]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODEventCuts.h
Merge branch 'feature-movesplit'
[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 #include "AliVEvent.h"
24
25 class AliSpectraAODEventCuts : public TNamed
26 {
27  public:
28   enum {  kProcessedEvents = 0,kPhysSelEvents,kAcceptedEvents, kVtxRange, kVtxCentral, kVtxNoEvent, kQVector, kNVtxCuts};
29
30   // Constructors
31  AliSpectraAODEventCuts() : 
32   TNamed(),
33     fAOD(0),
34     fSelectBit(AliVEvent::kMB),
35     fCentralityMethod(),
36     fTrackBits(1),
37     fIsMC(0),
38     fIsLHC10h(0),
39     fTrackCuts(0),
40     fIsSelected(0),
41     fCentralityCutMin(0.),
42     fCentralityCutMax(999),
43     fQVectorCutMin(-999.),
44     fQVectorCutMax(999.),
45     fVertexCutMin(-10.),
46     fVertexCutMax(10.),
47     fMultiplicityCutMin(-999.),
48     fMultiplicityCutMax(99999.),
49     fqTPC(-999.),
50     fqV0C(-999.),
51     fqV0A(-999.),
52     fqV0Cx(-999.),
53     fqV0Ax(-999.),
54     fqV0Cy(-999.),
55     fqV0Ay(-999.),
56     fPsiV0C(-999.),
57     fPsiV0A(-999.),
58     fCent(-999.),
59     fOutput(0),
60     fCalib(0),
61     fRun(-1),
62     fMultV0(0),
63     fV0Cpol1(-1),
64     fV0Cpol2(-1),
65     fV0Cpol3(-1),
66     fV0Cpol4(-1),
67     fV0Apol1(-1),
68     fV0Apol2(-1),
69     fV0Apol3(-1),
70     fV0Apol4(-1),
71     fQvecIntList(0),
72     fQvecIntegral(0), 
73     fSplineArrayV0A(0),
74     fSplineArrayV0C(0),
75         fSplineArrayTPC(0),
76     fQgenIntegral(0), 
77     fSplineArrayV0Agen(0),
78     fSplineArrayV0Cgen(0),
79     fQvecMC(0),
80     fNch(0),
81     fQvecCalibType(0),
82     fV0Aeff(0)
83       {
84         for (Int_t i = 0; i<10; i++){
85           fMeanQxa2[i] = -1;
86           fMeanQya2[i] = -1;
87           fMeanQxc2[i] = -1;
88           fMeanQyc2[i] = -1;   
89         }
90       }
91   AliSpectraAODEventCuts(const char *name);
92   virtual  ~AliSpectraAODEventCuts() {}
93   
94   void  SetEventSelectionBit( UInt_t val )        { fSelectBit = val;  }
95   void  SetCentralityMethod(const char* method) { fCentralityMethod = method; }
96   void  SetTrackBits(UInt_t TrackBits) {fTrackBits=TrackBits;}
97   void  SetIsMC(Bool_t isMC = kFALSE)    {fIsMC = isMC; };
98   void  SetIsLHC10h(Bool_t isLHC10h = kFALSE)    {fIsLHC10h = isLHC10h; };
99   void  SetCentralityCutMin(Float_t cut)  { fCentralityCutMin = cut; }
100   void  SetCentralityCutMax(Float_t cut)  { fCentralityCutMax = cut; }
101   void  SetQVectorCut(Float_t min,Float_t max)  { fQVectorCutMin = min; fQVectorCutMax = max; }
102   void  SetVertexCut(Float_t min,Float_t max)  { fVertexCutMin = min; fVertexCutMax = max; }
103   void  SetMultiplicityCut(Float_t min,Float_t max)  { fMultiplicityCutMin = min; fMultiplicityCutMax = max; }
104   
105   UInt_t GetEventSelectionBit()   const           { return fSelectBit;}
106   TString GetCentralityMethod()   const           { return fCentralityMethod;}
107   UInt_t GetTrackType()          const    { return fTrackBits;}
108   Bool_t GetIsMC()                const           { return fIsMC;}
109   Bool_t GetIsLHC10h()                const           { return fIsLHC10h;}
110   Float_t  GetCentralityMin()      const {  return fCentralityCutMin; }
111   Float_t  GetCentralityMax()     const {  return fCentralityCutMax; }
112   Float_t  GetQVectorCutMin()    const {  return fQVectorCutMin; }
113   Float_t  GetQVectorCutMax()   const {  return fQVectorCutMax; }
114   Float_t  GetVertexCutMin()     const {  return fVertexCutMin; }
115   Float_t  GetVertexCutMax()    const {  return fVertexCutMax; }
116   Float_t  GetMultiplicityCutMin()  const {  return fMultiplicityCutMin; }
117   Float_t  GetMultiplicityCutMax()  const {  return fMultiplicityCutMax; }
118   Double_t  GetqTPC()  const {  return fqTPC; }
119   Double_t  GetqV0C()  const {  return fqV0C; }
120   Double_t  GetqV0A()  const {  return fqV0A; }
121   Double_t  GetqV0Cx()  const {  return fqV0Cx; }
122   Double_t  GetqV0Ax()  const {  return fqV0Ax; }
123   Double_t  GetqV0Cy()  const {  return fqV0Cy; }
124   Double_t  GetqV0Ay()  const {  return fqV0Ay; }
125   Double_t  GetPsiV0C()  const {  return fPsiV0C; }
126   Double_t  GetPsiV0A()  const {  return fPsiV0A; }
127   Double_t  GetCent()  const {  return fCent; }
128   TList *GetOutputList()       {return fOutput;};
129   TList *GetCalibList()       {return fCalib;};
130   void SetCalibFile(TFile *f)    {
131     TIter next(f->GetListOfKeys());
132     TKey *key;
133     while ((key = (TKey*)next())) {
134       AliOADBContainer * obj=(AliOADBContainer*)key->ReadObj();
135       fCalib->Add(obj);
136     }
137   };
138   
139   void SetQvecIntegralFile(TFile *f)    {
140     TIter next(f->GetListOfKeys());
141     TKey *key;
142     while ((key = (TKey*)next())) {
143       TObject * h=(TObject*)key->ReadObj();
144       fQvecIntList->Add(h);
145     }
146   };
147   
148   // Methods
149   Bool_t IsSelected(AliAODEvent * aod,AliSpectraAODTrackCuts     *trackcuts);
150   Bool_t CheckVtxRange();
151   Bool_t CheckCentralityCut();
152   Bool_t CheckMultiplicityCut();
153   Bool_t CheckQVectorCut();
154   Double_t CalculateQVectorLHC10h();  //procedure to calculate the q vector for PbPb 2010
155   Double_t CalculateQVectorTPC(Double_t etaMin=-0.5,Double_t etaMax=0.5);  //procedure to calculate the q vector from TPC
156   void   PrintCuts();
157   Bool_t OpenInfoCalbration(Int_t run);
158   Short_t  GetCentrCode(AliVEvent* ev);
159   
160   Double_t CalculateQVector(); //q vector calculation using Event plane task
161   
162   Float_t  NumberOfEvents()     { return ((TH1I*)fOutput->FindObject("fHistoCuts"))->GetBinContent(kAcceptedEvents+1); }
163   Float_t  NumberOfProcessedEvents()     { return ((TH1I*)fOutput->FindObject("fHistoCuts"))->GetBinContent(kProcessedEvents+1); }
164   Float_t  NumberOfPhysSelEvents()     { return ((TH1I*)fOutput->FindObject("fHistoCuts"))->GetBinContent(kPhysSelEvents+1); }
165
166   Long64_t Merge(TCollection* list);
167
168   Double_t GetQvecPercentile(Int_t v0side);  
169   Bool_t CheckSplineArray(TObjArray * splarr, Int_t n);
170   TObjArray *GetSplineArrayV0A() { return fSplineArrayV0A; }
171   TObjArray *GetSplineArrayV0C() { return fSplineArrayV0C; }
172   
173   Double_t GetQvecMC() {return fQvecMC;}
174   
175   Int_t GetNch() { return fNch; }
176   
177   void SetQVecCalibType(Int_t val) { fQvecCalibType=val; }  //0. centrality - 1. Nch
178   Int_t GetNchBin(TH2D * h);
179   
180   Double_t CalculateQVectorMC(Int_t v0side, Int_t type);
181   Double_t GetQvecPercentileMC(Int_t v0side, Int_t type);
182   
183   Int_t CheckVZEROchannel(Int_t vzeroside, Double_t eta, Double_t phi);
184   Int_t CheckVZEROacceptance(Double_t eta);
185
186  private:
187   
188   AliAODEvent     *fAOD;              //! AOD event
189   UInt_t           fSelectBit;            // Select events according to AliAnalysisTaskJetServices bit maps 
190   TString          fCentralityMethod;     // Method to determine centrality
191   UInt_t           fTrackBits;       // Type of track to be used in the Qvector calculation
192   Bool_t          fIsMC; // true if processing MC
193   Bool_t          fIsLHC10h; // for LHC10h
194   AliSpectraAODTrackCuts     *fTrackCuts;              //! track cuts
195   Bool_t          fIsSelected;        // True if cuts are selected
196   Float_t         fCentralityCutMin;     // minimum centrality percentile
197   Float_t         fCentralityCutMax;     // maximum centrality percentile
198   Float_t         fQVectorCutMin;     // minimum qvecPos
199   Float_t         fQVectorCutMax;     // maximum qvecPos
200   Float_t         fVertexCutMin;     // minimum vertex position
201   Float_t         fVertexCutMax;     // maximum vertex position
202   Float_t         fMultiplicityCutMin;     // minimum multiplicity position
203   Float_t         fMultiplicityCutMax;     // maximum multiplicity position
204   Double_t       fqTPC;            //q vector in the TPC
205   Double_t       fqV0C;            //q vector in the VZERO-C
206   Double_t       fqV0A;            //q vector in the VZERO-A
207   Double_t       fqV0Cx;            //q vector in the VZERO-C, x-comp
208   Double_t       fqV0Ax;            //q vector in the VZERO-A, x-comp
209   Double_t       fqV0Cy;            //q vector in the VZERO-C, y-comp
210   Double_t       fqV0Ay;            //q vector in the VZERO-A, y-comp
211   Double_t       fPsiV0C;            //EP from VZERO-C
212   Double_t       fPsiV0A;            //EP from VZERO-A
213   Double_t       fCent;            //centrality according to fCentralityMethod
214   TList            *fOutput;        // output list 
215   TList            *fCalib;        // output list 
216   Int_t fRun;                       // run number - for calibration
217   TProfile* fMultV0;                //! profile from V0 multiplicity
218   Float_t fV0Cpol1;                 // mean V0C multiplicity - from fit profile - ring 1
219   Float_t fV0Cpol2;                 // mean V0C multiplicity - from fit profile - ring 2
220   Float_t fV0Cpol3;                 // mean V0C multiplicity - from fit profile - ring 3
221   Float_t fV0Cpol4;                 // mean V0C multiplicity - from fit profile - ring 4
222   Float_t fV0Apol1;                 // mean V0A multiplicity - from fit profile - ring 1
223   Float_t fV0Apol2;                 // mean V0A multiplicity - from fit profile - ring 2
224   Float_t fV0Apol3;                 // mean V0A multiplicity - from fit profile - ring 3
225   Float_t fV0Apol4;                 // mean V0A multiplicity - from fit profile - ring 4
226   Float_t fMeanQxa2[10];             // mean Qxa values for centr - recentering
227   Float_t fMeanQya2[10];             // mean Qya values for centr - recentering
228   Float_t fMeanQxc2[10];             // mean Qxc values for centr - recentering
229   Float_t fMeanQyc2[10];             // mean Qyc values for centr - recentering
230
231   TList *fQvecIntList;            // List with Qvec Integrated vs centrality distribution
232   TH2D * fQvecIntegral;           // ! Integrated Qvec distribution
233   TObjArray * fSplineArrayV0A;    // TSpline array for VZERO-A
234   TObjArray * fSplineArrayV0C;    // TSpline array for VZERO-C
235   TObjArray * fSplineArrayTPC;    // TSpline array for TPC
236   TH2D * fQgenIntegral;           // ! Integrated Qvec distribution for generated tracks
237   TObjArray * fSplineArrayV0Agen;    // TSpline array for VZERO-A for generated tracks
238   TObjArray * fSplineArrayV0Cgen;    // TSpline array for VZERO-C for generated tracks
239   Double_t fQvecMC; //q-vector value from MC
240   
241   Int_t fNch;
242   Int_t fQvecCalibType; //0. centrality - 1. Nch
243   TH1F * fV0Aeff; // VZEROA efficiency prim+sec / gen.
244
245   AliSpectraAODEventCuts(const AliSpectraAODEventCuts&);
246   AliSpectraAODEventCuts& operator=(const AliSpectraAODEventCuts&);
247   
248   ClassDef(AliSpectraAODEventCuts, 10);
249   
250 };
251 #endif
252