5 |
|
sw_.Start (); |
6 |
|
string cutFlowName = "cutFlow", |
7 |
|
selectionName = "selection", |
8 |
< |
rejectionName = "rejection"; |
8 |
> |
minusOneName = "minusOne"; |
9 |
|
|
10 |
|
prefix_ = prefix; |
11 |
|
if (prefix_ != "") |
12 |
|
{ |
13 |
|
cutFlowName = prefix_ + "CutFlow"; |
14 |
|
selectionName = prefix_ + "Selection"; |
15 |
< |
rejectionName = prefix_ + "Rejection"; |
15 |
> |
minusOneName = prefix_ + "MinusOne"; |
16 |
|
} |
17 |
|
|
18 |
|
TH1::SetDefaultSumw2 (); |
19 |
|
cutFlow_ = fs->make<TH1D> (cutFlowName.c_str (), "", 1, 0.0, 1.0); |
20 |
|
selection_ = fs->make<TH1D> (selectionName.c_str (), "", 1, 0.0, 1.0); |
21 |
< |
rejection_ = fs->make<TH1D> (rejectionName.c_str (), "", 1, 0.0, 1.0); |
21 |
> |
minusOne_ = fs->make<TH1D> (minusOneName.c_str (), "", 1, 0.0, 1.0); |
22 |
|
|
23 |
|
cutFlow_->GetXaxis ()->SetBinLabel (1, "Total"); |
24 |
|
selection_->GetXaxis ()->SetBinLabel (1, "Total"); |
25 |
< |
rejection_->GetXaxis ()->SetBinLabel (1, "Total"); |
25 |
> |
minusOne_->GetXaxis ()->SetBinLabel (1, "Total"); |
26 |
|
} |
27 |
|
|
28 |
|
CutFlow::~CutFlow () |
42 |
|
|
43 |
|
cutFlow_->SetBins (cutNames_.size () + 1, 0.0, cutNames_.size () + 1.0); |
44 |
|
selection_->SetBins (cutNames_.size () + 1, 0.0, cutNames_.size () + 1.0); |
45 |
< |
rejection_->SetBins (cutNames_.size () + 1, 0.0, cutNames_.size () + 1.0); |
45 |
> |
minusOne_->SetBins (cutNames_.size () + 1, 0.0, cutNames_.size () + 1.0); |
46 |
|
|
47 |
|
cutFlow_->GetXaxis ()->SetBinLabel (cutNames_.size () + 1, cutName.c_str ()); |
48 |
|
selection_->GetXaxis ()->SetBinLabel (cutNames_.size () + 1, cutName.c_str ()); |
49 |
< |
rejection_->GetXaxis ()->SetBinLabel (cutNames_.size () + 1, cutName.c_str ()); |
49 |
> |
minusOne_->GetXaxis ()->SetBinLabel (cutNames_.size () + 1, cutName.c_str ()); |
50 |
|
} |
51 |
|
|
52 |
|
return cuts_[cutName]; |
85 |
|
{ |
86 |
|
fillCumulative = false; |
87 |
|
if (complement < 0.0) |
88 |
< |
complement = rejection_->GetBinCenter (cut - cutNames_.begin () + 2); |
88 |
> |
complement = minusOne_->GetBinCenter (cut - cutNames_.begin () + 2); |
89 |
|
else |
90 |
|
fillComplement = false; |
91 |
|
} |
92 |
|
} |
93 |
|
if (fillCumulative) |
94 |
|
{ |
95 |
< |
rejection_->Fill (0.5, w); |
95 |
> |
minusOne_->Fill (0.5, w); |
96 |
|
for (vector<string>::const_iterator cut = cutNames_.begin (); cut != cutNames_.end (); cut++) |
97 |
|
{ |
98 |
< |
double binCenter = rejection_->GetBinCenter (cut - cutNames_.begin () + 2); |
98 |
> |
double binCenter = minusOne_->GetBinCenter (cut - cutNames_.begin () + 2); |
99 |
|
|
100 |
< |
rejection_->Fill (binCenter, w); |
100 |
> |
minusOne_->Fill (binCenter, w); |
101 |
|
} |
102 |
|
} |
103 |
|
if (!fillCumulative && fillComplement) |
104 |
< |
rejection_->Fill (complement, w); |
104 |
> |
minusOne_->Fill (complement, w); |
105 |
|
} |
106 |
|
|
107 |
|
void |
170 |
|
} |
171 |
|
|
172 |
|
clog << setw (80) << setfill ('-') << '-' << setfill (' ') << endl; |
173 |
< |
clog << setw (15) << left << "Cut Name" << right << setw (16) << "Events" << setw (16) << "Cumulative Eff." << setw (16) << "Individual Eff." << setw (16) << "Rejection" << endl; |
173 |
> |
clog << setw (15) << left << "Cut Name" << right << setw (16) << "Events" << setw (16) << "Cumulative Eff." << setw (16) << "Individual Eff." << setw (16) << "Minus One" << endl; |
174 |
|
clog << setw (80) << setfill ('-') << '-' << setfill (' ') << endl; |
175 |
|
totalEvents = cutFlow_->GetBinContent (1); |
176 |
|
clog << setw (15) << left << "Total:" << right << setw (16) << totalEvents << setw (16) << "100%" << setw (16) << "100%" << setw (16) << "0%" << endl; |
178 |
|
{ |
179 |
|
double cutFlow = cutFlow_->GetBinContent (cut - cutNames_.begin () + 2), |
180 |
|
selection = selection_->GetBinContent (cut - cutNames_.begin () + 2), |
181 |
< |
rejection = rejection_->GetBinContent (cut - cutNames_.begin () + 2); |
181 |
> |
minusOne = minusOne_->GetBinContent (cut - cutNames_.begin () + 2); |
182 |
|
|
183 |
|
clog << setw (15) << left << (*cut + ":") << right << setw (16) << cutFlow << setw (15) << 100.0 * (cutFlow / (double) totalEvents) << "%" |
184 |
|
<< setw (15) << 100.0 * (selection / (double) totalEvents) << "%" |
185 |
< |
<< setw (15) << 100.0 * (rejection / (double) totalEvents) << "%" << endl; |
185 |
> |
<< setw (15) << 100.0 * (minusOne / (double) totalEvents) << "%" << endl; |
186 |
|
} |
187 |
|
clog << setw (80) << setfill ('-') << '-' << setfill (' ') << endl; |
188 |
|
} |