AliPhysics  ec7afe5 (ec7afe5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TLinearBinning Class Reference

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

#include <TLinearBinning.h>

Inheritance diagram for TLinearBinning:

Classes

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

Public Member Functions

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

Private Attributes

Int_t fNbins
 Number of bins. More...
 
Double_t fMinimum
 Minimum of the binning. More...
 
Double_t fMaximum
 Maximum of the binning. More...
 
Bool_t fLimitsSet
 Switch indicating that the binning is initialized. More...
 

Detailed Description

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

Author
Markus Fasel
Since
May 31st, 2016

This class creates a 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

TLinearBinning mybinning(100, -10., 10.);

or using the set function

TLinearBinning mybinning;
mybinning.Set(100, -10, 10);

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 47 of file TLinearBinning.h.

Constructor & Destructor Documentation

TLinearBinning::TLinearBinning ( )

Constructor

Definition at line 21 of file TLinearBinning.cxx.

Referenced by MakeCopy().

TLinearBinning::TLinearBinning ( Int_t  nbins,
Double_t  min,
Double_t  max 
)

Constructor, defining the limits and the number of bins

Parameters
[in]nbinsNumber of bins
[in]minMinimum bin edge of the binning
[in]maxMaximum bin edge of the binning

Definition at line 31 of file TLinearBinning.cxx.

virtual TLinearBinning::~TLinearBinning ( )
inlinevirtual

Destructor

Definition at line 95 of file TLinearBinning.h.

Member Function Documentation

void TLinearBinning::CreateBinEdges ( TArrayD binedges) const
virtual

Converting the linear binning in a set of bin edges

Parameters
binedges

Implements TBinning.

Definition at line 41 of file TLinearBinning.cxx.

TBinning * TLinearBinning::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 60 of file TLinearBinning.cxx.

void TLinearBinning::Set ( Int_t  nbins,
Double_t  min,
Double_t  max 
)
inline

Set the binning with minimum, maximum and number of bins

Parameters
[in]nbinsNumber of bins
[in]minMinimum of the binning
[in]maxMaximum of the binning

Definition at line 124 of file TLinearBinning.h.

Member Data Documentation

Bool_t TLinearBinning::fLimitsSet
private

Switch indicating that the binning is initialized.

Definition at line 121 of file TLinearBinning.h.

Referenced by CreateBinEdges(), and Set().

Double_t TLinearBinning::fMaximum
private

Maximum of the binning.

Definition at line 120 of file TLinearBinning.h.

Referenced by CreateBinEdges(), and Set().

Double_t TLinearBinning::fMinimum
private

Minimum of the binning.

Definition at line 119 of file TLinearBinning.h.

Referenced by CreateBinEdges(), and Set().

Int_t TLinearBinning::fNbins
private

Number of bins.

Definition at line 118 of file TLinearBinning.h.

Referenced by CreateBinEdges(), and Set().


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