]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODEventCuts.h
Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / AliSpectraAODEventCuts.h
1 #ifndef ALISPECTRAAODEVENTCUTS_H
2 #define ALISPECTRAAODEVENTCUTS_H
3
4 /*  See cxx source for full Copyright notice */
5
6 //-------------------------------------------------------------------------
7 //                      AliSpectraAODEventCuts
8 //
9 //
10 //
11 //
12 // Authors: Michele Floris, CERN, Philip Versteeg, UU, Redmer Bertens, UU
13 //-------------------------------------------------------------------------
14
15 class AliAODEvent;
16 class AliSpectraAODTrackCuts;
17 class TProfile;
18
19 #include "TNamed.h"
20 #include "TFile.h"
21 #include "TKey.h"
22 #include "AliOADBContainer.h"
23
24 class AliSpectraAODEventCuts : public TNamed
25 {
26  public:
27   enum {  kProcessedEvents = 0,kPhysSelEvents,kAcceptedEvents, kVtxRange, kVtxCentral, kVtxNoEvent, kQVector, kNVtxCuts};
28
29   // Constructors
30  AliSpectraAODEventCuts() : 
31   TNamed(),
32     fAOD(0),
33     fSelectBit(AliVEvent::kMB),
34     fCentralityMethod(),
35     fTrackBits(1),
36     fIsMC(0),
37     fIsLHC10h(0),
38     fTrackCuts(0),
39     fIsSelected(0),
40     fCentralityCutMin(0.),
41     fCentralityCutMax(999),
42     fQVectorCutMin(-999.),
43     fQVectorCutMax(999.),
44     fVertexCutMin(-10.),
45     fVertexCutMax(10.),
46     fMultiplicityCutMin(-999.),
47     fMultiplicityCutMax(99999.),
48     fqV0C(-999.),
49     fqV0A(-999.),
50     fqV0Cx(-999.),
51     fqV0Ax(-999.),
52     fqV0Cy(-999.),
53     fqV0Ay(-999.),
54     fPsiV0C(-999.),
55     fPsiV0A(-999.),
56     fCent(-999.),
57     fOutput(0),
58     fCalib(0),
59     fRun(-1),
60     fMultV0(0),
61     fV0Cpol1(-1),
62     fV0Cpol2(-1),
63     fV0Cpol3(-1),
64     fV0Cpol4(-1),
65     fV0Apol1(-1),
66     fV0Apol2(-1),
67     fV0Apol3(-1),
68     fV0Apol4(-1)
69       {
70         for (Int_t i = 0; i<10; i++){
71           fMeanQxa2[i] = -1;
72           fMeanQya2[i] = -1;
73           fMeanQxc2[i] = -1;
74           fMeanQyc2[i] = -1;   
75         }
76       }
77   AliSpectraAODEventCuts(const char *name);
78   virtual  ~AliSpectraAODEventCuts() {}
79   
80   void  SetEventSelectionBit( UInt_t val )        { fSelectBit = val;  }
81   void  SetCentralityMethod(const char* method) { fCentralityMethod = method; }
82   void  SetTrackBits(UInt_t TrackBits) {fTrackBits=TrackBits;}
83   void  SetIsMC(Bool_t isMC = kFALSE)    {fIsMC = isMC; };
84   void  SetIsLHC10h(Bool_t isLHC10h = kFALSE)    {fIsLHC10h = isLHC10h; };
85   void  SetCentralityCutMin(Float_t cut)  { fCentralityCutMin = cut; }
86   void  SetCentralityCutMax(Float_t cut)  { fCentralityCutMax = cut; }
87   void  SetQVectorCut(Float_t min,Float_t max)  { fQVectorCutMin = min; fQVectorCutMax = max; }
88   void  SetVertexCut(Float_t min,Float_t max)  { fVertexCutMin = min; fVertexCutMax = max; }
89   void  SetMultiplicityCut(Float_t min,Float_t max)  { fMultiplicityCutMin = min; fMultiplicityCutMax = max; }
90   
91   UInt_t GetEventSelectionBit()   const           { return fSelectBit;}
92   TString GetCentralityMethod()   const           { return fCentralityMethod;}
93   UInt_t GetTrackType()          const    { return fTrackBits;}
94   Bool_t GetIsMC()                const           { return fIsMC;}
95   Bool_t GetIsLHC10h()                const           { return fIsLHC10h;}
96   Float_t  GetCentralityMin()      const {  return fCentralityCutMin; }
97   Float_t  GetCentralityMax()     const {  return fCentralityCutMax; }
98   Float_t  GetQVectorCutMin()    const {  return fQVectorCutMin; }
99   Float_t  GetQVectorCutMax()   const {  return fQVectorCutMax; }
100   Float_t  GetVertexCutMin()     const {  return fVertexCutMin; }
101   Float_t  GetVertexCutMax()    const {  return fVertexCutMax; }
102   Float_t  GetMultiplicityCutMin()  const {  return fMultiplicityCutMin; }
103   Float_t  GetMultiplicityCutMax()  const {  return fMultiplicityCutMax; }
104   Double_t  GetqV0C()  const {  return fqV0C; }
105   Double_t  GetqV0A()  const {  return fqV0A; }
106   Double_t  GetqV0Cx()  const {  return fqV0Cx; }
107   Double_t  GetqV0Ax()  const {  return fqV0Ax; }
108   Double_t  GetqV0Cy()  const {  return fqV0Cy; }
109   Double_t  GetqV0Ay()  const {  return fqV0Ay; }
110   Double_t  GetPsiV0C()  const {  return fPsiV0C; }
111   Double_t  GetPsiV0A()  const {  return fPsiV0A; }
112   Double_t  GetCent()  const {  return fCent; }
113   TList *GetOutputList()       {return fOutput;};
114   TList *GetCalibList()       {return fCalib;};
115   void SetCalibFile(TFile *f)    {
116     TIter next(f->GetListOfKeys());
117     TKey *key;
118     while ((key = (TKey*)next())) {
119       AliOADBContainer * obj=(AliOADBContainer*)key->ReadObj();
120       fCalib->Add(obj);
121     }
122   };
123   
124   // Methods
125   Bool_t IsSelected(AliAODEvent * aod,AliSpectraAODTrackCuts     *trackcuts);
126   Bool_t CheckVtxRange();
127   Bool_t CheckCentralityCut();
128   Bool_t CheckMultiplicityCut();
129   Bool_t CheckQVectorCut();
130   Double_t CalculateQVectorLHC10h();
131   void   PrintCuts();
132   Bool_t OpenInfoCalbration(Int_t run);
133   Short_t  GetCentrCode(AliVEvent* ev);
134   
135   Float_t  NumberOfEvents()     { return ((TH1I*)fOutput->FindObject("fHistoCuts"))->GetBinContent(kAcceptedEvents+1); }
136   Float_t  NumberOfProcessedEvents()     { return ((TH1I*)fOutput->FindObject("fHistoCuts"))->GetBinContent(kProcessedEvents+1); }
137   Float_t  NumberOfPhysSelEvents()     { return ((TH1I*)fOutput->FindObject("fHistoCuts"))->GetBinContent(kPhysSelEvents+1); }
138
139   Long64_t Merge(TCollection* list);
140   
141
142  private:
143   
144   AliAODEvent     *fAOD;              //! AOD event
145   UInt_t           fSelectBit;            // Select events according to AliAnalysisTaskJetServices bit maps 
146   TString          fCentralityMethod;     // Method to determine centrality
147   UInt_t           fTrackBits;       // Type of track to be used in the Qvector calculation
148   Bool_t          fIsMC; // true if processing MC
149   Bool_t          fIsLHC10h; // for LHC10h
150   AliSpectraAODTrackCuts     *fTrackCuts;              //! track cuts
151   Bool_t          fIsSelected;        // True if cuts are selected
152   Float_t         fCentralityCutMin;     // minimum centrality percentile
153   Float_t         fCentralityCutMax;     // maximum centrality percentile
154   Float_t         fQVectorCutMin;     // minimum qvecPos
155   Float_t         fQVectorCutMax;     // maximum qvecPos
156   Float_t         fVertexCutMin;     // minimum vertex position
157   Float_t         fVertexCutMax;     // maximum vertex position
158   Float_t         fMultiplicityCutMin;     // minimum multiplicity position
159   Float_t         fMultiplicityCutMax;     // maximum multiplicity position
160   Double_t       fqV0C;            //q vector in the VZERO-C
161   Double_t       fqV0A;            //q vector in the VZERO-A
162   Double_t       fqV0Cx;            //q vector in the VZERO-C, x-comp
163   Double_t       fqV0Ax;            //q vector in the VZERO-A, x-comp
164   Double_t       fqV0Cy;            //q vector in the VZERO-C, y-comp
165   Double_t       fqV0Ay;            //q vector in the VZERO-A, y-comp
166   Double_t       fPsiV0C;            //EP from VZERO-C
167   Double_t       fPsiV0A;            //EP from VZERO-A
168   Double_t       fCent;            //centrality according to fCentralityMethod
169   TList            *fOutput;        // output list 
170   TList            *fCalib;        // output list 
171   Int_t fRun;                       // run number - for calibration
172   TProfile* fMultV0;                //! profile from V0 multiplicity
173   Float_t fV0Cpol1;                 // mean V0C multiplicity - from fit profile - ring 1
174   Float_t fV0Cpol2;                 // mean V0C multiplicity - from fit profile - ring 2
175   Float_t fV0Cpol3;                 // mean V0C multiplicity - from fit profile - ring 3
176   Float_t fV0Cpol4;                 // mean V0C multiplicity - from fit profile - ring 4
177   Float_t fV0Apol1;                 // mean V0A multiplicity - from fit profile - ring 1
178   Float_t fV0Apol2;                 // mean V0A multiplicity - from fit profile - ring 2
179   Float_t fV0Apol3;                 // mean V0A multiplicity - from fit profile - ring 3
180   Float_t fV0Apol4;                 // mean V0A multiplicity - from fit profile - ring 4
181   Float_t fMeanQxa2[10];             // mean Qxa values for centr - recentering
182   Float_t fMeanQya2[10];             // mean Qya values for centr - recentering
183   Float_t fMeanQxc2[10];             // mean Qxc values for centr - recentering
184   Float_t fMeanQyc2[10];             // mean Qyc values for centr - recentering
185
186   AliSpectraAODEventCuts(const AliSpectraAODEventCuts&);
187   AliSpectraAODEventCuts& operator=(const AliSpectraAODEventCuts&);
188   
189   ClassDef(AliSpectraAODEventCuts, 5);
190   
191 };
192 #endif
193