]>
Commit | Line | Data |
---|---|---|
b938b7fc | 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, proviyaded 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 purapose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | ////////////////////////////////////////////////////////////////////////////// | |
17 | // // | |
18 | // Analysis task for the systematic study of the uncertainties related to // | |
19 | // the tracking and ITS-TPC matching efficiency for different particle // | |
20 | // species. // | |
21 | // // | |
22 | ////////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | ||
25 | #include "Riostream.h" | |
26 | #include "TH1F.h" | |
27 | #include "TH2D.h" | |
28 | #include "TH3F.h" | |
29 | #include "THn.h" | |
30 | #include "TList.h" | |
31 | #include "TMath.h" | |
32 | #include "TParticlePDG.h" | |
33 | // | |
34 | #include "AliAnalysisTaskSE.h" | |
35 | #include "AliAnalysisManager.h" | |
36 | #include "AliPID.h" | |
37 | #include "AliESDtrackCuts.h" | |
38 | #include "AliESDVertex.h" | |
39 | #include "AliESDEvent.h" | |
40 | #include "AliESDInputHandler.h" | |
41 | #include "AliESDtrack.h" | |
42 | #include "AliESDpid.h" | |
43 | #include "AliESDUtils.h" | |
44 | #include "AliMCEventHandler.h" | |
45 | #include "AliMCEvent.h" | |
46 | #include "AliStack.h" | |
47 | #include "AliLog.h" | |
48 | // | |
49 | #include "AliAnalysisTrackingUncertainties.h" | |
50 | ||
51 | ||
52 | ClassImp(AliAnalysisTrackingUncertainties) | |
53 | ||
54 | // histogram constants | |
55 | const Int_t kNumberOfAxes = 5; | |
56 | ||
57 | //________________________________________________________________________ | |
58 | AliAnalysisTrackingUncertainties::AliAnalysisTrackingUncertainties() | |
59 | : AliAnalysisTaskSE("TaskTestPA"), | |
60 | fESD(0), | |
61 | fESDpid(0), | |
62 | fUtils(0), | |
63 | fMCtrue(0), | |
64 | fListHist(0), | |
65 | fESDtrackCuts(0), | |
66 | fMatchTr(), | |
317abc03 | 67 | fMatchChi(), |
68 | fExcludeMomFromChi2ITSTPC(0) | |
b938b7fc | 69 | { |
70 | // default Constructor | |
71 | /* fast compilation test | |
72 | ||
73 | gSystem->Load("libANALYSIS"); | |
74 | gSystem->Load("libANALYSISalice"); | |
75 | .L AliAnalysisTrackingUncertainties.cxx++ | |
76 | */ | |
77 | } | |
78 | ||
79 | ||
80 | //________________________________________________________________________ | |
81 | AliAnalysisTrackingUncertainties::AliAnalysisTrackingUncertainties(const char *name) | |
82 | : AliAnalysisTaskSE(name), | |
83 | fESD(0), | |
84 | fESDpid(0), | |
85 | fUtils(0), | |
86 | fMCtrue(0), | |
87 | fListHist(0), | |
88 | fESDtrackCuts(0), | |
89 | fMatchTr(), | |
317abc03 | 90 | fMatchChi(), |
91 | fExcludeMomFromChi2ITSTPC(0) | |
b938b7fc | 92 | { |
93 | // | |
94 | // standard constructur which should be used | |
95 | // | |
96 | fMCtrue = kTRUE; | |
97 | // | |
98 | // create track cuts | |
99 | // | |
100 | fESDtrackCuts = new AliESDtrackCuts("AliESDtrackCuts","AliESDtrackCuts"); | |
101 | fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE); | |
102 | fESDtrackCuts->SetEtaRange(-1., 1.); | |
103 | // | |
104 | // analysis utils if needed | |
105 | // | |
106 | fUtils = new AliAnalysisUtils(); | |
107 | // | |
108 | ||
109 | // Output slot #0 writes into a TList container | |
110 | DefineOutput(1, TList::Class()); | |
111 | ||
112 | } | |
113 | ||
114 | ||
115 | //________________________________________________________________________ | |
116 | void AliAnalysisTrackingUncertainties::UserCreateOutputObjects() | |
117 | { | |
118 | // | |
119 | // Create histograms | |
120 | // Called once | |
121 | // | |
122 | fListHist = new TList(); | |
123 | fListHist->SetOwner(kTRUE); | |
124 | // | |
a95c2a62 | 125 | // (1.) basic QA and statistics histograms |
b938b7fc | 126 | // |
127 | TH2F * histVertexSelection = new TH2F("histVertexSelection", "vertex selection; vertex z (cm); accepted/rejected", 100, -50., 50., 2, -0.5, 1.5); | |
128 | fListHist->Add(histVertexSelection); | |
129 | // | |
a95c2a62 | 130 | // (2.) track cut variation histograms |
131 | // | |
b938b7fc | 132 | InitializeTrackCutHistograms(); |
133 | // | |
a95c2a62 | 134 | // (3.) ITS -> TPC matching histograms |
135 | // | |
317abc03 | 136 | // Int_t binsMatch[kNumberOfAxes] = { 10, 50, 20, 18, 6}; |
137 | // Double_t minMatch[kNumberOfAxes] = { 0, 0.1, -1, 0, -0.5}; | |
138 | // Double_t maxMatch[kNumberOfAxes] = {200, 20, +1, 2*TMath::Pi(), 5.5}; | |
a95c2a62 | 139 | // |
317abc03 | 140 | // TString axisNameMatch[kNumberOfAxes] = {"matchChi2","pT","eta","phi","pid"}; |
141 | // TString axisTitleMatch[kNumberOfAxes] = {"matchChi2","pT","eta","phi","pid"}; | |
a95c2a62 | 142 | // |
317abc03 | 143 | // THnF * hBestMatch = new THnF("hBestMatch","ITS -> TPC matching ",kNumberOfAxes, binsMatch, minMatch, maxMatch); |
144 | // for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){ | |
145 | // hBestMatch->GetAxis(iaxis)->SetName(axisNameMatch[iaxis]); | |
146 | // hBestMatch->GetAxis(iaxis)->SetTitle(axisTitleMatch[iaxis]); | |
147 | // } | |
148 | // BinLogAxis(hBestMatch, 1); | |
149 | // fListHist->Add(hBestMatch); | |
a95c2a62 | 150 | // |
b938b7fc | 151 | // |
b938b7fc | 152 | // |
153 | const int nbPt=40; | |
154 | const double ptMax=5; | |
155 | // | |
156 | TH2F * hNMatch = new TH2F("hNMatch","N Matches",nbPt,0,ptMax,kMaxMatch+1,-0.5,kMaxMatch+0.5); | |
317abc03 | 157 | TH2F * hBestMatch = new TH2F("hBestMatch","Best Match Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2); // OB |
158 | TH2F * hBestMatch_cuts = new TH2F("hBestMatch_cuts","Best Match Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2); | |
b938b7fc | 159 | TH2F * hAllMatch = new TH2F("hAllMatch","All Matches Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2); |
160 | TH2F * hAllMatchGlo = new TH2F("hAllMatchGlo","All Matches Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2); | |
317abc03 | 161 | TH2F * hPtCorr_ITSTPC = new TH2F("hPtCorr_ITSTPC","PtCorr",nbPt,0,ptMax,nbPt,0,ptMax); |
162 | TH2F * hdPtRel_ITSTPC = new TH2F("hdPtRel_ITSTPC","dPt/pt",nbPt,0,ptMax,2*nbPt+1,-0.4*ptMax,0.4*ptMax); | |
163 | TH2F * hdInvPtRel_ITSTPC = new TH2F("hdInvPtRel_ITSTPC","pt*dPt^{-1}",nbPt,0,ptMax,2*nbPt+1,-0.4*ptMax,0.4*ptMax); | |
164 | // | |
b938b7fc | 165 | fListHist->Add(hNMatch); |
317abc03 | 166 | fListHist->Add(hBestMatch); |
167 | fListHist->Add(hBestMatch_cuts); | |
b938b7fc | 168 | fListHist->Add(hAllMatch); |
169 | fListHist->Add(hAllMatchGlo); | |
317abc03 | 170 | fListHist->Add(hPtCorr_ITSTPC); |
171 | fListHist->Add(hdPtRel_ITSTPC); | |
172 | fListHist->Add(hdInvPtRel_ITSTPC); | |
173 | // | |
b938b7fc | 174 | // |
175 | TH2F * hNMatchBg = new TH2F("hNMatchBg","N Matches",nbPt,0,ptMax,kMaxMatch+1,-0.5,kMaxMatch+0.5); | |
176 | TH2F * hBestMatchBg = new TH2F("hBestMatchBg","Best Match Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2); | |
317abc03 | 177 | TH2F * hBestMatchBg_cuts = new TH2F("hBestMatchBg_cuts","Best Match Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2); // OB |
b938b7fc | 178 | TH2F * hAllMatchBg = new TH2F("hAllMatchBg","All Matches Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2); |
179 | TH2F * hAllMatchGloBg = new TH2F("hAllMatchGloBg","All Matches Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2); | |
317abc03 | 180 | TH2F * hdPtRelBg_ITSTPC = new TH2F("hdPtRelBg_ITSTPC","dPt/pt",nbPt,0,ptMax,2*nbPt+1,-0.4*ptMax,0.4*ptMax); |
181 | TH2F * hdInvPtRelBg_ITSTPC = new TH2F("hdInvPtRelBg_ITSTPC","pt*dPt^{-1}",nbPt,0,ptMax,2*nbPt+1,-0.4*ptMax,0.4*ptMax); | |
182 | ||
183 | //cout<<" here 0 : hdPtRelBg_ITSTPC "<<hdPtRelBg_ITSTPC<<" hdInvPtRelBg_ITSTPC "<<hdInvPtRelBg_ITSTPC<<endl; | |
184 | ||
b938b7fc | 185 | fListHist->Add(hNMatchBg); |
186 | fListHist->Add(hBestMatchBg); | |
317abc03 | 187 | fListHist->Add(hBestMatchBg_cuts); |
b938b7fc | 188 | fListHist->Add(hAllMatchBg); |
189 | fListHist->Add(hAllMatchGloBg); | |
317abc03 | 190 | fListHist->Add(hdPtRelBg_ITSTPC); |
191 | fListHist->Add(hdInvPtRelBg_ITSTPC); | |
8ea0d018 | 192 | //add default track cuts in the output list |
193 | fListHist->Add(fESDtrackCuts); | |
b938b7fc | 194 | // |
195 | // post data | |
196 | // | |
197 | PostData(1, fListHist); | |
198 | ||
199 | ||
200 | } | |
201 | ||
202 | ||
203 | ||
204 | //________________________________________________________________________ | |
205 | void AliAnalysisTrackingUncertainties::UserExec(Option_t *) | |
206 | { | |
207 | // | |
208 | // main event loop | |
209 | // | |
210 | fESD = dynamic_cast<AliESDEvent*>( InputEvent() ); | |
211 | if (!fESD) { | |
212 | PostData(1, fListHist); | |
213 | return; | |
214 | } | |
215 | // | |
216 | if (!fESDpid) fESDpid = ((AliESDInputHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetESDpid(); | |
217 | // | |
218 | // Check Monte Carlo information and other access first: | |
219 | // | |
220 | AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
221 | if (!eventHandler) { | |
222 | fMCtrue = kFALSE; | |
223 | } | |
224 | // | |
225 | // extract generated particles information | |
226 | // | |
227 | AliMCEvent* mcEvent = 0x0; | |
228 | AliStack* stack = 0x0; | |
229 | if (eventHandler) mcEvent = eventHandler->MCEvent(); | |
230 | if (!mcEvent) { | |
231 | if (fMCtrue) return; | |
232 | } | |
233 | if (fMCtrue) { | |
234 | // | |
235 | stack = mcEvent->Stack(); | |
236 | if (!stack) return; | |
237 | // | |
238 | for(Int_t i = 0; i < stack->GetNtrack(); i++) { | |
239 | /* at the moment nothing is needed here | |
240 | TParticle * trackMC = stack->Particle(i); | |
241 | Double_t rap = trackMC->Eta(); | |
242 | Double_t y = trackMC->Y(); | |
243 | Double_t pT = trackMC->Pt(); | |
244 | */ | |
245 | // | |
246 | } | |
247 | ||
248 | } | |
249 | // | |
250 | if (!fESDtrackCuts) { | |
251 | PostData(1, fListHist); | |
252 | return; | |
253 | } | |
254 | // | |
255 | // monitor vertex position and selection | |
256 | // | |
257 | TH2F * histVertexSelection = (TH2F *) fListHist->FindObject("histVertexSelection"); | |
258 | // | |
259 | Float_t vertexZ = 0.; | |
260 | if (IsVertexAccepted(fESD, vertexZ)) { | |
261 | histVertexSelection->Fill(vertexZ, 0); | |
262 | } else { | |
263 | histVertexSelection->Fill(vertexZ, 1); | |
264 | return; | |
265 | } | |
266 | // | |
267 | // fill track cut variation histograms | |
268 | // | |
269 | ProcessTrackCutVariation(); | |
270 | // | |
271 | // fill ITS->TPC matching histograms | |
272 | // | |
273 | ProcessItsTpcMatching(); | |
274 | ||
275 | // Post output data | |
276 | PostData(1, fListHist); | |
277 | ||
278 | } | |
279 | ||
280 | ||
281 | //________________________________________________________________________ | |
282 | void AliAnalysisTrackingUncertainties::ProcessItsTpcMatching(){ | |
283 | // | |
284 | // check how many its-sa tracks get matched to TPC | |
285 | // | |
286 | int ntr = fESD->GetNumberOfTracks(); | |
287 | // | |
288 | // initialize histograms | |
289 | // | |
317abc03 | 290 | TH2F * hNMatch = (TH2F*) fListHist->FindObject("hNMatch"); |
291 | TH2F * hBestMatch = (TH2F*) fListHist->FindObject("hBestMatch"); | |
292 | TH2F * hBestMatch_cuts = (TH2F*) fListHist->FindObject("hBestMatch_cuts"); | |
293 | TH2F * hAllMatch = (TH2F*) fListHist->FindObject("hAllMatch"); | |
294 | TH2F * hAllMatchGlo = (TH2F*) fListHist->FindObject("hAllMatchGlo"); | |
295 | TH2F * hPtCorr_ITSTPC = (TH2F*) fListHist->FindObject("hPtCorr_ITSTPC"); | |
296 | TH2F * hdPtRel_ITSTPC = (TH2F*) fListHist->FindObject("hdPtRel_ITSTPC"); | |
297 | TH2F * hdInvPtRel_ITSTPC = (TH2F*) fListHist->FindObject("hdInvPtRel_ITSTPC"); | |
298 | ||
b938b7fc | 299 | // |
317abc03 | 300 | TH2F * hNMatchBg = (TH2F*) fListHist->FindObject("hNMatchBg"); |
301 | TH2F * hBestMatchBg = (TH2F*) fListHist->FindObject("hBestMatchBg"); | |
302 | TH2F * hBestMatchBg_cuts = (TH2F*) fListHist->FindObject("hBestMatchBg_cuts"); | |
303 | TH2F * hAllMatchBg = (TH2F*) fListHist->FindObject("hAllMatchBg"); | |
304 | TH2F * hAllMatchGloBg = (TH2F*) fListHist->FindObject("hAllMatchGloBg"); | |
305 | TH2F * hdPtRelBg_ITSTPC = (TH2F*) fListHist->FindObject("hdPtRelBg_ITSTPC"); | |
306 | TH2F * hdInvPtRelBg_ITSTPC = (TH2F*) fListHist->FindObject("hdInvPtRelBg_ITSTPC"); | |
307 | ||
308 | //cout<<" here 1: hdPtRelBg_ITSTPC "<<hdPtRelBg_ITSTPC<<" hdInvPtRelBg_ITSTPC "<<hdInvPtRelBg_ITSTPC<<endl; | |
309 | ||
b938b7fc | 310 | // |
311 | for (int it=0;it<ntr;it++) { | |
312 | AliESDtrack* trSA = fESD->GetTrack(it); | |
313 | if (!trSA->IsOn(AliESDtrack::kITSpureSA) || !trSA->IsOn(AliESDtrack::kITSrefit)) continue; | |
314 | double pt = trSA->Pt(); | |
317abc03 | 315 | |
316 | // OB - fiducial eta and pt cuts | |
317 | Double_t etaSA = trSA->Eta(); | |
318 | // std::cout<<" etaSA "<<etaSA<<std::endl; // eta range up to +/- 1.4 | |
319 | ||
320 | Double_t ptSA = trSA->Pt(); | |
321 | ||
322 | if(TMath::Abs(etaSA)>0.8) continue; | |
323 | ||
b938b7fc | 324 | // |
325 | Int_t nmatch = 0; | |
317abc03 | 326 | for (int i=kMaxMatch;i--;) {fMatchChi[i]=0; fMatchTr[i]=0;} |
327 | for (int it1=0;it1<ntr;it1++){ | |
328 | ||
329 | //std::cout<<" here 0, it1 "<<it1<<" it "<<it<<std::endl; | |
330 | ||
b938b7fc | 331 | if (it1==it) continue; |
317abc03 | 332 | |
333 | //std::cout<<" here 2, it1 "<<it1<<" it "<<it<<std::endl; | |
334 | ||
b938b7fc | 335 | AliESDtrack* trESD = fESD->GetTrack(it1); |
336 | if (!trESD->IsOn(AliESDtrack::kTPCrefit)) continue; | |
317abc03 | 337 | |
338 | //std::cout<<" call match: it1 "<<it1<<" it "<<it<<" nmatch "<<nmatch<<std::endl; | |
339 | Match(trSA,trESD, nmatch, fExcludeMomFromChi2ITSTPC); | |
340 | //std::cout<<" left match: it1 "<<it1<<" it "<<it<<" nmatch "<<nmatch<<std::endl; | |
b938b7fc | 341 | } |
342 | // | |
317abc03 | 343 | |
344 | // std::cout<<" if "<<it<<" filling nmatch "<<nmatch<<" best chi2 "<<fMatchChi[0]<<std::endl; | |
345 | ||
b938b7fc | 346 | hNMatch->Fill(pt,nmatch); |
317abc03 | 347 | if (nmatch>0){ |
348 | hBestMatch->Fill(pt,fMatchChi[0]); | |
349 | hPtCorr_ITSTPC->Fill(pt,fMatchTr[0]->Pt()); | |
350 | hdPtRel_ITSTPC->Fill(pt,(pt-fMatchTr[0]->Pt())/pt); | |
351 | hdInvPtRel_ITSTPC->Fill(pt,pt*( 1/pt - (1/fMatchTr[0]->Pt()) )); | |
a95c2a62 | 352 | } |
353 | // | |
b938b7fc | 354 | for (int imt=nmatch;imt--;) { |
355 | hAllMatch->Fill(pt,fMatchChi[imt]); | |
356 | if (fMatchTr[imt]->IsOn(AliESDtrack::kITSrefit)) hAllMatchGlo->Fill(pt,fMatchChi[imt]); | |
357 | } | |
358 | // | |
359 | nmatch = 0; | |
360 | for (int i=kMaxMatch;i--;) {fMatchChi[i]=0; fMatchTr[i]=0;} | |
361 | for (int it1=0;it1<ntr;it1++) { | |
362 | if (it1==it) continue; | |
363 | AliESDtrack* trESD = fESD->GetTrack(it1); | |
364 | if (!trESD->IsOn(AliESDtrack::kTPCrefit)) continue; | |
317abc03 | 365 | Match(trSA,trESD, nmatch, fExcludeMomFromChi2ITSTPC, TMath::Pi()); |
b938b7fc | 366 | } |
367 | // | |
368 | hNMatchBg->Fill(pt,nmatch); | |
317abc03 | 369 | if (nmatch>0){ |
370 | hBestMatchBg->Fill(pt,fMatchChi[0]); | |
371 | hdPtRelBg_ITSTPC->Fill(pt,(pt-fMatchTr[0]->Pt())/pt); | |
372 | hdInvPtRelBg_ITSTPC->Fill(pt,pt*( 1/pt - (1/fMatchTr[0]->Pt()) )); | |
373 | } | |
374 | ||
375 | if (nmatch>0 && fESDtrackCuts){ | |
376 | if(fESDtrackCuts->AcceptTrack(fMatchTr[0])){ | |
377 | hBestMatchBg_cuts->Fill(pt,fMatchChi[0]); | |
378 | } | |
379 | } | |
380 | ||
b938b7fc | 381 | for (int imt=nmatch;imt--;) { |
382 | hAllMatchBg->Fill(pt,fMatchChi[imt]); | |
383 | if (fMatchTr[imt]->IsOn(AliESDtrack::kITSrefit)) hAllMatchGloBg->Fill(pt,fMatchChi[imt]); | |
384 | } | |
385 | // | |
386 | } | |
387 | ||
388 | ||
389 | } | |
390 | ||
391 | ||
317abc03 | 392 | void AliAnalysisTrackingUncertainties::Match(const AliESDtrack* tr0, const AliESDtrack* tr1, Int_t& nmatch, |
393 | Bool_t excludeMom, Double_t rotate) { | |
b938b7fc | 394 | // |
395 | // check if two tracks are matching, possible rotation for combinatoric backgr. | |
396 | // | |
397 | Float_t bField = fESD->GetMagneticField(); | |
398 | // | |
399 | const AliExternalTrackParam* trtpc0 = tr1->GetInnerParam(); | |
400 | if (!trtpc0) return; | |
401 | AliExternalTrackParam trtpc(*trtpc0); | |
402 | // | |
403 | if (TMath::Abs(rotate)>1e-5) { | |
404 | const double *par = trtpc.GetParameter(); | |
405 | const double *cov = trtpc.GetCovariance(); | |
406 | double alp = trtpc.GetAlpha() + rotate; | |
407 | trtpc.Set(trtpc.GetX(),alp,par,cov); | |
408 | } | |
409 | // | |
410 | if (!trtpc.Rotate(tr0->GetAlpha())) return; | |
411 | if (!trtpc.PropagateTo(tr0->GetX(),bField)) return; | |
412 | double chi2 = tr0->GetPredictedChi2(&trtpc); | |
317abc03 | 413 | |
414 | //std::cout<<" in Match, nmatch "<<nmatch<<" par[4] before "<<trtpc.GetParameter()[4]<<" chi2 "<<chi2<<endl; | |
415 | ||
416 | // OB chi2 excluding pt | |
417 | if(excludeMom){ | |
418 | ((double*)trtpc.GetParameter())[4] = tr0->GetParameter()[4]; // set ITS mom equal TPC mom | |
419 | chi2 = tr0->GetPredictedChi2(&trtpc); | |
420 | ||
421 | //std::cout<<" in Match, nmatch "<<nmatch<<" par[4] after "<<trtpc.GetParameter()[4]<<" tr0 mom "<<tr0->GetParameter()[4] | |
422 | // <<" chi2 "<<chi2<<std::endl; | |
423 | } | |
424 | ||
425 | ||
b938b7fc | 426 | if (chi2>kMaxChi2) return; |
317abc03 | 427 | |
428 | // std::cout<<" found good match, tr1 "<<tr1<<" chi2 "<<chi2<<std::endl; | |
429 | // std::cout<<" before: fMatchChi[0] "<<fMatchChi[0]<<" [1] "<<fMatchChi[1] | |
430 | // <<" [2] "<<fMatchChi[2]<<" [3] "<<fMatchChi[3] | |
431 | // <<" [4] "<<fMatchChi[4]<<std::endl; | |
432 | ||
433 | // std::cout<<" before: fMatchTr[0] "<<fMatchTr[0]<<" [1] "<<fMatchTr[1] | |
434 | // <<" [2] "<<fMatchTr[2]<<" [3] "<<fMatchTr[3] | |
435 | // <<" [4] "<<fMatchTr[4]<<std::endl; | |
436 | ||
b938b7fc | 437 | // |
438 | int ins; | |
439 | for (ins=0;ins<nmatch;ins++) if (chi2<fMatchChi[ins]) break; | |
440 | if (ins>=kMaxMatch) return; | |
441 | ||
442 | for (int imv=nmatch;imv>ins;imv--) { | |
443 | if (imv>=kMaxMatch) continue; | |
444 | fMatchTr[imv] = fMatchTr[imv-1]; | |
445 | fMatchChi[imv] = fMatchChi[imv-1]; | |
446 | } | |
447 | fMatchTr[ins] = tr1; | |
448 | fMatchChi[ins] = chi2; | |
449 | nmatch++; | |
450 | if (nmatch>=kMaxMatch) nmatch = kMaxMatch; | |
451 | // | |
452 | } | |
453 | ||
454 | ||
455 | //________________________________________________________________________ | |
456 | void AliAnalysisTrackingUncertainties::ProcessTrackCutVariation() { | |
457 | // | |
458 | // fill track cut variation histograms - undo cuts step-by-step and fill histograms | |
459 | // | |
460 | // | |
461 | // initialize histograms | |
462 | // | |
a95c2a62 | 463 | THnF * histNcl = (THnF *) fListHist->FindObject("histNcl"); |
464 | THnF * histChi2Tpc = (THnF *) fListHist->FindObject("histChi2Tpc"); | |
465 | THnF * histDcaZ = (THnF *) fListHist->FindObject("histDcaZ"); | |
466 | THnF * histSpd = (THnF *) fListHist->FindObject("histSpd"); | |
467 | THnF * histNcr = (THnF *) fListHist->FindObject("histNcr"); | |
468 | THnF * histCRoverFC = (THnF *) fListHist->FindObject("histCRoverFC"); | |
469 | THnF * histChi2Its = (THnF *) fListHist->FindObject("histChi2Its"); | |
470 | THnF * histTpcLength = (THnF *) fListHist->FindObject("histTpcLength"); | |
471 | THnF * histTpcItsMatch = (THnF *) fListHist->FindObject("histTpcItsMatch"); | |
b938b7fc | 472 | // |
473 | Float_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z for the vertex cut | |
474 | // | |
475 | for (Int_t i=0;i<fESD->GetNumberOfTracks();++i) { | |
476 | // | |
477 | AliESDtrack *track =fESD->GetTrack(i); | |
478 | // | |
479 | // relevant variables | |
480 | // | |
8ea0d018 | 481 | //Double_t pid = Double_t(GetPid(track)); |
a95c2a62 | 482 | // |
483 | Int_t nclsTPC = track->GetTPCncls(); | |
484 | Float_t pT = track->Pt(); | |
485 | Float_t eta = track->Eta(); | |
486 | Float_t phi = track->Phi(); | |
487 | Float_t chi2TPC = track->GetTPCchi2(); | |
488 | Float_t ncrTPC = track->GetTPCCrossedRows(); | |
489 | Int_t nclsTPCF = track->GetTPCNclsF(); | |
490 | Float_t nCRoverFC = track->GetTPCCrossedRows(); | |
491 | Double_t chi2ITS = track->GetITSchi2(); | |
492 | Int_t nclsITS = track->GetITSclusters(0); | |
493 | Float_t tpcLength = 0.; | |
494 | ||
495 | if (track->GetInnerParam() && track->GetESDEvent()) { | |
496 | tpcLength = track->GetLengthInActiveZone(1, 1.8, 220, track->GetESDEvent()->GetMagneticField()); | |
497 | } | |
498 | ||
b938b7fc | 499 | if (nclsTPC != 0) { |
500 | chi2TPC /= nclsTPC; | |
501 | } else { | |
502 | chi2TPC = 999.; | |
503 | } | |
a95c2a62 | 504 | |
505 | if (nclsTPCF !=0) { | |
506 | nCRoverFC /= nclsTPCF; | |
507 | } else { | |
508 | nCRoverFC = 999.; | |
509 | } | |
510 | ||
511 | if (nclsITS != 0){ | |
512 | chi2ITS /= nclsITS; | |
513 | }else { | |
514 | chi2ITS = 999.; | |
515 | } | |
b938b7fc | 516 | // |
517 | track->GetImpactParameters(dca, cov); | |
518 | // | |
519 | // (1.) fill number of clusters histogram | |
520 | // | |
521 | Int_t minNclsTPC = fESDtrackCuts->GetMinNClusterTPC(); | |
522 | fESDtrackCuts->SetMinNClustersTPC(0); | |
523 | if (fESDtrackCuts->AcceptTrack(track)) { | |
a95c2a62 | 524 | for(Int_t iPid = 0; iPid < 6; iPid++) { |
525 | Double_t vecHistNcl[kNumberOfAxes] = {nclsTPC, pT, eta, phi, iPid}; | |
526 | if (IsConsistentWithPid(iPid, track)) histNcl->Fill(vecHistNcl); | |
527 | } | |
b938b7fc | 528 | } |
529 | fESDtrackCuts->SetMinNClustersTPC(minNclsTPC); | |
530 | // | |
531 | // (2.) fill chi2 TPC histogram | |
532 | // | |
533 | Float_t maxChi2 = fESDtrackCuts->GetMaxChi2PerClusterTPC(); | |
534 | fESDtrackCuts->SetMaxChi2PerClusterTPC(999.); | |
535 | if (fESDtrackCuts->AcceptTrack(track)) { | |
a95c2a62 | 536 | for(Int_t iPid = 0; iPid < 6; iPid++) { |
537 | Double_t vecHistChi2Tpc[kNumberOfAxes] = {chi2TPC, pT, eta, phi, iPid}; | |
538 | if (IsConsistentWithPid(iPid, track)) histChi2Tpc->Fill(vecHistChi2Tpc); | |
539 | } | |
b938b7fc | 540 | } |
541 | fESDtrackCuts->SetMaxChi2PerClusterTPC(maxChi2); | |
542 | // | |
543 | // (3.) fill dca_z histogram | |
544 | // | |
545 | Float_t maxDcaZ = fESDtrackCuts->GetMaxDCAToVertexZ(); | |
546 | fESDtrackCuts->SetMaxDCAToVertexZ(999.); | |
547 | if (fESDtrackCuts->AcceptTrack(track)) { | |
a95c2a62 | 548 | for(Int_t iPid = 0; iPid < 6; iPid++) { |
549 | Double_t vecHistDcaZ[kNumberOfAxes] = {TMath::Abs(dca[1]), pT, eta, phi, iPid}; | |
550 | if (IsConsistentWithPid(iPid, track)) histDcaZ->Fill(vecHistDcaZ); | |
551 | } | |
b938b7fc | 552 | } |
553 | fESDtrackCuts->SetMaxDCAToVertexZ(maxDcaZ); | |
554 | // | |
555 | // (4.) fill hit in SPD histogram | |
556 | // | |
48b2ef2f | 557 | fESDtrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff); |
b938b7fc | 558 | if (fESDtrackCuts->AcceptTrack(track)) { |
559 | Int_t hasPoint = 0; | |
560 | if (track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)) hasPoint = 1; | |
a95c2a62 | 561 | for(Int_t iPid = 0; iPid < 6; iPid++) { |
562 | Double_t vecHistSpd[kNumberOfAxes] = {hasPoint, pT, eta, phi, iPid}; | |
563 | if (IsConsistentWithPid(iPid, track)) histSpd->Fill(vecHistSpd); | |
564 | } | |
b938b7fc | 565 | } |
566 | fESDtrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny); | |
a95c2a62 | 567 | // |
568 | // (5.) fill number of crossed rows histogram | |
569 | // | |
570 | //Int_t minNcrTPC = fESDtrackCuts->GetMinNCrossedRowsTPC(); //wait for getter in ESDtrackCuts | |
571 | Int_t minNcrTPC = 0; //for now use standard value from 2010 !! | |
572 | fESDtrackCuts->SetMinNCrossedRowsTPC(0); | |
573 | if (fESDtrackCuts->AcceptTrack(track)) { | |
574 | for(Int_t iPid = 0; iPid < 6; iPid++) { | |
575 | Double_t vecHistNcr[kNumberOfAxes] = {ncrTPC, pT, eta, phi, iPid}; | |
576 | if (IsConsistentWithPid(iPid, track)) histNcr->Fill(vecHistNcr); | |
577 | } | |
578 | } | |
579 | fESDtrackCuts->SetMinNCrossedRowsTPC(minNcrTPC); | |
580 | // | |
581 | // (6.) fill crossed rows over findable clusters histogram | |
582 | // | |
583 | //Int_t minCRoverFC = fESDtrackCuts->GetMinRatioCrossedRowsOverFindableClustersTPC(); //wait for getter in ESDtrackCuts | |
584 | Int_t minCRoverFC = 0.; //for now use standard value from 2010 !! | |
585 | fESDtrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.); | |
586 | if (fESDtrackCuts->AcceptTrack(track)) { | |
587 | for(Int_t iPid = 0; iPid < 6; iPid++) { | |
588 | Double_t vecHistCRoverFC[kNumberOfAxes] = {nCRoverFC, pT, eta, phi, iPid}; | |
589 | if (IsConsistentWithPid(iPid, track)) histCRoverFC->Fill(vecHistCRoverFC); | |
590 | } | |
591 | } | |
592 | fESDtrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(minCRoverFC); | |
593 | // | |
594 | // (7.) fill chi2 ITS histogram | |
595 | // | |
596 | Float_t maxChi2ITS = fESDtrackCuts->GetMaxChi2PerClusterITS(); | |
597 | fESDtrackCuts->SetMaxChi2PerClusterITS(999.); | |
598 | if (fESDtrackCuts->AcceptTrack(track)) { | |
599 | for(Int_t iPid = 0; iPid < 6; iPid++) { | |
600 | Double_t vecHistChi2ITS[kNumberOfAxes] = {chi2ITS, pT, eta, phi, iPid}; | |
601 | if (IsConsistentWithPid(iPid, track)) histChi2Its->Fill(vecHistChi2ITS); | |
602 | } | |
603 | } | |
604 | fESDtrackCuts->SetMaxChi2PerClusterITS(maxChi2ITS); | |
605 | // | |
606 | // (8.) fill active length in TPC histogram | |
607 | // | |
608 | Int_t minTpcLength = fESDtrackCuts->GetMinLengthActiveVolumeTPC(); | |
609 | fESDtrackCuts->SetMinLengthActiveVolumeTPC(0); | |
610 | if (fESDtrackCuts->AcceptTrack(track)) { | |
611 | for(Int_t iPid = 0; iPid < 6; iPid++) { | |
612 | Double_t vecHistTpcLength[kNumberOfAxes] = {tpcLength, pT, eta, phi, iPid}; | |
613 | if (IsConsistentWithPid(iPid, track)) histTpcLength->Fill(vecHistTpcLength); | |
614 | } | |
615 | } | |
616 | fESDtrackCuts->SetMinLengthActiveVolumeTPC(minTpcLength); | |
617 | // | |
618 | // (9.) fill TPC->ITS matching efficiency histogram | |
619 | // | |
620 | Bool_t isMatched = kFALSE; | |
621 | // remove all ITS requirements | |
622 | // | |
623 | // Leonardo and Emilia: | |
8ea0d018 | 624 | // -> if MC is available: fill it only for true primaries, |
625 | // --to be done for every cut? | |
a95c2a62 | 626 | // -> Postprocessing: plot histogram with 1 divided by histogram with 0 as a function of pT/eta/phi |
8ea0d018 | 627 | // -> Do we want to remove the DCA cut? |
628 | Bool_t refit=fESDtrackCuts->GetRequireITSRefit(); | |
629 | Float_t chi2tpc= fESDtrackCuts->GetMaxChi2TPCConstrainedGlobal(); | |
630 | Float_t chi2its= fESDtrackCuts->GetMaxChi2PerClusterITS(); | |
631 | //TString str = fESDtrackCuts->GetMaxDCAToVertexXYPtDep(); | |
632 | ||
a95c2a62 | 633 | fESDtrackCuts->SetRequireITSRefit(kFALSE); |
a95c2a62 | 634 | fESDtrackCuts->SetMaxChi2TPCConstrainedGlobal(99999.); |
635 | fESDtrackCuts->SetMaxChi2PerClusterITS(999999.); | |
8ea0d018 | 636 | //TString str = fESDtrackCuts->GetMaxDCAToVertexXYPtDep(); |
637 | //fESDtrackCuts->SetMaxDCAToVertexXYPtDep(); | |
638 | fESDtrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff); | |
639 | ||
640 | if (fESDtrackCuts->AcceptTrack(track)) { | |
641 | for(Int_t iPid = 0; iPid < 6; iPid++) { | |
642 | Double_t vecHistTpcItsMatch[kNumberOfAxes] = {isMatched, pT, eta, phi, iPid}; | |
643 | if (IsConsistentWithPid(iPid, track)) histTpcItsMatch->Fill(vecHistTpcItsMatch); // fill with 1 here | |
644 | } | |
645 | } | |
646 | //apply back the cuts | |
647 | fESDtrackCuts->SetRequireITSRefit(refit); | |
648 | fESDtrackCuts->SetMaxChi2TPCConstrainedGlobal(chi2tpc); | |
649 | fESDtrackCuts->SetMaxChi2PerClusterITS(chi2its); | |
650 | //fESDtrackCuts->SetMaxDCAToVertexXYPtDep(str.Data()); | |
651 | fESDtrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny); | |
652 | //set is matched | |
653 | isMatched=kTRUE; | |
a95c2a62 | 654 | if (fESDtrackCuts->AcceptTrack(track)) { |
a95c2a62 | 655 | for(Int_t iPid = 0; iPid < 6; iPid++) { |
656 | Double_t vecHistTpcItsMatch[kNumberOfAxes] = {isMatched, pT, eta, phi, iPid}; | |
657 | if (IsConsistentWithPid(iPid, track)) histTpcItsMatch->Fill(vecHistTpcItsMatch); // fill with 0 here | |
658 | } | |
659 | } | |
8ea0d018 | 660 | |
b938b7fc | 661 | } // end of track loop |
662 | ||
663 | ||
664 | } | |
665 | ||
666 | ||
667 | ||
668 | //________________________________________________________________________ | |
669 | void AliAnalysisTrackingUncertainties::Terminate(Option_t *) | |
670 | { | |
671 | // Draw result to the screen | |
672 | // Called once at the end of the query | |
673 | ||
674 | ||
675 | } | |
676 | ||
677 | ||
678 | //________________________________________________________________________ | |
679 | void AliAnalysisTrackingUncertainties::BinLogAxis(const THn *h, Int_t axisNumber) { | |
680 | // | |
681 | // Method for the correct logarithmic binning of histograms | |
682 | // | |
683 | TAxis *axis = h->GetAxis(axisNumber); | |
684 | int bins = axis->GetNbins(); | |
685 | ||
686 | Double_t from = axis->GetXmin(); | |
687 | Double_t to = axis->GetXmax(); | |
688 | Double_t *newBins = new Double_t[bins + 1]; | |
689 | ||
690 | newBins[0] = from; | |
691 | Double_t factor = pow(to/from, 1./bins); | |
692 | ||
693 | for (int i = 1; i <= bins; i++) { | |
694 | newBins[i] = factor * newBins[i-1]; | |
695 | } | |
696 | axis->Set(bins, newBins); | |
697 | delete [] newBins; | |
698 | ||
699 | } | |
700 | ||
701 | ||
702 | //________________________________________________________________________ | |
703 | Bool_t AliAnalysisTrackingUncertainties::IsVertexAccepted(AliESDEvent * esd, Float_t &vertexZ) { | |
704 | // | |
705 | // function to check if a proper vertex is reconstructed and write z-position in vertexZ | |
706 | // | |
707 | vertexZ = -999.; | |
708 | Bool_t vertexOkay = kFALSE; | |
709 | const AliESDVertex *vertex = esd->GetPrimaryVertexTracks(); | |
710 | if (vertex->GetNContributors() < 1) { | |
711 | // | |
712 | vertex = esd->GetPrimaryVertexSPD(); | |
713 | if (vertex->GetNContributors() < 1) { | |
714 | vertexOkay = kFALSE; } | |
715 | else { | |
716 | vertexOkay = kTRUE; | |
717 | } | |
718 | // | |
719 | TString vtxTyp = vertex->GetTitle(); | |
720 | Double_t cov[6]={0}; | |
721 | vertex->GetCovarianceMatrix(cov); | |
722 | Double_t zRes = TMath::Sqrt(cov[5]); | |
723 | if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) vertexOkay = kFALSE; | |
724 | } | |
725 | else { | |
726 | vertexOkay = kTRUE; | |
727 | } | |
728 | ||
729 | vertexZ = vertex->GetZ(); | |
730 | return vertexOkay; | |
731 | ||
732 | } | |
733 | ||
4d737435 | 734 | //________________________________________________________________________ |
735 | AliAnalysisTrackingUncertainties::ESpecies_t AliAnalysisTrackingUncertainties::GetPid(const AliESDtrack * const tr, Bool_t useTPCTOF) const { | |
736 | // | |
737 | // Determine particle species for a given track | |
738 | // Two approaches can be used: As default the selection is done using TPC-only, in addition | |
739 | // the TOF usage is optional. In case of TPC-TOF, a valid TOF signal has to be provided for | |
740 | // the given track. The identification is delegated to helper function for each species. | |
741 | // Tracks which are selected as more than one species (ambiguous decision) are rejected. | |
742 | // | |
743 | // @Return: Particles species (kUndef in case no identification is possible) | |
744 | // | |
745 | if(!fESDpid) return kUndef; | |
746 | if(useTPCTOF && !(tr->GetStatus() & AliVTrack::kTOFpid)) return kUndef; | |
747 | ||
748 | Bool_t isElectron(kFALSE), isPion(kFALSE), isKaon(kFALSE), isProton(kFALSE); | |
749 | Int_t nspec(0); | |
750 | if((isElectron = IsElectron(tr, useTPCTOF))) nspec++; | |
751 | if((isPion = IsPion(tr, useTPCTOF))) nspec++; | |
752 | if((isKaon = IsKaon(tr, useTPCTOF))) nspec++; | |
753 | if((isProton = IsProton(tr,useTPCTOF))) nspec++; | |
754 | if(nspec != 1) return kUndef; // No decision or ambiguous decision; | |
755 | if(isElectron) return kSpecElectron; | |
a95c2a62 | 756 | if(isPion) return kSpecPion; |
757 | if(isProton) return kSpecProton; | |
758 | if(isKaon) return kSpecKaon; | |
4d737435 | 759 | return kUndef; |
760 | } | |
761 | ||
762 | //________________________________________________________________________ | |
763 | Bool_t AliAnalysisTrackingUncertainties::IsElectron(const AliESDtrack * const tr, Bool_t useTPCTOF) const { | |
764 | // | |
765 | // Selection of electron candidates using the upper half of the TPC sigma band, starting at | |
766 | // the mean ignoring its shift, and going up to 3 sigma above the mean. In case TOF information | |
767 | // is available, tracks which are incompatible with electrons within 3 sigma are rejected. If | |
768 | // no TOF information is used, the momentum regions where the kaon and the proton line cross | |
769 | // the electron line are cut out using a 3 sigma cut around the kaon or proton line. | |
770 | // | |
771 | ||
772 | Float_t nsigmaElectronTPC = fESDpid->NumberOfSigmasTPC(tr, AliPID::kElectron); | |
773 | if(nsigmaElectronTPC < 0 || nsigmaElectronTPC > 3) return kFALSE; | |
774 | ||
775 | if(useTPCTOF){ | |
776 | Float_t nsigmaElectronTOF = fESDpid->NumberOfSigmasTOF(tr, AliPID::kElectron); | |
777 | if(TMath::Abs(nsigmaElectronTOF) > 3) return kFALSE; | |
778 | else return kTRUE; | |
779 | } else { | |
780 | Float_t nsigmaKaonTPC = fESDpid->NumberOfSigmasTPC(tr, AliPID::kKaon), | |
781 | nsigmaProtonTPC =fESDpid->NumberOfSigmasTPC(tr, AliPID::kProton); | |
782 | if(TMath::Abs(nsigmaKaonTPC < 3) || TMath::Abs(nsigmaProtonTPC < 3)) return kFALSE; | |
783 | else return kTRUE; | |
784 | } | |
785 | } | |
786 | ||
787 | //________________________________________________________________________ | |
a95c2a62 | 788 | Bool_t AliAnalysisTrackingUncertainties::IsConsistentWithPid(Int_t type, const AliESDtrack * const tr) { |
789 | // | |
790 | // just check if the PID is consistent with a given hypothesis in order to | |
791 | // investigate effects which are only dependent on the energy loss. | |
792 | // | |
793 | if (type == kSpecPion) return IsPion(tr); | |
794 | if (type == kSpecKaon) return IsKaon(tr); | |
795 | if (type == kSpecProton) return IsProton(tr); | |
796 | if (type == kSpecElectron) return IsElectron(tr); | |
797 | if (type == kAll) return kTRUE; | |
798 | return kFALSE; | |
799 | ||
4d737435 | 800 | } |
801 | ||
802 | //________________________________________________________________________ | |
a95c2a62 | 803 | Bool_t AliAnalysisTrackingUncertainties::IsPion(const AliESDtrack * const tr, Bool_t /*useTPCPTOF*/) const{ |
804 | // | |
805 | // Selectron of pion candidates | |
806 | // @TODO: To be implemented | |
807 | // | |
808 | Float_t nsigmaPionTPC = fESDpid->NumberOfSigmasTPC(tr, AliPID::kPion); | |
809 | if (TMath::Abs(nsigmaPionTPC) < 3) return kTRUE; | |
810 | return kFALSE; | |
811 | ||
4d737435 | 812 | } |
813 | ||
814 | //________________________________________________________________________ | |
a95c2a62 | 815 | Bool_t AliAnalysisTrackingUncertainties::IsKaon(const AliESDtrack * const tr, Bool_t /*useTPCPTOF*/) const { |
816 | // | |
817 | // Selection of kaon candidates | |
818 | // @TODO: To be implemented | |
819 | // | |
820 | Float_t nsigmaKaonTPC = fESDpid->NumberOfSigmasTPC(tr, AliPID::kKaon); | |
821 | if (TMath::Abs(nsigmaKaonTPC) < 3) return kTRUE; | |
822 | return kFALSE; | |
823 | ||
824 | } | |
825 | ||
826 | //________________________________________________________________________ | |
827 | Bool_t AliAnalysisTrackingUncertainties::IsProton(const AliESDtrack * const tr, Bool_t /*useTPCPTOF*/) const{ | |
828 | // | |
829 | // Selection of proton candidates | |
830 | // @TODO: To be implemented | |
831 | // | |
832 | Float_t nsigmaProtonTPC = fESDpid->NumberOfSigmasTPC(tr, AliPID::kProton); | |
833 | if (TMath::Abs(nsigmaProtonTPC) < 3) return kTRUE; | |
834 | return kFALSE; | |
835 | ||
4d737435 | 836 | } |
b938b7fc | 837 | |
838 | //________________________________________________________________________ | |
839 | void AliAnalysisTrackingUncertainties::InitializeTrackCutHistograms() { | |
840 | // | |
841 | // create histograms for the track cut studies | |
842 | // | |
843 | // | |
844 | // (1.) number of clusters | |
a95c2a62 | 845 | // 0-ncl, 1-pt, 2-eta, 3-phi, 4-pid(0-3 -> electron-proton, 4 -> undef, 5 -> all) |
b938b7fc | 846 | Int_t binsNcl[kNumberOfAxes] = { 40, 50, 20, 18, 6}; |
847 | Double_t minNcl[kNumberOfAxes] = { 20, 0.1, -1, 0, -0.5}; | |
848 | Double_t maxNcl[kNumberOfAxes] = {160, 20, +1, 2*TMath::Pi(), 5.5}; | |
849 | // | |
850 | TString axisNameNcl[kNumberOfAxes] = {"ncl","pT","eta","phi","pid"}; | |
851 | TString axisTitleNcl[kNumberOfAxes] = {"ncl","pT","eta","phi","pid"}; | |
852 | // | |
853 | THnF * histNcl = new THnF("histNcl","number of clusters histogram",kNumberOfAxes, binsNcl, minNcl, maxNcl); | |
854 | BinLogAxis(histNcl, 1); | |
855 | fListHist->Add(histNcl); | |
856 | // | |
857 | for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){ | |
858 | histNcl->GetAxis(iaxis)->SetName(axisNameNcl[iaxis]); | |
859 | histNcl->GetAxis(iaxis)->SetTitle(axisTitleNcl[iaxis]); | |
860 | } | |
861 | // | |
862 | // (2.) chi2/cls-TPC | |
a95c2a62 | 863 | // 0-chi2, 1-pt, 2-eta, 3-phi, 4-pid(0-3 -> electron-proton, 4 -> undef, 5 -> all) |
b938b7fc | 864 | Int_t binsChi2Tpc[kNumberOfAxes] = { 40, 50, 20, 18, 6}; |
865 | Double_t minChi2Tpc[kNumberOfAxes] = { 0, 0.1, -1, 0, -0.5}; | |
866 | Double_t maxChi2Tpc[kNumberOfAxes] = { 8, 20, +1, 2*TMath::Pi(), 5.5}; | |
867 | // | |
868 | TString axisNameChi2Tpc[kNumberOfAxes] = {"chi2tpc","pT","eta","phi","pid"}; | |
869 | TString axisTitleChi2Tpc[kNumberOfAxes] = {"chi2tpc","pT","eta","phi","pid"}; | |
870 | // | |
a95c2a62 | 871 | THnF * histChi2Tpc = new THnF("histChi2Tpc","chi2 per cls. in TPC",kNumberOfAxes, binsChi2Tpc, minChi2Tpc, maxChi2Tpc); |
b938b7fc | 872 | BinLogAxis(histChi2Tpc, 1); |
873 | fListHist->Add(histChi2Tpc); | |
874 | // | |
875 | for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){ | |
876 | histChi2Tpc->GetAxis(iaxis)->SetName(axisNameChi2Tpc[iaxis]); | |
877 | histChi2Tpc->GetAxis(iaxis)->SetTitle(axisTitleChi2Tpc[iaxis]); | |
878 | } | |
879 | // | |
880 | // (3.) dca_z | |
a95c2a62 | 881 | // 0-dcaZ, 1-pt, 2-eta, 3-phi, 4-pid(0-3 -> electron-proton, 4 -> undef, 5 -> all) |
48b2ef2f | 882 | Int_t binsDcaZ[kNumberOfAxes] = { 20, 50, 20, 18, 6}; |
b938b7fc | 883 | Double_t minDcaZ[kNumberOfAxes] = { 0, 0.1, -1, 0, -0.5}; |
48b2ef2f | 884 | Double_t maxDcaZ[kNumberOfAxes] = { 4, 20, +1, 2*TMath::Pi(), 5.5}; |
b938b7fc | 885 | // |
886 | TString axisNameDcaZ[kNumberOfAxes] = {"dcaZ","pT","eta","phi","pid"}; | |
887 | TString axisTitleDcaZ[kNumberOfAxes] = {"dcaZ","pT","eta","phi","pid"}; | |
888 | // | |
a95c2a62 | 889 | THnF * histDcaZ = new THnF("histDcaZ","dca_z to prim. vtx.",kNumberOfAxes, binsDcaZ, minDcaZ, maxDcaZ); |
b938b7fc | 890 | BinLogAxis(histDcaZ, 1); |
891 | fListHist->Add(histDcaZ); | |
892 | // | |
893 | for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){ | |
894 | histDcaZ->GetAxis(iaxis)->SetName(axisNameDcaZ[iaxis]); | |
895 | histDcaZ->GetAxis(iaxis)->SetTitle(axisTitleDcaZ[iaxis]); | |
896 | } | |
897 | // | |
898 | // (4.) hit in SPD layer | |
a95c2a62 | 899 | // 0-spdHit, 1-pt, 2-eta, 3-phi, 4-pid(0-3 -> electron-proton, 4 -> undef, 5 -> all) |
b938b7fc | 900 | Int_t binsSpd[kNumberOfAxes] = { 2, 50, 20, 18, 6}; |
901 | Double_t minSpd[kNumberOfAxes] = { -0.5, 0.1, -1, 0, -0.5}; | |
902 | Double_t maxSpd[kNumberOfAxes] = { 1.5, 20, +1, 2*TMath::Pi(), 5.5}; | |
903 | // | |
904 | TString axisNameSpd[kNumberOfAxes] = {"spdHit","pT","eta","phi","pid"}; | |
905 | TString axisTitleSpd[kNumberOfAxes] = {"spdHit","pT","eta","phi","pid"}; | |
906 | // | |
a95c2a62 | 907 | THnF * histSpd = new THnF("histSpd","hit in SPD layer or not",kNumberOfAxes, binsSpd, minSpd, maxSpd); |
b938b7fc | 908 | BinLogAxis(histSpd, 1); |
909 | fListHist->Add(histSpd); | |
910 | // | |
911 | for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){ | |
912 | histSpd->GetAxis(iaxis)->SetName(axisNameSpd[iaxis]); | |
913 | histSpd->GetAxis(iaxis)->SetTitle(axisTitleSpd[iaxis]); | |
914 | } | |
a95c2a62 | 915 | // |
916 | // (5.) number of crossed rows | |
917 | // 0-ncr, 1-pt, 2-eta, 3-phi, 4-pid(0,unid,etc.) | |
918 | Int_t binsNcr[kNumberOfAxes] = { 40, 50, 20, 18, 6}; | |
919 | Double_t minNcr[kNumberOfAxes] = { 20, 0.1, -1, 0, -0.5}; | |
920 | Double_t maxNcr[kNumberOfAxes] = {160, 20, +1, 2*TMath::Pi(), 5.5}; | |
921 | // | |
922 | TString axisNameNcr[kNumberOfAxes] = {"Ncr","pT","eta","phi","pid"}; | |
923 | TString axisTitleNcr[kNumberOfAxes] = {"Ncr","pT","eta","phi","pid"}; | |
924 | // | |
925 | THnF * histNcr = new THnF("histNcr","number of crossed rows TPC histogram",kNumberOfAxes, binsNcr, minNcr, maxNcr); | |
926 | BinLogAxis(histNcr, 1); | |
927 | fListHist->Add(histNcr); | |
928 | // | |
929 | for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){ | |
930 | histNcr->GetAxis(iaxis)->SetName(axisNameNcr[iaxis]); | |
931 | histNcr->GetAxis(iaxis)->SetTitle(axisTitleNcr[iaxis]); | |
932 | } | |
933 | // | |
934 | // (6.) ratio crossed rows over findable clusters | |
935 | // 0-CRoverFC, 1-pt, 2-eta, 3-phi, 4-pid(0,unid,etc.) | |
936 | Int_t binsCRoverFC[kNumberOfAxes] = { 26, 50, 20, 18, 6}; | |
937 | Double_t minCRoverFC[kNumberOfAxes] = { 0.4, 0.1, -1, 0, -0.5}; | |
938 | Double_t maxCRoverFC[kNumberOfAxes] = { 1.8, 20, +1, 2*TMath::Pi(), 5.5}; | |
939 | // | |
940 | TString axisNameCRoverFC[kNumberOfAxes] = {"CRoverFC","pT","eta","phi","pid"}; | |
941 | TString axisTitleCRoverFC[kNumberOfAxes] = {"CRoverFC","pT","eta","phi","pid"}; | |
942 | // | |
943 | THnF * histCRoverFC = new THnF("histCRoverFC","number of crossed rows over findable clusters histogram",kNumberOfAxes, binsCRoverFC, minCRoverFC, maxCRoverFC); | |
944 | BinLogAxis(histCRoverFC, 1); | |
945 | fListHist->Add(histCRoverFC); | |
946 | // | |
947 | for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){ | |
948 | histCRoverFC->GetAxis(iaxis)->SetName(axisNameCRoverFC[iaxis]); | |
949 | histCRoverFC->GetAxis(iaxis)->SetTitle(axisTitleCRoverFC[iaxis]); | |
950 | } | |
951 | // | |
952 | // (7.) max chi2 / ITS cluster | |
953 | // 0-Chi2Its, 1-pt, 2-eta, 3-phi, 4-pid(0,unid,etc.) | |
954 | Int_t binsChi2Its[kNumberOfAxes] = { 25, 50, 20, 18, 6}; | |
955 | Double_t minChi2Its[kNumberOfAxes] = { 0, 0.1, -1, 0, -0.5}; | |
956 | Double_t maxChi2Its[kNumberOfAxes] = { 50, 20, +1, 2*TMath::Pi(), 5.5}; | |
957 | // | |
958 | TString axisNameChi2Its[kNumberOfAxes] = {"Chi2Its","pT","eta","phi","pid"}; | |
959 | TString axisTitleChi2Its[kNumberOfAxes] = {"Chi2Its","pT","eta","phi","pid"}; | |
960 | // | |
961 | THnF * histChi2Its = new THnF("histChi2Its","number of crossed rows TPC histogram",kNumberOfAxes, binsChi2Its, minChi2Its, maxChi2Its); | |
962 | BinLogAxis(histChi2Its, 1); | |
963 | fListHist->Add(histChi2Its); | |
964 | // | |
965 | for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){ | |
966 | histChi2Its->GetAxis(iaxis)->SetName(axisNameChi2Its[iaxis]); | |
967 | histChi2Its->GetAxis(iaxis)->SetTitle(axisTitleChi2Its[iaxis]); | |
968 | } | |
969 | // | |
970 | // (8.) tpc active volume length | |
971 | // 0-TpcLength, 1-pt, 2-eta, 3-phi, 4-pid(0,unid,etc.) | |
972 | Int_t binsTpcLength[kNumberOfAxes] = { 40, 50, 20, 18, 6}; | |
973 | Double_t minTpcLength[kNumberOfAxes] = { 0, 0.1, -1, 0, -0.5}; | |
974 | Double_t maxTpcLength[kNumberOfAxes] = { 170, 20, +1, 2*TMath::Pi(), 5.5}; | |
975 | // | |
976 | TString axisNameTpcLength[kNumberOfAxes] = {"TpcLength","pT","eta","phi","pid"}; | |
977 | TString axisTitleTpcLength[kNumberOfAxes] = {"TpcLength","pT","eta","phi","pid"}; | |
978 | // | |
979 | THnF * histTpcLength = new THnF("histTpcLength","number of crossed rows TPC histogram",kNumberOfAxes, binsTpcLength, minTpcLength, maxTpcLength); | |
980 | BinLogAxis(histTpcLength, 1); | |
981 | fListHist->Add(histTpcLength); | |
982 | // | |
983 | for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){ | |
984 | histTpcLength->GetAxis(iaxis)->SetName(axisNameTpcLength[iaxis]); | |
985 | histTpcLength->GetAxis(iaxis)->SetTitle(axisTitleTpcLength[iaxis]); | |
986 | } | |
987 | // | |
988 | // (9.) match TPC->ITS | |
989 | // 0-is matched, 1-pt, 2-eta, 3-phi, 4-pid(0-3 -> electron-proton, 4 -> undef, 5 -> all) | |
990 | Int_t binsTpcItsMatch[kNumberOfAxes] = { 2, 50, 20, 18, 6}; | |
991 | Double_t minTpcItsMatch[kNumberOfAxes] = { -0.5, 0.1, -1, 0, -0.5}; | |
992 | Double_t maxTpcItsMatch[kNumberOfAxes] = { 1.5, 20, +1, 2*TMath::Pi(), 5.5}; | |
993 | // | |
994 | TString axisNameTpcItsMatch[kNumberOfAxes] = {"isMatched","pT","eta","phi","pid"}; | |
995 | TString axisTitleTpcItsMatch[kNumberOfAxes] = {"isMatched","pT","eta","phi","pid"}; | |
996 | // | |
997 | THnF * histTpcItsMatch = new THnF("histTpcItsMatch","TPC -> ITS matching",kNumberOfAxes, binsTpcItsMatch, minTpcItsMatch, maxTpcItsMatch); | |
998 | BinLogAxis(histTpcItsMatch, 1); | |
999 | fListHist->Add(histTpcItsMatch); | |
1000 | // | |
1001 | for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){ | |
1002 | histTpcItsMatch->GetAxis(iaxis)->SetName(axisNameTpcItsMatch[iaxis]); | |
1003 | histTpcItsMatch->GetAxis(iaxis)->SetTitle(axisTitleTpcItsMatch[iaxis]); | |
1004 | } | |
b938b7fc | 1005 | |
1006 | ||
1007 | ||
1008 | ||
1009 | } | |
1010 |