]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEcuts.h
Update of PID classes (Markus); Reduction of the number of cut steps in the Correctio...
[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 #ifndef ALIHFECUTS_H
16 #define ALIHFECUTS_H
17
18 #ifndef ROOT_TObject
19 #include <TObject.h>
20 #endif
21
22 #ifndef ALIHFEEXTRACUTS_H
23 #include "AliHFEextraCuts.h"
24 #endif
25
26 class AliCFManager;
27 class AliESDtrack;
28 class AliMCParticle;
29
30 class TObjArray;
31 class TList;
32
33 class AliHFEcuts : public TObject{
34   enum{
35     kDebugMode = BIT(14)
36   };
37   typedef enum{
38     kPrimary = 0,
39     kProductionVertex = 1,
40     kSigmaToVertex = 2,
41     kDCAToVertex = 3,
42     kITSPixel = 4,
43     kMaxImpactParam = 5
44   } Require_t;
45
46   public:
47     typedef enum{
48       kStepMCGenerated = 0,
49       kStepMCsignal = 1,
50       kStepMCInAcceptance = 2,
51       kStepRecKineITSTPC = 3,
52       kStepRecPrim = 4,
53       kStepHFEcutsITS = 5,
54       kStepHFEcutsTRD = 6
55     } CutStep_t;
56     enum{
57       kNcutSteps = 7,
58       kNcutESDSteps = 4
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 UnsetDebugMode() { SetBit(kDebugMode, kFALSE); }
75     Bool_t IsInDebugMode() const { return TestBit(kDebugMode); };
76     
77     // Getters
78     Bool_t IsRequireITSpixel() const { return TESTBIT(fRequirements, kITSPixel); };
79     Bool_t IsRequireMaxImpactParam() const { return TESTBIT(fRequirements, kMaxImpactParam); };
80     Bool_t IsRequirePrimary() const { return TESTBIT(fRequirements, kPrimary); };
81     Bool_t IsRequireProdVertex() const { return TESTBIT(fRequirements, kProductionVertex); };
82     Bool_t IsRequireSigmaToVertex() const { return TESTBIT(fRequirements, kSigmaToVertex); };
83     Bool_t IsRequireDCAToVertex() const {return TESTBIT(fRequirements, kDCAToVertex); };
84     
85     // Setters
86     inline void SetCutITSpixel(UChar_t cut);
87     void SetMinNClustersTPC(UChar_t minClustersTPC) { fMinClustersTPC = minClustersTPC; }
88     void SetMinNTrackletsTRD(UChar_t minNtrackletsTRD) { fMinTrackletsTRD = minNtrackletsTRD; }
89     void SetMaxChi2perClusterTPC(Double_t chi2) { fMaxChi2clusterTPC = chi2; };
90     inline void SetMaxImpactParam(Double_t radial, Double_t z);
91     void SetMinRatioTPCclusters(Double_t minRatioTPC) { fMinClusterRatioTPC = minRatioTPC; };
92     void SetPtRange(Double_t ptmin, Double_t ptmax){fPtRange[0] = ptmin; fPtRange[1] = ptmax;};
93     inline void SetProductionVertex(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax);
94     inline void SetSigmaToVertex(Double_t sig);
95     
96     inline void CreateStandardCuts();
97     
98     // Requirements
99     void SetRequireDCAToVertex() { SETBIT(fRequirements, kDCAToVertex); };
100     void SetRequireIsPrimary() { SETBIT(fRequirements, kPrimary); };
101     void SetRequireITSPixel() { SETBIT(fRequirements, kITSPixel); }
102     void SetRequireProdVertex() { SETBIT(fRequirements, kProductionVertex); };
103     void SetRequireSigmaToVertex() { SETBIT(fRequirements, kSigmaToVertex); };
104
105     void SetDebugLevel(Int_t level) { fDebugLevel = level; };
106     Int_t GetDebugLevel() const { return fDebugLevel; };
107
108   private:
109     void SetParticleGenCutList();
110     void SetAcceptanceCutList();
111     void SetRecKineITSTPCCutList();
112     void SetRecPrimaryCutList();
113     void SetHFElectronITSCuts();
114     void SetHFElectronTRDCuts();
115   
116     ULong64_t fRequirements;      // Bitmap for requirements
117     Double_t fDCAtoVtx[2];            // DCA to Vertex
118     Double_t fProdVtx[4];               // Production Vertex
119     Double_t fPtRange[2];               // pt range
120     UChar_t fMinClustersTPC;        // Min.Number of TPC clusters
121     UChar_t fMinTrackletsTRD;       // Min. Number of TRD tracklets
122     UChar_t fCutITSPixel;               // Cut on ITS pixel
123     Double_t fMaxChi2clusterTPC;        // Max Chi2 per TPC cluster
124     Double_t fMinClusterRatioTPC;       // Min. Ratio findable / found TPC clusters
125     Double_t fSigmaToVtx;               // Sigma To Vertex
126     
127     TList *fHistQA;                         //! QA Histograms
128     TObjArray *fCutList;                //! List of cut objects(Correction Framework Manager)
129
130     Int_t fDebugLevel;            // Debug Level
131     
132   ClassDef(AliHFEcuts, 1)         // Container for HFE cuts
133 };
134
135 //__________________________________________________________________
136 void AliHFEcuts::SetProductionVertex(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax){
137   // Set the production vertex constraint
138   SetRequireProdVertex();
139   fProdVtx[0] = xmin;
140   fProdVtx[1] = xmax;
141   fProdVtx[2] = ymin;
142   fProdVtx[3] = ymax;
143 }
144
145 //__________________________________________________________________
146 void AliHFEcuts::SetSigmaToVertex(Double_t sig){
147   SetRequireSigmaToVertex();
148   fSigmaToVtx = sig;
149 }
150
151 //__________________________________________________________________
152 void AliHFEcuts::SetMaxImpactParam(Double_t radial, Double_t z){
153   SetRequireDCAToVertex();
154   fDCAtoVtx[0] = radial;
155   fDCAtoVtx[1] = z;
156 }
157
158 //__________________________________________________________________
159 void AliHFEcuts::SetCutITSpixel(UChar_t cut){
160   SetRequireITSPixel();
161   fCutITSPixel = cut;
162 }
163
164 //__________________________________________________________________
165 void AliHFEcuts::CreateStandardCuts(){
166   //
167   // Standard Cuts defined by the HFE Group
168   //
169   SetRequireProdVertex();
170   fProdVtx[0] = -3;
171   fProdVtx[1] = 3;
172   fProdVtx[2] = -3;
173   fProdVtx[3] = 3;
174   SetRequireDCAToVertex();
175   fDCAtoVtx[0] = 4.;
176   fDCAtoVtx[1] = 10.;
177   fMinClustersTPC = 50;
178   fMinTrackletsTRD = 0;
179   SetRequireITSPixel();
180   fCutITSPixel = AliHFEextraCuts::kFirst;
181   fMaxChi2clusterTPC = 3.5;
182   fMinClusterRatioTPC = 0.6;
183   fPtRange[0] = 0.1;
184   fPtRange[1] = 20.;
185 }
186 #endif