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

FloatFun Class Reference

#include <FloatFunBase.h>

Inheritance diagram for FloatFun:

Inheritance graph
[legend]
Collaboration diagram for FloatFun:

Collaboration graph
[legend]
List of all members.

Detailed Description

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

Classes derived from FloatFun have to implement just the function operator(); this operator has to return a float for an event, which can be used as abscissa or weight value for a (self-filling) histogram entry.

FloatFun objects are mainly used by self-filling histograms.

The destructor of FloatFun is protected; therefore, FloatFun objects cannot be created as automatic variables, only on the heap. This ensures that all FloatFun 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.

Changelog:

Author: Benno List, Jenny Böhme

Date
2005/07/21 11:20:12
Author
blist

Definition at line 51 of file FloatFunBase.h.

Public Member Functions

 FloatFun (const char *name_="?")
 Constructor from a C style string, serves as default constructor.

 FloatFun (const std::string &name_)
 Constructor from a C++ string.

 FloatFun (const std::string &name_, const std::string &definition_)
 Constructor from two C++ strings.

virtual Float_FF operator() () const=0
 Returns a float value, typically from an ntuple row.

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

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

FloatFungetObject (const char *name)
 Access function that returns a pointer to an NamedO object with this name.


Protected Member Functions

virtual ~FloatFun ()
 Protected destructor ensures creation on the heap.


Related Functions

(Note that these are not member functions.)

FloatFunoperator+ (const FloatFun &lhs_, const FloatFun &rhs_)
 Sum of two FloatFun objects.

FloatFunoperator+ (const FloatFun &lhs_, Float_FF rhs_)
 Sum of a FloatFun object with a scalar.

FloatFunoperator+ (Float_FF lhs_, const FloatFun &rhs_)
 Sum of a FloatFun object with a scalar.

FloatFunoperator- (const FloatFun &lhs_, const FloatFun &rhs_)
 Difference of two FloatFun objects.

FloatFunoperator- (const FloatFun &lhs_, Float_FF rhs_)
 Difference of a FloatFun object with a scalar.

FloatFunoperator- (Float_FF lhs_, const FloatFun &rhs_)
 Sum of a FloatFun object with a scalar.

FloatFunoperator- (const FloatFun &arg_)
 Unary minus of a FloatFun.

FloatFunoperator+ (FloatFun &arg_)
 Unary plus of a FloatFun.

FloatFunoperator * (const FloatFun &lhs_, const FloatFun &rhs_)
 Product of two FloatFun objects.

FloatFunoperator * (Float_FF lhs_, const FloatFun &rhs_)
 Scalar product with a FloatFun.

FloatFunoperator * (const FloatFun &lhs_, Float_FF rhs_)
 Scalar product with a FloatFun.

FloatFunoperator/ (const FloatFun &lhs_, const FloatFun &rhs_)
 Quotient of two FloatFun objects.

FloatFunoperator/ (Float_FF lhs_, const FloatFun &rhs_)
 Division of a scalar by a FloatFun.

FloatFunoperator/ (const FloatFun &lhs_, Float_FF rhs_)
 Division of a FloatFun by a scalar.

FloatFunabs (const FloatFun &arg_)
 Absolute value of a FloatFun.

FloatFunacos (const FloatFun &arg_)
 Arc cosine of a FloatFun.

FloatFunasin (const FloatFun &arg_)
 Arc sine of a FloatFun.

FloatFunatan (const FloatFun &arg_)
 Arc Tangent of a FloatFun.

FloatFunatan2 (const FloatFun &arg1, const FloatFun &arg2)
 Arc tangent of two FloatFun objects: atan2(y, x)=atan(y/x).

FloatFunceil (const FloatFun &arg_)
 Ceiling of a FloatFun: smallest integral value not less than argument.

FloatFuncos (const FloatFun &arg_)
 Cosine of a FloatFun.

FloatFuncosh (const FloatFun &arg_)
 Hyperbolic Cosine of a FloatFun.

FloatFunexp (const FloatFun &arg_)
 Exponential function of a FloatFun.

FloatFunfabs (const FloatFun &arg_)
 Absolute value of a FloatFun.

FloatFunfloor (const FloatFun &arg_)
 Floor value of a FloatFun: largest integral value not greater than argument.

FloatFunlog (const FloatFun &arg_)
 Natural logarithm of a FloatFun.

FloatFunlog10 (const FloatFun &arg_)
 Decadic logarithm of a FloatFun.

FloatFunpow (const FloatFun &arg1_, const FloatFun &arg2_)
 Power of a FloatFun.

FloatFunsin (const FloatFun &arg_)
 Sine of a FloatFun.

FloatFunsinh (const FloatFun &arg_)
 Hyperbolic sine of a FloatFun.

FloatFuntanh (const FloatFun &arg_)
 Hyperbolic tangent of a FloatFun.

FloatFunsquare (const FloatFun &arg_)
 Suare of a FloatFun.

FloatFunrad (const FloatFun &arg_)
 Conversion from degrees to radians.

FloatFundeg (const FloatFun &arg_)
 Conversion from radians to degrees.

FloatFunCompoperator< (const FloatFun &lhs_, const FloatFun &rhs_)
 Comparison between two FloatFun objects.

FloatFunCompoperator> (const FloatFun &lhs_, const FloatFun &rhs_)
 Comparison between two FloatFun objects.

FloatFunCompoperator<= (const FloatFun &lhs_, const FloatFun &rhs_)
 Comparison between two FloatFun objects.

FloatFunCompoperator>= (const FloatFun &lhs_, const FloatFun &rhs_)
 Comparison between two FloatFun objects.

FloatFunCompoperator== (const FloatFun &lhs_, const FloatFun &rhs_)
 Comparison between two FloatFun objects.

FloatFunCompoperator!= (const FloatFun &lhs_, const FloatFun &rhs_)
 Comparison between two FloatFun objects.

FloatFunCompoperator< (Float_FF lhs_, const FloatFun &rhs_)
 Comparison between a Float_FF and a FloatFun.

FloatFunCompoperator<= (Float_FF lhs_, const FloatFun &rhs_)
 Comparison between a Float_FF and a FloatFun.

FloatFunCompoperator> (Float_FF lhs_, const FloatFun &rhs_)
 Comparison between a Float_FF and a FloatFun.

FloatFunCompoperator>= (Float_FF lhs_, const FloatFun &rhs_)
 Comparison between a Float_FF and a FloatFun.

FloatFunCompoperator== (Float_FF lhs_, const FloatFun &rhs_)
 Comparison between a Float_FF and a FloatFun.

FloatFunCompoperator!= (Float_FF lhs_, const FloatFun &rhs_)
 Comparison between a Float_FF and a FloatFun.

FloatFunCompoperator< (const FloatFun &lhs_, Float_FF rhs_)
 Comparison between a FloatFun and a Float_FF.

FloatFunCompoperator<= (const FloatFun &lhs_, Float_FF rhs_)
 Comparison between a FloatFun and a Float_FF.

FloatFunCompoperator> (const FloatFun &lhs_, Float_FF rhs_)
 Comparison between a FloatFun and a Float_FF.

FloatFunCompoperator>= (const FloatFun &lhs_, Float_FF rhs_)
 Comparison between a FloatFun and a Float_FF.

FloatFunCompoperator== (const FloatFun &lhs_, Float_FF rhs_)
 Comparison between a FloatFun and a Float_FF.

FloatFunCompoperator!= (const FloatFun &lhs_, Float_FF rhs_)
 Comparison between a FloatFun and a Float_FF.

FloatFunCompoperator< (const FloatFunComp &lhs_, const FloatFun &rhs_)
 Chained comparison, with a FloatFun object at the right side.

FloatFunCompoperator<= (const FloatFunComp &lhs_, const FloatFun &rhs_)
 Chained comparison, with a FloatFun object at the right side.

FloatFunCompoperator> (const FloatFunComp &lhs_, const FloatFun &rhs_)
 Chained comparison, with a FloatFun object at the right side.

FloatFunCompoperator>= (const FloatFunComp &lhs_, const FloatFun &rhs_)
 Chained comparison, with a FloatFun object at the right side.

FloatFunCompoperator== (const FloatFunComp &lhs_, const FloatFun &rhs_)
 Chained comparison, with a FloatFun object at the right side.

FloatFunCompoperator!= (const FloatFunComp &lhs_, const FloatFun &rhs_)
 Chained comparison, with a FloatFun object at the right side.

FloatFunCompoperator< (const FloatFunComp &lhs_, Float_FF rhs_)
 Chained comparison, with a FloatFun object at the right side.

FloatFunCompoperator<= (const FloatFunComp &lhs_, Float_FF rhs_)
 Chained comparison, with a Float_FF at the right side.

FloatFunCompoperator> (const FloatFunComp &lhs_, Float_FF rhs_)
 Chained comparison, with a Float_FF at the right side.

FloatFunCompoperator>= (const FloatFunComp &lhs_, Float_FF rhs_)
 Chained comparison, with a Float_FF at the right side.

FloatFunCompoperator== (const FloatFunComp &lhs_, Float_FF rhs_)
 Chained comparison, with a Float_FF at the right side.

FloatFunCompoperator!= (const FloatFunComp &lhs_, Float_FF rhs_)
 Chained comparison, with a Float_FF at the right side.

FloatFunmax (const FloatFunPoRConst &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.

FloatFunmin (const FloatFunPoRConst &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.

FloatFunsum (const FloatFunPoRConst &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).

FloatFunaverage (const FloatFunPoRConst &fun, const BaseCutPoRConst &cut=0, const FillIteratorPoR &intiter=0, const FillIteratorPoRConst &extiter=0)
 Returns the average of all values of fun if cut is fulfilled.

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

FloatFungauss (const FloatFunPoR &rnd, double mean, double sigma)
 Returns a Gaussian distributed value from a random function.


Constructor & Destructor Documentation

FloatFun::FloatFun 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 FloatFunBase.h.

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

Constructor from a C++ string.

Parameters:
name_  The object's name

Definition at line 59 of file FloatFunBase.h.

FloatFun::FloatFun 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 63 of file FloatFunBase.h.


Member Function Documentation

FloatFun* FloatFun::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 FloatFun!

Parameters:
name  The name

Reimplemented from NamedO.

Definition at line 80 of file FloatFunBase.h.

FloatFun* FloatFun::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 90 of file FloatFunBase.h.


Friends And Related Function Documentation

FloatFun & max const FloatFunPoRConst 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 FloatFun
cut  An optional cut
intiter  An optional iterator over which to loop
extiter  An optional external iterator

Definition at line 648 of file FloatFun.C.

FloatFun & min const FloatFunPoRConst 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 FloatFun
cut  An optional cut
intiter  An optional iterator over which to loop
extiter  An optional external iterator

Definition at line 656 of file FloatFun.C.

FloatFun & sum const FloatFunPoRConst 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 FloatFun
cut  An optional cut
intiter  An optional iterator over which to loop
extiter  An optional external iterator

Definition at line 664 of file FloatFun.C.

FloatFun & average const FloatFunPoRConst fun,
const BaseCutPoRConst cut = 0,
const FillIteratorPoR intiter = 0,
const FillIteratorPoRConst extiter = 0
[related]
 

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

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

Definition at line 672 of file FloatFun.C.

FloatFun & cached const ROListPoR rol,
const FloatFunPoR fun,
const FillIteratorPoR iter = 0
[related]
 

Returns a cached version of a FloatFun.

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

Definition at line 444 of file FloatFun.C.

References getIterator(), FloatFunPoR::pff, and FillIteratorPoR::pfi.

FloatFun & gauss const FloatFunPoR rnd,
double  mean,
double  sigma
[related]
 

Returns a Gaussian distributed value from a random function.

Parameters:
rnd  A random function
mean  The mean value
sigma  The sigma value

Definition at line 302 of file RandomFuns.C.

References FloatFunPoR::pff.


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