]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/EBYE/PIDFluctuation/task/AliEbyENetChargeFluctuationTask.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / EBYE / PIDFluctuation / task / AliEbyENetChargeFluctuationTask.h
1 #ifndef AliEbyENetChargeFluctuationTask_cxx
2 #define AliEbyENetChargeFluctuationTask_cxx
3
4 //=========================================================================//
5 //                                                                         //
6 //             AliEbyE Analysis for Net-Charge     Fluctuation             //
7 //              Author:   Deepika Rathee  || Satyajit Jena                 //
8 //                        drathee@cern.ch || sjena@cern.ch                 //
9 //                                                                         //
10 //=========================================================================//
11
12 #include "THnBase.h"
13 #include "THn.h"
14 #include "TH1F.h"
15 #include "TF1.h"
16 #include "TProfile2D.h"
17 #include "TRandom3.h"
18
19 class TList;
20
21 class AliESDtrack;
22 class AliMCEvent;
23 class AliStack;
24 class AliPIDResponse;
25 class AliESDtrackCuts;
26 class AliInputEventHandler;
27 class AliESDInputHandler;
28 class AliAODInputHandler;
29 class AliAODEvent;
30 class AliAODTrack;
31 class AliAODMCParticle;
32 class AliMCParticle;
33 class TClonesArray;
34 class AliHelperPID;
35
36 #include "AliAnalysisTaskSE.h"
37
38 class AliEbyENetChargeFluctuationTask: public AliAnalysisTaskSE {
39
40  public:
41
42   AliEbyENetChargeFluctuationTask( const char *name = "NetChargeFluctuation");
43   virtual ~AliEbyENetChargeFluctuationTask();
44   
45   virtual void   UserCreateOutputObjects();
46   virtual void   UserExec(Option_t *option);
47   virtual void   Terminate(Option_t *);
48   
49   void SetVertexDiamond(Double_t vx, Double_t vy, Double_t vz) {
50     fVxMax = vx;fVyMax = vy; fVzMax = vz;
51   }
52   void SetKinematicsCuts(Double_t ptl, Double_t pth, Double_t eta, Double_t rap) {
53     fPtMin = ptl; fPtMax = pth; fEtaMin = -eta; fEtaMax = eta; fRapMin = -rap; fRapMax = rap;
54   }
55   void SetTrackFilterBit(Int_t bit) {fAODtrackCutBit = bit; }
56   void SetCentralityEstimator(const char* cent)  { fCentralityEstimator = cent;}
57   void SetSystemType(Int_t i) { fSystemType = i; }
58  
59   void SetPhi(Double_t phil) {fPhiMax = phil;}
60   void SetIsMC() {fIsMC = kTRUE;}
61   void SetNSubSamples(Int_t i) {fNSubSamples = i;}
62   void Debug() {fDebug = kTRUE;}
63   void SetIsAOD() {fIsAOD = kTRUE;}
64   void SetAnal(Int_t i);// {fAnalType = i; };
65   void SetHelperPID(AliHelperPID* pid){ fHelperPID = pid; }
66   void SetDca(Double_t dcaxy,Double_t dcaz) { fDcaXy = dcaxy; fDcaZ = dcaz;}
67  
68   void SetAnalysisCutObject(AliESDtrackCuts *const trackCuts) {
69     fESDtrackCuts = trackCuts;}
70   
71
72  private:
73
74   Int_t GetPDG(Int_t i) {
75     if (i == 0) return 0;  else if (i == 1) return  211;  
76     else if (i == 2) return  321; else if (i == 3) return  2212;  
77     else return 0; }
78   Double_t *CreateLogAxis(Int_t nbins, Double_t xmin, Double_t xmax);
79   
80   /*---- Setup events ----*/
81
82   Int_t SetupEvent();
83   Int_t SetupESD();
84   Int_t SetupAOD();
85   Int_t SetupMC();
86   Int_t SetupEventCR(AliESDInputHandler *esdHandler, AliAODInputHandler *aodHandler, AliMCEvent *mcEvent);
87   void  ResetCurrentEvent();
88   /* ---- Check Events/Track/AOD/ESD ---- */
89   
90   Bool_t ChargedTrack(AliVTrack* track);
91   Bool_t TriggeredEvents();
92   Bool_t RejectedEvent();
93   Bool_t ParticleRapidity(AliVParticle *particle, Double_t &yP, Int_t gCurPid);
94   Bool_t TrackRapidity(AliVTrack *track, Double_t &yP, Int_t gCurPid);
95   Bool_t IsFindableInTPC(Int_t label);
96   Bool_t AcceptEvent(AliAODEvent *event, Int_t cent) const; //! accept eventc
97   Bool_t IsEventStats(Int_t *aEventCuts);
98   Bool_t AcceptTrack(AliVTrack *track) const;
99   Bool_t AcceptTrackMC(AliVParticle *particle, Int_t idxMC) const;
100
101   /* ------ Containers ------ */
102   
103   void InitPhy();  
104   void CreateQA();
105   void CreateBasicQA();
106   void CreateBasicHistos(const Char_t *title, Bool_t isMC, Bool_t isPer);
107   void CreateRatioHistos(const Char_t *title,Bool_t isMC, Bool_t isPer);
108   void CreateGroupHistos(const Char_t *name, const Char_t *title, Int_t nSample,Bool_t isPer);
109   void FillBasicHistos(Bool_t isMC, Bool_t isPer);
110   void FillRatioHistos(Bool_t isMC,Bool_t isPer);
111   void FillGroupHistos(const Char_t *name, Int_t iSub, Bool_t isMC,Bool_t isPer);
112   
113  
114   void FillCC(Int_t i);
115   void FillRCC(Int_t i);
116   void FillRecCE(Int_t i);
117   void FillRecDE(Int_t i);
118   void FillRecDED(Int_t i);
119   void FillGenCE(Int_t i);
120   void FillQAThnRec(AliVTrack *track, Int_t gPid, Double_t rap);
121   void FillQAThnMc(AliVParticle *particle, Int_t gPid, Double_t rap);
122
123   /* ------ Get-Calculate-Fill ------ */
124
125   void ExecAA();
126   void ExecpA();
127   void Execpp();
128   void CalEC();
129   void CalED();
130   void CreateCE(); 
131   void CreateDEM(); 
132   void CreateDED(); 
133   void CalculateCE(Int_t gPid);
134   void CalculateDE(Int_t gPid);
135   void CalculateDED(Int_t gPid);
136   
137   /* Global Members Private */
138
139   AliInputEventHandler *fInputEventHandler; // Input Handler
140   AliESDEvent          *fESD;               // Current ESD events
141   AliAODEvent          *fAOD;               // Current AOD events
142   AliMCEvent           *fMCEvent;           // Current MC Event
143   AliStack             *fStack;             // Stak tree
144   AliAODInputHandler   *fAODHandler;        // AOD handler
145   AliESDInputHandler   *fESDHandler;        // ESD handler
146   AliStack             *fMCStack;           // MC Stack
147   TClonesArray         *fArrayMC;           // AOD MC stack
148   AliESDtrackCuts      *fESDtrackCuts;      // ESD Track Cuts
149
150   TList     *fQaList;                       // Tree of QA
151   TList     *fPhyList;                      // For Analysis
152   TList     *fDcaList;                      // dca for Both Data and MC 
153   TList     *fEffList;                      // Correction List
154
155   Int_t      fSystemType;                   // Translated to Int_t 0:"pp", 1:"pA", 2:"AA"
156   TString    fCentralityEstimator;          // "V0M","TRK","TKL","ZDC","FMD"  
157  
158   Double_t   fVxMax;                        // X vertex  Range
159   Double_t   fVyMax;                        // Y vertex Range
160   Double_t   fVzMax;                        // Z vertex Range
161   Double_t   fPhiMin;                       // Phi Minimum
162   Double_t   fPhiMax;                       // Phi Maximum
163   Double_t   fPtMin;                        // pT Minimum
164   Double_t   fPtMax;                        // Pt Maximum
165   Double_t   fEtaMin;                       // Eta Minimum
166   Double_t   fEtaMax;                       // Eta Maximum
167   Double_t   fRapMin;                       // Rapidity Minimum
168   Double_t   fRapMax;                       // Rapidity Maximum
169   Double_t   fDcaXy;                        // DCA Xy
170   Double_t   fDcaZ;                         // DCA Z
171   Double_t   fCentralityBin;                // Centrality bin of current event within max centrality bin
172   Double_t   fCentralityPercentile;         // Centrality percentile of current event
173   Double_t   fNp[4][2];                     // Array of particle/anti-particle counts
174   Double_t   fMCNp[4][2];                   // Array of MC particle/anti-particle counts
175   Double_t   fRedFactp[9][2];               // Array of particle/anti-particle reduced factorial
176   Double_t   fCurGen[8];                    // Current Gen Track
177   Double_t   fCurGenD[8];                   // Current info on DGen
178   Double_t   fCurRecD[7];                   // Current DRec
179   Double_t   fCurRec[5];                    // Current Rec info
180   Double_t   fCurCont[6];                   // Current Contamination
181
182   Float_t    fMinTrackLengthMC;             // Min track length for MC tracks
183   Int_t      fAODtrackCutBit;               // AOD BITs
184   Int_t      fNSubSamples;                  // N subsamples
185   Int_t      fSubSampleIdx;                 // Subsample idx for current event
186   Int_t      fOrder;                        // Max order of higher order distributions
187   Int_t      fNTriggers;                    // N triggers used
188   Int_t      fHEventStatMax;                // Max N cuts to be included in HEventSta
189   Int_t      fNCentralityBins;              // N centrality bins used
190   Int_t      fCentralityBinMax;             // Max Cent
191   Int_t      fNTracks;                      // Number of Tracks of Current Events
192
193   Bool_t     fIsMC;                         // Is MC event - Auto set by Add Task
194   Bool_t     fIsRatio;                      // Is Ratio
195   Bool_t     fIsAOD;                        // analysis mode: 0 = ESDs  | 1 = AODs
196   Bool_t     fIsSub;                        // analysis mode SS  
197   Bool_t     fIsBS;                         // analysis mode BS
198   Bool_t     fIsPer;                        // analysis mode PER
199   Bool_t     fIsEff;                        // analysis mode Eff
200   Bool_t     fDebug;                        // Check for QA
201   Bool_t     fIsQa;                         // Check for QA
202   Bool_t     fIsPhy;                        // Check for QA
203   Bool_t     fIsDca;                        // Check for QA
204   Bool_t     fIsNu;                         // Check for QA
205
206   TRandom3  *fRan;                          // Radom Number BS
207   TRandom3  *fRanIdx;                       // Random Number SS
208
209   AliHelperPID *fHelperPID;                 // Customised HelperPID class
210
211   AliEbyENetChargeFluctuationTask(const AliEbyENetChargeFluctuationTask&);
212   AliEbyENetChargeFluctuationTask& operator = (const AliEbyENetChargeFluctuationTask&);
213   ClassDef(AliEbyENetChargeFluctuationTask, 1);
214
215 };
216
217 #endif
218
219