]>
Commit | Line | Data |
---|---|---|
d25bcbe6 | 1 | #ifndef AlidNdPtAnalysisPbPbAOD_H |
2 | #define AlidNdPtAnalysisPbPbAOD_H | |
3 | ||
4 | ||
5 | //------------------------------------------------------------------------------ | |
6 | // AlidNdPtAnalysisPbPbAOD class used for dNdPt analysis in PbPb collision | |
7 | // via AODs | |
8 | // | |
9 | // Author: P. Luettig, 15.05.2013 | |
72bb4ceb | 10 | // last modified: 08.10.2013 |
d25bcbe6 | 11 | //------------------------------------------------------------------------------ |
12 | ||
13 | class iostream; | |
14 | ||
15 | class TObject; | |
16 | class TFile; | |
17 | class TCint; | |
18 | class THnSparse; | |
19 | ||
20 | #include "AliAnalysisTaskSE.h" | |
21 | ||
22 | ||
23 | #include "TList.h" | |
24 | #include "TFile.h" | |
25 | #include "TH1.h" | |
26 | #include "TH2.h" | |
27 | #include "TH3.h" | |
28 | #include "THnSparse.h" | |
72bb4ceb | 29 | #include "THn.h" |
d25bcbe6 | 30 | #include "TClonesArray.h" |
31 | ||
32 | #include "TParticlePDG.h" | |
33 | #include "TDatabasePDG.h" | |
34 | ||
35 | #include "AliLog.h" | |
36 | #include "AliCentrality.h" | |
37 | #include "AliAODEvent.h" | |
38 | #include "AliVEvent.h" | |
39 | ||
40 | #include "AliInputEventHandler.h" | |
41 | #include "AliAODInputHandler.h" | |
42 | #include "AliAnalysisManager.h" | |
43 | #include "AliMCEventHandler.h" | |
44 | #include "AliAODMCHeader.h" | |
45 | #include "AliAODMCParticle.h" | |
46 | #include "AliGenHijingEventHeader.h" | |
47 | #include "AliGenPythiaEventHeader.h" | |
d0483ba3 | 48 | #include "AliExternalTrackParam.h" |
ea3cfeda | 49 | #include "AliESDtrack.h" |
d25bcbe6 | 50 | |
51 | #include "TSystem.h" | |
52 | #include "TROOT.h" | |
53 | ||
54 | class AlidNdPtAnalysisPbPbAOD : public AliAnalysisTaskSE { | |
55 | public : | |
ea3cfeda | 56 | enum CheckQuantity { cqCrossedRows = 0, cqNcluster = 1, cqChi = 2, cqLength = 3 }; |
72bb4ceb | 57 | enum KinematicQuantity { kqPt = 0, kqEta = 1, kqPhi = 2 }; |
ea3cfeda | 58 | enum MaxCheckQuantity { cqMax = 4 }; |
72bb4ceb | 59 | enum MaxKinematicQuantity { kqMax = 3 }; |
60 | ||
ea3cfeda | 61 | AlidNdPtAnalysisPbPbAOD(const char *name = "dNdPtPbPbAOD"); |
d25bcbe6 | 62 | ~AlidNdPtAnalysisPbPbAOD(); |
63 | ||
64 | virtual void UserCreateOutputObjects(); | |
65 | virtual void UserExec(Option_t *option); | |
66 | virtual void Terminate(Option_t *); | |
67 | ||
68 | // Set binning for Histograms (if not set default binning is used) | |
69 | void SetBinsMult(Int_t nbins, Double_t* edges) { Printf("[I] Setting Mult Bins"); fMultNbins = nbins; fBinsMult = GetArrayClone(nbins,edges); } | |
70 | void SetBinsPt(Int_t nbins, Double_t* edges) { Printf("[I] Setting pT Bins"); fPtNbins = nbins; fBinsPt = GetArrayClone(nbins,edges); } | |
71 | void SetBinsPtCorr(Int_t nbins, Double_t* edges) { Printf("[I] Setting pTcorr Bins"); fPtCorrNbins = nbins; fBinsPtCorr = GetArrayClone(nbins,edges); } | |
72bb4ceb | 72 | void SetBinsPtCheck(Int_t nbins, Double_t* edges) { Printf("[I] Setting pTcheck Bins"); fPtCheckNbins = nbins; fBinsPtCheck = GetArrayClone(nbins,edges); } |
d25bcbe6 | 73 | void SetBinsEta(Int_t nbins, Double_t* edges) { Printf("[I] Setting Eta Bins"); fEtaNbins = nbins; fBinsEta = GetArrayClone(nbins,edges); } |
72bb4ceb | 74 | void SetBinsEtaCheck(Int_t nbins, Double_t* edges) { Printf("[I] Setting EtaCheck Bins"); fEtaCheckNbins = nbins; fBinsEtaCheck = GetArrayClone(nbins,edges); } |
d25bcbe6 | 75 | void SetBinsZv(Int_t nbins, Double_t* edges) { Printf("[I] Setting Zv Bins"); fZvNbins = nbins; fBinsZv= GetArrayClone(nbins,edges); } |
76 | void SetBinsCentrality(Int_t nbins, Double_t* edges) { Printf("[I] Setting Cent Bins"); fCentralityNbins = nbins; fBinsCentrality = GetArrayClone(nbins,edges); } | |
72bb4ceb | 77 | void SetBinsPhi(Int_t nbins, Double_t* edges) { Printf("[I] Setting Phi Bins"); fPhiNbins = nbins; fBinsPhi = GetArrayClone(nbins,edges); } |
d25bcbe6 | 78 | |
79 | // set event cut variables | |
ea3cfeda PL |
80 | void SetCutMaxZVertex( Double_t d) { fCutMaxZVertex = d; } |
81 | Double_t GetCutMaxZVertex() { return fCutMaxZVertex; } | |
d25bcbe6 | 82 | |
83 | // set track kinematic cut parameters | |
ea3cfeda PL |
84 | void SetCutPtRange(Double_t ptmin, Double_t ptmax) { fCutPtMin = ptmin; fCutPtMax = ptmax; } |
85 | Double_t GetCutPtMin() { return fCutPtMin; } | |
86 | Double_t GetCutPtMax() { return fCutPtMax; } | |
87 | ||
88 | void SetCutEtaRange(Double_t etamin, Double_t etamax) { fCutEtaMin = etamin; fCutEtaMax = etamax; } | |
89 | Double_t GetCutEtaMin() { return fCutEtaMin; } | |
90 | Double_t GetCutEtaMax() { return fCutEtaMax; } | |
91 | ||
92 | void EnableRelativeCuts() { Printf("[I] Relative Cuts enabled"); fUseRelativeCuts = kTRUE; } | |
93 | Bool_t AreRelativeCutsEnabled() { return fUseRelativeCuts; } | |
94 | ||
95 | // setter and getter track quality cut parameters | |
96 | void SetCutRequireTPCRefit(Bool_t *b) { fCutRequireTPCRefit = b; } | |
97 | Bool_t IsTPCRefitRequired() { return fCutRequireTPCRefit; } | |
98 | ||
99 | void SetCutMinNClustersTPC(Double_t d) { fCutMinNumberOfClusters = d; } | |
100 | Double_t GetCutMinNClustersTPC() { return fCutMinNumberOfClusters; } | |
101 | ||
102 | void SetCutPercMinNClustersTPC(Double_t d) { Printf("[I] Take only %.2f%% tracks with most clusters", d*100.); fCutPercMinNumberOfClusters = d; } | |
103 | Double_t GetCutPercMinNClustersTPC() { return fCutPercMinNumberOfClusters; } | |
104 | ||
105 | void SetCutMinNCrossedRowsTPC(Double_t d) { fCutMinNumberOfCrossedRows = d; } | |
106 | Double_t GetCutMinNCrossedRowsTPC() { return fCutMinNumberOfCrossedRows; } | |
107 | ||
108 | void SetCutPercMinNCrossedRowsTPC(Double_t d) { Printf("[I] Take only %.2f%% tracks with most crossedRows", d*100.); fCutPercMinNumberOfCrossedRows = d; } | |
109 | Double_t GetCutPercMinNCrossedRowsTPC() { return fCutPercMinNumberOfCrossedRows; } | |
110 | ||
111 | void SetCutMinRatioCrossedRowsOverFindableClustersTPC(Double_t d) { fCutMinRatioCrossedRowsOverFindableClustersTPC = d; } | |
112 | Double_t GetCutMinRatioCrossedRowsOverFindableClustersTPC() { return fCutMinRatioCrossedRowsOverFindableClustersTPC; } | |
113 | ||
114 | void SetCutLengthInTPCPtDependent() { fCutLengthInTPCPtDependent = kTRUE; } | |
115 | Bool_t DoCutLengthInTPCPtDependent() { return fCutLengthInTPCPtDependent; } | |
116 | ||
117 | void SetPrefactorLengthInTPCPtDependent(Double_t d) { fPrefactorLengthInTPCPtDependent = d; } | |
118 | Double_t GetPrefactorLengthInTPCPtDependent() { return fPrefactorLengthInTPCPtDependent; } | |
119 | ||
120 | void SetCutMaxChi2PerClusterTPC(Double_t d) { fCutMaxChi2PerClusterTPC = d; } | |
121 | void SetCutMaxFractionSharedTPCClusters(Double_t d) { fCutMaxFractionSharedTPCClusters = d; } | |
122 | void SetCutMaxDCAToVertexZ(Double_t d) { fCutMaxDCAToVertexZ = d; } | |
123 | void SetCutMaxDCAToVertexXY(Double_t d) { fCutMaxDCAToVertexXY = d; } | |
124 | void SetCutRequireITSRefit(Bool_t *b) { fCutRequireITSRefit = b; } | |
125 | void SetCutMaxChi2PerClusterITS(Double_t d) { fCutMaxChi2PerClusterITS = d; } | |
126 | void SetCutDCAToVertex2D(Bool_t *b) { fCutDCAToVertex2D = b; } | |
127 | void SetCutRequireSigmaToVertex(Bool_t *b) { fCutRequireSigmaToVertex = b; } | |
d25bcbe6 | 128 | void SetCutMaxDCAToVertexXYPtDep(Double_t d0, Double_t d1, Double_t d2) |
129 | { | |
ea3cfeda PL |
130 | fCutMaxDCAToVertexXYPtDepPar0 = d0; |
131 | fCutMaxDCAToVertexXYPtDepPar1 = d1; | |
132 | fCutMaxDCAToVertexXYPtDepPar2 = d2; | |
d25bcbe6 | 133 | } |
ea3cfeda PL |
134 | void SetCutAcceptKinkDaughters(Bool_t *b) { fCutAcceptKinkDaughters = b; } |
135 | void SetCutMaxChi2TPCConstrainedGlobal(Double_t d) { fCutMaxChi2TPCConstrainedGlobal = d; } | |
136 | ||
72bb4ceb | 137 | // fill function for cross check histos |
138 | Bool_t FillDebugHisto(Double_t *dCrossCheckVar, Double_t *dKineVar, Double_t dCentrality, Bool_t bIsAccepted); | |
139 | ||
d0483ba3 | 140 | // getter for DCA |
b3341d37 | 141 | Bool_t GetDCA(const AliAODTrack *track, AliAODEvent *evt, Double_t d0z0[2]); |
d0483ba3 | 142 | |
ea3cfeda PL |
143 | THnSparseF *GetHistZvPtEtaCent() const { return fZvPtEtaCent; } |
144 | TH1F *GetHistEventStatistics() const { return fEventStatistics; } | |
d25bcbe6 | 145 | |
146 | const char * GetParticleName(Int_t pdg); | |
147 | ||
148 | AliGenHijingEventHeader* GetHijingEventHeader(AliAODMCHeader *header); | |
149 | AliGenPythiaEventHeader* GetPythiaEventHeader(AliAODMCHeader *header); | |
150 | ||
ea3cfeda PL |
151 | |
152 | Bool_t SetRelativeCuts(AliAODEvent *event); | |
153 | ||
154 | Bool_t IsTrackAccepted(AliAODTrack *tr, Double_t dCentrality, Double_t bMagZ); | |
d25bcbe6 | 155 | Bool_t IsMCTrackAccepted(AliAODMCParticle *part); |
156 | ||
157 | Bool_t IsHijingParticle(const AliAODMCParticle *part, AliGenHijingEventHeader* hijingGenHeader); | |
158 | Bool_t IsPythiaParticle(const AliAODMCParticle *part, AliGenPythiaEventHeader* pythiaGenHeader); | |
159 | ||
160 | static Double_t* GetArrayClone(Int_t n, Double_t* source); | |
161 | ||
162 | private : | |
163 | ||
164 | // Output List | |
165 | TList *fOutputList; | |
166 | ||
167 | // Histograms | |
ea3cfeda PL |
168 | TH1F *fPt; // simple pT histogramm |
169 | TH1F *fMCPt; // simple pT truth histogramm | |
170 | THnSparseF *fZvPtEtaCent; //-> Zv:Pt:Eta:Cent | |
bc2a9da9 | 171 | THnSparseF *fPhiPtEtaCent; //-> Phi:Pt:Eta:Cent |
ea3cfeda PL |
172 | THnSparseF *fMCRecPrimZvPtEtaCent; //-> MC Zv:Pt:Eta:Cent |
173 | THnSparseF *fMCGenZvPtEtaCent; //-> MC Zv:Pt:Eta:Cent | |
174 | THnSparseF *fMCRecSecZvPtEtaCent; //-> MC Zv:Pt:Eta:Cent, only secondaries | |
bc2a9da9 PL |
175 | THnSparseF *fMCRecPrimPhiPtEtaCent; //-> MC Phi:Pt:Eta:Cent |
176 | THnSparseF *fMCGenPhiPtEtaCent; //-> MC Phi:Pt:Eta:Cent | |
177 | THnSparseF *fMCRecSecPhiPtEtaCent; //-> MC Phi:Pt:Eta:Cent, only secondaries | |
ea3cfeda PL |
178 | TH1F *fEventStatistics; // contains statistics of number of events after each cut |
179 | TH1F *fEventStatisticsCentrality; // contains number of events vs centrality, events need to have a track in kinematic range | |
180 | TH1F *fMCEventStatisticsCentrality; // contains MC number of events vs centrality, events need to have a track in kinematic range | |
181 | TH1F *fAllEventStatisticsCentrality; // contains number of events vs centrality, events need to be triggered | |
182 | TH2F *fEventStatisticsCentralityTrigger; // contains number of events vs centrality in 1% bins vs trigger | |
183 | THnSparseF *fZvMultCent; // Zv:Mult:Cent | |
184 | TH1F *fTriggerStatistics; // contains number of events per trigger | |
185 | TH1F *fMCTrackPdgCode; // contains statistics of pdg codes of tracks | |
186 | TH1F *fMCTrackStatusCode; // contains statistics of status codes of tracks | |
187 | TH1F *fCharge; // charge distribution in data | |
188 | TH1F *fMCCharge; // charge distribution in MC | |
189 | TH2F *fMCPdgPt; // PDGvs PT for MC Particles | |
190 | TH1F *fMCHijingPrim; // number of particles, which are Hijing particles and primaries | |
191 | THnSparseF *fDCAPtAll; //control histo: DCAz:DCAxy:pT:eta:phi for all reconstructed tracks | |
192 | THnSparseF *fDCAPtAccepted; //control histo: DCAz:DCAxy:pT:eta:phi for all accepted reco tracks | |
193 | THnSparseF *fMCDCAPtSecondary; //control histo: DCAz:DCAxy:pT:eta:phi for all accepted reco track, which are secondaries (using MC info) | |
194 | THnSparseF *fMCDCAPtPrimary; //control histo: DCAz:DCAxy:pT:eta:phi for all accepted reco track, which are primaries (using MC info) | |
195 | THnF *fCrossCheckAll[4]; //control histo: {CrossedRows,Ncluster,Chi} vs pT,eta,phi,Centrality for all tracks | |
196 | THnF *fCrossCheckAcc[4]; //control histo: {CrossedRows,Ncluster,Chi} vs pT,eta,phi,Centrality after cuts | |
197 | TH1F *fCutPercClusters; // control histo: number of clusters, where the relative cut has been set e-by-e | |
198 | TH1F *fCutPercCrossed; // control histo: number of crossed rows, where the relative cut has been set e-by-e | |
199 | TH2F *fCrossCheckRowsLength; // control histo: number of crossed rows vs length in TPC | |
200 | TH2F *fCrossCheckClusterLength; // control histo: number of clusters vs length in TPC | |
201 | TH2F *fCrossCheckRowsLengthAcc; // control histo: number of crossed rows vs length in TPC for all accepted tracks | |
202 | TH2F *fCrossCheckClusterLengthAcc; // control histo: number of clusters vs length in TPC for all accepted tracks | |
72bb4ceb | 203 | |
d25bcbe6 | 204 | |
205 | // global variables | |
ea3cfeda | 206 | Bool_t fIsMonteCarlo; |
72bb4ceb | 207 | |
d25bcbe6 | 208 | // event cut variables |
ea3cfeda | 209 | Double_t fCutMaxZVertex; |
d25bcbe6 | 210 | |
211 | // track kinematic cut variables | |
ea3cfeda PL |
212 | Double_t fCutPtMin; |
213 | Double_t fCutPtMax; | |
214 | Double_t fCutEtaMin; | |
215 | Double_t fCutEtaMax; | |
d25bcbe6 | 216 | |
217 | // track quality cut variables | |
ea3cfeda PL |
218 | Bool_t fUseRelativeCuts; |
219 | Bool_t fCutRequireTPCRefit; | |
220 | Double_t fCutMinNumberOfClusters; | |
221 | Double_t fCutPercMinNumberOfClusters; | |
222 | Double_t fCutMinNumberOfCrossedRows; | |
223 | Double_t fCutPercMinNumberOfCrossedRows; | |
224 | Double_t fCutMinRatioCrossedRowsOverFindableClustersTPC; | |
225 | Double_t fCutMaxChi2PerClusterTPC; | |
226 | Double_t fCutMaxFractionSharedTPCClusters; | |
227 | Double_t fCutMaxDCAToVertexZ; | |
228 | Double_t fCutMaxDCAToVertexXY; | |
229 | Bool_t fCutRequireITSRefit; | |
230 | Double_t fCutMaxChi2PerClusterITS; | |
231 | Bool_t fCutDCAToVertex2D; | |
232 | Bool_t fCutRequireSigmaToVertex; | |
233 | Double_t fCutMaxDCAToVertexXYPtDepPar0; | |
234 | Double_t fCutMaxDCAToVertexXYPtDepPar1; | |
235 | Double_t fCutMaxDCAToVertexXYPtDepPar2; | |
236 | Bool_t fCutAcceptKinkDaughters; | |
237 | Double_t fCutMaxChi2TPCConstrainedGlobal; | |
238 | Bool_t fCutLengthInTPCPtDependent; | |
239 | Double_t fPrefactorLengthInTPCPtDependent; | |
d25bcbe6 | 240 | |
241 | //binning for THNsparse | |
242 | Int_t fMultNbins; | |
243 | Int_t fPtNbins; | |
244 | Int_t fPtCorrNbins; | |
72bb4ceb | 245 | Int_t fPtCheckNbins; |
d25bcbe6 | 246 | Int_t fEtaNbins; |
72bb4ceb | 247 | Int_t fEtaCheckNbins; |
d25bcbe6 | 248 | Int_t fZvNbins; |
249 | Int_t fCentralityNbins; | |
72bb4ceb | 250 | Int_t fPhiNbins; |
d25bcbe6 | 251 | Double_t* fBinsMult; //[fMultNbins] |
252 | Double_t* fBinsPt; //[fPtNbins] | |
253 | Double_t* fBinsPtCorr; //[fPtCorrNbins] | |
72bb4ceb | 254 | Double_t* fBinsPtCheck; //[fPtCheckNbins] |
d25bcbe6 | 255 | Double_t* fBinsEta; //[fEtaNbins] |
72bb4ceb | 256 | Double_t* fBinsEtaCheck; //[fEtaCheckNbins] |
d25bcbe6 | 257 | Double_t* fBinsZv; //[fZvNbins] |
258 | Double_t* fBinsCentrality; //[fCentralityNbins] | |
72bb4ceb | 259 | Double_t* fBinsPhi; //[fPhiNbins] |
d25bcbe6 | 260 | |
261 | AlidNdPtAnalysisPbPbAOD(const AlidNdPtAnalysisPbPbAOD&); // not implemented | |
262 | AlidNdPtAnalysisPbPbAOD& operator=(const AlidNdPtAnalysisPbPbAOD&); // not implemented | |
263 | ||
ea3cfeda | 264 | ClassDef(AlidNdPtAnalysisPbPbAOD,4); // has to be at least 1, otherwise not streamable... |
d25bcbe6 | 265 | }; |
266 | ||
267 | #endif |