]>
Commit | Line | Data |
---|---|---|
809a4336 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
50685501 | 15 | // |
16 | // Cut menagement class implemented by the | |
17 | // ALICE Heavy Flavour Electron Group | |
18 | // Interface to the correction framework | |
19 | // Provides a set of standard cuts | |
20 | // | |
21 | // Authors: | |
22 | // Raphaelle Bailhache <R.Bailhache@gsi.de> | |
23 | // Markus Fasel <M.Fasel@gsi.de> | |
24 | // Markus Heide <mheide@uni-muenster.de> | |
25 | // Matus Kalisky <m.kalisky@uni-muenster.de> | |
26 | // | |
70da6c5a | 27 | // Overview over the 18 steps in the correction Framework |
28 | // 0. Generated Electrons | |
29 | // 1. Signal Electrons | |
30 | // 2. Electron in Acceptance | |
31 | // ------------------------------------------------------------ | |
32 | // 3. Rec without cuts (MC information) | |
33 | // 4. Rec Kine ITS/TPC (MC Information) | |
34 | // 5. Rec Primary (MC Information) | |
35 | // 6. HFE ITS (MC Information) | |
36 | // 7. HFE TRD (MC Information) | |
37 | // 8. PID (MC Information) | |
38 | // ............................................................ | |
39 | // 9. Rec without cuts(MC Information for tracks which are already registered) | |
40 | // 10. Rec Kine ITS/TPC (MC Information for tracks which are already registered) | |
41 | // 11. RecPrimary (MC Information for tracks which are already registered) | |
42 | // 12. HFE ITS (MC Information for tracks which are already registered) | |
43 | // 13. HFE TPC (MC Information for tracks which are already registered) | |
44 | // 14. PID (MC Information for tracks which are already registered) | |
45 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
46 | // 15. Rec without cuts | |
47 | // 16. Rec Kine ITS/TPC | |
48 | // 17. Rec Primary | |
49 | // 18. HFE ITS | |
50 | // 19. HFE TRD | |
51 | // 20. PID | |
52 | // | |
809a4336 | 53 | #include <TClass.h> |
54 | #include <TList.h> | |
55 | #include <TObjArray.h> | |
56 | #include <TString.h> | |
57 | ||
58 | #include "AliCFAcceptanceCuts.h" | |
59 | #include "AliCFCutBase.h" | |
0792aa82 | 60 | #include "AliCFEventGenCuts.h" |
809a4336 | 61 | #include "AliCFManager.h" |
62 | #include "AliCFParticleGenCuts.h" | |
63 | #include "AliCFTrackIsPrimaryCuts.h" | |
64 | #include "AliCFTrackKineCuts.h" | |
65 | #include "AliCFTrackQualityCuts.h" | |
66 | #include "AliESDtrack.h" | |
c2690925 | 67 | #include "AliHFEextraEventCuts.h" |
e17c1f86 | 68 | #include "AliMCEvent.h" |
69 | #include "AliVEvent.h" | |
809a4336 | 70 | |
71 | #include "AliHFEcuts.h" | |
72 | ||
73 | ClassImp(AliHFEcuts) | |
74 | ||
3a72645a | 75 | const Char_t *AliHFEcuts::fgkMCCutName[AliHFEcuts::kNcutStepsMCTrack] = { |
76 | "MCGenerated", | |
c2690925 | 77 | "MCGeneratedZOutNoPileUpCentralityFine", |
3a72645a | 78 | "MCGeneratedEventCut", |
79 | "MCInAcceptance" | |
80 | }; | |
81 | ||
82 | const Char_t * AliHFEcuts::fgkRecoCutName[AliHFEcuts::kNcutStepsRecTrack] = { | |
83 | "NoCuts", | |
84 | "RecKineITSTPC", | |
85 | "Primary", | |
86 | "HFEITS", | |
9250ffbf | 87 | "HFETOF", |
8c1c76e9 | 88 | "HFETPC", |
3a72645a | 89 | "HFETRD" |
90 | }; | |
91 | ||
92 | const Char_t * AliHFEcuts::fgkDECutName[AliHFEcuts::kNcutStepsDETrack] = { | |
93 | "HFEDCA" | |
94 | }; | |
95 | ||
c2690925 | 96 | const Char_t * AliHFEcuts::fgkSecvtxCutName[AliHFEcuts::kNcutStepsSecvtxTrack] = { |
97 | "HFESecvtx" | |
98 | }; | |
99 | ||
3a72645a | 100 | const Char_t * AliHFEcuts::fgkEventCutName[AliHFEcuts::kNcutStepsEvent] = { |
101 | "EventStepGenerated", | |
102 | "EventStepRecNoCut", | |
103 | "EventStepRecNoPileUp", | |
8c1c76e9 | 104 | "EventStepRecCentralityOK", |
3a72645a | 105 | "EventStepZRange", |
106 | "EventStepReconstructed" | |
107 | }; | |
108 | ||
109 | const Char_t * AliHFEcuts::fgkUndefined = "Undefined"; | |
110 | ||
809a4336 | 111 | //__________________________________________________________________ |
112 | AliHFEcuts::AliHFEcuts(): | |
e3fc062d | 113 | TNamed(), |
114 | fRequirements(0), | |
76d0b522 | 115 | fTPCclusterDef(0), |
116 | fTPCratioDef(0), | |
e3fc062d | 117 | fMinClustersTPC(0), |
e17c1f86 | 118 | fMinClustersTPCPID(0), |
3a72645a | 119 | fMinClustersITS(0), |
e3fc062d | 120 | fMinTrackletsTRD(0), |
cedf0381 | 121 | fMaxChi2TRD(-1.), |
e3fc062d | 122 | fCutITSPixel(0), |
123 | fCheckITSLayerStatus(kTRUE), | |
5cd679b7 | 124 | fCutITSDrift(0), |
8c1c76e9 | 125 | fMaxChi2clusterITS(-1.), |
e3fc062d | 126 | fMaxChi2clusterTPC(0.), |
127 | fMinClusterRatioTPC(0.), | |
3a72645a | 128 | fVertexRangeZ(20.), |
e17c1f86 | 129 | fTRDtrackletsExact(kFALSE), |
e3ae862b | 130 | fTOFPIDStep(kFALSE), |
c2690925 | 131 | fTOFMISMATCHStep(kFALSE), |
8c1c76e9 | 132 | fTPCPIDCLEANUPStep(kFALSE), |
cedf0381 | 133 | fITSpatternCut(kFALSE), |
c2690925 | 134 | fUseMixedVertex(kTRUE), |
63bdf450 | 135 | fUseSPDVertex(kFALSE), |
136 | fUseCorrelationVertex(kFALSE), | |
4437a0d2 | 137 | fSPDVtxResolution(kFALSE), |
138 | fPApileupCut(kFALSE), | |
c2690925 | 139 | fIsIPSigmacut(kFALSE), |
63bdf450 | 140 | fIsIPcharge(kFALSE), |
141 | fIsIPOpp(kFALSE), | |
9250ffbf | 142 | fFractionOfSharedTPCClusters(-1.0), |
143 | fMaxImpactParameterRpar(kFALSE), | |
11ff28c5 | 144 | fAdditionalStatusRequirement(0), |
1c051dd4 | 145 | fTOFsignaldx(-1.0), |
146 | fTOFsignaldz(-1.0), | |
96167a04 | 147 | fAODFilterBit(-1), |
bbeea05b | 148 | fRejectKinkDaughters(kTRUE), |
149 | fRejectKinkMothers(kTRUE), | |
e3fc062d | 150 | fHistQA(0x0), |
151 | fCutList(0x0), | |
152 | fDebugLevel(0) | |
153 | { | |
154 | // | |
155 | // Dummy Constructor | |
156 | // | |
8c1c76e9 | 157 | memset(fProdVtx, 0, sizeof(Double_t) * 4); |
bbeea05b | 158 | memset(fProdVtxZ, 0, sizeof(Double_t) * 2); |
8c1c76e9 | 159 | memset(fDCAtoVtx, 0, sizeof(Double_t) * 2); |
160 | memset(fPtRange, 0, sizeof(Double_t) * 2); | |
161 | memset(fIPCutParams, 0, sizeof(Float_t) * 4); | |
162 | memset(fSigmaToVtx, 0, sizeof(Double_t) * 3); | |
cddc311d | 163 | fEtaRange[0] = -0.8; fEtaRange[1] = 0.8; |
e3fc062d | 164 | } |
165 | ||
166 | //__________________________________________________________________ | |
167 | AliHFEcuts::AliHFEcuts(const Char_t *name, const Char_t *title): | |
168 | TNamed(name, title), | |
809a4336 | 169 | fRequirements(0), |
76d0b522 | 170 | fTPCclusterDef(0), |
171 | fTPCratioDef(0), | |
809a4336 | 172 | fMinClustersTPC(0), |
e17c1f86 | 173 | fMinClustersTPCPID(0), |
3a72645a | 174 | fMinClustersITS(0), |
809a4336 | 175 | fMinTrackletsTRD(0), |
cedf0381 | 176 | fMaxChi2TRD(-1.), |
809a4336 | 177 | fCutITSPixel(0), |
0792aa82 | 178 | fCheckITSLayerStatus(kTRUE), |
5cd679b7 | 179 | fCutITSDrift(0), |
8c1c76e9 | 180 | fMaxChi2clusterITS(-1.), |
809a4336 | 181 | fMaxChi2clusterTPC(0.), |
182 | fMinClusterRatioTPC(0.), | |
3a72645a | 183 | fVertexRangeZ(20.), |
e17c1f86 | 184 | fTRDtrackletsExact(kFALSE), |
e3ae862b | 185 | fTOFPIDStep(kFALSE), |
c2690925 | 186 | fTOFMISMATCHStep(kFALSE), |
8c1c76e9 | 187 | fTPCPIDCLEANUPStep(kFALSE), |
cedf0381 | 188 | fITSpatternCut(kFALSE), |
c2690925 | 189 | fUseMixedVertex(kTRUE), |
63bdf450 | 190 | fUseSPDVertex(kFALSE), |
191 | fUseCorrelationVertex(kFALSE), | |
d87a9d29 | 192 | fSPDVtxResolution(kFALSE), |
4437a0d2 | 193 | fPApileupCut(kFALSE), |
c2690925 | 194 | fIsIPSigmacut(kFALSE), |
63bdf450 | 195 | fIsIPcharge(kFALSE), |
196 | fIsIPOpp(kFALSE), | |
9250ffbf | 197 | fFractionOfSharedTPCClusters(-1.0), |
198 | fMaxImpactParameterRpar(kFALSE), | |
11ff28c5 | 199 | fAdditionalStatusRequirement(0), |
1c051dd4 | 200 | fTOFsignaldx(-1.0), |
201 | fTOFsignaldz(-1.0), | |
96167a04 | 202 | fAODFilterBit(-1), |
bbeea05b | 203 | fRejectKinkDaughters(kTRUE), |
204 | fRejectKinkMothers(kTRUE), | |
809a4336 | 205 | fHistQA(0x0), |
dbe3abbe | 206 | fCutList(0x0), |
207 | fDebugLevel(0) | |
809a4336 | 208 | { |
209 | // | |
210 | // Default Constructor | |
211 | // | |
212 | memset(fProdVtx, 0, sizeof(Double_t) * 4); | |
bbeea05b | 213 | memset(fProdVtxZ, 0, sizeof(Double_t) * 2); |
809a4336 | 214 | memset(fDCAtoVtx, 0, sizeof(Double_t) * 2); |
215 | memset(fPtRange, 0, sizeof(Double_t) * 2); | |
c2690925 | 216 | memset(fIPCutParams, 0, sizeof(Float_t) * 4); |
8c1c76e9 | 217 | memset(fSigmaToVtx, 0, sizeof(Double_t) * 3); |
cddc311d | 218 | fEtaRange[0] = -0.8; fEtaRange[1] = 0.8; |
809a4336 | 219 | } |
220 | ||
221 | //__________________________________________________________________ | |
222 | AliHFEcuts::AliHFEcuts(const AliHFEcuts &c): | |
e3fc062d | 223 | TNamed(c), |
809a4336 | 224 | fRequirements(c.fRequirements), |
e3ae862b | 225 | fTPCclusterDef(c.fTPCclusterDef), |
226 | fTPCratioDef(c.fTPCratioDef), | |
e3fc062d | 227 | fMinClustersTPC(0), |
e17c1f86 | 228 | fMinClustersTPCPID(0), |
3a72645a | 229 | fMinClustersITS(0), |
e3fc062d | 230 | fMinTrackletsTRD(0), |
cedf0381 | 231 | fMaxChi2TRD(-1.), |
e3fc062d | 232 | fCutITSPixel(0), |
233 | fCheckITSLayerStatus(0), | |
5cd679b7 | 234 | fCutITSDrift(0), |
8c1c76e9 | 235 | fMaxChi2clusterITS(-1.), |
e3fc062d | 236 | fMaxChi2clusterTPC(0), |
237 | fMinClusterRatioTPC(0), | |
3a72645a | 238 | fVertexRangeZ(20.), |
e17c1f86 | 239 | fTRDtrackletsExact(kFALSE), |
e3ae862b | 240 | fTOFPIDStep(kFALSE), |
c2690925 | 241 | fTOFMISMATCHStep(kFALSE), |
8c1c76e9 | 242 | fTPCPIDCLEANUPStep(kFALSE), |
cedf0381 | 243 | fITSpatternCut(c.fITSpatternCut), |
c2690925 | 244 | fUseMixedVertex(kTRUE), |
63bdf450 | 245 | fUseSPDVertex(kFALSE), |
d87a9d29 | 246 | fUseCorrelationVertex(c.fUseCorrelationVertex), |
247 | fSPDVtxResolution(c.fSPDVtxResolution), | |
4437a0d2 | 248 | fPApileupCut(c.fPApileupCut), |
c2690925 | 249 | fIsIPSigmacut(kFALSE), |
63bdf450 | 250 | fIsIPcharge(kFALSE), |
251 | fIsIPOpp(kFALSE), | |
9250ffbf | 252 | fFractionOfSharedTPCClusters(-1.0), |
253 | fMaxImpactParameterRpar(kFALSE), | |
11ff28c5 | 254 | fAdditionalStatusRequirement(0), |
1c051dd4 | 255 | fTOFsignaldx(-1.0), |
256 | fTOFsignaldz(-1.0), | |
96167a04 | 257 | fAODFilterBit(-1), |
bbeea05b | 258 | fRejectKinkDaughters(c.fRejectKinkDaughters), |
259 | fRejectKinkMothers(c.fRejectKinkMothers), | |
809a4336 | 260 | fHistQA(0x0), |
dbe3abbe | 261 | fCutList(0x0), |
262 | fDebugLevel(0) | |
809a4336 | 263 | { |
264 | // | |
265 | // Copy Constructor | |
266 | // | |
e3fc062d | 267 | c.Copy(*this); |
268 | } | |
269 | ||
270 | //__________________________________________________________________ | |
271 | AliHFEcuts &AliHFEcuts::operator=(const AliHFEcuts &c){ | |
272 | // | |
273 | // Make assignment | |
274 | // | |
275 | if(&c != this) c.Copy(*this); | |
276 | return *this; | |
277 | } | |
278 | ||
279 | //__________________________________________________________________ | |
280 | void AliHFEcuts::Copy(TObject &c) const { | |
281 | // | |
282 | // Performing copy | |
283 | // | |
284 | AliHFEcuts &target = dynamic_cast<AliHFEcuts &>(c); | |
285 | ||
286 | target.fRequirements = fRequirements; | |
e3ae862b | 287 | target.fTPCclusterDef = fTPCclusterDef; |
288 | target.fTPCratioDef = fTPCratioDef; | |
e3fc062d | 289 | target.fMinClustersTPC = fMinClustersTPC; |
e17c1f86 | 290 | target.fMinClustersTPCPID = fMinClustersTPCPID; |
3a72645a | 291 | target.fMinClustersITS = fMinClustersITS; |
e3fc062d | 292 | target.fMinTrackletsTRD = fMinTrackletsTRD; |
cedf0381 | 293 | target.fMaxChi2TRD = fMaxChi2TRD; |
e3fc062d | 294 | target.fCutITSPixel = fCutITSPixel; |
295 | target.fCheckITSLayerStatus = fCheckITSLayerStatus; | |
5cd679b7 | 296 | target.fCutITSDrift = fCutITSDrift; |
8c1c76e9 | 297 | target.fMaxChi2clusterITS = fMaxChi2clusterITS; |
e3fc062d | 298 | target.fMaxChi2clusterTPC = fMaxChi2clusterTPC; |
299 | target.fMinClusterRatioTPC = fMinClusterRatioTPC; | |
3a72645a | 300 | target.fVertexRangeZ = fVertexRangeZ; |
e17c1f86 | 301 | target.fTRDtrackletsExact = fTRDtrackletsExact; |
e3ae862b | 302 | target.fTOFPIDStep = fTOFPIDStep; |
c2690925 | 303 | target.fTOFMISMATCHStep = fTOFMISMATCHStep; |
8c1c76e9 | 304 | target.fTPCPIDCLEANUPStep = fTPCPIDCLEANUPStep; |
c2690925 | 305 | target.fUseMixedVertex = fUseMixedVertex; |
63bdf450 | 306 | target.fUseSPDVertex = fUseSPDVertex; |
307 | target.fUseCorrelationVertex = fUseCorrelationVertex; | |
d87a9d29 | 308 | target.fSPDVtxResolution = fSPDVtxResolution; |
4437a0d2 | 309 | target.fPApileupCut = fPApileupCut; |
c2690925 | 310 | target.fIsIPSigmacut = fIsIPSigmacut; |
63bdf450 | 311 | target.fIsIPcharge = fIsIPcharge; |
312 | target.fIsIPOpp = fIsIPOpp; | |
9250ffbf | 313 | target.fFractionOfSharedTPCClusters = fFractionOfSharedTPCClusters; |
314 | target.fMaxImpactParameterRpar = fMaxImpactParameterRpar; | |
11ff28c5 | 315 | target.fAdditionalStatusRequirement = fAdditionalStatusRequirement; |
1c051dd4 | 316 | target.fTOFsignaldx = fTOFsignaldx; |
317 | target.fTOFsignaldz = fTOFsignaldz; | |
96167a04 | 318 | target.fAODFilterBit = fAODFilterBit; |
bbeea05b | 319 | target.fRejectKinkDaughters = fRejectKinkDaughters; |
320 | target.fRejectKinkMothers = fRejectKinkMothers; | |
e3fc062d | 321 | target.fDebugLevel = 0; |
322 | ||
323 | memcpy(target.fProdVtx, fProdVtx, sizeof(Double_t) * 4); | |
bbeea05b | 324 | memcpy(target.fProdVtxZ, fProdVtxZ, sizeof(Double_t) * 2); |
e3fc062d | 325 | memcpy(target.fDCAtoVtx, fDCAtoVtx, sizeof(Double_t) * 2); |
326 | memcpy(target.fPtRange, fPtRange, sizeof(Double_t) *2); | |
c2690925 | 327 | memcpy(target.fIPCutParams, fIPCutParams, sizeof(Float_t) * 4); |
8c1c76e9 | 328 | memcpy(target.fSigmaToVtx, fSigmaToVtx, sizeof(Double_t) * 3); |
cddc311d | 329 | memcpy(target.fEtaRange, fEtaRange, sizeof(Double_t) * 2); |
e3fc062d | 330 | |
331 | // Copy cut List | |
332 | if(target.fCutList){ | |
333 | target.fCutList->Clear(); | |
334 | delete target.fCutList; | |
335 | } | |
336 | if(fCutList){ | |
337 | target.fCutList = dynamic_cast<TObjArray *>(fCutList->Clone()); | |
bf892a6a | 338 | if(target.fCutList) target.fCutList->SetOwner(); // Coverity |
e3fc062d | 339 | } |
340 | if(target.fHistQA){ | |
e3fc062d | 341 | delete target.fHistQA; |
e3fc062d | 342 | } |
343 | if(fHistQA){ | |
344 | // If the QA list was already produced, then we create it new, loop over the cuts and connect all the histos with this list | |
345 | target.fHistQA = new TList; | |
346 | target.fHistQA->SetName(Form("%s_CutQAhistograms", GetName())); | |
c2690925 | 347 | fHistQA->SetOwner(kTRUE); |
e3fc062d | 348 | TIter cit(target.fCutList); |
349 | TObjArray *clist = NULL; | |
350 | AliCFCutBase *co = NULL; | |
351 | while((clist = dynamic_cast<TObjArray *>(cit()))){ | |
352 | TIter cit1(clist); | |
353 | while((co = dynamic_cast<AliCFCutBase *>(cit1()))) co->SetQAOn(target.fHistQA); | |
354 | } | |
355 | } | |
809a4336 | 356 | } |
357 | ||
358 | //__________________________________________________________________ | |
359 | AliHFEcuts::~AliHFEcuts(){ | |
360 | // | |
361 | // Destruktor | |
362 | // | |
363 | if(fCutList){ | |
364 | fCutList->Delete(); | |
365 | delete fCutList; | |
366 | } | |
367 | fCutList = 0x0; | |
c2690925 | 368 | if(fHistQA) delete fHistQA; |
809a4336 | 369 | } |
370 | ||
8c1c76e9 | 371 | //__________________________________________________________________ |
372 | Long64_t AliHFEcuts::Merge(const TCollection *list){ | |
373 | // | |
374 | // Merge function doing nothing, just writing the object to file | |
375 | // | |
376 | if(!list) return 0; | |
377 | if(list->IsEmpty()) return 1; | |
378 | Long64_t counts = 0; | |
379 | // just count the number of objects to merge | |
380 | TIter iter(list); | |
381 | while(iter()){ counts++; } | |
382 | return counts+1; | |
383 | } | |
384 | ||
809a4336 | 385 | //__________________________________________________________________ |
386 | void AliHFEcuts::Initialize(AliCFManager *cfm){ | |
50685501 | 387 | // |
388 | // Initializes the cut objects from the correction framework | |
389 | // Publishes the cuts to the correction framework manager | |
390 | // | |
faee3b18 | 391 | AliDebug(2, "Called"); |
3a72645a | 392 | const Int_t kMCOffset = kNcutStepsMCTrack; |
393 | const Int_t kRecOffset = kNcutStepsRecTrack; | |
e3fc062d | 394 | if(fCutList) |
395 | fCutList->Delete(); | |
396 | else{ | |
397 | fCutList = new TObjArray; | |
398 | fCutList->SetOwner(); | |
399 | } | |
400 | if(IsQAOn()){ | |
401 | fHistQA = new TList; | |
402 | fHistQA->SetName(Form("%s_CutQAhistograms", GetName())); | |
c2690925 | 403 | fHistQA->SetOwner(kTRUE); |
722347d8 | 404 | } |
405 | ||
809a4336 | 406 | // Call all the setters for the cuts |
407 | SetParticleGenCutList(); | |
408 | SetAcceptanceCutList(); | |
722347d8 | 409 | SetRecKineITSTPCCutList(); |
809a4336 | 410 | SetRecPrimaryCutList(); |
dbe3abbe | 411 | SetHFElectronITSCuts(); |
9250ffbf | 412 | SetHFElectronTOFCuts(); |
8c1c76e9 | 413 | SetHFElectronTPCCuts(); |
dbe3abbe | 414 | SetHFElectronTRDCuts(); |
3a72645a | 415 | SetHFElectronDcaCuts(); |
dbe3abbe | 416 | |
9bcfd1ab | 417 | // Publish to the cuts which analysis type they are (ESD Analysis by default) |
418 | if(IsAOD()){ | |
419 | AliInfo("Setting AOD Analysis"); | |
420 | TObjArray *genCuts = dynamic_cast<TObjArray *>(fCutList->FindObject("fPartGenCuts")); | |
421 | if(genCuts){ | |
422 | AliCFParticleGenCuts *myGenCut = dynamic_cast<AliCFParticleGenCuts *>(genCuts->FindObject("fCutsGenMC")); | |
76d0b522 | 423 | if(myGenCut) { |
424 | myGenCut->SetAODMC(kTRUE); | |
425 | } | |
9bcfd1ab | 426 | } |
427 | } | |
428 | ||
0792aa82 | 429 | // Connect the event cuts |
70da6c5a | 430 | SetEventCutList(kEventStepGenerated); |
0792aa82 | 431 | SetEventCutList(kEventStepReconstructed); |
432 | cfm->SetEventCutsList(kEventStepGenerated, dynamic_cast<TObjArray *>(fCutList->FindObject("fEvGenCuts"))); | |
70da6c5a | 433 | cfm->SetEventCutsList(kEventStepReconstructed, dynamic_cast<TObjArray *>(fCutList->FindObject("fEvRecCuts"))); |
809a4336 | 434 | |
0792aa82 | 435 | // Connect the particle cuts |
3a72645a | 436 | // 1st MC |
809a4336 | 437 | cfm->SetParticleCutsList(kStepMCGenerated, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartGenCuts"))); |
438 | cfm->SetParticleCutsList(kStepMCInAcceptance, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartAccCuts"))); | |
3a72645a | 439 | // 2nd Reco |
440 | cfm->SetParticleCutsList(kStepRecKineITSTPC + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartRecKineITSTPCCuts"))); | |
441 | cfm->SetParticleCutsList(kStepRecPrim + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartPrimCuts"))); | |
442 | cfm->SetParticleCutsList(kStepHFEcutsITS + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsITS"))); | |
9250ffbf | 443 | cfm->SetParticleCutsList(kStepHFEcutsTOF+ kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsTOF"))); |
8c1c76e9 | 444 | cfm->SetParticleCutsList(kStepHFEcutsTPC+ kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsTPC"))); |
3a72645a | 445 | cfm->SetParticleCutsList(kStepHFEcutsTRD + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsTRD"))); |
446 | cfm->SetParticleCutsList(kStepHFEcutsDca + kRecOffset + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsDca"))); | |
dbe3abbe | 447 | |
809a4336 | 448 | } |
449 | ||
450 | //__________________________________________________________________ | |
451 | void AliHFEcuts::Initialize(){ | |
452 | // Call all the setters for the cuts | |
faee3b18 | 453 | AliDebug(2, "Called\n"); |
e3fc062d | 454 | if(fCutList) |
455 | fCutList->Delete(); | |
456 | else{ | |
457 | fCutList = new TObjArray; | |
458 | fCutList->SetOwner(); | |
459 | } | |
460 | if(IsQAOn()){ | |
461 | fHistQA = new TList; | |
462 | fHistQA->SetName(Form("%s_CutQAhistograms", GetName())); | |
463 | fHistQA->SetOwner(kFALSE); | |
464 | } | |
809a4336 | 465 | SetParticleGenCutList(); |
466 | SetAcceptanceCutList(); | |
722347d8 | 467 | SetRecKineITSTPCCutList(); |
809a4336 | 468 | SetRecPrimaryCutList(); |
dbe3abbe | 469 | SetHFElectronITSCuts(); |
9250ffbf | 470 | SetHFElectronTOFCuts(); |
8c1c76e9 | 471 | SetHFElectronTPCCuts(); |
63bdf450 | 472 | SetHFElectronTRDCuts(); |
3a72645a | 473 | SetHFElectronDcaCuts(); |
dbe3abbe | 474 | |
76d0b522 | 475 | // Publish to the cuts which analysis type they are (ESD Analysis by default) |
476 | if(IsAOD()){ | |
477 | //printf("Initialize AOD\n"); | |
478 | //AliInfo("Setting AOD Analysis"); | |
479 | TObjArray *genCuts = dynamic_cast<TObjArray *>(fCutList->FindObject("fPartGenCuts")); | |
480 | if(genCuts){ | |
481 | AliCFParticleGenCuts *myGenCut = dynamic_cast<AliCFParticleGenCuts *>(genCuts->FindObject("fCutsGenMC")); | |
482 | if(myGenCut) { | |
483 | myGenCut->SetAODMC(kTRUE); | |
484 | //printf("Set AOD MC\n"); | |
485 | } | |
486 | } | |
487 | } | |
488 | ||
e156c3bb | 489 | // Connect the event cuts |
490 | SetEventCutList(kEventStepGenerated); | |
491 | SetEventCutList(kEventStepReconstructed); | |
492 | ||
493 | ||
809a4336 | 494 | } |
495 | ||
0792aa82 | 496 | //__________________________________________________________________ |
497 | void AliHFEcuts::SetEventCutList(Int_t istep){ | |
498 | // | |
499 | // Cuts for Event Selection | |
500 | // | |
faee3b18 | 501 | AliDebug(2, "Called\n"); |
0792aa82 | 502 | TObjArray *arr = new TObjArray; |
503 | if(istep == kEventStepGenerated){ | |
faee3b18 | 504 | AliCFEventGenCuts *evGenCuts = new AliCFEventGenCuts((Char_t *)"fCutsEvGen", (Char_t *)"Event Generated cuts"); |
3a72645a | 505 | //evGenCuts->SetNTracksCut(1); |
0792aa82 | 506 | evGenCuts->SetRequireVtxCuts(kTRUE); |
3a72645a | 507 | //evGenCuts->SetVertexXCut(-1, 1); |
508 | //evGenCuts->SetVertexYCut(-1, 1); | |
509 | evGenCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ); | |
69ac0e6f | 510 | if(IsQAOn()) evGenCuts->SetQAOn(fHistQA); |
0792aa82 | 511 | |
512 | arr->SetName("fEvGenCuts"); | |
513 | arr->AddLast(evGenCuts); | |
514 | } else { | |
c2690925 | 515 | |
63bdf450 | 516 | AliHFEextraEventCuts *evRecCuts = new AliHFEextraEventCuts((Char_t *)"fCutsEvRec", (Char_t *)"Event Reconstructed cuts"); |
517 | evRecCuts->SetRequireVtxCuts(kTRUE); | |
518 | if(fUseSPDVertex) evRecCuts->SetUseSPDVertex(); | |
519 | if(fUseMixedVertex) evRecCuts->SetUseMixedVertex(); | |
520 | if(fUseCorrelationVertex) evRecCuts->SetCheckCorrelationSPDVtx(); | |
d87a9d29 | 521 | if(fSPDVtxResolution) evRecCuts->SetCheckSPDResolution(); |
4437a0d2 | 522 | if(fPApileupCut) evRecCuts->SetpAPileupCut(); |
63bdf450 | 523 | evRecCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ); |
524 | //evRecCuts->SetVertexNContributors(1,(Int_t)1.e9); | |
525 | if(IsQAOn()) evRecCuts->SetQAOn(fHistQA); | |
526 | arr->SetName("fEvRecCuts"); | |
527 | arr->AddLast(evRecCuts); | |
528 | ||
529 | } | |
0792aa82 | 530 | fCutList->AddLast(arr); |
531 | } | |
532 | ||
809a4336 | 533 | //__________________________________________________________________ |
534 | void AliHFEcuts::SetParticleGenCutList(){ | |
535 | // | |
536 | // Initialize Particle Cuts for Monte Carlo Tracks | |
e156c3bb | 537 | // Production Vertex Radius: < 3cm |
809a4336 | 538 | // Particle Species: Electrons |
1c051dd4 | 539 | // Eta: < 0.8 (fEtaRange) |
809a4336 | 540 | // |
faee3b18 | 541 | |
542 | TObjArray *mcCuts = new TObjArray; | |
543 | mcCuts->SetName("fPartGenCuts"); | |
544 | ||
545 | // | |
546 | AliDebug(2, "Called\n"); | |
809a4336 | 547 | AliCFParticleGenCuts *genCuts = new AliCFParticleGenCuts("fCutsGenMC", "Particle Generation Cuts"); |
548 | genCuts->SetRequireIsCharged(); | |
faee3b18 | 549 | if(IsRequirePrimary()) { |
550 | genCuts->SetRequireIsPrimary(); | |
551 | } | |
809a4336 | 552 | if(IsRequireProdVertex()){ |
bbeea05b | 553 | AliDebug(3, Form("Vertex Range: fProdVtx[0] %f, fProdVtx[1] %f, fProdVtx[2] %f, fProdVtx[3] %f, fProdVtxZ[0] %f, fProdVtx[1] %f", fProdVtx[0], fProdVtx[1], fProdVtx[2], fProdVtx[3], fProdVtxZ[0], fProdVtxZ[1])); |
120f0e47 | 554 | //if(!IsAOD()) { |
555 | genCuts->SetProdVtxRangeX(fProdVtx[0], fProdVtx[1]); | |
556 | genCuts->SetProdVtxRangeY(fProdVtx[2], fProdVtx[3]); | |
bbeea05b | 557 | genCuts->SetProdVtxRangeZ(fProdVtxZ[0], fProdVtx[1]); |
120f0e47 | 558 | genCuts->SetProdVtxRange2D(kTRUE); // Use ellipse |
559 | //} | |
560 | //else { | |
76d0b522 | 561 | // (ONLY PROVISOIRE FOR MC AOD) |
562 | // genCuts->SetProdVtxRangeX(-TMath::Abs(fProdVtx[1]), TMath::Abs(fProdVtx[1])); | |
563 | // genCuts->SetProdVtxRangeY(-TMath::Abs(fProdVtx[3]), TMath::Abs(fProdVtx[3])); | |
120f0e47 | 564 | //} |
809a4336 | 565 | } |
722347d8 | 566 | genCuts->SetRequirePdgCode(11, kTRUE); |
e3fc062d | 567 | if(IsQAOn()) genCuts->SetQAOn(fHistQA); |
809a4336 | 568 | |
faee3b18 | 569 | // Add |
809a4336 | 570 | mcCuts->AddLast(genCuts); |
faee3b18 | 571 | |
572 | // | |
573 | if(IsRequireKineMCCuts()) { | |
574 | AliCFTrackKineCuts *kineMCcuts = new AliCFTrackKineCuts((Char_t *)"fCutsKineMC", (Char_t *)"MC Kine Cuts"); | |
575 | kineMCcuts->SetPtRange(fPtRange[0], fPtRange[1]); | |
1c051dd4 | 576 | //kineMCcuts->SetEtaRange(-0.8, 0.8); |
cddc311d | 577 | kineMCcuts->SetEtaRange(fEtaRange[0],fEtaRange[1]); |
e3fc062d | 578 | if(IsQAOn()) kineMCcuts->SetQAOn(fHistQA); |
faee3b18 | 579 | mcCuts->AddLast(kineMCcuts); |
580 | } | |
581 | ||
809a4336 | 582 | fCutList->AddLast(mcCuts); |
583 | } | |
584 | ||
585 | //__________________________________________________________________ | |
586 | void AliHFEcuts::SetAcceptanceCutList(){ | |
587 | // | |
588 | // Initialize Particle (Monte Carlo) acceptance cuts | |
589 | // Min. Required Hist for Detectors: | |
590 | // ITS [3] | |
591 | // TPC [2] | |
722347d8 | 592 | // TRD [2*nTracklets] |
809a4336 | 593 | // TOF [0] |
594 | // | |
faee3b18 | 595 | AliDebug(2, "Called\n"); |
809a4336 | 596 | AliCFAcceptanceCuts *accCuts = new AliCFAcceptanceCuts("fCutsAccMC", "MC Acceptance Cuts"); |
597 | accCuts->SetMinNHitITS(3); | |
598 | accCuts->SetMinNHitTPC(2); | |
722347d8 | 599 | accCuts->SetMinNHitTRD(2*fMinTrackletsTRD); |
e3fc062d | 600 | if(IsQAOn()) accCuts->SetQAOn(fHistQA); |
809a4336 | 601 | |
75d81601 | 602 | TObjArray *partAccCuts = new TObjArray(); |
603 | partAccCuts->SetName("fPartAccCuts"); | |
604 | partAccCuts->AddLast(accCuts); | |
605 | fCutList->AddLast(partAccCuts); | |
809a4336 | 606 | } |
607 | ||
608 | //__________________________________________________________________ | |
722347d8 | 609 | void AliHFEcuts::SetRecKineITSTPCCutList(){ |
809a4336 | 610 | // |
611 | // Track Kinematics and Quality cuts (Based on the Standard cuts from PWG0) | |
612 | // | |
722347d8 | 613 | // ITS refit |
809a4336 | 614 | // Variances: |
615 | // y: 2 | |
616 | // z: 2 | |
617 | // sin(phi): 0.5 | |
618 | // tan(theta): 0.5 | |
619 | // 1/pt: 2 | |
620 | // Min. Number of Clusters: | |
621 | // TPC: 50 | |
622 | // RefitRequired: | |
809a4336 | 623 | // TPC |
624 | // Chi2 per TPC cluster: 3.5 | |
625 | // | |
626 | // Kinematics: | |
627 | // Momentum Range: 100MeV - 20GeV | |
628 | // Eta: < 0.9 (TRD-TOF acceptance) | |
629 | // | |
11ff28c5 | 630 | const Long_t kStatusSelectionDefault(AliESDtrack::kTPCrefit | AliESDtrack::kITSrefit); |
faee3b18 | 631 | AliDebug(2, "Called\n"); |
632 | AliCFTrackQualityCuts *trackQuality = new AliCFTrackQualityCuts((Char_t *)"fCutsQualityRec", (Char_t *)"REC Track Quality Cuts"); | |
11ff28c5 | 633 | //trackQuality->SetMinNClusterITS(fMinClustersITS); |
809a4336 | 634 | trackQuality->SetMaxChi2PerClusterTPC(fMaxChi2clusterTPC); |
8c1c76e9 | 635 | if(fMaxChi2clusterITS >= 0.) trackQuality->SetMaxChi2PerClusterITS(fMaxChi2clusterITS); |
11ff28c5 | 636 | Long_t statusRequirement; |
637 | if(fAdditionalStatusRequirement) | |
638 | statusRequirement = kStatusSelectionDefault | fAdditionalStatusRequirement; | |
639 | else | |
640 | statusRequirement = kStatusSelectionDefault; | |
641 | trackQuality->SetStatus(statusRequirement); | |
3a72645a | 642 | //trackQuality->SetMaxCovDiagonalElements(2., 2., 0.5, 0.5, 2); |
809a4336 | 643 | |
e17c1f86 | 644 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTPCRec","Extra cuts from the HFE group"); |
722347d8 | 645 | hfecuts->SetDebugLevel(fDebugLevel); |
11ff28c5 | 646 | hfecuts->SetMinNbITScls(fMinClustersITS); |
3a72645a | 647 | // Set the cut in the TPC number of clusters |
76d0b522 | 648 | hfecuts->SetMinNClustersTPC(fMinClustersTPC,AliHFEextraCuts::ETPCclusterDef_t(fTPCclusterDef)); |
e17c1f86 | 649 | hfecuts->SetMinNClustersTPCPID(fMinClustersTPCPID); |
76d0b522 | 650 | hfecuts->SetClusterRatioTPC(fMinClusterRatioTPC,AliHFEextraCuts::ETPCclrDef_t(fTPCratioDef)); |
9250ffbf | 651 | if(fFractionOfSharedTPCClusters > 0.0) hfecuts->SetFractionOfTPCSharedClusters(fFractionOfSharedTPCClusters); |
cedf0381 | 652 | if(fITSpatternCut) hfecuts->SetITSpatternCut(); |
96167a04 | 653 | if(fAODFilterBit > -1) hfecuts->SetAODFilterBit(fAODFilterBit); |
722347d8 | 654 | |
faee3b18 | 655 | AliCFTrackKineCuts *kineCuts = new AliCFTrackKineCuts((Char_t *)"fCutsKineRec", (Char_t *)"REC Kine Cuts"); |
bbeea05b | 656 | //printf("Setting max. pt to %f\n", fPtRange[1]); |
809a4336 | 657 | kineCuts->SetPtRange(fPtRange[0], fPtRange[1]); |
1c051dd4 | 658 | //kineCuts->SetEtaRange(-0.8, 0.8); |
cddc311d | 659 | kineCuts->SetEtaRange(fEtaRange[0],fEtaRange[1]); |
809a4336 | 660 | |
e3fc062d | 661 | if(IsQAOn()){ |
809a4336 | 662 | trackQuality->SetQAOn(fHistQA); |
722347d8 | 663 | hfecuts->SetQAOn(fHistQA); |
809a4336 | 664 | kineCuts->SetQAOn(fHistQA); |
665 | } | |
666 | ||
667 | TObjArray *recCuts = new TObjArray; | |
722347d8 | 668 | recCuts->SetName("fPartRecKineITSTPCCuts"); |
809a4336 | 669 | recCuts->AddLast(trackQuality); |
722347d8 | 670 | recCuts->AddLast(hfecuts); |
809a4336 | 671 | recCuts->AddLast(kineCuts); |
672 | fCutList->AddLast(recCuts); | |
673 | } | |
674 | ||
675 | //__________________________________________________________________ | |
676 | void AliHFEcuts::SetRecPrimaryCutList(){ | |
677 | // | |
678 | // Primary cuts (based on standard cuts from PWG0): | |
679 | // DCA to Vertex: | |
680 | // XY: 3. cm | |
681 | // Z: 10. cm | |
682 | // No Kink daughters | |
683 | // | |
faee3b18 | 684 | AliDebug(2, "Called\n"); |
685 | AliCFTrackIsPrimaryCuts *primaryCut = new AliCFTrackIsPrimaryCuts((Char_t *)"fCutsPrimaryCuts", (Char_t *)"REC Primary Cuts"); | |
6400afdd | 686 | //if(IsRequireDCAToVertex()){ |
78ea5ef4 | 687 | //primaryCut->SetDCAToVertex2D(kTRUE); |
6400afdd | 688 | //primaryCut->SetMaxDCAToVertexXY(fDCAtoVtx[0]); |
689 | //primaryCut->SetMaxDCAToVertexZ(fDCAtoVtx[1]); | |
690 | //} | |
809a4336 | 691 | if(IsRequireSigmaToVertex()){ |
692 | primaryCut->SetRequireSigmaToVertex(kTRUE); | |
8c1c76e9 | 693 | if(fSigmaToVtx[0]) primaryCut->SetMaxNSigmaToVertex(fSigmaToVtx[0]); |
694 | if(fSigmaToVtx[1]) primaryCut->SetMaxSigmaDCAxy(fSigmaToVtx[1]); | |
695 | if(fSigmaToVtx[2]) primaryCut->SetMaxSigmaDCAz(fSigmaToVtx[2]); | |
809a4336 | 696 | } |
6400afdd | 697 | //primaryCut->SetAcceptKinkDaughters(kFALSE); |
e3fc062d | 698 | if(IsQAOn()) primaryCut->SetQAOn(fHistQA); |
809a4336 | 699 | |
9250ffbf | 700 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsPrimaryCutsextra","Extra cuts from the HFE group"); |
701 | hfecuts->SetMaxImpactParameterRpar(fMaxImpactParameterRpar); | |
bbeea05b | 702 | if(fRejectKinkDaughters) hfecuts->SetRejectKinkDaughter(); |
703 | if(fRejectKinkMothers) hfecuts->SetRejectKinkMother(); | |
6400afdd | 704 | if(IsRequireDCAToVertex()){ |
705 | hfecuts->SetMaxImpactParamR(fDCAtoVtx[0]); | |
706 | hfecuts->SetMaxImpactParamZ(fDCAtoVtx[1]); | |
707 | } | |
9250ffbf | 708 | |
809a4336 | 709 | TObjArray *primCuts = new TObjArray; |
710 | primCuts->SetName("fPartPrimCuts"); | |
6400afdd | 711 | // needed for AOD... |
5cd679b7 | 712 | if(IsRequireSigmaToVertex()) primCuts->AddLast(primaryCut); |
11ff28c5 | 713 | //if(fMaxImpactParameterRpar){ |
714 | primCuts->AddLast(hfecuts); | |
715 | //} | |
809a4336 | 716 | fCutList->AddLast(primCuts); |
717 | } | |
718 | ||
719 | //__________________________________________________________________ | |
dbe3abbe | 720 | void AliHFEcuts::SetHFElectronITSCuts(){ |
809a4336 | 721 | // |
dbe3abbe | 722 | // Special Cuts introduced by the HFElectron Group: ITS |
809a4336 | 723 | // |
faee3b18 | 724 | AliDebug(2, "Called\n"); |
dbe3abbe | 725 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupPixels","Extra cuts from the HFE group"); |
809a4336 | 726 | if(IsRequireITSpixel()){ |
727 | hfecuts->SetRequireITSpixel(AliHFEextraCuts::ITSPixel_t(fCutITSPixel)); | |
0792aa82 | 728 | hfecuts->SetCheckITSstatus(fCheckITSLayerStatus); |
809a4336 | 729 | } |
5cd679b7 | 730 | if(IsRequireITSdrift()){ |
731 | hfecuts->SetRequireITSdrift(AliHFEextraCuts::ITSDrift_t(fCutITSDrift)); | |
732 | } | |
dbe3abbe | 733 | |
e3fc062d | 734 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); |
78ea5ef4 | 735 | hfecuts->SetDebugLevel(fDebugLevel); |
736 | ||
dbe3abbe | 737 | TObjArray *hfeCuts = new TObjArray; |
738 | hfeCuts->SetName("fPartHFECutsITS"); | |
739 | hfeCuts->AddLast(hfecuts); | |
740 | fCutList->AddLast(hfeCuts); | |
741 | } | |
742 | ||
dbe3abbe | 743 | //__________________________________________________________________ |
9250ffbf | 744 | void AliHFEcuts::SetHFElectronTOFCuts(){ |
dbe3abbe | 745 | // |
746 | // Special Cuts introduced by the HFElectron Group: TRD | |
747 | // | |
faee3b18 | 748 | AliDebug(2, "Called\n"); |
9250ffbf | 749 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTOF","Extra cuts from the HFE group on TOF PID"); |
e3ae862b | 750 | if(fTOFPIDStep) hfecuts->SetTOFPID(kTRUE); |
c2690925 | 751 | if(fTOFMISMATCHStep) hfecuts->SetTOFMISMATCH(kTRUE); |
1c051dd4 | 752 | if((fTOFsignaldx > 0.0) && (fTOFsignaldz > 0.0)) hfecuts->SetTOFsignalDxz(fTOFsignaldx,fTOFsignaldz); |
e3fc062d | 753 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); |
78ea5ef4 | 754 | hfecuts->SetDebugLevel(fDebugLevel); |
dbe3abbe | 755 | |
9250ffbf | 756 | TObjArray *hfeCuts = new TObjArray; |
757 | hfeCuts->SetName("fPartHFECutsTOF"); | |
758 | hfeCuts->AddLast(hfecuts); | |
759 | fCutList->AddLast(hfeCuts); | |
760 | } | |
761 | ||
8c1c76e9 | 762 | //__________________________________________________________________ |
763 | void AliHFEcuts::SetHFElectronTPCCuts(){ | |
764 | // | |
765 | // Special Cuts introduced by the HFElectron Group: TPC | |
766 | // | |
767 | AliDebug(2, "Called\n"); | |
e17c1f86 | 768 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTPCPID","Extra cuts from the HFE group on TPC PID"); |
8c1c76e9 | 769 | if(fTPCPIDCLEANUPStep) hfecuts->SetTPCPIDCleanUp(kTRUE); |
770 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); | |
771 | hfecuts->SetDebugLevel(fDebugLevel); | |
772 | ||
773 | TObjArray *hfeCuts = new TObjArray; | |
774 | hfeCuts->SetName("fPartHFECutsTPC"); | |
775 | hfeCuts->AddLast(hfecuts); | |
776 | fCutList->AddLast(hfeCuts); | |
777 | } | |
778 | ||
779 | ||
9250ffbf | 780 | //__________________________________________________________________ |
781 | void AliHFEcuts::SetHFElectronTRDCuts(){ | |
782 | // | |
783 | // Special Cuts introduced by the HFElectron Group: TRD | |
784 | // | |
785 | AliDebug(2, "Called\n"); | |
786 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTRD","Extra cuts from the HFE group on TRD PID"); | |
e17c1f86 | 787 | if(fMinTrackletsTRD > 0.) hfecuts->SetMinTrackletsTRD(fMinTrackletsTRD, fTRDtrackletsExact); |
cedf0381 | 788 | if(fMaxChi2TRD >= 0) |
789 | hfecuts->SetMaxChi2TRD(fMaxChi2TRD); | |
790 | ||
9250ffbf | 791 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); |
792 | hfecuts->SetDebugLevel(fDebugLevel); | |
793 | ||
dbe3abbe | 794 | TObjArray *hfeCuts = new TObjArray; |
795 | hfeCuts->SetName("fPartHFECutsTRD"); | |
809a4336 | 796 | hfeCuts->AddLast(hfecuts); |
797 | fCutList->AddLast(hfeCuts); | |
798 | } | |
799 | ||
809a4336 | 800 | //__________________________________________________________________ |
3a72645a | 801 | void AliHFEcuts::SetHFElectronDcaCuts(){ |
802 | // | |
803 | // Special Cuts introduced by the HFElectron Group: minimum of impact parameter | |
804 | // | |
805 | AliDebug(2, "Called\n"); | |
806 | AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupDCA","Extra cuts from the HFE group"); | |
63bdf450 | 807 | hfecuts->SetMinHFEImpactParamR(fIPCutParams,fIsIPSigmacut,fIsIPcharge,fIsIPOpp); |
3a72645a | 808 | if(IsQAOn()) hfecuts->SetQAOn(fHistQA); |
809 | hfecuts->SetDebugLevel(fDebugLevel); | |
810 | ||
811 | TObjArray *hfeCuts = new TObjArray; | |
812 | hfeCuts->SetName("fPartHFECutsDca"); | |
813 | hfeCuts->AddLast(hfecuts); | |
814 | fCutList->AddLast(hfeCuts); | |
815 | } | |
816 | ||
817 | //__________________________________________________________________ | |
818 | Bool_t AliHFEcuts::CheckParticleCuts(UInt_t step, TObject *o){ | |
809a4336 | 819 | // |
820 | // Checks the cuts without using the correction framework manager | |
821 | // | |
faee3b18 | 822 | AliDebug(2, "Called\n"); |
8c1c76e9 | 823 | TString stepnames[kNcutStepsMCTrack + kNcutStepsRecTrack + kNcutStepsDETrack + kNcutStepsSecvtxTrack + 1] = {"fPartGenCuts","fPartEvCutPileupZ","fPartEvCut","fPartAccCuts","fPartRecNoCuts","fPartRecKineITSTPCCuts", "fPartPrimCuts", "fPartHFECutsITS","fPartHFECutsTOF","fPartHFECutsTPC","fPartHFECutsTRD","fPartHFECutsDca", "fPartHFECutsSecvtx"}; |
3a72645a | 824 | AliDebug(2, Form("Doing cut %s", stepnames[step].Data())); |
e3fc062d | 825 | TObjArray *cuts = dynamic_cast<TObjArray *>(fCutList->FindObject(stepnames[step].Data())); |
809a4336 | 826 | if(!cuts) return kTRUE; |
3a72645a | 827 | TIter it(cuts); |
809a4336 | 828 | AliCFCutBase *mycut; |
829 | Bool_t status = kTRUE; | |
3a72645a | 830 | while((mycut = dynamic_cast<AliCFCutBase *>(it()))){ |
809a4336 | 831 | status &= mycut->IsSelected(o); |
832 | } | |
809a4336 | 833 | return status; |
834 | } | |
e156c3bb | 835 | |
836 | ||
837 | //__________________________________________________________________ | |
838 | Bool_t AliHFEcuts::CheckEventCuts(const char*namestep, TObject *o){ | |
839 | // | |
840 | // Checks the cuts without using the correction framework manager | |
841 | // | |
842 | AliDebug(2, "Called\n"); | |
843 | TObjArray *cuts = dynamic_cast<TObjArray *>(fCutList->FindObject(namestep)); | |
844 | if(!cuts) return kTRUE; | |
845 | TIter it(cuts); | |
846 | AliCFCutBase *mycut; | |
847 | Bool_t status = kTRUE; | |
848 | while((mycut = dynamic_cast<AliCFCutBase *>(it()))){ | |
849 | status &= mycut->IsSelected(o); | |
850 | } | |
851 | return status; | |
852 | } | |
e17c1f86 | 853 | |
854 | //__________________________________________________________________ | |
855 | void AliHFEcuts::SetRecEvent(const AliVEvent *ev){ | |
856 | // | |
857 | // Publish reconstructed event to the cuts | |
858 | // | |
859 | TIter cutsteps(fCutList); | |
860 | TObjArray *cutstep; | |
861 | AliCFCutBase *cut; | |
862 | while((cutstep = dynamic_cast<TObjArray *>(cutsteps()))){ | |
863 | TIter cutIter(cutstep); | |
864 | while((cut = dynamic_cast<AliCFCutBase *>(cutIter()))){ | |
865 | cut->SetRecEventInfo(ev); | |
866 | } | |
867 | } | |
868 | } | |
869 | ||
870 | //__________________________________________________________________ | |
76d0b522 | 871 | void AliHFEcuts::SetMCEvent(const AliVEvent *ev){ |
e17c1f86 | 872 | // |
873 | // Publish reconstructed event to the cuts | |
874 | // | |
875 | TIter cutsteps(fCutList); | |
876 | TObjArray *cutstep; | |
877 | AliCFCutBase *cut; | |
878 | while((cutstep = dynamic_cast<TObjArray *>(cutsteps()))){ | |
879 | TIter cutIter(cutstep); | |
880 | while((cut = dynamic_cast<AliCFCutBase *>(cutIter()))){ | |
881 | cut->SetMCEventInfo(ev); | |
882 | } | |
883 | } | |
884 | } |