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

SetOfH Class Reference

#include <SetOfH.h>

Inheritance diagram for SetOfH:

Inheritance graph
[legend]
Collaboration diagram for SetOfH:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class for collection of histograms that have the same axis/axes.

A SetOfH contains a set of 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 a BinningFun object that at the same time defines the number of histograms.

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

A SetOfH is a convenient tool to create a large set of histograms at the same time.

Functions exist to add, multiply, and divide sets of histograms. These operations are performed on pairs of corresponding histograms, if possible.

Author: Benno List

Date
2005/11/26 13:51:02
Author
blist

Changelog:

Definition at line 53 of file SetOfH.h.

Public Member Functions

 SetOfH (const char *name_, const char *title_, const ROListPoR &hhl, const BinningFunPoR &binning1_, Option_t *option_=0)
 Constructor for a 1-dimensional Set.

 SetOfH (const char *name_, const char *title_, const ROListPoR &hhl, const BinningFunPoR &binning1_, const BinningFunPoR &binning2_, Option_t *option_=0)
 Constructor for a 2-dimensional Set (a Matrix).

virtual ~SetOfH ()
 Destructor.

TH1 * getHisto (unsigned int i)
 Returns histogram number i (corresponding to bin i of the BinningFun).

virtual void Divide (TF1 *f1, Double_t c1=1)
 Divide all histos by the same function (as for TProfile): this = this/(c1*f1).

virtual void Divide (const TH1 *h1)
 Divide all histos by the same histogram (as for TProfile): this = this/h1.

virtual void Divide (const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=0)
 Replace contents of all histograms by the division of h1 by h2: this = c1*h1/(c2*h2).

virtual void Divide (const SetOfH *soh)
 Divide each histo by corresponding histo of soh: this = this/soh.

virtual void Divide (const SetOfH *soh1, const SetOfH *soh2, Double_t c1=1, Double_t c2=1, Option_t *option=0)
 Replace each histo by ratio of corresponding histos in soh1 and soh2: this = c1*soh1/(c2*soh2).

virtual void Divide (const SetOfH *soh1, const SetOfH *soh2, const SetOfH *soh3, Double_t c1=1, Double_t c2=1)
 Replace each histo by the division of h1 by h2, with h3 as overlap histogram: this = c1*h1/(c2*h2).

virtual void Multiply (TF1 *f1, Double_t c1=1)
 Multiply all histos by the same function (as for TProfile): this = this*(c1*f1).

virtual void Multiply (const TH1 *h1)
 Multiply all histos by the same function (as for TProfile): this = this*(c1*f1).

virtual void Multiply (const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=0)
 Replace contents of all histograms by the product of h1 by h2: this = c1*h1/(c2*h2).

virtual void Multiply (const SetOfH *soh)
 Multiply each histo by corresponding histo of soh: this = this*soh.

virtual void Multiply (const SetOfH *soh1, const SetOfH *soh2, Double_t c1=1, Double_t c2=1, Option_t *option=0)
 Multiply each histo by product of corresponding histos in soh1 and soh2: this = (c1*soh1)*(c2*soh2).

virtual void Add (const SetOfH *soh, Double_t c1=1)
 Add to each histo corresponding histo of soh: this = this+c1*soh.

virtual const char * genBinTitle (IndexType i) const
 Generate a bin title string; the returned string must be deleted by the caller!

virtual const char * genBinName (IndexType i) const
 Generate a bin name string; the returned string must be deleted by the caller!

const char * getTitle () const
 Get the title string. Don't delete the returned string!

const char * getName () const
 Get the name string. Don't delete the returned string!

const char * getOption () const
 Get the option string. Don't delete the returned string!

const BinningFungetBinning () const
 Get the BinningFun.

BinningFungetBinning ()
 Get the BinningFun.

const BinningFungetBinning (int i) const
 Get the BinningFun of a certain dimension (1, 2 [for MatrixOfH], 3 [for CubeOfH]).

BinningFungetBinning (int i)
 Get the BinningFun of a certain dimension (1, 2 [for MatrixOfH], 3 [for CubeOfH]).

virtual void initHisto (IndexType i)=0
 Books and registers one histogram with number i.


Protected Member Functions

virtual void initHistos ()
 Book all the histos , generate their names and titles.


Private Member Functions

void init (const char *name_, const char *title_, Option_t *option_)
 Copy name and title to local store.

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

SetOfHoperator= (const SetOfH &source)
 Private assignment operator, left unimplemented: No assignment!


Private Attributes

char * name
 Common histogram name.

char * title
 Common histogram title.

BinningFunbinning1
 The 1st BinningFun that assigns entries to histograms.

BinningFunbinning2
 The 2nd BinningFun that assigns entries to histograms.

BinningFunbinning3
 The 3rd BinningFun that assigns entries to histograms.

char * option
 Option string (as for TProfile).


Constructor & Destructor Documentation

SetOfH::SetOfH const char *  name_,
const char *  title_,
const ROListPoR hhl,
const BinningFunPoR binning1_,
Option_t *  option_ = 0
 

Constructor for a 1-dimensional Set.

Parameters:
name_  Common histogram name
title_  Common histogram title
hhl  ROList object where "this" will be registered
binning1_  The BinningFun that assigns entries to histograms
option_  An optional option.

Definition at line 37 of file SetOfH.C.

References init(), ROListPoR::prol, and ROList::registerObject().

SetOfH::SetOfH const char *  name_,
const char *  title_,
const ROListPoR hhl,
const BinningFunPoR binning1_,
const BinningFunPoR binning2_,
Option_t *  option_ = 0
 

Constructor for a 2-dimensional Set (a Matrix).

Parameters:
name_  Common histogram name
title_  Common histogram title
hhl  ROList object where "this" will be registered
binning1_  The 1st BinningFun that assigns entries to histograms
binning2_  The 2nd BinningFun that assigns entries to histograms
option_  An optional option.

Definition at line 49 of file SetOfH.C.

References init(), ROListPoR::prol, and ROList::registerObject().


Member Function Documentation

TH1 * SetOfH::getHisto unsigned int  i  ) 
 

Returns histogram number i (corresponding to bin i of the BinningFun).

Parameters:
i  The number of the histogram to be returned

Definition at line 89 of file SetOfH.C.

References ROList::getEntries(), and ROList::getEntry().

void SetOfH::Divide TF1 *  f1,
Double_t  c1 = 1
[virtual]
 

Divide all histos by the same function (as for TProfile): this = this/(c1*f1).

Parameters:
f1  The function f1
c1  An optional multiplier to f1

Definition at line 134 of file SetOfH.C.

References ROList::getEntry().

void SetOfH::Divide const TH1 *  h1  )  [virtual]
 

Divide all histos by the same histogram (as for TProfile): this = this/h1.

Parameters:
h1  The histogram h1

Definition at line 140 of file SetOfH.C.

References ROList::getEntry().

void SetOfH::Divide const TH1 *  h1,
const TH1 *  h2,
Double_t  c1 = 1,
Double_t  c2 = 1,
Option_t *  option = 0
[virtual]
 

Replace contents of all histograms by the division of h1 by h2: this = c1*h1/(c2*h2).

This operation is somewhat pointless for a SetOfHProf, it exists only to have the same Divide methods as for a TProfile

Parameters:
h1  The first histogram h1
h2  The second histogram h2
c1  An optional multiplier to h1
c2  An optional multiplier to h2
option  An option. "B" means binomial errors

Definition at line 146 of file SetOfH.C.

References ROList::getEntry().

void SetOfH::Divide const SetOfH soh  )  [virtual]
 

Divide each histo by corresponding histo of soh: this = this/soh.

Parameters:
soh  Histograms by which to divide

Definition at line 152 of file SetOfH.C.

References ROList::getEntries(), ROList::getEntry(), ROList::getIndex(), and getName().

void SetOfH::Divide const SetOfH soh1,
const SetOfH soh2,
Double_t  c1 = 1,
Double_t  c2 = 1,
Option_t *  option = 0
[virtual]
 

Replace each histo by ratio of corresponding histos in soh1 and soh2: this = c1*soh1/(c2*soh2).

Parameters:
soh1  The first set of histos soh1
soh2  The second set of histos moh2
c1  An optional multiplier to soh1
c2  An optional multiplier to soh2
option  An option. "B" means binomial errors

Definition at line 168 of file SetOfH.C.

References ROList::getEntries(), ROList::getEntry(), ROList::getIndex(), and getName().

void SetOfH::Divide const SetOfH soh1,
const SetOfH soh2,
const SetOfH soh3,
Double_t  c1 = 1,
Double_t  c2 = 1
[virtual]
 

Replace each histo by the division of h1 by h2, with h3 as overlap histogram: this = c1*h1/(c2*h2).

In the most general case where soh1 contains a sum of event weights w_i and soh2 a sum of event weights v_i, h3 should contain the sum w_i*v_i for those events which fall into the same x bin of the same histogram; soh3 is the overlap set of histograms.

Parameters:
soh1  The first set of histos soh1
soh2  The second set of histos moh2
soh3  The third set of histos moh2
c1  An optional multiplier to soh1
c2  An optional multiplier to soh2

Definition at line 187 of file SetOfH.C.

References RegH1F::Divide(), ROList::getEntries(), ROList::getEntry(), ROList::getIndex(), and getName().

void SetOfH::Multiply TF1 *  f1,
Double_t  c1 = 1
[virtual]
 

Multiply all histos by the same function (as for TProfile): this = this*(c1*f1).

Parameters:
f1  The function f1
c1  An optional multiplier to f1

Definition at line 209 of file SetOfH.C.

References ROList::getEntry().

void SetOfH::Multiply const TH1 *  h1  )  [virtual]
 

Multiply all histos by the same function (as for TProfile): this = this*(c1*f1).

An optional multiplier to f1

Parameters:
h1  The function f1

Definition at line 215 of file SetOfH.C.

References ROList::getEntry().

void SetOfH::Multiply const TH1 *  h1,
const TH1 *  h2,
Double_t  c1 = 1,
Double_t  c2 = 1,
Option_t *  option = 0
[virtual]
 

Replace contents of all histograms by the product of h1 by h2: this = c1*h1/(c2*h2).

This operation is somewhat pointless for a SetOfH, it exists only to have the same Multiply methods as for a TProfile

Parameters:
h1  The first matrix of histos moh1
h2  The firsecondst matrix of histos moh2
c1  An optional multiplier to moh1
c2  An optional multiplier to moh2
option  An option that is not used, as for TH1

Definition at line 221 of file SetOfH.C.

References ROList::getEntry().

void SetOfH::Multiply const SetOfH soh  )  [virtual]
 

Multiply each histo by corresponding histo of soh: this = this*soh.

Parameters:
soh  Histograms by which to multiply

Definition at line 227 of file SetOfH.C.

References ROList::getEntries(), ROList::getEntry(), ROList::getIndex(), and getName().

void SetOfH::Multiply const SetOfH soh1,
const SetOfH soh2,
Double_t  c1 = 1,
Double_t  c2 = 1,
Option_t *  option = 0
[virtual]
 

Multiply each histo by product of corresponding histos in soh1 and soh2: this = (c1*soh1)*(c2*soh2).

Parameters:
soh1  The first set of histos soh1
soh2  The second set of histos soh2
c1  An optional multiplier to soh1
c2  An optional multiplier to soh2
option  An option that is not used, as for TH1

Definition at line 244 of file SetOfH.C.

References ROList::getEntries(), ROList::getEntry(), ROList::getIndex(), and getName().

void SetOfH::Add const SetOfH soh,
Double_t  c1 = 1
[virtual]
 

Add to each histo corresponding histo of soh: this = this+c1*soh.

Parameters:
soh  Histograms to add
c1  An optional multiplier to soh

Definition at line 264 of file SetOfH.C.

References ROList::getEntries(), ROList::getEntry(), and ROList::getIndex().

const char * SetOfH::genBinTitle IndexType  i  )  const [virtual]
 

Generate a bin title string; the returned string must be deleted by the caller!

Parameters:
i  The bin number

Definition at line 94 of file SetOfH.C.

References binning1, BinningFun::getBinTitle(), and title.

Referenced by MatrixOfHistograms::getSet(), SetOfHProf::initHisto(), SetOfHistograms::initHisto(), and SetOfH2F::initHisto().

const char * SetOfH::genBinName IndexType  i  )  const [virtual]
 

Generate a bin name string; the returned string must be deleted by the caller!

Parameters:
i  The bin number

Definition at line 109 of file SetOfH.C.

References binning1, BinningFun::getBinName(), and name.

Referenced by MatrixOfHistograms::getSet(), SetOfHProf::initHisto(), SetOfHistograms::initHisto(), SetOfH2F::initHisto(), and SetOfHistograms::SetOfHistograms().

const BinningFun * SetOfH::getBinning int  i  )  const [inline]
 

Get the BinningFun of a certain dimension (1, 2 [for MatrixOfH], 3 [for CubeOfH]).

Parameters:
i  The dimension (1 or 2)

Definition at line 234 of file SetOfH.h.

References binning1, binning2, and binning3.

BinningFun * SetOfH::getBinning int  i  )  [inline]
 

Get the BinningFun of a certain dimension (1, 2 [for MatrixOfH], 3 [for CubeOfH]).

Parameters:
i  The dimension (1 or 2)

Definition at line 243 of file SetOfH.h.

References binning1, binning2, and binning3.

virtual void SetOfH::initHisto IndexType  i  )  [pure virtual]
 

Books and registers one histogram with number i.

Parameters:
i  The number under which to register

Implemented in MatrixOfH, SetOfH2F, SetOfHistograms, and SetOfHProf.

Referenced by initHistos().

void SetOfH::init const char *  name_,
const char *  title_,
Option_t *  option_
[private]
 

Copy name and title to local store.

Parameters:
name_  Common histogram name
title_  Common histogram title
option_  Option string (as for TProfile)

Definition at line 62 of file SetOfH.C.

References name, option, and title.

Referenced by SetOfH().


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