]> git.uio.no Git - u/mrichter/AliRoot.git/blob - CORRFW/AliCFTrackQualityCuts.h
syntax correction in comments
[u/mrichter/AliRoot.git] / CORRFW / AliCFTrackQualityCuts.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 // The class AliCFTrackQualityCuts is designed to select reconstructed tracks
17 // of high quality and to provide corresponding QA histograms.
18 // This class inherits from the Analysis' Framework abstract base class
19 // AliAnalysisCuts and is a part of the Correction Framework.
20 // This class acts on single, reconstructed tracks, it is applicable on
21 // ESD and AOD data.
22 // It mainly consists of a IsSelected function that returns a boolean.
23 // This function checks whether the considered track passes a set of cuts:
24 // - number of clusters in the ITS
25 // - number of clusters in the TPC
26 // - number of clusters in the TRD
27 // - ratio of found / finable number of clusters in the TPC
28 // - number of tracklets in the TRD
29 // - number TRD tracklets used for pid
30 // - chi2 / cluster in the ITS
31 // - chi2 / cluster in the TPC
32 // - chi2 / tracklet in the TRD
33 // - covariance matrix diagonal elements
34 // - track status (cf AliESDtrack.h)
35 //
36 // The cut values for these cuts are set with the corresponding set functions.
37 // All cut classes provided by the correction framework are supposed to be
38 // added in the Analysis Framwork's class AliAnalysisFilter and applied by
39 // the filter via a loop.
40 //
41 // author: I. Kraus (Ingrid.Kraus@cern.ch)
42 // idea taken form
43 // AliESDtrackCuts writte by Jan Fiete Grosse-Oetringhaus and
44 // AliRsnDaughterCut class written by A. Pulvirenti.
45
46 #ifndef ALICFTRACKQUALITYCUTS_H
47 #define ALICFTRACKQUALITYCUTS_H
48
49 #include "AliCFCutBase.h"
50
51 class TH2F ;
52 class TH1F ;
53 class TBits;
54 class AliESDtrack ;
55
56 class AliCFTrackQualityCuts : public AliCFCutBase
57 {
58  public :
59   AliCFTrackQualityCuts() ;
60   AliCFTrackQualityCuts(Char_t* name, Char_t* title) ;
61   AliCFTrackQualityCuts(const AliCFTrackQualityCuts& c) ;
62   AliCFTrackQualityCuts& operator=(const AliCFTrackQualityCuts& c) ;
63   ~AliCFTrackQualityCuts();
64   void Copy(TObject &c) const;
65
66   Bool_t IsSelected(TObject* obj);
67   Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
68
69   // cut value setter
70   void SetMinNClusterTPC(Int_t cluster=-1)              {fMinNClusterTPC = cluster;}
71   void SetMinNClusterITS(Int_t cluster=-1)              {fMinNClusterITS = cluster;}
72   void SetMinNClusterTRD(Int_t cluster=-1)              {fMinNClusterTRD = cluster;}
73   void SetMinFoundClusterTPC(Double_t fraction=-1)      {fMinFoundClusterTPC = fraction;}
74   void SetMinNTrackletTRD(Int_t tracklet=-1)            {fMinNTrackletTRD = tracklet;}
75   void SetMinNTrackletTRDpid(Int_t tracklet=-1)         {fMinNTrackletTRDpid = tracklet;}
76   void SetMaxChi2PerClusterTPC(Double_t chi=1.e+09)     {fMaxChi2PerClusterTPC = chi;}
77   void SetMaxChi2PerClusterITS(Double_t chi=1.e+09)     {fMaxChi2PerClusterITS = chi;}
78   void SetMaxChi2PerTrackletTRD(Double_t chi=1.e+09)    {fMaxChi2PerTrackletTRD = chi;}
79   void SetMaxCovDiagonalElements(Float_t c1=1.e+09, Float_t c2=1.e+09, Float_t c3=1.e+09, Float_t c4=1.e+09, Float_t c5=1.e+09) 
80 {fCovariance11Max=c1;fCovariance22Max=c2;fCovariance33Max=c3;fCovariance44Max=c4;fCovariance55Max=c5;}
81   void SetStatus(ULong_t status=0) {fStatus = status ;}
82
83   // QA histograms
84   void DrawHistograms(Bool_t drawLogScale=kTRUE);
85   void SaveHistograms(const Char_t* dir = 0);
86   void AddQAHistograms(TList *qaList);
87   // QA histogram setter
88   // please use indices from the enumeration below
89   void SetHistogramBins(Int_t index, Int_t nbins, Double_t *bins);
90   void SetHistogramBins(Int_t index, Int_t nbins, Double_t xmin, Double_t xmax);
91
92   // indeces/counters for single selections
93   enum { 
94     kCutClusterTPC=0,   // number of clusters in TPC
95     kCutClusterITS,     // number of clusters in ITS
96     kCutClusterTRD,     // number of clusters in TRD
97     kCutMinFoundClusterTPC,     // ratio found / findable number of clusters in TPC
98     kCutTrackletTRD,    // number of tracklets in TRD
99     kCutTrackletTRDpid, // tracklets for TRD pid
100     kCutChi2TPC,        // chi2 per cluster in TPC
101     kCutChi2ITS,        // chi2 per cluster in ITS
102     kCutChi2TRD,        // chi2 per cluster in TRD
103     kCutCovElement11,   // diagonal element 11 of covariance matrix
104     kCutCovElement22,   // diagonal element 22 of covariance matrix
105     kCutCovElement33,   // diagonal element 33 of covariance matrix
106     kCutCovElement44,   // diagonal element 44 of covariance matrix
107     kCutCovElement55,   // diagonal element 55 of covariance matrix
108     kCutStatus,         // track status
109     kNCuts,             // number of single selections
110     kNStepQA=2,         // number of QA steps (before/after the cuts)
111     kNHist=14           // number of QA histograms
112   };
113
114  private:
115   void SelectionBitMap(TObject* obj);
116   void DefineHistograms();              // books histograms and TList
117   void Initialise();                    // sets everything to 0
118   void FillHistograms(TObject* obj, Bool_t b);
119                                         // Fills histograms before and after cuts
120   Double_t fMinNClusterTPC;             // min number of clusters in TPC
121   Double_t fMinNClusterITS;             // min number of clusters in ITS
122   Double_t fMinNClusterTRD;             // min number of clusters in TRD
123   Double_t fMinFoundClusterTPC;         // min ratio found / findable number of clusters in TPC
124   Double_t fMinNTrackletTRD;            // min number of tracklets in TRD
125   Double_t fMinNTrackletTRDpid;         // min number of tracklets for TRD pid
126   Double_t fMaxChi2PerClusterTPC;       // max chi2 per clusters in TPC
127   Double_t fMaxChi2PerClusterITS;       // max chi2 per clusters in ITS
128   Double_t fMaxChi2PerTrackletTRD;      // max chi2 per clusters in TRD
129
130   Double_t fCovariance11Max ;           // max covariance matrix element 11
131   Double_t fCovariance22Max ;           // max covariance matrix element 22
132   Double_t fCovariance33Max ;           // max covariance matrix element 33
133   Double_t fCovariance44Max ;           // max covariance matrix element 44
134   Double_t fCovariance55Max ;           // max covariance matrix element 55
135
136   ULong_t fStatus;    // track status
137
138   TH1F* fhCutStatistics;                // Histogram: statistics of what cuts the tracks did not survive
139   TH2F* fhCutCorrelation;               // Histogram: 2d statistics plot
140
141   TH1F* fhQA[kNHist][kNStepQA];         // QA Histograms
142   TBits *fBitmap ;                      // stores single selection decisions
143
144   // QA histogram setters
145   Int_t fhNBinsClusterTPC;              // number of bins+1: cluster TPC
146   Int_t fhNBinsClusterITS;              // number of bins+1: cluster ITS
147   Int_t fhNBinsClusterTRD;              // number of bins+1: cluster TRD
148   Int_t fhNBinsFoundClusterTPC;         // number of bins+1: ratio found / findable number of clusters in TPC
149   Int_t fhNBinsTrackletTRD;             // number of bins+1: number of tracklets in TRD
150   Int_t fhNBinsTrackletTRDpid;          // number of bins+1: number of tracklets for TRD pid
151   Int_t fhNBinsChi2TPC;                 // number of bins+1: chi2 per cluster TPC
152   Int_t fhNBinsChi2ITS;                 // number of bins+1: chi2 per cluster ITS
153   Int_t fhNBinsChi2TRD;                 // number of bins+1: chi2 per cluster TRD
154   Int_t fhNBinsCovariance11;            // number of bins+1: covariance matrix element 11
155   Int_t fhNBinsCovariance22;            // number of bins+1: covariance matrix element 22
156   Int_t fhNBinsCovariance33;            // number of bins+1: covariance matrix element 33
157   Int_t fhNBinsCovariance44;            // number of bins+1: covariance matrix element 44
158   Int_t fhNBinsCovariance55;            // number of bins+1: covariance matrix element 55
159
160   Double_t *fhBinLimClusterTPC; //[fhNBinsClusterTPC] bin limits: cluster TPC
161   Double_t *fhBinLimClusterITS; //[fhNBinsClusterITS] bin limits: cluster ITS
162   Double_t *fhBinLimClusterTRD; //[fhNBinsClusterTRD] bin limits: cluster TRD
163   Double_t *fhBinLimFoundClusterTPC;//[fhNBinsFoundClusterTPC] bin limits: ratio found / findable number of clusters in TPC
164   Double_t *fhBinLimTrackletTRD;//[fhNBinsTrackletsTRD] bin limits: number of tracklets in TRD
165   Double_t *fhBinLimTrackletTRDpid;//[fhNBinsTrackletsTRDpid] bin limits: number of tracklets for TRD pid
166   Double_t *fhBinLimChi2TPC;    //[fhNBinsChi2TPC] bin limits: chi2 per cluster TPC
167   Double_t *fhBinLimChi2ITS;    //[fhNBinsChi2ITS] bin limits: chi2 per cluster ITS
168   Double_t *fhBinLimChi2TRD;    //[fhNBinsChi2TRD] bin limits: chi2 per cluster TRD
169   Double_t *fhBinLimCovariance11;//[fhNBinsCovariance11] bin limits: covariance matrix element 11
170   Double_t *fhBinLimCovariance22;//[fhNBinsCovariance22] bin limits: covariance matrix element 22
171   Double_t *fhBinLimCovariance33;//[fhNBinsCovariance33] bin limits: covariance matrix element 33
172   Double_t *fhBinLimCovariance44;//[fhNBinsCovariance44] bin limits: covariance matrix element 44
173   Double_t *fhBinLimCovariance55;//[fhNBinsCovariance55] bin limits: covariance matrix element 55
174
175   ClassDef(AliCFTrackQualityCuts,4);
176 };
177
178 #endif