]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEextraCuts.h
Cleanup the code. Fix memory leak. Now inherit from AliAnalysisTaskSE (Antoine, Phili...
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEextraCuts.h
1 #ifndef ALIHFEEXTRACUTS_H
2 #define ALIHFEEXTRACUTS_H
3
4 /**************************************************************************
5 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 *                                                                        *
7 * Author: The ALICE Off-line Project.                                    *
8 * Contributors are mentioned in the code where appropriate.              *
9 *                                                                        *
10 * Permission to use, copy, modify and distribute this software and its   *
11 * documentation strictly for non-commercial purposes is hereby granted   *
12 * without fee, provided that the above copyright notice appears in all   *
13 * copies and that both the copyright notice and this permission notice   *
14 * appear in the supporting documentation. The authors make no claims     *
15 * about the suitability of this software for any purpose. It is          *
16 * provided "as is" without express or implied warranty.                  *
17 **************************************************************************/
18
19 /* $Id$ */ 
20
21 //
22 // Extra Cuts from the ALICE HFE Group
23 // Container for cuts which are currently not implemented by
24 // the Correction Framework
25 //
26
27 // #ifndef ALICFCUTBASE_H
28 #include "AliCFCutBase.h"
29 // #endif
30
31 class TList;
32
33 class AliVEvent;
34 class AliVParticle;
35 class AliVTrack;
36
37 class AliHFEextraCuts : public AliCFCutBase{
38   public:
39     typedef enum{
40       kFirst = 0,
41       kSecond = 1,
42       kBoth = 2,
43       kNone = 3,
44       kAny = 4
45     } ITSPixel_t;
46     typedef enum{
47       kFound = 0,
48       kFoundIter1 = 1,
49       kCrossedRows = 2
50     } ETPCclusterDef_t;
51     typedef enum{
52       kFoundOverFindable = 0,
53       kFoundOverFindableIter1 = 1,
54       kFoundOverCR = 2,
55       kCROverFindable = 3
56     } ETPCclrDef_t;
57     AliHFEextraCuts(const Char_t *name, const Char_t *title);
58     AliHFEextraCuts(const AliHFEextraCuts &c);
59     AliHFEextraCuts &operator=(const AliHFEextraCuts &c);
60     virtual ~AliHFEextraCuts();
61     
62     virtual Bool_t IsSelected(TObject *o);
63     virtual Bool_t IsSelected(TList *) { return kTRUE; };
64     virtual void SetRecEventInfo(const TObject *event);
65
66     inline void SetClusterRatioTPC(Double_t ratio, ETPCclrDef_t def);
67     inline void SetRequireITSpixel(ITSPixel_t pixel);
68     inline void SetMinImpactParamR(Double_t impactParam);
69     inline void SetMaxImpactParamR(Double_t impactParam);
70     inline void SetMinImpactParamZ(Double_t impactParam);
71     inline void SetMaxImpactParamZ(Double_t impactParam);
72     inline void SetMinHFEImpactParamR();
73     inline void SetMinHFEImpactParamNsigmaR();
74     inline void SetMinTrackletsTRD(Int_t minTracklets);
75     inline void SetMinNClustersTPC(Int_t minclusters, ETPCclusterDef_t def);
76     void SetTOFPID(Bool_t tofPid) { fTOFpid = tofPid;}
77
78     void SetCheckITSstatus(Bool_t check) { fCheck = check; };
79     Bool_t GetCheckITSstatus() const { return fCheck; };
80
81     void SetDebugLevel(Int_t level) { fDebugLevel = level; };
82     Int_t GetDebugLevel() const { return fDebugLevel; };
83     
84   protected:
85     virtual void AddQAHistograms(TList *qaList);
86     Bool_t CheckRecCuts(AliVTrack *track);
87     Bool_t CheckMCCuts(AliVParticle * /*track*/) const;
88     Bool_t CheckITSstatus(Int_t itsStatus) const;
89     void FillQAhistosRec(AliVTrack *track, UInt_t when);
90 //     void FillQAhistosMC(AliMCParticle *track, UInt_t when);
91     void FillCutCorrelation(ULong64_t survivedCut);
92     void PrintBitMap(Int_t bitmap);
93     
94     // Getter Functions for ESD/AOD compatible mode
95     Int_t GetTRDnTrackletsPID(AliVTrack *track);
96     Int_t GetITSstatus(AliVTrack *track, Int_t layer);
97     UInt_t GetTPCncls(AliVTrack *track);
98     Double_t GetTPCclusterRatio(AliVTrack *track);
99     void GetImpactParameters(AliVTrack *track, Float_t &radial, Float_t &z);
100     void GetHFEImpactParameters(AliVTrack *track, Double_t &dcaxy, Double_t &dcansigmaxy);
101     void GetHFEImpactParameterCuts(AliVTrack *track, Double_t &hfeimpactRcut, Double_t &hfeimpactnsigmaRcut);
102
103   private:
104     typedef enum{
105       kMinImpactParamR = 0,
106       kMaxImpactParamR = 1,
107       kMinImpactParamZ = 2,
108       kMaxImpactParamZ = 3,
109       kClusterRatioTPC = 4,
110       kMinTrackletsTRD = 5,
111       kPixelITS = 6,
112       kMinHFEImpactParamR = 7,
113       kMinHFEImpactParamNsigmaR = 8,
114       kMinNClustersTPC = 9,
115       kNcuts = 10
116     } Cut_t;
117     enum{
118       //
119       // Common Constants
120       //
121       kBeforeCuts =0,
122       kAfterCuts = 1
123     };
124     AliVEvent *fEvent;                //! working event
125     ULong64_t fCutCorrelation;              // Cut Correlation
126     ULong64_t fRequirements;                  // Cut Requirements
127     Float_t fImpactParamCut[4];             // Impact Parmameter Cut
128     UInt_t fMinNClustersTPC;          // Minimum TPC clusters cut
129     Float_t fClusterRatioTPC;                 // Ratio of findable vs. found clusters in TPC
130     UChar_t fMinTrackletsTRD;                 // Min. Number of Tracklets inside TRD
131     UChar_t fPixelITS;                // Cut on ITS Pixels
132     Bool_t  fTOFpid;                  // TOF pid
133     UChar_t fTPCclusterDef;           // TPC cluster definition Bitmap
134     UChar_t fTPCclusterRatioDef;      // TPC cluster ratio definition Bitmap
135
136     Bool_t  fCheck;                     // check
137     TList *fQAlist;                     //! Directory for QA histograms
138     Int_t   fDebugLevel;                // Debug Level
139   
140   ClassDef(AliHFEextraCuts, 1)      // Additional cuts implemented by the ALICE HFE group
141 };
142
143 //__________________________________________________________
144 void AliHFEextraCuts::SetClusterRatioTPC(Double_t ratio, ETPCclrDef_t def) {
145   SETBIT(fRequirements, kClusterRatioTPC);
146   SETBIT(fTPCclusterRatioDef, def);
147   fClusterRatioTPC = ratio; 
148 }
149
150 //__________________________________________________________
151 void AliHFEextraCuts::SetRequireITSpixel(ITSPixel_t pixel) {
152   SETBIT(fRequirements, kPixelITS);
153   fPixelITS = pixel; 
154 }
155
156 //__________________________________________________________
157 void AliHFEextraCuts::SetMinImpactParamR(Double_t impactParam){
158   SETBIT(fRequirements, kMinImpactParamR);
159   fImpactParamCut[0] = impactParam;
160 }
161
162 //__________________________________________________________
163 void AliHFEextraCuts::SetMaxImpactParamR(Double_t impactParam){
164   SETBIT(fRequirements, kMaxImpactParamR);
165   fImpactParamCut[2] = impactParam;
166 }
167
168 //__________________________________________________________
169 void AliHFEextraCuts::SetMinImpactParamZ(Double_t impactParam){
170   SETBIT(fRequirements, kMinImpactParamZ);
171   fImpactParamCut[1] = impactParam;
172 }
173
174 //__________________________________________________________
175 void AliHFEextraCuts::SetMaxImpactParamZ(Double_t impactParam){
176   SETBIT(fRequirements, kMaxImpactParamZ);
177   fImpactParamCut[3] = impactParam;
178 }
179
180 //__________________________________________________________
181 void AliHFEextraCuts::SetMinHFEImpactParamR(){
182   SETBIT(fRequirements, kMinHFEImpactParamR);
183 }
184
185 //__________________________________________________________
186 void AliHFEextraCuts::SetMinHFEImpactParamNsigmaR(){
187   SETBIT(fRequirements, kMinHFEImpactParamNsigmaR);
188 }
189
190 //__________________________________________________________
191 void AliHFEextraCuts::SetMinTrackletsTRD(Int_t minTracklets){
192   SETBIT(fRequirements, kMinTrackletsTRD);
193   fMinTrackletsTRD = minTracklets;
194 }
195
196 //__________________________________________________________
197 void AliHFEextraCuts::SetMinNClustersTPC(Int_t minClusters, ETPCclusterDef_t tpcdef){
198   SETBIT(fRequirements, kMinNClustersTPC);
199   SETBIT(fTPCclusterDef, tpcdef);
200   fMinNClustersTPC = minClusters;
201 }
202 #endif