#include <IntFunBase.h>
Inheritance diagram for IntFun:
Classes derived from IntFun have to implement just the function operator(); this operator has to return a int for an event, which can be used as abscissa or weight value for a (self-filling) histogram entry.
IntFun objects are mainly used by self-filling histograms.
The destructor of IntFun is protected; therefore, IntFun objects cannot be created as automatic variables, only on the heap. This ensures that all IntFun 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 IntFun object.
Changelog:
Author: Benno List, Jenny Böhme
Definition at line 51 of file IntFunBase.h.
Public Member Functions | |
IntFun (const char *name_="?") | |
Constructor from a C style string, serves as default constructor. | |
IntFun (const std::string &name_) | |
Constructor from a C++ string. | |
IntFun (const std::string &name_, const std::string &definition_) | |
Constructor from two C++ strings. | |
virtual int | operator() () const=0 |
Returns a int value, typically from an ntuple row. | |
virtual FloatFun & | Float () const |
Returns a FloatFun 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 | |
IntFun * | getObject (const std::string &name) |
Access function that returns a pointer to an FloatFun object with this name. | |
IntFun * | getObject (const char *name) |
Access function that returns a pointer to an NamedO object with this name. | |
Protected Member Functions | |
virtual | ~IntFun () |
Protected destructor ensures creation on the heap. | |
Related Functions | |
(Note that these are not member functions.) | |
IntFun & | operator/ (int lhs_, const IntFun &rhs_) |
Scalar ratio of an IntFun. | |
IntFun & | operator+ (const IntFun &lhs_, const IntFun &rhs_) |
Sum of two IntFun objects. | |
IntFun & | operator+ (int lhs_, const IntFun &rhs_) |
Sum of a scalar and an IntFun object. | |
IntFun & | operator+ (const IntFun &lhs_, int rhs_) |
Sum of an IntFun object and a scalar. | |
IntFun & | operator- (const IntFun &lhs_, const IntFun &rhs_) |
Difference of two IntFun objects. | |
IntFun & | operator- (int lhs_, const IntFun &rhs_) |
Difference of a scalar and an IntFun object. | |
IntFun & | operator- (const IntFun &lhs_, int rhs_) |
Difference of an IntFun object and a scalar. | |
IntFun & | operator- (const IntFun &arg_) |
Unary minus of a IntFun. | |
IntFun & | operator+ (IntFun &arg_) |
Unary plus of a IntFun. | |
IntFun & | operator * (const IntFun &lhs_, const IntFun &rhs_) |
Product of two IntFun objects. | |
IntFun & | operator/ (const IntFun &lhs_, const IntFun &rhs_) |
Ratio of two IntFun objects. | |
IntFun & | operator * (int lhs_, const IntFun &rhs_) |
Scalar product of an IntFun. | |
IntFun & | operator * (const IntFun &lhs_, int rhs_) |
Scalar product of an IntFun. | |
IntFun & | operator/ (const IntFun &lhs_, int rhs_) |
Scalar ratio of an IntFun. | |
IntFun & | operator & (const IntFun &lhs_, const IntFun &rhs_) |
And of two IntFun objects. | |
IntFun & | operator| (const IntFun &lhs_, const IntFun &rhs_) |
Or of two IntFun objects. | |
IntFun & | operator^ (const IntFun &lhs_, const IntFun &rhs_) |
Xor of two IntFun objects. | |
IntFun & | operator & (const IntFun &lhs_, int rhs_) |
Bitwise And of an IntFun with a scalar. | |
IntFun & | operator & (int lhs_, const IntFun &rhs_) |
Bitwise And of an IntFun with a scalar. | |
IntFun & | operator| (const IntFun &lhs_, int rhs_) |
Bitwise Or of an IntFun with a scalar. | |
IntFun & | operator| (int lhs_, const IntFun &rhs_) |
Bitwise Or of an IntFun with a scalar. | |
IntFun & | operator^ (const IntFun &lhs_, int rhs_) |
Bitwise Xor of an IntFun with a scalar. | |
IntFun & | operator^ (int lhs_, const IntFun &rhs_) |
Bitwise Xor of an IntFun with a scalar. | |
IntFun & | operator~ (const IntFun &arg_) |
Bitwise Complement of an IntFun. | |
IntFun & | square (const IntFun &arg_) |
Square of a IntFun. | |
IntFun & | abs (const IntFun &arg_) |
Absolute value of a IntFun. | |
IntFunComp & | operator< (const IntFun &lhs_, const IntFun &rhs_) |
Comparison between two IntFun objects. | |
IntFunComp & | operator> (const IntFun &lhs_, const IntFun &rhs_) |
Comparison between two IntFun objects. | |
IntFunComp & | operator<= (const IntFun &lhs_, const IntFun &rhs_) |
Comparison between two IntFun objects. | |
IntFunComp & | operator>= (const IntFun &lhs_, const IntFun &rhs_) |
Comparison between two IntFun objects. | |
IntFunComp & | operator== (const IntFun &lhs_, const IntFun &rhs_) |
Comparison between two IntFun objects. | |
IntFunComp & | operator!= (const IntFun &lhs_, const IntFun &rhs_) |
Comparison between two IntFun objects. | |
IntFunComp & | operator< (int lhs_, const IntFun &rhs_) |
Comparison between a int and a IntFun. | |
IntFunComp & | operator<= (int lhs_, const IntFun &rhs_) |
Comparison between a int and a IntFun. | |
IntFunComp & | operator> (int lhs_, const IntFun &rhs_) |
Comparison between a int and a IntFun. | |
IntFunComp & | operator>= (int lhs_, const IntFun &rhs_) |
Comparison between a int and a IntFun. | |
IntFunComp & | operator== (int lhs_, const IntFun &rhs_) |
Comparison between a int and a IntFun. | |
IntFunComp & | operator!= (int lhs_, const IntFun &rhs_) |
Comparison between a int and a IntFun. | |
IntFunComp & | operator< (const IntFun &lhs_, int rhs_) |
Comparison between a IntFun and a int. | |
IntFunComp & | operator<= (const IntFun &lhs_, int rhs_) |
Comparison between a IntFun and a int. | |
IntFunComp & | operator> (const IntFun &lhs_, int rhs_) |
Comparison between a IntFun and a int. | |
IntFunComp & | operator>= (const IntFun &lhs_, int rhs_) |
Comparison between a IntFun and a int. | |
IntFunComp & | operator== (const IntFun &lhs_, int rhs_) |
Comparison between a IntFun and a int. | |
IntFunComp & | operator!= (const IntFun &lhs_, int rhs_) |
Comparison between a IntFun and a int. | |
IntFunComp & | operator< (const IntFunComp &lhs_, const IntFun &rhs_) |
Chained comparison, with a IntFun object at the right side. | |
IntFunComp & | operator<= (const IntFunComp &lhs_, const IntFun &rhs_) |
Chained comparison, with a IntFun object at the right side. | |
IntFunComp & | operator> (const IntFunComp &lhs_, const IntFun &rhs_) |
Chained comparison, with a IntFun object at the right side. | |
IntFunComp & | operator>= (const IntFunComp &lhs_, const IntFun &rhs_) |
Chained comparison, with a IntFun object at the right side. | |
IntFunComp & | operator== (const IntFunComp &lhs_, const IntFun &rhs_) |
Chained comparison, with a IntFun object at the right side. | |
IntFunComp & | operator!= (const IntFunComp &lhs_, const IntFun &rhs_) |
Chained comparison, with a IntFun object at the right side. | |
IntFunComp & | operator< (const IntFunComp &lhs_, int rhs_) |
Chained comparison, with a IntFun object at the right side. | |
IntFunComp & | operator<= (const IntFunComp &lhs_, int rhs_) |
Chained comparison, with a int at the right side. | |
IntFunComp & | operator> (const IntFunComp &lhs_, int rhs_) |
Chained comparison, with a int at the right side. | |
IntFunComp & | operator>= (const IntFunComp &lhs_, int rhs_) |
Chained comparison, with a int at the right side. | |
IntFunComp & | operator== (const IntFunComp &lhs_, int rhs_) |
Chained comparison, with a int at the right side. | |
IntFunComp & | operator!= (const IntFunComp &lhs_, int rhs_) |
Chained comparison, with a int at the right side. | |
IntFun & | max (const IntFunPoRConst &fun, const BaseCutPoRConst &cut=0, const FillIteratorPoR &intiter=0, const FillIteratorPoRConst &extiter=0) |
Returns the maximum of all values of fun if cut is fulfilled. | |
IntFun & | min (const IntFunPoRConst &fun, const BaseCutPoRConst &cut=0, const FillIteratorPoR &intiter=0, const FillIteratorPoRConst &extiter=0) |
Returns the minimum of all values of fun if cut is fulfilled. | |
IntFun & | sum (const IntFunPoRConst &fun, const BaseCutPoRConst &cut=0, const FillIteratorPoR &intiter=0, const FillIteratorPoRConst &extiter=0) |
Returns the sum of all values of fun if cut is fulfilled (if no fun is given, 1 is assumed). | |
IntFun & | count (const BaseCutPoRConst &cut=0, const FillIteratorPoR &intiter=0, const FillIteratorPoRConst &extiter=0) |
Returns the number of all values of fun if cut is fulfilled (if no fun is given, 1 is assumed). | |
FloatFun & | Float (const IntFun &arg) |
Returns a FloatFun object made out of the IntFun object. | |
IntFun & | cached (const ROListPoR &rol, const IntFunPoR &fun, const FillIteratorPoR &iter=0) |
Returns a cached version of a FloatFun. | |
IntFun & | poisson (const FloatFunPoR &rnd, double mean) |
Returns a Poisson distributed value from a random function. |
|
Constructor from a C style string, serves as default constructor.
Definition at line 55 of file IntFunBase.h. |
|
Constructor from a C++ string.
Definition at line 60 of file IntFunBase.h. |
|
Constructor from two C++ strings.
Definition at line 65 of file IntFunBase.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 IntFun!
Reimplemented from NamedO. Definition at line 85 of file IntFunBase.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 95 of file IntFunBase.h. |
|
Returns the maximum of all values of fun if cut is fulfilled.
|
|
Returns the minimum of all values of fun if cut is fulfilled.
|
|
Returns the sum of all values of fun if cut is fulfilled (if no fun is given, 1 is assumed).
|
|
Returns the number of all values of fun if cut is fulfilled (if no fun is given, 1 is assumed).
|
|
Returns a cached version of a FloatFun.
Definition at line 323 of file IntFun.C. References getIterator(), FillIteratorPoR::pfi, and IntFunPoR::pif. |
|
Returns a Poisson distributed value from a random function.
Definition at line 308 of file RandomFuns.C. |