#include <BaseCutBase.h>
Inheritance diagram for BaseCut:
Cut objects derived from BaseCut have to implement just the function operator(); this operator has to return a bool that indicates whether an event passes the cut or not.
Cut objects are mainly used by self-filling histograms.
The destructor of BaseCut is protected; therefore, BaseCut objects cannot be created as automatic variables, only on the heap. This ensures that all BaseCut objects live until the end of the program run, otherwise it would be very hard to ensure that a self-filling histogram, which stores only a pointer to a cut object, does not try to access a cut object that has already been destroyed. Purists can use the "destroy" method to delete a FloatFun object.
Cut objects can be combined with the usual logical operators !, &&, ||
Changelog:
Author: Benno List, Jenny Boehme
Definition at line 51 of file BaseCutBase.h.
Public Member Functions | |
BaseCut (const char *name_="?") | |
Constructor from a C style string, serves as default constructor. | |
BaseCut (const std::string &name_) | |
Constructor from a C++ string. | |
BaseCut (const std::string &name_, const std::string &definition_) | |
Constructor from two C++ strings. | |
virtual bool | operator() () const=0 |
Returns a bool value, typically the result of a cut on ntuple data. | |
virtual FloatFun & | Float () const |
Returns a FloatFun object. | |
virtual IntFun & | Int () const |
Returns a IntFun object. | |
virtual void | destroy () |
Replaces delete, which cannot be called because of protected destructor. | |
virtual const FillIterator * | getIterator () const |
Returns pointer to iterator, if any. | |
Static Public Member Functions | |
BaseCut * | getObject (const std::string &name) |
Access function that returns a pointer to an FloatFun object with this name. | |
BaseCut * | getObject (const char *name) |
Access function that returns a pointer to an NamedO object with this name. | |
Protected Member Functions | |
virtual | ~BaseCut () |
Protected destructor ensures creation on the heap. | |
Related Functions | |
(Note that these are not member functions.) | |
BaseCut & | operator|| (const BaseCut &lhs_, const BaseCut &rhs_) |
"Or" of two BaseCut objects | |
BaseCut & | operator! (const BaseCut &rhs_) |
Negation of a BaseCut. | |
FloatFun & | Float (const BaseCut &arg) |
Returns a FloatFun object made out of the BaseCut object. | |
IntFun & | Int (const BaseCut &arg) |
Returns a IntFun object made out of the BaseCut object. | |
BaseCut & | cached (const ROListPoR &rol, const BaseCutPoR &cut, const FillIteratorPoR &iter=0) |
Returns a cached version of a BaseCut. |
|
Constructor from a C style string, serves as default constructor.
Definition at line 55 of file BaseCutBase.h. |
|
Constructor from a C++ string.
Definition at line 60 of file BaseCutBase.h. |
|
Constructor from two C++ strings.
Definition at line 65 of file BaseCutBase.h. |
|
Access function that returns a pointer to an FloatFun object with this name. This access function must never be called within the constructor of any class that is derived from BaseCut!
Reimplemented from NamedO. Definition at line 87 of file BaseCutBase.h. |
|
Access function that returns a pointer to an NamedO object with this name. This access function must never be called within the constructor of any class that is derived from NamedO!
Reimplemented from NamedO. Definition at line 97 of file BaseCutBase.h. |
|
Returns a cached version of a BaseCut.
Definition at line 170 of file BaseCut.C. References getIterator(), BaseCutPoR::pbc, and FillIteratorPoR::pfi. |