]>
Commit | Line | Data |
---|---|---|
477d6cee | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
477d6cee | 15 | |
16 | //_________________________________________________________________________ | |
17 | // | |
18 | // Class for track selection and identification (not done now) | |
19 | // Tracks from the CTS are kept in the AOD. | |
20 | // Few histograms produced. | |
21 | // | |
22 | //-- Author: Gustavo Conesa (INFN-LNF) | |
23 | //_________________________________________________________________________ | |
24 | ||
25 | ||
26 | // --- ROOT system --- | |
477d6cee | 27 | #include "TParticle.h" |
28 | #include "TH2F.h" | |
05d0d05d | 29 | |
477d6cee | 30 | //---- AliRoot system ---- |
31 | #include "AliAnaChargedParticles.h" | |
32 | #include "AliCaloTrackReader.h" | |
33 | #include "AliAODPWG4Particle.h" | |
34 | #include "AliStack.h" | |
ff45398a | 35 | #include "AliFiducialCut.h" |
88f9563f | 36 | #include "AliVTrack.h" |
591cc579 | 37 | #include "AliAODMCParticle.h" |
fedea415 | 38 | #include "AliAODTrack.h" |
39 | #include "AliAODEvent.h" | |
40 | #include "AliESDEvent.h" | |
477d6cee | 41 | |
42 | ClassImp(AliAnaChargedParticles) | |
43 | ||
05d0d05d | 44 | //__________________________________________________ |
fe9615b9 | 45 | AliAnaChargedParticles::AliAnaChargedParticles() : |
745913ae | 46 | AliAnaCaloTrackCorrBaseClass(), |
9b4a1ee2 | 47 | fFillPileUpHistograms(0), fFillTrackBCHistograms(0), |
52bd777f | 48 | fFillVertexBC0Histograms(0), |
52bd777f | 49 | //Histograms |
50 | fhNtracks(0), fhPt(0), fhPtNoCut(0), | |
51 | fhPtCutDCA(0), fhPtCutDCABCOK(0), | |
8f467228 | 52 | fhPhiNeg(0), fhEtaNeg(0), |
fedea415 | 53 | fhPhiPos(0), fhEtaPos(0), |
54 | fhEtaPhiPos(0), fhEtaPhiNeg(0), | |
52bd777f | 55 | fhPtVtxOutBC0(0), fhEtaPhiVtxOutBC0(0), |
56 | fhPtVtxInBC0(0), fhEtaPhiVtxInBC0(0), | |
8f467228 | 57 | fhPtSPDRefit(0), fhPtNoSPDRefit(0), fhPtNoSPDNoRefit(0), |
58 | fhEtaPhiSPDRefitPt02(0), fhEtaPhiNoSPDRefitPt02(0), fhEtaPhiNoSPDNoRefitPt02(0), | |
59 | fhEtaPhiSPDRefitPt3(0), fhEtaPhiNoSPDRefitPt3(0), fhEtaPhiNoSPDNoRefitPt3(0), | |
62c64236 | 60 | |
52bd777f | 61 | //TOF |
fedea415 | 62 | fhTOFSignal(0), fhTOFSignalPtCut(0), fhTOFSignalBCOK(0), |
cc944149 | 63 | fhPtTOFSignal(0), fhPtTOFSignalDCACut(0), |
64 | fhPtTOFSignalVtxOutBC0(0), fhPtTOFSignalVtxInBC0(0), | |
52bd777f | 65 | fhPtTOFStatus0(0), fhEtaPhiTOFStatus0(0), |
fedea415 | 66 | fhEtaPhiTOFBC0(0), fhEtaPhiTOFBCPlus(0), fhEtaPhiTOFBCMinus(0), |
67 | fhEtaPhiTOFBC0PileUpSPD(0), | |
68 | fhEtaPhiTOFBCPlusPileUpSPD(0), | |
52bd777f | 69 | fhEtaPhiTOFBCMinusPileUpSPD(0), |
85c4406e | 70 | fhProductionVertexBC(0), |
71 | fhPtNPileUpSPDVtx(0), fhPtNPileUpTrkVtx(0), | |
72 | fhPtNPileUpSPDVtxBC0(0), fhPtNPileUpTrkVtxBC0(0) | |
73 | ||
477d6cee | 74 | { |
75 | //Default Ctor | |
76 | ||
fedea415 | 77 | for(Int_t i = 0; i < 7; i++) |
78 | { | |
79 | fhPtPileUp [i] = 0; | |
80 | fhPtTOFSignalPileUp[i] = 0; | |
52bd777f | 81 | fhPtTOFSignalVtxOutBC0PileUp[i] = 0; |
82 | fhPtTOFSignalVtxInBC0PileUp [i] = 0; | |
83 | fhProductionVertexBCPileUp [i] = 0; | |
fedea415 | 84 | } |
85 | ||
86 | for(Int_t i = 0; i < 3; i++) | |
87 | { | |
88 | fhPtDCA [i] = 0 ; | |
8f467228 | 89 | |
90 | fhPtDCASPDRefit [i] = 0 ; | |
91 | fhPtDCANoSPDRefit [i] = 0 ; | |
92 | fhPtDCANoSPDNoRefit [i] = 0 ; | |
93 | ||
fedea415 | 94 | fhPtDCAPileUp [i] = 0 ; |
fedea415 | 95 | fhPtDCATOFBC0 [i] = 0 ; |
52bd777f | 96 | fhPtDCATOFBCOut [i] = 0 ; |
fedea415 | 97 | fhPtDCAPileUpTOFBC0 [i] = 0 ; |
52bd777f | 98 | fhPtDCANoTOFHit [i] = 0 ; |
99 | fhPtDCAPileUpNoTOFHit [i] = 0 ; | |
fedea415 | 100 | |
52bd777f | 101 | fhPtDCAVtxOutBC0 [i] = 0 ; |
102 | fhPtDCAVtxInBC0 [i] = 0 ; | |
103 | fhPtDCAVtxOutBC0PileUp[i] = 0 ; | |
104 | fhPtDCAVtxInBC0PileUp [i] = 0 ; | |
cbd6236f | 105 | fhPtDCAVtxOutBC0NoTOFHit[i] = 0 ; |
106 | fhPtDCAVtxInBC0NoTOFHit [i] = 0 ; | |
52bd777f | 107 | fhPtDCAVtxOutBC0PileUpNoTOFHit[i] = 0 ; |
cbd6236f | 108 | fhPtDCAVtxInBC0PileUpNoTOFHit [i] = 0 ; |
fedea415 | 109 | } |
fe9615b9 | 110 | |
62c64236 | 111 | // MC |
112 | for(Int_t imcPart = 0; imcPart < 6; imcPart++) | |
113 | { | |
114 | fhPtMCPart [imcPart] = 0; | |
115 | fhPtMCPrimPart [imcPart] = 0; | |
116 | fhPhiMCPart [imcPart] = 0; | |
117 | fhPhiMCPrimPart[imcPart] = 0; | |
118 | fhEtaMCPart [imcPart] = 0; | |
119 | fhEtaMCPrimPart[imcPart] = 0; | |
120 | } | |
121 | ||
477d6cee | 122 | //Initialize parameters |
123 | InitParameters(); | |
477d6cee | 124 | |
477d6cee | 125 | } |
126 | ||
05d0d05d | 127 | //_______________________________________________________ |
477d6cee | 128 | TList * AliAnaChargedParticles::GetCreateOutputObjects() |
129 | { | |
130 | // Create histograms to be saved in output file and | |
131 | // store them in fOutputContainer | |
132 | ||
133 | ||
134 | TList * outputContainer = new TList() ; | |
62c64236 | 135 | outputContainer->SetName("ChargedParticleHistos") ; |
477d6cee | 136 | |
745913ae | 137 | Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); |
138 | Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); | |
139 | Float_t ptmin = GetHistogramRanges()->GetHistoPtMin(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin(); | |
5025c139 | 140 | |
141 | fhNtracks = new TH1F ("hNtracks","# of tracks", 1000,0,1000); | |
142 | fhNtracks->SetXTitle("# of tracks"); | |
143 | outputContainer->Add(fhNtracks); | |
05d0d05d | 144 | |
145 | fhPt = new TH1F ("hPt","p_T distribution", nptbins,ptmin,ptmax); | |
477d6cee | 146 | fhPt->SetXTitle("p_{T} (GeV/c)"); |
147 | outputContainer->Add(fhPt); | |
148 | ||
52bd777f | 149 | fhPtNoCut = new TH1F ("hPtNoCut","p_T distribution, raw tracks", nptbins,ptmin,ptmax); |
150 | fhPtNoCut->SetXTitle("p_{T} (GeV/c)"); | |
151 | outputContainer->Add(fhPtNoCut); | |
152 | ||
153 | fhPtCutDCA = new TH1F ("hPtCutDCA","p_T distribution, cut DCA", nptbins,ptmin,ptmax); | |
154 | fhPtCutDCA->SetXTitle("p_{T} (GeV/c)"); | |
155 | outputContainer->Add(fhPtCutDCA); | |
156 | ||
9b4a1ee2 | 157 | if(fFillVertexBC0Histograms) |
158 | { | |
159 | fhPtCutDCABCOK = new TH1F ("hPtCutDCABCOK","p_T distribution, DCA cut, track BC=0 or -100", nptbins,ptmin,ptmax); | |
160 | fhPtCutDCABCOK->SetXTitle("p_{T} (GeV/c)"); | |
161 | outputContainer->Add(fhPtCutDCABCOK); | |
162 | } | |
163 | ||
05d0d05d | 164 | fhPhiNeg = new TH2F ("hPhiNegative","#phi of negative charges distribution", |
165 | nptbins,ptmin,ptmax, nphibins,phimin,phimax); | |
166 | fhPhiNeg->SetYTitle("#phi (rad)"); | |
167 | fhPhiNeg->SetXTitle("p_{T} (GeV/c)"); | |
168 | outputContainer->Add(fhPhiNeg); | |
169 | ||
170 | fhEtaNeg = new TH2F ("hEtaNegative","#eta of negative charges distribution", | |
171 | nptbins,ptmin,ptmax, netabins,etamin,etamax); | |
172 | fhEtaNeg->SetYTitle("#eta "); | |
173 | fhEtaNeg->SetXTitle("p_{T} (GeV/c)"); | |
174 | outputContainer->Add(fhEtaNeg); | |
477d6cee | 175 | |
192689a4 | 176 | fhPhiPos = new TH2F ("hPhiPositive","#phi of positive charges distribution", |
05d0d05d | 177 | nptbins,ptmin,ptmax, nphibins,phimin,phimax); |
178 | fhPhiPos->SetYTitle("#phi (rad)"); | |
179 | fhPhiPos->SetXTitle("p_{T} (GeV/c)"); | |
180 | outputContainer->Add(fhPhiPos); | |
477d6cee | 181 | |
192689a4 | 182 | fhEtaPos = new TH2F ("hEtaPositive","#eta of positive charges distribution", |
05d0d05d | 183 | nptbins,ptmin,ptmax, netabins,etamin,etamax); |
184 | fhEtaPos->SetYTitle("#eta "); | |
185 | fhEtaPos->SetXTitle("p_{T} (GeV/c)"); | |
186 | outputContainer->Add(fhEtaPos); | |
5025c139 | 187 | |
fe9615b9 | 188 | fhEtaPhiPos = new TH2F ("hEtaPhiPositive","pt/eta/phi of positive charge",netabins,etamin,etamax, nphibins,phimin,phimax); |
4bfeae64 | 189 | fhEtaPhiPos->SetXTitle("#eta "); |
190 | fhEtaPhiPos->SetYTitle("#phi (rad)"); | |
05d0d05d | 191 | outputContainer->Add(fhEtaPhiPos); |
192 | ||
193 | fhEtaPhiNeg = new TH2F ("hEtaPhiNegative","eta vs phi of negative charge",netabins,etamin,etamax, nphibins,phimin,phimax); | |
4bfeae64 | 194 | fhEtaPhiNeg->SetXTitle("#eta "); |
195 | fhEtaPhiNeg->SetYTitle("#phi (rad)"); | |
05d0d05d | 196 | outputContainer->Add(fhEtaPhiNeg); |
477d6cee | 197 | |
52bd777f | 198 | if(fFillVertexBC0Histograms) |
199 | { | |
200 | fhPtVtxOutBC0 = new TH1F ("hPtVtxOutBC0","p_T distribution, vertex in BC=0", nptbins,ptmin,ptmax); | |
201 | fhPtVtxOutBC0->SetXTitle("p_{T} (GeV/c)"); | |
202 | outputContainer->Add(fhPtVtxOutBC0); | |
203 | ||
204 | fhEtaPhiVtxOutBC0 = new TH2F ("hEtaPhiVtxOutBC0","eta vs phi of all charges with vertex in BC=0",netabins,etamin,etamax, nphibins,phimin,phimax); | |
205 | fhEtaPhiVtxOutBC0->SetXTitle("#eta "); | |
206 | fhEtaPhiVtxOutBC0->SetYTitle("#phi (rad)"); | |
207 | outputContainer->Add(fhEtaPhiVtxOutBC0); | |
208 | ||
209 | fhPtVtxInBC0 = new TH1F ("hPtVtxInBC0","p_T distribution, vertex in BC=0", nptbins,ptmin,ptmax); | |
210 | fhPtVtxInBC0->SetXTitle("p_{T} (GeV/c)"); | |
211 | outputContainer->Add(fhPtVtxInBC0); | |
212 | ||
213 | fhEtaPhiVtxInBC0 = new TH2F ("hEtaPhiVtxInBC0","eta vs phi of all charges with vertex in BC=0",netabins,etamin,etamax, nphibins,phimin,phimax); | |
214 | fhEtaPhiVtxInBC0->SetXTitle("#eta "); | |
215 | fhEtaPhiVtxInBC0->SetYTitle("#phi (rad)"); | |
216 | outputContainer->Add(fhEtaPhiVtxInBC0); | |
217 | } | |
218 | ||
8f467228 | 219 | fhPtSPDRefit = new TH1F ("hPtSPDRefit","p_T distribution of tracks with SPD and ITS refit", nptbins,ptmin,ptmax); |
220 | fhPtSPDRefit->SetXTitle("p_{T} (GeV/c)"); | |
221 | outputContainer->Add(fhPtSPDRefit); | |
222 | ||
223 | fhEtaPhiSPDRefitPt02 = new TH2F ("hEtaPhiSPDRefitPt02","eta vs phi of tracks with SPD and ITS refit, p_{T} < 2 GeV/c",netabins,etamin,etamax, nphibins,phimin,phimax); | |
224 | fhEtaPhiSPDRefitPt02->SetXTitle("#eta "); | |
225 | fhEtaPhiSPDRefitPt02->SetYTitle("#phi (rad)"); | |
226 | outputContainer->Add(fhEtaPhiSPDRefitPt02); | |
227 | ||
228 | fhEtaPhiSPDRefitPt3 = new TH2F ("hEtaPhiSPDRefitPt3","eta vs phi of tracks with SPD and ITS refit, p_{T} > 3 GeV/c",netabins,etamin,etamax, nphibins,phimin,phimax); | |
229 | fhEtaPhiSPDRefitPt3->SetXTitle("#eta "); | |
230 | fhEtaPhiSPDRefitPt3->SetYTitle("#phi (rad)"); | |
231 | outputContainer->Add(fhEtaPhiSPDRefitPt3); | |
232 | ||
233 | fhPtNoSPDRefit = new TH1F ("hPtNoSPDRefit","p_T distribution of constrained tracks no SPD and with ITSRefit", nptbins,ptmin,ptmax); | |
234 | fhPtNoSPDRefit->SetXTitle("p_{T} (GeV/c)"); | |
235 | outputContainer->Add(fhPtNoSPDRefit); | |
236 | ||
237 | fhEtaPhiNoSPDRefitPt02 = new TH2F ("hEtaPhiNoSPDRefitPt02","eta vs phi of constrained tracks no SPD and with ITSRefit, p_{T} < 2 GeV/c",netabins,etamin,etamax, nphibins,phimin,phimax); | |
238 | fhEtaPhiNoSPDRefitPt02->SetXTitle("#eta "); | |
239 | fhEtaPhiNoSPDRefitPt02->SetYTitle("#phi (rad)"); | |
240 | outputContainer->Add(fhEtaPhiNoSPDRefitPt02); | |
241 | ||
242 | fhEtaPhiNoSPDRefitPt3 = new TH2F ("hEtaPhiNoSPDRefitPt3","eta vs phi of of constrained tracks no SPD and with ITSRefit, p_{T} > 3 GeV/c",netabins,etamin,etamax, nphibins,phimin,phimax); | |
243 | fhEtaPhiNoSPDRefitPt3->SetXTitle("#eta "); | |
244 | fhEtaPhiNoSPDRefitPt3->SetYTitle("#phi (rad)"); | |
245 | outputContainer->Add(fhEtaPhiNoSPDRefitPt3); | |
246 | ||
247 | fhPtNoSPDNoRefit = new TH1F ("hPtNoSPDNoRefit","p_T distribution of constrained tracks with no SPD requierement and without ITSRefit", nptbins,ptmin,ptmax); | |
248 | fhPtNoSPDNoRefit->SetXTitle("p_{T} (GeV/c)"); | |
249 | outputContainer->Add(fhPtNoSPDNoRefit); | |
250 | ||
251 | fhEtaPhiNoSPDNoRefitPt02 = new TH2F ("hEtaPhiNoSPDNoRefitPt02","eta vs phi of constrained tracks with no SPD requierement and without ITSRefit, p_{T} < 2 GeV/c",netabins,etamin,etamax, nphibins,phimin,phimax); | |
252 | fhEtaPhiNoSPDNoRefitPt02->SetXTitle("#eta "); | |
253 | fhEtaPhiNoSPDNoRefitPt02->SetYTitle("#phi (rad)"); | |
254 | outputContainer->Add(fhEtaPhiNoSPDNoRefitPt02); | |
255 | ||
256 | fhEtaPhiNoSPDNoRefitPt3 = new TH2F ("hEtaPhiNoSPDNoRefitPt3","eta vs phi of constrained tracks with no SPD requierement and without ITSRefit, p_{T} > 3 GeV/c",netabins,etamin,etamax, nphibins,phimin,phimax); | |
257 | fhEtaPhiNoSPDNoRefitPt3->SetXTitle("#eta "); | |
258 | fhEtaPhiNoSPDNoRefitPt3->SetYTitle("#phi (rad)"); | |
259 | outputContainer->Add(fhEtaPhiNoSPDNoRefitPt3); | |
260 | ||
52bd777f | 261 | if(fFillVertexBC0Histograms) |
262 | { | |
263 | fhProductionVertexBC = new TH1F("hProductionVertexBC", "tracks production vertex bunch crossing ", 41 , -20 , 20 ) ; | |
264 | fhProductionVertexBC->SetYTitle("# tracks"); | |
265 | fhProductionVertexBC->SetXTitle("Bunch crossing"); | |
266 | outputContainer->Add(fhProductionVertexBC); | |
267 | } | |
8f467228 | 268 | |
fe9615b9 | 269 | Int_t ntofbins = 1000; |
270 | Int_t mintof = -500; | |
271 | Int_t maxtof = 500; | |
fedea415 | 272 | |
fe9615b9 | 273 | fhTOFSignal = new TH1F ("hTOFSignal","TOF signal", ntofbins,mintof,maxtof); |
fedea415 | 274 | fhTOFSignal->SetXTitle("TOF signal (ns)"); |
fe9615b9 | 275 | outputContainer->Add(fhTOFSignal); |
276 | ||
9b4a1ee2 | 277 | if(fFillTrackBCHistograms) |
278 | { | |
279 | fhTOFSignalBCOK = new TH1F ("hTOFSignalBCOK","TOF signal", ntofbins,mintof,maxtof); | |
280 | fhTOFSignalBCOK->SetXTitle("TOF signal (ns)"); | |
281 | outputContainer->Add(fhTOFSignalBCOK); | |
282 | } | |
fedea415 | 283 | |
fe9615b9 | 284 | fhTOFSignalPtCut = new TH1F ("hTOFSignalPtCut","TOF signal", ntofbins,mintof,maxtof); |
fedea415 | 285 | fhTOFSignalPtCut->SetXTitle("TOF signal (ns)"); |
fe9615b9 | 286 | outputContainer->Add(fhTOFSignalPtCut); |
287 | ||
288 | fhPtTOFSignal = new TH2F ("hPtTOFSignal","TOF signal", nptbins,ptmin,ptmax,ntofbins,mintof,maxtof); | |
fedea415 | 289 | fhPtTOFSignal->SetYTitle("TOF signal (ns)"); |
fe9615b9 | 290 | fhPtTOFSignal->SetXTitle("p_{T} (GeV/c)"); |
291 | outputContainer->Add(fhPtTOFSignal); | |
cc944149 | 292 | |
293 | fhPtTOFSignalDCACut = new TH2F ("hPtTOFSignalDCACut","TOF signal after DCA cut", nptbins,ptmin,ptmax,ntofbins,mintof,maxtof); | |
294 | fhPtTOFSignalDCACut->SetYTitle("TOF signal (ns)"); | |
295 | fhPtTOFSignalDCACut->SetXTitle("p_{T} (GeV/c)"); | |
296 | outputContainer->Add(fhPtTOFSignalDCACut); | |
fedea415 | 297 | |
52bd777f | 298 | if(fFillVertexBC0Histograms) |
299 | { | |
300 | fhPtTOFSignalVtxOutBC0 = new TH2F ("hPtTOFSignalVtxOutBC0","TOF signal, vtx BC!=0", nptbins,ptmin,ptmax,ntofbins,mintof,maxtof); | |
301 | fhPtTOFSignalVtxOutBC0->SetYTitle("TOF signal (ns)"); | |
302 | fhPtTOFSignalVtxOutBC0->SetXTitle("p_{T} (GeV/c)"); | |
303 | outputContainer->Add(fhPtTOFSignalVtxOutBC0); | |
304 | ||
b6c46114 | 305 | fhPtTOFSignalVtxInBC0 = new TH2F ("hPtTOFSignalVtxInBC0","TOF signal, vtx BC=0", nptbins,ptmin,ptmax,ntofbins,mintof,maxtof); |
52bd777f | 306 | fhPtTOFSignalVtxInBC0->SetYTitle("TOF signal (ns)"); |
307 | fhPtTOFSignalVtxInBC0->SetXTitle("p_{T} (GeV/c)"); | |
308 | outputContainer->Add(fhPtTOFSignalVtxInBC0); | |
309 | } | |
310 | ||
fedea415 | 311 | if(fFillPileUpHistograms) |
312 | { | |
313 | TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ; | |
314 | ||
315 | for(Int_t i = 0 ; i < 7 ; i++) | |
316 | { | |
317 | fhPtPileUp[i] = new TH1F(Form("hPtPileUp%s",pileUpName[i].Data()), | |
318 | Form("Track p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), | |
319 | nptbins,ptmin,ptmax); | |
320 | fhPtPileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
321 | outputContainer->Add(fhPtPileUp[i]); | |
322 | ||
323 | fhPtTOFSignalPileUp[i] = new TH2F(Form("hPtTOFSignalPileUp%s",pileUpName[i].Data()), | |
324 | Form("Track TOF vs p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), | |
325 | nptbins,ptmin,ptmax,ntofbins,mintof,maxtof); | |
326 | fhPtTOFSignalPileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
327 | fhPtTOFSignalPileUp[i]->SetXTitle("TOF signal (ns)"); | |
328 | outputContainer->Add(fhPtTOFSignalPileUp[i]); | |
52bd777f | 329 | |
330 | if(fFillVertexBC0Histograms) | |
331 | { | |
332 | fhPtTOFSignalVtxOutBC0PileUp[i] = new TH2F(Form("hPtTOFSignalVtxOutBC0PileUp%s",pileUpName[i].Data()), | |
333 | Form("Track TOF vs p_{T} distribution, %s Pile-Up event, vtx BC!=0",pileUpName[i].Data()), | |
334 | nptbins,ptmin,ptmax,ntofbins,mintof,maxtof); | |
335 | fhPtTOFSignalVtxOutBC0PileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
336 | fhPtTOFSignalVtxOutBC0PileUp[i]->SetXTitle("TOF signal (ns)"); | |
337 | outputContainer->Add(fhPtTOFSignalVtxOutBC0PileUp[i]); | |
338 | ||
339 | fhPtTOFSignalVtxInBC0PileUp[i] = new TH2F(Form("hPtTOFSignalVtxInBC0PileUp%s",pileUpName[i].Data()), | |
340 | Form("Track TOF vs p_{T} distribution, %s Pile-Up event, vtx BC=0",pileUpName[i].Data()), | |
341 | nptbins,ptmin,ptmax,ntofbins,mintof,maxtof); | |
342 | fhPtTOFSignalVtxInBC0PileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
343 | fhPtTOFSignalVtxInBC0PileUp[i]->SetXTitle("TOF signal (ns)"); | |
344 | outputContainer->Add(fhPtTOFSignalVtxInBC0PileUp[i]); | |
345 | } | |
346 | ||
347 | if(fFillVertexBC0Histograms) | |
348 | { | |
349 | fhProductionVertexBCPileUp[i] = new TH1F(Form("hProductionVertexBCPileUp%s",pileUpName[i].Data()), | |
350 | Form("tracks production vertex bunch crossing, %s Pile-Up event",pileUpName[i].Data()), | |
351 | 41 , -20 , 20 ) ; | |
352 | fhProductionVertexBCPileUp[i]->SetYTitle("# tracks"); | |
353 | fhProductionVertexBCPileUp[i]->SetXTitle("Bunch crossing"); | |
354 | outputContainer->Add(fhProductionVertexBCPileUp[i]); | |
355 | } | |
fedea415 | 356 | } |
357 | ||
9b4a1ee2 | 358 | |
359 | if(fFillTrackBCHistograms) | |
360 | { | |
361 | fhEtaPhiTOFBC0 = new TH2F ("hEtaPhiTOFBC0","eta-phi for tracks with hit on TOF, and tof corresponding to BC=0",netabins,etamin,etamax, nphibins,phimin,phimax); | |
362 | fhEtaPhiTOFBC0->SetXTitle("#eta "); | |
363 | fhEtaPhiTOFBC0->SetYTitle("#phi (rad)"); | |
364 | outputContainer->Add(fhEtaPhiTOFBC0); | |
365 | ||
366 | fhEtaPhiTOFBCPlus = new TH2F ("hEtaPhiTOFBCPlus","eta-phi for tracks with hit on TOF, and tof corresponding to BC>0",netabins,etamin,etamax, nphibins,phimin,phimax); | |
367 | fhEtaPhiTOFBCPlus->SetXTitle("#eta "); | |
368 | fhEtaPhiTOFBCPlus->SetYTitle("#phi (rad)"); | |
369 | outputContainer->Add(fhEtaPhiTOFBCPlus); | |
370 | ||
371 | fhEtaPhiTOFBCMinus = new TH2F ("hEtaPhiTOFBCMinus","eta-phi for tracks with hit on TOF, and tof corresponding to BC<0",netabins,etamin,etamax, nphibins,phimin,phimax); | |
372 | fhEtaPhiTOFBCMinus->SetXTitle("#eta "); | |
373 | fhEtaPhiTOFBCMinus->SetYTitle("#phi (rad)"); | |
374 | outputContainer->Add(fhEtaPhiTOFBCMinus); | |
375 | ||
376 | if(fFillPileUpHistograms) | |
377 | { | |
378 | fhEtaPhiTOFBC0PileUpSPD = new TH2F ("hEtaPhiTOFBC0PileUpSPD","eta-phi for tracks with hit on TOF, and tof corresponding to BC=0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax); | |
379 | fhEtaPhiTOFBC0PileUpSPD->SetXTitle("#eta "); | |
380 | fhEtaPhiTOFBC0PileUpSPD->SetYTitle("#phi (rad)"); | |
381 | outputContainer->Add(fhEtaPhiTOFBC0PileUpSPD); | |
382 | ||
383 | fhEtaPhiTOFBCPlusPileUpSPD = new TH2F ("hEtaPhiTOFBCPlusPileUpSPD","eta-phi for tracks with hit on TOF, and tof corresponding to BC>0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax); | |
384 | fhEtaPhiTOFBCPlusPileUpSPD->SetXTitle("#eta "); | |
385 | fhEtaPhiTOFBCPlusPileUpSPD->SetYTitle("#phi (rad)"); | |
386 | outputContainer->Add(fhEtaPhiTOFBCPlusPileUpSPD); | |
387 | ||
388 | fhEtaPhiTOFBCMinusPileUpSPD = new TH2F ("hEtaPhiTOFBCMinusPileUpSPD","eta-phi for tracks with hit on TOF, and tof corresponding to BC<0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax); | |
389 | fhEtaPhiTOFBCMinusPileUpSPD->SetXTitle("#eta "); | |
390 | fhEtaPhiTOFBCMinusPileUpSPD->SetYTitle("#phi (rad)"); | |
391 | outputContainer->Add(fhEtaPhiTOFBCMinusPileUpSPD); | |
392 | } | |
393 | } | |
fedea415 | 394 | |
fe9615b9 | 395 | } |
396 | ||
397 | fhPtTOFStatus0 = new TH1F ("hPtTOFStatus0","p_T distribution of tracks not hitting TOF", nptbins,ptmin,ptmax); | |
398 | fhPtTOFStatus0->SetXTitle("p_{T} (GeV/c)"); | |
399 | outputContainer->Add(fhPtTOFStatus0); | |
400 | ||
401 | ||
fedea415 | 402 | fhEtaPhiTOFStatus0 = new TH2F ("hEtaPhiTOFStatus0","eta-phi for tracks without hit on TOF",netabins,etamin,etamax, nphibins,phimin,phimax); |
fe9615b9 | 403 | fhEtaPhiTOFStatus0->SetXTitle("#eta "); |
404 | fhEtaPhiTOFStatus0->SetYTitle("#phi (rad)"); | |
405 | outputContainer->Add(fhEtaPhiTOFStatus0); | |
406 | ||
fedea415 | 407 | TString dcaName[] = {"xy","z","Cons"} ; |
408 | Int_t ndcabins = 800; | |
409 | Int_t mindca = -4; | |
410 | Int_t maxdca = 4; | |
411 | ||
412 | for(Int_t i = 0 ; i < 3 ; i++) | |
413 | { | |
414 | ||
415 | fhPtDCA[i] = new TH2F(Form("hPtDCA%s",dcaName[i].Data()), | |
416 | Form("Track DCA%s vs p_{T} distribution",dcaName[i].Data()), | |
417 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
418 | fhPtDCA[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 419 | fhPtDCA[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
fedea415 | 420 | outputContainer->Add(fhPtDCA[i]); |
421 | ||
8f467228 | 422 | fhPtDCASPDRefit[i] = new TH2F(Form("hPtDCA%sSPDRefit",dcaName[i].Data()), |
423 | Form("Track DCA%s vs p_{T} distribution of tracks with SPD and ITS refit",dcaName[i].Data()), | |
424 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
425 | fhPtDCASPDRefit[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 426 | fhPtDCASPDRefit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
8f467228 | 427 | outputContainer->Add(fhPtDCASPDRefit[i]); |
428 | ||
429 | fhPtDCANoSPDRefit[i] = new TH2F(Form("hPtDCA%sNoSPDRefit",dcaName[i].Data()), | |
430 | Form("Track DCA%s vs p_{T} distributionof constrained tracks no SPD and with ITSRefit",dcaName[i].Data()), | |
431 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
432 | fhPtDCANoSPDRefit[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 433 | fhPtDCANoSPDRefit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
8f467228 | 434 | outputContainer->Add(fhPtDCANoSPDRefit[i]); |
435 | ||
436 | fhPtDCANoSPDNoRefit[i] = new TH2F(Form("hPtDCA%sNoSPDNoRefit",dcaName[i].Data()), | |
437 | Form("Track DCA%s vs p_{T} distribution, constrained tracks with no SPD requierement and without ITSRefit",dcaName[i].Data()), | |
438 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
439 | fhPtDCANoSPDNoRefit[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 440 | fhPtDCANoSPDNoRefit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
8f467228 | 441 | outputContainer->Add(fhPtDCANoSPDNoRefit[i]); |
442 | ||
9b4a1ee2 | 443 | if(fFillTrackBCHistograms) |
444 | { | |
445 | fhPtDCATOFBC0[i] = new TH2F(Form("hPtDCA%sTOFBC0",dcaName[i].Data()), | |
446 | Form("Track DCA%s vs p_{T} distribution, BC=0",dcaName[i].Data()), | |
447 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
448 | fhPtDCATOFBC0[i]->SetXTitle("p_{T} (GeV/c)"); | |
449 | fhPtDCATOFBC0[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
450 | outputContainer->Add(fhPtDCATOFBC0[i]); | |
451 | ||
452 | fhPtDCATOFBCOut[i] = new TH2F(Form("hPtDCA%sTOFBCOut",dcaName[i].Data()), | |
453 | Form("Track DCA%s vs p_{T} distribution, BC!=0",dcaName[i].Data()), | |
454 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
455 | fhPtDCATOFBCOut[i]->SetXTitle("p_{T} (GeV/c)"); | |
456 | fhPtDCATOFBCOut[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
457 | outputContainer->Add(fhPtDCATOFBCOut[i]); | |
458 | } | |
52bd777f | 459 | |
fedea415 | 460 | fhPtDCANoTOFHit[i] = new TH2F(Form("hPtDCA%sNoTOFHit",dcaName[i].Data()), |
461 | Form("Track (no TOF hit) DCA%s vs p_{T} distribution",dcaName[i].Data()), | |
462 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
463 | fhPtDCANoTOFHit[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 464 | fhPtDCANoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
fedea415 | 465 | outputContainer->Add(fhPtDCANoTOFHit[i]); |
466 | ||
52bd777f | 467 | if(fFillVertexBC0Histograms) |
468 | { | |
469 | fhPtDCAVtxOutBC0[i] = new TH2F(Form("hPtDCA%sVtxOutBC0",dcaName[i].Data()), | |
470 | Form("Track DCA%s vs p_{T} distribution, vertex with BC!=0",dcaName[i].Data()), | |
471 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
472 | fhPtDCAVtxOutBC0[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 473 | fhPtDCAVtxOutBC0[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
52bd777f | 474 | outputContainer->Add(fhPtDCAVtxOutBC0[i]); |
475 | ||
476 | fhPtDCAVtxOutBC0NoTOFHit[i] = new TH2F(Form("hPtDCA%sVtxOutBC0NoTOFHit",dcaName[i].Data()), | |
477 | Form("Track (no TOF hit) DCA%s vs p_{T} distribution, vertex with BC!=0",dcaName[i].Data()), | |
478 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
479 | fhPtDCAVtxOutBC0NoTOFHit[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 480 | fhPtDCAVtxOutBC0NoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
52bd777f | 481 | outputContainer->Add(fhPtDCAVtxOutBC0NoTOFHit[i]); |
482 | ||
483 | fhPtDCAVtxInBC0[i] = new TH2F(Form("hPtDCA%sVtxInBC0",dcaName[i].Data()), | |
484 | Form("Track DCA%s vs p_{T} distribution, vertex with BC==0",dcaName[i].Data()), | |
485 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
486 | fhPtDCAVtxInBC0[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 487 | fhPtDCAVtxInBC0[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
52bd777f | 488 | outputContainer->Add(fhPtDCAVtxInBC0[i]); |
489 | ||
490 | fhPtDCAVtxInBC0NoTOFHit[i] = new TH2F(Form("hPtDCA%sVtxInBC0NoTOFHit",dcaName[i].Data()), | |
491 | Form("Track (no TOF hit) DCA%s vs p_{T} distribution, vertex with BC==0",dcaName[i].Data()), | |
492 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
493 | fhPtDCAVtxInBC0NoTOFHit[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 494 | fhPtDCAVtxInBC0NoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
52bd777f | 495 | outputContainer->Add(fhPtDCAVtxInBC0NoTOFHit[i]); |
496 | } | |
fedea415 | 497 | |
498 | if(fFillPileUpHistograms) | |
499 | { | |
500 | fhPtDCAPileUp[i] = new TH2F(Form("hPtDCA%sPileUp",dcaName[i].Data()), | |
501 | Form("Track DCA%s vs p_{T} distribution, SPD Pile-Up",dcaName[i].Data()), | |
502 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
503 | fhPtDCAPileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 504 | fhPtDCAPileUp[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
fedea415 | 505 | outputContainer->Add(fhPtDCAPileUp[i]); |
506 | ||
9b4a1ee2 | 507 | if(fFillTrackBCHistograms) |
508 | { | |
509 | fhPtDCAPileUpTOFBC0[i] = new TH2F(Form("hPtDCA%sPileUpTOFBC0",dcaName[i].Data()), | |
510 | Form("Track DCA%s vs p_{T} distribution",dcaName[i].Data()), | |
511 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
512 | fhPtDCAPileUpTOFBC0[i]->SetXTitle("p_{T} (GeV/c)"); | |
513 | fhPtDCAPileUpTOFBC0[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
514 | outputContainer->Add(fhPtDCAPileUpTOFBC0[i]); | |
515 | } | |
fedea415 | 516 | |
517 | fhPtDCAPileUpNoTOFHit[i] = new TH2F(Form("hPtDCA%sPileUpNoTOFHit",dcaName[i].Data()), | |
518 | Form("Track (no TOF hit) DCA%s vs p_{T} distribution, SPD Pile-Up, vertex with BC!=0",dcaName[i].Data()), | |
519 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
520 | fhPtDCAPileUpNoTOFHit[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 521 | fhPtDCAPileUpNoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
fedea415 | 522 | outputContainer->Add(fhPtDCAPileUpNoTOFHit[i]); |
523 | ||
52bd777f | 524 | if(fFillVertexBC0Histograms) |
525 | { | |
526 | fhPtDCAVtxOutBC0PileUp[i] = new TH2F(Form("hPtDCA%sPileUpVtxOutBC0",dcaName[i].Data()), | |
527 | Form("Track DCA%s vs p_{T} distribution, SPD Pile-Up, vertex with BC!=0",dcaName[i].Data()), | |
528 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
529 | fhPtDCAVtxOutBC0PileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 530 | fhPtDCAVtxOutBC0PileUp[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
52bd777f | 531 | outputContainer->Add(fhPtDCAVtxOutBC0PileUp[i]); |
532 | ||
533 | fhPtDCAVtxOutBC0PileUpNoTOFHit[i] = new TH2F(Form("hPtDCA%sVtxOutBC0PileUpNoTOFHit",dcaName[i].Data()), | |
534 | Form("Track (no TOF hit) DCA%s vs p_{T} distribution, SPD Pile-Up, vertex with BC!=0",dcaName[i].Data()), | |
535 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
536 | fhPtDCAVtxOutBC0PileUpNoTOFHit[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 537 | fhPtDCAVtxOutBC0PileUpNoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
52bd777f | 538 | outputContainer->Add(fhPtDCAVtxOutBC0PileUpNoTOFHit[i]); |
539 | ||
540 | fhPtDCAVtxInBC0PileUp[i] = new TH2F(Form("hPtDCA%sPileUpVtxInBC0",dcaName[i].Data()), | |
541 | Form("Track DCA%s vs p_{T} distribution, SPD Pile-Up,vertex with BC==0",dcaName[i].Data()), | |
542 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
543 | fhPtDCAVtxInBC0PileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 544 | fhPtDCAVtxInBC0PileUp[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
52bd777f | 545 | outputContainer->Add(fhPtDCAVtxInBC0PileUp[i]); |
546 | ||
547 | fhPtDCAVtxInBC0PileUpNoTOFHit[i] = new TH2F(Form("hPtDCA%sVtxInBC0PileUpNoTOFHit",dcaName[i].Data()), | |
548 | Form("Track (no TOF hit) DCA%s vs p_{T} distribution, SPD Pile-Up, vertex with BC==0",dcaName[i].Data()), | |
549 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
550 | fhPtDCAVtxInBC0PileUpNoTOFHit[i]->SetXTitle("p_{T} (GeV/c)"); | |
f9a67d4f | 551 | fhPtDCAVtxInBC0PileUpNoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data())); |
52bd777f | 552 | outputContainer->Add(fhPtDCAVtxInBC0PileUpNoTOFHit[i]); |
553 | ||
554 | } | |
fedea415 | 555 | } |
556 | } | |
557 | ||
52bd777f | 558 | if(IsDataMC()) |
559 | { | |
62c64236 | 560 | //enum mvType{kmcPion = 0, kmcProton = 1, kmcKaon = 2, kmcMuon = 3, kmcElectron = 4, kmcUnknown = 4 }; |
561 | ||
562 | TString histoName[] = {"Pion","Proton","Kaon","Muon","Electron","Unknown"}; | |
563 | TString titleName[] = {"#pi^{#pm}","p^{#pm}","K^{#pm}","#mu^{#pm}","e^{#pm}","x^{#pm}"}; | |
477d6cee | 564 | |
62c64236 | 565 | for(Int_t imcPart = 0; imcPart < 6; imcPart++) |
566 | { | |
567 | fhPtMCPart[imcPart] = new TH1F (Form("hPtMC%s",histoName[imcPart].Data()), | |
568 | Form("reconstructed #it{p}_{T} distribution from %s",titleName[imcPart].Data()), | |
569 | nptbins,ptmin,ptmax); | |
570 | fhPtMCPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})"); | |
571 | outputContainer->Add(fhPtMCPart[imcPart]); | |
572 | ||
573 | fhPhiMCPart[imcPart] = new TH2F (Form("hPhiMC%s",histoName[imcPart].Data()), | |
574 | Form("reconstructed #phi vs #it{p}_{T} distribution from %s",titleName[imcPart].Data()), | |
575 | nptbins,ptmin,ptmax, nphibins,phimin,phimax); | |
576 | fhPhiMCPart[imcPart]->SetYTitle("#phi (rad)"); | |
577 | fhPhiMCPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})"); | |
578 | outputContainer->Add(fhPhiMCPart[imcPart]); | |
579 | ||
580 | fhEtaMCPart[imcPart] = new TH2F (Form("hEtaMC%s",histoName[imcPart].Data()), | |
581 | Form("reconstructed #eta vs #it{p}_{T} distribution from %s",titleName[imcPart].Data()), | |
582 | nptbins,ptmin,ptmax, netabins,etamin,etamax); | |
583 | fhEtaMCPart[imcPart]->SetYTitle("#eta "); | |
584 | fhEtaMCPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})"); | |
585 | outputContainer->Add(fhEtaMCPart[imcPart]); | |
586 | ||
587 | fhPtMCPrimPart[imcPart] = new TH1F (Form("hPtMCPrimary%s",histoName[imcPart].Data()), | |
588 | Form("generated #it{p}_{T} distribution from %s",titleName[imcPart].Data()), | |
589 | nptbins,ptmin,ptmax); | |
590 | fhPtMCPrimPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})"); | |
591 | outputContainer->Add(fhPtMCPrimPart[imcPart]); | |
592 | ||
593 | fhPhiMCPrimPart[imcPart] = new TH2F (Form("hPhiMCPrimary%s",histoName[imcPart].Data()), | |
594 | Form("generated #phi vs #it{p}_{T} distribution from %s",titleName[imcPart].Data()), | |
595 | nptbins,ptmin,ptmax, nphibins,phimin,phimax); | |
596 | fhPhiMCPrimPart[imcPart]->SetYTitle("#phi (rad)"); | |
597 | fhPhiMCPrimPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})"); | |
598 | outputContainer->Add(fhPhiMCPrimPart[imcPart]); | |
599 | ||
600 | fhEtaMCPrimPart[imcPart] = new TH2F (Form("hEtaMCPrimary%s",histoName[imcPart].Data()), | |
601 | Form("generated #eta vs #it{p}_{T} distribution from %s",titleName[imcPart].Data()), | |
602 | nptbins,ptmin,ptmax, netabins,etamin,etamax); | |
603 | fhEtaMCPrimPart[imcPart]->SetYTitle("#eta "); | |
604 | fhEtaMCPrimPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})"); | |
605 | outputContainer->Add(fhEtaMCPrimPart[imcPart]); | |
606 | } | |
477d6cee | 607 | |
477d6cee | 608 | } |
a3aebfff | 609 | |
85c4406e | 610 | fhPtNPileUpSPDVtx = new TH2F ("hPt_NPileUpVertSPD","pT of cluster vs N pile-up SPD vertex", |
611 | nptbins,ptmin,ptmax,20,0,20); | |
612 | fhPtNPileUpSPDVtx->SetYTitle("# vertex "); | |
613 | fhPtNPileUpSPDVtx->SetXTitle("p_{T} (GeV/c)"); | |
614 | outputContainer->Add(fhPtNPileUpSPDVtx); | |
615 | ||
616 | fhPtNPileUpTrkVtx = new TH2F ("hPt_NPileUpVertTracks","pT of cluster vs N pile-up Tracks vertex", | |
617 | nptbins,ptmin,ptmax, 20,0,20 ); | |
618 | fhPtNPileUpTrkVtx->SetYTitle("# vertex "); | |
619 | fhPtNPileUpTrkVtx->SetXTitle("p_{T} (GeV/c)"); | |
620 | outputContainer->Add(fhPtNPileUpTrkVtx); | |
621 | ||
622 | if(fFillVertexBC0Histograms) | |
623 | { | |
624 | fhPtNPileUpSPDVtxBC0 = new TH2F ("hPt_NPileUpVertSPD_BC0","pT of cluster vs N pile-up SPD vertex", | |
625 | nptbins,ptmin,ptmax,20,0,20); | |
626 | fhPtNPileUpSPDVtxBC0->SetYTitle("# vertex "); | |
627 | fhPtNPileUpSPDVtxBC0->SetXTitle("p_{T} (GeV/c)"); | |
628 | outputContainer->Add(fhPtNPileUpSPDVtxBC0); | |
629 | ||
630 | fhPtNPileUpTrkVtxBC0 = new TH2F ("hPt_NPileUpVertTracks_BC0","pT of cluster vs N pile-up Tracks vertex", | |
631 | nptbins,ptmin,ptmax, 20,0,20 ); | |
632 | fhPtNPileUpTrkVtxBC0->SetYTitle("# vertex "); | |
633 | fhPtNPileUpTrkVtxBC0->SetXTitle("p_{T} (GeV/c)"); | |
634 | outputContainer->Add(fhPtNPileUpTrkVtxBC0); | |
635 | } | |
636 | ||
477d6cee | 637 | return outputContainer; |
a3aebfff | 638 | |
477d6cee | 639 | } |
640 | ||
52bd777f | 641 | |
05d0d05d | 642 | //___________________________________________ |
477d6cee | 643 | void AliAnaChargedParticles::InitParameters() |
644 | { | |
645 | //Initialize the parameters of the analysis. | |
646 | SetOutputAODClassName("AliAODPWG4Particle"); | |
a3aebfff | 647 | SetOutputAODName("PWG4Particle"); |
648 | ||
649 | AddToHistogramsName("AnaCharged_"); | |
477d6cee | 650 | |
cbd6236f | 651 | |
477d6cee | 652 | } |
653 | ||
05d0d05d | 654 | //____________________________________________________________ |
477d6cee | 655 | void AliAnaChargedParticles::Print(const Option_t * opt) const |
656 | { | |
657 | //Print some relevant parameters set for the analysis | |
658 | if(! opt) | |
659 | return; | |
660 | ||
a3aebfff | 661 | printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; |
745913ae | 662 | AliAnaCaloTrackCorrBaseClass::Print(" "); |
a3aebfff | 663 | |
477d6cee | 664 | printf("Min Pt = %3.2f\n", GetMinPt()); |
665 | printf("Max Pt = %3.2f\n", GetMaxPt()); | |
477d6cee | 666 | |
667 | } | |
668 | ||
05d0d05d | 669 | //_________________________________ |
477d6cee | 670 | void AliAnaChargedParticles::Init() |
671 | { | |
672 | //Init | |
673 | //Do some checks | |
373ffbac | 674 | |
675 | if(!GetReader()->IsCTSSwitchedOn()) | |
676 | AliFatal("STOP!: You want to use CTS tracks in analysis but not read!! \n!!Check the configuration file!!\n"); | |
677 | ||
477d6cee | 678 | |
679 | } | |
680 | ||
05d0d05d | 681 | //_________________________________________________ |
477d6cee | 682 | void AliAnaChargedParticles::MakeAnalysisFillAOD() |
683 | { | |
684 | //Do analysis and fill aods | |
be518ab0 | 685 | if(!GetCTSTracks() || GetCTSTracks()->GetEntriesFast() == 0) return ; |
192689a4 | 686 | |
be518ab0 | 687 | Int_t ntracks = GetCTSTracks()->GetEntriesFast(); |
2244659d | 688 | Double_t vert[3] = {0,0,0}; //vertex ; |
192689a4 | 689 | |
477d6cee | 690 | //Some prints |
691 | if(GetDebug() > 0) | |
a3aebfff | 692 | printf("AliAnaChargedParticles::MakeAnalysisFillAOD() - In CTS aod entries %d\n", ntracks); |
477d6cee | 693 | |
85c4406e | 694 | AliVEvent * event = GetReader()->GetInputEvent(); |
695 | AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event); | |
696 | AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event); | |
697 | ||
cc944149 | 698 | Int_t vtxBC = GetReader()->GetVertexBC(); |
699 | if(!GetReader()->IsDCACutOn()) vtxBC = GetReader()->GetVertexBC(event->GetPrimaryVertex()); | |
52bd777f | 700 | |
52bd777f | 701 | if(fFillVertexBC0Histograms) |
702 | { | |
703 | fhProductionVertexBC->Fill(vtxBC); | |
704 | if(fFillPileUpHistograms) | |
705 | { | |
706 | if(GetReader()->IsPileUpFromSPD()) fhProductionVertexBCPileUp[0]->Fill(vtxBC); | |
707 | if(GetReader()->IsPileUpFromEMCal()) fhProductionVertexBCPileUp[1]->Fill(vtxBC); | |
708 | if(GetReader()->IsPileUpFromSPDOrEMCal()) fhProductionVertexBCPileUp[2]->Fill(vtxBC); | |
709 | if(GetReader()->IsPileUpFromSPDAndEMCal()) fhProductionVertexBCPileUp[3]->Fill(vtxBC); | |
710 | if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhProductionVertexBCPileUp[4]->Fill(vtxBC); | |
711 | if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhProductionVertexBCPileUp[5]->Fill(vtxBC); | |
712 | if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhProductionVertexBCPileUp[6]->Fill(vtxBC); | |
713 | } | |
714 | } | |
715 | ||
85c4406e | 716 | // N pile up vertices |
717 | Int_t nVtxSPD = -1; | |
718 | Int_t nVtxTrk = -1; | |
719 | ||
720 | if (esdEv) | |
721 | { | |
722 | nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD(); | |
723 | nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks(); | |
724 | ||
725 | }//ESD | |
726 | else if (aodEv) | |
727 | { | |
728 | nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD(); | |
729 | nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks(); | |
730 | }//AOD | |
731 | ||
732 | ||
52bd777f | 733 | //printf("AliAnaChargedParticles::MakeAnalysisFillAOD() - primary vertex BC %d\n",vtxBC); |
734 | ||
735 | Double_t bz = event->GetMagneticField(); | |
fedea415 | 736 | |
477d6cee | 737 | //Fill AODParticle with CTS aods |
52bd777f | 738 | Float_t pt = 0; |
739 | Float_t phi = 0; | |
740 | Float_t eta = 0; | |
5025c139 | 741 | Int_t evtIndex = 0; |
52bd777f | 742 | for(Int_t i = 0; i < ntracks; i++) |
743 | { | |
88f9563f | 744 | AliVTrack * track = (AliVTrack*) (GetCTSTracks()->At(i)); |
52bd777f | 745 | |
746 | pt = track->Pt(); | |
747 | eta = track->Eta(); | |
748 | phi = track->Phi(); | |
749 | ||
750 | fhPtNoCut->Fill(pt); | |
477d6cee | 751 | |
85c4406e | 752 | fhPtNPileUpSPDVtx->Fill(pt,nVtxSPD); |
753 | fhPtNPileUpTrkVtx->Fill(pt,nVtxTrk); | |
754 | ||
52bd777f | 755 | AliAODTrack * aodTrack = dynamic_cast<AliAODTrack*>(track); |
756 | AliESDtrack * esdTrack = dynamic_cast<AliESDtrack*>(track); | |
477d6cee | 757 | |
fe9615b9 | 758 | //TOF |
759 | ULong_t status = track->GetStatus(); | |
fedea415 | 760 | Bool_t okTOF = (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ; |
52bd777f | 761 | Double32_t tof = track->GetTOFsignal()*1e-3; |
fe9615b9 | 762 | |
52bd777f | 763 | //DCA |
fedea415 | 764 | Double_t dcaCons = -999; |
fedea415 | 765 | if(aodTrack) |
766 | { | |
767 | dcaCons = aodTrack->DCA(); | |
309684b9 | 768 | //vtxBC = aodTrack->GetProdVertex()->GetBC(); |
fedea415 | 769 | } |
fedea415 | 770 | |
771 | Double_t dca[2] = {1e6,1e6}; | |
772 | Double_t covar[3] = {1e6,1e6,1e6}; | |
773 | track->PropagateToDCA(GetReader()->GetInputEvent()->GetPrimaryVertex(),bz,100.,dca,covar); | |
774 | ||
52bd777f | 775 | Float_t trackDCA = dca[0]; |
776 | ||
fedea415 | 777 | if(dcaCons == -999) |
778 | { | |
52bd777f | 779 | fhPtDCA[0]->Fill(pt, dca[0]); |
780 | fhPtDCA[1]->Fill(pt, dca[1]); | |
781 | } | |
782 | else | |
783 | { | |
784 | trackDCA = dcaCons; | |
785 | fhPtDCA[2]->Fill(pt, dcaCons); | |
786 | } | |
787 | ||
cc944149 | 788 | if(GetReader()->AcceptDCA(pt,trackDCA)) fhPtCutDCA->Fill(pt); |
52bd777f | 789 | |
790 | if(fFillVertexBC0Histograms) | |
791 | { | |
792 | if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA) | |
793 | { | |
794 | fhPtVtxOutBC0->Fill(pt); | |
795 | fhEtaPhiVtxOutBC0->Fill(eta,phi); | |
796 | ||
797 | if(dcaCons == -999) | |
798 | { | |
799 | fhPtDCAVtxOutBC0[0]->Fill(pt, dca[0]); | |
800 | fhPtDCAVtxOutBC0[1]->Fill(pt, dca[1]); | |
801 | } | |
802 | else | |
803 | fhPtDCAVtxOutBC0[2]->Fill(pt, dcaCons); | |
804 | } | |
805 | else | |
806 | { | |
807 | fhPtVtxInBC0->Fill(pt); | |
808 | fhEtaPhiVtxInBC0->Fill(eta,phi); | |
85c4406e | 809 | |
810 | fhPtNPileUpSPDVtxBC0->Fill(pt,nVtxSPD); | |
811 | fhPtNPileUpTrkVtxBC0->Fill(pt,nVtxTrk); | |
812 | ||
cc944149 | 813 | if(GetReader()->AcceptDCA(pt,trackDCA)) fhPtCutDCABCOK->Fill(pt); |
52bd777f | 814 | |
815 | if(dcaCons == -999) | |
816 | { | |
817 | fhPtDCAVtxInBC0[0]->Fill(pt, dca[0]); | |
818 | fhPtDCAVtxInBC0[1]->Fill(pt, dca[1]); | |
819 | } | |
820 | else | |
821 | fhPtDCAVtxInBC0[2]->Fill(pt, dcaCons); | |
822 | ||
823 | } | |
fedea415 | 824 | } |
fedea415 | 825 | |
826 | if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD()) | |
827 | { | |
828 | if(dcaCons == -999) | |
829 | { | |
52bd777f | 830 | fhPtDCAPileUp[0]->Fill(pt, dca[0]); |
831 | fhPtDCAPileUp[1]->Fill(pt, dca[1]); | |
fedea415 | 832 | } |
833 | else | |
52bd777f | 834 | fhPtDCAPileUp[2]->Fill(pt, dcaCons); |
835 | ||
836 | if(fFillVertexBC0Histograms) | |
837 | { | |
838 | if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA) | |
839 | { | |
840 | if(dcaCons == -999) | |
841 | { | |
842 | fhPtDCAVtxOutBC0PileUp[0]->Fill(pt, dca[0]); | |
843 | fhPtDCAVtxOutBC0PileUp[1]->Fill(pt, dca[1]); | |
844 | } | |
845 | else fhPtDCAVtxOutBC0PileUp[2]->Fill(pt, dcaCons); | |
846 | } | |
847 | else | |
848 | { | |
849 | if(dcaCons == -999) | |
850 | { | |
851 | fhPtDCAVtxInBC0PileUp[0]->Fill(pt, dca[0]); | |
852 | fhPtDCAVtxInBC0PileUp[1]->Fill(pt, dca[1]); | |
853 | } | |
854 | else fhPtDCAVtxInBC0PileUp[2]->Fill(pt, dcaCons); | |
855 | } | |
856 | } | |
fedea415 | 857 | } |
858 | ||
859 | if(!okTOF) | |
860 | { | |
861 | if(dcaCons == -999) | |
862 | { | |
52bd777f | 863 | fhPtDCANoTOFHit[0]->Fill(pt, dca[0]); |
864 | fhPtDCANoTOFHit[1]->Fill(pt, dca[1]); | |
fedea415 | 865 | } |
866 | else | |
52bd777f | 867 | fhPtDCANoTOFHit[2]->Fill(pt, dcaCons); |
fedea415 | 868 | |
52bd777f | 869 | if(fFillVertexBC0Histograms) |
870 | { | |
871 | if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA) | |
872 | { | |
873 | if(dcaCons == -999) | |
874 | { | |
875 | fhPtDCAVtxOutBC0NoTOFHit[0]->Fill(pt, dca[0]); | |
876 | fhPtDCAVtxOutBC0NoTOFHit[1]->Fill(pt, dca[1]); | |
877 | } | |
878 | else | |
879 | fhPtDCAVtxOutBC0NoTOFHit[2]->Fill(pt, dcaCons); | |
880 | } | |
881 | else | |
882 | { | |
883 | if(dcaCons == -999) | |
884 | { | |
885 | fhPtDCAVtxInBC0NoTOFHit[0]->Fill(pt, dca[0]); | |
886 | fhPtDCAVtxInBC0NoTOFHit[1]->Fill(pt, dca[1]); | |
887 | } | |
888 | else | |
889 | fhPtDCAVtxInBC0NoTOFHit[2]->Fill(pt, dcaCons); | |
890 | ||
891 | } | |
892 | } | |
fedea415 | 893 | |
894 | if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD()) | |
895 | { | |
896 | if(dcaCons == -999) | |
897 | { | |
52bd777f | 898 | fhPtDCAPileUpNoTOFHit[0]->Fill(pt, dca[0]); |
899 | fhPtDCAPileUpNoTOFHit[1]->Fill(pt, dca[1]); | |
fedea415 | 900 | } |
901 | else | |
52bd777f | 902 | fhPtDCAPileUpNoTOFHit[2]->Fill(pt, dcaCons); |
fedea415 | 903 | |
52bd777f | 904 | if(fFillVertexBC0Histograms) |
905 | { | |
906 | if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA) | |
907 | { | |
908 | if(dcaCons == -999) | |
909 | { | |
910 | fhPtDCAVtxOutBC0PileUpNoTOFHit[0]->Fill(pt, dca[0]); | |
911 | fhPtDCAVtxOutBC0PileUpNoTOFHit[1]->Fill(pt, dca[1]); | |
912 | } | |
913 | else | |
914 | fhPtDCAVtxOutBC0PileUpNoTOFHit[2]->Fill(pt, dcaCons); | |
915 | } | |
916 | else | |
917 | { | |
918 | if(dcaCons == -999) | |
919 | { | |
920 | fhPtDCAVtxInBC0PileUpNoTOFHit[0]->Fill(pt, dca[0]); | |
921 | fhPtDCAVtxInBC0PileUpNoTOFHit[1]->Fill(pt, dca[1]); | |
922 | } | |
923 | else | |
924 | fhPtDCAVtxInBC0PileUpNoTOFHit[2]->Fill(pt, dcaCons); | |
925 | ||
926 | } | |
927 | } | |
fedea415 | 928 | } |
929 | } | |
930 | ||
931 | //printf("track pT %2.2f, DCA Cons %f, DCA1 %f, DCA2 %f, TOFBC %d, oktof %d, tof %f\n", | |
52bd777f | 932 | // pt,dcaCons,dca[0],dca[1],track->GetTOFBunchCrossing(bz),okTOF, tof); |
fedea415 | 933 | |
fedea415 | 934 | |
52bd777f | 935 | // if( vtxBC == 0 && trackBC !=0 && trackBC!=AliVTrack::kTOFBCNA) |
936 | // printf("TOF Signal %e, BC %d, pt %f, dca_xy %f, dca_z %f, dca_tpc %f \n", tof,trackBC, pt,dca[0],dca[1],dcaCons); | |
937 | ||
938 | ||
939 | if(okTOF) | |
fedea415 | 940 | { |
52bd777f | 941 | fhTOFSignal ->Fill(tof); |
942 | fhPtTOFSignal->Fill(pt, tof); | |
cc944149 | 943 | if(GetReader()->AcceptDCA(pt,trackDCA)) fhPtTOFSignalDCACut->Fill(pt, tof); |
944 | ||
75af435c | 945 | if(fFillVertexBC0Histograms) |
946 | { | |
947 | if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA) | |
948 | fhPtTOFSignalVtxOutBC0->Fill(pt, tof); | |
949 | else | |
950 | fhPtTOFSignalVtxInBC0->Fill(pt, tof); | |
951 | } | |
fedea415 | 952 | |
9b4a1ee2 | 953 | Int_t trackBC = 1000; |
954 | ||
955 | if(fFillTrackBCHistograms) | |
fedea415 | 956 | { |
9b4a1ee2 | 957 | trackBC = track->GetTOFBunchCrossing(bz); |
958 | ||
959 | if(trackBC==0) | |
fedea415 | 960 | { |
9b4a1ee2 | 961 | fhTOFSignalBCOK->Fill(tof); |
962 | ||
963 | if(dcaCons == -999) | |
964 | { | |
965 | fhPtDCATOFBC0[0]->Fill(pt, dca[0]); | |
966 | fhPtDCATOFBC0[1]->Fill(pt, dca[1]); | |
967 | } | |
968 | else | |
969 | fhPtDCATOFBC0[2]->Fill(pt, dcaCons); | |
970 | ||
971 | if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD()) | |
972 | { | |
973 | if(dcaCons == -999) | |
974 | { | |
975 | fhPtDCAPileUpTOFBC0[0]->Fill(pt, dca[0]); | |
976 | fhPtDCAPileUpTOFBC0[1]->Fill(pt, dca[1]); | |
977 | } | |
978 | else | |
979 | fhPtDCAPileUpTOFBC0[2]->Fill(pt, dcaCons); | |
980 | } | |
fedea415 | 981 | } |
9b4a1ee2 | 982 | else if(trackBC!=AliVTrack::kTOFBCNA) |
52bd777f | 983 | { |
984 | if(dcaCons == -999) | |
985 | { | |
9b4a1ee2 | 986 | fhPtDCATOFBCOut[0]->Fill(pt, dca[0]); |
987 | fhPtDCATOFBCOut[1]->Fill(pt, dca[1]); | |
52bd777f | 988 | } |
989 | else | |
9b4a1ee2 | 990 | fhPtDCATOFBCOut[2]->Fill(pt, dcaCons); |
991 | ||
52bd777f | 992 | } |
fedea415 | 993 | } |
fedea415 | 994 | |
52bd777f | 995 | if(fFillPileUpHistograms) |
996 | { | |
997 | if(GetReader()->IsPileUpFromSPD()) fhPtTOFSignalPileUp[0]->Fill(pt, tof); | |
998 | if(GetReader()->IsPileUpFromEMCal()) fhPtTOFSignalPileUp[1]->Fill(pt, tof); | |
999 | if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtTOFSignalPileUp[2]->Fill(pt, tof); | |
1000 | if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtTOFSignalPileUp[3]->Fill(pt, tof); | |
1001 | if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtTOFSignalPileUp[4]->Fill(pt, tof); | |
1002 | if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtTOFSignalPileUp[5]->Fill(pt, tof); | |
1003 | if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtTOFSignalPileUp[6]->Fill(pt, tof); | |
1004 | ||
9b4a1ee2 | 1005 | if(fFillTrackBCHistograms) |
1006 | { | |
1007 | if (trackBC ==0) { fhEtaPhiTOFBC0 ->Fill(eta,phi); if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD()) fhEtaPhiTOFBC0PileUpSPD ->Fill(eta,phi); } | |
1008 | else if (trackBC < 0) { fhEtaPhiTOFBCPlus ->Fill(eta,phi); if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD()) fhEtaPhiTOFBCPlusPileUpSPD ->Fill(eta,phi); } | |
1009 | else if (trackBC > 0) { fhEtaPhiTOFBCMinus->Fill(eta,phi); if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD()) fhEtaPhiTOFBCMinusPileUpSPD->Fill(eta,phi); } | |
1010 | } | |
fedea415 | 1011 | |
52bd777f | 1012 | if(fFillVertexBC0Histograms) |
1013 | { | |
1014 | if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA) | |
1015 | { | |
1016 | if(GetReader()->IsPileUpFromSPD()) fhPtTOFSignalVtxOutBC0PileUp[0]->Fill(pt, tof); | |
1017 | if(GetReader()->IsPileUpFromEMCal()) fhPtTOFSignalVtxOutBC0PileUp[1]->Fill(pt, tof); | |
1018 | if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtTOFSignalVtxOutBC0PileUp[2]->Fill(pt, tof); | |
1019 | if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtTOFSignalVtxOutBC0PileUp[3]->Fill(pt, tof); | |
1020 | if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtTOFSignalVtxOutBC0PileUp[4]->Fill(pt, tof); | |
1021 | if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtTOFSignalVtxOutBC0PileUp[5]->Fill(pt, tof); | |
1022 | if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtTOFSignalVtxOutBC0PileUp[6]->Fill(pt, tof); | |
1023 | } | |
1024 | else | |
1025 | { | |
1026 | if(GetReader()->IsPileUpFromSPD()) fhPtTOFSignalVtxInBC0PileUp[0]->Fill(pt, tof); | |
1027 | if(GetReader()->IsPileUpFromEMCal()) fhPtTOFSignalVtxInBC0PileUp[1]->Fill(pt, tof); | |
1028 | if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtTOFSignalVtxInBC0PileUp[2]->Fill(pt, tof); | |
1029 | if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtTOFSignalVtxInBC0PileUp[3]->Fill(pt, tof); | |
1030 | if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtTOFSignalVtxInBC0PileUp[4]->Fill(pt, tof); | |
1031 | if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtTOFSignalVtxInBC0PileUp[5]->Fill(pt, tof); | |
1032 | if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtTOFSignalVtxInBC0PileUp[6]->Fill(pt, tof); | |
1033 | } | |
1034 | } | |
1035 | } | |
1036 | } | |
1037 | ||
1038 | //Fill AODParticle after some selection | |
1039 | Double_t mom[3] = {track->Px(),track->Py(),track->Pz()}; | |
1040 | ||
192689a4 | 1041 | Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,"CTS") ; |
1042 | ||
05d0d05d | 1043 | if(GetDebug() > 1) |
52bd777f | 1044 | printf("AliAnaChargedParticles::MakeAnalysisFillAOD() - Track pt %2.2f, eta %2.2f, phi %2.2f in fiducial cut %d\n",pt,eta,phi,in); |
192689a4 | 1045 | |
1046 | //Acceptance selection | |
1047 | if(IsFiducialCutOn() && ! in ) continue ; | |
1048 | ||
1049 | // Momentum selection | |
52bd777f | 1050 | if(pt < GetMinPt() || pt > GetMaxPt()) continue; |
fe9615b9 | 1051 | |
1052 | if(okTOF) fhTOFSignalPtCut->Fill(tof); | |
1053 | else | |
1054 | { | |
52bd777f | 1055 | fhPtTOFStatus0 ->Fill(pt); |
1056 | fhEtaPhiTOFStatus0->Fill(eta,phi); | |
fe9615b9 | 1057 | } |
192689a4 | 1058 | |
8f467228 | 1059 | Bool_t bITSRefit = (status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit; |
1060 | Bool_t bConstrained = kFALSE; | |
41ebe136 | 1061 | if (aodTrack) bConstrained = aodTrack->IsGlobalConstrained(); |
1062 | else if(esdTrack) bConstrained = (!esdTrack->HasPointOnITSLayer(0) && !esdTrack->HasPointOnITSLayer(1)); | |
8f467228 | 1063 | //printf("Track %d, pt %2.2f, eta %2.2f, phi %2.2f, SPDRefit %d, refit %d, dcaCons %2.2f\n", |
52bd777f | 1064 | // i, pt, eta, phi, bConstrained, bITSRefit, dcaCons); |
8f467228 | 1065 | |
1066 | if(bConstrained) | |
1067 | { | |
1068 | if(bITSRefit) | |
1069 | { | |
52bd777f | 1070 | fhPtNoSPDRefit->Fill(pt); |
1071 | if(pt < 2)fhEtaPhiNoSPDRefitPt02->Fill(eta,phi); | |
1072 | if(pt > 3)fhEtaPhiNoSPDRefitPt3 ->Fill(eta,phi); | |
8f467228 | 1073 | |
1074 | if(dcaCons == -999) | |
1075 | { | |
52bd777f | 1076 | fhPtDCANoSPDRefit[0]->Fill(pt, dca[0]); |
1077 | fhPtDCANoSPDRefit[1]->Fill(pt, dca[1]); | |
8f467228 | 1078 | } |
1079 | else | |
52bd777f | 1080 | fhPtDCANoSPDRefit[2]->Fill(pt, dcaCons); |
8f467228 | 1081 | |
1082 | } | |
1083 | else | |
1084 | { | |
52bd777f | 1085 | fhPtNoSPDNoRefit->Fill(pt); |
1086 | if(pt < 2)fhEtaPhiNoSPDNoRefitPt02->Fill(eta,phi); | |
1087 | if(pt > 3)fhEtaPhiNoSPDNoRefitPt3 ->Fill(eta,phi); | |
8f467228 | 1088 | if(dcaCons == -999) |
1089 | { | |
52bd777f | 1090 | fhPtDCANoSPDNoRefit[0]->Fill(pt, dca[0]); |
1091 | fhPtDCANoSPDNoRefit[1]->Fill(pt, dca[1]); | |
8f467228 | 1092 | } |
1093 | else | |
52bd777f | 1094 | fhPtDCANoSPDNoRefit[2]->Fill(pt, dcaCons); |
8f467228 | 1095 | |
1096 | } | |
1097 | } | |
1098 | else | |
1099 | { | |
52bd777f | 1100 | fhPtSPDRefit->Fill(pt); |
1101 | if(pt < 2)fhEtaPhiSPDRefitPt02->Fill(eta,phi); | |
1102 | if(pt > 3)fhEtaPhiSPDRefitPt3 ->Fill(eta,phi); | |
8f467228 | 1103 | if(dcaCons == -999) |
1104 | { | |
52bd777f | 1105 | fhPtDCASPDRefit[0]->Fill(pt, dca[0]); |
1106 | fhPtDCASPDRefit[1]->Fill(pt, dca[1]); | |
8f467228 | 1107 | } |
1108 | else | |
52bd777f | 1109 | fhPtDCASPDRefit[2]->Fill(pt, dcaCons); |
8f467228 | 1110 | } |
52bd777f | 1111 | |
192689a4 | 1112 | // Mixed event |
fe9615b9 | 1113 | if (GetMixedEvent()) |
1114 | { | |
192689a4 | 1115 | evtIndex = GetMixedEvent()->EventIndex(track->GetID()) ; |
fe9615b9 | 1116 | } |
1117 | ||
192689a4 | 1118 | GetVertex(vert,evtIndex); |
1119 | if(TMath::Abs(vert[2])> GetZvertexCut()) return; | |
1120 | ||
1121 | AliAODPWG4Particle tr = AliAODPWG4Particle(mom[0],mom[1],mom[2],0); | |
1122 | tr.SetDetector("CTS"); | |
1123 | tr.SetLabel(track->GetLabel()); | |
1124 | tr.SetTrackLabel(track->GetID(),-1); | |
1125 | tr.SetChargedBit(track->Charge()>0); | |
7cd4e982 | 1126 | |
192689a4 | 1127 | AddAODParticle(tr); |
1128 | ||
477d6cee | 1129 | }//loop |
1130 | ||
1131 | if(GetDebug() > 0) | |
a3aebfff | 1132 | printf("AliAnaChargedParticles::MakeAnalysisFillAOD() - Final aod branch entries %d\n", GetOutputAODBranch()->GetEntriesFast()); |
477d6cee | 1133 | } |
1134 | ||
1135 | //__________________________________________________________________ | |
62c64236 | 1136 | void AliAnaChargedParticles::MakeAnalysisFillHistograms() |
477d6cee | 1137 | { |
1138 | //Do analysis and fill histograms | |
1139 | ||
1140 | //Loop on stored AODParticles | |
1141 | Int_t naod = GetOutputAODBranch()->GetEntriesFast(); | |
05d0d05d | 1142 | |
2244659d | 1143 | fhNtracks->Fill(GetReader()->GetTrackMultiplicity()) ; |
05d0d05d | 1144 | |
62c64236 | 1145 | if(GetDebug() > 0) |
05d0d05d | 1146 | printf("AliAnaChargedParticles::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod); |
1147 | ||
52bd777f | 1148 | Float_t pt = 0; |
1149 | Float_t phi = 0; | |
1150 | Float_t eta = 0; | |
fedea415 | 1151 | |
52bd777f | 1152 | for(Int_t iaod = 0; iaod < naod ; iaod++) |
1153 | { | |
1154 | AliAODPWG4Particle* track = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); | |
1155 | ||
1156 | pt = track->Pt(); | |
1157 | eta = track->Eta(); | |
1158 | phi = track->Phi(); | |
1159 | ||
1160 | fhPt->Fill(pt); | |
05d0d05d | 1161 | |
52bd777f | 1162 | if(track->GetChargedBit()) |
1163 | { | |
1164 | fhPhiPos ->Fill(pt, phi); | |
1165 | fhEtaPos ->Fill(pt, eta); | |
1166 | fhEtaPhiPos->Fill(eta,phi); | |
05d0d05d | 1167 | } |
52bd777f | 1168 | else |
1169 | { | |
1170 | fhPhiNeg ->Fill(pt, phi); | |
1171 | fhEtaNeg ->Fill(pt, eta); | |
1172 | fhEtaPhiNeg->Fill(eta,phi); | |
05d0d05d | 1173 | } |
477d6cee | 1174 | |
fedea415 | 1175 | if(fFillPileUpHistograms) |
1176 | { | |
52bd777f | 1177 | if(GetReader()->IsPileUpFromSPD()) {fhPtPileUp[0]->Fill(pt);} |
1178 | if(GetReader()->IsPileUpFromEMCal()) {fhPtPileUp[1]->Fill(pt);} | |
1179 | if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtPileUp[2]->Fill(pt);} | |
1180 | if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtPileUp[3]->Fill(pt);} | |
1181 | if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtPileUp[4]->Fill(pt);} | |
1182 | if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtPileUp[5]->Fill(pt);} | |
1183 | if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(pt);} | |
fedea415 | 1184 | } |
62c64236 | 1185 | |
fedea415 | 1186 | |
42b156e0 | 1187 | if(IsDataMC()) |
1188 | { | |
727a309a | 1189 | //Play with the MC stack if available |
5025c139 | 1190 | Int_t mompdg = -1; |
52bd777f | 1191 | Int_t label = track->GetLabel(); |
5025c139 | 1192 | |
62c64236 | 1193 | if(label >= 0) |
42b156e0 | 1194 | { |
62c64236 | 1195 | if( GetReader()->ReadStack() && label < GetMCStack()->GetNtrack()) |
1196 | { | |
1197 | TParticle * mom = GetMCStack()->Particle(label); | |
1198 | mompdg =TMath::Abs(mom->GetPdgCode()); | |
1199 | } | |
1200 | else if(GetReader()->ReadAODMCParticles()) | |
1201 | { | |
1202 | AliAODMCParticle * aodmom = 0; | |
1203 | //Get the list of MC particles | |
1204 | aodmom = (AliAODMCParticle*) (GetReader()->GetAODMCParticles())->At(label); | |
1205 | mompdg =TMath::Abs(aodmom->GetPdgCode()); | |
1206 | } | |
477d6cee | 1207 | } |
62c64236 | 1208 | |
1209 | Int_t mcType = kmcUnknown; | |
1210 | if (mompdg==211 ) mcType = kmcPion; | |
1211 | else if(mompdg==2212) mcType = kmcProton; | |
1212 | else if(mompdg==321 ) mcType = kmcKaon; | |
1213 | else if(mompdg==11 ) mcType = kmcElectron; | |
1214 | else if(mompdg==13 ) mcType = kmcMuon; | |
1215 | ||
1216 | fhPtMCPart [mcType]->Fill(pt); | |
1217 | fhEtaMCPart[mcType]->Fill(pt,eta); | |
1218 | fhPhiMCPart[mcType]->Fill(pt,phi); | |
1219 | ||
477d6cee | 1220 | }//Work with stack also |
f6661bbc | 1221 | |
477d6cee | 1222 | }// aod branch loop |
1223 | ||
727a309a | 1224 | if(IsDataMC()) |
62c64236 | 1225 | { |
1226 | Int_t primpdg = -1; | |
1227 | TLorentzVector mom; | |
1228 | if(GetReader()->ReadStack()) | |
727a309a | 1229 | { |
62c64236 | 1230 | AliStack * stack = GetMCStack(); |
1231 | if(stack) { | |
1232 | for(Int_t i=0 ; i<stack->GetNtrack(); i++) | |
1233 | { | |
1234 | TParticle *prim = stack->Particle(i); | |
1235 | if(prim->IsPrimary()) | |
1236 | { | |
1237 | primpdg = TMath::Abs(prim->GetPdgCode()); | |
1238 | ||
1239 | Int_t mcType = kmcUnknown; | |
1240 | if (primpdg==211 ) mcType = kmcPion; | |
1241 | else if(primpdg==2212) mcType = kmcProton; | |
1242 | else if(primpdg==321 ) mcType = kmcKaon; | |
1243 | else if(primpdg==11 ) mcType = kmcElectron; | |
1244 | else if(primpdg==13 ) mcType = kmcMuon; | |
1245 | ||
1246 | prim->Momentum(mom); | |
1247 | Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,"CTS") ; | |
1248 | ||
1249 | Float_t ptPrim = prim->Pt(); | |
1250 | if(in) fhPtMCPrimPart [mcType]->Fill(ptPrim); | |
1251 | fhEtaMCPrimPart[mcType]->Fill(ptPrim,prim->Eta()); | |
1252 | fhPhiMCPrimPart[mcType]->Fill(ptPrim,prim->Phi()); | |
1253 | } | |
1254 | } | |
727a309a | 1255 | } |
62c64236 | 1256 | } |
1257 | else if(GetReader()->ReadAODMCParticles()) | |
1258 | { | |
1259 | TClonesArray * mcparticles = GetReader()->GetAODMCParticles(); | |
1260 | if(mcparticles) | |
1261 | { | |
1262 | Int_t nprim = mcparticles->GetEntriesFast(); | |
1263 | for(Int_t i=0; i < nprim; i++) | |
1264 | { | |
1265 | AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i); | |
1266 | ||
1267 | if(prim->IsPrimary()) | |
1268 | { | |
1269 | primpdg = TMath::Abs(prim->GetPdgCode()); | |
1270 | ||
1271 | Int_t mcType = kmcUnknown; | |
1272 | if (primpdg==211 ) mcType = kmcPion; | |
1273 | else if(primpdg==2212) mcType = kmcProton; | |
1274 | else if(primpdg==321 ) mcType = kmcKaon; | |
1275 | else if(primpdg==11 ) mcType = kmcElectron; | |
1276 | else if(primpdg==13 ) mcType = kmcMuon; | |
1277 | ||
1278 | mom.SetPxPyPzE(prim->Px(),prim->Py(),prim->Pz(),prim->E()); | |
1279 | Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,"CTS") ; | |
1280 | ||
1281 | Float_t ptPrim = prim->Pt(); | |
1282 | if(in) fhPtMCPrimPart [mcType]->Fill(ptPrim); | |
1283 | fhEtaMCPrimPart[mcType]->Fill(ptPrim,prim->Eta()); | |
1284 | fhPhiMCPrimPart[mcType]->Fill(ptPrim,prim->Phi()); | |
1285 | } | |
1286 | } | |
727a309a | 1287 | } |
1288 | } | |
1289 | } | |
62c64236 | 1290 | } |