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