ROOT » HIST » HIST » TUnfoldBinning

class TUnfoldBinning: public TNamed


  TUnfoldBinning

  This class serves as a container of analysis bins
  analysis bins are specified by defining the axes of a distribution.
  It is also possible to have unconnected analysis bins without axis.
  Multiple TUnfoldBinning objects may be arranged in a tree,
  such that a full tree structure of histograms and bins is supported

  If you use this software, please consider the following citation
       S.Schmitt, JINST 7 (2012) T10003 [arXiv:1205.6201]

  More documentation and updates are available on
      http://www.desy.de/~sschmitt

  Functionality

  The class gives access to all analysis bins numbered in sequence.
  Such a sequence of bins may be stored in a 1-dimension histogram.
  Correlations between two TUnfoldBinning objects may be stored in
  a 2-dimensional histogram. This type of ordering is required for
  the TUnfold class.

  In addition, it is possible to have root histograms, using the
  axes as defined with the distributions. Underflow/overflow bins
  can be included or excluded when mapping bins on root histograms.
  In addition, it is possible to collapse one of more axes when going
  from a N-dimensional distribution to a root histogram.


Function Members (Methods)

public:
virtual~TUnfoldBinning()
voidTObject::AbstractMethod(const char* method) const
Bool_tAddAxis(const TAxis& axis, Bool_t includeUnderflow, Bool_t includeOverflow)
Bool_tAddAxis(const char* name, Int_t nBins, const Double_t* binBorders, Bool_t hasUnderflow, Bool_t hasOverflow)
Bool_tAddAxis(const char* name, Int_t nBins, Double_t xMin, Double_t xMax, Bool_t hasUnderflow, Bool_t hasOverflow)
TUnfoldBinning*AddBinning(TUnfoldBinning* binning)
TUnfoldBinning*AddBinning(const char* name, Int_t nBins = 0, const char* binNames = 0)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
TH2D*CreateErrorMatrixHistogram(const char* histogramName, Bool_t originalAxisBinning, Int_t** binMap = 0, const char* histogramTitle = 0, const char* axisSteering = 0) const
TH1*CreateHistogram(const char* histogramName, Bool_t originalAxisBinning = kFALSE, Int_t** binMap = 0, const char* histogramTitle = 0, const char* axisSteering = 0) const
static TH2D*CreateHistogramOfMigrations(const TUnfoldBinning* xAxis, const TUnfoldBinning* yAxis, const char* histogramName, Bool_t originalXAxisBinning = kFALSE, Bool_t originalYAxisBinning = kFALSE, const char* histogramTitle = 0)
voidDecodeAxisSteering(const char* axisSteering, const char* options, Int_t* isOptionGiven) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
TH1*ExtractHistogram(const char* histogramName, const TH1* globalBins, const TH2* globalBinsEmatrix = 0, Bool_t originalAxisBinning = kTRUE, const char* axisSteering = 0) const
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
const TUnfoldBinning*FindNode(const char* name) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Double_tGetBinFactor(Int_t iBin) const
const TUnfoldBinning*GetBinLocation(Int_t binTHxx, const char* axisSteering, Int_t[32] axisBins) const
TStringGetBinName(Int_t iBin) const
voidGetBinNeighbours(Int_t globalBin, Int_t axis, Int_t* prev, Double_t* distPrev, Int_t* next, Double_t* distNext) const
Double_tGetBinSize(Int_t iBin) const
voidGetBinUnderflowOverflowStatus(Int_t iBin, Int_t* uStatus, Int_t* oStatus) const
const TUnfoldBinning*GetChildNode() const
virtual Double_tGetDistributionAverageBinSize(Int_t axis, Bool_t includeUnderflow, Bool_t includeOverflow) const
TStringGetDistributionAxisLabel(Int_t axis) const
virtual Double_tGetDistributionBinCenter(Int_t axis, Int_t bin) const
const TVectorD*GetDistributionBinning(Int_t axis) const
Int_tGetDistributionDimension() const
Int_tGetDistributionNumberOfBins() const
virtual Double_tGetDistributionOverflowBinWidth(Int_t axis) const
virtual Double_tGetDistributionUnderflowBinWidth(Int_t axis) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Int_tGetEndBin() const
Int_tGetGlobalBinNumber(Double_t x) const
Int_tGetGlobalBinNumber(const Double_t* x) const
Int_tGetGlobalBinNumber(Double_t x, Double_t y) const
Int_tGetGlobalBinNumber(Double_t x, Double_t y, Double_t z) const
Int_tGetGlobalBinNumber(Double_t x0, Double_t x1, Double_t x2, Double_t x3) const
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
const TUnfoldBinning*GetNextNode() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
const TUnfoldBinning*GetParentNode() const
const TUnfoldBinning*GetPrevNode() const
Int_tGetStartBin() const
Int_tGetTH1xNumberOfBins(Bool_t originalAxisBinning = kTRUE, const char* axisSteering = 0) const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TUnfoldBinning&operator=(const TUnfoldBinning&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
voidPrintStream(ostream& out, Int_t indent = 0) const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidSetBinFactorFunction(Double_t normalisation, TF1* userFunc = 0)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TUnfoldBinning(const TUnfoldBinning&)
TUnfoldBinning(const char* name = 0, Int_t nBins = 0, const char* binNames = 0)
TUnfoldBinning(const TAxis& axis, Int_t includeUnderflow, Int_t includeOverflow)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
TStringBuildHistogramTitle(const char* histogramName, const char* histogramTitle, const Int_t* axisList) const
TStringBuildHistogramTitle2D(const char* histogramName, const char* histogramTitle, Int_t xAxis, const TUnfoldBinning* yAxisBinning, Int_t yAxis) const
Int_t*CreateBinMap(const TH1* hist, Int_t nDim, const Int_t* axisList, const char* axisSteering) const
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
Int_tFillBinMapRecursive(Int_t startBin, const char* axisSteering, Int_t* binMap) const
Int_tFillBinMapSingleNode(const TH1* hist, Int_t startBin, Int_t nDim, const Int_t* axisList, const char* axisSteering, Int_t* binMap) const
const TUnfoldBinning*GetBinLocationRecursive(Int_t& offset, const char* axisSteering, Int_t[32] axisBins) const
const TUnfoldBinning*GetNonemptyNode() const
TUnfoldBinning*GetRootNode()
const TUnfoldBinning*GetRootNode() const
Int_tGetTHxxBinning(Int_t maxDim, Int_t* axisBins, Int_t* axisList, const char* axisSteering) const
Int_tGetTHxxBinningSingleNode(Int_t maxDim, Int_t* axisBins, Int_t* axisList, const char* axisSteering) const
Int_tGetTHxxBinsRecursive(const char* axisSteering) const
Bool_tHasUnconnectedBins() const
voidInitialize(Int_t nBins)
voidTObject::MakeZombie()
const TUnfoldBinning*ToAxisBins(Int_t globalBin, Int_t* axisBins) const
Int_tToGlobalBin(const Int_t* axisBins) const
Int_tUpdateFirstLastBin(Bool_t startWithRootNode = kTRUE)

Data Members

public:
static TUnfoldBinning::(anonymous)MAXDIM
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
TUnfoldBinning*childNodefirst daughter node
TObjArray*fAxisLabelListfor each axis its name (TObjString)
TObjArray*fAxisListfor each axis the bin borders (TVectorD)
Double_tfBinFactorConstantscale factor on user factor
TF1*fBinFactorFunctionfunction to calculate user factor from bin centres (default function is a constant)
Int_tfDistributionSizenumber of bins in this node's distribution
Int_tfFirstBinglobal bin number of the first bin
Int_tfHasOverflowbit fields indicating whether there are underflow/overflow bins on the axes
Int_tfHasUnderflowbit fields indicating whether there are underflow/overflow bins on the axes
Int_tfLastBinglobal bin number of the last(+1) bin
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
TUnfoldBinning*nextNodenext sister
TUnfoldBinning*parentNodemother node
TUnfoldBinning*prevNodeprevious sister

Class Charts

Inheritance Chart:
TObject
TNamed
TUnfoldBinning

Function documentation

void Initialize(Int_t nBins)
 initialize variables
Int_t UpdateFirstLastBin(Bool_t startWithRootNode = kTRUE)
 update fFirstBin and fLastBin members of this node and its children
   startWithRootNode: if true, start the update with the root node
~TUnfoldBinning(void)
 delete all children
TUnfoldBinning * AddBinning(TUnfoldBinning* binning)
 add a binning as last daughter to this tree
   binning: pointer to the new binning
 return value: if succeeded, return "binning"
               otherwise return 0
void PrintStream(ostream& out, Int_t indent = 0) const
 print some information about this binning tree
    out: stream to write to
    indent: initial indentation (sub-trees have indent+1)
TUnfoldBinning const * FindNode(const char* name) const
 parse the tree and return a node with the given name
   name: the name of the node to find
TUnfoldBinning * GetRootNode(void)
 return root node
TUnfoldBinning const * GetRootNode(void)
 return root node
const TUnfoldBinning * GetNonemptyNode(void)
 get the node which has non-empty distributions
 if there is none or if there are many, return zero
Int_t GetTHxxBinsRecursive(const char* axisSteering) const
 input:
   axisSteering :
       "pattern1;pattern2;...;patternN"
       patternI = axis[mode]
       axis = name or *
       mode = C|U|O
        C: collapse axis into one bin
        U: discarde underflow bin
        O: discarde overflow bin
 output:
   binMap[] : map global bin numbers to histogram bins
 return value :  number of bins
Int_t GetGlobalBinNumber(Double_t x) const
 locate bin on a one-dimensional distribution
 input
    x: coordinate to locate
Int_t GetGlobalBinNumber(Double_t x, Double_t y) const
 locate bin on a two-dimensional distribution
 input
    x,y: coordinates to locate
Int_t GetGlobalBinNumber(const Double_t* x) const
 locate bin on a n-dimensional distribution
 input
    x[]: coordinates to locate
TString GetBinName(Int_t iBin) const
 get the name of a bin in the given tree
    iBin: bin number
Double_t GetBinSize(Int_t iBin) const
 get N-dimensional bin size
 input:
    iBin : global bin number
    includeUO : include underflow/overflow bins or not
Double_t GetBinFactor(Int_t iBin) const
 return user factor for a bin
    iBin : global bin number
Bool_t HasUnconnectedBins(void)
 check whether there are bins but no axis
Double_t GetDistributionUnderflowBinWidth(Int_t axis) const
 return width of the underflow bin
   axis: axis number
Double_t GetDistributionOverflowBinWidth(Int_t axis) const
 return width of the underflow bin
   axis: axis number
Int_t ToGlobalBin(const Int_t* axisBins) const
 get global bin number, given axis bin numbers
   axisBins[]: bin numbers on each axis
 return: global bin nmber or -1 if not inside distribution
TUnfoldBinning(const char* name = 0, Int_t nBins = 0, const char* binNames = 0)
 setup 
TUnfoldBinning(const TAxis& axis, Int_t includeUnderflow, Int_t includeOverflow)
TUnfoldBinning * AddBinning(TUnfoldBinning* binning)
Bool_t AddAxis(const char* name, Int_t nBins, const Double_t* binBorders, Bool_t hasUnderflow, Bool_t hasOverflow)
Bool_t AddAxis(const TAxis& axis, Bool_t includeUnderflow, Bool_t includeOverflow)
void SetBinFactorFunction(Double_t normalisation, TF1* userFunc = 0)
TUnfoldBinning const * GetChildNode(void)
 Navigation 
{ return childNode; }
TUnfoldBinning const * GetPrevNode(void)
{ return prevNode; }
TUnfoldBinning const * GetNextNode(void)
{ return nextNode; }
TUnfoldBinning const * GetParentNode(void)
{ return parentNode; }
Int_t GetTH1xNumberOfBins(Bool_t originalAxisBinning = kTRUE, const char* axisSteering = 0) const
 Create THxx histograms 
TH1 * CreateHistogram(const char* histogramName, Bool_t originalAxisBinning = kFALSE, Int_t** binMap = 0, const char* histogramTitle = 0, const char* axisSteering = 0) const
TH2D * CreateErrorMatrixHistogram(const char* histogramName, Bool_t originalAxisBinning, Int_t** binMap = 0, const char* histogramTitle = 0, const char* axisSteering = 0) const
TH2D * CreateHistogramOfMigrations(const TUnfoldBinning* xAxis, const TUnfoldBinning* yAxis, const char* histogramName, Bool_t originalXAxisBinning = kFALSE, Bool_t originalYAxisBinning = kFALSE, const char* histogramTitle = 0)
 Calculate global bin number 
Int_t GetGlobalBinNumber(Double_t x) const
Int_t GetGlobalBinNumber(Double_t x, Double_t y) const
Int_t GetStartBin(void)
{ return fFirstBin; }
Int_t GetEndBin(void)
{ return fLastBin; }
void GetBinUnderflowOverflowStatus(Int_t iBin, Int_t* uStatus, Int_t* oStatus) const
void GetBinNeighbours(Int_t globalBin, Int_t axis, Int_t* prev, Double_t* distPrev, Int_t* next, Double_t* distNext) const
 access by bin number, given an axis steering 
{ MAXDIM=32 }
const TUnfoldBinning * GetBinLocation(Int_t binTHxx, const char* axisSteering, Int_t[32] axisBins) const
 access distribution properties 
Int_t GetDistributionNumberOfBins(void)
{ return fDistributionSize; }
Int_t GetDistributionDimension(void)
{ return fAxisList->GetEntriesFast(); }
Double_t GetDistributionAverageBinSize(Int_t axis, Bool_t includeUnderflow, Bool_t includeOverflow) const
TVectorD const * GetDistributionBinning(Int_t axis) const
TString GetDistributionAxisLabel(Int_t axis) const
Double_t GetDistributionBinCenter(Int_t axis, Int_t bin) const
TUnfoldBinning const * ToAxisBins(Int_t globalBin, Int_t* axisBins) const
TString BuildHistogramTitle(const char* histogramName, const char* histogramTitle, const Int_t* axisList) const
Int_t GetTHxxBinning(Int_t maxDim, Int_t* axisBins, Int_t* axisList, const char* axisSteering) const
Int_t GetTHxxBinningSingleNode(Int_t maxDim, Int_t* axisBins, Int_t* axisList, const char* axisSteering) const
const TUnfoldBinning * GetBinLocationRecursive(Int_t& offset, const char* axisSteering, Int_t[32] axisBins) const
Int_t * CreateBinMap(const TH1* hist, Int_t nDim, const Int_t* axisList, const char* axisSteering) const
Int_t FillBinMapRecursive(Int_t startBin, const char* axisSteering, Int_t* binMap) const