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