AliPhysics  95775ff (95775ff)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnaWeights.h
Go to the documentation of this file.
1 #ifndef ALIANAWEIGHTS_H
2 #define ALIANAWEIGHTS_H
3 
4 //_________________________________________________________________________
24 //_________________________________________________________________________
25 
26 class TH1F;
27 class TList;
28 class AliGenPythiaEventHeader;
29 #include <TF1.h>
30 
31 #include <TObject.h>
32 
33 class AliAnaWeights : public TObject {
34 
35  public:
36 
37  AliAnaWeights();
38 
40  virtual ~AliAnaWeights() ;
41 
42  //
43  // General
44  //
46 
47  Int_t GetDebug() const { return fDebug ; }
48 
49  void SetDebug(Int_t d) { fDebug = d ; }
50 
51  //
52  // Centrality weights
53  //
54  void InitCentralityWeightsHistogram(Int_t nbins = 100, Int_t minCen = 0, Int_t maxCen = 100) ;
55 
57 
59 
60  void SetCentrality(Float_t cen) { fCentrality = cen ; }
61 
63 
65 
67 
68  //
69  // Pythia pT hard weights
70  //
72 
73  static Bool_t GetPythiaInfoFromFile(TString currFile, Float_t & xsec, Float_t & trials) ;
74 
75  virtual Double_t GetWeight() ;
76 
78 
81 
82  void SetPythiaEventHeader(AliGenPythiaEventHeader* py) { fPyEventHeader = py ; }
83 
86 
88 
91 
92  //
93  // Pt weights
94  //
95  Double_t GetParticlePtWeight ( Float_t pt, Int_t pdg, TString genName, Int_t igen ) const ;
96 
97  void SetEtaFunction(TF1* fun) { if ( fEtaFunction ) delete fEtaFunction ; fEtaFunction = fun ; }
98  void SetPi0Function(TF1* fun) { if ( fPi0Function ) delete fPi0Function ; fPi0Function = fun ; }
99 
102 
103  private:
104 
106 
107  //
108  // Centrality weights
109  //
110 
112 
114 
116 
117  //
118  // MC weights for particles
119  //
120 
122 
123  TF1 * fEtaFunction;
124 
125  TF1 * fPi0Function;
126 
127  //
128  // MC weights, pT hard pythia
129  //
130 
132 
134 
136 
138 
139  TH1F * fhXsec ;
140 
141  TH1F * fhTrials ;
142 
143  AliGenPythiaEventHeader * fPyEventHeader ;
144 
146 
148  AliAnaWeights( const AliAnaWeights&);
149 
152 
154  ClassDef(AliAnaWeights, 3) ;
156 
157 } ;
158 
159 #endif //ALIANAWEIGHTS_H
Int_t pdg
TList * GetCreateOutputHistograms()
double Double_t
Definition: External.C:58
void SetCentrality(Float_t cen)
Definition: AliAnaWeights.h:60
void SwitchOffMCCrossSectionFromEventHeader()
Definition: AliAnaWeights.h:90
void SwitchOffCentralityWeight()
Definition: AliAnaWeights.h:66
void SetEtaFunction(TF1 *fun)
Definition: AliAnaWeights.h:97
Calculate the weight to the event to be applied when filling histograms.
Definition: AliAnaWeights.h:33
TH1F * fhCentralityWeight
Container of centrality weights.
Double_t GetParticlePtWeight(Float_t pt, Int_t pdg, TString genName, Int_t igen) const
void SwitchOnMCCrossSectionHistoFill()
Definition: AliAnaWeights.h:87
Int_t GetDebug() const
Definition: AliAnaWeights.h:47
Int_t fDebug
Debug level.
Bool_t IsCentralityWeightOn() const
Definition: AliAnaWeights.h:62
Float_t fCentrality
Container of centrality percentile.
Bool_t fJustFillCrossSecHist
Do not provide a weight, just fill cross section histograms.
void SwitchOnCentralityWeight()
Definition: AliAnaWeights.h:64
void SwitchOnMCCrossSectionFromEventHeader()
Definition: AliAnaWeights.h:89
virtual ~AliAnaWeights()
Destructor.
int Int_t
Definition: External.C:63
void SwitchOnMCCrossSectionCalculation()
Definition: AliAnaWeights.h:84
float Float_t
Definition: External.C:68
Bool_t IsMCCrossSectionJustHistoFillOn() const
Definition: AliAnaWeights.h:80
void SwitchOnMCParticlePtWeights()
void InitCentralityWeightsHistogram(Int_t nbins=100, Int_t minCen=0, Int_t maxCen=100)
TF1 * fPi0Function
! pi0 spectrum parametrization
void SwitchOffMCCrossSectionCalculation()
Definition: AliAnaWeights.h:85
void SetPi0Function(TF1 *fun)
Definition: AliAnaWeights.h:98
TH1F * GetCentralityWeightsHistogram()
Bool_t IsMCCrossSectionCalculationOn() const
Definition: AliAnaWeights.h:79
AliAnaWeights()
Constructor.
Bool_t IsWeightSettingOn() const
Definition: AliAnaWeights.h:77
void SwitchOffMCParticlePtWeights()
TH1F * fhXsec
! Cross section in PYTHIA.
AliAnaWeights & operator=(const AliAnaWeights &)
Assignment operator not implemented.
TF1 * fEtaFunction
! eta spectrum parametrization
void SetCentralityWeightsHistogram(TH1F *h)
Definition: AliAnaWeights.h:58
Double_t fMCWeight
pT-hard bin MC weight. It is used only internally.
void SetDebug(Int_t d)
Definition: AliAnaWeights.h:49
void SetPythiaEventHeader(AliGenPythiaEventHeader *py)
Definition: AliAnaWeights.h:82
AliGenPythiaEventHeader * fPyEventHeader
! Pythia event header, needed to retrieve cross section, only in recent MC
TString fCurrFileName
Current file path name.
Bool_t fDoMCParticlePtWeights
activate the generation of a pT weight depending on MC particle pdg and generator ...
virtual Double_t GetWeight()
const Int_t nbins
bool Bool_t
Definition: External.C:53
Bool_t fUseCentralityWeight
Return the centratlity weight.
Bool_t fCheckPythiaEventHeader
Get cross section from pythia event header.
Bool_t fCheckMCCrossSection
Retrieve from the pyxsec.root file the cross section, only if requested.
virtual Double_t GetPythiaCrossSection()
static Bool_t GetPythiaInfoFromFile(TString currFile, Float_t &xsec, Float_t &trials)
TH1F * fhTrials
! Number of event trials in PYTHIA.