233 :
TNamed(axis.GetName(),axis.GetTitle())
268 "binning \"%s\" already has parent \"%s\", can not be added to %s",
274 "binning \"%s\" has previous node \"%s\", can not be added to %s",
280 "binning \"%s\" has next node \"%s\", can not be added to %s",
290 while(
child->nextNode) {
323 Fatal(
"AddAxis",
"number of bins %d is not positive",
327 Fatal(
"AddAxis",
"xmin=%f required to be smaller than xmax=%f",
384 Fatal(
"AddAxis",
"node already has %d bins without axis",
387 Fatal(
"AddAxis",
"number of bins %d is not positive",
395 Fatal(
"AddAxis",
"bin border %d is not finite",i);
397 }
else if((i>0)&&((*bins)(i)<=(*bins)(i-1))) {
398 Fatal(
"AddAxis",
"bins not in order x[%d]=%f <= %f=x[%d]",
399 i,(*bins)(i),(*bins)(i-1),i-1);
439 out<<
"TUnfoldBinning \""<<
GetName()<<
"\" has ";
645 }
else if(
xAxis>=0) {
651 }
else if(
yAxis>=0) {
775 "Original binning can not be represented as THxx");
818 Info(
"CreateErrorMatrixHistogram",
819 "Original binning can not be represented on one axis");
907 for(
Int_t i=0;i<3;i++) {
1063 Error(
"SetBinMapEntry",
"global bin number %d outside range (max=%d)",
1090 Error(
"FillBinMap1D",
"distribution %s with steering=%s is not 1D",
1155 Fatal(
"CreateBinMap",
"called with nDim=%d but GetNonemptyNode()=0",
1224 for(
Int_t i=3;i<3+10;i++) {
1240 Fatal(
"FillBinMapSingleNode",
1241 "bin %d outside binning scheme",
1244 Fatal(
"FillBinMapSingleNode",
1245 "bin %d located in %s %d-%d rather than %s %d=%d",
1246 i,(
const char *)
dest->GetName(),
1247 dest->GetStartBin(),
dest->GetEndBin(),
1279 }
else if(
nDim==1) {
1287 Error(
"FillBinMapSingleNode",
"inconsistent dimensions %d %d",
nDim,
1297 Fatal(
"FillBinMapSingleNode",
"inconsistent dimensions %d %d",
nDim,
1382 if(!
r)
return nullptr;
1436 Fatal(
"GetBinNumber",
1437 "called with 1 argument for %d dimensional distribution",
1456 Fatal(
"GetBinNumber",
1457 "called with 2 arguments for %d dimensional distribution",
1485 Fatal(
"GetBinNumber",
1486 "called with 3 arguments for %d dimensional distribution",
1516 Fatal(
"GetBinNumber",
1517 "called with 4 arguments for %d dimensional distribution",
1549 Fatal(
"GetBinNumber",
1550 "called with 5 arguments for %d dimensional distribution",
1584 Fatal(
"GetBinNumber",
1585 "called with 6 arguments for %d dimensional distribution",
1631 Fatal(
"GetBinNumber",
1632 "no axes are defined for node %s",
1641 if(!(
x[dim]>=(*bins)[
i0])) {
1644 }
else if(!(
x[dim]<(*bins)[
i1])) {
1650 if(
x[dim]<(*bins)[
i2]) {
1735 }
else if(pos>=bins->
GetNrows()-1) {
1738 r *= (*bins)(pos+1)-(*bins)(pos);
1797 Error(
"GetBinFactor",
1798 "internal error: user function is neither TF1 or TVectorD");
1952 Error(
"GetDistributionAverageBinSize",
"axis %d does not exist",axis);
1971 return (*bins)[1]-(*bins)[0];
2015 }
else if(bin>=bins->
GetNrows()-1) {
2019 r=0.5*((*bins)[bin+1]+(*bins)[bin]);
2051 if((i>=0)&&(i<
nMax)) {
2066 Fatal(
"ToGlobalBin",
"bad input %d for dimensionless binning %s %d",
2169 Error(
"DecodeAxisSteering",
2170 "steering \"%s\" does not end with [options]",
2171 (
const char *)pattern);
static void indent(ostringstream &buf, int indent_level)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
TVectorT< Double_t > TVectorD
Class to manage histogram axis.
const char * GetTitle() const override
Returns title of object.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
1-D histogram with a double per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
virtual Int_t GetDimension() const
virtual Int_t GetBin(Int_t binx, Int_t biny=0, Int_t binz=0) const
Return Global bin number corresponding to binx,y,z.
2-D histogram with a double per channel (see TH1 documentation)
Service class for 2-D histogram classes.
3-D histogram with a double per channel (see TH1 documentation)
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Int_t GetEntriesFast() const
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
void AddLast(TObject *obj) override
Add object in the next empty slot in the array.
Collectable string class.
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Binning schemes for use with the unfolding algorithm TUnfoldDensity.
void PrintStream(std::ostream &out, Int_t indent=0, int debug=0) const
Print some information about this binning tree.
Int_t ToGlobalBin(Int_t const *axisBins, Int_t *isBelow=nullptr, Int_t *isAbove=nullptr) const
Get global bin number, given axis bin numbers.
Bool_t HasOverflow(int axis) const
check whether the axis has an overflow bin
~TUnfoldBinning(void) override
TH1 * CreateHistogram(const char *histogramName, Bool_t originalAxisBinning=kFALSE, Int_t **binMap=nullptr, const char *histogramTitle=nullptr, const char *axisSteering=nullptr) const
Create a THxx histogram capable to hold the bins of this binning node and its children.
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.
virtual Double_t GetDistributionOverflowBinWidth(Int_t axis) const
Return bin width assigned to the overflow bin.
Int_t fFirstBin
global bin number of the first bin
void SetBinFactorFunction(Double_t normalisation, TF1 *userFunc=nullptr)
Set normalisation factor and function which are used in calls to GetBinFactor().
TH1 * ExtractHistogram(const char *histogramName, const TH1 *globalBins, const TH2 *globalBinsEmatrix=nullptr, Bool_t originalAxisBinning=kTRUE, const char *axisSteering=nullptr) const
Extract a distribution from the given set of global bins.
Int_t UpdateFirstLastBin(Bool_t startWithRootNode=kTRUE)
Update fFirstBin and fLastBin members of this node and its children.
TString BuildHistogramTitle(const char *histogramName, const char *histogramTitle, Int_t const *axisList) const
Construct a title.
Int_t FillBinMapRecursive(Int_t startBin, const char *axisSteering, Int_t *binMap) const
Recursively fill bin map.
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,...
TUnfoldBinning * parentNode
mother node
Int_t GetDistributionDimension(void) const
query dimension of this node's distribution
TUnfoldBinning const * GetPrevNode(void) const
previous sister node
void SetBinFactor(Double_t normalisation, TObject *factors)
Set normalisation factors which are used in calls to GetBinFactor().
TUnfoldBinning * childNode
first daughter node
TString GetBinName(Int_t iBin) const
Get the name of a bin.
Int_t GetTH1xNumberOfBins(Bool_t originalAxisBinning=kTRUE, const char *axisSteering=nullptr) const
Return the number of histogram bins required when storing this binning in a one-dimensional histogram...
virtual Double_t GetDistributionUnderflowBinWidth(Int_t axis) const
Return bin width assigned to the underflow bin.
Double_t GetBinSize(Int_t iBin) const
Get N-dimensional bin size.
Int_t GetDistributionNumberOfBins(void) const
number of bins in the distribution possibly including under/overflow
Double_t GetGlobalFactor(void) const
Return global scaling factor for this node.
Int_t GetGlobalBinNumber(Double_t x) const
Locate a bin in a one-dimensional distribution.
Bool_t HasUnconnectedBins(void) const
Check whether there are bins but no axis.
virtual Double_t GetBinFactor(Int_t iBin) const
Return scaling factor for the given global bin number.
TUnfoldBinning * nextNode
next sister
TObject * fBinFactorFunction
function to calculate a scale factor from bin centres (may be a TF1 or a TVectorD
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.
Int_t fHasUnderflow
bit fields indicating whether there are underflow bins on the axes
Int_t GetEndBin(void) const
last+1 bin of this node (includes children)
TObjArray * fAxisLabelList
for each axis its name (TObjString), or names of unconnected bins
Double_t fBinFactorConstant
common scale factor for all bins of this node
TUnfoldBinning const * GetNextNode(void) const
next sister node
Bool_t HasUnderflow(int axis) const
check whether an axis has an underflow bin
Int_t * CreateEmptyBinMap(void) const
Create an empty bin map, useful together with the getter methods of class TUnfold and TUnfoldSys.
TUnfoldBinning const * GetParentNode(void) const
mother node
@ MAXDIM
maximum numner of axes per distribution
static TH2D * CreateHistogramOfMigrations(TUnfoldBinning const *xAxis, TUnfoldBinning const *yAxis, char const *histogramName, Bool_t originalXAxisBinning=kFALSE, Bool_t originalYAxisBinning=kFALSE, char const *histogramTitle=nullptr)
Create a TH2D histogram capable to hold the bins of the two input binning schemes on the x and y axes...
TObjArray * fAxisList
for each axis the bin borders (TVectorD)
Int_t fLastBin
global bin number of the last(+1) bin, including daughters
void GetBinUnderflowOverflowStatus(Int_t iBin, Int_t *uStatus, Int_t *oStatus) const
Return bit maps indicating underflow and overflow status.
virtual Double_t GetDistributionBinCenter(Int_t axis, Int_t bin) const
return bin center for a given axis and bin number
Int_t fDistributionSize
number of bins in this node's distribution
Int_t fHasOverflow
bit fields indicating whether there are overflow bins on the axes
const TUnfoldBinning * GetNonemptyNode(void) const
Find a node which has non-empty distributions if there is none or if there are many,...
void Initialize(Int_t nBins)
Initialize variables for a given number of bins.
void SetBinMapEntry(Int_t *binMap, Int_t globalBin, Int_t destBin) const
Set one entry in a bin map.
virtual Double_t GetDistributionAverageBinSize(Int_t axis, Bool_t includeUnderflow, Bool_t includeOverflow) const
Get average bin size on the specified axis.
void DecodeAxisSteering(const char *axisSteering, const char *options, Int_t *isOptionGiven) const
Decode axis steering.
virtual Bool_t IsBinFactorGlobal(void) const
Check whether there is only a global scaling factor for this node.
TString GetDistributionAxisLabel(Int_t axis) const
get name of an axis
TUnfoldBinning * AddBinning(TUnfoldBinning *binning)
Add a TUnfoldBinning as the last child of this node.
const TObjString * GetUnconnectedBinName(Int_t bin) const
Return the bin names of unconnected bins.
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.
TVectorD const * GetDistributionBinning(Int_t axis) const
get vector of bin borders for one 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.
TH2D * CreateErrorMatrixHistogram(const char *histogramName, Bool_t originalAxisBinning, Int_t **binMap=nullptr, const char *histogramTitle=nullptr, const char *axisSteering=nullptr) const
Create a TH2D histogram capable to hold a covariance matrix.
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.
TUnfoldBinning * prevNode
previous sister
TUnfoldBinning const * GetRootNode(void) const
return root node of the binnig scheme
Int_t GetStartBin(void) const
first bin of this node
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.
TUnfoldBinning const * FindNode(char const *name) const
Traverse the tree and return the first node which matches the given name.
TUnfoldBinning(const char *name=nullptr, Int_t nBins=0, const char *binNames=nullptr)
Create a new node without axis.
Int_t GetTHxxBinsRecursive(const char *axisSteering) const
Calculate number of bins required to store this binning with the given axisSteering.
TUnfoldBinning const * GetChildNode(void) const
first daughter node
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 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.
Int_t Finite(Double_t x)
Check if it is finite with a mask in order to be consistent in presence of fast math.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.