HepMC3 event record library: Selector Class Reference

HepMC3 event record library

Public Member Functions | Static Public Member Functions
Selector Class Referenceabstract

## Detailed Description

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 57 of file Selector.h.

`#include <Selector.h>`

Inheritance diagram for Selector:
[legend]

## Public Member Functions
virtual | ~Selector ()
| Destructor.
virtual Filter | operator> (int value) const =0
| Operator >.
virtual Filter | operator> (double value) const =0
| Operator >.
virtual Filter | operator>= (int value) const =0
| Operator >=.
virtual Filter | operator>= (double value) const =0
| Operator >=.
virtual Filter | operator< (int value) const =0
| Operator <.
virtual Filter | operator< (double value) const =0
| Operator <.
virtual Filter | operator<= (int value) const =0
| Operator <=.
virtual Filter | operator<= (double value) const =0
| Operator <=.
virtual Filter | operator== (int value) const =0
| Equality.
virtual Filter | operator== (double value) const =0
| Equality.
virtual Filter | operator!= (int value) const =0
| NonEquality.
virtual Filter | operator!= (double value) const =0
| NonEquality.
virtual ConstSelectorPtr | abs () const =0
| abs function

## Static Public Member Functions
static AttributeFeature | ATTRIBUTE (const std::string &name)
| ATTRIBUTE function.

## Constructor & Destructor Documentation

## ◆ ~Selector()

virtual ~Selector | ( |  | ) |
| inlinevirtual

Destructor.

Definition at line 60 of file Selector.h.

## Member Function Documentation

## ◆ abs()

virtual ConstSelectorPtr abs | ( |  | ) | const
| pure virtual

abs function

Implemented in SelectorWrapper< Feature_type >, SelectorWrapper< double >, and SelectorWrapper< int >.

## ◆ ATTRIBUTE()

AttributeFeature ATTRIBUTE | ( | const std::string & | name | ) |
| static

ATTRIBUTE function.

Definition at line 28 of file Selector.cc.

## ◆ operator!=() [1/2]

virtual Filter operator!= | ( | double | value | ) | const
| pure virtual

NonEquality.

Implemented in SelectorWrapper< Feature_type >.

## ◆ operator!=() [2/2]

virtual Filter operator!= | ( | int | value | ) | const
| pure virtual

NonEquality.

Implemented in SelectorWrapper< Feature_type >, SelectorWrapper< double >, and SelectorWrapper< int >.

## ◆ operator<() [1/2]

virtual Filter operator< | ( | double | value | ) | const
| pure virtual

Operator <.

Implemented in SelectorWrapper< Feature_type >.

## ◆ operator<() [2/2]

virtual Filter operator< | ( | int | value | ) | const
| pure virtual

Operator <.

Implemented in SelectorWrapper< Feature_type >, SelectorWrapper< double >, and SelectorWrapper< int >.

## ◆ operator<=() [1/2]

virtual Filter operator<= | ( | double | value | ) | const
| pure virtual

Operator <=.

Implemented in SelectorWrapper< Feature_type >.

## ◆ operator<=() [2/2]

virtual Filter operator<= | ( | int | value | ) | const
| pure virtual

Operator <=.

Implemented in SelectorWrapper< Feature_type >, SelectorWrapper< double >, and SelectorWrapper< int >.

## ◆ operator==() [1/2]

virtual Filter operator== | ( | double | value | ) | const
| pure virtual

Equality.

Implemented in SelectorWrapper< Feature_type >.

## ◆ operator==() [2/2]

virtual Filter operator== | ( | int | value | ) | const
| pure virtual

Equality.

Implemented in SelectorWrapper< Feature_type >, SelectorWrapper< double >, and SelectorWrapper< int >.

## ◆ operator>() [1/2]

virtual Filter operator> | ( | double | value | ) | const
| pure virtual

Operator >.

Implemented in SelectorWrapper< Feature_type >.

## ◆ operator>() [2/2]

virtual Filter operator> | ( | int | value | ) | const
| pure virtual

Operator >.

Implemented in SelectorWrapper< Feature_type >, SelectorWrapper< double >, and SelectorWrapper< int >.

## ◆ operator>=() [1/2]

virtual Filter operator>= | ( | double | value | ) | const
| pure virtual

Operator >=.

Implemented in SelectorWrapper< Feature_type >.

## ◆ operator>=() [2/2]

virtual Filter operator>= | ( | int | value | ) | const
| pure virtual

Operator >=.

Implemented in SelectorWrapper< Feature_type >, SelectorWrapper< double >, and SelectorWrapper< int >.

The documentation for this class was generated from the following files:

- Selector.h
- Selector.cc