]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEcuts.h
Update of the HFE package
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEcuts.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 // Cut container class for the ALICE HFE group
17 // Serves also as interface to the correction Framework
18 // Provides a set of standard cuts
19 //
20 #ifndef ALIHFECUTS_H
21 #define ALIHFECUTS_H
22
23 #ifndef ROOT_TObject
24 #include <TObject.h>
25 #endif
26
27 #ifndef ALIHFEEXTRACUTS_H
28 #include "AliHFEextraCuts.h"
29 #endif
30
31 class AliCFManager;
32 class AliESDtrack;
33 class AliMCParticle;
34
35 class TObjArray;
36 class TList;
37
38 class AliHFEcuts : public TObject{
39   public:
40     typedef enum{
41       kStepMCGenerated = 0,
42       kStepMCsignal = 1,
43       kStepMCInAcceptance = 2,
44       kStepRecNoCut = 3,
45       kStepRecKineITSTPC = 4,
46       kStepRecPrim = 5,
47       kStepHFEcutsITS = 6,
48       kStepHFEcutsTRD = 7,
49       kStepPID = 8
50     } CutStep_t;
51     typedef enum{
52       kEventStepGenerated = 0,
53       kEventStepReconstructed = 1
54     } EventCutStep_t;
55     enum{
56       kNcutStepsEvent = 2,
57       kNcutStepsTrack = 9,
58       kNcutStepsESDtrack = 6 
59     };    // Additional constants
60
61     AliHFEcuts();
62     AliHFEcuts(const AliHFEcuts &c);
63     AliHFEcuts &operator=(const AliHFEcuts &c);
64     ~AliHFEcuts();
65     
66     void Initialize(AliCFManager *cfm);
67     void Initialize();
68
69     Bool_t CheckParticleCuts(CutStep_t step, TObject *o);
70   
71     TList *GetQAhistograms() const { return fHistQA; }
72     
73     void SetDebugMode();
74     void SetAOD() { SetBit(kAOD, kTRUE); }
75     void SetESD() { SetBit(kAOD, kFALSE); }
76     void UnsetDebugMode() { SetBit(kDebugMode, kFALSE); }
77     Bool_t IsInDebugMode() const { return TestBit(kDebugMode); };
78     Bool_t IsAOD() const { return TestBit(kAOD); }
79     Bool_t IsESD() const { return !TestBit(kAOD); }
80     
81     // Getters
82     Bool_t IsRequireITSpixel() const { return TESTBIT(fRequirements, kITSPixel); };
83     Bool_t IsRequireMaxImpactParam() const { return TESTBIT(fRequirements, kMaxImpactParam); };
84     Bool_t IsRequirePrimary() const { return TESTBIT(fRequirements, kPrimary); };
85     Bool_t IsRequireProdVertex() const { return TESTBIT(fRequirements, kProductionVertex); };
86     Bool_t IsRequireSigmaToVertex() const { return TESTBIT(fRequirements, kSigmaToVertex); };
87     Bool_t IsRequireDCAToVertex() const {return TESTBIT(fRequirements, kDCAToVertex); };
88     
89     // Setters
90     inline void SetCutITSpixel(UChar_t cut);
91     void SetCheckITSLayerStatus(Bool_t checkITSLayerStatus) { fCheckITSLayerStatus = checkITSLayerStatus; }
92     void SetMinNClustersTPC(UChar_t minClustersTPC) { fMinClustersTPC = minClustersTPC; }
93     void SetMinNTrackletsTRD(UChar_t minNtrackletsTRD) { fMinTrackletsTRD = minNtrackletsTRD; }
94     void SetMaxChi2perClusterTPC(Double_t chi2) { fMaxChi2clusterTPC = chi2; };
95     inline void SetMaxImpactParam(Double_t radial, Double_t z);
96     void SetMinRatioTPCclusters(Double_t minRatioTPC) { fMinClusterRatioTPC = minRatioTPC; };
97     void SetPtRange(Double_t ptmin, Double_t ptmax){fPtRange[0] = ptmin; fPtRange[1] = ptmax;};
98     inline void SetProductionVertex(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax);
99     inline void SetSigmaToVertex(Double_t sig);
100     
101     inline void CreateStandardCuts();
102     
103     // Requirements
104     void SetRequireDCAToVertex() { SETBIT(fRequirements, kDCAToVertex); };
105     void SetRequireIsPrimary() { SETBIT(fRequirements, kPrimary); };
106     void SetRequireITSPixel() { SETBIT(fRequirements, kITSPixel); }
107     void SetRequireProdVertex() { SETBIT(fRequirements, kProductionVertex); };
108     void SetRequireSigmaToVertex() { SETBIT(fRequirements, kSigmaToVertex); };
109
110     void SetDebugLevel(Int_t level) { fDebugLevel = level; };
111     Int_t GetDebugLevel() const { return fDebugLevel; };
112
113   private:
114     enum{
115       kDebugMode = BIT(14),
116       kAOD = BIT(15)
117     };
118     typedef enum{
119       kPrimary = 0,
120       kProductionVertex = 1,
121       kSigmaToVertex = 2,
122       kDCAToVertex = 3,
123       kITSPixel = 4,
124       kMaxImpactParam = 5
125     } Require_t;
126     void SetParticleGenCutList();
127     void SetAcceptanceCutList();
128     void SetRecKineITSTPCCutList();
129     void SetRecPrimaryCutList();
130     void SetHFElectronITSCuts();
131     void SetHFElectronTRDCuts();
132     void SetEventCutList(Int_t istep);
133   
134     ULong64_t fRequirements;      // Bitmap for requirements
135     Double_t fDCAtoVtx[2];            // DCA to Vertex
136     Double_t fProdVtx[4];               // Production Vertex
137     Double_t fPtRange[2];               // pt range
138     UChar_t fMinClustersTPC;        // Min.Number of TPC clusters
139     UChar_t fMinTrackletsTRD;       // Min. Number of TRD tracklets
140     UChar_t fCutITSPixel;               // Cut on ITS pixel
141     Bool_t  fCheckITSLayerStatus;       // Check ITS layer status
142     Double_t fMaxChi2clusterTPC;        // Max Chi2 per TPC cluster
143     Double_t fMinClusterRatioTPC;       // Min. Ratio findable / found TPC clusters
144     Double_t fSigmaToVtx;               // Sigma To Vertex
145     
146     TList *fHistQA;                         //! QA Histograms
147     TObjArray *fCutList;                //! List of cut objects(Correction Framework Manager)
148
149     Int_t fDebugLevel;            // Debug Level
150     
151   ClassDef(AliHFEcuts, 1)         // Container for HFE cuts
152 };
153
154 //__________________________________________________________________
155 void AliHFEcuts::SetProductionVertex(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax){
156   // Set the production vertex constraint
157   SetRequireProdVertex();
158   fProdVtx[0] = xmin;
159   fProdVtx[1] = xmax;
160   fProdVtx[2] = ymin;
161   fProdVtx[3] = ymax;
162 }
163
164 //__________________________________________________________________
165 void AliHFEcuts::SetSigmaToVertex(Double_t sig){
166   SetRequireSigmaToVertex();
167   fSigmaToVtx = sig;
168 }
169
170 //__________________________________________________________________
171 void AliHFEcuts::SetMaxImpactParam(Double_t radial, Double_t z){
172   SetRequireDCAToVertex();
173   fDCAtoVtx[0] = radial;
174   fDCAtoVtx[1] = z;
175 }
176
177 //__________________________________________________________________
178 void AliHFEcuts::SetCutITSpixel(UChar_t cut){
179   SetRequireITSPixel();
180   fCutITSPixel = cut;
181 }
182
183 //__________________________________________________________________
184 void AliHFEcuts::CreateStandardCuts(){
185   //
186   // Standard Cuts defined by the HFE Group
187   //
188   SetRequireProdVertex();
189   fProdVtx[0] = -3;
190   fProdVtx[1] = 3;
191   fProdVtx[2] = -3;
192   fProdVtx[3] = 3;
193   SetRequireDCAToVertex();
194   fDCAtoVtx[0] = 2.;
195   fDCAtoVtx[1] = 10.;
196   fMinClustersTPC = 50;
197   fMinTrackletsTRD = 0;
198   SetRequireITSPixel();
199   fCutITSPixel = AliHFEextraCuts::kFirst;
200   fMaxChi2clusterTPC = 3.5;
201   fMinClusterRatioTPC = 0.6;
202   fPtRange[0] = 0.1;
203   fPtRange[1] = 20.;
204 }
205 #endif