]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/AliHFEextraCuts.h
Corrected EINCLUDE, compilation with Root 6
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEextraCuts.h
1
2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 *                                                                        *
5 * Author: The ALICE Off-line Project.                                    *
6 * Contributors are mentioned in the code where appropriate.              *
7 *                                                                        *
8 * Permission to use, copy, modify and distribute this software and its   *
9 * documentation strictly for non-commercial purposes is hereby granted   *
10 * without fee, provided that the above copyright notice appears in all   *
11 * copies and that both the copyright notice and this permission notice   *
12 * appear in the supporting documentation. The authors make no claims     *
13 * about the suitability of this software for any purpose. It is          *
14 * provided "as is" without express or implied warranty.                  *
15 **************************************************************************/
16 //
17 // Extra Cuts from the ALICE HFE Group
18 // Container for cuts which are currently not implemented by
19 // the Correction Framework
20 //
21 #ifndef ALIHFEEXTRACUTS_H
22 #define ALIHFEEXTRACUTS_H
23
24 // #ifndef ALICFCUTBASE_H
25 #include "AliCFCutBase.h"
26 // #endif
27
28 #include <TArrayI.h>
29 class TList;
30
31 class AliVEvent;
32 class AliVParticle;
33 class AliVTrack;
34 class AliVVertex;
35 class AliAODVertex;
36 class AliAODEvent;
37 class AliESDEvent;
38
39 class AliHFEextraCuts: public AliCFCutBase{
40   public:
41     typedef enum{
42       kFirst = 0,
43       kSecond = 1,
44       kBoth = 2,
45       kNone = 3,
46       kAny = 4,
47       kExclusiveSecond = 5
48     } ITSPixel_t;
49     typedef enum{
50       kFirstD = 0  
51     } ITSDrift_t;
52     typedef enum{
53       kFound = 0,
54       kFoundIter1 = 1,
55       kCrossedRows = 2,
56       kFoundAll = 3
57     } ETPCclusterDef_t;
58     typedef enum{
59       kFoundOverFindable = 0,
60       kFoundOverFindableIter1 = 1,
61       kFoundOverCR = 2,
62       kCROverFindable = 3,
63       kFoundAllOverFindable = 4,
64     } ETPCclrDef_t;
65     AliHFEextraCuts(const Char_t *name, const Char_t *title);
66     AliHFEextraCuts(const AliHFEextraCuts &c);
67     AliHFEextraCuts &operator=(const AliHFEextraCuts &c);
68     virtual ~AliHFEextraCuts();
69     
70     virtual Bool_t IsSelected(TObject *o);
71     virtual Bool_t IsSelected(TList *) { return kTRUE; };
72     virtual void SetRecEventInfo(const TObject *event);
73
74     inline void SetClusterRatioTPC(Double_t ratio, ETPCclrDef_t def);
75     inline void SetRequireITSpixel(ITSPixel_t pixel);
76     inline void SetRequireITSdrift(ITSDrift_t drift);
77     inline void SetMinImpactParamR(Double_t impactParam);
78     inline void SetMaxImpactParamR(Double_t impactParam);
79     inline void SetMinImpactParamZ(Double_t impactParam);
80     inline void SetMaxImpactParamZ(Double_t impactParam);
81     inline void SetMinHFEImpactParamR(Float_t ipcutParam[4], Bool_t issigmacut, Bool_t isipcharge, Bool_t isopp);
82     inline void SetMinTrackletsTRD(Int_t minTracklets, Bool_t exact = kFALSE);
83     inline void SetMaxChi2TRD(Float_t maxchi2);
84     inline void SetMinNClustersTPC(Int_t minclusters, ETPCclusterDef_t def);
85     void SetMinNClustersTPCPID(Int_t minclusters) { SETBIT(fRequirements, kMinNClustersTPCPID); fMinNClustersTPCPID = minclusters; }
86     void SetTOFPID(Bool_t tofPid) { tofPid ? SETBIT(fRequirements, kTOFPID) : CLRBIT(fRequirements, kTOFPID); }
87     void SetTOFMISMATCH(Bool_t tofMismatch) { tofMismatch ? SETBIT(fRequirements, kTOFmismatch) : CLRBIT(fRequirements, kTOFmismatch); }
88     void SetTPCPIDCleanUp(Bool_t tpcPIDCleanUp) { tpcPIDCleanUp ? SETBIT(fRequirements, kTPCPIDCleanUp) : CLRBIT(fRequirements, kTPCPIDCleanUp); }
89     void SetMaxImpactParameterRpar(Bool_t maxImpactParameterRpar) { maxImpactParameterRpar ? SETBIT(fRequirements, kMaxImpactParameterRpar) : CLRBIT(fRequirements, kMaxImpactParameterRpar); }
90     void SetFractionOfTPCSharedClusters(Double_t fractionShared) { fFractionTPCShared= fractionShared; SETBIT(fRequirements, kTPCfractionShared); }
91     void SetMinNbITScls(UChar_t minNbITScls) { fMinNbITScls = minNbITScls; SETBIT(fRequirements, kMinNbITScls); }
92     void SetTOFsignalDxz(Double_t tofsignalDx,Double_t tofsignalDz) { fTOFsignalDx=tofsignalDx; fTOFsignalDz=tofsignalDz; SETBIT(fRequirements, kTOFsignalDxy); }
93     void SetRejectKinkDaughter() { SETBIT(fRequirements, kRejectKinkDaughter);}; 
94     void SetRejectKinkMother() { SETBIT(fRequirements, kRejectKinkMother);}; 
95     void SetAODFilterBit(Int_t bit) {fAODFilterBit = bit; SETBIT(fRequirements, kAODFilterBit);};
96     void SetCheckITSstatus(Bool_t check) { fCheck = check; };
97     void SetITSpatternCut() { SETBIT(fRequirements, kITSpattern); }
98     void SetDebugLevel(Int_t level) { fDebugLevel = level; };
99
100     Bool_t GetCheckITSstatus() const { return fCheck; };
101     Int_t GetDebugLevel() const { return fDebugLevel; };
102     void GetHFEImpactParameters(const AliVTrack * const track, Double_t &dcaxy, Double_t &dcansigmaxy); // temporary moved from protected to publich for IP QA 
103     void GetHFEImpactParameters(const AliVTrack * const track, Double_t dcaD[2], Double_t covD[3]);
104     void GetImpactParameters(AliVTrack *track, Float_t &radial, Float_t &z);
105     const AliVVertex* RemoveDaughtersFromPrimaryVtx(const AliESDEvent * const esdevent, const AliVTrack * const track);
106     AliAODVertex* RemoveDaughtersFromPrimaryVtx(const AliAODEvent * const aod, const AliVTrack * const track);
107     Int_t GetITSstatus(const AliVTrack * const track, Int_t layer) const;
108     Bool_t CheckITSstatus(Int_t itsStatus) const;
109     Bool_t CheckITSpattern(const AliVTrack *const track) const;
110     Bool_t IsKinkDaughter(AliVTrack *track);
111     Bool_t IsKinkMother(AliVTrack *track);
112
113
114     void UnSetRejectKinkDaughter() { CLRBIT(fRequirements, kRejectKinkDaughter);}; 
115     void UnSetRejectKinkMother() { CLRBIT(fRequirements, kRejectKinkMother);}; 
116
117     
118   protected:
119     virtual void AddQAHistograms(TList *qaList);
120     Bool_t CheckRecCuts(AliVTrack *track);
121     Bool_t CheckMCCuts(AliVParticle * /*track*/) const;
122     void FillQAhistosRec(AliVTrack *track, UInt_t when);
123     //void FillQAhistosMC(AliMCParticle *track, UInt_t when);
124     void FillCutCorrelation(ULong64_t survivedCut);
125     void PrintBitMap(Int_t bitmap);
126     
127     // Getter Functions for ESD/AOD compatible mode
128     UInt_t GetTPCncls(AliVTrack *track);
129     Bool_t GetTPCCountSharedMapBitsAboveThreshold(AliVTrack *track);
130     Double_t GetTPCclusterRatio(AliVTrack *track); 
131     //void GetHFEImpactParameters(AliVTrack *track, Double_t &dcaxy, Double_t &dcansigmaxy);
132     void GetHFEImpactParameterCuts(const AliVTrack * const track, Double_t &hfeimpactRcut, Double_t &hfeimpactnsigmaRcut);
133     void GetMaxImpactParameterCutR(const AliVTrack * const track, Double_t &maximpactRcut);
134     void GetTOFsignalDxDz(const AliVTrack * const track, Double_t &tofsignalDx, Double_t &tofsignalDz);
135     Float_t GetTPCsharedClustersRatio(AliVTrack *track);
136     Float_t GetTRDchi(AliVTrack *track);
137     Int_t GetITSNbOfcls(AliVTrack *track);
138
139   private:
140     typedef enum{
141       kMinImpactParamR = 0,
142       kMaxImpactParamR = 1,
143       kMinImpactParamZ = 2,
144       kMaxImpactParamZ = 3,
145       kClusterRatioTPC = 4,
146       kMinTrackletsTRD = 5,
147       kPixelITS = 6,
148       kMinHFEImpactParamR = 7,
149       kMinHFEImpactParamNsigmaR = 8,
150       kMinNClustersTPC = 9,
151       kMinNClustersTPCPID = 10,
152       kTPCfractionShared = 11,
153       kTOFPID = 12,
154       kTOFmismatch = 13,
155       kTPCPIDCleanUp = 14,
156       kEMCALmatch = 15,
157       kMaxImpactParameterRpar = 16,
158       kMinNbITScls = 17,
159       kRejectKinkDaughter = 18,
160       kRejectKinkMother = 19,
161       kDriftITS = 20,
162       kTOFsignalDxy = 21,
163       kMaxTRDChi2 = 22,
164       kITSpattern = 23,
165       kMinHFEImpactParamRcharge = 24,
166       kAODFilterBit=25,
167       kNcuts = 26
168     } Cut_t;
169     enum{
170       //
171       // Common Constants
172       //
173       kBeforeCuts =0,
174       kAfterCuts = 1
175     };
176     static const Int_t fgkNQAhistos;   // Number of QA histos
177     AliVEvent *fEvent;                //! working event
178     ULong64_t fCutCorrelation;        // Cut Correlation
179     ULong64_t fRequirements;          // Cut Requirements
180     Float_t fImpactParamCut[4];       // Impact Parmameter Cut
181     Float_t fIPcutParam[4];           // Parmameter of impact parameter cut parametrization
182     UInt_t fMinNClustersTPC;          // Minimum TPC clusters cut
183     UInt_t fMinNClustersTPCPID;       // Minimum TPC PID clusters cut
184     Float_t fClusterRatioTPC;         // Ratio of findable vs. found clusters in TPC
185     UChar_t fMinTrackletsTRD;         // Min. Number of Tracklets inside TRD
186     Float_t fMaxChi2TRD;              // Max chi2 TRD
187     UChar_t fMinNbITScls;             // Min. Number of ITS clusters
188     Bool_t  fTRDtrackletsExact;       // Require exact number of tracklets
189     UChar_t fPixelITS;                // Cut on ITS Pixels
190     UChar_t fDriftITS;                // Cut on ITS Drift
191     UChar_t fTPCclusterDef;           // TPC cluster definition Bitmap
192     UChar_t fTPCclusterRatioDef;      // TPC cluster ratio definition Bitmap
193     Double_t  fFractionTPCShared;     // Cut on fraction of shared clusters
194     Bool_t fOppSideIPcut;             // flag to use conversion peak side of ip*charge cut
195     Double_t fTOFsignalDx;            // TOF signal dx
196     Double_t fTOFsignalDz;            // TOF signal dz
197     Double_t fMagField;               // Magnetic field
198     Int_t    fAODFilterBit;           // Require AOD filter bit
199     TArrayI  fListKinkMothers;        // List of Kink Mothers (AOD analysis)
200     Int_t    fNumberKinkMothers;      // Number of Kink mothers
201
202     Bool_t  fCheck;                     // check
203     TList *fQAlist;                     //! Directory for QA histograms
204     Int_t   fDebugLevel;                // Debug Level
205   
206     ClassDef(AliHFEextraCuts, 5)      // Additional cuts implemented by the ALICE HFE group
207 };
208
209 //__________________________________________________________
210 void AliHFEextraCuts::SetClusterRatioTPC(Double_t ratio, ETPCclrDef_t def) {
211   SETBIT(fRequirements, kClusterRatioTPC);
212   SETBIT(fTPCclusterRatioDef, def);
213   fClusterRatioTPC = ratio; 
214 }
215
216 //__________________________________________________________
217 void AliHFEextraCuts::SetRequireITSpixel(ITSPixel_t pixel) {
218   SETBIT(fRequirements, kPixelITS);
219   fPixelITS = pixel; 
220 }
221
222 //__________________________________________________________
223 void AliHFEextraCuts::SetRequireITSdrift(ITSDrift_t drift) {
224   SETBIT(fRequirements, kDriftITS);
225   fDriftITS = drift; 
226 }
227
228 //__________________________________________________________
229 void AliHFEextraCuts::SetMinImpactParamR(Double_t impactParam){
230   SETBIT(fRequirements, kMinImpactParamR);
231   fImpactParamCut[0] = impactParam;
232 }
233
234 //__________________________________________________________
235 void AliHFEextraCuts::SetMaxImpactParamR(Double_t impactParam){
236   SETBIT(fRequirements, kMaxImpactParamR);
237   fImpactParamCut[2] = impactParam;
238 }
239
240 //__________________________________________________________
241 void AliHFEextraCuts::SetMinImpactParamZ(Double_t impactParam){
242   SETBIT(fRequirements, kMinImpactParamZ);
243   fImpactParamCut[1] = impactParam;
244 }
245
246 //__________________________________________________________
247 void AliHFEextraCuts::SetMaxImpactParamZ(Double_t impactParam){
248   SETBIT(fRequirements, kMaxImpactParamZ);
249   fImpactParamCut[3] = impactParam;
250 }
251
252 //__________________________________________________________
253 void AliHFEextraCuts::SetMinHFEImpactParamR(Float_t ipcutParam[4], Bool_t isSigmacut, Bool_t isIPcharge, Bool_t isopp){
254   if(isSigmacut){ SETBIT(fRequirements, kMinHFEImpactParamNsigmaR);}
255   else{ 
256     if(isIPcharge){ SETBIT(fRequirements, kMinHFEImpactParamRcharge);}
257     else {SETBIT(fRequirements, kMinHFEImpactParamR);}
258     fIPcutParam[0]=ipcutParam[0];
259     fIPcutParam[1]=ipcutParam[1];
260     fIPcutParam[2]=ipcutParam[2];
261     fIPcutParam[3]=ipcutParam[3];
262     fOppSideIPcut = isopp;
263   }
264 }
265
266 //__________________________________________________________
267 void AliHFEextraCuts::SetMinTrackletsTRD(Int_t minTracklets, Bool_t exact){
268   SETBIT(fRequirements, kMinTrackletsTRD);
269   fMinTrackletsTRD = minTracklets;
270   fTRDtrackletsExact = exact;
271 }
272
273 //__________________________________________________________
274 void AliHFEextraCuts::SetMaxChi2TRD(Float_t maxchi2){
275   SETBIT(fRequirements, kMaxTRDChi2);
276   fMaxChi2TRD = maxchi2;
277 }
278
279
280 //__________________________________________________________
281 void AliHFEextraCuts::SetMinNClustersTPC(Int_t minClusters, ETPCclusterDef_t tpcdef){
282   SETBIT(fRequirements, kMinNClustersTPC);
283   SETBIT(fTPCclusterDef, tpcdef);
284   fMinNClustersTPC = minClusters;
285 }
286 #endif