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

Public Types

enum  EMode { kUp = (0x1) << 14, kDown = (0x2) << 14, kDisabled = (0x4) << 14 }
 
enum  ECalc { kProduct, kSquare, kSum, kAverage }
 
typedef std::map< short, TH1D * > PdgMap
 

Public Member Functions

 AliTrackletWeights ()
 
 AliTrackletWeights (const char *name, const char *title="Sim. tracklet weights")
 
 AliTrackletWeights (const AliTrackletWeights &o)
 
virtual ~AliTrackletWeights ()
 
AliTrackletWeightsoperator= (const AliTrackletWeights &o)
 
virtual Double_t LookupWeight (AliAODTracklet *tracklet, Double_t cent, TH2 *corr=0) const
 
Bool_t AddAbundanceWeight (Short_t pdg, const TH1D *h, UShort_t mode=0)
 
Bool_t AddStrangenessWeight (Short_t pdg, const TH1D *h, UShort_t mode=0)
 
Bool_t SetPtWeight (const TH2D *h, UShort_t mode=0)
 
void SetAbundanceMode (Short_t pdg, UShort_t mode)
 
void SetStrangenessMode (Short_t pdg, UShort_t mode)
 
void SetPtMode (UShort_t mode)
 
void SetCalc (UChar_t mode=kProduct)
 
void SetMask (UChar_t mask)
 
void SetVeto (UChar_t veto)
 
void Draw (Option_t *option="")
 
void Print (Option_t *option="") const
 
Bool_t IsFolder () const
 
void Store (TCollection *out)
 
Bool_t Retrieve (TCollection *in)
 
Double_t GetAbundanceWeight (UShort_t apdg, Double_t cent) const
 
Double_t GetStrangenessWeight (UShort_t apdg, Double_t cent) const
 

Protected Member Functions

virtual Double_t LookupWeight (Double_t pT, Short_t pdg, Double_t cent) const
 
TH1DGetPdgHist (const PdgMap &m, Short_t pdg) const
 
virtual Double_t GetPdgWeight (const PdgMap &m, UShort_t apdg, Double_t cent) const
 
Bool_t AddPdgWeight (PdgMap &map, Short_t pdg, const TH1D *w, UShort_t mode=0)
 
void SetPdgMode (PdgMap &map, Short_t pdg, UShort_t mode)
 
void StoreMap (TCollection *parent, const char *name, PdgMap &m)
 
Bool_t RetrieveMap (TCollection *parent, const char *name, PdgMap &m)
 
void ModStack (THStack *stack)
 
void PrintMap (const PdgMap &m, const char *name, Option_t *options="") const
 
void PrintHist (const char *tag, TH1 *h) const
 
 ClassDef (AliTrackletWeights, 3)
 

Protected Attributes

TH2DfPt
 
PdgMap fAbundance
 
PdgMap fStrangeness
 
UChar_t fCalc
 
UChar_t fMask
 
UChar_t fVeto
 

Detailed Description

Simulation weights

Definition at line 42 of file AliTrackletWeights.C.

Member Typedef Documentation

typedef std::map<short,TH1D*> AliTrackletWeights::PdgMap

Map a particle species to a weight

Definition at line 105 of file AliTrackletWeights.C.

Member Enumeration Documentation

Mode calculation

Enumerator
kProduct 

Tracklet weights calculated as

\[ w_{ij} = \left\{\begin{array}{cl} w_i & i=j \mbox{ good tracklets}\\ w_i w_j & i\neq j \mbox{ fake tracklets} \end{array}\right. \]

kSquare 

Tracklet weights calculated as

\[ w_{ij} = \sqrt{w_i w_j} = \left\{\begin{array}{cl} w_i & i=j \mbox{ good tracklets}\\ \sqrt{w_i w_j} & i\neq j \mbox{ fake tracklets} \end{array}\right. \]

kSum 

Tracklet weights calculated as

\[ w_{ij} = 1+(w_i-1)+(w_j-1) \]

kAverage 

Tracklet weights calculated as

\[ w_{ij} = 1+\frac{(w_i-1)+(w_j-1)}{2} = \frac{w_i + w_j}{2} = \left\{\begin{array}{cl} w_i & i=j \mbox{ good tracklets}\\ (w_i + w_j)/2 & i\neq j \mbox{ fake tracklets} \end{array}\right. \]

Definition at line 59 of file AliTrackletWeights.C.

Mode of weights

Enumerator
kUp 

If this bit is set, adjust weight up by error

kDown 

If this bit is set, adjust weight down by error

kDisabled 

If this bit is set, the weight is disabled

Definition at line 48 of file AliTrackletWeights.C.

Constructor & Destructor Documentation

AliTrackletWeights::AliTrackletWeights ( )
inline

Default constructor - ROOT I/O only

Definition at line 110 of file AliTrackletWeights.C.

AliTrackletWeights::AliTrackletWeights ( const char *  name,
const char *  title = "Sim. tracklet weights" 
)

Named constructor

Parameters
nameName of object
title(optional) free-form title

Definition at line 457 of file AliTrackletWeights.C.

AliTrackletWeights::AliTrackletWeights ( const AliTrackletWeights o)

Copy constructor

Parameters
oObject to copy from

Definition at line 469 of file AliTrackletWeights.C.

virtual AliTrackletWeights::~AliTrackletWeights ( )
inlinevirtual

Destructor

Definition at line 134 of file AliTrackletWeights.C.

Member Function Documentation

Bool_t AliTrackletWeights::AddAbundanceWeight ( Short_t  pdg,
const TH1D h,
UShort_t  mode = 0 
)
inline

Add a histogram to weight particle abundances

Parameters
pdgParticle species
hWeight of particle specie as a function of centrality.
modeMode of this weight (+1: up, 0: normal, -1: down)
Returns
true on success.

Definition at line 165 of file AliTrackletWeights.C.

Referenced by AliTrackletWeights(), MakeWeight(), and operator=().

Bool_t AliTrackletWeights::AddPdgWeight ( PdgMap map,
Short_t  pdg,
const TH1D w,
UShort_t  mode = 0 
)
protected

Add a weight histogram

Parameters
mapMap of weights
pdgParticle species
wWeight histogram
modeMode of this weight (+1: up, 0: normal, -1: down)
Returns
true on success

Definition at line 507 of file AliTrackletWeights.C.

Referenced by AddAbundanceWeight(), AddStrangenessWeight(), and RetrieveMap().

Bool_t AliTrackletWeights::AddStrangenessWeight ( Short_t  pdg,
const TH1D h,
UShort_t  mode = 0 
)
inline

Add a histogram to weight strange particle abundances

Parameters
pdgParticle species
hWeight of particle specie as a function of centrality.
modeMode of this weight (+1: up, 0: normal, -1: down)
Returns
true on success.

Definition at line 178 of file AliTrackletWeights.C.

Referenced by AliTrackletWeights(), MakeK0S(), MakeRealistic(), MakeRuben(), MakeWeight(), and operator=().

AliTrackletWeights::ClassDef ( AliTrackletWeights  ,
 
)
protected
void AliTrackletWeights::Draw ( Option_t option = "")

Draw the weights

Parameters
option

Definition at line 793 of file AliTrackletWeights.C.

Referenced by MakeEposWeight(), MakeK0S(), MakeRealistic(), MakeRuben(), MakeWeight(), and ReadWeights().

Double_t AliTrackletWeights::GetAbundanceWeight ( UShort_t  apdg,
Double_t  cent 
) const
inline

Get the abundance weight of a given particle type for a given centrality

Parameters
apdgAbsolute value of the particle PDG identifier
centCentrality
Returns
The associated weight

Definition at line 332 of file AliTrackletWeights.C.

TH1D * AliTrackletWeights::GetPdgHist ( const PdgMap m,
Short_t  pdg 
) const
protected

Get the histogram associated with a particle species in a given map.

Parameters
pdgParticle species
mMap
Returns
Pointer to histogram or null

Definition at line 557 of file AliTrackletWeights.C.

Referenced by GetPdgWeight(), and SetPdgMode().

Double_t AliTrackletWeights::GetPdgWeight ( const PdgMap m,
UShort_t  apdg,
Double_t  cent 
) const
protectedvirtual

Get a PDG depedent weight.

Parameters
mMap to look up in
apdgThe absolute value of the PDG code
centThe event centrality
Returns
the weight associated with the particle

Definition at line 566 of file AliTrackletWeights.C.

Referenced by GetAbundanceWeight(), GetStrangenessWeight(), and LookupWeight().

Double_t AliTrackletWeights::GetStrangenessWeight ( UShort_t  apdg,
Double_t  cent 
) const
inline

Get the strangeness weight of a given particle type for a given centrality

Parameters
apdgAbsolute value of the particle PDG identifier
centCentrality
Returns
The associated weight

Definition at line 345 of file AliTrackletWeights.C.

Bool_t AliTrackletWeights::IsFolder ( ) const
inline
Returns
always true

Definition at line 308 of file AliTrackletWeights.C.

Double_t AliTrackletWeights::LookupWeight ( AliAODTracklet tracklet,
Double_t  cent,
TH2 corr = 0 
) const
virtual

Find the tracklet weight

Parameters
trackletTracklet
centCentrality
corrOptional histogram to fill with correlation of weights
Returns
The weight

Definition at line 610 of file AliTrackletWeights.C.

Double_t AliTrackletWeights::LookupWeight ( Double_t  pT,
Short_t  pdg,
Double_t  cent 
) const
protectedvirtual

Look-up weight based on transverse momentum pT, particle species pdf and event centrality cent.

Parameters
pT(mother) particle transverse momentum
pdg(mother) particle specie number
centEvent centrality
Returns
The accumulated weight

Definition at line 586 of file AliTrackletWeights.C.

void AliTrackletWeights::ModStack ( THStack *  stack)
protected

Modify a drawn stack

Parameters
stackStack to modify

Definition at line 653 of file AliTrackletWeights.C.

Referenced by Draw().

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

Assignment operator

Parameters
oObject to assign from
Returns
Reference to this object

Definition at line 488 of file AliTrackletWeights.C.

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

Print information on reweights

Parameters
optionNot used

Definition at line 850 of file AliTrackletWeights.C.

Referenced by MakeEposWeight(), MakeK0S(), MakeRealistic(), MakeRuben(), MakeWeight(), and AliTrackletAODWeightedMCdNdeta::Print().

void AliTrackletWeights::PrintHist ( const char *  tag,
TH1 h 
) const
protected

Print info on a histogram

Parameters
tagTag line
hhistogramT

Definition at line 869 of file AliTrackletWeights.C.

Referenced by Print(), and PrintMap().

void AliTrackletWeights::PrintMap ( const PdgMap m,
const char *  name,
Option_t options = "" 
) const
protected

Print a map

Parameters
mThe map
nameName of map
optionsOptions

Definition at line 882 of file AliTrackletWeights.C.

Referenced by Print().

Bool_t AliTrackletWeights::Retrieve ( TCollection in)

Retrieve weights from a collection

Parameters
inInput collection
Returns
true on success

Definition at line 734 of file AliTrackletWeights.C.

Bool_t AliTrackletWeights::RetrieveMap ( TCollection parent,
const char *  name,
PdgMap m 
)
protected

Retrieve map contents from an input collection

Parameters
parentInput collection
nameName of collection
mMap to add to
Returns
true on success

Definition at line 763 of file AliTrackletWeights.C.

Referenced by Retrieve().

void AliTrackletWeights::SetAbundanceMode ( Short_t  pdg,
UShort_t  mode 
)
inline

Set the mode of a single particle abundance weight. Mode is a bit mask of

  • kDisabled: The weight is disabled - i.e., will be 1
  • kUp: The weight is adjusted up by the error of the weight
  • kDown: The weight is adjusted down by the error of the weight
Parameters
pdgParticle specie
modeMode of this weight (+1: up, 0: normal, -1: down)

Definition at line 203 of file AliTrackletWeights.C.

void AliTrackletWeights::SetCalc ( UChar_t  mode = kProduct)
inline

Set the mode for calculating the weight of a tracklet. A tracklet consist of two clusters with labels \( i\) and \( j\). A weight ( \( w_i\) and \( w_j\)) is assigned to each of the particles corresponding to the tracks with these labels. The weight is calculated from the particle species and transverse momentum of the primary mother particle of the tracks \( i\) and \( j\). The weight of a tracklet can then be calculated in four different ways

Product

\[ w = \left{\begin{array}{cl} w_i & \mbox{for} i=j\\ w_i w_j & \mbox{for} i\neq j\\ \end{array}\right.\quad, \]

Square root of product of weights

\[ w = \left{\begin{array}{cl} w_i & \mbox{for} i=j\\ \sqrt(w_i w_j) & \mbox{for} i\neq j\\ \end{array}\right.\quad, \]

Sum of weights

\[ w = 1 + \left{\begin{array}{cl} 2(w_i-1) & \mbox{for} i=j\\ (w_i-1) + (w_j-1) & \mbox{for} i\neq j\\ \end{array}\right.\quad, \]

Average of weights

\[ w = 1 + \left{\begin{array}{cl} (w_i-1) & \mbox{for} i=j\\ ((w_i-1) + (w_j-1))/2 & \mbox{for} i\neq j\\ \end{array}\right.\quad. \]

Parameters
modeWhether to take square root or not

Definition at line 280 of file AliTrackletWeights.C.

Referenced by AliTrackletAODWeightedMCdNdeta::SetWeightCalc().

void AliTrackletWeights::SetMask ( UChar_t  mask)
inline

Set the tracklet mask

Parameters
maskMask to use

Definition at line 286 of file AliTrackletWeights.C.

Referenced by MakeRuben(), and AliTrackletAODWeightedMCdNdeta::SetWeightMask().

void AliTrackletWeights::SetPdgMode ( PdgMap map,
Short_t  pdg,
UShort_t  mode 
)
protected

Set the mode of a single particle weight. Mode is a bit mask of

  • kDisabled: The weight is disabled - i.e., will be 1
  • kUp: The weight is adjusted up by the error of the weight
  • kDown: The weight is adjusted down by the error of the weight
Parameters
mapMap
pdgParticle specie
modeMode

Definition at line 549 of file AliTrackletWeights.C.

Referenced by SetAbundanceMode(), and SetStrangenessMode().

void AliTrackletWeights::SetPtMode ( UShort_t  mode)

Set the mode of a transverse momentum weight. Mode is a bit mask of

  • kDisabled: The weight is disabled - i.e., will be 1
  • kUp: The weight for \( p_T<0.05\) is adjusted by +30%
  • kDown: The weight for \( p_T<0.05\) is adjusted by -30%
Parameters
modeMode

Definition at line 544 of file AliTrackletWeights.C.

Bool_t AliTrackletWeights::SetPtWeight ( const TH2D h,
UShort_t  mode = 0 
)

Set the weight histogram per transverse momentum and centrality

Parameters
hhistogram of (centrality vs pT) weights
modeMode of this weight (+1: up, 0: normal, -1: down)
Returns
true on success

Definition at line 529 of file AliTrackletWeights.C.

Referenced by AliTrackletWeights(), MakeEposWeight(), MakeWeight(), and operator=().

void AliTrackletWeights::SetStrangenessMode ( Short_t  pdg,
UShort_t  mode 
)
inline

Set the mode of a single particle strangeness weight. Mode is a bit mask of

  • kDisabled: The weight is disabled - i.e., will be 1
  • kUp: The weight is adjusted up by the error of the weight
  • kDown: The weight is adjusted down by the error of the weight
Parameters
pdgParticle specie
modeMode

Definition at line 218 of file AliTrackletWeights.C.

void AliTrackletWeights::SetVeto ( UChar_t  veto)
inline

Set the tracklet veto

Parameters
vetoVeto to use

Definition at line 292 of file AliTrackletWeights.C.

Referenced by MakeRuben(), and AliTrackletAODWeightedMCdNdeta::SetWeightVeto().

void AliTrackletWeights::Store ( TCollection out)

Store weights histograms in output of analysis

Parameters
outCollection to add histograms to

Definition at line 673 of file AliTrackletWeights.C.

void AliTrackletWeights::StoreMap ( TCollection parent,
const char *  name,
PdgMap m 
)
protected

Write a maps histograms to an output container

Parameters
parentOutput container
nameName of output sub-container
mMap of weights

Definition at line 695 of file AliTrackletWeights.C.

Referenced by Store().

Member Data Documentation

PdgMap AliTrackletWeights::fAbundance
protected
UChar_t AliTrackletWeights::fCalc
protected

Definition at line 450 of file AliTrackletWeights.C.

Referenced by LookupWeight(), operator=(), Print(), Retrieve(), SetCalc(), and Store().

UChar_t AliTrackletWeights::fMask
protected

Definition at line 451 of file AliTrackletWeights.C.

Referenced by LookupWeight(), operator=(), Print(), Retrieve(), SetMask(), and Store().

TH2D* AliTrackletWeights::fPt
protected
PdgMap AliTrackletWeights::fStrangeness
protected
UChar_t AliTrackletWeights::fVeto
protected

Definition at line 452 of file AliTrackletWeights.C.

Referenced by LookupWeight(), operator=(), Print(), Retrieve(), SetVeto(), and Store().


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