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

CutBinning Class Reference

#include <CutBinning.h>

Inheritance diagram for CutBinning:

Inheritance graph
[legend]
Collaboration diagram for CutBinning:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class that generates a non-exclusive binning from an array of cuts.

The purpose of a CutBinning is to sort histogram entries into non-exclusive bins. An array of pointers to BaseCut objects is used to create the CutBinning object. The CutBinning object can then be used as BinningFun for a SFSetOfHistos or SFMatrixOfHistos to show how a quantity evolves when different cuts are applied.

Author: Benno List, Jenny List

Date
2005/07/20 10:51:32
Author
blist

Changelog:

Definition at line 46 of file CutBinning.h.

Public Member Functions

 CutBinning (int nbins, const BaseCut *cuts[], const char *name=0)
 Create a CutBinning from an array of pointers to cuts.

 CutBinning (int nbins, BaseCut *cuts[], const char *name=0)
 Create a CutBinning from an array of pointers to cuts.

 CutBinning (int nbins, const BaseCut *cuts[], const char *titles[], const char *name=0)
 Create a CutBinning from an array of pointers to cuts.

 CutBinning (int nbins, BaseCut *cuts[], const char *titles[], const char *name=0)
 Create a CutBinning from an array of pointers to cuts.

virtual int operator() () const
 Returns a bin number between -1 and getNBins()-1.

virtual bool operator() (int i) const
 Returns whether an event belongs to bin i.

virtual bool isExclusive () const
 Returns whether a CutBinning is exclusive.

virtual const char * getBinName (int i) const
 returns a name string.

virtual const char * getBinTitle (int i) const
 returns a title string.

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

virtual int getMaxBins () const
 Gets the maximal return value of operator() plus 1, or the higest "sensible" value for a bin number.

virtual bool hasBinLabels () const
 Returns whether the bins have alphanumeric bin labels.

virtual const char * getBinLabel (int i) const
 Returns the bin label (string must not be deleted by user!).


Protected Member Functions

virtual ~CutBinning ()
 Protected destructor to ensure creation on the heap.

void genDefinition ()
 Generates a definition string and sets the definition to it.

void checkIterators ()
 Makes sure all cuts depend on the same (or no) iterator.


Private Attributes

std::vector< const BaseCut * > theCuts
std::vector< std::string > binNames
std::vector< std::string > binTitles
const FillIteratortheFillIterator


Constructor & Destructor Documentation

CutBinning::CutBinning int  nbins,
const BaseCut cuts[],
const char *  name = 0
 

Create a CutBinning from an array of pointers to cuts.

Parameters:
nbins  The number of bins
cuts  The cuts
name  The object name

Definition at line 31 of file CutBinning.C.

References genDefinition(), and NamedO::str().

CutBinning::CutBinning int  nbins,
BaseCut cuts[],
const char *  name = 0
 

Create a CutBinning from an array of pointers to cuts.

Parameters:
nbins  The number of bins
cuts  The cuts
name  The object name

Definition at line 45 of file CutBinning.C.

References genDefinition(), and NamedO::str().

CutBinning::CutBinning int  nbins,
const BaseCut cuts[],
const char *  titles[],
const char *  name = 0
 

Create a CutBinning from an array of pointers to cuts.

Parameters:
nbins  The number of bins
cuts  The cuts
titles  The title strings
name  The object name

Definition at line 59 of file CutBinning.C.

References genDefinition(), and NamedO::str().

CutBinning::CutBinning int  nbins,
BaseCut cuts[],
const char *  titles[],
const char *  name = 0
 

Create a CutBinning from an array of pointers to cuts.

Parameters:
nbins  The number of bins
cuts  The cuts
titles  The title strings
name  The object name

Definition at line 73 of file CutBinning.C.

References genDefinition(), and NamedO::str().


Member Function Documentation

bool CutBinning::operator() int  i  )  const [virtual]
 

Returns whether an event belongs to bin i.

Parameters:
i  The bin number

Reimplemented from BinningFun.

Definition at line 88 of file CutBinning.C.

const char * CutBinning::getBinName int  i  )  const [virtual]
 

returns a name string.

The name string MAY, and MUST, be destroyed by the user! therefore: you MUST NOT return a string constant here, like "dummy", but use new[] to allocate the string. The name string should be short, unique, and contain no spaces, like "tbin0".

Parameters:
i  The bin number

Implements BinningFun.

Definition at line 93 of file CutBinning.C.

const char * CutBinning::getBinTitle int  i  )  const [virtual]
 

returns a title string.

The name string MAY, and MUST, be destroyed by the user! therefore: you MUST NOT return a string constant here, like "dummy", but use new[] to allocate the string. The name string should describe the bin, like "0.1 < t < 0.5".

Parameters:
i  The bin number

Implements BinningFun.

Definition at line 101 of file CutBinning.C.

Referenced by getBinLabel().

const char * CutBinning::getBinLabel int  i  )  const [virtual]
 

Returns the bin label (string must not be deleted by user!).

Parameters:
i  The bin number

Definition at line 144 of file CutBinning.C.

References getBinTitle().

void CutBinning::genDefinition  )  [protected]
 

Generates a definition string and sets the definition to it.

This method is called in the constructor, therefore it makes no sense to make it virtual, because the constructor will always call CutBinning::setDefinition().

Definition at line 109 of file CutBinning.C.

References NamedO::setDefinition().

Referenced by CutBinning().


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