ATLAS Offline Software
|
Templated class containing a cut, name of cut and description of cut(optional) Typically, the class will be templated on <xAOD::TruthParticle> or <xAOD::TrackParticle>. More...
#include <CutFlow.h>
Public Types | |
typedef A | value_type |
Utility typedefs to help callers: the value type. More... | |
typedef const std::function< bool(const A &)> | func_type |
Utility typedefs to help callers: the function type. More... | |
Public Member Functions | |
Accept () | |
Default constructor with a simple predicate returning false. More... | |
Accept (const std::function< bool(const A &)> &predicate, const std::string &name="", const std::string &description="") | |
Normal constructor. More... | |
bool | operator() (const A &i) const |
Overloading the () operator allows the class to be used as a functional. More... | |
bool | pass (const A &i) const |
Apply the predicate function and return the value, also updating an internal counter. More... | |
const std::string & | name () const |
Return cut name. More... | |
const std::string & | description () const |
Return cut description. More... | |
Private Attributes | |
func_type | m_predicate |
std::string | m_name |
std::string | m_desc |
Templated class containing a cut, name of cut and description of cut(optional) Typically, the class will be templated on <xAOD::TruthParticle> or <xAOD::TrackParticle>.
The cut is passed in as any predicate function, the type is declared as function<bool(A)> although typically these will be lambda functions. The cut is an 'accept' cut, i.e. the value passes if it is true. These predicate functions are called each time the 'pass' method is called. The class keeps an internal count of how many values passed, and may be used as a functional due to the overloaded () operator.
typedef A Accept< A >::value_type |
|
inline |
Normal constructor.
predicate | any function taking the templated value and returning a bool |
name | optional name for this cut |
description | optional description for this cut |