]>
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 | |
10 | //------------------------------------------------------------------------------ | |
11 | ||
12 | class iostream; | |
13 | ||
14 | class TObject; | |
15 | class TFile; | |
16 | class TCint; | |
17 | class THnSparse; | |
18 | ||
19 | #include "AliAnalysisTaskSE.h" | |
20 | ||
21 | ||
22 | #include "TList.h" | |
23 | #include "TFile.h" | |
24 | #include "TH1.h" | |
25 | #include "TH2.h" | |
26 | #include "TH3.h" | |
27 | #include "THnSparse.h" | |
28 | #include "TClonesArray.h" | |
29 | ||
30 | #include "TParticlePDG.h" | |
31 | #include "TDatabasePDG.h" | |
32 | ||
33 | #include "AliLog.h" | |
34 | #include "AliCentrality.h" | |
35 | #include "AliAODEvent.h" | |
36 | #include "AliVEvent.h" | |
37 | ||
38 | #include "AliInputEventHandler.h" | |
39 | #include "AliAODInputHandler.h" | |
40 | #include "AliAnalysisManager.h" | |
41 | #include "AliMCEventHandler.h" | |
42 | #include "AliAODMCHeader.h" | |
43 | #include "AliAODMCParticle.h" | |
44 | #include "AliGenHijingEventHeader.h" | |
45 | #include "AliGenPythiaEventHeader.h" | |
d0483ba3 | 46 | #include "AliExternalTrackParam.h" |
d25bcbe6 | 47 | |
48 | #include "TSystem.h" | |
49 | #include "TROOT.h" | |
50 | ||
51 | class AlidNdPtAnalysisPbPbAOD : public AliAnalysisTaskSE { | |
52 | public : | |
53 | AlidNdPtAnalysisPbPbAOD(); | |
54 | AlidNdPtAnalysisPbPbAOD(const char *name); | |
55 | ~AlidNdPtAnalysisPbPbAOD(); | |
56 | ||
57 | virtual void UserCreateOutputObjects(); | |
58 | virtual void UserExec(Option_t *option); | |
59 | virtual void Terminate(Option_t *); | |
60 | ||
61 | // Set binning for Histograms (if not set default binning is used) | |
62 | void SetBinsMult(Int_t nbins, Double_t* edges) { Printf("[I] Setting Mult Bins"); fMultNbins = nbins; fBinsMult = GetArrayClone(nbins,edges); } | |
63 | void SetBinsPt(Int_t nbins, Double_t* edges) { Printf("[I] Setting pT Bins"); fPtNbins = nbins; fBinsPt = GetArrayClone(nbins,edges); } | |
64 | void SetBinsPtCorr(Int_t nbins, Double_t* edges) { Printf("[I] Setting pTcorr Bins"); fPtCorrNbins = nbins; fBinsPtCorr = GetArrayClone(nbins,edges); } | |
65 | void SetBinsEta(Int_t nbins, Double_t* edges) { Printf("[I] Setting Eta Bins"); fEtaNbins = nbins; fBinsEta = GetArrayClone(nbins,edges); } | |
66 | void SetBinsZv(Int_t nbins, Double_t* edges) { Printf("[I] Setting Zv Bins"); fZvNbins = nbins; fBinsZv= GetArrayClone(nbins,edges); } | |
67 | void SetBinsCentrality(Int_t nbins, Double_t* edges) { Printf("[I] Setting Cent Bins"); fCentralityNbins = nbins; fBinsCentrality = GetArrayClone(nbins,edges); } | |
68 | ||
69 | ||
70 | // set event cut variables | |
71 | void SetCutMaxZVertex( Double_t d) { dCutMaxZVertex = d; } | |
72 | ||
73 | // set track kinematic cut parameters | |
74 | void SetCutPtRange(Double_t ptmin, Double_t ptmax) { dCutPtMin = ptmin; dCutPtMax = ptmax; } | |
75 | void SetCutEtaRange(Double_t etamin, Double_t etamax) { dCutEtaMin = etamin; dCutEtaMax = etamax; } | |
76 | ||
77 | // set track quality cut parameters | |
78 | void SetCutRequireTPCRefit(Bool_t *b) { bCutRequireTPCRefit = b; } | |
f856053f | 79 | void SetCutMinNCrossedRowsTPC(Double_t d) { dCutMinNumberOfCrossedRows = d; } |
d25bcbe6 | 80 | void SetCutMinRatioCrossedRowsOverFindableClustersTPC(Double_t d) { dCutMinRatioCrossedRowsOverFindableClustersTPC = d; } |
81 | void SetCutMaxChi2PerClusterTPC(Double_t d) { dCutMaxChi2PerClusterTPC = d; } | |
82 | void SetCutMaxFractionSharedTPCClusters(Double_t d) { dCutMaxFractionSharedTPCClusters = d; } | |
83 | void SetCutMaxDCAToVertexZ(Double_t d) { dCutMaxDCAToVertexZ = d; } | |
84 | void SetCutMaxDCAToVertexXY(Double_t d) { dCutMaxDCAToVertexXY = d; } | |
85 | void SetCutRequireITSRefit(Bool_t *b) { bCutRequireITSRefit = b; } | |
86 | void SetCutMaxChi2PerClusterITS(Double_t d) { dCutMaxChi2PerClusterITS = d; } | |
87 | void SetCutDCAToVertex2D(Bool_t *b) { dCutDCAToVertex2D = b; } | |
88 | void SetCutRequireSigmaToVertex(Bool_t *b) { dCutRequireSigmaToVertex = b; } | |
89 | void SetCutMaxDCAToVertexXYPtDep(Double_t d0, Double_t d1, Double_t d2) | |
90 | { | |
91 | dCutMaxDCAToVertexXYPtDepPar0 = d0; | |
92 | dCutMaxDCAToVertexXYPtDepPar1 = d1; | |
93 | dCutMaxDCAToVertexXYPtDepPar2 = d2; | |
94 | } | |
95 | void SetCutAcceptKinkDaughters(Bool_t *b) { bCutAcceptKinkDaughters = b; } | |
96 | void SetCutMaxChi2TPCConstrainedGlobal(Double_t d) { dCutMaxChi2TPCConstrainedGlobal = d; } | |
97 | ||
f856053f | 98 | // getter for qualtiy track cuts |
99 | Double_t GetCutMinNCrossedRowsTPC() { return dCutMinNumberOfCrossedRows; } | |
100 | ||
d0483ba3 | 101 | // getter for DCA |
102 | Double_t GetDCAz(AliAODTrack *track, AliAODEvent *event); | |
103 | Double_t GetDCAxy(AliAODTrack *track, AliAODEvent *event); | |
104 | Double_t GetDCA(AliAODTrack *tr, AliAODEvent *evt, Bool_t bDCAz); | |
105 | ||
d25bcbe6 | 106 | THnSparseF *GetHistZvPtEtaCent() const { return hnZvPtEtaCent; } |
107 | TH1F *GetHistEventStatistics() const { return hEventStatistics; } | |
108 | ||
109 | const char * GetParticleName(Int_t pdg); | |
110 | ||
111 | AliGenHijingEventHeader* GetHijingEventHeader(AliAODMCHeader *header); | |
112 | AliGenPythiaEventHeader* GetPythiaEventHeader(AliAODMCHeader *header); | |
113 | ||
5747f2c6 | 114 | // Int_t IsMCSecondary(AliAODMCParticle *part, TClonesArray *arrayMC); |
d25bcbe6 | 115 | Bool_t IsTrackAccepted(AliAODTrack *tr); |
116 | Bool_t IsMCTrackAccepted(AliAODMCParticle *part); | |
117 | ||
118 | Bool_t IsHijingParticle(const AliAODMCParticle *part, AliGenHijingEventHeader* hijingGenHeader); | |
119 | Bool_t IsPythiaParticle(const AliAODMCParticle *part, AliGenPythiaEventHeader* pythiaGenHeader); | |
120 | ||
121 | static Double_t* GetArrayClone(Int_t n, Double_t* source); | |
122 | ||
123 | private : | |
124 | ||
125 | // Output List | |
126 | TList *fOutputList; | |
127 | ||
128 | // Histograms | |
f856053f | 129 | TH1F *hPt; // simple pT histogramm |
130 | TH1F *hMCPt; // simple pT truth histogramm | |
d25bcbe6 | 131 | THnSparseF *hnZvPtEtaCent; //-> Zv:Pt:Eta:Cent |
132 | THnSparseF *hnMCRecPrimZvPtEtaCent; //-> MC Zv:Pt:Eta:Cent | |
133 | THnSparseF *hnMCGenZvPtEtaCent; //-> MC Zv:Pt:Eta:Cent | |
5747f2c6 | 134 | THnSparseF *hnMCRecSecZvPtEtaCent; //-> MC Zv:Pt:Eta:Cent, only secondaries |
d25bcbe6 | 135 | TH1F *hEventStatistics; // contains statistics of number of events after each cut |
136 | TH1F *hEventStatisticsCentrality; // contains number of events vs centrality, events need to have a track in kinematic range | |
137 | TH1F *hAllEventStatisticsCentrality; // contains number of events vs centrality, events need to be triggered | |
138 | THnSparseF *hnZvMultCent; // Zv:Mult:Cent | |
139 | TH1F *hTriggerStatistics; // contains number of events per trigger | |
140 | TH1F *hMCTrackPdgCode; // contains statistics of pdg codes of tracks | |
141 | TH1F *hMCTrackStatusCode; // contains statistics of status codes of tracks | |
142 | TH1F *hCharge; // charge distribution in data | |
143 | TH1F *hMCCharge; // charge distribution in MC | |
144 | TH2F *hMCPdgPt; // PDGvs PT for MC Particles | |
145 | TH1F *hMCHijingPrim; // number of particles, which are Hijing particles and primaries | |
146 | TH1F *hAccNclsTPC; //control histo: number of clusters in TPC for accepted tracks | |
147 | TH1F *hAccCrossedRowsTPC; //control histo: number of crossed rows in TPC for accepted tracks | |
d0483ba3 | 148 | THnSparseF *hDCAPtAll; //control histo: DCAz vs DCAxy vs pT for all reconstructed tracks |
149 | THnSparseF *hDCAPtAccepted; //control histo: DCAz vs DCAxy vs pT for all accepted reco tracks | |
150 | THnSparseF *hMCDCAPtSecondary; //control histo: DCAz vs DCAxy vs pT for all accepted reco track, which are secondaries (using MC info) | |
151 | THnSparseF *hMCDCAPtPrimary; //control histo: DCAz vs DCAxy vs pT for all accepted reco track, which are primaries (using MC info) | |
152 | ||
d25bcbe6 | 153 | |
154 | // global variables | |
155 | Bool_t bIsMonteCarlo; | |
f856053f | 156 | |
d25bcbe6 | 157 | // event cut variables |
158 | Double_t dCutMaxZVertex; | |
159 | ||
160 | // track kinematic cut variables | |
161 | Double_t dCutPtMin; | |
162 | Double_t dCutPtMax; | |
163 | Double_t dCutEtaMin; | |
164 | Double_t dCutEtaMax; | |
165 | ||
166 | // track quality cut variables | |
167 | Bool_t bCutRequireTPCRefit; | |
168 | Double_t dCutMinNumberOfCrossedRows; | |
169 | Double_t dCutMinRatioCrossedRowsOverFindableClustersTPC; | |
170 | Double_t dCutMaxChi2PerClusterTPC; | |
171 | Double_t dCutMaxFractionSharedTPCClusters; | |
172 | Double_t dCutMaxDCAToVertexZ; | |
173 | Double_t dCutMaxDCAToVertexXY; | |
174 | Bool_t bCutRequireITSRefit; | |
175 | Double_t dCutMaxChi2PerClusterITS; | |
176 | Bool_t dCutDCAToVertex2D; | |
177 | Bool_t dCutRequireSigmaToVertex; | |
178 | Double_t dCutMaxDCAToVertexXYPtDepPar0; | |
179 | Double_t dCutMaxDCAToVertexXYPtDepPar1; | |
180 | Double_t dCutMaxDCAToVertexXYPtDepPar2; | |
181 | Bool_t bCutAcceptKinkDaughters; | |
182 | Double_t dCutMaxChi2TPCConstrainedGlobal; | |
183 | ||
184 | //binning for THNsparse | |
185 | Int_t fMultNbins; | |
186 | Int_t fPtNbins; | |
187 | Int_t fPtCorrNbins; | |
188 | Int_t fEtaNbins; | |
189 | Int_t fZvNbins; | |
190 | Int_t fCentralityNbins; | |
191 | Double_t* fBinsMult; //[fMultNbins] | |
192 | Double_t* fBinsPt; //[fPtNbins] | |
193 | Double_t* fBinsPtCorr; //[fPtCorrNbins] | |
194 | Double_t* fBinsEta; //[fEtaNbins] | |
195 | Double_t* fBinsZv; //[fZvNbins] | |
196 | Double_t* fBinsCentrality; //[fCentralityNbins] | |
197 | ||
198 | AlidNdPtAnalysisPbPbAOD(const AlidNdPtAnalysisPbPbAOD&); // not implemented | |
199 | AlidNdPtAnalysisPbPbAOD& operator=(const AlidNdPtAnalysisPbPbAOD&); // not implemented | |
200 | ||
5747f2c6 | 201 | ClassDef(AlidNdPtAnalysisPbPbAOD,2); // has to be at least 1, otherwise not streamable... |
d25bcbe6 | 202 | }; |
203 | ||
204 | #endif |