1 #include "AliESDtrackCuts.h"
4 #include <AliESDtrack.h>
9 //____________________________________________________________________
10 ClassImp(AliESDtrackCuts)
13 const Char_t* AliESDtrackCuts::fgkCutNames[kNCuts] = {
18 "#Chi^{2}/clusters TPC",
19 "#Chi^{2}/clusters ITS",
37 //____________________________________________________________________
38 AliESDtrackCuts::AliESDtrackCuts() : TNamed(),
39 fCutMinNClusterTPC(0),
40 fCutMinNClusterITS(0),
41 fCutMaxChi2PerClusterTPC(0),
42 fCutMaxChi2PerClusterITS(0),
48 fCutAcceptKinkDaughters(0),
49 fCutRequireTPCRefit(0),
50 fCutRequireITSRefit(0),
51 fCutNsigmaToVertex(0),
52 fCutSigmaToVertexRequired(0),
73 // default constructor
79 //____________________________________________________________________
80 AliESDtrackCuts::AliESDtrackCuts(Char_t* name, Char_t* title) : TNamed(name,title),
81 fCutMinNClusterTPC(0),
82 fCutMinNClusterITS(0),
83 fCutMaxChi2PerClusterTPC(0),
84 fCutMaxChi2PerClusterITS(0),
90 fCutAcceptKinkDaughters(0),
91 fCutRequireTPCRefit(0),
92 fCutRequireITSRefit(0),
93 fCutNsigmaToVertex(0),
94 fCutSigmaToVertexRequired(0),
119 //##############################################################################
120 // setting default cuts
121 SetMinNClustersTPC();
122 SetMinNClustersITS();
123 SetMaxChi2PerClusterTPC();
124 SetMaxChi2PerClusterITS();
125 SetMaxCovDiagonalElements();
126 SetRequireTPCRefit();
127 SetRequireITSRefit();
128 SetAcceptKingDaughters();
129 SetMinNsigmaToVertex();
130 SetRequireSigmaToVertex();
142 //_____________________________________________________________________________
143 AliESDtrackCuts::AliESDtrackCuts(const AliESDtrackCuts &c) : TNamed(c),
144 fCutMinNClusterTPC(0),
145 fCutMinNClusterITS(0),
146 fCutMaxChi2PerClusterTPC(0),
147 fCutMaxChi2PerClusterITS(0),
153 fCutAcceptKinkDaughters(0),
154 fCutRequireTPCRefit(0),
155 fCutRequireITSRefit(0),
156 fCutNsigmaToVertex(0),
157 fCutSigmaToVertexRequired(0),
181 ((AliESDtrackCuts &) c).Copy(*this);
184 AliESDtrackCuts::~AliESDtrackCuts()
190 for (Int_t i=0; i<2; i++) {
192 if (fhNClustersITS[i])
193 delete fhNClustersITS[i];
194 if (fhNClustersTPC[i])
195 delete fhNClustersTPC[i];
196 if (fhChi2PerClusterITS[i])
197 delete fhChi2PerClusterITS[i];
198 if (fhChi2PerClusterTPC[i])
199 delete fhChi2PerClusterTPC[i];
218 if (fhDXYNormalized[i])
219 delete fhDXYNormalized[i];
220 if (fhDZNormalized[i])
221 delete fhDZNormalized[i];
222 if (fhDXYvsDZNormalized[i])
223 delete fhDXYvsDZNormalized[i];
224 if (fhNSigmaToVertex[i])
225 delete fhNSigmaToVertex[i];
229 delete ffDTheoretical;
232 delete fhCutStatistics;
233 if (fhCutCorrelation)
234 delete fhCutCorrelation;
237 void AliESDtrackCuts::Init()
240 // sets everything to zero
243 fCutMinNClusterTPC = 0;
244 fCutMinNClusterITS = 0;
246 fCutMaxChi2PerClusterTPC = 0;
247 fCutMaxChi2PerClusterITS = 0;
255 fCutAcceptKinkDaughters = 0;
256 fCutRequireTPCRefit = 0;
257 fCutRequireITSRefit = 0;
259 fCutNsigmaToVertex = 0;
260 fCutSigmaToVertexRequired = 0;
277 fHistogramsOn = kFALSE;
279 for (Int_t i=0; i<2; ++i)
281 fhNClustersITS[i] = 0;
282 fhNClustersTPC[i] = 0;
284 fhChi2PerClusterITS[i] = 0;
285 fhChi2PerClusterTPC[i] = 0;
297 fhDXYNormalized[i] = 0;
298 fhDZNormalized[i] = 0;
299 fhDXYvsDZNormalized[i] = 0;
300 fhNSigmaToVertex[i] = 0;
305 fhCutCorrelation = 0;
308 //_____________________________________________________________________________
309 AliESDtrackCuts &AliESDtrackCuts::operator=(const AliESDtrackCuts &c)
312 // Assignment operator
315 if (this != &c) ((AliESDtrackCuts &) c).Copy(*this);
319 //_____________________________________________________________________________
320 void AliESDtrackCuts::Copy(TObject &c) const
326 AliESDtrackCuts& target = (AliESDtrackCuts &) c;
330 target.fCutMinNClusterTPC = fCutMinNClusterTPC;
331 target.fCutMinNClusterITS = fCutMinNClusterITS;
333 target.fCutMaxChi2PerClusterTPC = fCutMaxChi2PerClusterTPC;
334 target.fCutMaxChi2PerClusterITS = fCutMaxChi2PerClusterITS;
336 target.fCutMaxC11 = fCutMaxC11;
337 target.fCutMaxC22 = fCutMaxC22;
338 target.fCutMaxC33 = fCutMaxC33;
339 target.fCutMaxC44 = fCutMaxC44;
340 target.fCutMaxC55 = fCutMaxC55;
342 target.fCutAcceptKinkDaughters = fCutAcceptKinkDaughters;
343 target.fCutRequireTPCRefit = fCutRequireTPCRefit;
344 target.fCutRequireITSRefit = fCutRequireITSRefit;
346 target.fCutNsigmaToVertex = fCutNsigmaToVertex;
347 target.fCutSigmaToVertexRequired = fCutSigmaToVertexRequired;
349 target.fPMin = fPMin;
350 target.fPMax = fPMax;
351 target.fPtMin = fPtMin;
352 target.fPtMax = fPtMax;
353 target.fPxMin = fPxMin;
354 target.fPxMax = fPxMax;
355 target.fPyMin = fPyMin;
356 target.fPyMax = fPyMax;
357 target.fPzMin = fPzMin;
358 target.fPzMax = fPzMax;
359 target.fEtaMin = fEtaMin;
360 target.fEtaMax = fEtaMax;
361 target.fRapMin = fRapMin;
362 target.fRapMax = fRapMax;
364 target.fHistogramsOn = fHistogramsOn;
366 for (Int_t i=0; i<2; ++i)
368 if (fhNClustersITS[i]) target.fhNClustersITS[i] = (TH1F*) fhNClustersITS[i]->Clone();
369 if (fhNClustersTPC[i]) target.fhNClustersTPC[i] = (TH1F*) fhNClustersTPC[i]->Clone();
371 if (fhChi2PerClusterITS[i]) target.fhChi2PerClusterITS[i] = (TH1F*) fhChi2PerClusterITS[i]->Clone();
372 if (fhChi2PerClusterTPC[i]) target.fhChi2PerClusterTPC[i] = (TH1F*) fhChi2PerClusterTPC[i]->Clone();
374 if (fhC11[i]) target.fhC11[i] = (TH1F*) fhC11[i]->Clone();
375 if (fhC22[i]) target.fhC22[i] = (TH1F*) fhC22[i]->Clone();
376 if (fhC33[i]) target.fhC33[i] = (TH1F*) fhC33[i]->Clone();
377 if (fhC44[i]) target.fhC44[i] = (TH1F*) fhC44[i]->Clone();
378 if (fhC55[i]) target.fhC55[i] = (TH1F*) fhC55[i]->Clone();
380 if (fhDXY[i]) target.fhDXY[i] = (TH1F*) fhDXY[i]->Clone();
381 if (fhDZ[i]) target.fhDZ[i] = (TH1F*) fhDZ[i]->Clone();
382 if (fhDXYvsDZ[i]) target.fhDXYvsDZ[i] = (TH2F*) fhDXYvsDZ[i]->Clone();
384 if (fhDXYNormalized[i]) target.fhDXYNormalized[i] = (TH1F*) fhDXYNormalized[i]->Clone();
385 if (fhDZNormalized[i]) target.fhDZNormalized[i] = (TH1F*) fhDZNormalized[i]->Clone();
386 if (fhDXYvsDZNormalized[i]) target.fhDXYvsDZNormalized[i] = (TH2F*) fhDXYvsDZNormalized[i]->Clone();
387 if (fhNSigmaToVertex[i]) target.fhNSigmaToVertex[i] = (TH1F*) fhNSigmaToVertex[i]->Clone();
389 if (ffDTheoretical) target.ffDTheoretical = (TF1*) ffDTheoretical->Clone();
391 if (fhCutStatistics) target.fhCutStatistics = (TH1F*) fhCutStatistics->Clone();
392 if (fhCutCorrelation) target.fhCutCorrelation = (TH2F*) fhCutCorrelation->Clone();
397 //_____________________________________________________________________________
398 Long64_t AliESDtrackCuts::Merge(TCollection* list) {
399 // Merge a list of AliESDtrackCuts objects with this (needed for PROOF)
400 // Returns the number of merged objects (including this)
411 TIterator* iter = list->MakeIterator();
415 // collection of measured and generated histograms
417 while ((obj = iter->Next())) {
419 AliESDtrackCuts* entry = dynamic_cast<AliESDtrackCuts*>(obj);
423 if (!entry->fHistogramsOn)
426 for (Int_t i=0; i<2; i++) {
428 fhNClustersITS[i] ->Add(entry->fhNClustersITS[i] );
429 fhNClustersTPC[i] ->Add(entry->fhNClustersTPC[i] );
431 fhChi2PerClusterITS[i] ->Add(entry->fhChi2PerClusterITS[i]);
432 fhChi2PerClusterTPC[i] ->Add(entry->fhChi2PerClusterTPC[i]);
434 fhC11[i] ->Add(entry->fhC11[i] );
435 fhC22[i] ->Add(entry->fhC22[i] );
436 fhC33[i] ->Add(entry->fhC33[i] );
437 fhC44[i] ->Add(entry->fhC44[i] );
438 fhC55[i] ->Add(entry->fhC55[i] );
440 fhDXY[i] ->Add(entry->fhDXY[i] );
441 fhDZ[i] ->Add(entry->fhDZ[i] );
442 fhDXYvsDZ[i] ->Add(entry->fhDXYvsDZ[i] );
444 fhDXYNormalized[i] ->Add(entry->fhDXYNormalized[i] );
445 fhDZNormalized[i] ->Add(entry->fhDZNormalized[i] );
446 fhDXYvsDZNormalized[i] ->Add(entry->fhDXYvsDZNormalized[i]);
447 fhNSigmaToVertex[i] ->Add(entry->fhNSigmaToVertex[i]);
451 fhCutStatistics ->Add(entry->fhCutStatistics);
452 fhCutCorrelation ->Add(entry->fhCutCorrelation);
461 //____________________________________________________________________
462 Float_t AliESDtrackCuts::GetSigmaToVertex(AliESDtrack* esdTrack)
464 // Calculates the number of sigma to the vertex.
469 esdTrack->GetImpactParameters(b,bCov);
470 if (bCov[0]<=0 || bCov[2]<=0) {
471 AliDebug(1, "Estimated b resolution lower or equal zero!");
472 bCov[0]=0; bCov[2]=0;
474 bRes[0] = TMath::Sqrt(bCov[0]);
475 bRes[1] = TMath::Sqrt(bCov[2]);
477 // -----------------------------------
478 // How to get to a n-sigma cut?
480 // The accumulated statistics from 0 to d is
482 // -> Erf(d/Sqrt(2)) for a 1-dim gauss (d = n_sigma)
483 // -> 1 - Exp(-d**2) for a 2-dim gauss (d*d = dx*dx + dy*dy != n_sigma)
485 // It means that for a 2-dim gauss: n_sigma(d) = Sqrt(2)*ErfInv(1 - Exp((-x**2)/2)
486 // Can this be expressed in a different way?
488 if (bRes[0] == 0 || bRes[1] ==0)
491 Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2));
493 // stupid rounding problem screws up everything:
494 // if d is too big, TMath::Exp(...) gets 0, and TMath::ErfInverse(1) that should be infinite, gets 0 :(
495 if (TMath::Exp(-d * d / 2) < 1e-10)
498 d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2);
502 void AliESDtrackCuts::EnableNeededBranches(TTree* tree)
504 // enables the branches needed by AcceptTrack, for a list see comment of AcceptTrack
506 tree->SetBranchStatus("fTracks.fFlags", 1);
507 tree->SetBranchStatus("fTracks.fITSncls", 1);
508 tree->SetBranchStatus("fTracks.fTPCncls", 1);
509 tree->SetBranchStatus("fTracks.fITSchi2", 1);
510 tree->SetBranchStatus("fTracks.fTPCchi2", 1);
511 tree->SetBranchStatus("fTracks.fC*", 1);
512 tree->SetBranchStatus("fTracks.fD", 1);
513 tree->SetBranchStatus("fTracks.fZ", 1);
514 tree->SetBranchStatus("fTracks.fCdd", 1);
515 tree->SetBranchStatus("fTracks.fCdz", 1);
516 tree->SetBranchStatus("fTracks.fCzz", 1);
517 tree->SetBranchStatus("fTracks.fP*", 1);
518 tree->SetBranchStatus("fTracks.fR*", 1);
519 tree->SetBranchStatus("fTracks.fKinkIndexes*", 1);
522 //____________________________________________________________________
524 AliESDtrackCuts::AcceptTrack(AliESDtrack* esdTrack) {
526 // figure out if the tracks survives all the track cuts defined
528 // the different quality parameter and kinematic values are first
529 // retrieved from the track. then it is found out what cuts the
530 // track did not survive and finally the cuts are imposed.
532 // this function needs the following branches:
538 // fTracks.fC //GetExternalCovariance
539 // fTracks.fD //GetImpactParameters
540 // fTracks.fZ //GetImpactParameters
541 // fTracks.fCdd //GetImpactParameters
542 // fTracks.fCdz //GetImpactParameters
543 // fTracks.fCzz //GetImpactParameters
544 // fTracks.fP //GetPxPyPz
545 // fTracks.fR //GetMass
546 // fTracks.fP //GetMass
547 // fTracks.fKinkIndexes
549 UInt_t status = esdTrack->GetStatus();
554 // getting quality parameters from the ESD track
555 Int_t nClustersITS = esdTrack->GetITSclusters(fIdxInt);
556 Int_t nClustersTPC = esdTrack->GetTPCclusters(fIdxInt);
560 Float_t chi2PerClusterITS = -1;
561 Float_t chi2PerClusterTPC = -1;
563 chi2PerClusterITS = esdTrack->GetITSchi2()/Float_t(nClustersITS);
565 chi2PerClusterTPC = esdTrack->GetTPCchi2()/Float_t(nClustersTPC);
568 esdTrack->GetExternalCovariance(extCov);
570 // getting the track to vertex parameters
571 Float_t nSigmaToVertex = GetSigmaToVertex(esdTrack);
573 // getting the kinematic variables of the track
574 // (assuming the mass is known)
576 esdTrack->GetPxPyPz(p);
577 Float_t momentum = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2) + TMath::Power(p[2],2));
578 Float_t pt = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2));
579 Float_t energy = TMath::Sqrt(TMath::Power(esdTrack->GetMass(),2) + TMath::Power(momentum,2));
582 //y-eta related calculations
585 if((momentum != TMath::Abs(p[2]))&&(momentum != 0))
586 eta = 0.5*TMath::Log((momentum + p[2])/(momentum - p[2]));
587 if((energy != TMath::Abs(p[2]))&&(momentum != 0))
588 y = 0.5*TMath::Log((energy + p[2])/(energy - p[2]));
591 //########################################################################
595 for (Int_t i=0; i<kNCuts; i++) cuts[i]=kFALSE;
597 // track quality cuts
598 if (fCutRequireTPCRefit && (status&AliESDtrack::kTPCrefit)==0)
600 if (fCutRequireITSRefit && (status&AliESDtrack::kITSrefit)==0)
602 if (nClustersTPC<fCutMinNClusterTPC)
604 if (nClustersITS<fCutMinNClusterITS)
606 if (chi2PerClusterTPC>fCutMaxChi2PerClusterTPC)
608 if (chi2PerClusterITS>fCutMaxChi2PerClusterITS)
610 if (extCov[0] > fCutMaxC11)
612 if (extCov[2] > fCutMaxC22)
614 if (extCov[5] > fCutMaxC33)
616 if (extCov[9] > fCutMaxC44)
618 if (extCov[14] > fCutMaxC55)
620 if (nSigmaToVertex > fCutNsigmaToVertex)
622 // if n sigma could not be calculated
623 if (nSigmaToVertex<0 && fCutSigmaToVertexRequired)
625 if (!fCutAcceptKinkDaughters && esdTrack->GetKinkIndex(0)>0)
627 // track kinematics cut
628 if((momentum < fPMin) || (momentum > fPMax))
630 if((pt < fPtMin) || (pt > fPtMax))
632 if((p[0] < fPxMin) || (p[0] > fPxMax))
634 if((p[1] < fPyMin) || (p[1] > fPyMax))
636 if((p[2] < fPzMin) || (p[2] > fPzMax))
638 if((eta < fEtaMin) || (eta > fEtaMax))
640 if((y < fRapMin) || (y > fRapMax))
644 for (Int_t i=0; i<kNCuts; i++)
645 if (cuts[i]) cut = kTRUE;
647 //########################################################################
648 // filling histograms
650 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n tracks")));
653 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n cut tracks")));
655 for (Int_t i=0; i<kNCuts; i++) {
657 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin(fgkCutNames[i])));
659 for (Int_t j=i; j<kNCuts; j++) {
660 if (cuts[i] && cuts[j]) {
661 Float_t x = fhCutCorrelation->GetXaxis()->GetBinCenter(fhCutCorrelation->GetXaxis()->FindBin(fgkCutNames[i]));
662 Float_t y = fhCutCorrelation->GetYaxis()->GetBinCenter(fhCutCorrelation->GetYaxis()->FindBin(fgkCutNames[j]));
663 fhCutCorrelation->Fill(x,y);
669 fhNClustersITS[0]->Fill(nClustersITS);
670 fhNClustersTPC[0]->Fill(nClustersTPC);
671 fhChi2PerClusterITS[0]->Fill(chi2PerClusterITS);
672 fhChi2PerClusterTPC[0]->Fill(chi2PerClusterTPC);
674 fhC11[0]->Fill(extCov[0]);
675 fhC22[0]->Fill(extCov[2]);
676 fhC33[0]->Fill(extCov[5]);
677 fhC44[0]->Fill(extCov[9]);
678 fhC55[0]->Fill(extCov[14]);
683 esdTrack->GetImpactParameters(b,bCov);
684 if (bCov[0]<=0 || bCov[2]<=0) {
685 AliDebug(1, "Estimated b resolution lower or equal zero!");
686 bCov[0]=0; bCov[2]=0;
688 bRes[0] = TMath::Sqrt(bCov[0]);
689 bRes[1] = TMath::Sqrt(bCov[2]);
692 fhDXY[0]->Fill(b[0]);
693 fhDXYvsDZ[0]->Fill(b[1],b[0]);
695 if (bRes[0]!=0 && bRes[1]!=0) {
696 fhDZNormalized[0]->Fill(b[1]/bRes[1]);
697 fhDXYNormalized[0]->Fill(b[0]/bRes[0]);
698 fhDXYvsDZNormalized[0]->Fill(b[1]/bRes[1], b[0]/bRes[0]);
699 fhNSigmaToVertex[0]->Fill(nSigmaToVertex);
703 //########################################################################
705 if (cut) return kFALSE;
707 //########################################################################
708 // filling histograms after cut
710 fhNClustersITS[1]->Fill(nClustersITS);
711 fhNClustersTPC[1]->Fill(nClustersTPC);
712 fhChi2PerClusterITS[1]->Fill(chi2PerClusterITS);
713 fhChi2PerClusterTPC[1]->Fill(chi2PerClusterTPC);
715 fhC11[1]->Fill(extCov[0]);
716 fhC22[1]->Fill(extCov[2]);
717 fhC33[1]->Fill(extCov[5]);
718 fhC44[1]->Fill(extCov[9]);
719 fhC55[1]->Fill(extCov[14]);
724 esdTrack->GetImpactParameters(b,bCov);
725 if (bCov[0]<=0 || bCov[2]<=0) {
726 AliDebug(1, "Estimated b resolution lower or equal zero!");
727 bCov[0]=0; bCov[2]=0;
729 bRes[0] = TMath::Sqrt(bCov[0]);
730 bRes[1] = TMath::Sqrt(bCov[2]);
733 fhDXY[1]->Fill(b[0]);
734 fhDXYvsDZ[1]->Fill(b[1],b[0]);
736 if (bRes[0]!=0 && bRes[1]!=0)
738 fhDZNormalized[1]->Fill(b[1]/bRes[1]);
739 fhDXYNormalized[1]->Fill(b[0]/bRes[0]);
740 fhDXYvsDZNormalized[1]->Fill(b[1]/bRes[1], b[0]/bRes[0]);
741 fhNSigmaToVertex[1]->Fill(nSigmaToVertex);
748 //____________________________________________________________________
750 AliESDtrackCuts::GetAcceptedTracks(AliESD* esd)
753 // returns an array of all tracks that pass the cuts
756 TObjArray* acceptedTracks = new TObjArray();
758 // loop over esd tracks
759 for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
760 AliESDtrack* track = esd->GetTrack(iTrack);
762 if (AcceptTrack(track))
763 acceptedTracks->Add(track);
766 return acceptedTracks;
769 //____________________________________________________________________
771 AliESDtrackCuts::CountAcceptedTracks(AliESD* esd)
774 // returns an the number of tracks that pass the cuts
779 // loop over esd tracks
780 for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
781 AliESDtrack* track = esd->GetTrack(iTrack);
783 if (AcceptTrack(track))
790 //____________________________________________________________________
791 void AliESDtrackCuts::DefineHistograms(Int_t color) {
793 // diagnostics histograms are defined
798 //###################################################################################
799 // defining histograms
801 fhCutStatistics = new TH1F("cut_statistics","cut statistics",kNCuts+4,-0.5,kNCuts+3.5);
803 fhCutStatistics->GetXaxis()->SetBinLabel(1,"n tracks");
804 fhCutStatistics->GetXaxis()->SetBinLabel(2,"n cut tracks");
806 fhCutCorrelation = new TH2F("cut_correlation","cut correlation",kNCuts,-0.5,kNCuts-0.5,kNCuts,-0.5,kNCuts-0.5);;
808 for (Int_t i=0; i<kNCuts; i++) {
809 fhCutStatistics->GetXaxis()->SetBinLabel(i+4,fgkCutNames[i]);
810 fhCutCorrelation->GetXaxis()->SetBinLabel(i+1,fgkCutNames[i]);
811 fhCutCorrelation->GetYaxis()->SetBinLabel(i+1,fgkCutNames[i]);
814 fhCutStatistics ->SetLineColor(color);
815 fhCutCorrelation ->SetLineColor(color);
816 fhCutStatistics ->SetLineWidth(2);
817 fhCutCorrelation ->SetLineWidth(2);
820 for (Int_t i=0; i<2; i++) {
821 if (i==0) sprintf(str," ");
822 else sprintf(str,"_cut");
824 fhNClustersITS[i] = new TH1F(Form("nClustersITS%s",str),"",8,-0.5,7.5);
825 fhNClustersTPC[i] = new TH1F(Form("nClustersTPC%s",str),"",165,-0.5,164.5);
826 fhChi2PerClusterITS[i] = new TH1F(Form("chi2PerClusterITS%s",str),"",500,0,10);
827 fhChi2PerClusterTPC[i] = new TH1F(Form("chi2PerClusterTPC%s",str),"",500,0,10);
829 fhC11[i] = new TH1F(Form("covMatrixDiagonal11%s",str),"",2000,0,20);
830 fhC22[i] = new TH1F(Form("covMatrixDiagonal22%s",str),"",2000,0,20);
831 fhC33[i] = new TH1F(Form("covMatrixDiagonal33%s",str),"",1000,0,1);
832 fhC44[i] = new TH1F(Form("covMatrixDiagonal44%s",str),"",1000,0,5);
833 fhC55[i] = new TH1F(Form("covMatrixDiagonal55%s",str),"",1000,0,5);
835 fhDXY[i] = new TH1F(Form("dXY%s",str),"",500,-10,10);
836 fhDZ[i] = new TH1F(Form("dZ%s",str),"",500,-10,10);
837 fhDXYvsDZ[i] = new TH2F(Form("dXYvsDZ%s",str),"",200,-10,10,200,-10,10);
839 fhDXYNormalized[i] = new TH1F(Form("dXYNormalized%s",str),"",500,-10,10);
840 fhDZNormalized[i] = new TH1F(Form("dZNormalized%s",str),"",500,-10,10);
841 fhDXYvsDZNormalized[i] = new TH2F(Form("dXYvsDZNormalized%s",str),"",200,-10,10,200,-10,10);
843 fhNSigmaToVertex[i] = new TH1F(Form("nSigmaToVertex%s",str),"",500,0,50);
845 fhNClustersITS[i]->SetXTitle("n ITS clusters");
846 fhNClustersTPC[i]->SetXTitle("n TPC clusters");
847 fhChi2PerClusterITS[i]->SetXTitle("#Chi^{2} per ITS cluster");
848 fhChi2PerClusterTPC[i]->SetXTitle("#Chi^{2} per TPC cluster");
850 fhC11[i]->SetXTitle("cov 11 : #sigma_{y}^{2} [cm^{2}]");
851 fhC22[i]->SetXTitle("cov 22 : #sigma_{z}^{2} [cm^{2}]");
852 fhC33[i]->SetXTitle("cov 33 : #sigma_{sin(#phi)}^{2}");
853 fhC44[i]->SetXTitle("cov 44 : #sigma_{tan(#theta_{dip})}^{2}");
854 fhC55[i]->SetXTitle("cov 55 : #sigma_{1/p_{T}}^{2} [(c/GeV)^2]");
856 fhDXY[i]->SetXTitle("transverse impact parameter");
857 fhDZ[i]->SetXTitle("longitudinal impact parameter");
858 fhDXYvsDZ[i]->SetXTitle("longitudinal impact parameter");
859 fhDXYvsDZ[i]->SetYTitle("transverse impact parameter");
861 fhDXYNormalized[i]->SetXTitle("normalized trans impact par");
862 fhDZNormalized[i]->SetXTitle("normalized long impact par");
863 fhDXYvsDZNormalized[i]->SetXTitle("normalized long impact par");
864 fhDXYvsDZNormalized[i]->SetYTitle("normalized trans impact par");
865 fhNSigmaToVertex[i]->SetXTitle("n #sigma to vertex");
867 fhNClustersITS[i]->SetLineColor(color); fhNClustersITS[i]->SetLineWidth(2);
868 fhNClustersTPC[i]->SetLineColor(color); fhNClustersTPC[i]->SetLineWidth(2);
869 fhChi2PerClusterITS[i]->SetLineColor(color); fhChi2PerClusterITS[i]->SetLineWidth(2);
870 fhChi2PerClusterTPC[i]->SetLineColor(color); fhChi2PerClusterTPC[i]->SetLineWidth(2);
872 fhC11[i]->SetLineColor(color); fhC11[i]->SetLineWidth(2);
873 fhC22[i]->SetLineColor(color); fhC22[i]->SetLineWidth(2);
874 fhC33[i]->SetLineColor(color); fhC33[i]->SetLineWidth(2);
875 fhC44[i]->SetLineColor(color); fhC44[i]->SetLineWidth(2);
876 fhC55[i]->SetLineColor(color); fhC55[i]->SetLineWidth(2);
878 fhDXY[i]->SetLineColor(color); fhDXY[i]->SetLineWidth(2);
879 fhDZ[i]->SetLineColor(color); fhDZ[i]->SetLineWidth(2);
881 fhDXYNormalized[i]->SetLineColor(color); fhDXYNormalized[i]->SetLineWidth(2);
882 fhDZNormalized[i]->SetLineColor(color); fhDZNormalized[i]->SetLineWidth(2);
883 fhNSigmaToVertex[i]->SetLineColor(color); fhNSigmaToVertex[i]->SetLineWidth(2);
886 // The number of sigmas to the vertex is per definition gaussian
887 ffDTheoretical = new TF1("nSigmaToVertexTheoretical","([0]/2.506628274)*exp(-(x**2)/2)",0,50);
888 ffDTheoretical->SetParameter(0,1);
893 //____________________________________________________________________
895 AliESDtrackCuts::Print(const Option_t*) const {
897 // print method - still to be implemented
900 AliInfo("AliESDtrackCuts...");
904 //____________________________________________________________________
905 void AliESDtrackCuts::SaveHistograms(Char_t* dir) {
907 // saves the histograms in a directory (dir)
911 if (!fHistogramsOn) {
912 AliDebug(0, "Histograms not on - cannot save histograms!!!");
916 gDirectory->mkdir(dir);
919 gDirectory->mkdir("before_cuts");
920 gDirectory->mkdir("after_cuts");
922 // a factor of 2 is needed since n sigma is positive
923 ffDTheoretical->SetParameter(0,2*fhNSigmaToVertex[0]->Integral("width"));
924 ffDTheoretical->Write("nSigmaToVertexTheory");
926 fhCutStatistics->Write();
927 fhCutCorrelation->Write();
929 for (Int_t i=0; i<2; i++) {
931 gDirectory->cd("before_cuts");
933 gDirectory->cd("after_cuts");
935 fhNClustersITS[i] ->Write();
936 fhNClustersTPC[i] ->Write();
937 fhChi2PerClusterITS[i] ->Write();
938 fhChi2PerClusterTPC[i] ->Write();
948 fhDXYvsDZ[i] ->Write();
950 fhDXYNormalized[i] ->Write();
951 fhDZNormalized[i] ->Write();
952 fhDXYvsDZNormalized[i] ->Write();
953 fhNSigmaToVertex[i] ->Write();
955 gDirectory->cd("../");
958 gDirectory->cd("../");