AliPhysics  master (3d17d9d)
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 
104 
105  private:
106 
108 
109  //
110  // Centrality weights
111  //
112 
114 
116 
118 
119  //
120  // MC weights for particles
121  //
122 
124 
125  TF1 * fEtaFunction;
126 
127  TF1 * fPi0Function;
128 
130 
131  //
132  // MC weights, pT hard pythia
133  //
134 
136 
138 
140 
142 
143  TH1F * fhXsec ;
144 
145  TH1F * fhTrials ;
146 
147  AliGenPythiaEventHeader * fPyEventHeader ;
148 
150 
152  AliAnaWeights( const AliAnaWeights&);
153 
156 
158  ClassDef(AliAnaWeights, 4) ;
160 
161 } ;
162 
163 #endif //ALIANAWEIGHTS_H
void CheckGeneratorName(Bool_t ch)
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 fCheckGeneratorName
apply weight only for pi0/eta particle from a particular generator.
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.