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

SFMatrixOfHistograms Class Reference

#include <SFMatrixOfHistograms.h>

Inheritance diagram for SFMatrixOfHistograms:

Inheritance graph
[legend]
Collaboration diagram for SFMatrixOfHistograms:

Collaboration graph
[legend]
List of all members.

Detailed Description

A self-filling 2-dimensional collection of 1-D histos with the same axis.

Like a MatrixOfHistograms, a SFMatrixOfHistograms contains a set of 1-dimensional TH1F histograms; these histograms are (normally) all created by the constructor. The histograms share the same axis binning, and their names and titles are created using two BinningFun objects that at the same time define the number of histograms.

The histogram names will a concatenation of the name given by the user, and the bin names given by the two BinningFun objects. The same applies to the title.

A SFMatrixOfHistograms is a self-filling set of histograms, NOT a set of self-filling histograms (which is a SFROList). This means that instead of calling a Fill() of each histogram, the SFMatrixOfHistograms object uses the BinningFun objects to determine which of the histograms gets an entry, and then makes the entry in just that histogram.

A typical application of a SFMatrixOfHistograms is to generate a set of mass histograms depending on some kinematic quantities like t and W, to measure cross sections in different kinematic bins.

Using SFMatrixOfHistograms makes it unnecessary to define cut objects like "t between 0.05 and 0.1"

Author: Jenny Böhme, Benno List

Date
2005/07/08 14:49:14
Author
blist

Changelog:

Definition at line 74 of file SFMatrixOfHistograms.h.

Public Member Functions

 SFMatrixOfHistograms (const char *name_, const char *title_, const ROListPoR &hhl, const FloatFunPoR &xfun_, const BaseCutPoR &cut_, const FloatFunPoR &wfun_, const BinningFunPoR &binning1_, const BinningFunPoR &binning2_, const FillIteratorPoR &iter_=0)
 Constructor for a set of empty histograms.

 SFMatrixOfHistograms (const char *name_, const char *title_, Int_t nbinsx, Axis_t xlow, Axis_t xup, const ROListPoR &hhl, const FloatFunPoR &xfun_, const BaseCutPoR &cut_, const FloatFunPoR &wfun_, const BinningFunPoR &binning1_, const BinningFunPoR &binning2_, const FillIteratorPoR &iter_=0)
 Constructor for a set of histograms with equidistant axis binning.

 SFMatrixOfHistograms (const char *name_, const char *title_, Int_t nbinsx, const Double_t *xbins, const ROListPoR &hhl, const FloatFunPoR &xfun_, const BaseCutPoR &cut_, const FloatFunPoR &wfun_, const BinningFunPoR &binning1_, const BinningFunPoR &binning2_, const FillIteratorPoR &iter_=0)
 Constructor for a set of histograms with non-equidistant axis binning, taking doubles.

 SFMatrixOfHistograms (const char *name_, const char *title_, Int_t nbinsx, const Float_t *xbins, const ROListPoR &hhl, const FloatFunPoR &xfun_, const BaseCutPoR &cut_, const FloatFunPoR &wfun_, const BinningFunPoR &binning1_, const BinningFunPoR &binning2_, const FillIteratorPoR &iter_=0)
 Constructor for a set of histograms with non-equidistant axis binning, taking floats.

 SFMatrixOfHistograms (const char *name_, const char *title_, const Binning &axisbinning, const ROListPoR &hhl, const FloatFunPoR &xfun_, const BaseCutPoR &cut_, const FloatFunPoR &wfun_, const BinningFunPoR &binning1_, const BinningFunPoR &binning2_, const FillIteratorPoR &iter_=0)
 Constructor taking a Binning object.

virtual ~SFMatrixOfHistograms ()
 Virtual destructor.

virtual void Fill ()
 The Self-filler method.

FloatFungetXFun () const
 Returns a pointer to the abscissa function object.

BaseCutgetCut () const
 Returns a pointer to the cut function object.

FloatFungetWFun () const
 Returns a pointer to the weight function object.

FillIteratorgetIter () const
 Returns a pointer to the iterator object.


Protected Member Functions

void checkIterators (const char *name)
 Checks consistency of iterators.

template<class Fun1, class Fun2> void checkTwoIterators (const char *name, const char *fun1name, Fun1 *fun1, const char *fun2name, Fun2 *fun2)
 Checks consistency of iterators of two function objects.

template<class Fun> void checkOneIterator (const char *name, const char *funname, Fun *fun)
 Function object.


Protected Attributes

FloatFunxfun
 Function object defining abscissa (what to plot).

BaseCutcut
 optional Function object defining a cut (0 means: no cut)

FloatFunwfun
 optional Function object defining weight (0 means: weight 1)

FillIteratoriter
 optional Iterator object for more than 1 entry per Fill() call


Private Member Functions

 SFMatrixOfHistograms (const SFMatrixOfHistograms &source)
 Private copy constructor, left unimplemented: No copying!

SFMatrixOfHistogramsoperator= (const SFMatrixOfHistograms &source)
 Private assignment operator, left unimplemented: No assignment!


Constructor & Destructor Documentation

SFMatrixOfHistograms::SFMatrixOfHistograms const char *  name_,
const char *  title_,
const ROListPoR hhl,
const FloatFunPoR xfun_,
const BaseCutPoR cut_,
const FloatFunPoR wfun_,
const BinningFunPoR binning1_,
const BinningFunPoR binning2_,
const FillIteratorPoR iter_ = 0
 

Constructor for a set of empty histograms.

Parameters:
name_  Common histogram name
title_  Common histogram title
hhl  ROList object where "this" will be registered
xfun_  Function object defining abscissa (what to plot)
cut_  optional Function object defining a cut (0 means: no cut)
wfun_  optional Function object defining weight (0 means: weight 1)
binning1_  The 1st BinningFun that assigns entries to histograms
binning2_  The 2nd BinningFun that assigns entries to histograms
iter_  optional Iterator object for more than 1 entry per Fill() call

Definition at line 40 of file SFMatrixOfHistograms.C.

References checkIterators().

SFMatrixOfHistograms::SFMatrixOfHistograms const char *  name_,
const char *  title_,
Int_t  nbinsx,
Axis_t  xlow,
Axis_t  xup,
const ROListPoR hhl,
const FloatFunPoR xfun_,
const BaseCutPoR cut_,
const FloatFunPoR wfun_,
const BinningFunPoR binning1_,
const BinningFunPoR binning2_,
const FillIteratorPoR iter_ = 0
 

Constructor for a set of histograms with equidistant axis binning.

Parameters:
name_  Common histogram name
title_  Common histogram title
nbinsx  Number of bins (as for TH1F)
xlow  Lower edge (as for TH1F)
xup  Upper edge (as for TH1F)
hhl  ROList object where "this" will be registered
xfun_  Function object defining abscissa (what to plot)
cut_  optional Function object defining a cut (0 means: no cut)
wfun_  optional Function object defining weight (0 means: weight 1)
binning1_  The 1st BinningFun that assigns entries to histograms
binning2_  The 2nd BinningFun that assigns entries to histograms
iter_  optional Iterator object for more than 1 entry per Fill() call

Definition at line 55 of file SFMatrixOfHistograms.C.

References checkIterators().

SFMatrixOfHistograms::SFMatrixOfHistograms const char *  name_,
const char *  title_,
Int_t  nbinsx,
const Double_t *  xbins,
const ROListPoR hhl,
const FloatFunPoR xfun_,
const BaseCutPoR cut_,
const FloatFunPoR wfun_,
const BinningFunPoR binning1_,
const BinningFunPoR binning2_,
const FillIteratorPoR iter_ = 0
 

Constructor for a set of histograms with non-equidistant axis binning, taking doubles.

Parameters:
name_  Common histogram name
title_  Common histogram title
nbinsx  Number of bins (as for TH1F)
xbins  Bin edges (as for TH1F)
hhl  ROList object where "this" will be registered
xfun_  Function object defining abscissa (what to plot)
cut_  optional Function object defining a cut (0 means: no cut)
wfun_  optional Function object defining weight (0 means: weight 1)
binning1_  The 1st BinningFun that assigns entries to histograms
binning2_  The 2nd BinningFun that assigns entries to histograms
iter_  optional Iterator object for more than 1 entry per Fill() call

Definition at line 73 of file SFMatrixOfHistograms.C.

References checkIterators().

SFMatrixOfHistograms::SFMatrixOfHistograms const char *  name_,
const char *  title_,
Int_t  nbinsx,
const Float_t *  xbins,
const ROListPoR hhl,
const FloatFunPoR xfun_,
const BaseCutPoR cut_,
const FloatFunPoR wfun_,
const BinningFunPoR binning1_,
const BinningFunPoR binning2_,
const FillIteratorPoR iter_ = 0
 

Constructor for a set of histograms with non-equidistant axis binning, taking floats.

Parameters:
name_  Common histogram name
title_  Common histogram title
nbinsx  Number of bins (as for TH1F)
xbins  Bin edges (as for TH1F)
hhl  ROList object where "this" will be registered
xfun_  Function object defining abscissa (what to plot)
cut_  optional Function object defining a cut (0 means: no cut)
wfun_  optional Function object defining weight (0 means: weight 1)
binning1_  The 1st BinningFun that assigns entries to histograms
binning2_  The 2nd BinningFun that assigns entries to histograms
iter_  optional Iterator object for more than 1 entry per Fill() call

Definition at line 90 of file SFMatrixOfHistograms.C.

References checkIterators().

SFMatrixOfHistograms::SFMatrixOfHistograms const char *  name_,
const char *  title_,
const Binning &  axisbinning,
const ROListPoR hhl,
const FloatFunPoR xfun_,
const BaseCutPoR cut_,
const FloatFunPoR wfun_,
const BinningFunPoR binning1_,
const BinningFunPoR binning2_,
const FillIteratorPoR iter_ = 0
 

Constructor taking a Binning object.

Parameters:
name_  Common histogram name
title_  Common histogram title
axisbinning  Defines the histogram binning
hhl  ROList object where "this" will be registered
xfun_  Function object defining abscissa (what to plot)
cut_  optional Function object defining a cut (0 means: no cut)
wfun_  optional Function object defining weight (0 means: weight 1)
binning1_  The 1st BinningFun that assigns entries to histograms
binning2_  The 2nd BinningFun that assigns entries to histograms
iter_  optional Iterator object for more than 1 entry per Fill() call

Definition at line 107 of file SFMatrixOfHistograms.C.

References checkIterators().


Member Function Documentation

void SFMatrixOfHistograms::Fill  )  [virtual]
 

The Self-filler method.

Fill() evaluates the cut object to see whether an event fulfills the cut defined by the cut object, then evaluates the BinningFun objects to see into which histogram to make an entry, then evaluates the xfun object to get the abscissa and the wfun object to obtain the weight. Optionally, the iter object serves as iterator.

Implements SFO.

Definition at line 125 of file SFMatrixOfHistograms.C.

References cut, SetOfH::getBinning(), MatrixOfH::getBinNumber(), ROList::getEntries(), ROList::getEntry(), ROList::IndexType, BinningFun::isExclusive(), iter, FillIterator::next(), FillIterator::reset(), wfun, and xfun.

void SFMatrixOfHistograms::checkIterators const char *  name  )  [protected]
 

Checks consistency of iterators.

Parameters:
name  The histogram name

Definition at line 257 of file SFMatrixOfHistograms.C.

References checkOneIterator(), checkTwoIterators(), cut, SetOfH::getBinning(), wfun, and xfun.

Referenced by SFMatrixOfHistograms().

template<class Fun1, class Fun2>
void SFMatrixOfHistograms::checkTwoIterators const char *  name,
const char *  fun1name,
Fun1 *  fun1,
const char *  fun2name,
Fun2 *  fun2
[protected]
 

Checks consistency of iterators of two function objects.

Function object 2

Parameters:
name  The histogram name
fun1name  Name of function object 1
fun1  Function object 1
fun2name  Name of function object 2

Definition at line 213 of file SFMatrixOfHistograms.C.

Referenced by checkIterators().

template<class Fun>
void SFMatrixOfHistograms::checkOneIterator const char *  name,
const char *  funname,
Fun *  fun
[protected]
 

Function object.

Parameters:
name  The histogram name
funname  Name of function object

Definition at line 227 of file SFMatrixOfHistograms.C.

References NamedO::getName(), and iter.

Referenced by checkIterators().


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