Initialize correctly FirstPHOSCluster
[u/mrichter/AliRoot.git] / PWG0 / esdTrackCuts / ESDtrackQualityCuts.h
CommitLineData
75ec0f41 1//****************************************************************
2//
3// Class for handling of ESD track quality cuts
4//
5// TODO:
6// - add functionality to save and load cuts
7// - fix the n sigma cut so it is really a n sigma cut
8//
9
10#ifndef ROOT_TObject
11#include "TObject.h"
12#endif
13#ifndef ROOT_TTree
14#include "TTree.h"
15#endif
16#ifndef ROOT_TH2
17#include "TH2.h"
18#endif
19
20#include "AliESDtrack.h"
21#include "AliESDVertex.h"
22#include "AliLog.h"
23
24class ESDtrackQualityCuts : public TObject
25{
26protected:
27
28 //######################################################
29 // esd track quality cuts
30 static const Int_t fNCuts = 14;
31 Char_t* fCutNames[14];
32
33 Int_t fCut_MinNClusterTPC; // min number of tpc clusters
34 Int_t fCut_MinNClusterITS; // min number of its clusters
35
36 Float_t fCut_MaxChi2PerClusterTPC; // max tpc fit chi2 per tpc cluster
37 Float_t fCut_MaxChi2PerClusterITS; // max its fit chi2 per its cluster
38
39 Float_t fCut_MaxC11; // max resolutions of covariance matrix diag. elements
40 Float_t fCut_MaxC22;
41 Float_t fCut_MaxC33;
42 Float_t fCut_MaxC44;
43 Float_t fCut_MaxC55;
44
45 Float_t fCut_NsigmaToVertex; // max number of estimated sigma from track-to-vertex
46 Bool_t fCut_SigmaToVertexRequired; // cut track if sigma from track-to-vertex could not be calculated
47
48 Bool_t fCut_AcceptKinkDaughters; // accepting kink daughters?
49 Bool_t fCut_RequireTPCRefit; // require TPC refit
50 Bool_t fCut_RequireITSRefit; // require ITS refit
51
52 //######################################################
53 // diagnostics histograms
54 Bool_t fHistogramsOn;
55
56 TH1F** hNClustersITS;
57 TH1F** hNClustersTPC;
58
59 TH1F** hChi2PerClusterITS;
60 TH1F** hChi2PerClusterTPC;
61
62 TH1F** hC11;
63 TH1F** hC22;
64 TH1F** hC33;
65 TH1F** hC44;
66 TH1F** hC55;
67
68 TH1F** hDXY;
69 TH1F** hDZ;
70 TH2F** hDXYvsDZ;
71
72 TH1F** hDXYNormalized;
73 TH1F** hDZNormalized;
74 TH2F** hDXYvsDZNormalized;
75
76 TH1F* hCutStatistics;
77 TH2F* hCutCorrelation;
78
79
80 // dummy array
81 Int_t fIdxInt[200];
82
83public:
84 ESDtrackQualityCuts();
85
86 Bool_t AcceptTrack(AliESDtrack* esdTrack);
87 Bool_t AcceptTrack(AliESDtrack* esdTrack, AliESDVertex* esdVtx, Double_t field);
88 Bool_t AcceptTrack(AliESDtrack* esdTrack, Double_t* vtx, Double_t* vtx_res, Double_t field);
89 Bool_t AcceptTrack(AliESDtrack* esdTrack, AliESDVertex* esdVtx, Float_t field)
90 {return AcceptTrack(esdTrack,esdVtx, Double_t(field));}
91
92 //######################################################
93 // track quality cut setters
94 void SetMinNClustersTPC(Int_t min=-1) {fCut_MinNClusterTPC=min;}
95 void SetMinNClustersITS(Int_t min=-1) {fCut_MinNClusterITS=min;}
96 void SetMaxChi2PerClusterTPC(Float_t max=1e99) {fCut_MaxChi2PerClusterTPC=max;}
97 void SetMaxChi2PerClusterITS(Float_t max=1e99) {fCut_MaxChi2PerClusterITS=max;}
98 void SetMinNsigmaToVertex(Float_t sigma=3) {fCut_NsigmaToVertex=sigma;}
99 void SetRequireSigmaToVertex(Bool_t b=kTRUE) { fCut_SigmaToVertexRequired = b; }
100 void SetRequireTPCRefit(Bool_t b=kFALSE) {fCut_RequireTPCRefit=b;}
101 void SetRequireITSRefit(Bool_t b=kFALSE) {fCut_RequireITSRefit=b;}
102 void SetAcceptKingDaughters(Bool_t b=kFALSE) {fCut_AcceptKinkDaughters=b;}
103 void SetMaxCovDiagonalElements(Float_t c1=1e99, Float_t c2=1e99, Float_t c3=1e99, Float_t c4=1e99, Float_t c5=1e99)
104 {fCut_MaxC11=c1; fCut_MaxC22=c2; fCut_MaxC33=c3; fCut_MaxC44=c4; fCut_MaxC55=c5;}
105
106 //######################################################
107 void SetHistogramsOn(Bool_t b=kFALSE) {fHistogramsOn = b;}
108 void DefineHistograms(Int_t color=1);
109 void SaveHistograms(Char_t* dir="track_selection");
110
111 // void SaveQualityCuts(Char_t* file)
112 // void LoadQualityCuts(Char_t* file)
113
114 ClassDef(ESDtrackQualityCuts,0)
115};
116