AliPhysics  c0d7b22 (c0d7b22)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
24 class AliEMCalTriggerPtHardWeight : public TObject {
25 public:
26  AliEMCalTriggerPtHardWeight(): TObject(), fPtMin(-1), fPtMax(-1), fWeight(-1) {}
27  AliEMCalTriggerPtHardWeight(double ptmin, double ptmax, double weight) : TObject(), fPtMin(ptmin), fPtMax(ptmax), fWeight(weight) {}
29 
30  void SetPtRange(Double_t ptmin, Double_t ptmax) { fPtMin = ptmin; fPtMax = ptmax; }
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 
60 class AliEMCalTriggerWeightHandler : public TObject {
61 public:
70 
75  void SetUseCrossSection(bool useCrossSection) { fUseCrossSection = useCrossSection; }
76 
81  void SetWeightModel(const TF1 *model) { fWeightModel = model; }
82 
90  void SetWeightForBin(double ptmin, double ptmax, double weight);
91 
97  double GetEventWeight(const AliMCEvent *const event) const;
103  double GetEventWeight(const AliGenPythiaEventHeader * const header) const;
104 
105 protected:
111  const AliEMCalTriggerPtHardWeight *FindWeight(Double_t pthard) const;
112 
113 private:
114  const TF1 *fWeightModel;
115  TObjArray *fBinWeights;
117 
119  ClassDef(AliEMCalTriggerWeightHandler, 1);
121 };
122 
123 } /* namespace EMCalTriggerPtAnalysis */
124 
125 #endif /* ALIEMCALTRIGGERWEIGHTHANDLER_H */
const AliEMCalTriggerPtHardWeight * FindWeight(Double_t pthard) const
AliEMCalTriggerPtHardWeight(double ptmin, double ptmax, double weight)
void SetWeightForBin(double ptmin, double ptmax, double weight)
const Double_t ptmax
const Double_t ptmin
double GetEventWeight(const AliMCEvent *const event) const
TObjArray * fBinWeights
Container for weights in a given pt-hard bin.
void GetPtLimits(Double_t &ptmin, Double_t &ptmax) const
double fWeight
Weight being applied to the pt-hard bin.