AliPhysics  0bb4a45 (0bb4a45)
AliEMCalTriggerWeightHandler.h
Go to the documentation of this file.
1 #ifndef ALIEMCALTRIGGERWEIGHTHANDLER_H
2 #define ALIEMCALTRIGGERWEIGHTHANDLER_H
3 /* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 #include <TObject.h>
7 
8 class TF1;
9 class TObjArray;
10 
11 class AliGenPythiaEventHeader;
12 class AliMCEvent;
13 
22 namespace EMCalTriggerPtAnalysis {
23 
25 public:
27  AliEMCalTriggerPtHardWeight(double ptmin, double ptmax, double weight) : TObject(), fPtMin(ptmin), fPtMax(ptmax), fWeight(weight) {}
29 
31  void SetWeight(double weight) { fWeight = weight; }
32 
33  bool IsSelected(Double_t pthard) const { return pthard >= fPtMin && pthard < fPtMax; }
34  Double_t GetWeight() const { return fWeight; }
35  Double_t GetPtMin() const { return fPtMin; }
36  Double_t GetPtMax() const { return fPtMax; }
37  void GetPtLimits(Double_t &ptmin, Double_t &ptmax) const { ptmin = fPtMin; ptmax = fPtMax; }
38 
39 private:
40  double fPtMin;
41  double fPtMax;
42  double fWeight;
43 
45  ClassDef(AliEMCalTriggerPtHardWeight, 1)
47 };
48 
61 public:
66 
72 
79 
84 
89  void SetUseCrossSection(bool useCrossSection) { fUseCrossSection = useCrossSection; }
90 
95  void SetWeightModel(const TF1 *model) { fWeightModel = model; }
96 
104  void SetWeightForBin(double ptmin, double ptmax, double weight);
105 
111  double GetEventWeight(const AliMCEvent *const event) const;
117  double GetEventWeight(const AliGenPythiaEventHeader * const header) const;
118 
119 protected:
125  const AliEMCalTriggerPtHardWeight *FindWeight(Double_t pthard) const;
126 
127 private:
128  const TF1 *fWeightModel;
131 
133  ClassDef(AliEMCalTriggerWeightHandler, 1);
135 };
136 
137 } /* namespace EMCalTriggerPtAnalysis */
138 
139 #endif /* ALIEMCALTRIGGERWEIGHTHANDLER_H */
double Double_t
Definition: External.C:58
AliEMCalTriggerPtHardWeight(double ptmin, double ptmax, double weight)
const Double_t ptmax
const Double_t ptmin
TObjArray * fBinWeights
Container for weights in a given pt-hard bin.
Analysis of high- tracks in triggered events.
void GetPtLimits(Double_t &ptmin, Double_t &ptmax) const
double fWeight
Weight being applied to the pt-hard bin.