13 #ifndef ROOT_TUnfoldBinning 14 #define ROOT_TUnfoldBinning 120 char const *histogramName,
123 char const *histogramTitle=0);
129 Int_t firstBinX)
const;
162 return (
TVectorD const *)fAxisList->
At(axis); }
165 return ((
TObjString *
const)fAxisLabelList->
At(axis))->GetString(); }
177 Int_t *isOptionGiven)
const;
186 Int_t const *axisList)
const;
195 Int_t *binMap)
const;
Int_t FillBinMap1D(Int_t *binMap, const char *axisSteering, Int_t firstBinX) const
Map all global bins referenced by this node to the one-dimensional histogram destHist, starting with bin firstBinX.
const TObjString * GetUnconnectedBinName(Int_t bin) const
Return the bin names of unconnected bins.
TUnfoldBinning const * GetChildNode(void) const
first daughter node
TUnfoldBinning * parentNode
mother node
TH1 * CreateHistogram(const char *histogramName, Bool_t originalAxisBinning=kFALSE, Int_t **binMap=0, const char *histogramTitle=0, const char *axisSteering=0) const
Create a THxx histogram capable to hold the bins of this binning node and its children.
TH2D * CreateErrorMatrixHistogram(const char *histogramName, Bool_t originalAxisBinning, Int_t **binMap=0, const char *histogramTitle=0, const char *axisSteering=0) const
Create a TH2D histogram capable to hold a covariance matrix.
virtual Double_t GetDistributionBinCenter(Int_t axis, Int_t bin) const
return bin center for a given axis and bin number
const TUnfoldBinning * GetNonemptyNode(void) const
Find a node which has non-empty distributions if there is none or if there are many, return zero.
Bool_t HasOverflow(int axis) const
check whether the axis has an overflow bin
Collectable string class.
Int_t fDistributionSize
number of bins in this node's distribution
TUnfoldBinning * childNode
first daughter node
virtual Double_t GetDistributionAverageBinSize(Int_t axis, Bool_t includeUnderflow, Bool_t includeOverflow) const
Get average bin size on the specified axis.
Int_t * CreateBinMap(const TH1 *hist, Int_t nDim, const Int_t *axisList, const char *axisSteering) const
Create mapping from global bin number to a histogram for this node.
TString BuildHistogramTitle2D(const char *histogramName, const char *histogramTitle, Int_t xAxis, const TUnfoldBinning *yAxisBinning, Int_t yAxis) const
Construct a histogram title for a 2D histogram with different binning schemes on x and y axis...
TUnfoldBinning const * ToAxisBins(Int_t globalBin, Int_t *axisBins) const
Return distribution in which the bin is located and bin numbers on the corresponding axes...
Double_t GetBinSize(Int_t iBin) const
Get N-dimensional bin size.
TUnfoldBinning * nextNode
next sister
void GetBinUnderflowOverflowStatus(Int_t iBin, Int_t *uStatus, Int_t *oStatus) const
Return bit maps indicating underflow and overflow status.
void SetBinFactor(Double_t normalisation, TObject *factors)
Set normalisation factors which are used in calls to GetBinFactor().
Int_t fHasOverflow
bit fields indicating whether there are overflow bins on the axes
Int_t fHasUnderflow
bit fields indicating whether there are underflow bins on the axes
void PrintStream(std::ostream &out, Int_t indent=0, int debug=0) const
Print some information about this binning tree.
TObject * At(Int_t idx) const
Int_t GetTHxxBinning(Int_t maxDim, Int_t *axisBins, Int_t *axisList, const char *axisSteering) const
Calculate properties of a THxx histogram to store this binning.
virtual ~TUnfoldBinning(void)
TUnfoldBinning const * GetNextNode(void) const
next sister node
Int_t UpdateFirstLastBin(Bool_t startWithRootNode=kTRUE)
Update fFirstBin and fLastBin members of this node and its children.
Int_t ToGlobalBin(Int_t const *axisBins, Int_t *isBelow=0, Int_t *isAbove=0) const
Get global bin number, given axis bin numbers.
Double_t fBinFactorConstant
common scale factor for all bins of this node
static const double x2[5]
Int_t GetEndBin(void) const
last+1 bin of this node (includes children)
#define ClassDef(name, id)
void SetBinMapEntry(Int_t *binMap, Int_t globalBin, Int_t destBin) const
Set one entry in a bin map.
The TNamed class is the base class for all named ROOT classes.
Double_t GetGlobalFactor(void) const
Return global scaling factor for this node.
Int_t fLastBin
global bin number of the last(+1) bin, including daughters
TObjArray * fAxisLabelList
for each axis its name (TObjString), or names of unconnected bins
void Initialize(Int_t nBins)
Initialize variables for a given number of bins.
static const double x4[22]
Int_t GetBinNeighbours(Int_t globalBin, Int_t axis, Int_t *prev, Double_t *distPrev, Int_t *next, Double_t *distNext, Bool_t isPeriodic=kFALSE) const
Get neighbour bins along the specified axis.
Int_t GetStartBin(void) const
first bin of this node
TVectorD const * GetDistributionBinning(Int_t axis) const
get vector of bin borders for one axis
Int_t GetDistributionDimension(void) const
query dimension of this node's distribution
TUnfoldBinning const * GetParentNode(void) const
mother node
TH1 * ExtractHistogram(const char *histogramName, const TH1 *globalBins, const TH2 *globalBinsEmatrix=0, Bool_t originalAxisBinning=kTRUE, const char *axisSteering=0) const
Extract a distribution from the given set of global bins.
Bool_t AddAxis(const char *name, Int_t nBins, const Double_t *binBorders, Bool_t hasUnderflow, Bool_t hasOverflow)
Add an axis with the specified bin borders.
void DecodeAxisSteering(const char *axisSteering, const char *options, Int_t *isOptionGiven) const
Decode axis steering.
void SetBinFactorFunction(Double_t normalisation, TF1 *userFunc=0)
Set normalisation factor and function which are used in calls to GetBinFactor().
Int_t fFirstBin
global bin number of the first bin
Service class for 2-Dim histogram classes.
Class to manage histogram axis.
virtual Double_t GetDistributionUnderflowBinWidth(Int_t axis) const
Return bin width assigned to the underflow bin.
Int_t GetEntriesFast() const
virtual Bool_t IsBinFactorGlobal(void) const
Check whether there is only a global scaling factor for this node.
TUnfoldBinning const * GetPrevNode(void) const
previous sister node
Bool_t HasUnderflow(int axis) const
check whether an axis has an underflow bin
static TH2D * CreateHistogramOfMigrations(TUnfoldBinning const *xAxis, TUnfoldBinning const *yAxis, char const *histogramName, Bool_t originalXAxisBinning=kFALSE, Bool_t originalYAxisBinning=kFALSE, char const *histogramTitle=0)
Create a TH2D histogram capable to hold the bins of the two input binning schemes on the x and y axes...
Binning schemes for use with the unfolding algorithm TUnfoldDensity.
TString GetDistributionAxisLabel(Int_t axis) const
get name of an axis
static const double x1[5]
TObject * fBinFactorFunction
function to calculate a scale factor from bin centres (may be a TF1 or a TVectorD ...
TUnfoldBinning * prevNode
previous sister
Int_t * CreateEmptyBinMap(void) const
Create an empty bin map, useful together with the getter methods of class TUnfold and TUnfoldSys...
Int_t GetDistributionNumberOfBins(void) const
number of bins in the distribution possibly including under/overflow
Int_t FillBinMapSingleNode(const TH1 *hist, Int_t startBin, Int_t nDim, const Int_t *axisList, const char *axisSteering, Int_t *binMap) const
Fill bin map for a single node.
#define TUnfold_CLASS_VERSION
Int_t GetGlobalBinNumber(Double_t x) const
Locate a bin in a one-dimensional distribution.
TString GetBinName(Int_t iBin) const
Get the name of a bin.
Mother of all ROOT objects.
you should not use this method at all Int_t Int_t z
Int_t GetTH1xNumberOfBins(Bool_t originalAxisBinning=kTRUE, const char *axisSteering=0) const
Return the number of histogram bins required when storing this binning in a one-dimensional histogram...
Int_t FillBinMapRecursive(Int_t startBin, const char *axisSteering, Int_t *binMap) const
Recursively fill bin map.
Bool_t HasUnconnectedBins(void) const
Check whether there are bins but no axis.
TUnfoldBinning const * GetRootNode(void) const
return root node of the binnig scheme
TObjArray * fAxisList
for each axis the bin borders (TVectorD)
virtual Double_t GetDistributionOverflowBinWidth(Int_t axis) const
Return bin width assigned to the overflow bin.
TUnfoldBinning(const char *name=0, Int_t nBins=0, const char *binNames=0)
Create a new node without axis.
maximum numner of axes per distribution
Int_t GetTHxxBinningSingleNode(Int_t maxDim, Int_t *axisBins, Int_t *axisList, const char *axisSteering) const
Get the properties of a histogram capable to hold the distribution attached to this node...
TString BuildHistogramTitle(const char *histogramName, const char *histogramTitle, Int_t const *axisList) const
Construct a title.
Int_t GetTHxxBinsRecursive(const char *axisSteering) const
Calculate number of bins required to store this binning with the given axisSteering.
TUnfoldBinning * AddBinning(TUnfoldBinning *binning)
Add a TUnfoldBinning as the last child of this node.
TUnfoldBinning const * FindNode(char const *name) const
Traverse the tree and return the first node which matches the given name.
virtual Double_t GetBinFactor(Int_t iBin) const
Return scaling factor for the given global bin number.
static const double x3[11]
tomato 2-D histogram with a double per channel (see TH1 documentation)}