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