more development
[u/mrichter/AliRoot.git] / ANALYSIS / AliESDtrackCuts.cxx
CommitLineData
73318471 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 **************************************************************************/
15
16/* $Id: AliESDtrackCuts.cxx 24534 2008-03-16 22:22:11Z fca $ */
17
18#include "AliESDtrackCuts.h"
19
20#include <AliESDtrack.h>
21#include <AliESD.h>
22#include <AliESDEvent.h>
23#include <AliLog.h>
24
25#include <TTree.h>
26#include <TCanvas.h>
27#include <TDirectory.h>
28
29//____________________________________________________________________
30ClassImp(AliESDtrackCuts)
31
32// Cut names
33const Char_t* AliESDtrackCuts::fgkCutNames[kNCuts] = {
34 "require TPC refit",
35 "require ITS refit",
36 "n clusters TPC",
37 "n clusters ITS",
38 "#Chi^{2}/clusters TPC",
39 "#Chi^{2}/clusters ITS",
40 "cov 11",
41 "cov 22",
42 "cov 33",
43 "cov 44",
44 "cov 55",
45 "trk-to-vtx",
46 "trk-to-vtx failed",
47 "kink daughters",
48 "p",
49 "p_{T}",
50 "p_{x}",
51 "p_{y}",
52 "p_{z}",
53 "y",
54 "eta"
55};
56
57//____________________________________________________________________
58AliESDtrackCuts::AliESDtrackCuts(const Char_t* name, const Char_t* title) : AliAnalysisCuts(name,title),
59 fCutMinNClusterTPC(0),
60 fCutMinNClusterITS(0),
61 fCutMaxChi2PerClusterTPC(0),
62 fCutMaxChi2PerClusterITS(0),
63 fCutMaxC11(0),
64 fCutMaxC22(0),
65 fCutMaxC33(0),
66 fCutMaxC44(0),
67 fCutMaxC55(0),
68 fCutAcceptKinkDaughters(0),
69 fCutRequireTPCRefit(0),
70 fCutRequireITSRefit(0),
71 fCutNsigmaToVertex(0),
72 fCutSigmaToVertexRequired(0),
73 fPMin(0),
74 fPMax(0),
75 fPtMin(0),
76 fPtMax(0),
77 fPxMin(0),
78 fPxMax(0),
79 fPyMin(0),
80 fPyMax(0),
81 fPzMin(0),
82 fPzMax(0),
83 fEtaMin(0),
84 fEtaMax(0),
85 fRapMin(0),
86 fRapMax(0),
87 fHistogramsOn(0),
88 ffDTheoretical(0),
89 fhCutStatistics(0),
90 fhCutCorrelation(0)
91{
92 //
93 // constructor
94 //
95
96 Init();
97
98 //##############################################################################
99 // setting default cuts
100 SetMinNClustersTPC();
101 SetMinNClustersITS();
102 SetMaxChi2PerClusterTPC();
103 SetMaxChi2PerClusterITS();
104 SetMaxCovDiagonalElements();
105 SetRequireTPCRefit();
106 SetRequireITSRefit();
107 SetAcceptKingDaughters();
108 SetMinNsigmaToVertex();
109 SetRequireSigmaToVertex();
110 SetPRange();
111 SetPtRange();
112 SetPxRange();
113 SetPyRange();
114 SetPzRange();
115 SetEtaRange();
116 SetRapRange();
117
118 SetHistogramsOn();
119}
120
121//_____________________________________________________________________________
122AliESDtrackCuts::AliESDtrackCuts(const AliESDtrackCuts &c) : AliAnalysisCuts(c),
123 fCutMinNClusterTPC(0),
124 fCutMinNClusterITS(0),
125 fCutMaxChi2PerClusterTPC(0),
126 fCutMaxChi2PerClusterITS(0),
127 fCutMaxC11(0),
128 fCutMaxC22(0),
129 fCutMaxC33(0),
130 fCutMaxC44(0),
131 fCutMaxC55(0),
132 fCutAcceptKinkDaughters(0),
133 fCutRequireTPCRefit(0),
134 fCutRequireITSRefit(0),
135 fCutNsigmaToVertex(0),
136 fCutSigmaToVertexRequired(0),
137 fPMin(0),
138 fPMax(0),
139 fPtMin(0),
140 fPtMax(0),
141 fPxMin(0),
142 fPxMax(0),
143 fPyMin(0),
144 fPyMax(0),
145 fPzMin(0),
146 fPzMax(0),
147 fEtaMin(0),
148 fEtaMax(0),
149 fRapMin(0),
150 fRapMax(0),
151 fHistogramsOn(0),
152 ffDTheoretical(0),
153 fhCutStatistics(0),
154 fhCutCorrelation(0)
155{
156 //
157 // copy constructor
158 //
159
160 ((AliESDtrackCuts &) c).Copy(*this);
161}
162
163AliESDtrackCuts::~AliESDtrackCuts()
164{
165 //
166 // destructor
167 //
168
169 for (Int_t i=0; i<2; i++) {
170
171 if (fhNClustersITS[i])
172 delete fhNClustersITS[i];
173 if (fhNClustersTPC[i])
174 delete fhNClustersTPC[i];
175 if (fhChi2PerClusterITS[i])
176 delete fhChi2PerClusterITS[i];
177 if (fhChi2PerClusterTPC[i])
178 delete fhChi2PerClusterTPC[i];
179 if (fhC11[i])
180 delete fhC11[i];
181 if (fhC22[i])
182 delete fhC22[i];
183 if (fhC33[i])
184 delete fhC33[i];
185 if (fhC44[i])
186 delete fhC44[i];
187 if (fhC55[i])
188 delete fhC55[i];
189
190 if (fhDXY[i])
191 delete fhDXY[i];
192 if (fhDZ[i])
193 delete fhDZ[i];
194 if (fhDXYvsDZ[i])
195 delete fhDXYvsDZ[i];
196
197 if (fhDXYNormalized[i])
198 delete fhDXYNormalized[i];
199 if (fhDZNormalized[i])
200 delete fhDZNormalized[i];
201 if (fhDXYvsDZNormalized[i])
202 delete fhDXYvsDZNormalized[i];
203 if (fhNSigmaToVertex[i])
204 delete fhNSigmaToVertex[i];
205 if (fhPt[i])
206 delete fhPt[i];
207 if (fhEta[i])
208 delete fhEta[i];
209 }
210
211 if (ffDTheoretical)
212 delete ffDTheoretical;
213
214 if (fhCutStatistics)
215 delete fhCutStatistics;
216 if (fhCutCorrelation)
217 delete fhCutCorrelation;
218}
219
220void AliESDtrackCuts::Init()
221{
222 //
223 // sets everything to zero
224 //
225
226 fCutMinNClusterTPC = 0;
227 fCutMinNClusterITS = 0;
228
229 fCutMaxChi2PerClusterTPC = 0;
230 fCutMaxChi2PerClusterITS = 0;
231
232 fCutMaxC11 = 0;
233 fCutMaxC22 = 0;
234 fCutMaxC33 = 0;
235 fCutMaxC44 = 0;
236 fCutMaxC55 = 0;
237
238 fCutAcceptKinkDaughters = 0;
239 fCutRequireTPCRefit = 0;
240 fCutRequireITSRefit = 0;
241
242 fCutNsigmaToVertex = 0;
243 fCutSigmaToVertexRequired = 0;
244
245 fPMin = 0;
246 fPMax = 0;
247 fPtMin = 0;
248 fPtMax = 0;
249 fPxMin = 0;
250 fPxMax = 0;
251 fPyMin = 0;
252 fPyMax = 0;
253 fPzMin = 0;
254 fPzMax = 0;
255 fEtaMin = 0;
256 fEtaMax = 0;
257 fRapMin = 0;
258 fRapMax = 0;
259
260 fHistogramsOn = kFALSE;
261
262 for (Int_t i=0; i<2; ++i)
263 {
264 fhNClustersITS[i] = 0;
265 fhNClustersTPC[i] = 0;
266
267 fhChi2PerClusterITS[i] = 0;
268 fhChi2PerClusterTPC[i] = 0;
269
270 fhC11[i] = 0;
271 fhC22[i] = 0;
272 fhC33[i] = 0;
273 fhC44[i] = 0;
274 fhC55[i] = 0;
275
276 fhDXY[i] = 0;
277 fhDZ[i] = 0;
278 fhDXYvsDZ[i] = 0;
279
280 fhDXYNormalized[i] = 0;
281 fhDZNormalized[i] = 0;
282 fhDXYvsDZNormalized[i] = 0;
283 fhNSigmaToVertex[i] = 0;
284
285 fhPt[i] = 0;
286 fhEta[i] = 0;
287 }
288 ffDTheoretical = 0;
289
290 fhCutStatistics = 0;
291 fhCutCorrelation = 0;
292}
293
294//_____________________________________________________________________________
295AliESDtrackCuts &AliESDtrackCuts::operator=(const AliESDtrackCuts &c)
296{
297 //
298 // Assignment operator
299 //
300
301 if (this != &c) ((AliESDtrackCuts &) c).Copy(*this);
302 return *this;
303}
304
305//_____________________________________________________________________________
306void AliESDtrackCuts::Copy(TObject &c) const
307{
308 //
309 // Copy function
310 //
311
312 AliESDtrackCuts& target = (AliESDtrackCuts &) c;
313
314 target.Init();
315
316 target.fCutMinNClusterTPC = fCutMinNClusterTPC;
317 target.fCutMinNClusterITS = fCutMinNClusterITS;
318
319 target.fCutMaxChi2PerClusterTPC = fCutMaxChi2PerClusterTPC;
320 target.fCutMaxChi2PerClusterITS = fCutMaxChi2PerClusterITS;
321
322 target.fCutMaxC11 = fCutMaxC11;
323 target.fCutMaxC22 = fCutMaxC22;
324 target.fCutMaxC33 = fCutMaxC33;
325 target.fCutMaxC44 = fCutMaxC44;
326 target.fCutMaxC55 = fCutMaxC55;
327
328 target.fCutAcceptKinkDaughters = fCutAcceptKinkDaughters;
329 target.fCutRequireTPCRefit = fCutRequireTPCRefit;
330 target.fCutRequireITSRefit = fCutRequireITSRefit;
331
332 target.fCutNsigmaToVertex = fCutNsigmaToVertex;
333 target.fCutSigmaToVertexRequired = fCutSigmaToVertexRequired;
334
335 target.fPMin = fPMin;
336 target.fPMax = fPMax;
337 target.fPtMin = fPtMin;
338 target.fPtMax = fPtMax;
339 target.fPxMin = fPxMin;
340 target.fPxMax = fPxMax;
341 target.fPyMin = fPyMin;
342 target.fPyMax = fPyMax;
343 target.fPzMin = fPzMin;
344 target.fPzMax = fPzMax;
345 target.fEtaMin = fEtaMin;
346 target.fEtaMax = fEtaMax;
347 target.fRapMin = fRapMin;
348 target.fRapMax = fRapMax;
349
350 target.fHistogramsOn = fHistogramsOn;
351
352 for (Int_t i=0; i<2; ++i)
353 {
354 if (fhNClustersITS[i]) target.fhNClustersITS[i] = (TH1F*) fhNClustersITS[i]->Clone();
355 if (fhNClustersTPC[i]) target.fhNClustersTPC[i] = (TH1F*) fhNClustersTPC[i]->Clone();
356
357 if (fhChi2PerClusterITS[i]) target.fhChi2PerClusterITS[i] = (TH1F*) fhChi2PerClusterITS[i]->Clone();
358 if (fhChi2PerClusterTPC[i]) target.fhChi2PerClusterTPC[i] = (TH1F*) fhChi2PerClusterTPC[i]->Clone();
359
360 if (fhC11[i]) target.fhC11[i] = (TH1F*) fhC11[i]->Clone();
361 if (fhC22[i]) target.fhC22[i] = (TH1F*) fhC22[i]->Clone();
362 if (fhC33[i]) target.fhC33[i] = (TH1F*) fhC33[i]->Clone();
363 if (fhC44[i]) target.fhC44[i] = (TH1F*) fhC44[i]->Clone();
364 if (fhC55[i]) target.fhC55[i] = (TH1F*) fhC55[i]->Clone();
365
366 if (fhDXY[i]) target.fhDXY[i] = (TH1F*) fhDXY[i]->Clone();
367 if (fhDZ[i]) target.fhDZ[i] = (TH1F*) fhDZ[i]->Clone();
368 if (fhDXYvsDZ[i]) target.fhDXYvsDZ[i] = (TH2F*) fhDXYvsDZ[i]->Clone();
369
370 if (fhDXYNormalized[i]) target.fhDXYNormalized[i] = (TH1F*) fhDXYNormalized[i]->Clone();
371 if (fhDZNormalized[i]) target.fhDZNormalized[i] = (TH1F*) fhDZNormalized[i]->Clone();
372 if (fhDXYvsDZNormalized[i]) target.fhDXYvsDZNormalized[i] = (TH2F*) fhDXYvsDZNormalized[i]->Clone();
373 if (fhNSigmaToVertex[i]) target.fhNSigmaToVertex[i] = (TH1F*) fhNSigmaToVertex[i]->Clone();
374
375 if (fhPt[i]) target.fhPt[i] = (TH1F*) fhPt[i]->Clone();
376 if (fhEta[i]) target.fhEta[i] = (TH1F*) fhEta[i]->Clone();
377 }
378 if (ffDTheoretical) target.ffDTheoretical = (TF1*) ffDTheoretical->Clone();
379
380 if (fhCutStatistics) target.fhCutStatistics = (TH1F*) fhCutStatistics->Clone();
381 if (fhCutCorrelation) target.fhCutCorrelation = (TH2F*) fhCutCorrelation->Clone();
382
383 TNamed::Copy(c);
384}
385
386//_____________________________________________________________________________
387Long64_t AliESDtrackCuts::Merge(TCollection* list) {
388 // Merge a list of AliESDtrackCuts objects with this (needed for PROOF)
389 // Returns the number of merged objects (including this)
73318471 390 if (!list)
391 return 0;
73318471 392 if (list->IsEmpty())
393 return 1;
73318471 394 if (!fHistogramsOn)
395 return 0;
73318471 396 TIterator* iter = list->MakeIterator();
397 TObject* obj;
398
399
400 // collection of measured and generated histograms
401 Int_t count = 0;
402 while ((obj = iter->Next())) {
403
404 AliESDtrackCuts* entry = dynamic_cast<AliESDtrackCuts*>(obj);
405 if (entry == 0)
406 continue;
407
408 if (!entry->fHistogramsOn)
409 continue;
410
411 for (Int_t i=0; i<2; i++) {
412
413 fhNClustersITS[i] ->Add(entry->fhNClustersITS[i] );
414 fhNClustersTPC[i] ->Add(entry->fhNClustersTPC[i] );
415
416 fhChi2PerClusterITS[i] ->Add(entry->fhChi2PerClusterITS[i]);
417 fhChi2PerClusterTPC[i] ->Add(entry->fhChi2PerClusterTPC[i]);
418
419 fhC11[i] ->Add(entry->fhC11[i] );
420 fhC22[i] ->Add(entry->fhC22[i] );
421 fhC33[i] ->Add(entry->fhC33[i] );
422 fhC44[i] ->Add(entry->fhC44[i] );
423 fhC55[i] ->Add(entry->fhC55[i] );
424
425 fhDXY[i] ->Add(entry->fhDXY[i] );
426 fhDZ[i] ->Add(entry->fhDZ[i] );
427 fhDXYvsDZ[i] ->Add(entry->fhDXYvsDZ[i] );
428
429 fhDXYNormalized[i] ->Add(entry->fhDXYNormalized[i] );
430 fhDZNormalized[i] ->Add(entry->fhDZNormalized[i] );
431 fhDXYvsDZNormalized[i] ->Add(entry->fhDXYvsDZNormalized[i]);
432 fhNSigmaToVertex[i] ->Add(entry->fhNSigmaToVertex[i]);
433
434 fhPt[i] ->Add(entry->fhPt[i]);
435 fhEta[i] ->Add(entry->fhEta[i]);
436 }
437
438 fhCutStatistics ->Add(entry->fhCutStatistics);
439 fhCutCorrelation ->Add(entry->fhCutCorrelation);
440
441 count++;
442 }
73318471 443 return count+1;
444}
445
446
447//____________________________________________________________________
448Float_t AliESDtrackCuts::GetSigmaToVertex(AliESDtrack* esdTrack)
449{
450 // Calculates the number of sigma to the vertex.
451
452 Float_t b[2];
453 Float_t bRes[2];
454 Float_t bCov[3];
455 esdTrack->GetImpactParameters(b,bCov);
36853ddd 456
73318471 457 if (bCov[0]<=0 || bCov[2]<=0) {
458 AliDebug(1, "Estimated b resolution lower or equal zero!");
459 bCov[0]=0; bCov[2]=0;
460 }
461 bRes[0] = TMath::Sqrt(bCov[0]);
462 bRes[1] = TMath::Sqrt(bCov[2]);
463
464 // -----------------------------------
465 // How to get to a n-sigma cut?
466 //
467 // The accumulated statistics from 0 to d is
468 //
469 // -> Erf(d/Sqrt(2)) for a 1-dim gauss (d = n_sigma)
470 // -> 1 - Exp(-d**2) for a 2-dim gauss (d*d = dx*dx + dy*dy != n_sigma)
471 //
472 // It means that for a 2-dim gauss: n_sigma(d) = Sqrt(2)*ErfInv(1 - Exp((-x**2)/2)
473 // Can this be expressed in a different way?
474
475 if (bRes[0] == 0 || bRes[1] ==0)
476 return -1;
477
478 Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2));
479
480 // stupid rounding problem screws up everything:
481 // if d is too big, TMath::Exp(...) gets 0, and TMath::ErfInverse(1) that should be infinite, gets 0 :(
482 if (TMath::Exp(-d * d / 2) < 1e-10)
483 return 1000;
484
485 d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2);
486 return d;
487}
488
489void AliESDtrackCuts::EnableNeededBranches(TTree* tree)
490{
491 // enables the branches needed by AcceptTrack, for a list see comment of AcceptTrack
492
493 tree->SetBranchStatus("fTracks.fFlags", 1);
494 tree->SetBranchStatus("fTracks.fITSncls", 1);
495 tree->SetBranchStatus("fTracks.fTPCncls", 1);
496 tree->SetBranchStatus("fTracks.fITSchi2", 1);
497 tree->SetBranchStatus("fTracks.fTPCchi2", 1);
498 tree->SetBranchStatus("fTracks.fC*", 1);
499 tree->SetBranchStatus("fTracks.fD", 1);
500 tree->SetBranchStatus("fTracks.fZ", 1);
501 tree->SetBranchStatus("fTracks.fCdd", 1);
502 tree->SetBranchStatus("fTracks.fCdz", 1);
503 tree->SetBranchStatus("fTracks.fCzz", 1);
504 tree->SetBranchStatus("fTracks.fP*", 1);
505 tree->SetBranchStatus("fTracks.fR*", 1);
506 tree->SetBranchStatus("fTracks.fKinkIndexes*", 1);
507}
508
509//____________________________________________________________________
510Bool_t
511AliESDtrackCuts::AcceptTrack(AliESDtrack* esdTrack) {
512 //
513 // figure out if the tracks survives all the track cuts defined
514 //
515 // the different quality parameter and kinematic values are first
516 // retrieved from the track. then it is found out what cuts the
517 // track did not survive and finally the cuts are imposed.
518
519 // this function needs the following branches:
520 // fTracks.fFlags
521 // fTracks.fITSncls
522 // fTracks.fTPCncls
523 // fTracks.fITSchi2
524 // fTracks.fTPCchi2
525 // fTracks.fC //GetExternalCovariance
526 // fTracks.fD //GetImpactParameters
527 // fTracks.fZ //GetImpactParameters
528 // fTracks.fCdd //GetImpactParameters
529 // fTracks.fCdz //GetImpactParameters
530 // fTracks.fCzz //GetImpactParameters
531 // fTracks.fP //GetPxPyPz
532 // fTracks.fR //GetMass
533 // fTracks.fP //GetMass
534 // fTracks.fKinkIndexes
535
36853ddd 536
73318471 537 UInt_t status = esdTrack->GetStatus();
538
539 // dummy array
540 Int_t fIdxInt[200];
541
542 // getting quality parameters from the ESD track
543 Int_t nClustersITS = esdTrack->GetITSclusters(fIdxInt);
544 Int_t nClustersTPC = esdTrack->GetTPCclusters(fIdxInt);
545
73318471 546 Float_t chi2PerClusterITS = -1;
547 Float_t chi2PerClusterTPC = -1;
548 if (nClustersITS!=0)
549 chi2PerClusterITS = esdTrack->GetITSchi2()/Float_t(nClustersITS);
550 if (nClustersTPC!=0)
551 chi2PerClusterTPC = esdTrack->GetTPCchi2()/Float_t(nClustersTPC);
73318471 552 Double_t extCov[15];
553 esdTrack->GetExternalCovariance(extCov);
554
555 // getting the track to vertex parameters
556 Float_t nSigmaToVertex = GetSigmaToVertex(esdTrack);
557
558 // getting the kinematic variables of the track
559 // (assuming the mass is known)
560 Double_t p[3];
561 esdTrack->GetPxPyPz(p);
36853ddd 562
73318471 563 Float_t momentum = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2) + TMath::Power(p[2],2));
564 Float_t pt = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2));
565 Float_t energy = TMath::Sqrt(TMath::Power(esdTrack->GetMass(),2) + TMath::Power(momentum,2));
566
567
568 //y-eta related calculations
569 Float_t eta = -100.;
570 Float_t y = -100.;
571 if((momentum != TMath::Abs(p[2]))&&(momentum != 0))
572 eta = 0.5*TMath::Log((momentum + p[2])/(momentum - p[2]));
573 if((energy != TMath::Abs(p[2]))&&(momentum != 0))
574 y = 0.5*TMath::Log((energy + p[2])/(energy - p[2]));
575
576
577 //########################################################################
578 // cut the track?
579
580 Bool_t cuts[kNCuts];
581 for (Int_t i=0; i<kNCuts; i++) cuts[i]=kFALSE;
582
583 // track quality cuts
584 if (fCutRequireTPCRefit && (status&AliESDtrack::kTPCrefit)==0)
585 cuts[0]=kTRUE;
586 if (fCutRequireITSRefit && (status&AliESDtrack::kITSrefit)==0)
587 cuts[1]=kTRUE;
588 if (nClustersTPC<fCutMinNClusterTPC)
589 cuts[2]=kTRUE;
590 if (nClustersITS<fCutMinNClusterITS)
591 cuts[3]=kTRUE;
592 if (chi2PerClusterTPC>fCutMaxChi2PerClusterTPC)
593 cuts[4]=kTRUE;
594 if (chi2PerClusterITS>fCutMaxChi2PerClusterITS)
595 cuts[5]=kTRUE;
596 if (extCov[0] > fCutMaxC11)
597 cuts[6]=kTRUE;
598 if (extCov[2] > fCutMaxC22)
599 cuts[7]=kTRUE;
600 if (extCov[5] > fCutMaxC33)
601 cuts[8]=kTRUE;
602 if (extCov[9] > fCutMaxC44)
603 cuts[9]=kTRUE;
604 if (extCov[14] > fCutMaxC55)
605 cuts[10]=kTRUE;
606 if (nSigmaToVertex > fCutNsigmaToVertex && fCutSigmaToVertexRequired)
607 cuts[11] = kTRUE;
608 // if n sigma could not be calculated
609 if (nSigmaToVertex<0 && fCutSigmaToVertexRequired)
610 cuts[12]=kTRUE;
611 if (!fCutAcceptKinkDaughters && esdTrack->GetKinkIndex(0)>0)
612 cuts[13]=kTRUE;
613 // track kinematics cut
614 if((momentum < fPMin) || (momentum > fPMax))
615 cuts[14]=kTRUE;
616 if((pt < fPtMin) || (pt > fPtMax))
617 cuts[15] = kTRUE;
618 if((p[0] < fPxMin) || (p[0] > fPxMax))
619 cuts[16] = kTRUE;
620 if((p[1] < fPyMin) || (p[1] > fPyMax))
621 cuts[17] = kTRUE;
622 if((p[2] < fPzMin) || (p[2] > fPzMax))
623 cuts[18] = kTRUE;
624 if((eta < fEtaMin) || (eta > fEtaMax))
625 cuts[19] = kTRUE;
626 if((y < fRapMin) || (y > fRapMax))
627 cuts[20] = kTRUE;
628
629 Bool_t cut=kFALSE;
630 for (Int_t i=0; i<kNCuts; i++)
631 if (cuts[i]) cut = kTRUE;
632
633 //########################################################################
634 // filling histograms
635 if (fHistogramsOn) {
636 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n tracks")));
73318471 637 if (cut)
638 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n cut tracks")));
639
640 for (Int_t i=0; i<kNCuts; i++) {
641 if (cuts[i])
642 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin(fgkCutNames[i])));
643
644 for (Int_t j=i; j<kNCuts; j++) {
645 if (cuts[i] && cuts[j]) {
03a5cc9f 646 Float_t xC = fhCutCorrelation->GetXaxis()->GetBinCenter(fhCutCorrelation->GetXaxis()->FindBin(fgkCutNames[i]));
647 Float_t yC = fhCutCorrelation->GetYaxis()->GetBinCenter(fhCutCorrelation->GetYaxis()->FindBin(fgkCutNames[j]));
648 fhCutCorrelation->Fill(xC, yC);
73318471 649 }
650 }
651 }
652
653 fhNClustersITS[0]->Fill(nClustersITS);
654 fhNClustersTPC[0]->Fill(nClustersTPC);
655 fhChi2PerClusterITS[0]->Fill(chi2PerClusterITS);
656 fhChi2PerClusterTPC[0]->Fill(chi2PerClusterTPC);
657
658 fhC11[0]->Fill(extCov[0]);
659 fhC22[0]->Fill(extCov[2]);
660 fhC33[0]->Fill(extCov[5]);
661 fhC44[0]->Fill(extCov[9]);
662 fhC55[0]->Fill(extCov[14]);
663
664 fhPt[0]->Fill(pt);
665 fhEta[0]->Fill(eta);
666
667 Float_t b[2];
668 Float_t bRes[2];
669 Float_t bCov[3];
670 esdTrack->GetImpactParameters(b,bCov);
36853ddd 671
73318471 672 if (bCov[0]<=0 || bCov[2]<=0) {
673 AliDebug(1, "Estimated b resolution lower or equal zero!");
674 bCov[0]=0; bCov[2]=0;
675 }
676 bRes[0] = TMath::Sqrt(bCov[0]);
677 bRes[1] = TMath::Sqrt(bCov[2]);
678
679 fhDZ[0]->Fill(b[1]);
680 fhDXY[0]->Fill(b[0]);
681 fhDXYvsDZ[0]->Fill(b[1],b[0]);
682
683 if (bRes[0]!=0 && bRes[1]!=0) {
684 fhDZNormalized[0]->Fill(b[1]/bRes[1]);
685 fhDXYNormalized[0]->Fill(b[0]/bRes[0]);
686 fhDXYvsDZNormalized[0]->Fill(b[1]/bRes[1], b[0]/bRes[0]);
687 fhNSigmaToVertex[0]->Fill(nSigmaToVertex);
688 }
689 }
690
691 //########################################################################
692 // cut the track!
693 if (cut) return kFALSE;
694
695 //########################################################################
696 // filling histograms after cut
697 if (fHistogramsOn) {
698 fhNClustersITS[1]->Fill(nClustersITS);
699 fhNClustersTPC[1]->Fill(nClustersTPC);
700 fhChi2PerClusterITS[1]->Fill(chi2PerClusterITS);
701 fhChi2PerClusterTPC[1]->Fill(chi2PerClusterTPC);
702
703 fhC11[1]->Fill(extCov[0]);
704 fhC22[1]->Fill(extCov[2]);
705 fhC33[1]->Fill(extCov[5]);
706 fhC44[1]->Fill(extCov[9]);
707 fhC55[1]->Fill(extCov[14]);
708
709 fhPt[1]->Fill(pt);
710 fhEta[1]->Fill(eta);
711
712 Float_t b[2];
713 Float_t bRes[2];
714 Float_t bCov[3];
715 esdTrack->GetImpactParameters(b,bCov);
716 if (bCov[0]<=0 || bCov[2]<=0) {
717 AliDebug(1, "Estimated b resolution lower or equal zero!");
718 bCov[0]=0; bCov[2]=0;
719 }
720 bRes[0] = TMath::Sqrt(bCov[0]);
721 bRes[1] = TMath::Sqrt(bCov[2]);
722
723 fhDZ[1]->Fill(b[1]);
724 fhDXY[1]->Fill(b[0]);
725 fhDXYvsDZ[1]->Fill(b[1],b[0]);
726
727 if (bRes[0]!=0 && bRes[1]!=0)
728 {
729 fhDZNormalized[1]->Fill(b[1]/bRes[1]);
730 fhDXYNormalized[1]->Fill(b[0]/bRes[0]);
731 fhDXYvsDZNormalized[1]->Fill(b[1]/bRes[1], b[0]/bRes[0]);
732 fhNSigmaToVertex[1]->Fill(nSigmaToVertex);
733 }
734 }
735
736 return kTRUE;
737}
738
739//____________________________________________________________________
740TObjArray* AliESDtrackCuts::GetAcceptedTracks(AliESD* esd)
741{
742 //
743 // returns an array of all tracks that pass the cuts
744 //
745
746 TObjArray* acceptedTracks = new TObjArray();
747
36853ddd 748
73318471 749 // loop over esd tracks
750 for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
751 AliESDtrack* track = esd->GetTrack(iTrack);
73318471 752 if (AcceptTrack(track))
36853ddd 753 acceptedTracks->Add(track);
73318471 754 }
73318471 755 return acceptedTracks;
756}
757
36853ddd 758
73318471 759//____________________________________________________________________
760Int_t AliESDtrackCuts::CountAcceptedTracks(AliESD* esd)
761{
762 //
763 // returns an the number of tracks that pass the cuts
764 //
765
766 Int_t count = 0;
767
768 // loop over esd tracks
769 for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
770 AliESDtrack* track = esd->GetTrack(iTrack);
771
772 if (AcceptTrack(track))
773 count++;
774 }
775
776 return count;
777}
778
779//____________________________________________________________________
36853ddd 780TObjArray* AliESDtrackCuts::GetAcceptedTracks(AliESDEvent* esd,Bool_t bTPC)
73318471 781{
782 //
783 // returns an array of all tracks that pass the cuts
36853ddd 784 // or an array of TPC only tracks (propagated to the TPC vertex during reco)
785 // tracks that pass the cut
73318471 786
787 TObjArray* acceptedTracks = new TObjArray();
788
789 // loop over esd tracks
790 for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
791 AliESDtrack* track = esd->GetTrack(iTrack);
792
36853ddd 793 if(bTPC){
794 if(!esd->GetPrimaryVertexTPC())return acceptedTracks; // No TPC vertex no TPC tracks
795
796 AliESDtrack *tpcTrack = new AliESDtrack();
797 bool bAdd = false;
798 Double_t pTPC[2],covTPC[3];
799 // This should have been done during the reconstruction
800 // fixed by Juri in r26675
801 // but recalculate for older data CKB
802 Float_t p[2],cov[3];
803 track->GetImpactParametersTPC(p,cov);
804 if(p[0]==0&&p[1]==0){
805 track->RelateToVertexTPC(esd->GetPrimaryVertexTPC(),esd->GetMagneticField(),kVeryBig);
806 }
807 // BKC
808
809 if(track->FillTPCOnlyTrack(*tpcTrack)){ // only true if we have a tpc track
810 // propagate to Vertex
811 // not needed for normal reconstructed ESDs...
812 // if(tpcTrack->PropagateToDCA(esd->GetPrimaryVertexTPC(), esd->GetMagneticField(), 10000, pTPC, covTPC))
813 if(AcceptTrack(tpcTrack)){
814 acceptedTracks->Add(tpcTrack);
815 bAdd = true;
816 }
817 }
818 if(!bAdd)delete tpcTrack;
819 }
820 else if(AcceptTrack(track)){// we cut by passing the original track
821 // default case
73318471 822 acceptedTracks->Add(track);
36853ddd 823 }
824 }
825 if(bTPC)acceptedTracks->SetOwner(kTRUE);
73318471 826 return acceptedTracks;
827}
828
829//____________________________________________________________________
830Int_t AliESDtrackCuts::CountAcceptedTracks(AliESDEvent* esd)
831{
832 //
833 // returns an the number of tracks that pass the cuts
834 //
835
836 Int_t count = 0;
837
838 // loop over esd tracks
839 for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
840 AliESDtrack* track = esd->GetTrack(iTrack);
73318471 841 if (AcceptTrack(track))
842 count++;
843 }
844
845 return count;
846}
847
848//____________________________________________________________________
849 void AliESDtrackCuts::DefineHistograms(Int_t color) {
850 //
851 // diagnostics histograms are defined
852 //
853
854 fHistogramsOn=kTRUE;
855
856 Bool_t oldStatus = TH1::AddDirectoryStatus();
857 TH1::AddDirectory(kFALSE);
858
859 //###################################################################################
860 // defining histograms
861
862 fhCutStatistics = new TH1F("cut_statistics","cut statistics",kNCuts+4,-0.5,kNCuts+3.5);
863
864 fhCutStatistics->GetXaxis()->SetBinLabel(1,"n tracks");
865 fhCutStatistics->GetXaxis()->SetBinLabel(2,"n cut tracks");
866
867 fhCutCorrelation = new TH2F("cut_correlation","cut correlation",kNCuts,-0.5,kNCuts-0.5,kNCuts,-0.5,kNCuts-0.5);;
868
869 for (Int_t i=0; i<kNCuts; i++) {
870 fhCutStatistics->GetXaxis()->SetBinLabel(i+4,fgkCutNames[i]);
871 fhCutCorrelation->GetXaxis()->SetBinLabel(i+1,fgkCutNames[i]);
872 fhCutCorrelation->GetYaxis()->SetBinLabel(i+1,fgkCutNames[i]);
873 }
874
875 fhCutStatistics ->SetLineColor(color);
876 fhCutCorrelation ->SetLineColor(color);
877 fhCutStatistics ->SetLineWidth(2);
878 fhCutCorrelation ->SetLineWidth(2);
879
880 Char_t str[256];
881 for (Int_t i=0; i<2; i++) {
882 if (i==0) sprintf(str," ");
883 else sprintf(str,"_cut");
884
885 fhNClustersITS[i] = new TH1F(Form("nClustersITS%s",str) ,"",8,-0.5,7.5);
886 fhNClustersTPC[i] = new TH1F(Form("nClustersTPC%s",str) ,"",165,-0.5,164.5);
887 fhChi2PerClusterITS[i] = new TH1F(Form("chi2PerClusterITS%s",str),"",500,0,10);
888 fhChi2PerClusterTPC[i] = new TH1F(Form("chi2PerClusterTPC%s",str),"",500,0,10);
889
890 fhC11[i] = new TH1F(Form("covMatrixDiagonal11%s",str),"",2000,0,20);
891 fhC22[i] = new TH1F(Form("covMatrixDiagonal22%s",str),"",2000,0,20);
892 fhC33[i] = new TH1F(Form("covMatrixDiagonal33%s",str),"",1000,0,1);
893 fhC44[i] = new TH1F(Form("covMatrixDiagonal44%s",str),"",1000,0,5);
894 fhC55[i] = new TH1F(Form("covMatrixDiagonal55%s",str),"",1000,0,5);
895
896 fhDXY[i] = new TH1F(Form("dXY%s",str) ,"",500,-10,10);
897 fhDZ[i] = new TH1F(Form("dZ%s",str) ,"",500,-10,10);
898 fhDXYvsDZ[i] = new TH2F(Form("dXYvsDZ%s",str),"",200,-10,10,200,-10,10);
899
900 fhDXYNormalized[i] = new TH1F(Form("dXYNormalized%s",str) ,"",500,-10,10);
901 fhDZNormalized[i] = new TH1F(Form("dZNormalized%s",str) ,"",500,-10,10);
902 fhDXYvsDZNormalized[i] = new TH2F(Form("dXYvsDZNormalized%s",str),"",200,-10,10,200,-10,10);
903
904 fhNSigmaToVertex[i] = new TH1F(Form("nSigmaToVertex%s",str),"",500,0,50);
905
906 fhPt[i] = new TH1F(Form("pt%s",str) ,"p_{T} distribution;p_{T} (GeV/c)",500,0.0,100.0);
907 fhEta[i] = new TH1F(Form("eta%s",str) ,"#eta distribution;#eta",40,-2.0,2.0);
908
909 fhNClustersITS[i]->SetTitle("n ITS clusters");
910 fhNClustersTPC[i]->SetTitle("n TPC clusters");
911 fhChi2PerClusterITS[i]->SetTitle("#Chi^{2} per ITS cluster");
912 fhChi2PerClusterTPC[i]->SetTitle("#Chi^{2} per TPC cluster");
913
914 fhC11[i]->SetTitle("cov 11 : #sigma_{y}^{2} [cm^{2}]");
915 fhC22[i]->SetTitle("cov 22 : #sigma_{z}^{2} [cm^{2}]");
916 fhC33[i]->SetTitle("cov 33 : #sigma_{sin(#phi)}^{2}");
917 fhC44[i]->SetTitle("cov 44 : #sigma_{tan(#theta_{dip})}^{2}");
918 fhC55[i]->SetTitle("cov 55 : #sigma_{1/p_{T}}^{2} [(c/GeV)^2]");
919
920 fhDXY[i]->SetTitle("transverse impact parameter");
921 fhDZ[i]->SetTitle("longitudinal impact parameter");
922 fhDXYvsDZ[i]->SetTitle("longitudinal impact parameter");
923 fhDXYvsDZ[i]->SetYTitle("transverse impact parameter");
924
925 fhDXYNormalized[i]->SetTitle("normalized trans impact par");
926 fhDZNormalized[i]->SetTitle("normalized long impact par");
927 fhDXYvsDZNormalized[i]->SetTitle("normalized long impact par");
928 fhDXYvsDZNormalized[i]->SetYTitle("normalized trans impact par");
929 fhNSigmaToVertex[i]->SetTitle("n #sigma to vertex");
930
931 fhNClustersITS[i]->SetLineColor(color); fhNClustersITS[i]->SetLineWidth(2);
932 fhNClustersTPC[i]->SetLineColor(color); fhNClustersTPC[i]->SetLineWidth(2);
933 fhChi2PerClusterITS[i]->SetLineColor(color); fhChi2PerClusterITS[i]->SetLineWidth(2);
934 fhChi2PerClusterTPC[i]->SetLineColor(color); fhChi2PerClusterTPC[i]->SetLineWidth(2);
935
936 fhC11[i]->SetLineColor(color); fhC11[i]->SetLineWidth(2);
937 fhC22[i]->SetLineColor(color); fhC22[i]->SetLineWidth(2);
938 fhC33[i]->SetLineColor(color); fhC33[i]->SetLineWidth(2);
939 fhC44[i]->SetLineColor(color); fhC44[i]->SetLineWidth(2);
940 fhC55[i]->SetLineColor(color); fhC55[i]->SetLineWidth(2);
941
942 fhDXY[i]->SetLineColor(color); fhDXY[i]->SetLineWidth(2);
943 fhDZ[i]->SetLineColor(color); fhDZ[i]->SetLineWidth(2);
944
945 fhDXYNormalized[i]->SetLineColor(color); fhDXYNormalized[i]->SetLineWidth(2);
946 fhDZNormalized[i]->SetLineColor(color); fhDZNormalized[i]->SetLineWidth(2);
947 fhNSigmaToVertex[i]->SetLineColor(color); fhNSigmaToVertex[i]->SetLineWidth(2);
948 }
949
950 // The number of sigmas to the vertex is per definition gaussian
951 ffDTheoretical = new TF1("nSigmaToVertexTheoretical","([0]/2.506628274)*exp(-(x**2)/2)",0,50);
952 ffDTheoretical->SetParameter(0,1);
953
954 TH1::AddDirectory(oldStatus);
955}
956
957//____________________________________________________________________
958Bool_t AliESDtrackCuts::LoadHistograms(const Char_t* dir)
959{
960 //
961 // loads the histograms from a file
962 // if dir is empty a directory with the name of this object is taken (like in SaveHistogram)
963 //
964
965 if (!dir)
966 dir = GetName();
967
968 if (!gDirectory->cd(dir))
969 return kFALSE;
970
971 ffDTheoretical = dynamic_cast<TF1*> (gDirectory->Get("nSigmaToVertexTheory"));
972
973 fhCutStatistics = dynamic_cast<TH1F*> (gDirectory->Get("cut_statistics"));
974 fhCutCorrelation = dynamic_cast<TH2F*> (gDirectory->Get("cut_correlation"));
975
976 Char_t str[5];
977 for (Int_t i=0; i<2; i++) {
978 if (i==0)
979 {
980 gDirectory->cd("before_cuts");
981 str[0] = 0;
982 }
983 else
984 {
985 gDirectory->cd("after_cuts");
986 sprintf(str,"_cut");
987 }
988
989 fhNClustersITS[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("nClustersITS%s",str) ));
990 fhNClustersTPC[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("nClustersTPC%s",str) ));
991 fhChi2PerClusterITS[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("chi2PerClusterITS%s",str)));
992 fhChi2PerClusterTPC[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("chi2PerClusterTPC%s",str)));
993
994 fhC11[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("covMatrixDiagonal11%s",str)));
995 fhC22[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("covMatrixDiagonal22%s",str)));
996 fhC33[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("covMatrixDiagonal33%s",str)));
997 fhC44[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("covMatrixDiagonal44%s",str)));
998 fhC55[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("covMatrixDiagonal55%s",str)));
999
1000 fhDXY[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("dXY%s",str) ));
1001 fhDZ[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("dZ%s",str) ));
1002 fhDXYvsDZ[i] = dynamic_cast<TH2F*> (gDirectory->Get(Form("dXYvsDZ%s",str)));
1003
1004 fhDXYNormalized[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("dXYNormalized%s",str) ));
1005 fhDZNormalized[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("dZNormalized%s",str) ));
1006 fhDXYvsDZNormalized[i] = dynamic_cast<TH2F*> (gDirectory->Get(Form("dXYvsDZNormalized%s",str)));
1007 fhNSigmaToVertex[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("nSigmaToVertex%s",str)));
1008
1009 fhPt[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("pt%s",str)));
1010 fhEta[i] = dynamic_cast<TH1F*> (gDirectory->Get(Form("eta%s",str)));
1011
1012 gDirectory->cd("../");
1013 }
1014
1015 gDirectory->cd("..");
1016
1017 return kTRUE;
1018}
1019
1020//____________________________________________________________________
1021void AliESDtrackCuts::SaveHistograms(const Char_t* dir) {
1022 //
1023 // saves the histograms in a directory (dir)
1024 //
1025
1026 if (!fHistogramsOn) {
1027 AliDebug(0, "Histograms not on - cannot save histograms!!!");
1028 return;
1029 }
1030
1031 if (!dir)
1032 dir = GetName();
1033
1034 gDirectory->mkdir(dir);
1035 gDirectory->cd(dir);
1036
1037 gDirectory->mkdir("before_cuts");
1038 gDirectory->mkdir("after_cuts");
1039
1040 // a factor of 2 is needed since n sigma is positive
1041 ffDTheoretical->SetParameter(0,2*fhNSigmaToVertex[0]->Integral("width"));
1042 ffDTheoretical->Write("nSigmaToVertexTheory");
1043
1044 fhCutStatistics->Write();
1045 fhCutCorrelation->Write();
1046
1047 for (Int_t i=0; i<2; i++) {
1048 if (i==0)
1049 gDirectory->cd("before_cuts");
1050 else
1051 gDirectory->cd("after_cuts");
1052
1053 fhNClustersITS[i] ->Write();
1054 fhNClustersTPC[i] ->Write();
1055 fhChi2PerClusterITS[i] ->Write();
1056 fhChi2PerClusterTPC[i] ->Write();
1057
1058 fhC11[i] ->Write();
1059 fhC22[i] ->Write();
1060 fhC33[i] ->Write();
1061 fhC44[i] ->Write();
1062 fhC55[i] ->Write();
1063
1064 fhDXY[i] ->Write();
1065 fhDZ[i] ->Write();
1066 fhDXYvsDZ[i] ->Write();
1067
1068 fhDXYNormalized[i] ->Write();
1069 fhDZNormalized[i] ->Write();
1070 fhDXYvsDZNormalized[i] ->Write();
1071 fhNSigmaToVertex[i] ->Write();
1072
1073 fhPt[i] ->Write();
1074 fhEta[i] ->Write();
1075
1076 gDirectory->cd("../");
1077 }
1078
1079 gDirectory->cd("../");
1080}
1081
1082//____________________________________________________________________
1083void AliESDtrackCuts::DrawHistograms()
1084{
1085 // draws some histograms
1086
1087 TCanvas* canvas1 = new TCanvas(Form("%s_1", GetName()), "Track Quality Results1", 800, 800);
1088 canvas1->Divide(2, 2);
1089
1090 canvas1->cd(1);
1091 fhNClustersTPC[0]->SetStats(kFALSE);
1092 fhNClustersTPC[0]->Draw();
1093
1094 canvas1->cd(2);
1095 fhChi2PerClusterTPC[0]->SetStats(kFALSE);
1096 fhChi2PerClusterTPC[0]->Draw();
1097
1098 canvas1->cd(3);
1099 fhNSigmaToVertex[0]->SetStats(kFALSE);
1100 fhNSigmaToVertex[0]->GetXaxis()->SetRangeUser(0, 10);
1101 fhNSigmaToVertex[0]->Draw();
1102
1103 canvas1->SaveAs(Form("%s_%s.gif", GetName(), canvas1->GetName()));
1104
1105 TCanvas* canvas2 = new TCanvas(Form("%s_2", GetName()), "Track Quality Results2", 1200, 800);
1106 canvas2->Divide(3, 2);
1107
1108 canvas2->cd(1);
1109 fhC11[0]->SetStats(kFALSE);
1110 gPad->SetLogy();
1111 fhC11[0]->Draw();
1112
1113 canvas2->cd(2);
1114 fhC22[0]->SetStats(kFALSE);
1115 gPad->SetLogy();
1116 fhC22[0]->Draw();
1117
1118 canvas2->cd(3);
1119 fhC33[0]->SetStats(kFALSE);
1120 gPad->SetLogy();
1121 fhC33[0]->Draw();
1122
1123 canvas2->cd(4);
1124 fhC44[0]->SetStats(kFALSE);
1125 gPad->SetLogy();
1126 fhC44[0]->Draw();
1127
1128 canvas2->cd(5);
1129 fhC55[0]->SetStats(kFALSE);
1130 gPad->SetLogy();
1131 fhC55[0]->Draw();
1132
1133 canvas2->SaveAs(Form("%s_%s.gif", GetName(), canvas2->GetName()));
1134
1135 TCanvas* canvas3 = new TCanvas(Form("%s_3", GetName()), "Track Quality Results3", 1200, 800);
1136 canvas3->Divide(3, 2);
1137
1138 canvas3->cd(1);
1139 fhDXY[0]->SetStats(kFALSE);
1140 gPad->SetLogy();
1141 fhDXY[0]->Draw();
1142
1143 canvas3->cd(2);
1144 fhDZ[0]->SetStats(kFALSE);
1145 gPad->SetLogy();
1146 fhDZ[0]->Draw();
1147
1148 canvas3->cd(3);
1149 fhDXYvsDZ[0]->SetStats(kFALSE);
1150 gPad->SetLogz();
1151 gPad->SetRightMargin(0.15);
1152 fhDXYvsDZ[0]->Draw("COLZ");
1153
1154 canvas3->cd(4);
1155 fhDXYNormalized[0]->SetStats(kFALSE);
1156 gPad->SetLogy();
1157 fhDXYNormalized[0]->Draw();
1158
1159 canvas3->cd(5);
1160 fhDZNormalized[0]->SetStats(kFALSE);
1161 gPad->SetLogy();
1162 fhDZNormalized[0]->Draw();
1163
1164 canvas3->cd(6);
1165 fhDXYvsDZNormalized[0]->SetStats(kFALSE);
1166 gPad->SetLogz();
1167 gPad->SetRightMargin(0.15);
1168 fhDXYvsDZNormalized[0]->Draw("COLZ");
1169
1170 canvas3->SaveAs(Form("%s_%s.gif", GetName(), canvas3->GetName()));
1171
1172 TCanvas* canvas4 = new TCanvas(Form("%s_4", GetName()), "Track Quality Results4", 800, 500);
1173 canvas4->Divide(2, 1);
1174
1175 canvas4->cd(1);
1176 fhCutStatistics->SetStats(kFALSE);
1177 fhCutStatistics->LabelsOption("v");
1178 gPad->SetBottomMargin(0.3);
1179 fhCutStatistics->Draw();
1180
1181 canvas4->cd(2);
1182 fhCutCorrelation->SetStats(kFALSE);
1183 fhCutCorrelation->LabelsOption("v");
1184 gPad->SetBottomMargin(0.3);
1185 gPad->SetLeftMargin(0.3);
1186 fhCutCorrelation->Draw("COLZ");
1187
1188 canvas4->SaveAs(Form("%s_%s.gif", GetName(), canvas4->GetName()));
1189
1190 /*canvas->cd(1);
1191 fhDXYvsDZNormalized[0]->SetStats(kFALSE);
1192 fhDXYvsDZNormalized[0]->DrawCopy("COLZ");
1193
1194 canvas->cd(2);
1195 fhNClustersTPC[0]->SetStats(kFALSE);
1196 fhNClustersTPC[0]->DrawCopy();
1197
1198 canvas->cd(3);
1199 fhChi2PerClusterITS[0]->SetStats(kFALSE);
1200 fhChi2PerClusterITS[0]->DrawCopy();
1201 fhChi2PerClusterITS[1]->SetLineColor(2);
1202 fhChi2PerClusterITS[1]->DrawCopy("SAME");
1203
1204 canvas->cd(4);
1205 fhChi2PerClusterTPC[0]->SetStats(kFALSE);
1206 fhChi2PerClusterTPC[0]->DrawCopy();
1207 fhChi2PerClusterTPC[1]->SetLineColor(2);
1208 fhChi2PerClusterTPC[1]->DrawCopy("SAME");*/
1209}
1210