2 // Class for handling of ESD track cuts.
4 // The class manages a number of track quality cuts, a
5 // track-to-vertex cut and a number of kinematic cuts. Two methods
6 // can be used to figure out if an ESD track survives the cuts:
7 // AcceptTrack which takes a single AliESDtrack as argument and
8 // returns kTRUE/kFALSE or GetAcceptedTracks which takes an AliESD
9 // object and returns an TObjArray (of AliESDtracks) with the tracks
10 // in the ESD that survived the cuts.
14 // - add functionality to save and load cuts
15 // - add different ways to make track to vertex cut
16 // - add histograms for kinematic cut variables?
17 // - upper and lower cuts for all (non-boolean) cuts
18 // - update print method
19 // - is there a smarter way to manage the cuts?
20 // - put comments to each variable
23 #ifndef ALIESDTRACKCUTS_H
24 #define ALIESDTRACKCUTS_H
28 #include "AliAnalysisCuts.h"
36 class AliESDtrackCuts : public AliAnalysisCuts
39 AliESDtrackCuts(const Char_t* name = "AliESDtrackCuts", const Char_t* title = "");
40 virtual ~AliESDtrackCuts();
41 Bool_t IsSelected(TObject* obj)
42 {return AcceptTrack((AliESDtrack*)obj);}
43 Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
44 Bool_t AcceptTrack(AliESDtrack* esdTrack);
45 TObjArray* GetAcceptedTracks(AliESD* esd);
46 Int_t CountAcceptedTracks(AliESD* esd);
47 TObjArray* GetAcceptedTracks(AliESDEvent* esd);
48 Int_t CountAcceptedTracks(AliESDEvent* esd);
50 virtual Long64_t Merge(TCollection* list);
51 virtual void Copy(TObject &c) const;
52 AliESDtrackCuts(const AliESDtrackCuts& pd); // Copy Constructor
53 AliESDtrackCuts &operator=(const AliESDtrackCuts &c);
55 //######################################################
56 // track quality cut setters
57 void SetMinNClustersTPC(Int_t min=-1) {fCutMinNClusterTPC=min;}
58 void SetMinNClustersITS(Int_t min=-1) {fCutMinNClusterITS=min;}
59 void SetMaxChi2PerClusterTPC(Float_t max=1e10) {fCutMaxChi2PerClusterTPC=max;}
60 void SetMaxChi2PerClusterITS(Float_t max=1e10) {fCutMaxChi2PerClusterITS=max;}
61 void SetRequireTPCRefit(Bool_t b=kFALSE) {fCutRequireTPCRefit=b;}
62 void SetRequireITSRefit(Bool_t b=kFALSE) {fCutRequireITSRefit=b;}
63 void SetAcceptKingDaughters(Bool_t b=kFALSE) {fCutAcceptKinkDaughters=b;}
64 void SetMaxCovDiagonalElements(Float_t c1=1e10, Float_t c2=1e10, Float_t c3=1e10, Float_t c4=1e10, Float_t c5=1e10)
65 {fCutMaxC11=c1; fCutMaxC22=c2; fCutMaxC33=c3; fCutMaxC44=c4; fCutMaxC55=c5;}
67 // track to vertex cut setters
68 void SetMinNsigmaToVertex(Float_t sigma=1e10) {fCutNsigmaToVertex = sigma;}
69 void SetRequireSigmaToVertex(Bool_t b=kTRUE ) {fCutSigmaToVertexRequired = b;}
72 Float_t GetMinNsigmaToVertex() { return fCutNsigmaToVertex;}
73 Bool_t GetRequireSigmaToVertex( ) { return fCutSigmaToVertexRequired;}
75 // track kinmatic cut setters
76 void SetPRange(Float_t r1=0, Float_t r2=1e10) {fPMin=r1; fPMax=r2;}
77 void SetPtRange(Float_t r1=0, Float_t r2=1e10) {fPtMin=r1; fPtMax=r2;}
78 void SetPxRange(Float_t r1=-1e10, Float_t r2=1e10) {fPxMin=r1; fPxMax=r2;}
79 void SetPyRange(Float_t r1=-1e10, Float_t r2=1e10) {fPyMin=r1; fPyMax=r2;}
80 void SetPzRange(Float_t r1=-1e10, Float_t r2=1e10) {fPzMin=r1; fPzMax=r2;}
81 void SetEtaRange(Float_t r1=-1e10, Float_t r2=1e10) {fEtaMin=r1; fEtaMax=r2;}
82 void SetRapRange(Float_t r1=-1e10, Float_t r2=1e10) {fRapMin=r1; fRapMax=r2;}
84 //######################################################
85 void SetHistogramsOn(Bool_t b=kFALSE) {fHistogramsOn = b;}
86 void DefineHistograms(Int_t color=1);
87 virtual Bool_t LoadHistograms(const Char_t* dir = 0);
88 void SaveHistograms(const Char_t* dir = 0);
89 void DrawHistograms();
91 Float_t GetSigmaToVertex(AliESDtrack* esdTrack);
93 static void EnableNeededBranches(TTree* tree);
95 // void SaveQualityCuts(Char_t* file)
96 // void LoadQualityCuts(Char_t* file)
98 TH1* GetDZNormalized(Int_t i) const { return fhDZNormalized[i]; }
101 void Init(); // sets everything to 0
103 enum { kNCuts = 21 };
105 //######################################################
106 // esd track quality cuts
107 static const Char_t* fgkCutNames[kNCuts]; //! names of cuts (for internal use)
109 Int_t fCutMinNClusterTPC; // min number of tpc clusters
110 Int_t fCutMinNClusterITS; // min number of its clusters
112 Float_t fCutMaxChi2PerClusterTPC; // max tpc fit chi2 per tpc cluster
113 Float_t fCutMaxChi2PerClusterITS; // max its fit chi2 per its cluster
115 Float_t fCutMaxC11; // max cov. matrix diag. elements (res. y^2)
116 Float_t fCutMaxC22; // max cov. matrix diag. elements (res. z^2)
117 Float_t fCutMaxC33; // max cov. matrix diag. elements (res. sin(phi)^2)
118 Float_t fCutMaxC44; // max cov. matrix diag. elements (res. tan(theta_dip)^2)
119 Float_t fCutMaxC55; // max cov. matrix diag. elements (res. 1/pt^2)
121 Bool_t fCutAcceptKinkDaughters; // accepting kink daughters?
122 Bool_t fCutRequireTPCRefit; // require TPC refit
123 Bool_t fCutRequireITSRefit; // require ITS refit
125 // track to vertex cut
126 Float_t fCutNsigmaToVertex; // max number of estimated sigma from track-to-vertex
127 Bool_t fCutSigmaToVertexRequired; // cut track if sigma from track-to-vertex could not be calculated
129 // esd kinematics cuts
130 Float_t fPMin, fPMax; // definition of the range of the P
131 Float_t fPtMin, fPtMax; // definition of the range of the Pt
132 Float_t fPxMin, fPxMax; // definition of the range of the Px
133 Float_t fPyMin, fPyMax; // definition of the range of the Py
134 Float_t fPzMin, fPzMax; // definition of the range of the Pz
135 Float_t fEtaMin, fEtaMax; // definition of the range of the eta
136 Float_t fRapMin, fRapMax; // definition of the range of the y
138 //######################################################
139 // diagnostics histograms
140 Bool_t fHistogramsOn; // histograms on/off
142 TH1F* fhNClustersITS[2]; //->
143 TH1F* fhNClustersTPC[2]; //->
145 TH1F* fhChi2PerClusterITS[2]; //->
146 TH1F* fhChi2PerClusterTPC[2]; //->
156 TH2F* fhDXYvsDZ[2]; //->
158 TH1F* fhDXYNormalized[2]; //->
159 TH1F* fhDZNormalized[2]; //->
160 TH2F* fhDXYvsDZNormalized[2]; //->
161 TH1F* fhNSigmaToVertex[2]; //->
163 TH1F* fhPt[2]; //-> pt of esd tracks
164 TH1F* fhEta[2]; //-> eta of esd tracks
166 TF1* ffDTheoretical; //-> theoretical distance to vertex normalized (2d gauss)
168 TH1F* fhCutStatistics; //-> statistics of what cuts the tracks did not survive
169 TH2F* fhCutCorrelation; //-> 2d statistics plot
171 ClassDef(AliESDtrackCuts, 2)