]>
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(), |
fedea415 | 47 | fPdg(0), fFillPileUpHistograms(0), |
48 | fhNtracks(0), fhPt(0), | |
8f467228 | 49 | fhPhiNeg(0), fhEtaNeg(0), |
fedea415 | 50 | fhPhiPos(0), fhEtaPos(0), |
51 | fhEtaPhiPos(0), fhEtaPhiNeg(0), | |
8f467228 | 52 | fhPtSPDRefit(0), fhPtNoSPDRefit(0), fhPtNoSPDNoRefit(0), |
53 | fhEtaPhiSPDRefitPt02(0), fhEtaPhiNoSPDRefitPt02(0), fhEtaPhiNoSPDNoRefitPt02(0), | |
54 | fhEtaPhiSPDRefitPt3(0), fhEtaPhiNoSPDRefitPt3(0), fhEtaPhiNoSPDNoRefitPt3(0), | |
05d0d05d | 55 | //MC |
fedea415 | 56 | fhPtPion(0), fhPhiPion(0), fhEtaPion(0), |
57 | fhPtProton(0), fhPhiProton(0), fhEtaProton(0), | |
58 | fhPtElectron(0), fhPhiElectron(0), fhEtaElectron(0), | |
59 | fhPtKaon(0), fhPhiKaon(0), fhEtaKaon(0), | |
60 | fhPtUnknown(0), fhPhiUnknown(0), fhEtaUnknown(0), | |
61 | fhTOFSignal(0), fhTOFSignalPtCut(0), fhTOFSignalBCOK(0), | |
62 | fhPtTOFSignal(0), fhPtTOFStatus0(0), fhEtaPhiTOFStatus0(0), | |
63 | fhEtaPhiTOFBC0(0), fhEtaPhiTOFBCPlus(0), fhEtaPhiTOFBCMinus(0), | |
64 | fhEtaPhiTOFBC0PileUpSPD(0), | |
65 | fhEtaPhiTOFBCPlusPileUpSPD(0), | |
309684b9 | 66 | fhEtaPhiTOFBCMinusPileUpSPD(0)//, |
67 | // fhProductionVertexBC(0) | |
477d6cee | 68 | { |
69 | //Default Ctor | |
70 | ||
fedea415 | 71 | for(Int_t i = 0; i < 7; i++) |
72 | { | |
73 | fhPtPileUp [i] = 0; | |
74 | fhPtTOFSignalPileUp[i] = 0; | |
75 | } | |
76 | ||
77 | for(Int_t i = 0; i < 3; i++) | |
78 | { | |
79 | fhPtDCA [i] = 0 ; | |
8f467228 | 80 | |
81 | fhPtDCASPDRefit [i] = 0 ; | |
82 | fhPtDCANoSPDRefit [i] = 0 ; | |
83 | fhPtDCANoSPDNoRefit [i] = 0 ; | |
84 | ||
fedea415 | 85 | //fhPtDCAVtxOutBC0 [i] = 0 ; |
86 | fhPtDCAPileUp [i] = 0 ; | |
87 | //fhPtDCAVtxOutBC0PileUp[i] = 0 ; | |
88 | ||
89 | fhPtDCATOFBC0 [i] = 0 ; | |
90 | fhPtDCAPileUpTOFBC0 [i] = 0 ; | |
91 | ||
92 | fhPtDCANoTOFHit [i] = 0 ; | |
93 | //fhPtDCAVtxOutBC0NoTOFHit [i] = 0 ; | |
94 | fhPtDCAPileUpNoTOFHit [i] = 0 ; | |
95 | //fhPtDCAVtxOutBC0PileUpNoTOFHit[i] = 0 ; | |
96 | } | |
fe9615b9 | 97 | |
477d6cee | 98 | //Initialize parameters |
99 | InitParameters(); | |
477d6cee | 100 | |
477d6cee | 101 | } |
102 | ||
05d0d05d | 103 | //_______________________________________________________ |
477d6cee | 104 | TList * AliAnaChargedParticles::GetCreateOutputObjects() |
105 | { | |
106 | // Create histograms to be saved in output file and | |
107 | // store them in fOutputContainer | |
108 | ||
109 | ||
110 | TList * outputContainer = new TList() ; | |
111 | outputContainer->SetName("ExampleHistos") ; | |
112 | ||
745913ae | 113 | Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); |
114 | Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); | |
115 | Float_t ptmin = GetHistogramRanges()->GetHistoPtMin(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin(); | |
5025c139 | 116 | |
117 | fhNtracks = new TH1F ("hNtracks","# of tracks", 1000,0,1000); | |
118 | fhNtracks->SetXTitle("# of tracks"); | |
119 | outputContainer->Add(fhNtracks); | |
05d0d05d | 120 | |
121 | fhPt = new TH1F ("hPt","p_T distribution", nptbins,ptmin,ptmax); | |
477d6cee | 122 | fhPt->SetXTitle("p_{T} (GeV/c)"); |
123 | outputContainer->Add(fhPt); | |
124 | ||
05d0d05d | 125 | fhPhiNeg = new TH2F ("hPhiNegative","#phi of negative charges distribution", |
126 | nptbins,ptmin,ptmax, nphibins,phimin,phimax); | |
127 | fhPhiNeg->SetYTitle("#phi (rad)"); | |
128 | fhPhiNeg->SetXTitle("p_{T} (GeV/c)"); | |
129 | outputContainer->Add(fhPhiNeg); | |
130 | ||
131 | fhEtaNeg = new TH2F ("hEtaNegative","#eta of negative charges distribution", | |
132 | nptbins,ptmin,ptmax, netabins,etamin,etamax); | |
133 | fhEtaNeg->SetYTitle("#eta "); | |
134 | fhEtaNeg->SetXTitle("p_{T} (GeV/c)"); | |
135 | outputContainer->Add(fhEtaNeg); | |
477d6cee | 136 | |
192689a4 | 137 | fhPhiPos = new TH2F ("hPhiPositive","#phi of positive charges distribution", |
05d0d05d | 138 | nptbins,ptmin,ptmax, nphibins,phimin,phimax); |
139 | fhPhiPos->SetYTitle("#phi (rad)"); | |
140 | fhPhiPos->SetXTitle("p_{T} (GeV/c)"); | |
141 | outputContainer->Add(fhPhiPos); | |
477d6cee | 142 | |
192689a4 | 143 | fhEtaPos = new TH2F ("hEtaPositive","#eta of positive charges distribution", |
05d0d05d | 144 | nptbins,ptmin,ptmax, netabins,etamin,etamax); |
145 | fhEtaPos->SetYTitle("#eta "); | |
146 | fhEtaPos->SetXTitle("p_{T} (GeV/c)"); | |
147 | outputContainer->Add(fhEtaPos); | |
5025c139 | 148 | |
fe9615b9 | 149 | fhEtaPhiPos = new TH2F ("hEtaPhiPositive","pt/eta/phi of positive charge",netabins,etamin,etamax, nphibins,phimin,phimax); |
4bfeae64 | 150 | fhEtaPhiPos->SetXTitle("#eta "); |
151 | fhEtaPhiPos->SetYTitle("#phi (rad)"); | |
05d0d05d | 152 | outputContainer->Add(fhEtaPhiPos); |
153 | ||
154 | fhEtaPhiNeg = new TH2F ("hEtaPhiNegative","eta vs phi of negative charge",netabins,etamin,etamax, nphibins,phimin,phimax); | |
4bfeae64 | 155 | fhEtaPhiNeg->SetXTitle("#eta "); |
156 | fhEtaPhiNeg->SetYTitle("#phi (rad)"); | |
05d0d05d | 157 | outputContainer->Add(fhEtaPhiNeg); |
477d6cee | 158 | |
8f467228 | 159 | fhPtSPDRefit = new TH1F ("hPtSPDRefit","p_T distribution of tracks with SPD and ITS refit", nptbins,ptmin,ptmax); |
160 | fhPtSPDRefit->SetXTitle("p_{T} (GeV/c)"); | |
161 | outputContainer->Add(fhPtSPDRefit); | |
162 | ||
163 | 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); | |
164 | fhEtaPhiSPDRefitPt02->SetXTitle("#eta "); | |
165 | fhEtaPhiSPDRefitPt02->SetYTitle("#phi (rad)"); | |
166 | outputContainer->Add(fhEtaPhiSPDRefitPt02); | |
167 | ||
168 | 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); | |
169 | fhEtaPhiSPDRefitPt3->SetXTitle("#eta "); | |
170 | fhEtaPhiSPDRefitPt3->SetYTitle("#phi (rad)"); | |
171 | outputContainer->Add(fhEtaPhiSPDRefitPt3); | |
172 | ||
173 | fhPtNoSPDRefit = new TH1F ("hPtNoSPDRefit","p_T distribution of constrained tracks no SPD and with ITSRefit", nptbins,ptmin,ptmax); | |
174 | fhPtNoSPDRefit->SetXTitle("p_{T} (GeV/c)"); | |
175 | outputContainer->Add(fhPtNoSPDRefit); | |
176 | ||
177 | 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); | |
178 | fhEtaPhiNoSPDRefitPt02->SetXTitle("#eta "); | |
179 | fhEtaPhiNoSPDRefitPt02->SetYTitle("#phi (rad)"); | |
180 | outputContainer->Add(fhEtaPhiNoSPDRefitPt02); | |
181 | ||
182 | 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); | |
183 | fhEtaPhiNoSPDRefitPt3->SetXTitle("#eta "); | |
184 | fhEtaPhiNoSPDRefitPt3->SetYTitle("#phi (rad)"); | |
185 | outputContainer->Add(fhEtaPhiNoSPDRefitPt3); | |
186 | ||
187 | fhPtNoSPDNoRefit = new TH1F ("hPtNoSPDNoRefit","p_T distribution of constrained tracks with no SPD requierement and without ITSRefit", nptbins,ptmin,ptmax); | |
188 | fhPtNoSPDNoRefit->SetXTitle("p_{T} (GeV/c)"); | |
189 | outputContainer->Add(fhPtNoSPDNoRefit); | |
190 | ||
191 | 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); | |
192 | fhEtaPhiNoSPDNoRefitPt02->SetXTitle("#eta "); | |
193 | fhEtaPhiNoSPDNoRefitPt02->SetYTitle("#phi (rad)"); | |
194 | outputContainer->Add(fhEtaPhiNoSPDNoRefitPt02); | |
195 | ||
196 | 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); | |
197 | fhEtaPhiNoSPDNoRefitPt3->SetXTitle("#eta "); | |
198 | fhEtaPhiNoSPDNoRefitPt3->SetYTitle("#phi (rad)"); | |
199 | outputContainer->Add(fhEtaPhiNoSPDNoRefitPt3); | |
200 | ||
201 | ||
309684b9 | 202 | // fhProductionVertexBC = new TH1F("hProductionVertexBC", "tracks production vertex bunch crossing ", 18 , -9 , 9 ) ; |
203 | // fhProductionVertexBC->SetYTitle("# tracks"); | |
204 | // fhProductionVertexBC->SetXTitle("Bunch crossing"); | |
205 | // outputContainer->Add(fhProductionVertexBC); | |
fedea415 | 206 | |
fe9615b9 | 207 | Int_t ntofbins = 1000; |
208 | Int_t mintof = -500; | |
209 | Int_t maxtof = 500; | |
fedea415 | 210 | |
fe9615b9 | 211 | fhTOFSignal = new TH1F ("hTOFSignal","TOF signal", ntofbins,mintof,maxtof); |
fedea415 | 212 | fhTOFSignal->SetXTitle("TOF signal (ns)"); |
fe9615b9 | 213 | outputContainer->Add(fhTOFSignal); |
214 | ||
fedea415 | 215 | fhTOFSignalBCOK = new TH1F ("hTOFSignalBCOK","TOF signal", ntofbins,mintof,maxtof); |
216 | fhTOFSignalBCOK->SetXTitle("TOF signal (ns)"); | |
217 | outputContainer->Add(fhTOFSignalBCOK); | |
218 | ||
fe9615b9 | 219 | fhTOFSignalPtCut = new TH1F ("hTOFSignalPtCut","TOF signal", ntofbins,mintof,maxtof); |
fedea415 | 220 | fhTOFSignalPtCut->SetXTitle("TOF signal (ns)"); |
fe9615b9 | 221 | outputContainer->Add(fhTOFSignalPtCut); |
222 | ||
223 | fhPtTOFSignal = new TH2F ("hPtTOFSignal","TOF signal", nptbins,ptmin,ptmax,ntofbins,mintof,maxtof); | |
fedea415 | 224 | fhPtTOFSignal->SetYTitle("TOF signal (ns)"); |
fe9615b9 | 225 | fhPtTOFSignal->SetXTitle("p_{T} (GeV/c)"); |
226 | outputContainer->Add(fhPtTOFSignal); | |
fedea415 | 227 | |
228 | if(fFillPileUpHistograms) | |
229 | { | |
230 | TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ; | |
231 | ||
232 | for(Int_t i = 0 ; i < 7 ; i++) | |
233 | { | |
234 | fhPtPileUp[i] = new TH1F(Form("hPtPileUp%s",pileUpName[i].Data()), | |
235 | Form("Track p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), | |
236 | nptbins,ptmin,ptmax); | |
237 | fhPtPileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
238 | outputContainer->Add(fhPtPileUp[i]); | |
239 | ||
240 | fhPtTOFSignalPileUp[i] = new TH2F(Form("hPtTOFSignalPileUp%s",pileUpName[i].Data()), | |
241 | Form("Track TOF vs p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), | |
242 | nptbins,ptmin,ptmax,ntofbins,mintof,maxtof); | |
243 | fhPtTOFSignalPileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
244 | fhPtTOFSignalPileUp[i]->SetXTitle("TOF signal (ns)"); | |
245 | outputContainer->Add(fhPtTOFSignalPileUp[i]); | |
246 | } | |
247 | ||
248 | fhEtaPhiTOFBC0 = new TH2F ("hEtaPhiTOFBC0","eta-phi for tracks with hit on TOF, and tof corresponding to BC=0",netabins,etamin,etamax, nphibins,phimin,phimax); | |
249 | fhEtaPhiTOFBC0->SetXTitle("#eta "); | |
250 | fhEtaPhiTOFBC0->SetYTitle("#phi (rad)"); | |
251 | outputContainer->Add(fhEtaPhiTOFBC0); | |
252 | ||
253 | fhEtaPhiTOFBCPlus = new TH2F ("hEtaPhiTOFBCPlus","eta-phi for tracks with hit on TOF, and tof corresponding to BC>0",netabins,etamin,etamax, nphibins,phimin,phimax); | |
254 | fhEtaPhiTOFBCPlus->SetXTitle("#eta "); | |
255 | fhEtaPhiTOFBCPlus->SetYTitle("#phi (rad)"); | |
256 | outputContainer->Add(fhEtaPhiTOFBCPlus); | |
257 | ||
258 | fhEtaPhiTOFBCMinus = new TH2F ("hEtaPhiTOFBCMinus","eta-phi for tracks with hit on TOF, and tof corresponding to BC<0",netabins,etamin,etamax, nphibins,phimin,phimax); | |
259 | fhEtaPhiTOFBCMinus->SetXTitle("#eta "); | |
260 | fhEtaPhiTOFBCMinus->SetYTitle("#phi (rad)"); | |
261 | outputContainer->Add(fhEtaPhiTOFBCMinus); | |
262 | ||
263 | 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); | |
264 | fhEtaPhiTOFBC0PileUpSPD->SetXTitle("#eta "); | |
265 | fhEtaPhiTOFBC0PileUpSPD->SetYTitle("#phi (rad)"); | |
266 | outputContainer->Add(fhEtaPhiTOFBC0PileUpSPD); | |
267 | ||
268 | 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); | |
269 | fhEtaPhiTOFBCPlusPileUpSPD->SetXTitle("#eta "); | |
270 | fhEtaPhiTOFBCPlusPileUpSPD->SetYTitle("#phi (rad)"); | |
271 | outputContainer->Add(fhEtaPhiTOFBCPlusPileUpSPD); | |
272 | ||
273 | 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); | |
274 | fhEtaPhiTOFBCMinusPileUpSPD->SetXTitle("#eta "); | |
275 | fhEtaPhiTOFBCMinusPileUpSPD->SetYTitle("#phi (rad)"); | |
276 | outputContainer->Add(fhEtaPhiTOFBCMinusPileUpSPD); | |
277 | ||
fe9615b9 | 278 | } |
279 | ||
280 | fhPtTOFStatus0 = new TH1F ("hPtTOFStatus0","p_T distribution of tracks not hitting TOF", nptbins,ptmin,ptmax); | |
281 | fhPtTOFStatus0->SetXTitle("p_{T} (GeV/c)"); | |
282 | outputContainer->Add(fhPtTOFStatus0); | |
283 | ||
284 | ||
fedea415 | 285 | fhEtaPhiTOFStatus0 = new TH2F ("hEtaPhiTOFStatus0","eta-phi for tracks without hit on TOF",netabins,etamin,etamax, nphibins,phimin,phimax); |
fe9615b9 | 286 | fhEtaPhiTOFStatus0->SetXTitle("#eta "); |
287 | fhEtaPhiTOFStatus0->SetYTitle("#phi (rad)"); | |
288 | outputContainer->Add(fhEtaPhiTOFStatus0); | |
289 | ||
fedea415 | 290 | TString dcaName[] = {"xy","z","Cons"} ; |
291 | Int_t ndcabins = 800; | |
292 | Int_t mindca = -4; | |
293 | Int_t maxdca = 4; | |
294 | ||
295 | for(Int_t i = 0 ; i < 3 ; i++) | |
296 | { | |
297 | ||
298 | fhPtDCA[i] = new TH2F(Form("hPtDCA%s",dcaName[i].Data()), | |
299 | Form("Track DCA%s vs p_{T} distribution",dcaName[i].Data()), | |
300 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
301 | fhPtDCA[i]->SetXTitle("p_{T} (GeV/c)"); | |
302 | fhPtDCA[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
303 | outputContainer->Add(fhPtDCA[i]); | |
304 | ||
8f467228 | 305 | fhPtDCASPDRefit[i] = new TH2F(Form("hPtDCA%sSPDRefit",dcaName[i].Data()), |
306 | Form("Track DCA%s vs p_{T} distribution of tracks with SPD and ITS refit",dcaName[i].Data()), | |
307 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
308 | fhPtDCASPDRefit[i]->SetXTitle("p_{T} (GeV/c)"); | |
309 | fhPtDCASPDRefit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
310 | outputContainer->Add(fhPtDCASPDRefit[i]); | |
311 | ||
312 | fhPtDCANoSPDRefit[i] = new TH2F(Form("hPtDCA%sNoSPDRefit",dcaName[i].Data()), | |
313 | Form("Track DCA%s vs p_{T} distributionof constrained tracks no SPD and with ITSRefit",dcaName[i].Data()), | |
314 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
315 | fhPtDCANoSPDRefit[i]->SetXTitle("p_{T} (GeV/c)"); | |
316 | fhPtDCANoSPDRefit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
317 | outputContainer->Add(fhPtDCANoSPDRefit[i]); | |
318 | ||
319 | fhPtDCANoSPDNoRefit[i] = new TH2F(Form("hPtDCA%sNoSPDNoRefit",dcaName[i].Data()), | |
320 | Form("Track DCA%s vs p_{T} distribution, constrained tracks with no SPD requierement and without ITSRefit",dcaName[i].Data()), | |
321 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
322 | fhPtDCANoSPDNoRefit[i]->SetXTitle("p_{T} (GeV/c)"); | |
323 | fhPtDCANoSPDNoRefit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
324 | outputContainer->Add(fhPtDCANoSPDNoRefit[i]); | |
325 | ||
fedea415 | 326 | fhPtDCATOFBC0[i] = new TH2F(Form("hPtDCA%sTOFBC0",dcaName[i].Data()), |
327 | Form("Track DCA%s vs p_{T} distribution",dcaName[i].Data()), | |
328 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
329 | fhPtDCATOFBC0[i]->SetXTitle("p_{T} (GeV/c)"); | |
330 | fhPtDCATOFBC0[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
331 | outputContainer->Add(fhPtDCATOFBC0[i]); | |
332 | ||
333 | fhPtDCANoTOFHit[i] = new TH2F(Form("hPtDCA%sNoTOFHit",dcaName[i].Data()), | |
334 | Form("Track (no TOF hit) DCA%s vs p_{T} distribution",dcaName[i].Data()), | |
335 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
336 | fhPtDCANoTOFHit[i]->SetXTitle("p_{T} (GeV/c)"); | |
337 | fhPtDCANoTOFHit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
338 | outputContainer->Add(fhPtDCANoTOFHit[i]); | |
339 | ||
340 | // fhPtDCAVtxOutBC0[i] = new TH2F(Form("hPtDCA%sVtxOutBC0",dcaName[i].Data()), | |
341 | // Form("Track DCA%s vs p_{T} distribution, vertex with BC!=0",dcaName[i].Data()), | |
342 | // nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
343 | // fhPtDCAVtxOutBC0[i]->SetXTitle("p_{T} (GeV/c)"); | |
344 | // fhPtDCAVtxOutBC0[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
345 | // outputContainer->Add(fhPtDCAVtxOutBC0[i]); | |
346 | // | |
347 | // fhPtDCAVtxOutBC0NoTOFHit[i] = new TH2F(Form("hPtDCA%sVtxOutBC0NoTOFHit",dcaName[i].Data()), | |
348 | // Form("Track (no TOF hit) DCA%s vs p_{T} distribution, vertex with BC!=0",dcaName[i].Data()), | |
349 | // nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
350 | // fhPtDCAVtxOutBC0NoTOFHit[i]->SetXTitle("p_{T} (GeV/c)"); | |
351 | // fhPtDCAVtxOutBC0NoTOFHit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
352 | // outputContainer->Add(fhPtDCAVtxOutBC0NoTOFHit[i]); | |
353 | ||
354 | if(fFillPileUpHistograms) | |
355 | { | |
356 | fhPtDCAPileUp[i] = new TH2F(Form("hPtDCA%sPileUp",dcaName[i].Data()), | |
357 | Form("Track DCA%s vs p_{T} distribution, SPD Pile-Up",dcaName[i].Data()), | |
358 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
359 | fhPtDCAPileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
360 | fhPtDCAPileUp[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
361 | outputContainer->Add(fhPtDCAPileUp[i]); | |
362 | ||
363 | fhPtDCAPileUpTOFBC0[i] = new TH2F(Form("hPtDCA%sPileUpTOFBC0",dcaName[i].Data()), | |
364 | Form("Track DCA%s vs p_{T} distribution",dcaName[i].Data()), | |
365 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
366 | fhPtDCAPileUpTOFBC0[i]->SetXTitle("p_{T} (GeV/c)"); | |
367 | fhPtDCAPileUpTOFBC0[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
368 | outputContainer->Add(fhPtDCAPileUpTOFBC0[i]); | |
369 | ||
370 | fhPtDCAPileUpNoTOFHit[i] = new TH2F(Form("hPtDCA%sPileUpNoTOFHit",dcaName[i].Data()), | |
371 | Form("Track (no TOF hit) DCA%s vs p_{T} distribution, SPD Pile-Up, vertex with BC!=0",dcaName[i].Data()), | |
372 | nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
373 | fhPtDCAPileUpNoTOFHit[i]->SetXTitle("p_{T} (GeV/c)"); | |
374 | fhPtDCAPileUpNoTOFHit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
375 | outputContainer->Add(fhPtDCAPileUpNoTOFHit[i]); | |
376 | ||
377 | // fhPtDCAVtxOutBC0PileUp[i] = new TH2F(Form("hPtDCA%sPileUpVtxOutBC0",dcaName[i].Data()), | |
378 | // Form("Track DCA%s vs p_{T} distribution, SPD Pile-Up",dcaName[i].Data()), | |
379 | // nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
380 | // fhPtDCAVtxOutBC0PileUp[i]->SetXTitle("p_{T} (GeV/c)"); | |
381 | // fhPtDCAVtxOutBC0PileUp[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
382 | // outputContainer->Add(fhPtDCAVtxOutBC0PileUp[i]); | |
383 | // | |
384 | // fhPtDCAVtxOutBC0PileUpNoTOFHit[i] = new TH2F(Form("hPtDCA%sVtxOutBC0PileUpNoTOFHit",dcaName[i].Data()), | |
385 | // Form("Track (no TOF hit) DCA%s vs p_{T} distribution, SPD Pile-Up, vertex with BC!=0",dcaName[i].Data()), | |
386 | // nptbins,ptmin,ptmax,ndcabins,mindca,maxdca); | |
387 | // fhPtDCAVtxOutBC0PileUpNoTOFHit[i]->SetXTitle("p_{T} (GeV/c)"); | |
388 | // fhPtDCAVtxOutBC0PileUpNoTOFHit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data())); | |
389 | // outputContainer->Add(fhPtDCAVtxOutBC0PileUpNoTOFHit[i]); | |
390 | } | |
391 | } | |
392 | ||
393 | ||
fe9615b9 | 394 | |
477d6cee | 395 | if(IsDataMC()){ |
396 | ||
a3aebfff | 397 | fhPtPion = new TH1F ("hPtMCPion","p_T distribution from #pi", nptbins,ptmin,ptmax); |
477d6cee | 398 | fhPtPion->SetXTitle("p_{T} (GeV/c)"); |
399 | outputContainer->Add(fhPtPion); | |
400 | ||
a3aebfff | 401 | fhPhiPion = new TH2F ("hPhiMCPion","#phi distribution from #pi",nptbins,ptmin,ptmax, nphibins,phimin,phimax); |
477d6cee | 402 | fhPhiPion->SetXTitle("#phi (rad)"); |
403 | outputContainer->Add(fhPhiPion); | |
404 | ||
a3aebfff | 405 | fhEtaPion = new TH2F ("hEtaMCPion","#eta distribution from #pi",nptbins,ptmin,ptmax, netabins,etamin,etamax); |
477d6cee | 406 | fhEtaPion->SetXTitle("#eta "); |
407 | outputContainer->Add(fhEtaPion); | |
408 | ||
a3aebfff | 409 | fhPtProton = new TH1F ("hPtMCProton","p_T distribution from proton", nptbins,ptmin,ptmax); |
477d6cee | 410 | fhPtProton->SetXTitle("p_{T} (GeV/c)"); |
411 | outputContainer->Add(fhPtProton); | |
412 | ||
a3aebfff | 413 | fhPhiProton = new TH2F ("hPhiMCProton","#phi distribution from proton",nptbins,ptmin,ptmax, nphibins,phimin,phimax); |
477d6cee | 414 | fhPhiProton->SetXTitle("#phi (rad)"); |
415 | outputContainer->Add(fhPhiProton); | |
416 | ||
a3aebfff | 417 | fhEtaProton = new TH2F ("hEtaMCProton","#eta distribution from proton",nptbins,ptmin,ptmax, netabins,etamin,etamax); |
477d6cee | 418 | fhEtaProton->SetXTitle("#eta "); |
419 | outputContainer->Add(fhEtaProton); | |
420 | ||
a3aebfff | 421 | fhPtKaon = new TH1F ("hPtMCKaon","p_T distribution from kaon", nptbins,ptmin,ptmax); |
477d6cee | 422 | fhPtKaon->SetXTitle("p_{T} (GeV/c)"); |
423 | outputContainer->Add(fhPtKaon); | |
424 | ||
a3aebfff | 425 | fhPhiKaon = new TH2F ("hPhiMCKaon","#phi distribution from kaon",nptbins,ptmin,ptmax, nphibins,phimin,phimax); |
477d6cee | 426 | fhPhiKaon->SetXTitle("#phi (rad)"); |
427 | outputContainer->Add(fhPhiKaon); | |
428 | ||
a3aebfff | 429 | fhEtaKaon = new TH2F ("hEtaMCKaon","#eta distribution from kaon",nptbins,ptmin,ptmax, netabins,etamin,etamax); |
477d6cee | 430 | fhEtaKaon->SetXTitle("#eta "); |
431 | outputContainer->Add(fhEtaKaon); | |
432 | ||
a3aebfff | 433 | fhPtElectron = new TH1F ("hPtMCElectron","p_T distribution from electron", nptbins,ptmin,ptmax); |
477d6cee | 434 | fhPtElectron->SetXTitle("p_{T} (GeV/c)"); |
435 | outputContainer->Add(fhPtElectron); | |
436 | ||
a3aebfff | 437 | fhPhiElectron = new TH2F ("hPhiMCElectron","#phi distribution from electron",nptbins,ptmin,ptmax, nphibins,phimin,phimax); |
477d6cee | 438 | fhPhiElectron->SetXTitle("#phi (rad)"); |
439 | outputContainer->Add(fhPhiElectron); | |
440 | ||
a3aebfff | 441 | fhEtaElectron = new TH2F ("hEtaMCElectron","#eta distribution from electron",nptbins,ptmin,ptmax, netabins,etamin,etamax); |
477d6cee | 442 | fhEtaElectron->SetXTitle("#eta "); |
443 | outputContainer->Add(fhEtaElectron); | |
444 | ||
a3aebfff | 445 | fhPtUnknown = new TH1F ("hPtMCUnknown","p_T distribution from unknown", nptbins,ptmin,ptmax); |
477d6cee | 446 | fhPtUnknown->SetXTitle("p_{T} (GeV/c)"); |
447 | outputContainer->Add(fhPtUnknown); | |
448 | ||
a3aebfff | 449 | fhPhiUnknown = new TH2F ("hPhiMCUnknown","#phi distribution from unknown",nptbins,ptmin,ptmax, nphibins,phimin,phimax); |
477d6cee | 450 | fhPhiUnknown->SetXTitle("#phi (rad)"); |
451 | outputContainer->Add(fhPhiUnknown); | |
452 | ||
a3aebfff | 453 | fhEtaUnknown = new TH2F ("hEtaMCUnknown","#eta distribution from unknown",nptbins,ptmin,ptmax, netabins,etamin,etamax); |
477d6cee | 454 | fhEtaUnknown->SetXTitle("#eta "); |
455 | outputContainer->Add(fhEtaUnknown); | |
456 | ||
457 | } | |
a3aebfff | 458 | |
477d6cee | 459 | return outputContainer; |
a3aebfff | 460 | |
477d6cee | 461 | } |
462 | ||
05d0d05d | 463 | //___________________________________________ |
477d6cee | 464 | void AliAnaChargedParticles::InitParameters() |
465 | { | |
466 | //Initialize the parameters of the analysis. | |
467 | SetOutputAODClassName("AliAODPWG4Particle"); | |
a3aebfff | 468 | SetOutputAODName("PWG4Particle"); |
469 | ||
470 | AddToHistogramsName("AnaCharged_"); | |
471 | ||
477d6cee | 472 | fPdg = -1; //Select all tracks |
473 | ||
474 | } | |
475 | ||
05d0d05d | 476 | //____________________________________________________________ |
477d6cee | 477 | void AliAnaChargedParticles::Print(const Option_t * opt) const |
478 | { | |
479 | //Print some relevant parameters set for the analysis | |
480 | if(! opt) | |
481 | return; | |
482 | ||
a3aebfff | 483 | printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; |
745913ae | 484 | AliAnaCaloTrackCorrBaseClass::Print(" "); |
a3aebfff | 485 | |
477d6cee | 486 | printf("Min Pt = %3.2f\n", GetMinPt()); |
487 | printf("Max Pt = %3.2f\n", GetMaxPt()); | |
488 | printf("Select clusters with pdg %d \n",fPdg); | |
489 | ||
490 | } | |
491 | ||
05d0d05d | 492 | //_________________________________ |
477d6cee | 493 | void AliAnaChargedParticles::Init() |
494 | { | |
495 | //Init | |
496 | //Do some checks | |
497 | if(!GetReader()->IsCTSSwitchedOn()){ | |
7cd4e982 | 498 | printf("AliAnaChargedParticles::Init() - STOP!: You want to use CTS tracks in analysis but not read!! \n!!Check the configuration file!!\n"); |
477d6cee | 499 | abort(); |
500 | } | |
501 | ||
502 | } | |
503 | ||
05d0d05d | 504 | //_________________________________________________ |
477d6cee | 505 | void AliAnaChargedParticles::MakeAnalysisFillAOD() |
506 | { | |
507 | //Do analysis and fill aods | |
be518ab0 | 508 | if(!GetCTSTracks() || GetCTSTracks()->GetEntriesFast() == 0) return ; |
192689a4 | 509 | |
be518ab0 | 510 | Int_t ntracks = GetCTSTracks()->GetEntriesFast(); |
2244659d | 511 | Double_t vert[3] = {0,0,0}; //vertex ; |
192689a4 | 512 | |
477d6cee | 513 | //Some prints |
514 | if(GetDebug() > 0) | |
a3aebfff | 515 | printf("AliAnaChargedParticles::MakeAnalysisFillAOD() - In CTS aod entries %d\n", ntracks); |
477d6cee | 516 | |
309684b9 | 517 | //AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (GetReader()->GetInputEvent()); |
518 | //AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (GetReader()->GetInputEvent()); | |
fedea415 | 519 | |
520 | Double_t bz = GetReader()->GetInputEvent()->GetMagneticField(); | |
521 | ||
477d6cee | 522 | //Fill AODParticle with CTS aods |
523 | TVector3 p3; | |
5025c139 | 524 | Int_t evtIndex = 0; |
477d6cee | 525 | for(Int_t i = 0; i < ntracks; i++){ |
526 | ||
88f9563f | 527 | AliVTrack * track = (AliVTrack*) (GetCTSTracks()->At(i)); |
477d6cee | 528 | |
fedea415 | 529 | //Fill AODParticle after some selection |
477d6cee | 530 | Double_t mom[3] = {track->Px(),track->Py(),track->Pz()}; |
531 | p3.SetXYZ(mom[0],mom[1],mom[2]); | |
532 | ||
fe9615b9 | 533 | //TOF |
534 | ULong_t status = track->GetStatus(); | |
fedea415 | 535 | Bool_t okTOF = (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ; |
fe9615b9 | 536 | Double32_t tof = track->GetTOFsignal()*1e-3; |
537 | //if( tof < 0) printf("TOF Signal %e, status %d, pt %f\n", tof,status,status2,p3.Pt()); | |
538 | ||
fedea415 | 539 | Double_t dcaCons = -999; |
309684b9 | 540 | //Int_t vtxBC = -999; |
541 | //if (esdevent) vtxBC = esdevent->GetPrimaryVertex()->GetBC(); | |
542 | //else if(aodevent) vtxBC = aodevent->GetPrimaryVertex()->GetBC(); | |
fedea415 | 543 | |
309684b9 | 544 | //if(vtxBC!=AliVTrack::kTOFBCNA)printf("BC primary %d",vtxBC); |
fedea415 | 545 | |
546 | AliAODTrack * aodTrack = dynamic_cast<AliAODTrack*>(track); | |
24017d51 | 547 | AliESDtrack * esdTrack = dynamic_cast<AliESDtrack*>(track); |
548 | ||
fedea415 | 549 | if(aodTrack) |
550 | { | |
551 | dcaCons = aodTrack->DCA(); | |
309684b9 | 552 | //vtxBC = aodTrack->GetProdVertex()->GetBC(); |
fedea415 | 553 | } |
554 | ||
309684b9 | 555 | //if(vtxBC!=AliVTrack::kTOFBCNA) printf(" - production %d\n",vtxBC); |
fedea415 | 556 | |
309684b9 | 557 | //fhProductionVertexBC->Fill(vtxBC); |
fedea415 | 558 | |
559 | Double_t dca[2] = {1e6,1e6}; | |
560 | Double_t covar[3] = {1e6,1e6,1e6}; | |
561 | track->PropagateToDCA(GetReader()->GetInputEvent()->GetPrimaryVertex(),bz,100.,dca,covar); | |
562 | ||
563 | if(dcaCons == -999) | |
564 | { | |
565 | fhPtDCA[0]->Fill(p3.Pt(), dca[0]); | |
566 | fhPtDCA[1]->Fill(p3.Pt(), dca[1]); | |
567 | } | |
568 | else fhPtDCA[2]->Fill(p3.Pt(), dcaCons); | |
569 | ||
570 | // if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA) | |
571 | // { | |
572 | // if(dcaCons == -999) | |
573 | // { | |
574 | // fhPtDCAVtxOutBC0[0]->Fill(p3.Pt(), dca[0]); | |
575 | // fhPtDCAVtxOutBC0[1]->Fill(p3.Pt(), dca[1]); | |
576 | // } | |
577 | // else | |
578 | // fhPtDCAVtxOutBC0[2]->Fill(p3.Pt(), dcaCons); | |
579 | // } | |
580 | ||
581 | if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD()) | |
582 | { | |
583 | if(dcaCons == -999) | |
584 | { | |
585 | fhPtDCAPileUp[0]->Fill(p3.Pt(), dca[0]); | |
586 | fhPtDCAPileUp[1]->Fill(p3.Pt(), dca[1]); | |
587 | } | |
588 | else | |
589 | fhPtDCAPileUp[2]->Fill(p3.Pt(), dcaCons); | |
590 | ||
591 | // if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA) | |
592 | // { | |
593 | // if(dcaCons == -999) | |
594 | // { | |
595 | // fhPtDCAVtxOutBC0PileUp[0]->Fill(p3.Pt(), dca[0]); | |
596 | // fhPtDCAVtxOutBC0PileUp[1]->Fill(p3.Pt(), dca[1]); | |
597 | // } | |
598 | // else fhPtDCAVtxOutBC0PileUp[2]->Fill(p3.Pt(), dcaCons); | |
599 | // } | |
600 | } | |
601 | ||
602 | if(!okTOF) | |
603 | { | |
604 | if(dcaCons == -999) | |
605 | { | |
606 | fhPtDCANoTOFHit[0]->Fill(p3.Pt(), dca[0]); | |
607 | fhPtDCANoTOFHit[1]->Fill(p3.Pt(), dca[1]); | |
608 | } | |
609 | else | |
610 | fhPtDCANoTOFHit[2]->Fill(p3.Pt(), dcaCons); | |
611 | ||
612 | // if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA) | |
613 | // { | |
614 | // if(dcaCons == -999) | |
615 | // { | |
616 | // fhPtDCAVtxOutBC0NoTOFHit[0]->Fill(p3.Pt(), dca[0]); | |
617 | // fhPtDCAVtxOutBC0NoTOFHit[1]->Fill(p3.Pt(), dca[1]); | |
618 | // } | |
619 | // else | |
620 | // fhPtDCAVtxOutBC0NoTOFHit[2]->Fill(p3.Pt(), dcaCons); | |
621 | // } | |
622 | ||
623 | if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD()) | |
624 | { | |
625 | if(dcaCons == -999) | |
626 | { | |
627 | fhPtDCAPileUpNoTOFHit[0]->Fill(p3.Pt(), dca[0]); | |
628 | fhPtDCAPileUpNoTOFHit[1]->Fill(p3.Pt(), dca[1]); | |
629 | } | |
630 | else | |
631 | fhPtDCAPileUpNoTOFHit[2]->Fill(p3.Pt(), dcaCons); | |
632 | ||
633 | // if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA) | |
634 | // { | |
635 | // if(dcaCons == -999) | |
636 | // { | |
637 | // fhPtDCAVtxOutBC0PileUpNoTOFHit[0]->Fill(p3.Pt(), dca[0]); | |
638 | // fhPtDCAVtxOutBC0PileUpNoTOFHit[1]->Fill(p3.Pt(), dca[1]); | |
639 | // } | |
640 | // else | |
641 | // fhPtDCAVtxOutBC0PileUpNoTOFHit[2]->Fill(p3.Pt(), dcaCons); | |
642 | // } | |
643 | } | |
644 | } | |
645 | ||
646 | //printf("track pT %2.2f, DCA Cons %f, DCA1 %f, DCA2 %f, TOFBC %d, oktof %d, tof %f\n", | |
647 | // p3.Pt(),dcaCons,dca[0],dca[1],track->GetTOFBunchCrossing(bz),okTOF, tof); | |
648 | ||
649 | Int_t trackBC = track->GetTOFBunchCrossing(bz); | |
650 | ||
651 | if(okTOF && trackBC==0) | |
652 | { | |
653 | fhTOFSignalBCOK->Fill(tof); | |
654 | ||
655 | if(dcaCons == -999) | |
656 | { | |
657 | fhPtDCATOFBC0[0]->Fill(p3.Pt(), dca[0]); | |
658 | fhPtDCATOFBC0[1]->Fill(p3.Pt(), dca[1]); | |
659 | } | |
660 | else | |
661 | fhPtDCATOFBC0[2]->Fill(p3.Pt(), dcaCons); | |
662 | ||
663 | if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD()) | |
664 | { | |
665 | if(dcaCons == -999) | |
666 | { | |
667 | fhPtDCAPileUpTOFBC0[0]->Fill(p3.Pt(), dca[0]); | |
668 | fhPtDCAPileUpTOFBC0[1]->Fill(p3.Pt(), dca[1]); | |
669 | } | |
670 | else | |
671 | fhPtDCAPileUpTOFBC0[2]->Fill(p3.Pt(), dcaCons); | |
672 | } | |
673 | } | |
674 | ||
675 | if(okTOF && fFillPileUpHistograms) | |
fe9615b9 | 676 | { |
677 | fhTOFSignal ->Fill(tof); | |
678 | fhPtTOFSignal->Fill(p3.Pt(), tof); | |
679 | ||
680 | if(GetReader()->IsPileUpFromSPD()) fhPtTOFSignalPileUp[0]->Fill(p3.Pt(), tof); | |
681 | if(GetReader()->IsPileUpFromEMCal()) fhPtTOFSignalPileUp[1]->Fill(p3.Pt(), tof); | |
682 | if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtTOFSignalPileUp[2]->Fill(p3.Pt(), tof); | |
683 | if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtTOFSignalPileUp[3]->Fill(p3.Pt(), tof); | |
684 | if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtTOFSignalPileUp[4]->Fill(p3.Pt(), tof); | |
685 | if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtTOFSignalPileUp[5]->Fill(p3.Pt(), tof); | |
686 | if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtTOFSignalPileUp[6]->Fill(p3.Pt(), tof); | |
fedea415 | 687 | |
688 | if (trackBC ==0) { fhEtaPhiTOFBC0 ->Fill(track->Eta(),track->Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiTOFBC0PileUpSPD ->Fill(track->Eta(),track->Phi()); } | |
689 | else if (trackBC < 0) { fhEtaPhiTOFBCPlus ->Fill(track->Eta(),track->Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiTOFBCPlusPileUpSPD ->Fill(track->Eta(),track->Phi()); } | |
690 | else if (trackBC > 0) { fhEtaPhiTOFBCMinus->Fill(track->Eta(),track->Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiTOFBCMinusPileUpSPD->Fill(track->Eta(),track->Phi()); } | |
691 | ||
fe9615b9 | 692 | } |
fedea415 | 693 | |
192689a4 | 694 | Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,"CTS") ; |
695 | ||
05d0d05d | 696 | if(GetDebug() > 1) |
192689a4 | 697 | printf("AliAnaChargedParticles::MakeAnalysisFillAOD() - Track pt %2.2f, phi %2.2f, eta %2.2f in fiducial cut %d\n",p3.Pt(), p3.Phi(), p3.Eta(),in); |
698 | ||
699 | //Acceptance selection | |
700 | if(IsFiducialCutOn() && ! in ) continue ; | |
701 | ||
702 | // Momentum selection | |
fe9615b9 | 703 | if(track->Pt() < GetMinPt() || track->Pt() > GetMaxPt()) continue; |
704 | ||
705 | if(okTOF) fhTOFSignalPtCut->Fill(tof); | |
706 | else | |
707 | { | |
708 | fhPtTOFStatus0 ->Fill(track->Pt()); | |
709 | fhEtaPhiTOFStatus0->Fill(track->Eta(),track->Phi()); | |
710 | } | |
192689a4 | 711 | |
8f467228 | 712 | Bool_t bITSRefit = (status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit; |
713 | Bool_t bConstrained = kFALSE; | |
41ebe136 | 714 | if (aodTrack) bConstrained = aodTrack->IsGlobalConstrained(); |
715 | else if(esdTrack) bConstrained = (!esdTrack->HasPointOnITSLayer(0) && !esdTrack->HasPointOnITSLayer(1)); | |
8f467228 | 716 | //printf("Track %d, pt %2.2f, eta %2.2f, phi %2.2f, SPDRefit %d, refit %d, dcaCons %2.2f\n", |
717 | // i, track->Pt(), track->Eta(), track->Phi(), bConstrained, bITSRefit, dcaCons); | |
718 | ||
719 | if(bConstrained) | |
720 | { | |
721 | if(bITSRefit) | |
722 | { | |
723 | fhPtNoSPDRefit->Fill(track->Pt()); | |
724 | if(track->Pt() < 2)fhEtaPhiNoSPDRefitPt02->Fill(track->Eta(),track->Phi()); | |
725 | if(track->Pt() > 3)fhEtaPhiNoSPDRefitPt3 ->Fill(track->Eta(),track->Phi()); | |
726 | ||
727 | if(dcaCons == -999) | |
728 | { | |
729 | fhPtDCANoSPDRefit[0]->Fill(p3.Pt(), dca[0]); | |
730 | fhPtDCANoSPDRefit[1]->Fill(p3.Pt(), dca[1]); | |
731 | } | |
732 | else | |
733 | fhPtDCANoSPDRefit[2]->Fill(p3.Pt(), dcaCons); | |
734 | ||
735 | } | |
736 | else | |
737 | { | |
738 | fhPtNoSPDNoRefit->Fill(track->Pt()); | |
739 | if(track->Pt() < 2)fhEtaPhiNoSPDNoRefitPt02->Fill(track->Eta(),track->Phi()); | |
740 | if(track->Pt() > 3)fhEtaPhiNoSPDNoRefitPt3 ->Fill(track->Eta(),track->Phi()); | |
741 | if(dcaCons == -999) | |
742 | { | |
743 | fhPtDCANoSPDNoRefit[0]->Fill(p3.Pt(), dca[0]); | |
744 | fhPtDCANoSPDNoRefit[1]->Fill(p3.Pt(), dca[1]); | |
745 | } | |
746 | else | |
747 | fhPtDCANoSPDNoRefit[2]->Fill(p3.Pt(), dcaCons); | |
748 | ||
749 | } | |
750 | } | |
751 | else | |
752 | { | |
753 | fhPtSPDRefit->Fill(track->Pt()); | |
754 | if(track->Pt() < 2)fhEtaPhiSPDRefitPt02->Fill(track->Eta(),track->Phi()); | |
755 | if(track->Pt() > 3)fhEtaPhiSPDRefitPt3 ->Fill(track->Eta(),track->Phi()); | |
756 | if(dcaCons == -999) | |
757 | { | |
758 | fhPtDCASPDRefit[0]->Fill(p3.Pt(), dca[0]); | |
759 | fhPtDCASPDRefit[1]->Fill(p3.Pt(), dca[1]); | |
760 | } | |
761 | else | |
762 | fhPtDCASPDRefit[2]->Fill(p3.Pt(), dcaCons); | |
763 | } | |
764 | ||
192689a4 | 765 | //Keep only particles identified with fPdg |
766 | //Selection not done for the moment | |
767 | //Should be done here. | |
768 | ||
769 | // Mixed event | |
fe9615b9 | 770 | if (GetMixedEvent()) |
771 | { | |
192689a4 | 772 | evtIndex = GetMixedEvent()->EventIndex(track->GetID()) ; |
fe9615b9 | 773 | } |
774 | ||
192689a4 | 775 | GetVertex(vert,evtIndex); |
776 | if(TMath::Abs(vert[2])> GetZvertexCut()) return; | |
777 | ||
778 | AliAODPWG4Particle tr = AliAODPWG4Particle(mom[0],mom[1],mom[2],0); | |
779 | tr.SetDetector("CTS"); | |
780 | tr.SetLabel(track->GetLabel()); | |
781 | tr.SetTrackLabel(track->GetID(),-1); | |
782 | tr.SetChargedBit(track->Charge()>0); | |
7cd4e982 | 783 | |
192689a4 | 784 | AddAODParticle(tr); |
785 | ||
477d6cee | 786 | }//loop |
787 | ||
788 | if(GetDebug() > 0) | |
a3aebfff | 789 | printf("AliAnaChargedParticles::MakeAnalysisFillAOD() - Final aod branch entries %d\n", GetOutputAODBranch()->GetEntriesFast()); |
477d6cee | 790 | } |
791 | ||
792 | //__________________________________________________________________ | |
793 | void AliAnaChargedParticles::MakeAnalysisFillHistograms() | |
794 | { | |
795 | //Do analysis and fill histograms | |
796 | ||
797 | //Loop on stored AODParticles | |
798 | Int_t naod = GetOutputAODBranch()->GetEntriesFast(); | |
05d0d05d | 799 | |
2244659d | 800 | fhNtracks->Fill(GetReader()->GetTrackMultiplicity()) ; |
05d0d05d | 801 | |
802 | if(GetDebug() > 0) | |
803 | printf("AliAnaChargedParticles::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod); | |
804 | ||
fedea415 | 805 | |
477d6cee | 806 | for(Int_t iaod = 0; iaod < naod ; iaod++){ |
807 | AliAODPWG4Particle* tr = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); | |
2244659d | 808 | |
477d6cee | 809 | fhPt->Fill(tr->Pt()); |
05d0d05d | 810 | |
811 | if(tr->GetChargedBit()){ | |
812 | fhPhiPos ->Fill(tr->Pt(), tr->Phi()); | |
b2fbc116 | 813 | fhEtaPos ->Fill(tr->Pt(), tr->Eta()); |
05d0d05d | 814 | fhEtaPhiPos->Fill(tr->Eta(),tr->Phi()); |
815 | } | |
816 | else{ | |
b2fbc116 | 817 | fhPhiNeg ->Fill(tr->Pt(), tr->Phi()); |
05d0d05d | 818 | fhEtaNeg ->Fill(tr->Pt(), tr->Eta()); |
819 | fhEtaPhiNeg->Fill(tr->Eta(),tr->Phi()); | |
820 | } | |
477d6cee | 821 | |
fedea415 | 822 | if(fFillPileUpHistograms) |
823 | { | |
824 | if(GetReader()->IsPileUpFromSPD()) {fhPtPileUp[0]->Fill(tr->Pt());} | |
825 | if(GetReader()->IsPileUpFromEMCal()) {fhPtPileUp[1]->Fill(tr->Pt());} | |
826 | if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtPileUp[2]->Fill(tr->Pt());} | |
827 | if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtPileUp[3]->Fill(tr->Pt());} | |
828 | if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtPileUp[4]->Fill(tr->Pt());} | |
829 | if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtPileUp[5]->Fill(tr->Pt());} | |
830 | if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(tr->Pt());} | |
831 | } | |
832 | ||
833 | ||
42b156e0 | 834 | if(IsDataMC()) |
835 | { | |
477d6cee | 836 | //Play with the MC stack if available |
5025c139 | 837 | Int_t mompdg = -1; |
42b156e0 | 838 | Int_t label = tr->GetLabel(); |
8c805178 | 839 | if(label >= 0) |
42b156e0 | 840 | { |
841 | if( GetReader()->ReadStack() && label < GetMCStack()->GetNtrack()) | |
842 | { | |
843 | TParticle * mom = GetMCStack()->Particle(label); | |
844 | mompdg =TMath::Abs(mom->GetPdgCode()); | |
845 | } | |
846 | else if(GetReader()->ReadAODMCParticles()) | |
847 | { | |
848 | AliAODMCParticle * aodmom = 0; | |
849 | //Get the list of MC particles | |
850 | aodmom = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(tr->GetInputFileIndex()))->At(label); | |
851 | mompdg =TMath::Abs(aodmom->GetPdgCode()); | |
852 | } | |
5025c139 | 853 | } |
854 | ||
42b156e0 | 855 | if(mompdg==211) |
856 | { | |
05d0d05d | 857 | fhPtPion ->Fill(tr->Pt()); |
5025c139 | 858 | fhPhiPion->Fill(tr->Pt(), tr->Phi()); |
859 | fhEtaPion->Fill(tr->Pt(), tr->Eta()); | |
477d6cee | 860 | } |
42b156e0 | 861 | else if(mompdg==2212) |
862 | { | |
05d0d05d | 863 | fhPtProton ->Fill(tr->Pt()); |
5025c139 | 864 | fhPhiProton->Fill(tr->Pt(), tr->Phi()); |
865 | fhEtaProton->Fill(tr->Pt(), tr->Eta()); | |
477d6cee | 866 | } |
42b156e0 | 867 | else if(mompdg==321) |
868 | { | |
05d0d05d | 869 | fhPtKaon ->Fill(tr->Pt()); |
5025c139 | 870 | fhPhiKaon->Fill(tr->Pt(), tr->Phi()); |
871 | fhEtaKaon->Fill(tr->Pt(), tr->Eta()); | |
477d6cee | 872 | } |
42b156e0 | 873 | else if(mompdg==11) |
874 | { | |
05d0d05d | 875 | fhPtElectron ->Fill(tr->Pt()); |
5025c139 | 876 | fhPhiElectron->Fill(tr->Pt(), tr->Phi()); |
877 | fhEtaElectron->Fill(tr->Pt(), tr->Eta()); | |
477d6cee | 878 | } |
879 | else { | |
5025c139 | 880 | //printf("unknown pdg %d\n",mompdg); |
05d0d05d | 881 | fhPtUnknown ->Fill(tr->Pt()); |
5025c139 | 882 | fhPhiUnknown->Fill(tr->Pt(), tr->Phi()); |
883 | fhEtaUnknown->Fill(tr->Pt(), tr->Eta()); | |
477d6cee | 884 | } |
05d0d05d | 885 | |
477d6cee | 886 | }//Work with stack also |
f6661bbc | 887 | |
477d6cee | 888 | }// aod branch loop |
889 | ||
890 | } |