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