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