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