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