updating makefile to include evgen headers to compile systematics selector
[u/mrichter/AliRoot.git] / PWG0 / esdTrackCuts / AliESDtrackCuts.h
CommitLineData
5c834ad5 1//
ab2c1f0d 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
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.
11//
5c834ad5 12//
13// TODO:
14// - add functionality to save and load cuts
5c834ad5 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?
aa93c798 20// - put comments to each variable
ebd60d8e 21// - implement destructor !!!
49dc84d9 22//
49dc84d9 23
ab2c1f0d 24#ifndef ALIESDTRACKCUTS_H
25#define ALIESDTRACKCUTS_H
26
aa93c798 27#include <TObject.h>
28#include <TH2.h>
5c834ad5 29
aa93c798 30class AliESD;
31class AliESDtrack;
32class AliLog;
5c495d37 33class TTree;
5c834ad5 34
35class AliESDtrackCuts : public TObject
36{
ebd60d8e 37
38public:
39 AliESDtrackCuts();
aa93c798 40 virtual ~AliESDtrackCuts();
ebd60d8e 41
42 Bool_t AcceptTrack(AliESDtrack* esdTrack);
ebd60d8e 43 TObjArray* GetAcceptedTracks(AliESD* esd);
c5858666 44 Int_t CountAcceptedTracks(AliESD* esd);
ebd60d8e 45
927c71e5 46 virtual Long64_t Merge(TCollection* list);
ebd60d8e 47 virtual void Copy(TObject &c) const;
48
49 //######################################################
50 // track quality cut setters
ab2c1f0d 51 void SetMinNClustersTPC(Int_t min=-1) {fCutMinNClusterTPC=min;}
52 void SetMinNClustersITS(Int_t min=-1) {fCutMinNClusterITS=min;}
53 void SetMaxChi2PerClusterTPC(Float_t max=1e99) {fCutMaxChi2PerClusterTPC=max;}
54 void SetMaxChi2PerClusterITS(Float_t max=1e99) {fCutMaxChi2PerClusterITS=max;}
55 void SetRequireTPCRefit(Bool_t b=kFALSE) {fCutRequireTPCRefit=b;}
56 void SetRequireITSRefit(Bool_t b=kFALSE) {fCutRequireITSRefit=b;}
57 void SetAcceptKingDaughters(Bool_t b=kFALSE) {fCutAcceptKinkDaughters=b;}
ebd60d8e 58 void SetMaxCovDiagonalElements(Float_t c1=1e99, Float_t c2=1e99, Float_t c3=1e99, Float_t c4=1e99, Float_t c5=1e99)
ab2c1f0d 59 {fCutMaxC11=c1; fCutMaxC22=c2; fCutMaxC33=c3; fCutMaxC44=c4; fCutMaxC55=c5;}
ebd60d8e 60
61 // track to vertex cut setters
ab2c1f0d 62 void SetMinNsigmaToVertex(Float_t sigma=1e99) {fCutNsigmaToVertex = sigma;}
63 void SetRequireSigmaToVertex(Bool_t b=kTRUE ) {fCutSigmaToVertexRequired = b;}
ebd60d8e 64
65 // track kinmatic cut setters
66 void SetPRange(Float_t r1=0, Float_t r2=1e99) {fPMin=r1; fPMax=r2;}
67 void SetPtRange(Float_t r1=0, Float_t r2=1e99) {fPtMin=r1; fPtMax=r2;}
68 void SetPxRange(Float_t r1=-1e99, Float_t r2=1e99) {fPxMin=r1; fPxMax=r2;}
69 void SetPyRange(Float_t r1=-1e99, Float_t r2=1e99) {fPyMin=r1; fPyMax=r2;}
70 void SetPzRange(Float_t r1=-1e99, Float_t r2=1e99) {fPzMin=r1; fPzMax=r2;}
71 void SetEtaRange(Float_t r1=-1e99, Float_t r2=1e99) {fEtaMin=r1; fEtaMax=r2;}
72 void SetRapRange(Float_t r1=-1e99, Float_t r2=1e99) {fRapMin=r1; fRapMax=r2;}
73
2b9019e4 74 Float_t GetMinNsigmaToVertex() { return fCutNsigmaToVertex; }
75
ebd60d8e 76 //######################################################
77 void SetHistogramsOn(Bool_t b=kFALSE) {fHistogramsOn = b;}
78 void DefineHistograms(Int_t color=1);
79 void SaveHistograms(Char_t* dir="track_selection");
2b9019e4 80
81 Float_t GetSigmaToVertex(AliESDtrack* esdTrack);
ebd60d8e 82
83 virtual void Print(const Option_t* = "") const;
84
5c495d37 85 static void EnableNeededBranches(TTree* tree);
86
ebd60d8e 87 // void SaveQualityCuts(Char_t* file)
88 // void LoadQualityCuts(Char_t* file)
89
5c834ad5 90protected:
ebd60d8e 91 void Init(); // sets everything to 0
92
93 enum { kNCuts = 21 };
5c834ad5 94
95 //######################################################
96 // esd track quality cuts
8b3563f4 97 static const Char_t* fgkCutNames[kNCuts]; //! names of cuts (for internal use)
ab2c1f0d 98
99 Int_t fCutMinNClusterTPC; // min number of tpc clusters
100 Int_t fCutMinNClusterITS; // min number of its clusters
101
102 Float_t fCutMaxChi2PerClusterTPC; // max tpc fit chi2 per tpc cluster
103 Float_t fCutMaxChi2PerClusterITS; // max its fit chi2 per its cluster
104
105 Float_t fCutMaxC11; // max cov. matrix diag. elements (res. y^2)
106 Float_t fCutMaxC22; // max cov. matrix diag. elements (res. z^2)
107 Float_t fCutMaxC33; // max cov. matrix diag. elements (res. sin(phi)^2)
108 Float_t fCutMaxC44; // max cov. matrix diag. elements (res. tan(theta_dip)^2)
109 Float_t fCutMaxC55; // max cov. matrix diag. elements (res. 1/pt^2)
110
111 Bool_t fCutAcceptKinkDaughters; // accepting kink daughters?
112 Bool_t fCutRequireTPCRefit; // require TPC refit
113 Bool_t fCutRequireITSRefit; // require ITS refit
5c834ad5 114
115 // track to vertex cut
ab2c1f0d 116 Float_t fCutNsigmaToVertex; // max number of estimated sigma from track-to-vertex
117 Bool_t fCutSigmaToVertexRequired; // cut track if sigma from track-to-vertex could not be calculated
5c834ad5 118
119 // esd kinematics cuts
120 Float_t fPMin, fPMax; // definition of the range of the P
121 Float_t fPtMin, fPtMax; // definition of the range of the Pt
122 Float_t fPxMin, fPxMax; // definition of the range of the Px
123 Float_t fPyMin, fPyMax; // definition of the range of the Py
124 Float_t fPzMin, fPzMax; // definition of the range of the Pz
125 Float_t fEtaMin, fEtaMax; // definition of the range of the eta
126 Float_t fRapMin, fRapMax; // definition of the range of the y
127
5c834ad5 128 //######################################################
129 // diagnostics histograms
ab2c1f0d 130 Bool_t fHistogramsOn; // histograms on/off
5c834ad5 131
8b3563f4 132 TH1F* fhNClustersITS[2]; //->
133 TH1F* fhNClustersTPC[2]; //->
134
135 TH1F* fhChi2PerClusterITS[2]; //->
136 TH1F* fhChi2PerClusterTPC[2]; //->
5c834ad5 137
8b3563f4 138 TH1F* fhC11[2]; //->
139 TH1F* fhC22[2]; //->
140 TH1F* fhC33[2]; //->
141 TH1F* fhC44[2]; //->
142 TH1F* fhC55[2]; //->
5c834ad5 143
8b3563f4 144 TH1F* fhDXY[2]; //->
145 TH1F* fhDZ[2]; //->
146 TH2F* fhDXYvsDZ[2]; //->
5c834ad5 147
8b3563f4 148 TH1F* fhDXYNormalized[2]; //->
149 TH1F* fhDZNormalized[2]; //->
150 TH2F* fhDXYvsDZNormalized[2]; //->
5c834ad5 151
8b3563f4 152 TH1F* fhCutStatistics; //-> statistics of what cuts the tracks did not survive
153 TH2F* fhCutCorrelation; //-> 2d statistics plot
aa617804 154
155 private:
156
157 AliESDtrackCuts(const AliESDtrackCuts& pd); // Copy Constructor
158 AliESDtrackCuts &operator=(const AliESDtrackCuts &c);
159
5c834ad5 160
8b3563f4 161 ClassDef(AliESDtrackCuts, 1)
5c834ad5 162};
163
164
165#endif