AliPhysics  80ccde44 (80ccde44)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliPoissonCalculator Class Reference

#include <AliPoissonCalculator.h>

Inheritance diagram for AliPoissonCalculator:

Public Member Functions

 AliPoissonCalculator ()
 
 AliPoissonCalculator (const char *)
 
 AliPoissonCalculator (const AliPoissonCalculator &o)
 
virtual ~AliPoissonCalculator ()
 
AliPoissonCalculatoroperator= (const AliPoissonCalculator &o)
 
void SetLumping (UShort_t nx, UShort_t ny)
 
void SetXLumping (UShort_t nx)
 
void SetYLumping (UShort_t ny)
 
void Init (Int_t xLumping=-1, Int_t yLumping=-1)
 
void Define (const TAxis &xaxis, const TAxis &yaxis)
 
void MakeOutput ()
 
void Output (TList *d)
 
void Reset (const TH2D *base)
 
void Fill (UShort_t strip, UShort_t sec, Bool_t hit, Double_t weight=1)
 
TH2DResult (Bool_t correct=true)
 
void FillDiagnostics ()
 
Bool_t IsFolder () const
 
void Print (const Option_t *option="") const
 
void Browse (TBrowser *b)
 
TH2DGetEmptyVsTotal () const
 
TH1DGetMean () const
 
TH1DGetOccupancy () const
 
TH2DGetCorrection () const
 
Int_t GetReducedXBin (Int_t ix) const
 
Int_t GetReducedXBin (Double_t x) const
 
Int_t GetReducedYBin (Int_t iy) const
 
Int_t GetReducedYBin (Double_t y) const
 

Protected Member Functions

Int_t CheckLumping (char which, Int_t nBins, Int_t lumping) const
 
void CleanUp ()
 
Double_t CalculateMean (Double_t empty, Double_t total) const
 
Double_t CalculateCorrection (Double_t empty, Double_t total) const
 

Protected Attributes

UShort_t fXLumping
 
UShort_t fYLumping
 
TH2DfTotal
 
TH2DfEmpty
 
TH2DfBasic
 
TH2DfEmptyVsTotal
 
TH1DfMean
 
TH1DfOcc
 
TH2DfCorr
 

Detailed Description

A class to calculate the multiplicity in \((\eta,\varphi)\) bins using Poisson statistics.

The input is assumed to be binned in \((\eta,\varphi)\) as described by the 2D histogram passwd to the Reset member function.

The data is grouped in to regions as defined by the parameters fXLumping and fYLumping. The total number of cells and number of empty cells is then calculate in each region. The mean multiplicity over the region is then determined as

\[ \langle m\rangle = -\log\left(\frac{e}{t}\right) \]

where \( e\) is the number of empty cells and \(t\) is the total number of cells in the region. A correction for counting statistics, is then applied

\begin{eqnarray*} c &=& \frac{1}{1 - \exp{-\langle m\rangle}}\\ &=& \frac{1}{1 - \frac{e}{t}} \end{eqnarray*}

and the final number in each cell is then \(h_i c \langle m\rangle\) where \(h_i\) is the number of hits in the cell \(i\)

Definition at line 36 of file AliPoissonCalculator.h.

Constructor & Destructor Documentation

AliPoissonCalculator::AliPoissonCalculator ( )

Constructor

Definition at line 54 of file AliPoissonCalculator.cxx.

AliPoissonCalculator::AliPoissonCalculator ( const char *  )

Constructor

Definition at line 72 of file AliPoissonCalculator.cxx.

AliPoissonCalculator::AliPoissonCalculator ( const AliPoissonCalculator o)

Copy constructor

Parameters
oObject to copy from

Definition at line 89 of file AliPoissonCalculator.cxx.

AliPoissonCalculator::~AliPoissonCalculator ( )
virtual

Destructor

Definition at line 106 of file AliPoissonCalculator.cxx.

Member Function Documentation

void AliPoissonCalculator::Browse ( TBrowser *  b)

Browse this object

Parameters
bObject to browse

Definition at line 451 of file AliPoissonCalculator.cxx.

Double_t AliPoissonCalculator::CalculateCorrection ( Double_t  empty,
Double_t  total 
) const
protected

The mean \(\lambda\) calculated above is not the full story. In addition it needs to be corrected using the expression

\[ \frac{1}{1-e^{\lambda}} = \frac{1}{1-\frac{N_{empty}}{N_{total}}} \]

Note the boundary conditions

  • \(N_{total}=0 \rightarrow\lambda=0\)
  • \(|N_{total}-N_{empty}|<\epsilon\rightarrow N_{empty} = N_{total}-\epsilon\)
Parameters
emptyNumber of empty bins
totalTotal number of bins
Returns
The correction to the mean.

Definition at line 335 of file AliPoissonCalculator.cxx.

Referenced by FillDiagnostics(), and Result().

Double_t AliPoissonCalculator::CalculateMean ( Double_t  empty,
Double_t  total 
) const
protected

Calculate the mean

This is based on the fact that for a Poisson

\[ P(n;\lambda) = \frac{-\lambda^n e^{-\lambda}}{n!} \]

we have the probability for 0 observation

\[ P(0;\lambda) = e^{-\lambda} = \frac{N_{empty}}{N_{total}} \]

and so we get that the mean is the defined region is

\[ \lambda = -\log\left(\frac{N_{empty}}{N_{total}}\right) \]

Note the boundary conditions

  • \(N_{total}=0 \rightarrow\lambda=0\)
  • \(N_{empty}<\epsilon\rightarrow N_{empty} = \epsilon\)
Parameters
emptyNumber of empty bins
totalTotal number of bins
Returns
The mean in the defined region

Definition at line 327 of file AliPoissonCalculator.cxx.

Referenced by FillDiagnostics(), and Result().

Int_t AliPoissonCalculator::CheckLumping ( char  which,
Int_t  nBins,
Int_t  lumping 
) const
protected

check that the lumping parameter makes sense

Parameters
whichWhich axis
nBinsNumber of bins
lumpingLumping
Returns
The new value of the lumping

Definition at line 247 of file AliPoissonCalculator.cxx.

Referenced by Reset().

void AliPoissonCalculator::CleanUp ( )
protected

Clean up allocated space

Definition at line 113 of file AliPoissonCalculator.cxx.

Referenced by operator=(), and SetLumping().

void AliPoissonCalculator::Define ( const TAxis xaxis,
const TAxis yaxis 
)

Initialize this object.

Also book the cache histograms

Parameters
xaxisThe X-axis
yaxisThe Y-axis

Definition at line 154 of file AliPoissonCalculator.cxx.

void AliPoissonCalculator::Fill ( UShort_t  strip,
UShort_t  sec,
Bool_t  hit,
Double_t  weight = 1 
)

Fill in an observation

Parameters
stripX axis bin number
secY axis bin number
hitTrue if hit
weightWeight if this

Definition at line 309 of file AliPoissonCalculator.cxx.

Referenced by AliFMDDensityCalculator::Calculate(), and TestPoisson().

void AliPoissonCalculator::FillDiagnostics ( )

After calculating the results, fill the diagnostics histograms

Definition at line 414 of file AliPoissonCalculator.cxx.

Referenced by AliFMDDensityCalculator::Calculate().

TH2D* AliPoissonCalculator::GetCorrection ( ) const
inline

Get the correction histogram

Returns
correction histogram

Definition at line 182 of file AliPoissonCalculator.h.

Referenced by TestPoisson().

TH2D* AliPoissonCalculator::GetEmptyVsTotal ( ) const
inline

Get the empty versus total histogram

Returns
Empty versus total

Definition at line 164 of file AliPoissonCalculator.h.

TH1D* AliPoissonCalculator::GetMean ( ) const
inline

Get the histogram of the means

Returns
Means

Definition at line 170 of file AliPoissonCalculator.h.

Referenced by TestPoisson().

TH1D* AliPoissonCalculator::GetOccupancy ( ) const
inline

Get the occupancy histogram

Returns
Occupancy histogram

Definition at line 176 of file AliPoissonCalculator.h.

Referenced by TestPoisson().

Int_t AliPoissonCalculator::GetReducedXBin ( Int_t  ix) const

Get the X bin in the reduced historgam

Parameters
ixX bin in full histogram
Returns
X bin in reduced histogram

Definition at line 344 of file AliPoissonCalculator.cxx.

Referenced by Result().

Int_t AliPoissonCalculator::GetReducedXBin ( Double_t  x) const

Get the X bin in the reduced historgam

Parameters
xX value
Returns
X bin in reduced histogram

Definition at line 352 of file AliPoissonCalculator.cxx.

Int_t AliPoissonCalculator::GetReducedYBin ( Int_t  iy) const

Get the Y bin in the reduced historgam

Parameters
iyY bin in full histogram
Returns
Y bin in reduced histogram

Definition at line 359 of file AliPoissonCalculator.cxx.

Referenced by Result().

Int_t AliPoissonCalculator::GetReducedYBin ( Double_t  y) const

Get the Y bin in the reduced historgam

Parameters
yY value
Returns
Y bin in reduced histogram

Definition at line 367 of file AliPoissonCalculator.cxx.

void AliPoissonCalculator::Init ( Int_t  xLumping = -1,
Int_t  yLumping = -1 
)

Intialize this object

Parameters
xLumpingIf larger than 0, set the eta lumping to this
yLumpingIf larger than 0, set the phi lumping to this

Definition at line 139 of file AliPoissonCalculator.cxx.

Referenced by AliPoissonCalculator(), operator=(), SetLumping(), and TestPoisson().

Bool_t AliPoissonCalculator::IsFolder ( ) const
inline
Returns
Always true

Definition at line 145 of file AliPoissonCalculator.h.

void AliPoissonCalculator::MakeOutput ( )

Make output stuff for the passed list

Definition at line 182 of file AliPoissonCalculator.cxx.

Referenced by Init(), and Output().

AliPoissonCalculator & AliPoissonCalculator::operator= ( const AliPoissonCalculator o)

Assignment operator

Parameters
oObject to assign from
Returns
Reference to this object

Definition at line 125 of file AliPoissonCalculator.cxx.

void AliPoissonCalculator::Output ( TList d)

Output stuff to the passed list

Parameters
dList to add output histograms to

Definition at line 223 of file AliPoissonCalculator.cxx.

void AliPoissonCalculator::Print ( const Option_t option = "") const

Print information

Parameters
optionNot used

Definition at line 432 of file AliPoissonCalculator.cxx.

void AliPoissonCalculator::Reset ( const TH2D base)

Reset the cache histogram

Parameters
baseBase histogram

Definition at line 261 of file AliPoissonCalculator.cxx.

Referenced by AliPoissonCalculator(), AliFMDDensityCalculator::Calculate(), Define(), operator=(), and TestPoisson().

TH2D * AliPoissonCalculator::Result ( Bool_t  correct = true)

Calculate result and store in output

Parameters
correctWhether to apply correction or not
Returns
The result histogram (fBase overwritten)

Definition at line 377 of file AliPoissonCalculator.cxx.

Referenced by AliFMDDensityCalculator::Calculate(), and TestPoisson().

void AliPoissonCalculator::SetLumping ( UShort_t  nx,
UShort_t  ny 
)

Set the number of eta bins to group into a region

Parameters
nxNumber of \(\eta\) bins per region
nyNumber of \(\phi\) bins per region

Definition at line 235 of file AliPoissonCalculator.cxx.

Referenced by AliFMDDensityCalculator::CreateOutputObjects(), SetXLumping(), and SetYLumping().

void AliPoissonCalculator::SetXLumping ( UShort_t  nx)
inline

Set the number of X bins to group into a region

Parameters
nxNumber of eta bins per region

Definition at line 79 of file AliPoissonCalculator.h.

void AliPoissonCalculator::SetYLumping ( UShort_t  ny)
inline

Set the number of Y bins to group into a region

Parameters
nyNumber of eta bins per region

Definition at line 85 of file AliPoissonCalculator.h.

Member Data Documentation

TH2D* AliPoissonCalculator::fBasic
protected
TH2D* AliPoissonCalculator::fCorr
protected
TH2D* AliPoissonCalculator::fEmpty
protected
TH2D* AliPoissonCalculator::fEmptyVsTotal
protected
TH1D* AliPoissonCalculator::fMean
protected

Definition at line 284 of file AliPoissonCalculator.h.

Referenced by Browse(), CleanUp(), FillDiagnostics(), GetMean(), MakeOutput(), and Output().

TH1D* AliPoissonCalculator::fOcc
protected
TH2D* AliPoissonCalculator::fTotal
protected

Definition at line 280 of file AliPoissonCalculator.h.

Referenced by Browse(), CleanUp(), Fill(), FillDiagnostics(), Reset(), Result(), and SetLumping().

UShort_t AliPoissonCalculator::fXLumping
protected

Definition at line 278 of file AliPoissonCalculator.h.

Referenced by Init(), MakeOutput(), operator=(), Print(), Reset(), and SetLumping().

UShort_t AliPoissonCalculator::fYLumping
protected

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