]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliHFEextraCuts.h
update
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEextraCuts.h
CommitLineData
76d0b522 1
809a4336 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**************************************************************************/
50685501 16//
17// Extra Cuts from the ALICE HFE Group
18// Container for cuts which are currently not implemented by
19// the Correction Framework
20//
c2690925 21#ifndef ALIHFEEXTRACUTS_H
22#define ALIHFEEXTRACUTS_H
809a4336 23
24// #ifndef ALICFCUTBASE_H
25#include "AliCFCutBase.h"
26// #endif
27
28class TList;
29
3a72645a 30class AliVEvent;
31class AliVParticle;
32class AliVTrack;
809a4336 33
e17c1f86 34class AliHFEextraCuts: public AliCFCutBase{
809a4336 35 public:
36 typedef enum{
37 kFirst = 0,
38 kSecond = 1,
39 kBoth = 2,
40 kNone = 3,
e156c3bb 41 kAny = 4,
42 kExclusiveSecond = 5
809a4336 43 } ITSPixel_t;
5cd679b7 44 typedef enum{
45 kFirstD = 0
46 } ITSDrift_t;
e3ae862b 47 typedef enum{
48 kFound = 0,
49 kFoundIter1 = 1,
76d0b522 50 kCrossedRows = 2,
51 kFoundAll = 3
e3ae862b 52 } ETPCclusterDef_t;
53 typedef enum{
54 kFoundOverFindable = 0,
55 kFoundOverFindableIter1 = 1,
56 kFoundOverCR = 2,
76d0b522 57 kCROverFindable = 3,
58 kFoundAllOverFindable = 4,
e3ae862b 59 } ETPCclrDef_t;
809a4336 60 AliHFEextraCuts(const Char_t *name, const Char_t *title);
61 AliHFEextraCuts(const AliHFEextraCuts &c);
62 AliHFEextraCuts &operator=(const AliHFEextraCuts &c);
75d81601 63 virtual ~AliHFEextraCuts();
809a4336 64
9eeae5d5 65 virtual Bool_t IsSelected(TObject *o);
66 virtual Bool_t IsSelected(TList *) { return kTRUE; };
3a72645a 67 virtual void SetRecEventInfo(const TObject *event);
809a4336 68
e3ae862b 69 inline void SetClusterRatioTPC(Double_t ratio, ETPCclrDef_t def);
809a4336 70 inline void SetRequireITSpixel(ITSPixel_t pixel);
5cd679b7 71 inline void SetRequireITSdrift(ITSDrift_t drift);
809a4336 72 inline void SetMinImpactParamR(Double_t impactParam);
73 inline void SetMaxImpactParamR(Double_t impactParam);
74 inline void SetMinImpactParamZ(Double_t impactParam);
75 inline void SetMaxImpactParamZ(Double_t impactParam);
11ff28c5 76 inline void SetMinHFEImpactParamR(Float_t ipcutParam[4], Bool_t issigmacut, Bool_t isabs);
aa1417ee 77 inline void SetMinTrackletsTRD(Int_t minTracklets, Bool_t exact = kFALSE);
cedf0381 78 inline void SetMaxChi2TRD(Float_t maxchi2);
e3ae862b 79 inline void SetMinNClustersTPC(Int_t minclusters, ETPCclusterDef_t def);
e17c1f86 80 void SetMinNClustersTPCPID(Int_t minclusters) { SETBIT(fRequirements, kMinNClustersTPCPID); fMinNClustersTPCPID = minclusters; }
8c1c76e9 81 void SetTOFPID(Bool_t tofPid) { tofPid ? SETBIT(fRequirements, kTOFPID) : CLRBIT(fRequirements, kTOFPID); }
82 void SetTOFMISMATCH(Bool_t tofMismatch) { tofMismatch ? SETBIT(fRequirements, kTOFmismatch) : CLRBIT(fRequirements, kTOFmismatch); }
83 void SetTPCPIDCleanUp(Bool_t tpcPIDCleanUp) { tpcPIDCleanUp ? SETBIT(fRequirements, kTPCPIDCleanUp) : CLRBIT(fRequirements, kTPCPIDCleanUp); }
84 void SetMaxImpactParameterRpar(Bool_t maxImpactParameterRpar) { maxImpactParameterRpar ? SETBIT(fRequirements, kMaxImpactParameterRpar) : CLRBIT(fRequirements, kMaxImpactParameterRpar); }
85 void SetFractionOfTPCSharedClusters(Double_t fractionShared) { fFractionTPCShared= fractionShared; SETBIT(fRequirements, kTPCfractionShared); }
11ff28c5 86 void SetMinNbITScls(UChar_t minNbITScls) { fMinNbITScls = minNbITScls; SETBIT(fRequirements, kMinNbITScls); }
1c051dd4 87 void SetTOFsignalDxz(Double_t tofsignalDx,Double_t tofsignalDz) { fTOFsignalDx=tofsignalDx; fTOFsignalDz=tofsignalDz; SETBIT(fRequirements, kTOFsignalDxy); }
11ff28c5 88 void SetRejectKinkDaughter() { SETBIT(fRequirements, kRejectKinkDaughter);};
89 void SetRejectKinkMother() { SETBIT(fRequirements, kRejectKinkMother);};
75d81601 90 void SetCheckITSstatus(Bool_t check) { fCheck = check; };
cedf0381 91 void SetITSpatternCut() { SETBIT(fRequirements, kITSpattern); }
dbe3abbe 92 void SetDebugLevel(Int_t level) { fDebugLevel = level; };
8c1c76e9 93
94 Bool_t GetCheckITSstatus() const { return fCheck; };
dbe3abbe 95 Int_t GetDebugLevel() const { return fDebugLevel; };
8c1c76e9 96 void GetHFEImpactParameters(AliVTrack *track, Double_t &dcaxy, Double_t &dcansigmaxy); // temporary moved from protected to publich for IP QA
11ff28c5 97 void GetHFEImpactParameters(AliVTrack *track, Double_t dcaD[2], Double_t covD[3]);
76d0b522 98 void GetImpactParameters(AliVTrack *track, Float_t &radial, Float_t &z);
cedf0381 99 Int_t GetITSstatus(const AliVTrack * const track, Int_t layer) const;
a8ef1999 100 Bool_t CheckITSstatus(Int_t itsStatus) const;
cedf0381 101 Bool_t CheckITSpattern(const AliVTrack *const track) const;
76d0b522 102 Bool_t IsKinkDaughter(AliVTrack *track);
11ff28c5 103
104 void UnSetRejectKinkDaughter() { CLRBIT(fRequirements, kRejectKinkDaughter);};
105 void UnSetRejectKinkMother() { CLRBIT(fRequirements, kRejectKinkMother);};
106
809a4336 107
108 protected:
109 virtual void AddQAHistograms(TList *qaList);
3a72645a 110 Bool_t CheckRecCuts(AliVTrack *track);
111 Bool_t CheckMCCuts(AliVParticle * /*track*/) const;
3a72645a 112 void FillQAhistosRec(AliVTrack *track, UInt_t when);
11ff28c5 113 //void FillQAhistosMC(AliMCParticle *track, UInt_t when);
809a4336 114 void FillCutCorrelation(ULong64_t survivedCut);
dbe3abbe 115 void PrintBitMap(Int_t bitmap);
809a4336 116
3a72645a 117 // Getter Functions for ESD/AOD compatible mode
e3ae862b 118 UInt_t GetTPCncls(AliVTrack *track);
8c1c76e9 119 Bool_t GetTPCCountSharedMapBitsAboveThreshold(AliVTrack *track);
76d0b522 120 Double_t GetTPCclusterRatio(AliVTrack *track);
8c1c76e9 121 //void GetHFEImpactParameters(AliVTrack *track, Double_t &dcaxy, Double_t &dcansigmaxy);
3a72645a 122 void GetHFEImpactParameterCuts(AliVTrack *track, Double_t &hfeimpactRcut, Double_t &hfeimpactnsigmaRcut);
9250ffbf 123 void GetMaxImpactParameterCutR(AliVTrack *track, Double_t &maximpactRcut);
1c051dd4 124 void GetTOFsignalDxDz(AliVTrack *track, Double_t &tofsignalDx, Double_t &tofsignalDz);
9250ffbf 125 Float_t GetTPCsharedClustersRatio(AliVTrack *track);
cedf0381 126 Float_t GetTRDchi(AliVTrack *track);
11ff28c5 127 Int_t GetITSNbOfcls(AliVTrack *track);
11ff28c5 128 Bool_t IsKinkMother(AliVTrack *track);
3a72645a 129
809a4336 130 private:
131 typedef enum{
132 kMinImpactParamR = 0,
133 kMaxImpactParamR = 1,
134 kMinImpactParamZ = 2,
135 kMaxImpactParamZ = 3,
136 kClusterRatioTPC = 4,
137 kMinTrackletsTRD = 5,
138 kPixelITS = 6,
3a72645a 139 kMinHFEImpactParamR = 7,
140 kMinHFEImpactParamNsigmaR = 8,
141 kMinNClustersTPC = 9,
e17c1f86 142 kMinNClustersTPCPID = 10,
143 kTPCfractionShared = 11,
144 kTOFPID = 12,
145 kTOFmismatch = 13,
146 kTPCPIDCleanUp = 14,
147 kEMCALmatch = 15,
148 kMaxImpactParameterRpar = 16,
11ff28c5 149 kMinNbITScls = 17,
150 kRejectKinkDaughter = 18,
151 kRejectKinkMother = 19,
5cd679b7 152 kDriftITS = 20,
1c051dd4 153 kTOFsignalDxy = 21,
cedf0381 154 kMaxTRDChi2 = 22,
155 kITSpattern = 23,
156 kNcuts = 24
809a4336 157 } Cut_t;
158 enum{
159 //
160 // Common Constants
161 //
162 kBeforeCuts =0,
163 kAfterCuts = 1
164 };
11ff28c5 165 static const Int_t fgkNQAhistos; // Number of QA histos
e3ae862b 166 AliVEvent *fEvent; //! working event
11ff28c5 167 ULong64_t fCutCorrelation; // Cut Correlation
168 ULong64_t fRequirements; // Cut Requirements
169 Float_t fImpactParamCut[4]; // Impact Parmameter Cut
170 Float_t fIPcutParam[4]; // Parmameter of impact parameter cut parametrization
e3ae862b 171 UInt_t fMinNClustersTPC; // Minimum TPC clusters cut
e17c1f86 172 UInt_t fMinNClustersTPCPID; // Minimum TPC PID clusters cut
11ff28c5 173 Float_t fClusterRatioTPC; // Ratio of findable vs. found clusters in TPC
174 UChar_t fMinTrackletsTRD; // Min. Number of Tracklets inside TRD
cedf0381 175 Float_t fMaxChi2TRD; // Max chi2 TRD
11ff28c5 176 UChar_t fMinNbITScls; // Min. Number of ITS clusters
aa1417ee 177 Bool_t fTRDtrackletsExact; // Require exact number of tracklets
e3ae862b 178 UChar_t fPixelITS; // Cut on ITS Pixels
5cd679b7 179 UChar_t fDriftITS; // Cut on ITS Drift
e3ae862b 180 UChar_t fTPCclusterDef; // TPC cluster definition Bitmap
181 UChar_t fTPCclusterRatioDef; // TPC cluster ratio definition Bitmap
8c1c76e9 182 Double_t fFractionTPCShared; // Cut on fraction of shared clusters
11ff28c5 183 Bool_t fAbsHFEImpactParamNsigmaR; // flag to use abs ip cut
1c051dd4 184 Double_t fTOFsignalDx; // TOF signal dx
185 Double_t fTOFsignalDz; // TOF signal dz
75d81601 186
187 Bool_t fCheck; // check
809a4336 188 TList *fQAlist; //! Directory for QA histograms
70da6c5a 189 Int_t fDebugLevel; // Debug Level
dbe3abbe 190
1c051dd4 191 ClassDef(AliHFEextraCuts, 5) // Additional cuts implemented by the ALICE HFE group
809a4336 192};
193
194//__________________________________________________________
e3ae862b 195void AliHFEextraCuts::SetClusterRatioTPC(Double_t ratio, ETPCclrDef_t def) {
809a4336 196 SETBIT(fRequirements, kClusterRatioTPC);
e3ae862b 197 SETBIT(fTPCclusterRatioDef, def);
809a4336 198 fClusterRatioTPC = ratio;
199}
200
201//__________________________________________________________
202void AliHFEextraCuts::SetRequireITSpixel(ITSPixel_t pixel) {
203 SETBIT(fRequirements, kPixelITS);
204 fPixelITS = pixel;
205}
206
5cd679b7 207//__________________________________________________________
208void AliHFEextraCuts::SetRequireITSdrift(ITSDrift_t drift) {
209 SETBIT(fRequirements, kDriftITS);
210 fDriftITS = drift;
211}
212
809a4336 213//__________________________________________________________
214void AliHFEextraCuts::SetMinImpactParamR(Double_t impactParam){
215 SETBIT(fRequirements, kMinImpactParamR);
216 fImpactParamCut[0] = impactParam;
217}
218
219//__________________________________________________________
220void AliHFEextraCuts::SetMaxImpactParamR(Double_t impactParam){
221 SETBIT(fRequirements, kMaxImpactParamR);
75d81601 222 fImpactParamCut[2] = impactParam;
809a4336 223}
224
225//__________________________________________________________
226void AliHFEextraCuts::SetMinImpactParamZ(Double_t impactParam){
227 SETBIT(fRequirements, kMinImpactParamZ);
75d81601 228 fImpactParamCut[1] = impactParam;
809a4336 229}
230
231//__________________________________________________________
232void AliHFEextraCuts::SetMaxImpactParamZ(Double_t impactParam){
233 SETBIT(fRequirements, kMaxImpactParamZ);
234 fImpactParamCut[3] = impactParam;
235}
236
3a72645a 237//__________________________________________________________
11ff28c5 238void AliHFEextraCuts::SetMinHFEImpactParamR(Float_t ipcutParam[4], Bool_t isSigmacut, Bool_t isabs){
c2690925 239 if(isSigmacut) SETBIT(fRequirements, kMinHFEImpactParamNsigmaR);
240 else SETBIT(fRequirements, kMinHFEImpactParamR);
241 fIPcutParam[0]=ipcutParam[0];
242 fIPcutParam[1]=ipcutParam[1];
243 fIPcutParam[2]=ipcutParam[2];
244 fIPcutParam[3]=ipcutParam[3];
11ff28c5 245 fAbsHFEImpactParamNsigmaR = isabs;
3a72645a 246}
247
809a4336 248//__________________________________________________________
aa1417ee 249void AliHFEextraCuts::SetMinTrackletsTRD(Int_t minTracklets, Bool_t exact){
809a4336 250 SETBIT(fRequirements, kMinTrackletsTRD);
251 fMinTrackletsTRD = minTracklets;
aa1417ee 252 fTRDtrackletsExact = exact;
809a4336 253}
3a72645a 254
cedf0381 255//__________________________________________________________
256void AliHFEextraCuts::SetMaxChi2TRD(Float_t maxchi2){
257 SETBIT(fRequirements, kMaxTRDChi2);
258 fMaxChi2TRD = maxchi2;
259}
260
261
3a72645a 262//__________________________________________________________
e3ae862b 263void AliHFEextraCuts::SetMinNClustersTPC(Int_t minClusters, ETPCclusterDef_t tpcdef){
3a72645a 264 SETBIT(fRequirements, kMinNClustersTPC);
e3ae862b 265 SETBIT(fTPCclusterDef, tpcdef);
3a72645a 266 fMinNClustersTPC = minClusters;
267}
809a4336 268#endif