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