AliPhysics  9c7580a (9c7580a)
AliAnaWeights.h
Go to the documentation of this file.
1 #ifndef ALIANAWEIGHTS_H
2 #define ALIANAWEIGHTS_H
3 
4 //_________________________________________________________________________
25 //_________________________________________________________________________
26 
27 class TH1F;
28 class TList;
29 class AliGenPythiaEventHeader;
30 #include <TF1.h>
31 
32 #include <TObject.h>
33 
34 class AliAnaWeights : public TObject {
35 
36  public:
37 
38  AliAnaWeights();
39 
41  virtual ~AliAnaWeights() ;
42 
43  //
44  // General
45  //
47 
48  Int_t GetDebug() const { return fDebug ; }
49 
50  void SetDebug(Int_t d) { fDebug = d ; }
51 
52  //
53  // Centrality weights
54  //
55  void InitCentralityWeightsHistogram(Int_t nbins = 100, Int_t minCen = 0, Int_t maxCen = 100) ;
56 
58 
60 
61  void SetCentrality(Float_t cen) { fCentrality = cen ; }
62 
64 
66 
68 
69  //
70  // Pythia pT hard weights
71  //
73 
74  static Bool_t GetPythiaInfoFromFile(TString currFile, Float_t & xsec, Float_t & trials) ;
75 
76  virtual Double_t GetWeight() ;
77 
79 
82 
83  void SetPythiaEventHeader(AliGenPythiaEventHeader* py) { fPyEventHeader = py ; }
84 
87 
89 
92 
93  //
94  // Pt weights
95  //
96  Double_t GetParticlePtWeight ( Float_t pt, Int_t pdg, TString genName, Int_t igen ) const ;
97 
98  void SetEtaFunction(TF1* fun) { if ( fEtaFunction ) delete fEtaFunction ; fEtaFunction = fun ; }
99  void SetPi0Function(TF1* fun) { if ( fPi0Function ) delete fPi0Function ; fPi0Function = fun ; }
100 
103 
104  private:
105 
107 
108  //
109  // Centrality weights
110  //
111 
113 
115 
117 
118  //
119  // MC weights for particles
120  //
121 
123 
124  TF1 * fEtaFunction;
125 
126  TF1 * fPi0Function;
127 
128  //
129  // MC weights, pT hard pythia
130  //
131 
133 
135 
137 
139 
140  TH1F * fhXsec ;
141 
142  TH1F * fhTrials ;
143 
144  AliGenPythiaEventHeader * fPyEventHeader ;
145 
147 
149  AliAnaWeights( const AliAnaWeights&);
150 
153 
155  ClassDef(AliAnaWeights, 3) ;
157 
158 } ;
159 
160 #endif //ALIANAWEIGHTS_H
Int_t pdg
TList * GetCreateOutputHistograms()
double Double_t
Definition: External.C:58
void SetCentrality(Float_t cen)
Definition: AliAnaWeights.h:61
void SwitchOffMCCrossSectionFromEventHeader()
Definition: AliAnaWeights.h:91
void SwitchOffCentralityWeight()
Definition: AliAnaWeights.h:67
void SetEtaFunction(TF1 *fun)
Definition: AliAnaWeights.h:98
Calculate the weight to the event to be applied when filling histograms.
Definition: AliAnaWeights.h:34
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:88
Int_t GetDebug() const
Definition: AliAnaWeights.h:48
Int_t fDebug
Debug level.
Bool_t IsCentralityWeightOn() const
Definition: AliAnaWeights.h:63
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:65
void SwitchOnMCCrossSectionFromEventHeader()
Definition: AliAnaWeights.h:90
virtual ~AliAnaWeights()
Destructor.
int Int_t
Definition: External.C:63
void SwitchOnMCCrossSectionCalculation()
Definition: AliAnaWeights.h:85
float Float_t
Definition: External.C:68
Bool_t IsMCCrossSectionJustHistoFillOn() const
Definition: AliAnaWeights.h:81
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:86
void SetPi0Function(TF1 *fun)
Definition: AliAnaWeights.h:99
TH1F * GetCentralityWeightsHistogram()
Bool_t IsMCCrossSectionCalculationOn() const
Definition: AliAnaWeights.h:80
AliAnaWeights()
Constructor.
Bool_t IsWeightSettingOn() const
Definition: AliAnaWeights.h:78
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:59
Double_t fMCWeight
pT-hard bin MC weight. It is used only internally.
void SetDebug(Int_t d)
Definition: AliAnaWeights.h:50
void SetPythiaEventHeader(AliGenPythiaEventHeader *py)
Definition: AliAnaWeights.h:83
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.