2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 // Extra Cuts from the ALICE HFE Group
18 // Container for cuts which are currently not implemented by
19 // the Correction Framework
21 #ifndef ALIHFEEXTRACUTS_H
22 #define ALIHFEEXTRACUTS_H
24 // #ifndef ALICFCUTBASE_H
25 #include "AliCFCutBase.h"
42 class AliHFEextraCuts: public AliCFCutBase{
62 kFoundOverFindable = 0,
63 kFoundOverFindableIter1 = 1,
66 kFoundAllOverFindable = 4,
68 AliHFEextraCuts(const Char_t *name, const Char_t *title);
69 AliHFEextraCuts(const AliHFEextraCuts &c);
70 AliHFEextraCuts &operator=(const AliHFEextraCuts &c);
71 virtual ~AliHFEextraCuts();
73 virtual Bool_t IsSelected(TObject *o);
74 virtual Bool_t IsSelected(TList *) { return kTRUE; };
75 virtual void SetRecEventInfo(const TObject *event);
77 inline void SetClusterRatioTPC(Double_t ratio, ETPCclrDef_t def);
78 inline void SetRequireITSpixel(ITSPixel_t pixel);
79 inline void SetRequireITSdrift(ITSDrift_t drift);
80 inline void SetMinImpactParamR(Double_t impactParam);
81 inline void SetMaxImpactParamR(Double_t impactParam);
82 inline void SetMinImpactParamZ(Double_t impactParam);
83 inline void SetMaxImpactParamZ(Double_t impactParam);
84 inline void SetMinHFEImpactParamR(Float_t ipcutParam[4], Bool_t issigmacut, Bool_t isipcharge, Bool_t isopp);
85 inline void SetMinTrackletsTRD(Int_t minTracklets, Bool_t exact = kFALSE);
86 inline void SetMaxChi2TRD(Float_t maxchi2);
87 inline void SetMinNClustersTPC(Int_t minclusters, ETPCclusterDef_t def);
88 void SetMinNClustersTPCPID(Int_t minclusters) { SETBIT(fRequirements, kMinNClustersTPCPID); fMinNClustersTPCPID = minclusters; }
89 void SetTOFPID(Bool_t tofPid) { tofPid ? SETBIT(fRequirements, kTOFPID) : CLRBIT(fRequirements, kTOFPID); }
90 void SetTOFMISMATCH(Bool_t tofMismatch) { tofMismatch ? SETBIT(fRequirements, kTOFmismatch) : CLRBIT(fRequirements, kTOFmismatch); }
91 void SetMatchTOFLabel(Bool_t match) {match ? SETBIT(fRequirements, kTOFlabel) : CLRBIT(fRequirements, kTOFlabel); }
92 void SetTPCPIDCleanUp(Bool_t tpcPIDCleanUp) { tpcPIDCleanUp ? SETBIT(fRequirements, kTPCPIDCleanUp) : CLRBIT(fRequirements, kTPCPIDCleanUp); }
93 void SetMaxImpactParameterRpar(Bool_t maxImpactParameterRpar) { maxImpactParameterRpar ? SETBIT(fRequirements, kMaxImpactParameterRpar) : CLRBIT(fRequirements, kMaxImpactParameterRpar); }
94 void SetFractionOfTPCSharedClusters(Double_t fractionShared) { fFractionTPCShared= fractionShared; SETBIT(fRequirements, kTPCfractionShared); }
95 void SetMinNbITScls(UChar_t minNbITScls) { fMinNbITScls = minNbITScls; SETBIT(fRequirements, kMinNbITScls); }
96 void SetTOFsignalDxz(Double_t tofsignalDx,Double_t tofsignalDz) { fTOFsignalDx=tofsignalDx; fTOFsignalDz=tofsignalDz; SETBIT(fRequirements, kTOFsignalDxy); }
97 void SetRejectKinkDaughter() { SETBIT(fRequirements, kRejectKinkDaughter);};
98 void SetRejectKinkMother() { SETBIT(fRequirements, kRejectKinkMother);};
99 void SetAODFilterBit(Int_t bit) {fAODFilterBit = bit; SETBIT(fRequirements, kAODFilterBit);};
100 void SetCheckITSstatus(Bool_t check) { fCheck = check; };
101 void SetITSpatternCut() { SETBIT(fRequirements, kITSpattern); }
102 void SetDebugLevel(Int_t level) { fDebugLevel = level; };
104 Bool_t GetCheckITSstatus() const { return fCheck; };
105 Int_t GetDebugLevel() const { return fDebugLevel; };
106 void GetHFEImpactParameters(const AliVTrack * const track, Double_t &dcaxy, Double_t &dcansigmaxy); // temporary moved from protected to publich for IP QA
107 void GetHFEImpactParameters(const AliVTrack * const track, Double_t dcaD[2], Double_t covD[3]);
108 void GetImpactParameters(AliVTrack *track, Float_t &radial, Float_t &z);
109 const AliVVertex* RemoveDaughtersFromPrimaryVtx(const AliESDEvent * const esdevent, const AliVTrack * const track);
110 AliAODVertex* RemoveDaughtersFromPrimaryVtx(const AliAODEvent * const aod, const AliVTrack * const track);
111 Int_t GetITSstatus(const AliVTrack * const track, Int_t layer) const;
112 Bool_t CheckITSstatus(Int_t itsStatus) const;
113 Bool_t CheckITSpattern(const AliVTrack *const track) const;
114 Bool_t IsKinkDaughter(AliVTrack *track);
115 Bool_t IsKinkMother(AliVTrack *track);
118 void UnSetRejectKinkDaughter() { CLRBIT(fRequirements, kRejectKinkDaughter);};
119 void UnSetRejectKinkMother() { CLRBIT(fRequirements, kRejectKinkMother);};
123 virtual void AddQAHistograms(TList *qaList);
124 Bool_t CheckRecCuts(AliVTrack *track);
125 Bool_t CheckMCCuts(AliVParticle * /*track*/) const;
126 void FillQAhistosRec(AliVTrack *track, UInt_t when);
127 //void FillQAhistosMC(AliMCParticle *track, UInt_t when);
128 void FillCutCorrelation(ULong64_t survivedCut);
129 void PrintBitMap(Int_t bitmap);
131 // Getter Functions for ESD/AOD compatible mode
132 UInt_t GetTPCncls(AliVTrack *track);
133 Bool_t GetTPCCountSharedMapBitsAboveThreshold(AliVTrack *track);
134 Double_t GetTPCclusterRatio(AliVTrack *track);
135 //void GetHFEImpactParameters(AliVTrack *track, Double_t &dcaxy, Double_t &dcansigmaxy);
136 void GetHFEImpactParameterCuts(const AliVTrack * const track, Double_t &hfeimpactRcut, Double_t &hfeimpactnsigmaRcut);
137 void GetMaxImpactParameterCutR(const AliVTrack * const track, Double_t &maximpactRcut);
138 void GetTOFsignalDxDz(const AliVTrack * const track, Double_t &tofsignalDx, Double_t &tofsignalDz);
139 Float_t GetTPCsharedClustersRatio(AliVTrack *track);
140 Float_t GetTRDchi(AliVTrack *track);
141 Int_t GetITSNbOfcls(AliVTrack *track);
142 Bool_t MatchTOFlabel(const AliVTrack * const track) const;
146 kMinImpactParamR = 0,
147 kMaxImpactParamR = 1,
148 kMinImpactParamZ = 2,
149 kMaxImpactParamZ = 3,
150 kClusterRatioTPC = 4,
151 kMinTrackletsTRD = 5,
153 kMinHFEImpactParamR = 7,
154 kMinHFEImpactParamNsigmaR = 8,
155 kMinNClustersTPC = 9,
156 kMinNClustersTPCPID = 10,
157 kTPCfractionShared = 11,
162 kMaxImpactParameterRpar = 16,
164 kRejectKinkDaughter = 18,
165 kRejectKinkMother = 19,
170 kMinHFEImpactParamRcharge = 24,
182 static const Int_t fgkNQAhistos; // Number of QA histos
183 AliVEvent *fEvent; //! working event
184 ULong64_t fCutCorrelation; // Cut Correlation
185 ULong64_t fRequirements; // Cut Requirements
186 Float_t fImpactParamCut[4]; // Impact Parmameter Cut
187 Float_t fIPcutParam[4]; // Parmameter of impact parameter cut parametrization
188 UInt_t fMinNClustersTPC; // Minimum TPC clusters cut
189 UInt_t fMinNClustersTPCPID; // Minimum TPC PID clusters cut
190 Float_t fClusterRatioTPC; // Ratio of findable vs. found clusters in TPC
191 UChar_t fMinTrackletsTRD; // Min. Number of Tracklets inside TRD
192 Float_t fMaxChi2TRD; // Max chi2 TRD
193 UChar_t fMinNbITScls; // Min. Number of ITS clusters
194 Bool_t fTRDtrackletsExact; // Require exact number of tracklets
195 UChar_t fPixelITS; // Cut on ITS Pixels
196 UChar_t fDriftITS; // Cut on ITS Drift
197 UChar_t fTPCclusterDef; // TPC cluster definition Bitmap
198 UChar_t fTPCclusterRatioDef; // TPC cluster ratio definition Bitmap
199 Double_t fFractionTPCShared; // Cut on fraction of shared clusters
200 Bool_t fOppSideIPcut; // flag to use conversion peak side of ip*charge cut
201 Double_t fTOFsignalDx; // TOF signal dx
202 Double_t fTOFsignalDz; // TOF signal dz
203 Double_t fMagField; // Magnetic field
204 Int_t fAODFilterBit; // Require AOD filter bit
205 TArrayI fListKinkMothers; // List of Kink Mothers (AOD analysis)
206 Int_t fNumberKinkMothers; // Number of Kink mothers
208 Bool_t fCheck; // check
209 TList *fQAlist; //! Directory for QA histograms
210 Int_t fDebugLevel; // Debug Level
212 ClassDef(AliHFEextraCuts, 5) // Additional cuts implemented by the ALICE HFE group
215 //__________________________________________________________
216 void AliHFEextraCuts::SetClusterRatioTPC(Double_t ratio, ETPCclrDef_t def) {
217 SETBIT(fRequirements, kClusterRatioTPC);
218 SETBIT(fTPCclusterRatioDef, def);
219 fClusterRatioTPC = ratio;
222 //__________________________________________________________
223 void AliHFEextraCuts::SetRequireITSpixel(ITSPixel_t pixel) {
224 SETBIT(fRequirements, kPixelITS);
228 //__________________________________________________________
229 void AliHFEextraCuts::SetRequireITSdrift(ITSDrift_t drift) {
230 SETBIT(fRequirements, kDriftITS);
234 //__________________________________________________________
235 void AliHFEextraCuts::SetMinImpactParamR(Double_t impactParam){
236 SETBIT(fRequirements, kMinImpactParamR);
237 fImpactParamCut[0] = impactParam;
240 //__________________________________________________________
241 void AliHFEextraCuts::SetMaxImpactParamR(Double_t impactParam){
242 SETBIT(fRequirements, kMaxImpactParamR);
243 fImpactParamCut[2] = impactParam;
246 //__________________________________________________________
247 void AliHFEextraCuts::SetMinImpactParamZ(Double_t impactParam){
248 SETBIT(fRequirements, kMinImpactParamZ);
249 fImpactParamCut[1] = impactParam;
252 //__________________________________________________________
253 void AliHFEextraCuts::SetMaxImpactParamZ(Double_t impactParam){
254 SETBIT(fRequirements, kMaxImpactParamZ);
255 fImpactParamCut[3] = impactParam;
258 //__________________________________________________________
259 void AliHFEextraCuts::SetMinHFEImpactParamR(Float_t ipcutParam[4], Bool_t isSigmacut, Bool_t isIPcharge, Bool_t isopp){
260 if(isSigmacut){ SETBIT(fRequirements, kMinHFEImpactParamNsigmaR);}
262 if(isIPcharge){ SETBIT(fRequirements, kMinHFEImpactParamRcharge);}
263 else {SETBIT(fRequirements, kMinHFEImpactParamR);}
264 fIPcutParam[0]=ipcutParam[0];
265 fIPcutParam[1]=ipcutParam[1];
266 fIPcutParam[2]=ipcutParam[2];
267 fIPcutParam[3]=ipcutParam[3];
268 fOppSideIPcut = isopp;
272 //__________________________________________________________
273 void AliHFEextraCuts::SetMinTrackletsTRD(Int_t minTracklets, Bool_t exact){
274 SETBIT(fRequirements, kMinTrackletsTRD);
275 fMinTrackletsTRD = minTracklets;
276 fTRDtrackletsExact = exact;
279 //__________________________________________________________
280 void AliHFEextraCuts::SetMaxChi2TRD(Float_t maxchi2){
281 SETBIT(fRequirements, kMaxTRDChi2);
282 fMaxChi2TRD = maxchi2;
286 //__________________________________________________________
287 void AliHFEextraCuts::SetMinNClustersTPC(Int_t minClusters, ETPCclusterDef_t tpcdef){
288 SETBIT(fRequirements, kMinNClustersTPC);
289 SETBIT(fTPCclusterDef, tpcdef);
290 fMinNClustersTPC = minClusters;