]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/AliAnalysisTaskHFEFlow.h
0aaa6fc3aba3182d5c6729a6b92223ebcc79efea
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliAnalysisTaskHFEFlow.h
1 /**************************************************************************\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
3 *                                                                        *\r
4 * Author: The ALICE Off-line Project.                                    *\r
5 * Contributors are mentioned in the code where appropriate.              *\r
6 *                                                                        *\r
7 * Permission to use, copy, modify and distribute this software and its   *\r
8 * documentation strictly for non-commercial purposes is hereby granted   *\r
9 * without fee, provided that the above copyright notice appears in all   *\r
10 * copies and that both the copyright notice and this permission notice   *\r
11 * appear in the supporting documentation. The authors make no claims     *\r
12 * about the suitability of this software for any purpose. It is          *\r
13 * provided "as is" without express or implied warranty.                  *\r
14 **************************************************************************/\r
15 //\r
16 // Flow task class for the ALICE HFE group\r
17 //\r
18 //\r
19 #ifndef ALIANALYSISTASKHFEFLOW_H\r
20 #define ALIANALYSISTASKHFEFLOW_H\r
21 \r
22 \r
23 \r
24 \r
25 #include <AliAnalysisTaskSE.h>\r
26 \r
27 class TList;\r
28 class AliVTrack;\r
29 class AliVEvent;\r
30 class AliESDtrack;\r
31 class AliESDEvent;\r
32 class AliMCEvent;\r
33 class AliFlowTrackCuts;\r
34 class AliFlowCandidateTrack;\r
35 class AliHFEcuts;\r
36 class AliHFEpid;\r
37 class TH1D;\r
38 class TH2D;\r
39 class TF1;\r
40 class TProfile;\r
41 class TProfile2D;\r
42 class THnSparse;\r
43 class AliHFEpidQAmanager;\r
44 class AliFlowEvent;\r
45 class AliESDtrackCuts;\r
46 class AliHFEVZEROEventPlane;\r
47 class TArrayI;\r
48 \r
49 class AliAnalysisTaskHFEFlow: public AliAnalysisTaskSE {\r
50   \r
51 public:\r
52 \r
53   typedef enum{\r
54     kElectronfromconversion = 0,\r
55     kElectronfromconversionboth = 1,\r
56     kElectronfrompi0 = 2,\r
57     kElectronfrompi0both = 3,\r
58     kElectronfrometa = 4,\r
59     kElectronfrometaboth = 5,\r
60     kElectronfromC = 6,\r
61     kElectronfromB = 7,\r
62     kElectronfromother = 8,\r
63     kNoElectron = 9\r
64   } FlowSource_t;\r
65   \r
66   typedef enum{\r
67     kS = 0,\r
68     kOp = 1\r
69   } FlowSign_t;\r
70 \r
71 \r
72 \r
73 \r
74   AliAnalysisTaskHFEFlow();\r
75   AliAnalysisTaskHFEFlow(const char *name);\r
76   AliAnalysisTaskHFEFlow(const AliAnalysisTaskHFEFlow &ref);\r
77   AliAnalysisTaskHFEFlow& operator=(const AliAnalysisTaskHFEFlow &ref);\r
78   virtual void Copy(TObject &o) const;\r
79   virtual ~AliAnalysisTaskHFEFlow();\r
80   \r
81   virtual void  UserExec(Option_t */*option*/);\r
82   virtual void  UserCreateOutputObjects();\r
83 \r
84   void SetAODAnalysis(Bool_t aodAnalysis) { fAODAnalysis = aodAnalysis; };\r
85   void SetUseFlagAOD(Bool_t useFlagAOD) { fUseFlagAOD = useFlagAOD; }\r
86   void SetApplyCut(Bool_t applyCut) { fApplyCut = applyCut; }\r
87   void SetFlags(ULong_t flags)          { fFlags = flags; }\r
88   \r
89   AliHFEpid *GetPID() const { return fPID; }\r
90   AliHFEpid *GetPIDTOFOnly() const { return fPIDTOFOnly; }\r
91   AliHFEpidQAmanager *GetPIDQAManager() const { return fPIDqa; }\r
92   AliHFEpid *GetPIDBackground() const { return fPIDBackground; }\r
93   AliHFEpidQAmanager *GetPIDBackgroundQAManager() const { return fPIDBackgroundqa; }\r
94 \r
95 \r
96   void SetContamination(TF1 * const function,Int_t k) { fContamination[k] = function; };\r
97   void SetV2Contamination(TF1 * const function,Int_t k) { fv2contamination[k] = function; };\r
98   void SetHFECuts(AliHFEcuts * const cuts) { fHFECuts = cuts; };\r
99   void SetHFEBackgroundCuts(AliESDtrackCuts * const cuts) { fHFEBackgroundCuts = cuts; };\r
100   void SetSubEtaGapTPC(Bool_t  subEtaGapTPC) { fSubEtaGapTPC = subEtaGapTPC; };\r
101   void SetEtaGap(Double_t  etaGap) { fEtaGap = etaGap; };\r
102   void SetVZEROEventPlane(Bool_t vzeroEventPlane) { fVZEROEventPlane = vzeroEventPlane; };\r
103   void SetVZEROEventPlaneA(Bool_t vzeroEventPlaneA) { fVZEROEventPlaneA = vzeroEventPlaneA; };\r
104   void SetVZEROEventPlaneC(Bool_t vzeroEventPlaneC) { fVZEROEventPlaneC = vzeroEventPlaneC; };\r
105   void SetHFEVZEROEventPlane(AliHFEVZEROEventPlane *hfeVZEROEventPlane) { fHFEVZEROEventPlane = hfeVZEROEventPlane; };\r
106 \r
107   void SetNbBinsCentralityQCumulant(Int_t nbBinsCentralityQCumulant) { fNbBinsCentralityQCumulant = nbBinsCentralityQCumulant; };\r
108   void SetBinCentralityLess(Int_t k, Float_t value)  { fBinCentralityLess[k] = value; };\r
109   void SetNbBinsPtQCumulant(Int_t nbBinsPtQCumulant) { fNbBinsPtQCumulant = nbBinsPtQCumulant; };\r
110   void SetMinPtQCumulant(Double_t minPtQCumulant) { fMinPtQCumulant = minPtQCumulant; };\r
111   void SetMaxPtQCumulant(Double_t maxPtQCumulant) { fMaxPtQCumulant = maxPtQCumulant; };\r
112 \r
113   void SetAfterBurnerOn(Bool_t afterBurnerOn)     { fAfterBurnerOn = afterBurnerOn; };\r
114   void SetNonFlowNumberOfTrackClones(Int_t nonFlowNumberOfTrackClones) { fNonFlowNumberOfTrackClones = nonFlowNumberOfTrackClones; };\r
115   void SetV1V2V3V4V5(Double_t v1,Double_t v2,Double_t v3,Double_t v4,Double_t v5) {fV1 = v1; fV2 = v2; fV3 = v3; fV4 = v4; fV5 = v5; };\r
116   void SetMaxNumberOfIterations(Int_t maxNumberOfIterations) { fMaxNumberOfIterations = maxNumberOfIterations; };\r
117   void SetPrecisionPhi(Double_t precisionPhi) { fPrecisionPhi = precisionPhi;};\r
118   void SetUseMCReactionPlane(Bool_t useMCReactionPlane) { fUseMCReactionPlane = useMCReactionPlane;};\r
119   void SetMCPID(Bool_t mcPID) { fMCPID = mcPID;};\r
120   void SetNoPID(Bool_t noPID) { fNoPID = noPID;};\r
121 \r
122   void SetDebugLevel(Int_t debugLevel) { fDebugLevel = debugLevel;};\r
123   void SetMonitorEventPlane(Bool_t monitorEventPlane) { fMonitorEventPlane = monitorEventPlane;};\r
124   void SetMonitorContamination(Bool_t monitorContamination) { fMonitorContamination = monitorContamination;};\r
125   void SetMonitorPhotonic(Bool_t monitorPhotonic) { fMonitorPhotonic = monitorPhotonic;};\r
126   void SetMonitorWithoutPID(Bool_t monitorWithoutPID) { fMonitorWithoutPID = monitorWithoutPID;};\r
127   void SetMonitorTrackCuts(Bool_t monitorTrackCuts) { fMonitorTrackCuts = monitorTrackCuts;};\r
128   void SetMonitorQCumulant(Bool_t monitorQCumulant) { fMonitorQCumulant = monitorQCumulant;};\r
129 \r
130   Int_t GetNbBinsCentralityQCumulant() const { return  fNbBinsCentralityQCumulant; };\r
131   Double_t GetBinCentralityLess(Int_t k) const { return fBinCentralityLess[k]; };\r
132   \r
133   AliFlowCandidateTrack *MakeTrack( Double_t mass, Double_t pt, Double_t phi, Double_t eta) ;\r
134   Double_t GetPhiAfterAddV2(Double_t phi,Double_t reactionPlaneAngle) const;\r
135 \r
136   void  SetMaxInvmass(Double_t maxInvmass) { fMaxInvmass = maxInvmass; };\r
137   void  SetMaxopening3D(Double_t maxOpening3D) { fMaxopening3D = maxOpening3D; };\r
138   void  SetMaxopeningtheta(Double_t maxOpeningtheta) { fMaxopeningtheta = maxOpeningtheta; };\r
139   void  SetMaxopeningphi(Double_t maxOpeningphi) { fMaxopeningphi = maxOpeningphi; };\r
140   void  SetAlgorithmMA(Bool_t algorithmMA) { fAlgorithmMA = algorithmMA; };\r
141   void  SetMassConstraint(Bool_t massConstraint) { fSetMassConstraint = massConstraint; };\r
142 \r
143   Int_t    LookAtNonHFE(Int_t iTrack1, AliVTrack *track1, AliVEvent *fESD, AliMCEvent *mcEvent,Int_t binct,Double_t deltaphi,Int_t source,Int_t indexmother);\r
144   \r
145 private:\r
146   TList     *fListHist;         //! TH list\r
147   Bool_t    fAODAnalysis;       // AOD analysis\r
148   Bool_t    fUseFlagAOD;        // Use the preselected AOD track\r
149   Bool_t    fApplyCut;       // Apply the analysis cut for AOD tracks\r
150   ULong_t   fFlags;             // reconstruction AOD status flags \r
151   \r
152   Bool_t    fVZEROEventPlane;  // Use Event Planes from VZERO\r
153   Bool_t    fVZEROEventPlaneA; // Use Event Planes from VZERO A\r
154   Bool_t    fVZEROEventPlaneC; // Use Event Planes from VZERO C\r
155 \r
156   Bool_t    fSubEtaGapTPC;    // bool to fill with eta gap\r
157   Double_t  fEtaGap;          // Value of the eta gap\r
158 \r
159   Int_t     fNbBinsCentralityQCumulant;  // Number of Bins Q Cumulant\r
160   Double_t  fBinCentralityLess[10];      // Centrality Bin lower value\r
161   Int_t     fNbBinsPtQCumulant;          // Nbbinspt QCumulant method\r
162   Double_t  fMinPtQCumulant;             // Min pt QCumulant method\r
163   Double_t  fMaxPtQCumulant;             // Max pt QCumulant method\r
164   Bool_t    fAfterBurnerOn;              // Add flow to all tracks\r
165   Int_t     fNonFlowNumberOfTrackClones; // number of times to clone the particles (nonflow) \r
166   Double_t  fV1;        // Add Flow. Must be in range [0,0.5].\r
167   Double_t  fV2;        // Add Flow. Must be in range [0,0.5].\r
168   Double_t  fV3;        // Add Flow. Must be in range [0,0.5].\r
169   Double_t  fV4;        // Add Flow. Must be in range [0,0.5].\r
170   Double_t  fV5;        // Add Flow. Must be in range [0,0.5].\r
171   Int_t     fMaxNumberOfIterations; // Max number of iteration for adding v2\r
172   Double_t  fPrecisionPhi;  // precision phi for adding v2\r
173   Bool_t    fUseMCReactionPlane; // use MC reaction plane\r
174 \r
175   Bool_t    fMCPID; // MC PID for electrons\r
176   Bool_t    fNoPID; // No PID for checks\r
177 \r
178   Double_t  fChi2OverNDFCut;   // Limit chi2\r
179   Double_t  fMaxdca;           // Limit dca\r
180   Double_t  fMaxopeningtheta;  // Limit opening angle in theta\r
181   Double_t  fMaxopeningphi;    // Limit opening angle in phi\r
182   Double_t  fMaxopening3D;     // Limit opening 3D\r
183   Double_t  fMaxInvmass;       // Limit invariant mass\r
184   Bool_t    fSetMassConstraint; // Set mass constraint\r
185   \r
186 \r
187   Int_t     fDebugLevel; // Debug Level  \r
188   Bool_t    fMonitorEventPlane; // Monitor event plane\r
189   Bool_t    fMonitorContamination; // Monitor contamination\r
190   Bool_t    fMonitorPhotonic;// Monitor photonic\r
191   Bool_t    fMonitorWithoutPID;// Monitor without PID\r
192   Bool_t    fMonitorTrackCuts;// Monitor track cuts\r
193   Bool_t    fMonitorQCumulant;// Monitor Q cumulant\r
194   \r
195   // Cuts for FLOW PWG2\r
196   AliFlowTrackCuts* fcutsRP;  //! Reference particle cut\r
197   AliFlowTrackCuts* fcutsPOI; //! Particle Of Interest cut\r
198   \r
199   // Cuts for HFE\r
200   AliHFEcuts *fHFECuts;           // HFE cuts\r
201   AliHFEpid  *fPID;               // PID cuts \r
202   AliHFEpid  *fPIDTOFOnly;        // PID cuts TOF only\r
203   AliHFEpidQAmanager *fPIDqa;     // QA Manager\r
204   AliFlowEvent *fflowEvent;       //! Flow event \r
205 \r
206   // Hadron Contamination\r
207   TF1 *fContamination[11];        // Parametrization of the contamination (0-5,5-10,10-20,20-30,30-40,40-50,50-60,60-70,70-80,80-90,90-100)\r
208   TF1 *fv2contamination[11];      // Parametrization of the v2 of charged pions (0-5,5-10,10-20,20-30,30-40,40-50,50-60,60-70,70-80,80-90,90-100)\r
209 \r
210   // Cuts for background study\r
211   AliESDtrackCuts *fHFEBackgroundCuts;    // HFE background cuts\r
212   AliHFEpid  *fPIDBackground;             // PID background cuts \r
213   AliHFEpidQAmanager *fPIDBackgroundqa;   // QA Manager Background  \r
214   Bool_t fAlgorithmMA;                    // algorithm MA\r
215 \r
216   // List of tracks\r
217   TArrayI *fArraytrack;                    //! list of tracks\r
218   Int_t fCounterPoolBackground;            // number of tracks\r
219 \r
220   // VZERO Event plane after calibration 2010\r
221   AliHFEVZEROEventPlane *fHFEVZEROEventPlane; // VZERO event plane calibrated\r
222   \r
223   // Histos\r
224   TH2D *fHistEV;               //! Number of events\r
225   \r
226   // A Event plane as function of phiepa, phiepb, phiepc, phiepd centrality \r
227   // a V0A, b V0C, c TPC,\r
228   THnSparseF *fEventPlane;     //! Event plane\r
229   \r
230   // B Event Plane after subtraction as function of phiep, centrality \r
231   THnSparseF *fEventPlaneaftersubtraction; //! Event plane\r
232 \r
233   // Contamination\r
234   THnSparseF *fFractionContamination;    //! Fraction of contamination as function of pt\r
235   TProfile2D *fContaminationv2;          //! v2 of contamination\r
236 \r
237   // Monitoring Event plane: cos2phi, sin2phi, centrality\r
238   THnSparseF *fCosSin2phiep;        //! Cos(2phi), Sin(2phi)\r
239   \r
240   // E Monitoring Event plane after subtraction of the track: cos, centrality, pt, eta\r
241   THnSparseF *fCos2phie;  //! Monitoring\r
242   THnSparseF *fSin2phie;  //! Monitoring\r
243   THnSparseF *fCos2phiep;  //! Monitoring\r
244   THnSparseF *fSin2phiep;  //! Monitoring\r
245   THnSparseF *fSin2phiephiep;  //! Monitoring\r
246 \r
247   // Fbis Resolution as function of cosres, cosres, cosres, centrality for three subevents (V0)\r
248   // a V0A, b V0C, c TPC\r
249   THnSparseF *fCosResabc; //! Res\r
250   THnSparseF *fSinResabc; //! Res\r
251   TProfile   *fProfileCosResab; //! Profile Res_a_b\r
252   TProfile   *fProfileCosResac; //! Profile Res_a_c\r
253   TProfile   *fProfileCosResbc; //! Profile Res_b_c\r
254   \r
255   // F Resolution as function of cosres, centrality for two subevents (TPC)\r
256   THnSparseF *fCosRes; //! Res\r
257   THnSparseF *fSinRes; //! Res\r
258   TProfile   *fProfileCosRes; //! Profile Res\r
259   \r
260   // Debuging Cuts step by step all centrality together: pt, step (6)\r
261   THnSparseF *fTrackingCuts; //! Tracking Cuts\r
262 \r
263   // Before PID cut\r
264   // G Maps delta phi as function of deltaphi, centrality, pt\r
265   THnSparseF *fDeltaPhiMapsBeforePID; //! Delta phi\r
266   // H Maps cos phi : cos, centrality, pt\r
267   THnSparseF *fCosPhiMapsBeforePID; //! Cos\r
268 \r
269   // G Maps delta phi as function of deltaphi, centrality, pt\r
270   THnSparseF *fDeltaPhiMaps; //! Delta phi\r
271   THnSparseF *fDeltaPhiMapsContamination; //! Delta phi for contamination substraction\r
272   // H Maps cos phi : cos, centrality, pt\r
273   THnSparseF *fCosPhiMaps;         //! Cos\r
274   TProfile2D *fProfileCosPhiMaps;  //! Profile Cos\r
275 \r
276   // Background study: not statistic but tagged \r
277   //THnSparseF *fDeltaPhiMapsTaggedPhotonic; //! Delta phi\r
278   //THnSparseF *fCosPhiMapsTaggedPhotonic; //! Cos\r
279   //THnSparseF *fDeltaPhiMapsTaggedNonPhotonic; //! Delta phi\r
280   //THnSparseF *fCosPhiMapsTaggedNonPhotonic; //! Cos\r
281   //THnSparseF *fDeltaPhiMapsTaggedPhotonicLS; //! Delta phi\r
282   //THnSparseF *fCosPhiMapsTaggedPhotonicLS; //! Cos\r
283 \r
284   // Background study: centrality, pt, source\r
285   THnSparseF *fMCSourceDeltaPhiMaps; //! Source MC\r
286   // Background study: deltaphi, centrality, pt, minv, source\r
287   THnSparseF *fOppSignDeltaPhiMaps;  //! Delta phi\r
288   THnSparseF *fSameSignDeltaPhiMaps; //! Delta phi\r
289   // Background study: angle, centrality, source\r
290   THnSparseF *fOppSignAngle;         // ! Opening Angles\r
291   THnSparseF *fSameSignAngle;        // ! Opening Angles\r
292 \r
293   Int_t FindMother(Int_t tr, AliMCEvent *mcEvent, Int_t &indexmother);\r
294   Int_t CheckPdg(Int_t tr, AliMCEvent* mcEvent);\r
295   Int_t IsMotherGamma(Int_t tr, AliMCEvent* mcEvent);\r
296   Int_t IsMotherPi0(Int_t tr, AliMCEvent* mcEvent);\r
297   Int_t IsMotherC(Int_t tr, AliMCEvent* mcEvent);\r
298   Int_t IsMotherB(Int_t tr, AliMCEvent* mcEvent);\r
299   Int_t IsMotherEta(Int_t tr, AliMCEvent* mcEvent);\r
300     \r
301   \r
302   ClassDef(AliAnalysisTaskHFEFlow, 1); // analysisclass\r
303 };\r
304 \r
305 #endif\r