]>
Commit | Line | Data |
---|---|---|
73318471 | 1 | // |
2 | // Class for handling of ESD track cuts. | |
3 | // | |
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 | |
524916f0 | 8 | // returns kTRUE/kFALSE or GetAcceptedTracks which takes an AliESDEvent |
73318471 | 9 | // object and returns an TObjArray (of AliESDtracks) with the tracks |
10 | // in the ESD that survived the cuts. | |
11 | // | |
12 | // | |
524916f0 | 13 | // TODO: |
73318471 | 14 | // - add functionality to save and load cuts |
73318471 | 15 | // - add histograms for kinematic cut variables? |
16 | // - upper and lower cuts for all (non-boolean) cuts | |
17 | // - update print method | |
73318471 | 18 | // - put comments to each variable |
19 | // | |
20 | ||
21 | #ifndef ALIESDTRACKCUTS_H | |
22 | #define ALIESDTRACKCUTS_H | |
23 | ||
73318471 | 24 | #include "AliAnalysisCuts.h" |
25 | ||
73318471 | 26 | class AliESDEvent; |
27 | class AliESDtrack; | |
28 | class AliLog; | |
29 | class TTree; | |
d95684c0 | 30 | class TH1; |
31 | class TH1F; | |
32 | class TH2F; | |
33 | class TF1; | |
34 | class TCollection; | |
73318471 | 35 | |
36 | class AliESDtrackCuts : public AliAnalysisCuts | |
37 | { | |
38 | public: | |
94c06b89 | 39 | enum ITSClusterRequirement { kOff = 0, kNone, kAny, kFirst, kOnlyFirst, kSecond, kOnlySecond, kBoth }; |
40 | enum Detector { kSPD = 0, kSDD, kSSD }; | |
41 | ||
73318471 | 42 | AliESDtrackCuts(const Char_t* name = "AliESDtrackCuts", const Char_t* title = ""); |
43 | virtual ~AliESDtrackCuts(); | |
36853ddd | 44 | |
9eeae5d5 | 45 | Bool_t IsSelected(TObject* obj) |
46 | {return AcceptTrack((AliESDtrack*)obj);} | |
47 | Bool_t IsSelected(TList* /*list*/) {return kTRUE;} | |
36853ddd | 48 | |
73318471 | 49 | Bool_t AcceptTrack(AliESDtrack* esdTrack); |
74687314 | 50 | TObjArray* GetAcceptedTracks(AliESDEvent* esd, Bool_t bTPC = kFALSE); |
73318471 | 51 | Int_t CountAcceptedTracks(AliESDEvent* esd); |
1bf80d20 | 52 | |
53 | static Int_t GetReferenceMultiplicity(AliESDEvent* esd, Bool_t tpcOnly); | |
73318471 | 54 | |
524916f0 | 55 | static AliESDtrack* GetTPCOnlyTrack(AliESDEvent* esd, Int_t iTrack); |
1bf80d20 | 56 | |
57 | // Standard cut definitions | |
58 | static AliESDtrackCuts* GetStandardTPCOnlyTrackCuts(); | |
524916f0 | 59 | |
73318471 | 60 | virtual Long64_t Merge(TCollection* list); |
61 | virtual void Copy(TObject &c) const; | |
62 | AliESDtrackCuts(const AliESDtrackCuts& pd); // Copy Constructor | |
63 | AliESDtrackCuts &operator=(const AliESDtrackCuts &c); | |
64 | ||
65 | //###################################################### | |
66 | // track quality cut setters | |
67 | void SetMinNClustersTPC(Int_t min=-1) {fCutMinNClusterTPC=min;} | |
68 | void SetMinNClustersITS(Int_t min=-1) {fCutMinNClusterITS=min;} | |
94c06b89 | 69 | void SetClusterRequirementITS(Detector det, ITSClusterRequirement req = kOff) { fCutClusterRequirementITS[det] = req; } |
73318471 | 70 | void SetMaxChi2PerClusterTPC(Float_t max=1e10) {fCutMaxChi2PerClusterTPC=max;} |
71 | void SetMaxChi2PerClusterITS(Float_t max=1e10) {fCutMaxChi2PerClusterITS=max;} | |
72 | void SetRequireTPCRefit(Bool_t b=kFALSE) {fCutRequireTPCRefit=b;} | |
a86cf7f4 | 73 | void SetRequireTPCStandAlone(Bool_t b=kFALSE) {fCutRequireTPCStandAlone=b;} |
73318471 | 74 | void SetRequireITSRefit(Bool_t b=kFALSE) {fCutRequireITSRefit=b;} |
d95684c0 | 75 | void SetRequireITSStandAlone(Bool_t b) {fCutRequireITSStandAlone = b;} |
29387958 | 76 | void SetAcceptKinkDaughters(Bool_t b=kTRUE) {fCutAcceptKinkDaughters=b;} |
73318471 | 77 | void SetMaxCovDiagonalElements(Float_t c1=1e10, Float_t c2=1e10, Float_t c3=1e10, Float_t c4=1e10, Float_t c5=1e10) |
78 | {fCutMaxC11=c1; fCutMaxC22=c2; fCutMaxC33=c3; fCutMaxC44=c4; fCutMaxC55=c5;} | |
025fb458 | 79 | void SetMaxRel1PtUncertainty(Float_t max=1e10) {fCutMaxRel1PtUncertainty=max;} |
73318471 | 80 | |
81 | // track to vertex cut setters | |
610e91ac | 82 | void SetMaxNsigmaToVertex(Float_t sigma=1e10) {fCutNsigmaToVertex = sigma; SetRequireSigmaToVertex(kTRUE);} |
29387958 | 83 | void SetRequireSigmaToVertex(Bool_t b=kTRUE) {fCutSigmaToVertexRequired = b;} |
133a5e00 | 84 | void SetMaxDCAToVertexXY(Float_t dist=1e10) {fCutMaxDCAToVertexXY = dist;} |
85 | void SetMaxDCAToVertexZ(Float_t dist=1e10) {fCutMaxDCAToVertexZ = dist;} | |
86 | void SetMinDCAToVertexXY(Float_t dist=0.) {fCutMinDCAToVertexXY = dist;} | |
87 | void SetMinDCAToVertexZ(Float_t dist=0.) {fCutMinDCAToVertexZ = dist;} | |
86f0e195 | 88 | void SetDCAToVertex2D(Bool_t b=kFALSE) {fCutDCAToVertex2D = b;} |
73318471 | 89 | |
90 | // getters | |
73318471 | 91 | |
5ce43eaf | 92 | Int_t GetMinNClusterTPC() const { return fCutMinNClusterTPC;} |
93 | Int_t GetMinNClustersITS() const { return fCutMinNClusterITS;} | |
94c06b89 | 94 | ITSClusterRequirement GetClusterRequirementITS(Detector det) const { return fCutClusterRequirementITS[det]; } |
5ce43eaf | 95 | Float_t GetMaxChi2PerClusterTPC() const { return fCutMaxChi2PerClusterTPC;} |
96 | Float_t GetMaxChi2PerClusterITS() const { return fCutMaxChi2PerClusterITS;} | |
97 | Bool_t GetRequireTPCRefit() const { return fCutRequireTPCRefit;} | |
a86cf7f4 | 98 | Bool_t GetRequireTPCStandAlone() const { return fCutRequireTPCStandAlone;} |
5ce43eaf | 99 | Bool_t GetRequireITSRefit() const { return fCutRequireITSRefit;} |
d95684c0 | 100 | Bool_t GetRequireITSStandAlone() const { return fCutRequireITSStandAlone; } |
58c4f3fb | 101 | Bool_t GetAcceptKinkDaughters() const { return fCutAcceptKinkDaughters;} |
5ce43eaf | 102 | void GetMaxCovDiagonalElements(Float_t& c1, Float_t& c2, Float_t& c3, Float_t& c4, Float_t& c5) |
103 | {c1 = fCutMaxC11; c2 = fCutMaxC22; c3 = fCutMaxC33; c4 = fCutMaxC44; c5 = fCutMaxC55;} | |
025fb458 | 104 | Float_t GetMaxRel1PtUncertainty() const { return fCutMaxRel1PtUncertainty;} |
94c06b89 | 105 | Float_t GetMaxNsigmaToVertex() const { return fCutNsigmaToVertex;} |
133a5e00 | 106 | Float_t GetMaxDCAToVertexXY() const { return fCutMaxDCAToVertexXY;} |
107 | Float_t GetMaxDCAToVertexZ() const { return fCutMaxDCAToVertexZ;} | |
108 | Float_t GetMinDCAToVertexXY() const { return fCutMinDCAToVertexXY;} | |
109 | Float_t GetMinDCAToVertexZ() const { return fCutMinDCAToVertexZ;} | |
86f0e195 | 110 | Bool_t GetDCAToVertex2D() const { return fCutDCAToVertex2D;} |
5ce43eaf | 111 | Bool_t GetRequireSigmaToVertex( ) const { return fCutSigmaToVertexRequired;} |
5ac99092 | 112 | |
1bf80d20 | 113 | void GetPRange(Float_t& r1, Float_t& r2) const {r1=fPMin; r2=fPMax;} |
114 | void GetPtRange(Float_t& r1, Float_t& r2) const {r1=fPtMin; r2=fPtMax;} | |
115 | void GetPxRange(Float_t& r1, Float_t& r2) const {r1=fPxMin; r2=fPxMax;} | |
116 | void GetPyRange(Float_t& r1, Float_t& r2) const {r1=fPyMin; r2=fPyMax;} | |
117 | void GetPzRange(Float_t& r1, Float_t& r2) const {r1=fPzMin; r2=fPzMax;} | |
118 | void GetEtaRange(Float_t& r1, Float_t& r2) const {r1=fEtaMin; r2=fEtaMax;} | |
119 | void GetRapRange(Float_t& r1, Float_t& r2) const {r1=fRapMin; r2=fRapMax;} | |
74687314 | 120 | |
73318471 | 121 | // track kinmatic cut setters |
122 | void SetPRange(Float_t r1=0, Float_t r2=1e10) {fPMin=r1; fPMax=r2;} | |
123 | void SetPtRange(Float_t r1=0, Float_t r2=1e10) {fPtMin=r1; fPtMax=r2;} | |
124 | void SetPxRange(Float_t r1=-1e10, Float_t r2=1e10) {fPxMin=r1; fPxMax=r2;} | |
125 | void SetPyRange(Float_t r1=-1e10, Float_t r2=1e10) {fPyMin=r1; fPyMax=r2;} | |
126 | void SetPzRange(Float_t r1=-1e10, Float_t r2=1e10) {fPzMin=r1; fPzMax=r2;} | |
127 | void SetEtaRange(Float_t r1=-1e10, Float_t r2=1e10) {fEtaMin=r1; fEtaMax=r2;} | |
128 | void SetRapRange(Float_t r1=-1e10, Float_t r2=1e10) {fRapMin=r1; fRapMax=r2;} | |
129 | ||
130 | //###################################################### | |
131 | void SetHistogramsOn(Bool_t b=kFALSE) {fHistogramsOn = b;} | |
132 | void DefineHistograms(Int_t color=1); | |
133 | virtual Bool_t LoadHistograms(const Char_t* dir = 0); | |
134 | void SaveHistograms(const Char_t* dir = 0); | |
135 | void DrawHistograms(); | |
136 | ||
57fddfbc | 137 | static Float_t GetSigmaToVertex(AliESDtrack* esdTrack); |
73318471 | 138 | |
139 | static void EnableNeededBranches(TTree* tree); | |
140 | ||
141 | // void SaveQualityCuts(Char_t* file) | |
142 | // void LoadQualityCuts(Char_t* file) | |
143 | ||
d95684c0 | 144 | TH1F* GetDZNormalized(Int_t i) const { return fhDZNormalized[i]; } |
73318471 | 145 | |
146 | protected: | |
147 | void Init(); // sets everything to 0 | |
94c06b89 | 148 | Bool_t CheckITSClusterRequirement(ITSClusterRequirement req, Bool_t clusterL1, Bool_t clusterL2); |
149 | ||
a86cf7f4 | 150 | enum { kNCuts = 33 }; |
73318471 | 151 | |
152 | //###################################################### | |
153 | // esd track quality cuts | |
154 | static const Char_t* fgkCutNames[kNCuts]; //! names of cuts (for internal use) | |
155 | ||
156 | Int_t fCutMinNClusterTPC; // min number of tpc clusters | |
157 | Int_t fCutMinNClusterITS; // min number of its clusters | |
94c06b89 | 158 | |
159 | ITSClusterRequirement fCutClusterRequirementITS[3]; // detailed ITS cluster requirements for (SPD, SDD, SSD) | |
73318471 | 160 | |
161 | Float_t fCutMaxChi2PerClusterTPC; // max tpc fit chi2 per tpc cluster | |
162 | Float_t fCutMaxChi2PerClusterITS; // max its fit chi2 per its cluster | |
163 | ||
164 | Float_t fCutMaxC11; // max cov. matrix diag. elements (res. y^2) | |
165 | Float_t fCutMaxC22; // max cov. matrix diag. elements (res. z^2) | |
166 | Float_t fCutMaxC33; // max cov. matrix diag. elements (res. sin(phi)^2) | |
167 | Float_t fCutMaxC44; // max cov. matrix diag. elements (res. tan(theta_dip)^2) | |
168 | Float_t fCutMaxC55; // max cov. matrix diag. elements (res. 1/pt^2) | |
169 | ||
025fb458 | 170 | Float_t fCutMaxRel1PtUncertainty; // max relative uncertainty of 1/pt |
171 | ||
73318471 | 172 | Bool_t fCutAcceptKinkDaughters; // accepting kink daughters? |
173 | Bool_t fCutRequireTPCRefit; // require TPC refit | |
a86cf7f4 | 174 | Bool_t fCutRequireTPCStandAlone; // require TPC standalone tracks |
73318471 | 175 | Bool_t fCutRequireITSRefit; // require ITS refit |
d95684c0 | 176 | Bool_t fCutRequireITSStandAlone; // require ITS standalone tracks |
73318471 | 177 | |
178 | // track to vertex cut | |
179 | Float_t fCutNsigmaToVertex; // max number of estimated sigma from track-to-vertex | |
180 | Bool_t fCutSigmaToVertexRequired; // cut track if sigma from track-to-vertex could not be calculated | |
133a5e00 | 181 | Float_t fCutMaxDCAToVertexXY; // track-to-vertex cut in max absolute distance in xy-plane |
182 | Float_t fCutMaxDCAToVertexZ; // track-to-vertex cut in max absolute distance in z-plane | |
183 | Float_t fCutMinDCAToVertexXY; // track-to-vertex cut on min absolute distance in xy-plane | |
184 | Float_t fCutMinDCAToVertexZ; // track-to-vertex cut on min absolute distance in z-plane | |
185 | Bool_t fCutDCAToVertex2D; // if true a 2D DCA cut is made. Tracks are accepted if sqrt((DCAXY / fCutMaxDCAToVertexXY)^2 + (DCAZ / fCutMaxDCAToVertexZ)^2) < 1 AND sqrt((DCAXY / fCutMinDCAToVertexXY)^2 + (DCAZ / fCutMinDCAToVertexZ)^2) > 1 | |
73318471 | 186 | |
187 | // esd kinematics cuts | |
188 | Float_t fPMin, fPMax; // definition of the range of the P | |
189 | Float_t fPtMin, fPtMax; // definition of the range of the Pt | |
190 | Float_t fPxMin, fPxMax; // definition of the range of the Px | |
191 | Float_t fPyMin, fPyMax; // definition of the range of the Py | |
192 | Float_t fPzMin, fPzMax; // definition of the range of the Pz | |
193 | Float_t fEtaMin, fEtaMax; // definition of the range of the eta | |
194 | Float_t fRapMin, fRapMax; // definition of the range of the y | |
195 | ||
196 | //###################################################### | |
197 | // diagnostics histograms | |
198 | Bool_t fHistogramsOn; // histograms on/off | |
199 | ||
200 | TH1F* fhNClustersITS[2]; //-> | |
201 | TH1F* fhNClustersTPC[2]; //-> | |
202 | ||
203 | TH1F* fhChi2PerClusterITS[2]; //-> | |
204 | TH1F* fhChi2PerClusterTPC[2]; //-> | |
205 | ||
206 | TH1F* fhC11[2]; //-> | |
207 | TH1F* fhC22[2]; //-> | |
208 | TH1F* fhC33[2]; //-> | |
209 | TH1F* fhC44[2]; //-> | |
210 | TH1F* fhC55[2]; //-> | |
211 | ||
025fb458 | 212 | TH1F* fhRel1PtUncertainty[2]; //-> rel. uncertainty of 1/pt |
213 | ||
73318471 | 214 | TH1F* fhDXY[2]; //-> |
215 | TH1F* fhDZ[2]; //-> | |
86f0e195 | 216 | TH1F* fhDXYDZ[2]; //-> absolute distance sqrt(dxy**2 + dz**2) to vertex; if 2D cut is set, normalized to given values |
73318471 | 217 | TH2F* fhDXYvsDZ[2]; //-> |
218 | ||
219 | TH1F* fhDXYNormalized[2]; //-> | |
220 | TH1F* fhDZNormalized[2]; //-> | |
221 | TH2F* fhDXYvsDZNormalized[2]; //-> | |
222 | TH1F* fhNSigmaToVertex[2]; //-> | |
524916f0 | 223 | |
73318471 | 224 | TH1F* fhPt[2]; //-> pt of esd tracks |
225 | TH1F* fhEta[2]; //-> eta of esd tracks | |
226 | ||
227 | TF1* ffDTheoretical; //-> theoretical distance to vertex normalized (2d gauss) | |
228 | ||
229 | TH1F* fhCutStatistics; //-> statistics of what cuts the tracks did not survive | |
230 | TH2F* fhCutCorrelation; //-> 2d statistics plot | |
231 | ||
a86cf7f4 | 232 | ClassDef(AliESDtrackCuts, 8) |
73318471 | 233 | }; |
234 | ||
235 | ||
236 | #endif |