5c834ad5 |
1 | #ifndef ALIESDTRACKCUTS_H |
2 | #define ALIESDTRACKCUTS_H |
3 | |
4 | //**************************************************************** |
5 | // |
6 | // Class for handling of ESD track cuts |
7 | // |
8 | // TODO: |
9 | // - add functionality to save and load cuts |
10 | // - fix the n sigma cut so it is really a n sigma cut |
11 | // - add different ways to make track to vertex cut |
12 | // - add histograms for kinematic cut variables? |
13 | // - upper and lower cuts for all (non-boolean) cuts |
14 | // - update print method |
15 | // - is there a smarter way to manage the cuts? |
16 | // |
49dc84d9 |
17 | // |
18 | // NOTE: |
19 | // - |
20 | // |
21 | |
5c834ad5 |
22 | |
5c834ad5 |
23 | #include "TObject.h" |
5c834ad5 |
24 | #include "TTree.h" |
5c834ad5 |
25 | #include "TH2.h" |
5c834ad5 |
26 | |
27 | #include "AliESD.h" |
28 | #include "AliESDtrack.h" |
29 | #include "AliLog.h" |
30 | |
31 | class AliESDtrackCuts : public TObject |
32 | { |
33 | protected: |
34 | |
35 | //###################################################### |
36 | // esd track quality cuts |
37 | static const Int_t fNCuts = 21; |
38 | Char_t* fCutNames[21]; |
39 | |
40 | Int_t fCut_MinNClusterTPC; // min number of tpc clusters |
41 | Int_t fCut_MinNClusterITS; // min number of its clusters |
42 | |
43 | Float_t fCut_MaxChi2PerClusterTPC; // max tpc fit chi2 per tpc cluster |
44 | Float_t fCut_MaxChi2PerClusterITS; // max its fit chi2 per its cluster |
45 | |
46 | Float_t fCut_MaxC11; // max resolutions of covariance matrix diag. elements |
47 | Float_t fCut_MaxC22; |
48 | Float_t fCut_MaxC33; |
49 | Float_t fCut_MaxC44; |
50 | Float_t fCut_MaxC55; |
51 | |
52 | Bool_t fCut_AcceptKinkDaughters; // accepting kink daughters? |
53 | Bool_t fCut_RequireTPCRefit; // require TPC refit |
54 | Bool_t fCut_RequireITSRefit; // require ITS refit |
55 | |
56 | // track to vertex cut |
57 | Float_t fCut_NsigmaToVertex; // max number of estimated sigma from track-to-vertex |
58 | Bool_t fCut_SigmaToVertexRequired; // cut track if sigma from track-to-vertex could not be calculated |
59 | |
60 | // esd kinematics cuts |
61 | Float_t fPMin, fPMax; // definition of the range of the P |
62 | Float_t fPtMin, fPtMax; // definition of the range of the Pt |
63 | Float_t fPxMin, fPxMax; // definition of the range of the Px |
64 | Float_t fPyMin, fPyMax; // definition of the range of the Py |
65 | Float_t fPzMin, fPzMax; // definition of the range of the Pz |
66 | Float_t fEtaMin, fEtaMax; // definition of the range of the eta |
67 | Float_t fRapMin, fRapMax; // definition of the range of the y |
68 | |
69 | //###################################################### |
70 | // array of accepted ESD tracks |
71 | |
72 | TObjArray* fAcceptedTracks; // List of accepted esd tracks after cuts |
73 | |
74 | |
75 | //###################################################### |
76 | // diagnostics histograms |
77 | Bool_t fHistogramsOn; |
78 | |
79 | TH1F** hNClustersITS; |
80 | TH1F** hNClustersTPC; |
81 | |
82 | TH1F** hChi2PerClusterITS; |
83 | TH1F** hChi2PerClusterTPC; |
84 | |
85 | TH1F** hC11; |
86 | TH1F** hC22; |
87 | TH1F** hC33; |
88 | TH1F** hC44; |
89 | TH1F** hC55; |
90 | |
91 | TH1F** hDXY; |
92 | TH1F** hDZ; |
93 | TH2F** hDXYvsDZ; |
94 | |
95 | TH1F** hDXYNormalized; |
96 | TH1F** hDZNormalized; |
97 | TH2F** hDXYvsDZNormalized; |
98 | |
99 | TH1F* hCutStatistics; |
100 | TH2F* hCutCorrelation; |
101 | |
102 | |
103 | // dummy array |
104 | Int_t fIdxInt[200]; |
105 | |
106 | public: |
107 | AliESDtrackCuts(); |
108 | |
109 | Bool_t AcceptTrack(AliESDtrack* esdTrack); |
49dc84d9 |
110 | |
5c834ad5 |
111 | TObjArray* GetAcceptedTracks(AliESD* esd); |
112 | |
113 | //###################################################### |
114 | // track quality cut setters |
115 | void SetMinNClustersTPC(Int_t min=-1) {fCut_MinNClusterTPC=min;} |
116 | void SetMinNClustersITS(Int_t min=-1) {fCut_MinNClusterITS=min;} |
117 | void SetMaxChi2PerClusterTPC(Float_t max=1e99) {fCut_MaxChi2PerClusterTPC=max;} |
118 | void SetMaxChi2PerClusterITS(Float_t max=1e99) {fCut_MaxChi2PerClusterITS=max;} |
119 | void SetRequireTPCRefit(Bool_t b=kFALSE) {fCut_RequireTPCRefit=b;} |
120 | void SetRequireITSRefit(Bool_t b=kFALSE) {fCut_RequireITSRefit=b;} |
121 | void SetAcceptKingDaughters(Bool_t b=kFALSE) {fCut_AcceptKinkDaughters=b;} |
122 | void SetMaxCovDiagonalElements(Float_t c1=1e99, Float_t c2=1e99, Float_t c3=1e99, Float_t c4=1e99, Float_t c5=1e99) |
123 | {fCut_MaxC11=c1; fCut_MaxC22=c2; fCut_MaxC33=c3; fCut_MaxC44=c4; fCut_MaxC55=c5;} |
124 | |
125 | // track to vertex cut setters |
126 | void SetMinNsigmaToVertex(Float_t sigma=1e99) {fCut_NsigmaToVertex = sigma;} |
127 | void SetRequireSigmaToVertex(Bool_t b=kTRUE ) {fCut_SigmaToVertexRequired = b;} |
128 | |
129 | // track kinmatic cut setters |
130 | void SetPRange(Float_t r1=0, Float_t r2=1e99) {fPMin=r1; fPMax=r2;} |
131 | void SetPtRange(Float_t r1=0, Float_t r2=1e99) {fPtMin=r1; fPtMax=r2;} |
132 | void SetPxRange(Float_t r1=-1e99, Float_t r2=1e99) {fPxMin=r1; fPxMax=r2;} |
133 | void SetPyRange(Float_t r1=-1e99, Float_t r2=1e99) {fPyMin=r1; fPyMax=r2;} |
134 | void SetPzRange(Float_t r1=-1e99, Float_t r2=1e99) {fPzMin=r1; fPzMax=r2;} |
135 | void SetEtaRange(Float_t r1=-1e99, Float_t r2=1e99) {fEtaMin=r1; fEtaMax=r2;} |
136 | void SetRapRange(Float_t r1=-1e99, Float_t r2=1e99) {fRapMin=r1; fRapMax=r2;} |
137 | |
138 | //###################################################### |
139 | void SetHistogramsOn(Bool_t b=kFALSE) {fHistogramsOn = b;} |
140 | void DefineHistograms(Int_t color=1); |
141 | void SaveHistograms(Char_t* dir="track_selection"); |
142 | |
49dc84d9 |
143 | virtual void Print(const Option_t* = "") const; |
5c834ad5 |
144 | |
145 | // void SaveQualityCuts(Char_t* file) |
146 | // void LoadQualityCuts(Char_t* file) |
147 | |
148 | ClassDef(AliESDtrackCuts,0) |
149 | }; |
150 | |
151 | |
152 | #endif |