1 #include "AliESDtrackCuts.h"
4 #include <AliESDtrack.h>
10 //____________________________________________________________________
11 ClassImp(AliESDtrackCuts)
14 const Char_t* AliESDtrackCuts::fgkCutNames[kNCuts] = {
19 "#Chi^{2}/clusters TPC",
20 "#Chi^{2}/clusters ITS",
38 //____________________________________________________________________
39 AliESDtrackCuts::AliESDtrackCuts() : TNamed(),
40 fCutMinNClusterTPC(0),
41 fCutMinNClusterITS(0),
42 fCutMaxChi2PerClusterTPC(0),
43 fCutMaxChi2PerClusterITS(0),
49 fCutAcceptKinkDaughters(0),
50 fCutRequireTPCRefit(0),
51 fCutRequireITSRefit(0),
52 fCutNsigmaToVertex(0),
53 fCutSigmaToVertexRequired(0),
74 // default constructor
80 //____________________________________________________________________
81 AliESDtrackCuts::AliESDtrackCuts(Char_t* name, Char_t* title) : TNamed(name,title),
82 fCutMinNClusterTPC(0),
83 fCutMinNClusterITS(0),
84 fCutMaxChi2PerClusterTPC(0),
85 fCutMaxChi2PerClusterITS(0),
91 fCutAcceptKinkDaughters(0),
92 fCutRequireTPCRefit(0),
93 fCutRequireITSRefit(0),
94 fCutNsigmaToVertex(0),
95 fCutSigmaToVertexRequired(0),
120 //##############################################################################
121 // setting default cuts
122 SetMinNClustersTPC();
123 SetMinNClustersITS();
124 SetMaxChi2PerClusterTPC();
125 SetMaxChi2PerClusterITS();
126 SetMaxCovDiagonalElements();
127 SetRequireTPCRefit();
128 SetRequireITSRefit();
129 SetAcceptKingDaughters();
130 SetMinNsigmaToVertex();
131 SetRequireSigmaToVertex();
143 //_____________________________________________________________________________
144 AliESDtrackCuts::AliESDtrackCuts(const AliESDtrackCuts &c) : TNamed(c),
145 fCutMinNClusterTPC(0),
146 fCutMinNClusterITS(0),
147 fCutMaxChi2PerClusterTPC(0),
148 fCutMaxChi2PerClusterITS(0),
154 fCutAcceptKinkDaughters(0),
155 fCutRequireTPCRefit(0),
156 fCutRequireITSRefit(0),
157 fCutNsigmaToVertex(0),
158 fCutSigmaToVertexRequired(0),
182 ((AliESDtrackCuts &) c).Copy(*this);
185 AliESDtrackCuts::~AliESDtrackCuts()
191 for (Int_t i=0; i<2; i++) {
193 if (fhNClustersITS[i])
194 delete fhNClustersITS[i];
195 if (fhNClustersTPC[i])
196 delete fhNClustersTPC[i];
197 if (fhChi2PerClusterITS[i])
198 delete fhChi2PerClusterITS[i];
199 if (fhChi2PerClusterTPC[i])
200 delete fhChi2PerClusterTPC[i];
219 if (fhDXYNormalized[i])
220 delete fhDXYNormalized[i];
221 if (fhDZNormalized[i])
222 delete fhDZNormalized[i];
223 if (fhDXYvsDZNormalized[i])
224 delete fhDXYvsDZNormalized[i];
225 if (fhNSigmaToVertex[i])
226 delete fhNSigmaToVertex[i];
230 delete ffDTheoretical;
233 delete fhCutStatistics;
234 if (fhCutCorrelation)
235 delete fhCutCorrelation;
238 void AliESDtrackCuts::Init()
241 // sets everything to zero
244 fCutMinNClusterTPC = 0;
245 fCutMinNClusterITS = 0;
247 fCutMaxChi2PerClusterTPC = 0;
248 fCutMaxChi2PerClusterITS = 0;
256 fCutAcceptKinkDaughters = 0;
257 fCutRequireTPCRefit = 0;
258 fCutRequireITSRefit = 0;
260 fCutNsigmaToVertex = 0;
261 fCutSigmaToVertexRequired = 0;
278 fHistogramsOn = kFALSE;
280 for (Int_t i=0; i<2; ++i)
282 fhNClustersITS[i] = 0;
283 fhNClustersTPC[i] = 0;
285 fhChi2PerClusterITS[i] = 0;
286 fhChi2PerClusterTPC[i] = 0;
298 fhDXYNormalized[i] = 0;
299 fhDZNormalized[i] = 0;
300 fhDXYvsDZNormalized[i] = 0;
301 fhNSigmaToVertex[i] = 0;
306 fhCutCorrelation = 0;
309 //_____________________________________________________________________________
310 AliESDtrackCuts &AliESDtrackCuts::operator=(const AliESDtrackCuts &c)
313 // Assignment operator
316 if (this != &c) ((AliESDtrackCuts &) c).Copy(*this);
320 //_____________________________________________________________________________
321 void AliESDtrackCuts::Copy(TObject &c) const
327 AliESDtrackCuts& target = (AliESDtrackCuts &) c;
331 target.fCutMinNClusterTPC = fCutMinNClusterTPC;
332 target.fCutMinNClusterITS = fCutMinNClusterITS;
334 target.fCutMaxChi2PerClusterTPC = fCutMaxChi2PerClusterTPC;
335 target.fCutMaxChi2PerClusterITS = fCutMaxChi2PerClusterITS;
337 target.fCutMaxC11 = fCutMaxC11;
338 target.fCutMaxC22 = fCutMaxC22;
339 target.fCutMaxC33 = fCutMaxC33;
340 target.fCutMaxC44 = fCutMaxC44;
341 target.fCutMaxC55 = fCutMaxC55;
343 target.fCutAcceptKinkDaughters = fCutAcceptKinkDaughters;
344 target.fCutRequireTPCRefit = fCutRequireTPCRefit;
345 target.fCutRequireITSRefit = fCutRequireITSRefit;
347 target.fCutNsigmaToVertex = fCutNsigmaToVertex;
348 target.fCutSigmaToVertexRequired = fCutSigmaToVertexRequired;
350 target.fPMin = fPMin;
351 target.fPMax = fPMax;
352 target.fPtMin = fPtMin;
353 target.fPtMax = fPtMax;
354 target.fPxMin = fPxMin;
355 target.fPxMax = fPxMax;
356 target.fPyMin = fPyMin;
357 target.fPyMax = fPyMax;
358 target.fPzMin = fPzMin;
359 target.fPzMax = fPzMax;
360 target.fEtaMin = fEtaMin;
361 target.fEtaMax = fEtaMax;
362 target.fRapMin = fRapMin;
363 target.fRapMax = fRapMax;
365 target.fHistogramsOn = fHistogramsOn;
367 for (Int_t i=0; i<2; ++i)
369 if (fhNClustersITS[i]) target.fhNClustersITS[i] = (TH1F*) fhNClustersITS[i]->Clone();
370 if (fhNClustersTPC[i]) target.fhNClustersTPC[i] = (TH1F*) fhNClustersTPC[i]->Clone();
372 if (fhChi2PerClusterITS[i]) target.fhChi2PerClusterITS[i] = (TH1F*) fhChi2PerClusterITS[i]->Clone();
373 if (fhChi2PerClusterTPC[i]) target.fhChi2PerClusterTPC[i] = (TH1F*) fhChi2PerClusterTPC[i]->Clone();
375 if (fhC11[i]) target.fhC11[i] = (TH1F*) fhC11[i]->Clone();
376 if (fhC22[i]) target.fhC22[i] = (TH1F*) fhC22[i]->Clone();
377 if (fhC33[i]) target.fhC33[i] = (TH1F*) fhC33[i]->Clone();
378 if (fhC44[i]) target.fhC44[i] = (TH1F*) fhC44[i]->Clone();
379 if (fhC55[i]) target.fhC55[i] = (TH1F*) fhC55[i]->Clone();
381 if (fhDXY[i]) target.fhDXY[i] = (TH1F*) fhDXY[i]->Clone();
382 if (fhDZ[i]) target.fhDZ[i] = (TH1F*) fhDZ[i]->Clone();
383 if (fhDXYvsDZ[i]) target.fhDXYvsDZ[i] = (TH2F*) fhDXYvsDZ[i]->Clone();
385 if (fhDXYNormalized[i]) target.fhDXYNormalized[i] = (TH1F*) fhDXYNormalized[i]->Clone();
386 if (fhDZNormalized[i]) target.fhDZNormalized[i] = (TH1F*) fhDZNormalized[i]->Clone();
387 if (fhDXYvsDZNormalized[i]) target.fhDXYvsDZNormalized[i] = (TH2F*) fhDXYvsDZNormalized[i]->Clone();
388 if (fhNSigmaToVertex[i]) target.fhNSigmaToVertex[i] = (TH1F*) fhNSigmaToVertex[i]->Clone();
390 if (ffDTheoretical) target.ffDTheoretical = (TF1*) ffDTheoretical->Clone();
392 if (fhCutStatistics) target.fhCutStatistics = (TH1F*) fhCutStatistics->Clone();
393 if (fhCutCorrelation) target.fhCutCorrelation = (TH2F*) fhCutCorrelation->Clone();
398 //_____________________________________________________________________________
399 Long64_t AliESDtrackCuts::Merge(TCollection* list) {
400 // Merge a list of AliESDtrackCuts objects with this (needed for PROOF)
401 // Returns the number of merged objects (including this)
412 TIterator* iter = list->MakeIterator();
416 // collection of measured and generated histograms
418 while ((obj = iter->Next())) {
420 AliESDtrackCuts* entry = dynamic_cast<AliESDtrackCuts*>(obj);
424 if (!entry->fHistogramsOn)
427 for (Int_t i=0; i<2; i++) {
429 fhNClustersITS[i] ->Add(entry->fhNClustersITS[i] );
430 fhNClustersTPC[i] ->Add(entry->fhNClustersTPC[i] );
432 fhChi2PerClusterITS[i] ->Add(entry->fhChi2PerClusterITS[i]);
433 fhChi2PerClusterTPC[i] ->Add(entry->fhChi2PerClusterTPC[i]);
435 fhC11[i] ->Add(entry->fhC11[i] );
436 fhC22[i] ->Add(entry->fhC22[i] );
437 fhC33[i] ->Add(entry->fhC33[i] );
438 fhC44[i] ->Add(entry->fhC44[i] );
439 fhC55[i] ->Add(entry->fhC55[i] );
441 fhDXY[i] ->Add(entry->fhDXY[i] );
442 fhDZ[i] ->Add(entry->fhDZ[i] );
443 fhDXYvsDZ[i] ->Add(entry->fhDXYvsDZ[i] );
445 fhDXYNormalized[i] ->Add(entry->fhDXYNormalized[i] );
446 fhDZNormalized[i] ->Add(entry->fhDZNormalized[i] );
447 fhDXYvsDZNormalized[i] ->Add(entry->fhDXYvsDZNormalized[i]);
448 fhNSigmaToVertex[i] ->Add(entry->fhNSigmaToVertex[i]);
452 fhCutStatistics ->Add(entry->fhCutStatistics);
453 fhCutCorrelation ->Add(entry->fhCutCorrelation);
462 //____________________________________________________________________
463 Float_t AliESDtrackCuts::GetSigmaToVertex(AliESDtrack* esdTrack)
465 // Calculates the number of sigma to the vertex.
470 esdTrack->GetImpactParameters(b,bCov);
471 if (bCov[0]<=0 || bCov[2]<=0) {
472 AliDebug(1, "Estimated b resolution lower or equal zero!");
473 bCov[0]=0; bCov[2]=0;
475 bRes[0] = TMath::Sqrt(bCov[0]);
476 bRes[1] = TMath::Sqrt(bCov[2]);
478 // -----------------------------------
479 // How to get to a n-sigma cut?
481 // The accumulated statistics from 0 to d is
483 // -> Erf(d/Sqrt(2)) for a 1-dim gauss (d = n_sigma)
484 // -> 1 - Exp(-d**2) for a 2-dim gauss (d*d = dx*dx + dy*dy != n_sigma)
486 // It means that for a 2-dim gauss: n_sigma(d) = Sqrt(2)*ErfInv(1 - Exp((-x**2)/2)
487 // Can this be expressed in a different way?
489 if (bRes[0] == 0 || bRes[1] ==0)
492 Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2));
494 // stupid rounding problem screws up everything:
495 // if d is too big, TMath::Exp(...) gets 0, and TMath::ErfInverse(1) that should be infinite, gets 0 :(
496 if (TMath::Exp(-d * d / 2) < 1e-10)
499 d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2);
503 void AliESDtrackCuts::EnableNeededBranches(TTree* tree)
505 // enables the branches needed by AcceptTrack, for a list see comment of AcceptTrack
507 tree->SetBranchStatus("fTracks.fFlags", 1);
508 tree->SetBranchStatus("fTracks.fITSncls", 1);
509 tree->SetBranchStatus("fTracks.fTPCncls", 1);
510 tree->SetBranchStatus("fTracks.fITSchi2", 1);
511 tree->SetBranchStatus("fTracks.fTPCchi2", 1);
512 tree->SetBranchStatus("fTracks.fC*", 1);
513 tree->SetBranchStatus("fTracks.fD", 1);
514 tree->SetBranchStatus("fTracks.fZ", 1);
515 tree->SetBranchStatus("fTracks.fCdd", 1);
516 tree->SetBranchStatus("fTracks.fCdz", 1);
517 tree->SetBranchStatus("fTracks.fCzz", 1);
518 tree->SetBranchStatus("fTracks.fP*", 1);
519 tree->SetBranchStatus("fTracks.fR*", 1);
520 tree->SetBranchStatus("fTracks.fKinkIndexes*", 1);
523 //____________________________________________________________________
525 AliESDtrackCuts::AcceptTrack(AliESDtrack* esdTrack) {
527 // figure out if the tracks survives all the track cuts defined
529 // the different quality parameter and kinematic values are first
530 // retrieved from the track. then it is found out what cuts the
531 // track did not survive and finally the cuts are imposed.
533 // this function needs the following branches:
539 // fTracks.fC //GetExternalCovariance
540 // fTracks.fD //GetImpactParameters
541 // fTracks.fZ //GetImpactParameters
542 // fTracks.fCdd //GetImpactParameters
543 // fTracks.fCdz //GetImpactParameters
544 // fTracks.fCzz //GetImpactParameters
545 // fTracks.fP //GetPxPyPz
546 // fTracks.fR //GetMass
547 // fTracks.fP //GetMass
548 // fTracks.fKinkIndexes
550 UInt_t status = esdTrack->GetStatus();
555 // getting quality parameters from the ESD track
556 Int_t nClustersITS = esdTrack->GetITSclusters(fIdxInt);
557 Int_t nClustersTPC = esdTrack->GetTPCclusters(fIdxInt);
561 Float_t chi2PerClusterITS = -1;
562 Float_t chi2PerClusterTPC = -1;
564 chi2PerClusterITS = esdTrack->GetITSchi2()/Float_t(nClustersITS);
566 chi2PerClusterTPC = esdTrack->GetTPCchi2()/Float_t(nClustersTPC);
569 esdTrack->GetExternalCovariance(extCov);
571 // getting the track to vertex parameters
572 Float_t nSigmaToVertex = GetSigmaToVertex(esdTrack);
574 // getting the kinematic variables of the track
575 // (assuming the mass is known)
577 esdTrack->GetPxPyPz(p);
578 Float_t momentum = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2) + TMath::Power(p[2],2));
579 Float_t pt = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2));
580 Float_t energy = TMath::Sqrt(TMath::Power(esdTrack->GetMass(),2) + TMath::Power(momentum,2));
583 //y-eta related calculations
586 if((momentum != TMath::Abs(p[2]))&&(momentum != 0))
587 eta = 0.5*TMath::Log((momentum + p[2])/(momentum - p[2]));
588 if((energy != TMath::Abs(p[2]))&&(momentum != 0))
589 y = 0.5*TMath::Log((energy + p[2])/(energy - p[2]));
592 //########################################################################
596 for (Int_t i=0; i<kNCuts; i++) cuts[i]=kFALSE;
598 // track quality cuts
599 if (fCutRequireTPCRefit && (status&AliESDtrack::kTPCrefit)==0)
601 if (fCutRequireITSRefit && (status&AliESDtrack::kITSrefit)==0)
603 if (nClustersTPC<fCutMinNClusterTPC)
605 if (nClustersITS<fCutMinNClusterITS)
607 if (chi2PerClusterTPC>fCutMaxChi2PerClusterTPC)
609 if (chi2PerClusterITS>fCutMaxChi2PerClusterITS)
611 if (extCov[0] > fCutMaxC11)
613 if (extCov[2] > fCutMaxC22)
615 if (extCov[5] > fCutMaxC33)
617 if (extCov[9] > fCutMaxC44)
619 if (extCov[14] > fCutMaxC55)
621 if (nSigmaToVertex > fCutNsigmaToVertex)
623 // if n sigma could not be calculated
624 if (nSigmaToVertex<0 && fCutSigmaToVertexRequired)
626 if (!fCutAcceptKinkDaughters && esdTrack->GetKinkIndex(0)>0)
628 // track kinematics cut
629 if((momentum < fPMin) || (momentum > fPMax))
631 if((pt < fPtMin) || (pt > fPtMax))
633 if((p[0] < fPxMin) || (p[0] > fPxMax))
635 if((p[1] < fPyMin) || (p[1] > fPyMax))
637 if((p[2] < fPzMin) || (p[2] > fPzMax))
639 if((eta < fEtaMin) || (eta > fEtaMax))
641 if((y < fRapMin) || (y > fRapMax))
645 for (Int_t i=0; i<kNCuts; i++)
646 if (cuts[i]) cut = kTRUE;
648 //########################################################################
649 // filling histograms
651 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n tracks")));
654 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n cut tracks")));
656 for (Int_t i=0; i<kNCuts; i++) {
658 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin(fgkCutNames[i])));
660 for (Int_t j=i; j<kNCuts; j++) {
661 if (cuts[i] && cuts[j]) {
662 Float_t x = fhCutCorrelation->GetXaxis()->GetBinCenter(fhCutCorrelation->GetXaxis()->FindBin(fgkCutNames[i]));
663 Float_t y = fhCutCorrelation->GetYaxis()->GetBinCenter(fhCutCorrelation->GetYaxis()->FindBin(fgkCutNames[j]));
664 fhCutCorrelation->Fill(x,y);
670 fhNClustersITS[0]->Fill(nClustersITS);
671 fhNClustersTPC[0]->Fill(nClustersTPC);
672 fhChi2PerClusterITS[0]->Fill(chi2PerClusterITS);
673 fhChi2PerClusterTPC[0]->Fill(chi2PerClusterTPC);
675 fhC11[0]->Fill(extCov[0]);
676 fhC22[0]->Fill(extCov[2]);
677 fhC33[0]->Fill(extCov[5]);
678 fhC44[0]->Fill(extCov[9]);
679 fhC55[0]->Fill(extCov[14]);
684 esdTrack->GetImpactParameters(b,bCov);
685 if (bCov[0]<=0 || bCov[2]<=0) {
686 AliDebug(1, "Estimated b resolution lower or equal zero!");
687 bCov[0]=0; bCov[2]=0;
689 bRes[0] = TMath::Sqrt(bCov[0]);
690 bRes[1] = TMath::Sqrt(bCov[2]);
693 fhDXY[0]->Fill(b[0]);
694 fhDXYvsDZ[0]->Fill(b[1],b[0]);
696 if (bRes[0]!=0 && bRes[1]!=0) {
697 fhDZNormalized[0]->Fill(b[1]/bRes[1]);
698 fhDXYNormalized[0]->Fill(b[0]/bRes[0]);
699 fhDXYvsDZNormalized[0]->Fill(b[1]/bRes[1], b[0]/bRes[0]);
700 fhNSigmaToVertex[0]->Fill(nSigmaToVertex);
704 //########################################################################
706 if (cut) return kFALSE;
708 //########################################################################
709 // filling histograms after cut
711 fhNClustersITS[1]->Fill(nClustersITS);
712 fhNClustersTPC[1]->Fill(nClustersTPC);
713 fhChi2PerClusterITS[1]->Fill(chi2PerClusterITS);
714 fhChi2PerClusterTPC[1]->Fill(chi2PerClusterTPC);
716 fhC11[1]->Fill(extCov[0]);
717 fhC22[1]->Fill(extCov[2]);
718 fhC33[1]->Fill(extCov[5]);
719 fhC44[1]->Fill(extCov[9]);
720 fhC55[1]->Fill(extCov[14]);
725 esdTrack->GetImpactParameters(b,bCov);
726 if (bCov[0]<=0 || bCov[2]<=0) {
727 AliDebug(1, "Estimated b resolution lower or equal zero!");
728 bCov[0]=0; bCov[2]=0;
730 bRes[0] = TMath::Sqrt(bCov[0]);
731 bRes[1] = TMath::Sqrt(bCov[2]);
734 fhDXY[1]->Fill(b[0]);
735 fhDXYvsDZ[1]->Fill(b[1],b[0]);
737 if (bRes[0]!=0 && bRes[1]!=0)
739 fhDZNormalized[1]->Fill(b[1]/bRes[1]);
740 fhDXYNormalized[1]->Fill(b[0]/bRes[0]);
741 fhDXYvsDZNormalized[1]->Fill(b[1]/bRes[1], b[0]/bRes[0]);
742 fhNSigmaToVertex[1]->Fill(nSigmaToVertex);
749 //____________________________________________________________________
751 AliESDtrackCuts::GetAcceptedTracks(AliESD* esd)
754 // returns an array of all tracks that pass the cuts
757 TObjArray* acceptedTracks = new TObjArray();
759 // loop over esd tracks
760 for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
761 AliESDtrack* track = esd->GetTrack(iTrack);
763 if (AcceptTrack(track))
764 acceptedTracks->Add(track);
767 return acceptedTracks;
770 //____________________________________________________________________
772 AliESDtrackCuts::CountAcceptedTracks(AliESD* esd)
775 // returns an the number of tracks that pass the cuts
780 // loop over esd tracks
781 for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
782 AliESDtrack* track = esd->GetTrack(iTrack);
784 if (AcceptTrack(track))
791 //____________________________________________________________________
792 void AliESDtrackCuts::DefineHistograms(Int_t color) {
794 // diagnostics histograms are defined
799 //###################################################################################
800 // defining histograms
802 fhCutStatistics = new TH1F("cut_statistics","cut statistics",kNCuts+4,-0.5,kNCuts+3.5);
804 fhCutStatistics->GetXaxis()->SetBinLabel(1,"n tracks");
805 fhCutStatistics->GetXaxis()->SetBinLabel(2,"n cut tracks");
807 fhCutCorrelation = new TH2F("cut_correlation","cut correlation",kNCuts,-0.5,kNCuts-0.5,kNCuts,-0.5,kNCuts-0.5);;
809 for (Int_t i=0; i<kNCuts; i++) {
810 fhCutStatistics->GetXaxis()->SetBinLabel(i+4,fgkCutNames[i]);
811 fhCutCorrelation->GetXaxis()->SetBinLabel(i+1,fgkCutNames[i]);
812 fhCutCorrelation->GetYaxis()->SetBinLabel(i+1,fgkCutNames[i]);
815 fhCutStatistics ->SetLineColor(color);
816 fhCutCorrelation ->SetLineColor(color);
817 fhCutStatistics ->SetLineWidth(2);
818 fhCutCorrelation ->SetLineWidth(2);
821 for (Int_t i=0; i<2; i++) {
822 if (i==0) sprintf(str," ");
823 else sprintf(str,"_cut");
825 fhNClustersITS[i] = new TH1F(Form("nClustersITS%s",str),"",8,-0.5,7.5);
826 fhNClustersTPC[i] = new TH1F(Form("nClustersTPC%s",str),"",165,-0.5,164.5);
827 fhChi2PerClusterITS[i] = new TH1F(Form("chi2PerClusterITS%s",str),"",500,0,10);
828 fhChi2PerClusterTPC[i] = new TH1F(Form("chi2PerClusterTPC%s",str),"",500,0,10);
830 fhC11[i] = new TH1F(Form("covMatrixDiagonal11%s",str),"",2000,0,20);
831 fhC22[i] = new TH1F(Form("covMatrixDiagonal22%s",str),"",2000,0,20);
832 fhC33[i] = new TH1F(Form("covMatrixDiagonal33%s",str),"",1000,0,1);
833 fhC44[i] = new TH1F(Form("covMatrixDiagonal44%s",str),"",1000,0,5);
834 fhC55[i] = new TH1F(Form("covMatrixDiagonal55%s",str),"",1000,0,5);
836 fhDXY[i] = new TH1F(Form("dXY%s",str),"",500,-10,10);
837 fhDZ[i] = new TH1F(Form("dZ%s",str),"",500,-10,10);
838 fhDXYvsDZ[i] = new TH2F(Form("dXYvsDZ%s",str),"",200,-10,10,200,-10,10);
840 fhDXYNormalized[i] = new TH1F(Form("dXYNormalized%s",str),"",500,-10,10);
841 fhDZNormalized[i] = new TH1F(Form("dZNormalized%s",str),"",500,-10,10);
842 fhDXYvsDZNormalized[i] = new TH2F(Form("dXYvsDZNormalized%s",str),"",200,-10,10,200,-10,10);
844 fhNSigmaToVertex[i] = new TH1F(Form("nSigmaToVertex%s",str),"",500,0,50);
846 fhNClustersITS[i]->SetXTitle("n ITS clusters");
847 fhNClustersTPC[i]->SetXTitle("n TPC clusters");
848 fhChi2PerClusterITS[i]->SetXTitle("#Chi^{2} per ITS cluster");
849 fhChi2PerClusterTPC[i]->SetXTitle("#Chi^{2} per TPC cluster");
851 fhC11[i]->SetXTitle("cov 11 : #sigma_{y}^{2} [cm^{2}]");
852 fhC22[i]->SetXTitle("cov 22 : #sigma_{z}^{2} [cm^{2}]");
853 fhC33[i]->SetXTitle("cov 33 : #sigma_{sin(#phi)}^{2}");
854 fhC44[i]->SetXTitle("cov 44 : #sigma_{tan(#theta_{dip})}^{2}");
855 fhC55[i]->SetXTitle("cov 55 : #sigma_{1/p_{T}}^{2} [(c/GeV)^2]");
857 fhDXY[i]->SetXTitle("transverse impact parameter");
858 fhDZ[i]->SetXTitle("longitudinal impact parameter");
859 fhDXYvsDZ[i]->SetXTitle("longitudinal impact parameter");
860 fhDXYvsDZ[i]->SetYTitle("transverse impact parameter");
862 fhDXYNormalized[i]->SetXTitle("normalized trans impact par");
863 fhDZNormalized[i]->SetXTitle("normalized long impact par");
864 fhDXYvsDZNormalized[i]->SetXTitle("normalized long impact par");
865 fhDXYvsDZNormalized[i]->SetYTitle("normalized trans impact par");
866 fhNSigmaToVertex[i]->SetXTitle("n #sigma to vertex");
868 fhNClustersITS[i]->SetLineColor(color); fhNClustersITS[i]->SetLineWidth(2);
869 fhNClustersTPC[i]->SetLineColor(color); fhNClustersTPC[i]->SetLineWidth(2);
870 fhChi2PerClusterITS[i]->SetLineColor(color); fhChi2PerClusterITS[i]->SetLineWidth(2);
871 fhChi2PerClusterTPC[i]->SetLineColor(color); fhChi2PerClusterTPC[i]->SetLineWidth(2);
873 fhC11[i]->SetLineColor(color); fhC11[i]->SetLineWidth(2);
874 fhC22[i]->SetLineColor(color); fhC22[i]->SetLineWidth(2);
875 fhC33[i]->SetLineColor(color); fhC33[i]->SetLineWidth(2);
876 fhC44[i]->SetLineColor(color); fhC44[i]->SetLineWidth(2);
877 fhC55[i]->SetLineColor(color); fhC55[i]->SetLineWidth(2);
879 fhDXY[i]->SetLineColor(color); fhDXY[i]->SetLineWidth(2);
880 fhDZ[i]->SetLineColor(color); fhDZ[i]->SetLineWidth(2);
882 fhDXYNormalized[i]->SetLineColor(color); fhDXYNormalized[i]->SetLineWidth(2);
883 fhDZNormalized[i]->SetLineColor(color); fhDZNormalized[i]->SetLineWidth(2);
884 fhNSigmaToVertex[i]->SetLineColor(color); fhNSigmaToVertex[i]->SetLineWidth(2);
887 // The number of sigmas to the vertex is per definition gaussian
888 ffDTheoretical = new TF1("nSigmaToVertexTheoretical","([0]/2.506628274)*exp(-(x**2)/2)",0,50);
889 ffDTheoretical->SetParameter(0,1);
894 //____________________________________________________________________
896 AliESDtrackCuts::Print(const Option_t*) const {
898 // print method - still to be implemented
901 AliInfo("AliESDtrackCuts...");
905 //____________________________________________________________________
906 void AliESDtrackCuts::SaveHistograms(Char_t* dir) {
908 // saves the histograms in a directory (dir)
912 if (!fHistogramsOn) {
913 AliDebug(0, "Histograms not on - cannot save histograms!!!");
917 gDirectory->mkdir(dir);
920 outfile = dir; outfile += ".root";
921 TFile *f = TFile::Open(outfile.Data(),"recreate");
923 gDirectory->mkdir("before_cuts");
924 gDirectory->mkdir("after_cuts");
926 // a factor of 2 is needed since n sigma is positive
927 ffDTheoretical->SetParameter(0,2*fhNSigmaToVertex[0]->Integral("width"));
928 ffDTheoretical->Write("nSigmaToVertexTheory");
930 fhCutStatistics->Write();
931 fhCutCorrelation->Write();
933 for (Int_t i=0; i<2; i++) {
935 gDirectory->cd("before_cuts");
937 gDirectory->cd("after_cuts");
938 fhNClustersITS[i] ->Write();
939 fhNClustersTPC[i] ->Write();
940 fhChi2PerClusterITS[i] ->Write();
941 fhChi2PerClusterTPC[i] ->Write();
951 fhDXYvsDZ[i] ->Write();
953 fhDXYNormalized[i] ->Write();
954 fhDZNormalized[i] ->Write();
955 fhDXYvsDZNormalized[i] ->Write();
956 fhNSigmaToVertex[i] ->Write();
958 gDirectory->cd("../");
963 gDirectory->cd("../");