#include <CutBinning.h>
Inheritance diagram for CutBinning:
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
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 FillIterator * | getIterator () 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 FillIterator * | theFillIterator |
|
Create a CutBinning from an array of pointers to cuts.
Definition at line 31 of file CutBinning.C. References genDefinition(), and NamedO::str(). |
|
Create a CutBinning from an array of pointers to cuts.
Definition at line 45 of file CutBinning.C. References genDefinition(), and NamedO::str(). |
|
Create a CutBinning from an array of pointers to cuts.
Definition at line 59 of file CutBinning.C. References genDefinition(), and NamedO::str(). |
|
Create a CutBinning from an array of pointers to cuts.
Definition at line 73 of file CutBinning.C. References genDefinition(), and NamedO::str(). |
|
Returns whether an event belongs to bin i.
Reimplemented from BinningFun. Definition at line 88 of file CutBinning.C. |
|
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".
Implements BinningFun. Definition at line 93 of file CutBinning.C. |
|
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".
Implements BinningFun. Definition at line 101 of file CutBinning.C. Referenced by getBinLabel(). |
|
Returns the bin label (string must not be deleted by user!).
Definition at line 144 of file CutBinning.C. References getBinTitle(). |
|
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(). |