Cutflow Struct Reference A tracker of numbers & fractions of events passing sequential cuts. More...
Detailed DescriptionA tracker of numbers & fractions of events passing sequential cuts. Definition at line 10 of file Cutflow.hh. Constructor & Destructor Documentation
Default constructor. Does nothing! Just to allow storage in STL containers and use as a member variable without using the init list Definition at line 15 of file Cutflow.hh. {}
Member Function Documentation
Fill the {icut}'th post-cut counter.
Definition at line 30 of file Cutflow.hh. { if (cutresult) counts[icut+1] += 1; return cutresult; }
Fill all cut-state counters from an Ncut-element results vector. This function is to be used to fill all of an event's pre- and post-cut state counters at once, including the incoming event counter. It must not be mixed with calls to the
Definition at line 43 of file Cutflow.hh.
Fill the N trailing post-cut counters, when supplied with an N-element results vector. The cutresults vector represents the boolean results of the last N cuts. This function allows mixing of cut-flow filling with higher-level analyze() function escapes such as the vetoEvent directive. The initial state (state 0) is not incremented.
Definition at line 60 of file Cutflow.hh. { if (cutresults.size() > ncuts) throw RangeError("Number of filled cut results needs to match the Cutflow construction"); const size_t offset = counts.size() - cutresults.size(); for (size_t i = 0; i < cutresults.size(); ++i) { if (cutresults[i]) counts[offset+i] += 1; else break; } return all(cutresults); }
Print string representation to a stream. Definition at line 89 of file Cutflow.hh. { os << str() << flush; }
Create a string representation. Definition at line 71 of file Cutflow.hh. { stringstream ss; ss << name << " cut-flow:"; size_t maxlen = 0; for (const string& t : cuts) maxlen = max(t.length(), maxlen); for (size_t i = 0; i <= ncuts; ++i) { const int pcttot = (counts[0] == 0) ? -1 : int(100*counts[i]/double(counts[0])); const int pctinc = (i == 0 || counts[i-1] == 0) ? -1 : int(100*counts[i]/double(counts[i-1])); ss << "\n" << setw(maxlen+5) << left << (i == 0 ? "" : "Pass "+cuts[i-1]) << " " << right << setw(toString(counts[0]).length()) << toString(counts[i]) << " " << setw(4) << (pcttot < 0 ? "- " : toString(pcttot)+"%") << " " << setw(4) << (pctinc < 0 ? "- " : toString(pctinc)+"%"); } return ss.str(); } Member Data Documentation
Definition at line 96 of file Cutflow.hh.
Definition at line 95 of file Cutflow.hh.
Definition at line 93 of file Cutflow.hh.
Definition at line 94 of file Cutflow.hh. The documentation for this struct was generated from the following file: Generated on Tue Dec 13 2016 16:32:51 for The Rivet MC analysis system by ![]() |