]> 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_TNamed
24 #include <TNamed.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 TNamed{
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       kEventStepRecNoCut = 1,
54       kEventStepReconstructed = 2
55     } EventCutStep_t;
56     enum{
57       kNcutStepsEvent = 3,
58       kNcutStepsTrack = 9,
59       kNcutStepsESDtrack = 6 
60     };    // Additional constants
61
62     AliHFEcuts();
63     AliHFEcuts(const Char_t *name, const Char_t *title);
64     AliHFEcuts(const AliHFEcuts &c);
65     AliHFEcuts &operator=(const AliHFEcuts &c);
66     void Copy(TObject &o) const;
67     ~AliHFEcuts();
68     
69     void Initialize(AliCFManager *cfm);
70     void Initialize();
71
72     Bool_t CheckParticleCuts(CutStep_t step, TObject *o);
73   
74     TList *GetQAhistograms() const { return fHistQA; }
75     
76     void SetQAOn() {SetBit(kDebugMode, kTRUE); };
77     void UnsetQA() {SetBit(kDebugMode, kFALSE); };
78     Bool_t IsQAOn() const { return TestBit(kDebugMode); };
79     void SetAOD() { SetBit(kAOD, kTRUE); }
80     void SetESD() { SetBit(kAOD, kFALSE); }
81     Bool_t IsAOD() const { return TestBit(kAOD); }
82     Bool_t IsESD() const { return !TestBit(kAOD); }
83     
84     // Getters
85     Bool_t IsRequireITSpixel() const { return TESTBIT(fRequirements, kITSPixel); };
86     Bool_t IsRequireMaxImpactParam() const { return TESTBIT(fRequirements, kMaxImpactParam); };
87     Bool_t IsRequirePrimary() const { return TESTBIT(fRequirements, kPrimary); };
88     Bool_t IsRequireProdVertex() const { return TESTBIT(fRequirements, kProductionVertex); };
89     Bool_t IsRequireSigmaToVertex() const { return TESTBIT(fRequirements, kSigmaToVertex); };
90     Bool_t IsRequireDCAToVertex() const {return TESTBIT(fRequirements, kDCAToVertex); };
91     Bool_t IsRequireKineMCCuts() const {return TESTBIT(fRequirements, kKineMCCuts); };
92     
93     // Setters
94     inline void SetCutITSpixel(UChar_t cut);
95     void SetCheckITSLayerStatus(Bool_t checkITSLayerStatus) { fCheckITSLayerStatus = checkITSLayerStatus; }
96     void SetMinNClustersTPC(UChar_t minClustersTPC) { fMinClustersTPC = minClustersTPC; }
97     void SetMinNTrackletsTRD(UChar_t minNtrackletsTRD) { fMinTrackletsTRD = minNtrackletsTRD; }
98     void SetMaxChi2perClusterTPC(Double_t chi2) { fMaxChi2clusterTPC = chi2; };
99     inline void SetMaxImpactParam(Double_t radial, Double_t z);
100     void SetMinRatioTPCclusters(Double_t minRatioTPC) { fMinClusterRatioTPC = minRatioTPC; };
101     void SetPtRange(Double_t ptmin, Double_t ptmax){fPtRange[0] = ptmin; fPtRange[1] = ptmax;};
102     inline void SetProductionVertex(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax);
103     inline void SetSigmaToVertex(Double_t sig);
104     
105     inline void CreateStandardCuts();
106     
107     // Requirements
108     void SetRequireDCAToVertex() { SETBIT(fRequirements, kDCAToVertex); };
109     void SetRequireIsPrimary() { SETBIT(fRequirements, kPrimary); };
110     void SetRequireITSPixel() { SETBIT(fRequirements, kITSPixel); }
111     void SetRequireProdVertex() { SETBIT(fRequirements, kProductionVertex); };
112     void SetRequireSigmaToVertex() { SETBIT(fRequirements, kSigmaToVertex); };
113     void SetRequireKineMCCuts() { SETBIT(fRequirements, kKineMCCuts); };
114
115     void SetDebugLevel(Int_t level) { fDebugLevel = level; };
116     Int_t GetDebugLevel() const { return fDebugLevel; };
117
118   private:
119     enum{
120       kDebugMode = BIT(14),
121       kAOD = BIT(15)
122     };
123     typedef enum{
124       kPrimary = 0,
125       kProductionVertex = 1,
126       kSigmaToVertex = 2,
127       kDCAToVertex = 3,
128       kITSPixel = 4,
129       kMaxImpactParam = 5,
130       kKineMCCuts = 6
131     } Require_t;
132     void SetParticleGenCutList();
133     void SetAcceptanceCutList();
134     void SetRecKineITSTPCCutList();
135     void SetRecPrimaryCutList();
136     void SetHFElectronITSCuts();
137     void SetHFElectronTRDCuts();
138     void SetEventCutList(Int_t istep);
139   
140     ULong64_t fRequirements;      // Bitmap for requirements
141     Double_t fDCAtoVtx[2];            // DCA to Vertex
142     Double_t fProdVtx[4];               // Production Vertex
143     Double_t fPtRange[2];               // pt range
144     UChar_t fMinClustersTPC;        // Min.Number of TPC clusters
145     UChar_t fMinTrackletsTRD;       // Min. Number of TRD tracklets
146     UChar_t fCutITSPixel;               // Cut on ITS pixel
147     Bool_t  fCheckITSLayerStatus;       // Check ITS layer status
148     Double_t fMaxChi2clusterTPC;        // Max Chi2 per TPC cluster
149     Double_t fMinClusterRatioTPC;       // Min. Ratio findable / found TPC clusters
150     Double_t fSigmaToVtx;               // Sigma To Vertex
151     
152     TList *fHistQA;                         //! QA Histograms
153     TObjArray *fCutList;                //! List of cut objects(Correction Framework Manager)
154
155     Int_t fDebugLevel;            // Debug Level
156     
157   ClassDef(AliHFEcuts, 1)         // Container for HFE cuts
158 };
159
160 //__________________________________________________________________
161 void AliHFEcuts::SetProductionVertex(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax){
162   // Set the production vertex constraint
163   SetRequireProdVertex();
164   fProdVtx[0] = xmin;
165   fProdVtx[1] = xmax;
166   fProdVtx[2] = ymin;
167   fProdVtx[3] = ymax;
168 }
169
170 //__________________________________________________________________
171 void AliHFEcuts::SetSigmaToVertex(Double_t sig){
172   SetRequireSigmaToVertex();
173   fSigmaToVtx = sig;
174 }
175
176 //__________________________________________________________________
177 void AliHFEcuts::SetMaxImpactParam(Double_t radial, Double_t z){
178   SetRequireDCAToVertex();
179   fDCAtoVtx[0] = radial;
180   fDCAtoVtx[1] = z;
181 }
182
183 //__________________________________________________________________
184 void AliHFEcuts::SetCutITSpixel(UChar_t cut){
185   SetRequireITSPixel();
186   fCutITSPixel = cut;
187 }
188
189 //__________________________________________________________________
190 void AliHFEcuts::CreateStandardCuts(){
191   //
192   // Standard Cuts defined by the HFE Group
193   //
194   SetRequireProdVertex();
195   fProdVtx[0] = 0;
196   fProdVtx[1] = 3;
197   fProdVtx[2] = 0;
198   fProdVtx[3] = 3;
199   //SetRequireDCAToVertex();
200   //fDCAtoVtx[0] = 0.5;
201   //fDCAtoVtx[1] = 1.5;
202   fMinClustersTPC = 80;
203   fMinTrackletsTRD = 0;
204   SetRequireITSPixel();
205   fCutITSPixel = AliHFEextraCuts::kFirst;
206   fMaxChi2clusterTPC = 3.5;
207   fMinClusterRatioTPC = 0.6;
208   fPtRange[0] = 0.1;
209   fPtRange[1] = 20.;
210   SetRequireKineMCCuts();
211 }
212 #endif