HepMC3 event record library
|
Selector is an interface to "standard" Features that are valid for both integral and floating point comparisons. More...
#include <Selector.h>
Public Member Functions | |
virtual | ~Selector () |
Destructor. More... | |
virtual Filter | operator> (int value) const =0 |
virtual Filter | operator> (double value) const =0 |
virtual Filter | operator>= (int value) const =0 |
virtual Filter | operator>= (double value) const =0 |
virtual Filter | operator< (int value) const =0 |
virtual Filter | operator< (double value) const =0 |
virtual Filter | operator<= (int value) const =0 |
virtual Filter | operator<= (double value) const =0 |
virtual Filter | operator== (int value) const =0 |
Equality. More... | |
virtual Filter | operator== (double value) const =0 |
Equality. More... | |
virtual Filter | operator!= (int value) const =0 |
NonEquality. More... | |
virtual Filter | operator!= (double value) const =0 |
NonEquality. More... | |
virtual ConstSelectorPtr | abs () const =0 |
Static Public Member Functions | |
static AttributeFeature | ATTRIBUTE (const std::string &name) |
Selector is an interface to "standard" Features that are valid for both integral and floating point comparisons.
You would use this in preference to the more general Feature<> templated type. A Selector is constructed from a function to extract features from particles, e.g.
ConstSelectorPtr status = std::make_shared<SelectorWrapper<int> >([](ConstParticlePtr p)->int{return p->status();}); ConstSelectorPtr pt = std::make_shared<SelectorWrapper<double> >([](ConstParticlePtr p)->double{return p->momentum().pt();});
You can then use the Selector to construct Filter functions that evaluate on particles, e.g. Filter is_stable = (*status) == 1; bool stable = is_stable(p); bool beam = (*status == 4)(p);
StandardSelector contains a few standard Selectors already defined, e.g.
ConstGenParticlePtr p; (StandardSelector::STATUS == 1)(p); (StandardSelector::PT > 15.)(p); (abs(StandardSelector::RAPIDITY) < 2.5)(p);
you can also combined them e.g.
Filter myCuts = (StandardSelector::PT > 15.) && (*abs(StandardSelector::RAPIDITY) < 2.5) || (StandardSelector::PT > 100.); bool passCuts = myCuts(p);
Definition at line 55 of file Selector.h.
|
inlinevirtual |
Destructor.
Definition at line 59 of file Selector.h.
NonEquality.
Implemented in SelectorWrapper< T >, SelectorWrapper< double >, and SelectorWrapper< int >.
NonEquality.
Implemented in SelectorWrapper< T >, SelectorWrapper< double >, and SelectorWrapper< int >.
|
pure virtual |
Equality.
Implemented in SelectorWrapper< T >, SelectorWrapper< double >, and SelectorWrapper< int >.
|
pure virtual |
Equality.
Implemented in SelectorWrapper< T >, SelectorWrapper< double >, and SelectorWrapper< int >.