AliPhysics  8d00e07 (8d00e07)
TVariableBinning Class Reference

Class creating a variable binning, used in the histogram manager. More...

#include <TVariableBinning.h>

Inheritance diagram for TVariableBinning:

Classes

class  LimitsNotSetException
 Exception indicating that the limits are not set. More...
 

Public Member Functions

 TVariableBinning ()
 
 TVariableBinning (Int_t nbins, const Double_t *binedges)
 
 TVariableBinning (const TArrayD &binedges)
 
virtual ~TVariableBinning ()
 
virtual TBinningMakeCopy () const
 
void Set (Int_t nbins, const Double_t *binedges)
 
void Set (const TArrayD &binedges)
 
virtual void CreateBinEdges (TArrayD &binedges) const
 
- Public Member Functions inherited from TBinning
 TBinning ()
 
virtual ~TBinning ()
 

Private Attributes

TArrayD fBinEdges
 

Detailed Description

Class creating a variable binning, used in the histogram manager.

Author
Markus Fasel
Since
May 31st, 2016

This class creates a varible (non-linear) binning. For this the user must provide

  • A minimum
  • A maximum
  • The number of bins

The information can be set either in the constructor

TArrayD binedges;
binedges[0] = 0.;
binedges[1] = 0.5;
binedges[2] = 1;
binedges[3] = 2.;
binedges[4] = 5.;
binedges[5] = 10.;
TVariableBinning mybinning(binedges);

or using the set function

TArrayD binedges;
binedges[0] = 0.;
binedges[1] = 0.5;
binedges[2] = 1;
binedges[3] = 2.;
binedges[4] = 5.;
binedges[5] = 10.;
TVariableBinning mybinning;
mybinning.Set(binedges);

The binning can be converted to a TArrayD which contains the bin edges in increasing order:

TArrayD binlimits;
mybinning.CreateBinEdges(binlimits);
Note
In case the binning is used together with the THistManager the last step is done by the THistManager and does not need to be performed by the user.

Definition at line 60 of file TVariableBinning.h.

Constructor & Destructor Documentation

TVariableBinning::TVariableBinning ( )

Constructor

Definition at line 17 of file TVariableBinning.cxx.

Referenced by MakeCopy(), and TVariableBinning::LimitsNotSetException::what().

TVariableBinning::TVariableBinning ( Int_t  nbins,
const Double_t binedges 
)

Constructor, defining the bin edges from a c-array

Parameters
[in]nbinsNumber of bins
[in]binedgesBin edges

Definition at line 24 of file TVariableBinning.cxx.

TVariableBinning::TVariableBinning ( const TArrayD binedges)

Constructor, defining the bin edges from a ROOT-array

Parameters
[in]binedgesBin edges

Definition at line 31 of file TVariableBinning.cxx.

virtual TVariableBinning::~TVariableBinning ( )
inlinevirtual

Destructor

Definition at line 113 of file TVariableBinning.h.

Member Function Documentation

void TVariableBinning::CreateBinEdges ( TArrayD binedges) const
virtual

Converting the variable binning in a set of bin edges

Parameters
binedges

Implements TBinning.

Definition at line 38 of file TVariableBinning.cxx.

Referenced by Set().

TBinning * TVariableBinning::MakeCopy ( ) const
virtual

Implementation of the copy function for the linear binning class

Returns
Copy of this binning with the exact same bin edges

Implements TBinning.

Definition at line 45 of file TVariableBinning.cxx.

Referenced by ~TVariableBinning().

void TVariableBinning::Set ( Int_t  nbins,
const Double_t binedges 
)
inline

Set the binning from a c-array

Parameters
[in]nbinsNumber of bins
[in]binedgesBin edges

Definition at line 145 of file TVariableBinning.h.

Referenced by TVariableBinning(), and ~TVariableBinning().

void TVariableBinning::Set ( const TArrayD binedges)
inline

Set the binning from a ROOT array

Parameters
[in]binedgesBin edges

Definition at line 132 of file TVariableBinning.h.

Member Data Documentation

TArrayD TVariableBinning::fBinEdges
private

Definition at line 142 of file TVariableBinning.h.

Referenced by CreateBinEdges(), and Set().


The documentation for this class was generated from the following files: