AliPhysics  b752f14 (b752f14)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliTrackletdNdetaUtils Class Reference
Inheritance diagram for AliTrackletdNdetaUtils:

Public Types

typedef TList Container
 

Public Member Functions

 AliTrackletdNdetaUtils ()
 
virtual ~AliTrackletdNdetaUtils ()
 

Static Public Member Functions

Service functions to check histogram consistencies
static Bool_t CheckAxisNBins (const char *which, const TAxis *a1, const TAxis *a2)
 
static Bool_t CheckAxisLimits (const char *which, const TAxis *a1, const TAxis *a2)
 
static Bool_t CheckAxisBins (const char *which, const TAxis *a1, const TAxis *a2)
 
static Bool_t CheckAxisLabels (const char *which, const TAxis *a1, const TAxis *a2)
 
static Bool_t CheckAxis (const char *which, const TAxis *a1, const TAxis *a2, Bool_t alsoLbls)
 
static Bool_t CheckConsistency (const TH1 *h1, const TH1 *h2)
 
Utilities
static TObjectGetO (Container *parent, const char *name, TClass *cls)
 
static TObjectGetO (TDirectory *parent, const char *name, TClass *cls)
 
static TH1GetH1 (Container *parent, const char *name)
 
static TH2GetH2 (Container *parent, const char *name)
 
static ContainerGetC (Container *parent, const char *name)
 
static ContainerGetC (TDirectory *parent, const char *name)
 
static Double_t GetD (Container *parent, const char *name, Double_t def=-1)
 
static Int_t GetI (Container *parent, const char *name, Int_t def=-1)
 
static Int_t GetB (Container *parent, const char *name, Bool_t def=false)
 
static TH1CopyH1 (Container *parent, const char *name, const char *newName=0)
 
static TH2CopyH2 (Container *parent, const char *name, const char *newName=0)
 
static TH1Make1D (Container &c, const TString &name, const TString &title, Color_t color, Style_t style, const TAxis &xAxis)
 
static TH2Make2D (Container &c, const TString &name, const TString &title, Color_t color, Style_t style, const TAxis &xAxis, const TAxis &yAxis)
 
static TH1Scale (TH1 *h, Double_t x, Double_t xe)
 
static TH2Scale (TH2 *h, Double_t x, Double_t xe)
 
static TH2Scale (TH2 *h, TH1 *s)
 
static void FixAxis (TAxis &axis, const char *title=0)
 
static void ScaleAxis (TAxis &axis, Double_t fact=1)
 
static void SetAxis (TAxis &axis, Int_t n, Double_t *borders)
 
static void SetAxis (TAxis &axis, const TString &spec, const char *sep=":,")
 
static void SetAxis (TAxis &axis, Int_t n, Double_t l, Double_t h)
 
static void SetAxis (TAxis &axis, Int_t n, Double_t m)
 
static void PrintAxis (const TAxis &axis, Int_t nSig=2, const char *alt=0)
 
static TH2ScaleToIPz (TH2 *h, TH1 *ipZ, Bool_t full=false)
 
static TH1AverageOverIPz (TH2 *h, const char *name, UShort_t mode, TH1 *ipz, TH2 *mask=0)
 
static TObjectCloneAndAdd (Container *c, TObject *o)
 
static Double_t Integrate (TH1 *h, Double_t min, Double_t max, Double_t &err)
 
static Double_t RatioE (Double_t n, Double_t en, Double_t d, Double_t ed, Double_t &er)
 
static Double_t RatioE2 (Double_t n, Double_t e2n, Double_t d, Double_t e2d, Double_t &e2r)
 

Protected Member Functions

 ClassDef (AliTrackletdNdetaUtils, 1)
 

Detailed Description

Class with utlity functions

Definition at line 24 of file AliTrackletdNdetaUtils.C.

Member Typedef Documentation

Constructor & Destructor Documentation

AliTrackletdNdetaUtils::AliTrackletdNdetaUtils ( )
inline

Dummy constructor

Definition at line 31 of file AliTrackletdNdetaUtils.C.

virtual AliTrackletdNdetaUtils::~AliTrackletdNdetaUtils ( )
inlinevirtual

Dummy destructor

Definition at line 35 of file AliTrackletdNdetaUtils.C.

Member Function Documentation

TH1 * AliTrackletdNdetaUtils::AverageOverIPz ( TH2 h,
const char *  name,
UShort_t  mode,
TH1 ipz,
TH2 mask = 0 
)
static

Average primary particle \(\mathrm{d}N_{\mathrm{ch}}/\mathrm{d}\\eta\) over \(\mathrm{IP}_z\)

Mode can be one of

  • 0: Scale average by content of ipz and do error propagation
  • 1: Only propagate errors from ipz (no scale)
  • 2: Do not propagate errors or scale by ipz
Parameters
hHistogram
nameName of projection
modeMode of operation.
ipzVertex distribution
maskOptional mask - if a bin is zero here, do not count it in average.
Returns
Newly allocated histogram or null

Definition at line 994 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::DrawdNdeta(), and AliTrackletdNdetaMCTask::CentBin::MasterFinalize().

Bool_t AliTrackletdNdetaUtils::CheckAxis ( const char *  which,
const TAxis a1,
const TAxis a2,
Bool_t  alsoLbls 
)
static

Check that axis definitions are compatible

Parameters
whichWhich axis we're checking
a1First axis
a2Second axis
alsoLblsIf true, also check labels
Returns
true if the axes are compatible

Definition at line 532 of file AliTrackletdNdetaUtils.C.

Referenced by CheckConsistency().

Bool_t AliTrackletdNdetaUtils::CheckAxisBins ( const char *  which,
const TAxis a1,
const TAxis a2 
)
static

In case of non-uniform bins, check each bin edge to see if they are the same

Parameters
whichWhich axis we're checking
a1First axis
a2Second axis
Returns
true if all bin edges are the same

Definition at line 472 of file AliTrackletdNdetaUtils.C.

Referenced by CheckAxis().

Bool_t AliTrackletdNdetaUtils::CheckAxisLabels ( const char *  which,
const TAxis a1,
const TAxis a2 
)
static

Check if all bin labels (if specified) are the same

Parameters
whichWhich axis we're checking
a1First axis
a2Second axis
Returns
True if all bin labels are the same

Definition at line 499 of file AliTrackletdNdetaUtils.C.

Referenced by CheckAxis().

Bool_t AliTrackletdNdetaUtils::CheckAxisLimits ( const char *  which,
const TAxis a1,
const TAxis a2 
)
static

Check axis limits (min,max) are the same

Parameters
whichWhich axis we're checking
a1First axis
a2Second axis
Returns
true if axis min/max are indetical

Definition at line 458 of file AliTrackletdNdetaUtils.C.

Referenced by CheckAxis().

Bool_t AliTrackletdNdetaUtils::CheckAxisNBins ( const char *  which,
const TAxis a1,
const TAxis a2 
)
static

Check if both axis have the same number of bins

Parameters
whichWhich axis is being checked
a1First axis
a2Second axis
Returns
true of both axis have equal number of bins

Definition at line 446 of file AliTrackletdNdetaUtils.C.

Referenced by CheckAxis().

Bool_t AliTrackletdNdetaUtils::CheckConsistency ( const TH1 h1,
const TH1 h2 
)
static

Check if two histograms are compatible by checking each defined axis.

Parameters
h1First histogram
h2Second histogram
Returns
true of they are compatible

Definition at line 544 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::Run().

AliTrackletdNdetaUtils::ClassDef ( AliTrackletdNdetaUtils  ,
 
)
protected
TObject * AliTrackletdNdetaUtils::CloneAndAdd ( Container c,
TObject o 
)
static
TH1 * AliTrackletdNdetaUtils::CopyH1 ( Container parent,
const char *  name,
const char *  newName = 0 
)
static

Get a copy of a 1D histogram from a container

Parameters
parentContainer
nameName of histogram
newNameOptional new name of copy
Returns
Pointer to histogram or null

Definition at line 729 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::DrawdNdeta(), AliTrackletdNdetaTask::CentBin::EstimateBackground(), AliTrackletdNdetaPost::Make2Stack(), and AliTrackletdNdetaPost::Run().

TH2 * AliTrackletdNdetaUtils::CopyH2 ( Container parent,
const char *  name,
const char *  newName = 0 
)
static

Get a copy of a 2D histogram from a container

Parameters
parentContainer
nameName of histogram
newNameOptional new name of copy
Returns
Pointer to histogram or null

Definition at line 740 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::DrawAlpha(), AliTrackletdNdetaPost::DrawBackground(), AliTrackletdNdetaPost::DrawdNdeta(), and AliTrackletdNdetaTask::CentBin::EstimateBackground().

void AliTrackletdNdetaUtils::FixAxis ( TAxis axis,
const char *  title = 0 
)
static

Fix axis attributes

Parameters
axisAxis to fix
titlePossible title for axis

Definition at line 849 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaTask::AliTrackletdNdetaTask(), AliTrackletdNdetaTask::InitCentBins(), AliTrackletdNdetaMCTask::MakePdgAxis(), ScaleAxis(), SetAxis(), and AliTrackletdNdetaTask::WorkerInit().

Int_t AliTrackletdNdetaUtils::GetB ( Container parent,
const char *  name,
Bool_t  def = false 
)
static

Get a boolean value from a container

Parameters
parentParent container
nameName of parameter
defDefault value if not found
Returns
The value (or default if not found)

Definition at line 718 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::DrawParams().

AliTrackletdNdetaUtils::Container * AliTrackletdNdetaUtils::GetC ( TDirectory *  parent,
const char *  name 
)
static

Get a container from a directory

Parameters
parentContainer
nameName of container
Returns
Pointer to container or null

Definition at line 692 of file AliTrackletdNdetaUtils.C.

Double_t AliTrackletdNdetaUtils::GetD ( Container parent,
const char *  name,
Double_t  def = -1 
)
static

Get a double-precision value from a container

Parameters
parentParent container
nameName of parameter
defDefault value if not found
Returns
The value (or default if not found)

Definition at line 697 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::DrawParams(), AliTrackletdNdetaTask::CentBin::EstimateBackground(), AliTrackletdNdetaPost::GetDeltaScale(), and AliTrackletdNdetaPost::Run().

Int_t AliTrackletdNdetaUtils::GetI ( Container parent,
const char *  name,
Int_t  def = -1 
)
static

Get a integer value from a container

Parameters
parentParent container
nameName of parameter
defDefault value if not found
Returns
The value (or default if not found)

Definition at line 708 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::DrawParams().

TObject * AliTrackletdNdetaUtils::GetO ( Container parent,
const char *  name,
TClass *  cls 
)
static

Get an object from a container.

Parameters
parentContainer
nameName of object
clsIf not null, check if object has this type
Returns
Pointer to object or null

Definition at line 627 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::DrawSim(), GetB(), GetC(), GetD(), GetH1(), GetH2(), and GetI().

TObject * AliTrackletdNdetaUtils::GetO ( TDirectory *  parent,
const char *  name,
TClass *  cls 
)
static

Get an object from a directory.

Parameters
parentdirectory
nameName of object
clsIf not null, check if object has this type
Returns
Pointer to object or null

Definition at line 651 of file AliTrackletdNdetaUtils.C.

Double_t AliTrackletdNdetaUtils::Integrate ( TH1 h,
Double_t  min,
Double_t  max,
Double_t err 
)
static

Helper function to integrate a histogram. Note, for symmetric histograms, both sides are integrate, and the errors added in quadrature.

Parameters
hHistogram to integrate
minLeast limint
maxLargest limit
errOn return, the error on the integral (95% CL)
Returns
The integral value.

Definition at line 1097 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::GetDeltaIntDist(), and AliTrackletdNdetaTask::HistoSet::MasterFinalize().

TH1 * AliTrackletdNdetaUtils::Make1D ( Container c,
const TString name,
const TString title,
Color_t  color,
Style_t  style,
const TAxis xAxis 
)
static

Service function to make a 1D histogram from an axis definition

Parameters
nameName of histogram
titleTitle of histogram
xAxisX axis to use
cContainer
colorColor
styleMarker style
Returns
Newly created histogram

Definition at line 751 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaTask::HistoSet::WorkerInit(), AliTrackletdNdetaTask::CentBin::WorkerInit(), AliTrackletdNdetaTask::WorkerInit(), and AliTrackletdNdetaMCTask::CentBin::WorkerInit().

TH2 * AliTrackletdNdetaUtils::Make2D ( Container c,
const TString name,
const TString title,
Color_t  color,
Style_t  style,
const TAxis xAxis,
const TAxis yAxis 
)
static

Service function to make a 2D histogram from axis definitions

Parameters
nameName of histogram
titleTitle of histogram
xAxisX axis definition
yAxisY axis definition
cContainer
colorColor
styleMarker style
Returns
Newly created histogram

Definition at line 794 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaTask::HistoSet::WorkerInit(), AliTrackletdNdetaTask::WorkerInit(), and AliTrackletdNdetaMCTask::CentBin::WorkerInit().

void AliTrackletdNdetaUtils::PrintAxis ( const TAxis axis,
Int_t  nSig = 2,
const char *  alt = 0 
)
static

Print axis

Parameters
axisAxis to print
nSigNumber of significant digits
altAtlernate name

Definition at line 941 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaTask::Print().

Double_t AliTrackletdNdetaUtils::RatioE ( Double_t  n,
Double_t  en,
Double_t  d,
Double_t  ed,
Double_t er 
)
static

Calculate ratio and error on ratio

Parameters
nNumerator value
enNumerator error
dDenominator value
edDenominator error
erOn return, ratio error
Returns
Ratio

Definition at line 1120 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::DrawdNdeta(), AliTrackletdNdetaTask::CentBin::EstimateBackground(), and AliTrackletdNdetaPost::GetDeltaScale().

Double_t AliTrackletdNdetaUtils::RatioE2 ( Double_t  n,
Double_t  e2n,
Double_t  d,
Double_t  e2d,
Double_t e2r 
)
static

Calculate ratio and error on ratio

Parameters
nNumerator value
e2nSquared numerator error
dDenominator value
e2dSquared denominator error
e2rOn return, squared ratio error
Returns
Ratio

Definition at line 1132 of file AliTrackletdNdetaUtils.C.

TH1 * AliTrackletdNdetaUtils::Scale ( TH1 h,
Double_t  x,
Double_t  xe 
)
static

Scale a histogram by factor with error propagation

Parameters
hHistogram to scale
xScalar
xeError on scalar
Returns
Pointer to histogram

Definition at line 610 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaPost::DrawdNdeta(), and AliTrackletdNdetaTask::CentBin::EstimateBackground().

TH2 * AliTrackletdNdetaUtils::Scale ( TH2 h,
Double_t  x,
Double_t  xe 
)
static

Scale a histogram by factor with error propagation

Parameters
hHistogram to scale
xScalar
xeError on scalar
Returns
Pointer to histogram

Definition at line 591 of file AliTrackletdNdetaUtils.C.

TH2 * AliTrackletdNdetaUtils::Scale ( TH2 h,
TH1 s 
)
static

Scale the two dimensional histogram with content of the 1-dimensional histogram (over X)

Parameters
hHistogram to scale
sThe scalar histogram
Returns
The scaled histogram (pointer to input)

Definition at line 569 of file AliTrackletdNdetaUtils.C.

void AliTrackletdNdetaUtils::ScaleAxis ( TAxis axis,
Double_t  fact = 1 
)
static

Scale bins of an axis by constant factor. The number of bins remains the same.

Parameters
axisAxis to modify
factFactor to scale by

Definition at line 865 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaMCTask::CentBin::WorkerInit().

TH2 * AliTrackletdNdetaUtils::ScaleToIPz ( TH2 h,
TH1 ipZ,
Bool_t  full = false 
)
static

Scale each Y-row of input histogram to the number of events in second histogram. Also scale to bin-width in X direction.

Parameters
hInput histogram
ipZHistogram to scale by
fullIf true, do error propegation of IPz errors
Returns
New copy of input, scaled by second histogram

Definition at line 957 of file AliTrackletdNdetaUtils.C.

Referenced by AliTrackletdNdetaTask::HistoSet::MasterFinalize(), and AliTrackletdNdetaMCTask::CentBin::MasterFinalize().

void AliTrackletdNdetaUtils::SetAxis ( TAxis axis,
Int_t  n,
Double_t borders 
)
static

Set an axis based on bin borders

Parameters
axisAxis to set
nNumber of bins
bordersBin borders (n+1 entries)

Definition at line 879 of file AliTrackletdNdetaUtils.C.

Referenced by SetAxis(), AliTrackletdNdetaTask::SetCentralityAxis(), AliTrackletdNdetaTask::SetEtaAxis(), AliTrackletdNdetaTask::SetIPzAxis(), and AliTrackletdNdetaTask::SetPhiAxis().

void AliTrackletdNdetaUtils::SetAxis ( TAxis axis,
const TString spec,
const char *  sep = ":," 
)
static

Set an axis based on test string of specs. The token separator is given in sep.

Parameters
axisAxis to set
specSpecification
sepToken separate

Definition at line 885 of file AliTrackletdNdetaUtils.C.

void AliTrackletdNdetaUtils::SetAxis ( TAxis axis,
Int_t  n,
Double_t  l,
Double_t  h 
)
static

Set axis with least and largest values

Parameters
axisAxis to set
nNumber of bins
lLeast value
hLargest value

Definition at line 927 of file AliTrackletdNdetaUtils.C.

void AliTrackletdNdetaUtils::SetAxis ( TAxis axis,
Int_t  n,
Double_t  m 
)
static

Set a symmetric axis

Parameters
axisAxis to set
nNumber of bins
mMaximum absolute value

Definition at line 936 of file AliTrackletdNdetaUtils.C.


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