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