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),
121 //##############################################################################
122 // setting default cuts
123 SetMinNClustersTPC();
124 SetMinNClustersITS();
125 SetMaxChi2PerClusterTPC();
126 SetMaxChi2PerClusterITS();
127 SetMaxCovDiagonalElements();
128 SetRequireTPCRefit();
129 SetRequireITSRefit();
130 SetAcceptKingDaughters();
131 SetMinNsigmaToVertex();
132 SetRequireSigmaToVertex();
144 //_____________________________________________________________________________
145 AliESDtrackCuts::AliESDtrackCuts(const AliESDtrackCuts &c) : TNamed(c),
146 fCutMinNClusterTPC(0),
147 fCutMinNClusterITS(0),
148 fCutMaxChi2PerClusterTPC(0),
149 fCutMaxChi2PerClusterITS(0),
155 fCutAcceptKinkDaughters(0),
156 fCutRequireTPCRefit(0),
157 fCutRequireITSRefit(0),
158 fCutNsigmaToVertex(0),
159 fCutSigmaToVertexRequired(0),
183 ((AliESDtrackCuts &) c).Copy(*this);
186 AliESDtrackCuts::~AliESDtrackCuts()
192 for (Int_t i=0; i<2; i++) {
194 if (fhNClustersITS[i])
195 delete fhNClustersITS[i];
196 if (fhNClustersTPC[i])
197 delete fhNClustersTPC[i];
198 if (fhChi2PerClusterITS[i])
199 delete fhChi2PerClusterITS[i];
200 if (fhChi2PerClusterTPC[i])
201 delete fhChi2PerClusterTPC[i];
220 if (fhDXYNormalized[i])
221 delete fhDXYNormalized[i];
222 if (fhDZNormalized[i])
223 delete fhDZNormalized[i];
224 if (fhDXYvsDZNormalized[i])
225 delete fhDXYvsDZNormalized[i];
226 if (fhNSigmaToVertex[i])
227 delete fhNSigmaToVertex[i];
231 delete ffDTheoretical;
234 delete fhCutStatistics;
235 if (fhCutCorrelation)
236 delete fhCutCorrelation;
239 void AliESDtrackCuts::Init()
242 // sets everything to zero
245 fCutMinNClusterTPC = 0;
246 fCutMinNClusterITS = 0;
248 fCutMaxChi2PerClusterTPC = 0;
249 fCutMaxChi2PerClusterITS = 0;
257 fCutAcceptKinkDaughters = 0;
258 fCutRequireTPCRefit = 0;
259 fCutRequireITSRefit = 0;
261 fCutNsigmaToVertex = 0;
262 fCutSigmaToVertexRequired = 0;
279 fHistogramsOn = kFALSE;
281 for (Int_t i=0; i<2; ++i)
283 fhNClustersITS[i] = 0;
284 fhNClustersTPC[i] = 0;
286 fhChi2PerClusterITS[i] = 0;
287 fhChi2PerClusterTPC[i] = 0;
299 fhDXYNormalized[i] = 0;
300 fhDZNormalized[i] = 0;
301 fhDXYvsDZNormalized[i] = 0;
302 fhNSigmaToVertex[i] = 0;
307 fhCutCorrelation = 0;
310 //_____________________________________________________________________________
311 AliESDtrackCuts &AliESDtrackCuts::operator=(const AliESDtrackCuts &c)
314 // Assignment operator
317 if (this != &c) ((AliESDtrackCuts &) c).Copy(*this);
321 //_____________________________________________________________________________
322 void AliESDtrackCuts::Copy(TObject &c) const
328 AliESDtrackCuts& target = (AliESDtrackCuts &) c;
332 target.fCutMinNClusterTPC = fCutMinNClusterTPC;
333 target.fCutMinNClusterITS = fCutMinNClusterITS;
335 target.fCutMaxChi2PerClusterTPC = fCutMaxChi2PerClusterTPC;
336 target.fCutMaxChi2PerClusterITS = fCutMaxChi2PerClusterITS;
338 target.fCutMaxC11 = fCutMaxC11;
339 target.fCutMaxC22 = fCutMaxC22;
340 target.fCutMaxC33 = fCutMaxC33;
341 target.fCutMaxC44 = fCutMaxC44;
342 target.fCutMaxC55 = fCutMaxC55;
344 target.fCutAcceptKinkDaughters = fCutAcceptKinkDaughters;
345 target.fCutRequireTPCRefit = fCutRequireTPCRefit;
346 target.fCutRequireITSRefit = fCutRequireITSRefit;
348 target.fCutNsigmaToVertex = fCutNsigmaToVertex;
349 target.fCutSigmaToVertexRequired = fCutSigmaToVertexRequired;
351 target.fPMin = fPMin;
352 target.fPMax = fPMax;
353 target.fPtMin = fPtMin;
354 target.fPtMax = fPtMax;
355 target.fPxMin = fPxMin;
356 target.fPxMax = fPxMax;
357 target.fPyMin = fPyMin;
358 target.fPyMax = fPyMax;
359 target.fPzMin = fPzMin;
360 target.fPzMax = fPzMax;
361 target.fEtaMin = fEtaMin;
362 target.fEtaMax = fEtaMax;
363 target.fRapMin = fRapMin;
364 target.fRapMax = fRapMax;
366 target.fHistogramsOn = fHistogramsOn;
368 for (Int_t i=0; i<2; ++i)
370 if (fhNClustersITS[i]) target.fhNClustersITS[i] = (TH1F*) fhNClustersITS[i]->Clone();
371 if (fhNClustersTPC[i]) target.fhNClustersTPC[i] = (TH1F*) fhNClustersTPC[i]->Clone();
373 if (fhChi2PerClusterITS[i]) target.fhChi2PerClusterITS[i] = (TH1F*) fhChi2PerClusterITS[i]->Clone();
374 if (fhChi2PerClusterTPC[i]) target.fhChi2PerClusterTPC[i] = (TH1F*) fhChi2PerClusterTPC[i]->Clone();
376 if (fhC11[i]) target.fhC11[i] = (TH1F*) fhC11[i]->Clone();
377 if (fhC22[i]) target.fhC22[i] = (TH1F*) fhC22[i]->Clone();
378 if (fhC33[i]) target.fhC33[i] = (TH1F*) fhC33[i]->Clone();
379 if (fhC44[i]) target.fhC44[i] = (TH1F*) fhC44[i]->Clone();
380 if (fhC55[i]) target.fhC55[i] = (TH1F*) fhC55[i]->Clone();
382 if (fhDXY[i]) target.fhDXY[i] = (TH1F*) fhDXY[i]->Clone();
383 if (fhDZ[i]) target.fhDZ[i] = (TH1F*) fhDZ[i]->Clone();
384 if (fhDXYvsDZ[i]) target.fhDXYvsDZ[i] = (TH2F*) fhDXYvsDZ[i]->Clone();
386 if (fhDXYNormalized[i]) target.fhDXYNormalized[i] = (TH1F*) fhDXYNormalized[i]->Clone();
387 if (fhDZNormalized[i]) target.fhDZNormalized[i] = (TH1F*) fhDZNormalized[i]->Clone();
388 if (fhDXYvsDZNormalized[i]) target.fhDXYvsDZNormalized[i] = (TH2F*) fhDXYvsDZNormalized[i]->Clone();
389 if (fhNSigmaToVertex[i]) target.fhNSigmaToVertex[i] = (TH1F*) fhNSigmaToVertex[i]->Clone();
391 if (ffDTheoretical) target.ffDTheoretical = (TF1*) ffDTheoretical->Clone();
393 if (fhCutStatistics) target.fhCutStatistics = (TH1F*) fhCutStatistics->Clone();
394 if (fhCutCorrelation) target.fhCutCorrelation = (TH2F*) fhCutCorrelation->Clone();
399 //_____________________________________________________________________________
400 Long64_t AliESDtrackCuts::Merge(TCollection* list) {
401 // Merge a list of AliESDtrackCuts objects with this (needed for PROOF)
402 // Returns the number of merged objects (including this)
413 TIterator* iter = list->MakeIterator();
417 // collection of measured and generated histograms
419 while ((obj = iter->Next())) {
421 AliESDtrackCuts* entry = dynamic_cast<AliESDtrackCuts*>(obj);
425 if (!entry->fHistogramsOn)
428 for (Int_t i=0; i<2; i++) {
430 fhNClustersITS[i] ->Add(entry->fhNClustersITS[i] );
431 fhNClustersTPC[i] ->Add(entry->fhNClustersTPC[i] );
433 fhChi2PerClusterITS[i] ->Add(entry->fhChi2PerClusterITS[i]);
434 fhChi2PerClusterTPC[i] ->Add(entry->fhChi2PerClusterTPC[i]);
436 fhC11[i] ->Add(entry->fhC11[i] );
437 fhC22[i] ->Add(entry->fhC22[i] );
438 fhC33[i] ->Add(entry->fhC33[i] );
439 fhC44[i] ->Add(entry->fhC44[i] );
440 fhC55[i] ->Add(entry->fhC55[i] );
442 fhDXY[i] ->Add(entry->fhDXY[i] );
443 fhDZ[i] ->Add(entry->fhDZ[i] );
444 fhDXYvsDZ[i] ->Add(entry->fhDXYvsDZ[i] );
446 fhDXYNormalized[i] ->Add(entry->fhDXYNormalized[i] );
447 fhDZNormalized[i] ->Add(entry->fhDZNormalized[i] );
448 fhDXYvsDZNormalized[i] ->Add(entry->fhDXYvsDZNormalized[i]);
449 fhNSigmaToVertex[i] ->Add(entry->fhNSigmaToVertex[i]);
453 fhCutStatistics ->Add(entry->fhCutStatistics);
454 fhCutCorrelation ->Add(entry->fhCutCorrelation);
463 //____________________________________________________________________
464 Float_t AliESDtrackCuts::GetSigmaToVertex(AliESDtrack* esdTrack)
466 // Calculates the number of sigma to the vertex.
471 esdTrack->GetImpactParameters(b,bCov);
472 if (bCov[0]<=0 || bCov[2]<=0) {
473 AliDebug(1, "Estimated b resolution lower or equal zero!");
474 bCov[0]=0; bCov[2]=0;
476 bRes[0] = TMath::Sqrt(bCov[0]);
477 bRes[1] = TMath::Sqrt(bCov[2]);
479 // -----------------------------------
480 // How to get to a n-sigma cut?
482 // The accumulated statistics from 0 to d is
484 // -> Erf(d/Sqrt(2)) for a 1-dim gauss (d = n_sigma)
485 // -> 1 - Exp(-d**2) for a 2-dim gauss (d*d = dx*dx + dy*dy != n_sigma)
487 // It means that for a 2-dim gauss: n_sigma(d) = Sqrt(2)*ErfInv(1 - Exp((-x**2)/2)
488 // Can this be expressed in a different way?
490 if (bRes[0] == 0 || bRes[1] ==0)
493 Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2));
495 // stupid rounding problem screws up everything:
496 // if d is too big, TMath::Exp(...) gets 0, and TMath::ErfInverse(1) that should be infinite, gets 0 :(
497 if (TMath::Exp(-d * d / 2) < 1e-10)
500 d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2);
504 void AliESDtrackCuts::EnableNeededBranches(TTree* tree)
506 // enables the branches needed by AcceptTrack, for a list see comment of AcceptTrack
508 tree->SetBranchStatus("fTracks.fFlags", 1);
509 tree->SetBranchStatus("fTracks.fITSncls", 1);
510 tree->SetBranchStatus("fTracks.fTPCncls", 1);
511 tree->SetBranchStatus("fTracks.fITSchi2", 1);
512 tree->SetBranchStatus("fTracks.fTPCchi2", 1);
513 tree->SetBranchStatus("fTracks.fC*", 1);
514 tree->SetBranchStatus("fTracks.fD", 1);
515 tree->SetBranchStatus("fTracks.fZ", 1);
516 tree->SetBranchStatus("fTracks.fCdd", 1);
517 tree->SetBranchStatus("fTracks.fCdz", 1);
518 tree->SetBranchStatus("fTracks.fCzz", 1);
519 tree->SetBranchStatus("fTracks.fP*", 1);
520 tree->SetBranchStatus("fTracks.fR*", 1);
521 tree->SetBranchStatus("fTracks.fKinkIndexes*", 1);
524 //____________________________________________________________________
526 AliESDtrackCuts::AcceptTrack(AliESDtrack* esdTrack) {
528 // figure out if the tracks survives all the track cuts defined
530 // the different quality parameter and kinematic values are first
531 // retrieved from the track. then it is found out what cuts the
532 // track did not survive and finally the cuts are imposed.
534 // this function needs the following branches:
540 // fTracks.fC //GetExternalCovariance
541 // fTracks.fD //GetImpactParameters
542 // fTracks.fZ //GetImpactParameters
543 // fTracks.fCdd //GetImpactParameters
544 // fTracks.fCdz //GetImpactParameters
545 // fTracks.fCzz //GetImpactParameters
546 // fTracks.fP //GetPxPyPz
547 // fTracks.fR //GetMass
548 // fTracks.fP //GetMass
549 // fTracks.fKinkIndexes
551 UInt_t status = esdTrack->GetStatus();
556 // getting quality parameters from the ESD track
557 Int_t nClustersITS = esdTrack->GetITSclusters(fIdxInt);
558 Int_t nClustersTPC = esdTrack->GetTPCclusters(fIdxInt);
562 Float_t chi2PerClusterITS = -1;
563 Float_t chi2PerClusterTPC = -1;
565 chi2PerClusterITS = esdTrack->GetITSchi2()/Float_t(nClustersITS);
567 chi2PerClusterTPC = esdTrack->GetTPCchi2()/Float_t(nClustersTPC);
570 esdTrack->GetExternalCovariance(extCov);
572 // getting the track to vertex parameters
573 Float_t nSigmaToVertex = GetSigmaToVertex(esdTrack);
575 // getting the kinematic variables of the track
576 // (assuming the mass is known)
578 esdTrack->GetPxPyPz(p);
579 Float_t momentum = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2) + TMath::Power(p[2],2));
580 Float_t pt = TMath::Sqrt(TMath::Power(p[0],2) + TMath::Power(p[1],2));
581 Float_t energy = TMath::Sqrt(TMath::Power(esdTrack->GetMass(),2) + TMath::Power(momentum,2));
584 //y-eta related calculations
587 if((momentum != TMath::Abs(p[2]))&&(momentum != 0))
588 eta = 0.5*TMath::Log((momentum + p[2])/(momentum - p[2]));
589 if((energy != TMath::Abs(p[2]))&&(momentum != 0))
590 y = 0.5*TMath::Log((energy + p[2])/(energy - p[2]));
593 //########################################################################
597 for (Int_t i=0; i<kNCuts; i++) cuts[i]=kFALSE;
599 // track quality cuts
600 if (fCutRequireTPCRefit && (status&AliESDtrack::kTPCrefit)==0)
602 if (fCutRequireITSRefit && (status&AliESDtrack::kITSrefit)==0)
604 if (nClustersTPC<fCutMinNClusterTPC)
606 if (nClustersITS<fCutMinNClusterITS)
608 if (chi2PerClusterTPC>fCutMaxChi2PerClusterTPC)
610 if (chi2PerClusterITS>fCutMaxChi2PerClusterITS)
612 if (extCov[0] > fCutMaxC11)
614 if (extCov[2] > fCutMaxC22)
616 if (extCov[5] > fCutMaxC33)
618 if (extCov[9] > fCutMaxC44)
620 if (extCov[14] > fCutMaxC55)
622 if (nSigmaToVertex > fCutNsigmaToVertex)
624 // if n sigma could not be calculated
625 if (nSigmaToVertex<0 && fCutSigmaToVertexRequired)
627 if (!fCutAcceptKinkDaughters && esdTrack->GetKinkIndex(0)>0)
629 // track kinematics cut
630 if((momentum < fPMin) || (momentum > fPMax))
632 if((pt < fPtMin) || (pt > fPtMax))
634 if((p[0] < fPxMin) || (p[0] > fPxMax))
636 if((p[1] < fPyMin) || (p[1] > fPyMax))
638 if((p[2] < fPzMin) || (p[2] > fPzMax))
640 if((eta < fEtaMin) || (eta > fEtaMax))
642 if((y < fRapMin) || (y > fRapMax))
646 for (Int_t i=0; i<kNCuts; i++)
647 if (cuts[i]) cut = kTRUE;
649 //########################################################################
650 // filling histograms
652 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n tracks")));
655 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin("n cut tracks")));
657 for (Int_t i=0; i<kNCuts; i++) {
659 fhCutStatistics->Fill(fhCutStatistics->GetBinCenter(fhCutStatistics->GetXaxis()->FindBin(fgkCutNames[i])));
661 for (Int_t j=i; j<kNCuts; j++) {
662 if (cuts[i] && cuts[j]) {
663 Float_t tx = fhCutCorrelation->GetXaxis()->GetBinCenter(fhCutCorrelation->GetXaxis()->FindBin(fgkCutNames[i]));
664 Float_t ty = fhCutCorrelation->GetYaxis()->GetBinCenter(fhCutCorrelation->GetYaxis()->FindBin(fgkCutNames[j]));
665 fhCutCorrelation->Fill(tx,ty);
671 fhNClustersITS[0]->Fill(nClustersITS);
672 fhNClustersTPC[0]->Fill(nClustersTPC);
673 fhChi2PerClusterITS[0]->Fill(chi2PerClusterITS);
674 fhChi2PerClusterTPC[0]->Fill(chi2PerClusterTPC);
676 fhC11[0]->Fill(extCov[0]);
677 fhC22[0]->Fill(extCov[2]);
678 fhC33[0]->Fill(extCov[5]);
679 fhC44[0]->Fill(extCov[9]);
680 fhC55[0]->Fill(extCov[14]);
685 esdTrack->GetImpactParameters(b,bCov);
686 if (bCov[0]<=0 || bCov[2]<=0) {
687 AliDebug(1, "Estimated b resolution lower or equal zero!");
688 bCov[0]=0; bCov[2]=0;
690 bRes[0] = TMath::Sqrt(bCov[0]);
691 bRes[1] = TMath::Sqrt(bCov[2]);
694 fhDXY[0]->Fill(b[0]);
695 fhDXYvsDZ[0]->Fill(b[1],b[0]);
697 if (bRes[0]!=0 && bRes[1]!=0) {
698 fhDZNormalized[0]->Fill(b[1]/bRes[1]);
699 fhDXYNormalized[0]->Fill(b[0]/bRes[0]);
700 fhDXYvsDZNormalized[0]->Fill(b[1]/bRes[1], b[0]/bRes[0]);
701 fhNSigmaToVertex[0]->Fill(nSigmaToVertex);
705 //########################################################################
707 if (cut) return kFALSE;
709 //########################################################################
710 // filling histograms after cut
712 fhNClustersITS[1]->Fill(nClustersITS);
713 fhNClustersTPC[1]->Fill(nClustersTPC);
714 fhChi2PerClusterITS[1]->Fill(chi2PerClusterITS);
715 fhChi2PerClusterTPC[1]->Fill(chi2PerClusterTPC);
717 fhC11[1]->Fill(extCov[0]);
718 fhC22[1]->Fill(extCov[2]);
719 fhC33[1]->Fill(extCov[5]);
720 fhC44[1]->Fill(extCov[9]);
721 fhC55[1]->Fill(extCov[14]);
726 esdTrack->GetImpactParameters(b,bCov);
727 if (bCov[0]<=0 || bCov[2]<=0) {
728 AliDebug(1, "Estimated b resolution lower or equal zero!");
729 bCov[0]=0; bCov[2]=0;
731 bRes[0] = TMath::Sqrt(bCov[0]);
732 bRes[1] = TMath::Sqrt(bCov[2]);
735 fhDXY[1]->Fill(b[0]);
736 fhDXYvsDZ[1]->Fill(b[1],b[0]);
738 if (bRes[0]!=0 && bRes[1]!=0)
740 fhDZNormalized[1]->Fill(b[1]/bRes[1]);
741 fhDXYNormalized[1]->Fill(b[0]/bRes[0]);
742 fhDXYvsDZNormalized[1]->Fill(b[1]/bRes[1], b[0]/bRes[0]);
743 fhNSigmaToVertex[1]->Fill(nSigmaToVertex);
750 //____________________________________________________________________
752 AliESDtrackCuts::GetAcceptedTracks(AliESD* esd)
755 // returns an array of all tracks that pass the cuts
758 TObjArray* acceptedTracks = new TObjArray();
760 // loop over esd tracks
761 for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
762 AliESDtrack* track = esd->GetTrack(iTrack);
764 if (AcceptTrack(track))
765 acceptedTracks->Add(track);
768 return acceptedTracks;
771 //____________________________________________________________________
773 AliESDtrackCuts::CountAcceptedTracks(AliESD* esd)
776 // returns an the number of tracks that pass the cuts
781 // loop over esd tracks
782 for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
783 AliESDtrack* track = esd->GetTrack(iTrack);
785 if (AcceptTrack(track))
792 //____________________________________________________________________
793 void AliESDtrackCuts::DefineHistograms(Int_t color) {
795 // diagnostics histograms are defined
800 //###################################################################################
801 // defining histograms
803 fhCutStatistics = new TH1F("cut_statistics","cut statistics",kNCuts+4,-0.5,kNCuts+3.5);
805 fhCutStatistics->GetXaxis()->SetBinLabel(1,"n tracks");
806 fhCutStatistics->GetXaxis()->SetBinLabel(2,"n cut tracks");
808 fhCutCorrelation = new TH2F("cut_correlation","cut correlation",kNCuts,-0.5,kNCuts-0.5,kNCuts,-0.5,kNCuts-0.5);;
810 for (Int_t i=0; i<kNCuts; i++) {
811 fhCutStatistics->GetXaxis()->SetBinLabel(i+4,fgkCutNames[i]);
812 fhCutCorrelation->GetXaxis()->SetBinLabel(i+1,fgkCutNames[i]);
813 fhCutCorrelation->GetYaxis()->SetBinLabel(i+1,fgkCutNames[i]);
816 fhCutStatistics ->SetLineColor(color);
817 fhCutCorrelation ->SetLineColor(color);
818 fhCutStatistics ->SetLineWidth(2);
819 fhCutCorrelation ->SetLineWidth(2);
822 for (Int_t i=0; i<2; i++) {
823 if (i==0) sprintf(str," ");
824 else sprintf(str,"_cut");
826 fhNClustersITS[i] = new TH1F(Form("nClustersITS%s",str),"",8,-0.5,7.5);
827 fhNClustersTPC[i] = new TH1F(Form("nClustersTPC%s",str),"",165,-0.5,164.5);
828 fhChi2PerClusterITS[i] = new TH1F(Form("chi2PerClusterITS%s",str),"",500,0,10);
829 fhChi2PerClusterTPC[i] = new TH1F(Form("chi2PerClusterTPC%s",str),"",500,0,10);
831 fhC11[i] = new TH1F(Form("covMatrixDiagonal11%s",str),"",2000,0,20);
832 fhC22[i] = new TH1F(Form("covMatrixDiagonal22%s",str),"",2000,0,20);
833 fhC33[i] = new TH1F(Form("covMatrixDiagonal33%s",str),"",1000,0,1);
834 fhC44[i] = new TH1F(Form("covMatrixDiagonal44%s",str),"",1000,0,5);
835 fhC55[i] = new TH1F(Form("covMatrixDiagonal55%s",str),"",1000,0,5);
837 fhDXY[i] = new TH1F(Form("dXY%s",str),"",500,-10,10);
838 fhDZ[i] = new TH1F(Form("dZ%s",str),"",500,-10,10);
839 fhDXYvsDZ[i] = new TH2F(Form("dXYvsDZ%s",str),"",200,-10,10,200,-10,10);
841 fhDXYNormalized[i] = new TH1F(Form("dXYNormalized%s",str),"",500,-10,10);
842 fhDZNormalized[i] = new TH1F(Form("dZNormalized%s",str),"",500,-10,10);
843 fhDXYvsDZNormalized[i] = new TH2F(Form("dXYvsDZNormalized%s",str),"",200,-10,10,200,-10,10);
845 fhNSigmaToVertex[i] = new TH1F(Form("nSigmaToVertex%s",str),"",500,0,50);
847 fhNClustersITS[i]->SetXTitle("n ITS clusters");
848 fhNClustersTPC[i]->SetXTitle("n TPC clusters");
849 fhChi2PerClusterITS[i]->SetXTitle("#Chi^{2} per ITS cluster");
850 fhChi2PerClusterTPC[i]->SetXTitle("#Chi^{2} per TPC cluster");
852 fhC11[i]->SetXTitle("cov 11 : #sigma_{y}^{2} [cm^{2}]");
853 fhC22[i]->SetXTitle("cov 22 : #sigma_{z}^{2} [cm^{2}]");
854 fhC33[i]->SetXTitle("cov 33 : #sigma_{sin(#phi)}^{2}");
855 fhC44[i]->SetXTitle("cov 44 : #sigma_{tan(#theta_{dip})}^{2}");
856 fhC55[i]->SetXTitle("cov 55 : #sigma_{1/p_{T}}^{2} [(c/GeV)^2]");
858 fhDXY[i]->SetXTitle("transverse impact parameter");
859 fhDZ[i]->SetXTitle("longitudinal impact parameter");
860 fhDXYvsDZ[i]->SetXTitle("longitudinal impact parameter");
861 fhDXYvsDZ[i]->SetYTitle("transverse impact parameter");
863 fhDXYNormalized[i]->SetXTitle("normalized trans impact par");
864 fhDZNormalized[i]->SetXTitle("normalized long impact par");
865 fhDXYvsDZNormalized[i]->SetXTitle("normalized long impact par");
866 fhDXYvsDZNormalized[i]->SetYTitle("normalized trans impact par");
867 fhNSigmaToVertex[i]->SetXTitle("n #sigma to vertex");
869 fhNClustersITS[i]->SetLineColor(color); fhNClustersITS[i]->SetLineWidth(2);
870 fhNClustersTPC[i]->SetLineColor(color); fhNClustersTPC[i]->SetLineWidth(2);
871 fhChi2PerClusterITS[i]->SetLineColor(color); fhChi2PerClusterITS[i]->SetLineWidth(2);
872 fhChi2PerClusterTPC[i]->SetLineColor(color); fhChi2PerClusterTPC[i]->SetLineWidth(2);
874 fhC11[i]->SetLineColor(color); fhC11[i]->SetLineWidth(2);
875 fhC22[i]->SetLineColor(color); fhC22[i]->SetLineWidth(2);
876 fhC33[i]->SetLineColor(color); fhC33[i]->SetLineWidth(2);
877 fhC44[i]->SetLineColor(color); fhC44[i]->SetLineWidth(2);
878 fhC55[i]->SetLineColor(color); fhC55[i]->SetLineWidth(2);
880 fhDXY[i]->SetLineColor(color); fhDXY[i]->SetLineWidth(2);
881 fhDZ[i]->SetLineColor(color); fhDZ[i]->SetLineWidth(2);
883 fhDXYNormalized[i]->SetLineColor(color); fhDXYNormalized[i]->SetLineWidth(2);
884 fhDZNormalized[i]->SetLineColor(color); fhDZNormalized[i]->SetLineWidth(2);
885 fhNSigmaToVertex[i]->SetLineColor(color); fhNSigmaToVertex[i]->SetLineWidth(2);
888 // The number of sigmas to the vertex is per definition gaussian
889 ffDTheoretical = new TF1("nSigmaToVertexTheoretical","([0]/2.506628274)*exp(-(x**2)/2)",0,50);
890 ffDTheoretical->SetParameter(0,1);
895 //____________________________________________________________________
897 AliESDtrackCuts::Print(const Option_t*) const {
899 // print method - still to be implemented
902 AliInfo("AliESDtrackCuts...");
906 //____________________________________________________________________
907 void AliESDtrackCuts::SaveHistograms(Char_t* dir) {
909 // saves the histograms in a directory (dir)
913 if (!fHistogramsOn) {
914 AliDebug(0, "Histograms not on - cannot save histograms!!!");
918 gDirectory->mkdir(dir);
921 outfile = dir; outfile += ".root";
922 TFile *f = TFile::Open(outfile.Data(),"recreate");
924 gDirectory->mkdir("before_cuts");
925 gDirectory->mkdir("after_cuts");
927 // a factor of 2 is needed since n sigma is positive
928 ffDTheoretical->SetParameter(0,2*fhNSigmaToVertex[0]->Integral("width"));
929 ffDTheoretical->Write("nSigmaToVertexTheory");
931 fhCutStatistics->Write();
932 fhCutCorrelation->Write();
934 for (Int_t i=0; i<2; i++) {
936 gDirectory->cd("before_cuts");
938 gDirectory->cd("after_cuts");
939 fhNClustersITS[i] ->Write();
940 fhNClustersTPC[i] ->Write();
941 fhChi2PerClusterITS[i] ->Write();
942 fhChi2PerClusterTPC[i] ->Write();
952 fhDXYvsDZ[i] ->Write();
954 fhDXYNormalized[i] ->Write();
955 fhDZNormalized[i] ->Write();
956 fhDXYvsDZNormalized[i] ->Write();
957 fhNSigmaToVertex[i] ->Write();
959 gDirectory->cd("../");
964 gDirectory->cd("../");