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