Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

IntFun Class Reference

#include <IntFunBase.h>

Inheritance diagram for IntFun:

Inheritance graph
[legend]
Collaboration diagram for IntFun:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class for objects that return a int number for each event.

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

Date
2005/06/06 15:01:42
Author
blist

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 FloatFunFloat () const
 Returns a FloatFun object.

virtual void destroy ()
 Replaces delete, which cannot be called because of protected destructor.

virtual const FillIteratorgetIterator () const
 Returns pointer to iterator, if any.


Static Public Member Functions

IntFungetObject (const std::string &name)
 Access function that returns a pointer to an FloatFun object with this name.

IntFungetObject (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.)

IntFunoperator/ (int lhs_, const IntFun &rhs_)
 Scalar ratio of an IntFun.

IntFunoperator+ (const IntFun &lhs_, const IntFun &rhs_)
 Sum of two IntFun objects.

IntFunoperator+ (int lhs_, const IntFun &rhs_)
 Sum of a scalar and an IntFun object.

IntFunoperator+ (const IntFun &lhs_, int rhs_)
 Sum of an IntFun object and a scalar.

IntFunoperator- (const IntFun &lhs_, const IntFun &rhs_)
 Difference of two IntFun objects.

IntFunoperator- (int lhs_, const IntFun &rhs_)
 Difference of a scalar and an IntFun object.

IntFunoperator- (const IntFun &lhs_, int rhs_)
 Difference of an IntFun object and a scalar.

IntFunoperator- (const IntFun &arg_)
 Unary minus of a IntFun.

IntFunoperator+ (IntFun &arg_)
 Unary plus of a IntFun.

IntFunoperator * (const IntFun &lhs_, const IntFun &rhs_)
 Product of two IntFun objects.

IntFunoperator/ (const IntFun &lhs_, const IntFun &rhs_)
 Ratio of two IntFun objects.

IntFunoperator * (int lhs_, const IntFun &rhs_)
 Scalar product of an IntFun.

IntFunoperator * (const IntFun &lhs_, int rhs_)
 Scalar product of an IntFun.

IntFunoperator/ (const IntFun &lhs_, int rhs_)
 Scalar ratio of an IntFun.

IntFunoperator & (const IntFun &lhs_, const IntFun &rhs_)
 And of two IntFun objects.

IntFunoperator| (const IntFun &lhs_, const IntFun &rhs_)
 Or of two IntFun objects.

IntFunoperator^ (const IntFun &lhs_, const IntFun &rhs_)
 Xor of two IntFun objects.

IntFunoperator & (const IntFun &lhs_, int rhs_)
 Bitwise And of an IntFun with a scalar.

IntFunoperator & (int lhs_, const IntFun &rhs_)
 Bitwise And of an IntFun with a scalar.

IntFunoperator| (const IntFun &lhs_, int rhs_)
 Bitwise Or of an IntFun with a scalar.

IntFunoperator| (int lhs_, const IntFun &rhs_)
 Bitwise Or of an IntFun with a scalar.

IntFunoperator^ (const IntFun &lhs_, int rhs_)
 Bitwise Xor of an IntFun with a scalar.

IntFunoperator^ (int lhs_, const IntFun &rhs_)
 Bitwise Xor of an IntFun with a scalar.

IntFunoperator~ (const IntFun &arg_)
 Bitwise Complement of an IntFun.

IntFunsquare (const IntFun &arg_)
 Square of a IntFun.

IntFunabs (const IntFun &arg_)
 Absolute value of a IntFun.

IntFunCompoperator< (const IntFun &lhs_, const IntFun &rhs_)
 Comparison between two IntFun objects.

IntFunCompoperator> (const IntFun &lhs_, const IntFun &rhs_)
 Comparison between two IntFun objects.

IntFunCompoperator<= (const IntFun &lhs_, const IntFun &rhs_)
 Comparison between two IntFun objects.

IntFunCompoperator>= (const IntFun &lhs_, const IntFun &rhs_)
 Comparison between two IntFun objects.

IntFunCompoperator== (const IntFun &lhs_, const IntFun &rhs_)
 Comparison between two IntFun objects.

IntFunCompoperator!= (const IntFun &lhs_, const IntFun &rhs_)
 Comparison between two IntFun objects.

IntFunCompoperator< (int lhs_, const IntFun &rhs_)
 Comparison between a int and a IntFun.

IntFunCompoperator<= (int lhs_, const IntFun &rhs_)
 Comparison between a int and a IntFun.

IntFunCompoperator> (int lhs_, const IntFun &rhs_)
 Comparison between a int and a IntFun.

IntFunCompoperator>= (int lhs_, const IntFun &rhs_)
 Comparison between a int and a IntFun.

IntFunCompoperator== (int lhs_, const IntFun &rhs_)
 Comparison between a int and a IntFun.

IntFunCompoperator!= (int lhs_, const IntFun &rhs_)
 Comparison between a int and a IntFun.

IntFunCompoperator< (const IntFun &lhs_, int rhs_)
 Comparison between a IntFun and a int.

IntFunCompoperator<= (const IntFun &lhs_, int rhs_)
 Comparison between a IntFun and a int.

IntFunCompoperator> (const IntFun &lhs_, int rhs_)
 Comparison between a IntFun and a int.

IntFunCompoperator>= (const IntFun &lhs_, int rhs_)
 Comparison between a IntFun and a int.

IntFunCompoperator== (const IntFun &lhs_, int rhs_)
 Comparison between a IntFun and a int.

IntFunCompoperator!= (const IntFun &lhs_, int rhs_)
 Comparison between a IntFun and a int.

IntFunCompoperator< (const IntFunComp &lhs_, const IntFun &rhs_)
 Chained comparison, with a IntFun object at the right side.

IntFunCompoperator<= (const IntFunComp &lhs_, const IntFun &rhs_)
 Chained comparison, with a IntFun object at the right side.

IntFunCompoperator> (const IntFunComp &lhs_, const IntFun &rhs_)
 Chained comparison, with a IntFun object at the right side.

IntFunCompoperator>= (const IntFunComp &lhs_, const IntFun &rhs_)
 Chained comparison, with a IntFun object at the right side.

IntFunCompoperator== (const IntFunComp &lhs_, const IntFun &rhs_)
 Chained comparison, with a IntFun object at the right side.

IntFunCompoperator!= (const IntFunComp &lhs_, const IntFun &rhs_)
 Chained comparison, with a IntFun object at the right side.

IntFunCompoperator< (const IntFunComp &lhs_, int rhs_)
 Chained comparison, with a IntFun object at the right side.

IntFunCompoperator<= (const IntFunComp &lhs_, int rhs_)
 Chained comparison, with a int at the right side.

IntFunCompoperator> (const IntFunComp &lhs_, int rhs_)
 Chained comparison, with a int at the right side.

IntFunCompoperator>= (const IntFunComp &lhs_, int rhs_)
 Chained comparison, with a int at the right side.

IntFunCompoperator== (const IntFunComp &lhs_, int rhs_)
 Chained comparison, with a int at the right side.

IntFunCompoperator!= (const IntFunComp &lhs_, int rhs_)
 Chained comparison, with a int at the right side.

IntFunmax (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.

IntFunmin (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.

IntFunsum (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).

IntFuncount (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).

FloatFunFloat (const IntFun &arg)
 Returns a FloatFun object made out of the IntFun object.

IntFuncached (const ROListPoR &rol, const IntFunPoR &fun, const FillIteratorPoR &iter=0)
 Returns a cached version of a FloatFun.

IntFunpoisson (const FloatFunPoR &rnd, double mean)
 Returns a Poisson distributed value from a random function.


Constructor & Destructor Documentation

IntFun::IntFun const char *  name_ = "?"  )  [inline, explicit]
 

Constructor from a C style string, serves as default constructor.

Parameters:
name_  The object's name

Definition at line 55 of file IntFunBase.h.

IntFun::IntFun const std::string &  name_  )  [inline, explicit]
 

Constructor from a C++ string.

Parameters:
name_  The object's name

Definition at line 60 of file IntFunBase.h.

IntFun::IntFun const std::string &  name_,
const std::string &  definition_
[inline]
 

Constructor from two C++ strings.

Parameters:
name_  The object's name
definition_  The object's definition

Definition at line 65 of file IntFunBase.h.


Member Function Documentation

IntFun* IntFun::getObject const std::string &  name  )  [inline, static]
 

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!

Parameters:
name  The name

Reimplemented from NamedO.

Definition at line 85 of file IntFunBase.h.

IntFun* IntFun::getObject const char *  name  )  [inline, static]
 

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!

Parameters:
name  The name

Reimplemented from NamedO.

Definition at line 95 of file IntFunBase.h.


Friends And Related Function Documentation

IntFun & max const IntFunPoRConst fun,
const BaseCutPoRConst cut = 0,
const FillIteratorPoR intiter = 0,
const FillIteratorPoRConst extiter = 0
[related]
 

Returns the maximum of all values of fun if cut is fulfilled.

Parameters:
fun  An optional IntFun
cut  An optional cut
intiter  An optional iterator over which to loop
extiter  An optional external iterator

Definition at line 580 of file IntFun.C.

IntFun & min const IntFunPoRConst fun,
const BaseCutPoRConst cut = 0,
const FillIteratorPoR intiter = 0,
const FillIteratorPoRConst extiter = 0
[related]
 

Returns the minimum of all values of fun if cut is fulfilled.

Parameters:
fun  An optional IntFun
cut  An optional cut
intiter  An optional iterator over which to loop
extiter  An optional external iterator

Definition at line 588 of file IntFun.C.

IntFun & sum const IntFunPoRConst fun,
const BaseCutPoRConst cut = 0,
const FillIteratorPoR intiter = 0,
const FillIteratorPoRConst extiter = 0
[related]
 

Returns the sum of all values of fun if cut is fulfilled (if no fun is given, 1 is assumed).

Parameters:
fun  An optional IntFun
cut  An optional cut
intiter  An optional iterator over which to loop
extiter  An optional external iterator

Definition at line 596 of file IntFun.C.

IntFun & count const BaseCutPoRConst cut = 0,
const FillIteratorPoR intiter = 0,
const FillIteratorPoRConst extiter = 0
[related]
 

Returns the number of all values of fun if cut is fulfilled (if no fun is given, 1 is assumed).

Parameters:
cut  An optional cut
intiter  An optional iterator over which to loop
extiter  An optional external iterator

Definition at line 604 of file IntFun.C.

IntFun & cached const ROListPoR rol,
const IntFunPoR fun,
const FillIteratorPoR iter = 0
[related]
 

Returns a cached version of a FloatFun.

Parameters:
rol  Cached objects list where to register
fun  An IntFun
iter  An optional iterator

Definition at line 323 of file IntFun.C.

References getIterator(), FillIteratorPoR::pfi, and IntFunPoR::pif.

IntFun & poisson const FloatFunPoR rnd,
double  mean
[related]
 

Returns a Poisson distributed value from a random function.

Parameters:
rnd  A random function
mean  The mean value

Definition at line 308 of file RandomFuns.C.


The documentation for this class was generated from the following files:
Generated on Thu Oct 26 12:54:39 2006 for SFH by doxygen 1.3.2