#include <SetOfH.h>
Inheritance diagram for SetOfH:
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
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 BinningFun * | getBinning () const |
Get the BinningFun. | |
BinningFun * | getBinning () |
Get the BinningFun. | |
const BinningFun * | getBinning (int i) const |
Get the BinningFun of a certain dimension (1, 2 [for MatrixOfH], 3 [for CubeOfH]). | |
BinningFun * | getBinning (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! | |
SetOfH & | operator= (const SetOfH &source) |
Private assignment operator, left unimplemented: No assignment! | |
Private Attributes | |
char * | name |
Common histogram name. | |
char * | title |
Common histogram title. | |
BinningFun * | binning1 |
The 1st BinningFun that assigns entries to histograms. | |
BinningFun * | binning2 |
The 2nd BinningFun that assigns entries to histograms. | |
BinningFun * | binning3 |
The 3rd BinningFun that assigns entries to histograms. | |
char * | option |
Option string (as for TProfile). |
|
Constructor for a 1-dimensional Set.
Definition at line 37 of file SetOfH.C. References init(), ROListPoR::prol, and ROList::registerObject(). |
|
Constructor for a 2-dimensional Set (a Matrix).
Definition at line 49 of file SetOfH.C. References init(), ROListPoR::prol, and ROList::registerObject(). |
|
Returns histogram number i (corresponding to bin i of the BinningFun).
Definition at line 89 of file SetOfH.C. References ROList::getEntries(), and ROList::getEntry(). |
|
Divide all histos by the same function (as for TProfile): this = this/(c1*f1).
Definition at line 134 of file SetOfH.C. References ROList::getEntry(). |
|
Divide all histos by the same histogram (as for TProfile): this = this/h1.
Definition at line 140 of file SetOfH.C. References ROList::getEntry(). |
|
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
Definition at line 146 of file SetOfH.C. References ROList::getEntry(). |
|
Divide each histo by corresponding histo of soh: this = this/soh.
Definition at line 152 of file SetOfH.C. References ROList::getEntries(), ROList::getEntry(), ROList::getIndex(), and getName(). |
|
Replace each histo by ratio of corresponding histos in soh1 and soh2: this = c1*soh1/(c2*soh2).
Definition at line 168 of file SetOfH.C. References ROList::getEntries(), ROList::getEntry(), ROList::getIndex(), and getName(). |
|
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.
Definition at line 187 of file SetOfH.C. References RegH1F::Divide(), ROList::getEntries(), ROList::getEntry(), ROList::getIndex(), and getName(). |
|
Multiply all histos by the same function (as for TProfile): this = this*(c1*f1).
Definition at line 209 of file SetOfH.C. References ROList::getEntry(). |
|
Multiply all histos by the same function (as for TProfile): this = this*(c1*f1). An optional multiplier to f1
Definition at line 215 of file SetOfH.C. References ROList::getEntry(). |
|
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
Definition at line 221 of file SetOfH.C. References ROList::getEntry(). |
|
Multiply each histo by corresponding histo of soh: this = this*soh.
Definition at line 227 of file SetOfH.C. References ROList::getEntries(), ROList::getEntry(), ROList::getIndex(), and getName(). |
|
Multiply each histo by product of corresponding histos in soh1 and soh2: this = (c1*soh1)*(c2*soh2).
Definition at line 244 of file SetOfH.C. References ROList::getEntries(), ROList::getEntry(), ROList::getIndex(), and getName(). |
|
Add to each histo corresponding histo of soh: this = this+c1*soh.
Definition at line 264 of file SetOfH.C. References ROList::getEntries(), ROList::getEntry(), and ROList::getIndex(). |
|
Generate a bin title string; the returned string must be deleted by the caller!
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(). |
|
Generate a bin name string; the returned string must be deleted by the caller!
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(). |
|
Get the BinningFun of a certain dimension (1, 2 [for MatrixOfH], 3 [for CubeOfH]).
|
|
Get the BinningFun of a certain dimension (1, 2 [for MatrixOfH], 3 [for CubeOfH]).
|
|
Books and registers one histogram with number i.
Implemented in MatrixOfH, SetOfH2F, SetOfHistograms, and SetOfHProf. Referenced by initHistos(). |
|
Copy name and title to local store.
Definition at line 62 of file SetOfH.C. References name, option, and title. Referenced by SetOfH(). |