|
ATLAS Offline Software
|
Go to the documentation of this file.
10 #ifndef _IDPVM_CutFlow_h_
11 #define _IDPVM_CutFlow_h_
41 Accept(
const std::function<
bool(
const A&)>& predicate,
const std::string&
name =
"",
116 unsigned int missing_cuts =
m_cuts.size();
118 for (
auto& thisCut:
m_cuts) {
119 if (not thisCut.pass(
value)) {
129 unsigned int idx = 0;
132 throw std::logic_error(
"Number of cuts and counters do not match." );
134 unsigned int missing_cuts = 0;
136 for (
auto& thisCut:
m_cuts) {
137 if (!thisCut.pass(
value)) { ++missing_cuts; }
151 std::vector<std::string>
204 m_counter = std::move(a_cutflow.m_counter);
210 throw std::logic_error(
"Tried to merge non matching cut_flows.");
213 for(
unsigned int count : a_cutflow.m_counter) {
228 for(std::vector<unsigned int>::reverse_iterator iter =
m_counter.rbegin();
239 std::string modeString = (
m_accumulateIntegrated) ?
"\nAll cuts were applied\n" :
"\nCuts were applied until one fails\n";
245 throw std::logic_error(std::string(
"Number of cuts and counters do not match. Resulting report:\n") + op );
JetConstituentVector::iterator iterator
const std::string & name() const
Return cut name.
void merge(CutFlow &&a_cutflow)
unsigned int accept(const A &value) const
Apply cuts and return the boolean result; keep count of number of calls and passes.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
std::vector< unsigned int > m_counter
void add(const Accept< A > &newCut)
Add one cut.
std::vector< unsigned int > & counter()
Templated CutList class to contain a group of cuts.
CutFlow(unsigned int n_cuts, CutMode cut_mode=UNTIL_FAIL)
const std::vector< unsigned int > & counter() const
void update(unsigned int missing_cuts)
const std::function< bool(const A &)> func_type
Utility typedefs to help callers: the function type.
std::string report(const std::vector< std::string > &names)
Produce a formatted string report of the results.
const std::string & description() const
Return cut description.
Accept(const std::function< bool(const A &)> &predicate, const std::string &name="", const std::string &description="")
Normal constructor.
unsigned int size() const
Return the number of cuts.
bool operator()(const A &i) const
Overloading the () operator allows the class to be used as a functional.
std::string to_string(const DetectorType &type)
bool pass(const A &i) const
Apply the predicate function and return the value, also updating an internal counter.
A value_type
Utility typedefs to help callers: the value type.
bool m_accumulateIntegrated
CutList()
Default constructor with no cuts implemented.
CutList(const std::vector< Accept< A > > &cuts)
Normal constructor takes a vector<Accept>. Note default mode is 'ALL'.
Templated class containing a cut, name of cut and description of cut(optional) Typically,...
Accept()
Default constructor with a simple predicate returning false.
setBGCode setTAP setLVL2ErrorBits bool
std::vector< std::string > names() const
Return a vector of the cut names.
unsigned int testAllCuts(const A &value, std::vector< unsigned int > &counter) const
std::vector< Accept< A > > m_cuts