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

BaseCut Class Reference

#include <BaseCutBase.h>

Inheritance diagram for BaseCut:

Inheritance graph
[legend]
Collaboration diagram for BaseCut:

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstract base class for function objects doing cuts.

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

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

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

virtual IntFunInt () const
 Returns a IntFun 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

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

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

BaseCutoperator|| (const BaseCut &lhs_, const BaseCut &rhs_)
 "Or" of two BaseCut objects

BaseCutoperator! (const BaseCut &rhs_)
 Negation of a BaseCut.

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

IntFunInt (const BaseCut &arg)
 Returns a IntFun object made out of the BaseCut object.

BaseCutcached (const ROListPoR &rol, const BaseCutPoR &cut, const FillIteratorPoR &iter=0)
 Returns a cached version of a BaseCut.


Constructor & Destructor Documentation

BaseCut::BaseCut 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 BaseCutBase.h.

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

Constructor from a C++ string.

Parameters:
name_  The object's name

Definition at line 60 of file BaseCutBase.h.

BaseCut::BaseCut 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 BaseCutBase.h.


Member Function Documentation

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

Parameters:
name  The name

Reimplemented from NamedO.

Definition at line 87 of file BaseCutBase.h.

BaseCut* BaseCut::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 97 of file BaseCutBase.h.


Friends And Related Function Documentation

BaseCut & cached const ROListPoR rol,
const BaseCutPoR cut,
const FillIteratorPoR iter = 0
[related]
 

Returns a cached version of a BaseCut.

Parameters:
rol  Cached objects list where to register
cut  A BaseCut
iter  An optional iterator

Definition at line 170 of file BaseCut.C.

References getIterator(), BaseCutPoR::pbc, and FillIteratorPoR::pfi.


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