small fix
[u/mrichter/AliRoot.git] / PWG0 / esdTrackCuts / AliESDtrackCuts.h
CommitLineData
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?
ebd60d8e 16// - put comment to each variable
17// - implement destructor !!!
49dc84d9 18//
19// NOTE:
20// -
21//
22
5c834ad5 23
5c834ad5 24#include "TObject.h"
aea6943b 25#include "TH1.h"
5c834ad5 26#include "TH2.h"
5c834ad5 27
28#include "AliESD.h"
29#include "AliESDtrack.h"
30#include "AliLog.h"
31
32class AliESDtrackCuts : public TObject
33{
ebd60d8e 34
35public:
36 AliESDtrackCuts();
37 virtual ~AliESDtrackCuts();
38 AliESDtrackCuts(const AliESDtrackCuts& pd); // Copy Constructor
39
40 Bool_t AcceptTrack(AliESDtrack* esdTrack);
41
42 TObjArray* GetAcceptedTracks(AliESD* esd);
43
44 AliESDtrackCuts &operator=(const AliESDtrackCuts &c);
45 virtual void Copy(TObject &c) const;
46
47 //######################################################
48 // track quality cut setters
49 void SetMinNClustersTPC(Int_t min=-1) {fCut_MinNClusterTPC=min;}
50 void SetMinNClustersITS(Int_t min=-1) {fCut_MinNClusterITS=min;}
51 void SetMaxChi2PerClusterTPC(Float_t max=1e99) {fCut_MaxChi2PerClusterTPC=max;}
52 void SetMaxChi2PerClusterITS(Float_t max=1e99) {fCut_MaxChi2PerClusterITS=max;}
53 void SetRequireTPCRefit(Bool_t b=kFALSE) {fCut_RequireTPCRefit=b;}
54 void SetRequireITSRefit(Bool_t b=kFALSE) {fCut_RequireITSRefit=b;}
55 void SetAcceptKingDaughters(Bool_t b=kFALSE) {fCut_AcceptKinkDaughters=b;}
56 void SetMaxCovDiagonalElements(Float_t c1=1e99, Float_t c2=1e99, Float_t c3=1e99, Float_t c4=1e99, Float_t c5=1e99)
57 {fCut_MaxC11=c1; fCut_MaxC22=c2; fCut_MaxC33=c3; fCut_MaxC44=c4; fCut_MaxC55=c5;}
58
59 // track to vertex cut setters
60 void SetMinNsigmaToVertex(Float_t sigma=1e99) {fCut_NsigmaToVertex = sigma;}
61 void SetRequireSigmaToVertex(Bool_t b=kTRUE ) {fCut_SigmaToVertexRequired = b;}
62
63 // track kinmatic cut setters
64 void SetPRange(Float_t r1=0, Float_t r2=1e99) {fPMin=r1; fPMax=r2;}
65 void SetPtRange(Float_t r1=0, Float_t r2=1e99) {fPtMin=r1; fPtMax=r2;}
66 void SetPxRange(Float_t r1=-1e99, Float_t r2=1e99) {fPxMin=r1; fPxMax=r2;}
67 void SetPyRange(Float_t r1=-1e99, Float_t r2=1e99) {fPyMin=r1; fPyMax=r2;}
68 void SetPzRange(Float_t r1=-1e99, Float_t r2=1e99) {fPzMin=r1; fPzMax=r2;}
69 void SetEtaRange(Float_t r1=-1e99, Float_t r2=1e99) {fEtaMin=r1; fEtaMax=r2;}
70 void SetRapRange(Float_t r1=-1e99, Float_t r2=1e99) {fRapMin=r1; fRapMax=r2;}
71
72 //######################################################
73 void SetHistogramsOn(Bool_t b=kFALSE) {fHistogramsOn = b;}
74 void DefineHistograms(Int_t color=1);
75 void SaveHistograms(Char_t* dir="track_selection");
76
77 virtual void Print(const Option_t* = "") const;
78
79 // void SaveQualityCuts(Char_t* file)
80 // void LoadQualityCuts(Char_t* file)
81
5c834ad5 82protected:
ebd60d8e 83 void Init(); // sets everything to 0
84
85 enum { kNCuts = 21 };
5c834ad5 86
87 //######################################################
88 // esd track quality cuts
ebd60d8e 89 static const Char_t* fCutNames[kNCuts];
5c834ad5 90
91 Int_t fCut_MinNClusterTPC; // min number of tpc clusters
92 Int_t fCut_MinNClusterITS; // min number of its clusters
93
94 Float_t fCut_MaxChi2PerClusterTPC; // max tpc fit chi2 per tpc cluster
95 Float_t fCut_MaxChi2PerClusterITS; // max its fit chi2 per its cluster
96
97 Float_t fCut_MaxC11; // max resolutions of covariance matrix diag. elements
98 Float_t fCut_MaxC22;
99 Float_t fCut_MaxC33;
100 Float_t fCut_MaxC44;
101 Float_t fCut_MaxC55;
102
103 Bool_t fCut_AcceptKinkDaughters; // accepting kink daughters?
104 Bool_t fCut_RequireTPCRefit; // require TPC refit
105 Bool_t fCut_RequireITSRefit; // require ITS refit
106
107 // track to vertex cut
108 Float_t fCut_NsigmaToVertex; // max number of estimated sigma from track-to-vertex
109 Bool_t fCut_SigmaToVertexRequired; // cut track if sigma from track-to-vertex could not be calculated
110
111 // esd kinematics cuts
112 Float_t fPMin, fPMax; // definition of the range of the P
113 Float_t fPtMin, fPtMax; // definition of the range of the Pt
114 Float_t fPxMin, fPxMax; // definition of the range of the Px
115 Float_t fPyMin, fPyMax; // definition of the range of the Py
116 Float_t fPzMin, fPzMax; // definition of the range of the Pz
117 Float_t fEtaMin, fEtaMax; // definition of the range of the eta
118 Float_t fRapMin, fRapMax; // definition of the range of the y
119
5c834ad5 120 //######################################################
121 // diagnostics histograms
122 Bool_t fHistogramsOn;
123
ebd60d8e 124 TH1F *fhNClustersITS[2]; //[2]
125 TH1F *fhNClustersTPC[2]; //[2]
5c834ad5 126
ebd60d8e 127 TH1F* fhChi2PerClusterITS[2]; //[2]
128 TH1F* fhChi2PerClusterTPC[2]; //[2]
5c834ad5 129
ebd60d8e 130 TH1F* fhC11[2]; //[2]
131 TH1F* fhC22[2]; //[2]
132 TH1F* fhC33[2]; //[2]
133 TH1F* fhC44[2]; //[2]
134 TH1F* fhC55[2]; //[2]
5c834ad5 135
ebd60d8e 136 TH1F* fhDXY[2]; //[2]
137 TH1F* fhDZ[2]; //[2]
138 TH2F* fhDXYvsDZ[2]; //[2]
5c834ad5 139
ebd60d8e 140 TH1F* fhDXYNormalized[2]; //[2]
141 TH1F* fhDZNormalized[2]; //[2]
142 TH2F* fhDXYvsDZNormalized[2]; //[2]
5c834ad5 143
86735596 144 TH1F* fhCutStatistics; //
145 TH2F* fhCutCorrelation; //
5c834ad5 146
5c834ad5 147 ClassDef(AliESDtrackCuts,0)
148};
149
150
151#endif