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