]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/hfe/AliHFEcuts.cxx
Updates + addition of EMCal
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEcuts.cxx
CommitLineData
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"
61#include "AliCFEventRecCuts.h"
809a4336 62#include "AliCFManager.h"
63#include "AliCFParticleGenCuts.h"
64#include "AliCFTrackIsPrimaryCuts.h"
65#include "AliCFTrackKineCuts.h"
66#include "AliCFTrackQualityCuts.h"
67#include "AliESDtrack.h"
c2690925 68#include "AliHFEextraEventCuts.h"
809a4336 69
70#include "AliHFEcuts.h"
71
72ClassImp(AliHFEcuts)
73
3a72645a 74const Char_t *AliHFEcuts::fgkMCCutName[AliHFEcuts::kNcutStepsMCTrack] = {
75 "MCGenerated",
c2690925 76 "MCGeneratedZOutNoPileUpCentralityFine",
3a72645a 77 "MCGeneratedEventCut",
78 "MCInAcceptance"
79};
80
81const Char_t * AliHFEcuts::fgkRecoCutName[AliHFEcuts::kNcutStepsRecTrack] = {
82 "NoCuts",
83 "RecKineITSTPC",
84 "Primary",
85 "HFEITS",
86 "HFETRD"
87};
88
89const Char_t * AliHFEcuts::fgkDECutName[AliHFEcuts::kNcutStepsDETrack] = {
90 "HFEDCA"
91};
92
c2690925 93const Char_t * AliHFEcuts::fgkSecvtxCutName[AliHFEcuts::kNcutStepsSecvtxTrack] = {
94 "HFESecvtx"
95};
96
3a72645a 97const Char_t * AliHFEcuts::fgkEventCutName[AliHFEcuts::kNcutStepsEvent] = {
98 "EventStepGenerated",
99 "EventStepRecNoCut",
100 "EventStepRecNoPileUp",
101 "EventStepZRange",
102 "EventStepReconstructed"
103};
104
105const Char_t * AliHFEcuts::fgkUndefined = "Undefined";
106
809a4336 107//__________________________________________________________________
108AliHFEcuts::AliHFEcuts():
e3fc062d 109 TNamed(),
110 fRequirements(0),
e3ae862b 111 fTPCclusterDef(AliHFEextraCuts::kFound),
112 fTPCratioDef(AliHFEextraCuts::kFoundOverFindable),
e3fc062d 113 fMinClustersTPC(0),
3a72645a 114 fMinClustersITS(0),
e3fc062d 115 fMinTrackletsTRD(0),
116 fCutITSPixel(0),
117 fCheckITSLayerStatus(kTRUE),
118 fMaxChi2clusterTPC(0.),
119 fMinClusterRatioTPC(0.),
120 fSigmaToVtx(0.),
3a72645a 121 fVertexRangeZ(20.),
e3ae862b 122 fTOFPIDStep(kFALSE),
c2690925 123 fTOFMISMATCHStep(kFALSE),
124 fUseMixedVertex(kTRUE),
125 fIsIPSigmacut(kFALSE),
e3fc062d 126 fHistQA(0x0),
127 fCutList(0x0),
128 fDebugLevel(0)
129{
130 //
131 // Dummy Constructor
132 //
133}
134
135//__________________________________________________________________
136AliHFEcuts::AliHFEcuts(const Char_t *name, const Char_t *title):
137 TNamed(name, title),
809a4336 138 fRequirements(0),
e3ae862b 139 fTPCclusterDef(AliHFEextraCuts::kFound),
140 fTPCratioDef(AliHFEextraCuts::kFoundOverFindable),
809a4336 141 fMinClustersTPC(0),
3a72645a 142 fMinClustersITS(0),
809a4336 143 fMinTrackletsTRD(0),
144 fCutITSPixel(0),
0792aa82 145 fCheckITSLayerStatus(kTRUE),
809a4336 146 fMaxChi2clusterTPC(0.),
147 fMinClusterRatioTPC(0.),
148 fSigmaToVtx(0.),
3a72645a 149 fVertexRangeZ(20.),
e3ae862b 150 fTOFPIDStep(kFALSE),
c2690925 151 fTOFMISMATCHStep(kFALSE),
152 fUseMixedVertex(kTRUE),
153 fIsIPSigmacut(kFALSE),
809a4336 154 fHistQA(0x0),
dbe3abbe 155 fCutList(0x0),
156 fDebugLevel(0)
809a4336 157{
158 //
159 // Default Constructor
160 //
161 memset(fProdVtx, 0, sizeof(Double_t) * 4);
162 memset(fDCAtoVtx, 0, sizeof(Double_t) * 2);
163 memset(fPtRange, 0, sizeof(Double_t) * 2);
c2690925 164 memset(fIPCutParams, 0, sizeof(Float_t) * 4);
809a4336 165}
166
167//__________________________________________________________________
168AliHFEcuts::AliHFEcuts(const AliHFEcuts &c):
e3fc062d 169 TNamed(c),
809a4336 170 fRequirements(c.fRequirements),
e3ae862b 171 fTPCclusterDef(c.fTPCclusterDef),
172 fTPCratioDef(c.fTPCratioDef),
e3fc062d 173 fMinClustersTPC(0),
3a72645a 174 fMinClustersITS(0),
e3fc062d 175 fMinTrackletsTRD(0),
176 fCutITSPixel(0),
177 fCheckITSLayerStatus(0),
178 fMaxChi2clusterTPC(0),
179 fMinClusterRatioTPC(0),
180 fSigmaToVtx(0),
3a72645a 181 fVertexRangeZ(20.),
e3ae862b 182 fTOFPIDStep(kFALSE),
c2690925 183 fTOFMISMATCHStep(kFALSE),
184 fUseMixedVertex(kTRUE),
185 fIsIPSigmacut(kFALSE),
809a4336 186 fHistQA(0x0),
dbe3abbe 187 fCutList(0x0),
188 fDebugLevel(0)
809a4336 189{
190 //
191 // Copy Constructor
192 //
e3fc062d 193 c.Copy(*this);
194}
195
196//__________________________________________________________________
197AliHFEcuts &AliHFEcuts::operator=(const AliHFEcuts &c){
198 //
199 // Make assignment
200 //
201 if(&c != this) c.Copy(*this);
202 return *this;
203}
204
205//__________________________________________________________________
206void AliHFEcuts::Copy(TObject &c) const {
207 //
208 // Performing copy
209 //
210 AliHFEcuts &target = dynamic_cast<AliHFEcuts &>(c);
211
212 target.fRequirements = fRequirements;
e3ae862b 213 target.fTPCclusterDef = fTPCclusterDef;
214 target.fTPCratioDef = fTPCratioDef;
e3fc062d 215 target.fMinClustersTPC = fMinClustersTPC;
3a72645a 216 target.fMinClustersITS = fMinClustersITS;
e3fc062d 217 target.fMinTrackletsTRD = fMinTrackletsTRD;
218 target.fCutITSPixel = fCutITSPixel;
219 target.fCheckITSLayerStatus = fCheckITSLayerStatus;
220 target.fMaxChi2clusterTPC = fMaxChi2clusterTPC;
221 target.fMinClusterRatioTPC = fMinClusterRatioTPC;
222 target.fSigmaToVtx = fSigmaToVtx;
3a72645a 223 target.fVertexRangeZ = fVertexRangeZ;
e3ae862b 224 target.fTOFPIDStep = fTOFPIDStep;
c2690925 225 target.fTOFMISMATCHStep = fTOFMISMATCHStep;
226 target.fUseMixedVertex = fUseMixedVertex;
227 target.fIsIPSigmacut = fIsIPSigmacut;
e3fc062d 228 target.fDebugLevel = 0;
229
230 memcpy(target.fProdVtx, fProdVtx, sizeof(Double_t) * 4);
231 memcpy(target.fDCAtoVtx, fDCAtoVtx, sizeof(Double_t) * 2);
232 memcpy(target.fPtRange, fPtRange, sizeof(Double_t) *2);
c2690925 233 memcpy(target.fIPCutParams, fIPCutParams, sizeof(Float_t) * 4);
e3fc062d 234
235 // Copy cut List
236 if(target.fCutList){
237 target.fCutList->Clear();
238 delete target.fCutList;
239 }
240 if(fCutList){
241 target.fCutList = dynamic_cast<TObjArray *>(fCutList->Clone());
bf892a6a 242 if(target.fCutList) target.fCutList->SetOwner(); // Coverity
e3fc062d 243 }
244 if(target.fHistQA){
e3fc062d 245 delete target.fHistQA;
e3fc062d 246 }
247 if(fHistQA){
248 // If the QA list was already produced, then we create it new, loop over the cuts and connect all the histos with this list
249 target.fHistQA = new TList;
250 target.fHistQA->SetName(Form("%s_CutQAhistograms", GetName()));
c2690925 251 fHistQA->SetOwner(kTRUE);
e3fc062d 252 TIter cit(target.fCutList);
253 TObjArray *clist = NULL;
254 AliCFCutBase *co = NULL;
255 while((clist = dynamic_cast<TObjArray *>(cit()))){
256 TIter cit1(clist);
257 while((co = dynamic_cast<AliCFCutBase *>(cit1()))) co->SetQAOn(target.fHistQA);
258 }
259 }
809a4336 260}
261
262//__________________________________________________________________
263AliHFEcuts::~AliHFEcuts(){
264 //
265 // Destruktor
266 //
267 if(fCutList){
268 fCutList->Delete();
269 delete fCutList;
270 }
271 fCutList = 0x0;
c2690925 272 if(fHistQA) delete fHistQA;
809a4336 273}
274
275//__________________________________________________________________
276void AliHFEcuts::Initialize(AliCFManager *cfm){
50685501 277 //
278 // Initializes the cut objects from the correction framework
279 // Publishes the cuts to the correction framework manager
280 //
faee3b18 281 AliDebug(2, "Called");
3a72645a 282 const Int_t kMCOffset = kNcutStepsMCTrack;
283 const Int_t kRecOffset = kNcutStepsRecTrack;
e3fc062d 284 if(fCutList)
285 fCutList->Delete();
286 else{
287 fCutList = new TObjArray;
288 fCutList->SetOwner();
289 }
290 if(IsQAOn()){
291 fHistQA = new TList;
292 fHistQA->SetName(Form("%s_CutQAhistograms", GetName()));
c2690925 293 fHistQA->SetOwner(kTRUE);
722347d8 294 }
295
809a4336 296 // Call all the setters for the cuts
297 SetParticleGenCutList();
298 SetAcceptanceCutList();
722347d8 299 SetRecKineITSTPCCutList();
809a4336 300 SetRecPrimaryCutList();
dbe3abbe 301 SetHFElectronITSCuts();
dbe3abbe 302 SetHFElectronTRDCuts();
3a72645a 303 SetHFElectronDcaCuts();
dbe3abbe 304
9bcfd1ab 305 // Publish to the cuts which analysis type they are (ESD Analysis by default)
306 if(IsAOD()){
307 AliInfo("Setting AOD Analysis");
308 TObjArray *genCuts = dynamic_cast<TObjArray *>(fCutList->FindObject("fPartGenCuts"));
309 if(genCuts){
310 AliCFParticleGenCuts *myGenCut = dynamic_cast<AliCFParticleGenCuts *>(genCuts->FindObject("fCutsGenMC"));
311 if(myGenCut) myGenCut->SetAODMC(kTRUE);
312 }
313 }
314
0792aa82 315 // Connect the event cuts
70da6c5a 316 SetEventCutList(kEventStepGenerated);
0792aa82 317 SetEventCutList(kEventStepReconstructed);
318 cfm->SetEventCutsList(kEventStepGenerated, dynamic_cast<TObjArray *>(fCutList->FindObject("fEvGenCuts")));
70da6c5a 319 cfm->SetEventCutsList(kEventStepReconstructed, dynamic_cast<TObjArray *>(fCutList->FindObject("fEvRecCuts")));
809a4336 320
0792aa82 321 // Connect the particle cuts
3a72645a 322 // 1st MC
809a4336 323 cfm->SetParticleCutsList(kStepMCGenerated, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartGenCuts")));
324 cfm->SetParticleCutsList(kStepMCInAcceptance, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartAccCuts")));
3a72645a 325 // 2nd Reco
326 cfm->SetParticleCutsList(kStepRecKineITSTPC + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartRecKineITSTPCCuts")));
327 cfm->SetParticleCutsList(kStepRecPrim + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartPrimCuts")));
328 cfm->SetParticleCutsList(kStepHFEcutsITS + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsITS")));
329 cfm->SetParticleCutsList(kStepHFEcutsTRD + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsTRD")));
330 cfm->SetParticleCutsList(kStepHFEcutsDca + kRecOffset + kMCOffset, dynamic_cast<TObjArray *>(fCutList->FindObject("fPartHFECutsDca")));
dbe3abbe 331
809a4336 332}
333
334//__________________________________________________________________
335void AliHFEcuts::Initialize(){
336 // Call all the setters for the cuts
faee3b18 337 AliDebug(2, "Called\n");
e3fc062d 338 if(fCutList)
339 fCutList->Delete();
340 else{
341 fCutList = new TObjArray;
342 fCutList->SetOwner();
343 }
344 if(IsQAOn()){
345 fHistQA = new TList;
346 fHistQA->SetName(Form("%s_CutQAhistograms", GetName()));
347 fHistQA->SetOwner(kFALSE);
348 }
809a4336 349 SetParticleGenCutList();
350 SetAcceptanceCutList();
722347d8 351 SetRecKineITSTPCCutList();
809a4336 352 SetRecPrimaryCutList();
dbe3abbe 353 SetHFElectronITSCuts();
dbe3abbe 354 SetHFElectronTRDCuts();
3a72645a 355 SetHFElectronDcaCuts();
dbe3abbe 356
809a4336 357}
358
0792aa82 359//__________________________________________________________________
360void AliHFEcuts::SetEventCutList(Int_t istep){
361 //
362 // Cuts for Event Selection
363 //
faee3b18 364 AliDebug(2, "Called\n");
0792aa82 365 TObjArray *arr = new TObjArray;
366 if(istep == kEventStepGenerated){
faee3b18 367 AliCFEventGenCuts *evGenCuts = new AliCFEventGenCuts((Char_t *)"fCutsEvGen", (Char_t *)"Event Generated cuts");
3a72645a 368 //evGenCuts->SetNTracksCut(1);
0792aa82 369 evGenCuts->SetRequireVtxCuts(kTRUE);
3a72645a 370 //evGenCuts->SetVertexXCut(-1, 1);
371 //evGenCuts->SetVertexYCut(-1, 1);
372 evGenCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ);
69ac0e6f 373 if(IsQAOn()) evGenCuts->SetQAOn(fHistQA);
0792aa82 374
375 arr->SetName("fEvGenCuts");
376 arr->AddLast(evGenCuts);
377 } else {
c2690925 378
379 if(!fUseMixedVertex) {
380 AliCFEventRecCuts *evRecCuts = new AliCFEventRecCuts((Char_t *)"fCutsEvRec", (Char_t *)"Event Reconstructed cuts");
381 //evRecCuts->SetNTracksCut(1);
382 evRecCuts->SetRequireVtxCuts(kTRUE);
383 //evRecCuts->SetVertexXCut(-1, 1);
384 //evRecCuts->SetVertexYCut(-1, 1);
385 //evRecCuts->SetVertexZCut(-30, 30);
386 evRecCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ);
387 evRecCuts->SetVertexNContributors(1,(Int_t)1.e9);
388 if(IsQAOn()) evRecCuts->SetQAOn(fHistQA);
389 arr->SetName("fEvRecCuts");
390 arr->AddLast(evRecCuts);
391 } else {
392 AliHFEextraEventCuts *evRecCuts = new AliHFEextraEventCuts((Char_t *)"fCutsEvRec", (Char_t *)"Event Reconstructed cuts");
393 evRecCuts->SetRequireVtxCuts(kTRUE);
394 evRecCuts->SetUseMixedVertex();
395 evRecCuts->SetVertexZCut(-fVertexRangeZ, fVertexRangeZ);
396 //evRecCuts->SetVertexNContributors(1,(Int_t)1.e9);
397 if(IsQAOn()) evRecCuts->SetQAOn(fHistQA);
398 arr->SetName("fEvRecCuts");
399 arr->AddLast(evRecCuts);
400 }
0792aa82 401 }
402 fCutList->AddLast(arr);
403}
404
809a4336 405//__________________________________________________________________
406void AliHFEcuts::SetParticleGenCutList(){
407 //
408 // Initialize Particle Cuts for Monte Carlo Tracks
409 // Production Vertex: < 1cm (Beampipe)
410 // Particle Species: Electrons
411 // Eta: < 0.9 (TRD-TOF acceptance)
412 //
faee3b18 413
414 TObjArray *mcCuts = new TObjArray;
415 mcCuts->SetName("fPartGenCuts");
416
417 //
418 AliDebug(2, "Called\n");
809a4336 419 AliCFParticleGenCuts *genCuts = new AliCFParticleGenCuts("fCutsGenMC", "Particle Generation Cuts");
420 genCuts->SetRequireIsCharged();
faee3b18 421 if(IsRequirePrimary()) {
422 genCuts->SetRequireIsPrimary();
423 }
809a4336 424 if(IsRequireProdVertex()){
faee3b18 425 AliDebug(3, Form("Vertex Range: fProdVtx[0] %f, fProdVtx[1] %f, fProdVtx[2] %f, fProdVtx[3] %f", fProdVtx[0], fProdVtx[1], fProdVtx[2], fProdVtx[3]));
809a4336 426 genCuts->SetProdVtxRangeX(fProdVtx[0], fProdVtx[1]);
427 genCuts->SetProdVtxRangeY(fProdVtx[2], fProdVtx[3]);
70da6c5a 428 genCuts->SetProdVtxRange2D(kTRUE); // Use ellipse
809a4336 429 }
722347d8 430 genCuts->SetRequirePdgCode(11, kTRUE);
e3fc062d 431 if(IsQAOn()) genCuts->SetQAOn(fHistQA);
809a4336 432
faee3b18 433 // Add
809a4336 434 mcCuts->AddLast(genCuts);
faee3b18 435
436 //
437 if(IsRequireKineMCCuts()) {
438 AliCFTrackKineCuts *kineMCcuts = new AliCFTrackKineCuts((Char_t *)"fCutsKineMC", (Char_t *)"MC Kine Cuts");
439 kineMCcuts->SetPtRange(fPtRange[0], fPtRange[1]);
440 kineMCcuts->SetEtaRange(-0.8, 0.8);
e3fc062d 441 if(IsQAOn()) kineMCcuts->SetQAOn(fHistQA);
faee3b18 442 mcCuts->AddLast(kineMCcuts);
443 }
444
809a4336 445 fCutList->AddLast(mcCuts);
446}
447
448//__________________________________________________________________
449void AliHFEcuts::SetAcceptanceCutList(){
450 //
451 // Initialize Particle (Monte Carlo) acceptance cuts
452 // Min. Required Hist for Detectors:
453 // ITS [3]
454 // TPC [2]
722347d8 455 // TRD [2*nTracklets]
809a4336 456 // TOF [0]
457 //
faee3b18 458 AliDebug(2, "Called\n");
809a4336 459 AliCFAcceptanceCuts *accCuts = new AliCFAcceptanceCuts("fCutsAccMC", "MC Acceptance Cuts");
460 accCuts->SetMinNHitITS(3);
461 accCuts->SetMinNHitTPC(2);
722347d8 462 accCuts->SetMinNHitTRD(2*fMinTrackletsTRD);
e3fc062d 463 if(IsQAOn()) accCuts->SetQAOn(fHistQA);
809a4336 464
75d81601 465 TObjArray *partAccCuts = new TObjArray();
466 partAccCuts->SetName("fPartAccCuts");
467 partAccCuts->AddLast(accCuts);
468 fCutList->AddLast(partAccCuts);
809a4336 469}
470
471//__________________________________________________________________
722347d8 472void AliHFEcuts::SetRecKineITSTPCCutList(){
809a4336 473 //
474 // Track Kinematics and Quality cuts (Based on the Standard cuts from PWG0)
475 //
722347d8 476 // ITS refit
809a4336 477 // Variances:
478 // y: 2
479 // z: 2
480 // sin(phi): 0.5
481 // tan(theta): 0.5
482 // 1/pt: 2
483 // Min. Number of Clusters:
484 // TPC: 50
485 // RefitRequired:
809a4336 486 // TPC
487 // Chi2 per TPC cluster: 3.5
488 //
489 // Kinematics:
490 // Momentum Range: 100MeV - 20GeV
491 // Eta: < 0.9 (TRD-TOF acceptance)
492 //
faee3b18 493 AliDebug(2, "Called\n");
494 AliCFTrackQualityCuts *trackQuality = new AliCFTrackQualityCuts((Char_t *)"fCutsQualityRec", (Char_t *)"REC Track Quality Cuts");
3a72645a 495 trackQuality->SetMinNClusterITS(fMinClustersITS);
809a4336 496 trackQuality->SetMaxChi2PerClusterTPC(fMaxChi2clusterTPC);
722347d8 497 trackQuality->SetStatus(AliESDtrack::kTPCrefit | AliESDtrack::kITSrefit);
3a72645a 498 //trackQuality->SetMaxCovDiagonalElements(2., 2., 0.5, 0.5, 2);
809a4336 499
722347d8 500 AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTPC","Extra cuts from the HFE group");
722347d8 501 hfecuts->SetDebugLevel(fDebugLevel);
3a72645a 502
503 // Set the cut in the TPC number of clusters
e3ae862b 504 hfecuts->SetMinNClustersTPC(fMinClustersTPC, fTPCclusterDef);
505 hfecuts->SetClusterRatioTPC(fMinClusterRatioTPC, fTPCratioDef);
722347d8 506
faee3b18 507 AliCFTrackKineCuts *kineCuts = new AliCFTrackKineCuts((Char_t *)"fCutsKineRec", (Char_t *)"REC Kine Cuts");
809a4336 508 kineCuts->SetPtRange(fPtRange[0], fPtRange[1]);
70da6c5a 509 kineCuts->SetEtaRange(-0.8, 0.8);
809a4336 510
e3fc062d 511 if(IsQAOn()){
809a4336 512 trackQuality->SetQAOn(fHistQA);
722347d8 513 hfecuts->SetQAOn(fHistQA);
809a4336 514 kineCuts->SetQAOn(fHistQA);
515 }
516
517 TObjArray *recCuts = new TObjArray;
722347d8 518 recCuts->SetName("fPartRecKineITSTPCCuts");
809a4336 519 recCuts->AddLast(trackQuality);
722347d8 520 recCuts->AddLast(hfecuts);
809a4336 521 recCuts->AddLast(kineCuts);
522 fCutList->AddLast(recCuts);
523}
524
525//__________________________________________________________________
526void AliHFEcuts::SetRecPrimaryCutList(){
527 //
528 // Primary cuts (based on standard cuts from PWG0):
529 // DCA to Vertex:
530 // XY: 3. cm
531 // Z: 10. cm
532 // No Kink daughters
533 //
faee3b18 534 AliDebug(2, "Called\n");
535 AliCFTrackIsPrimaryCuts *primaryCut = new AliCFTrackIsPrimaryCuts((Char_t *)"fCutsPrimaryCuts", (Char_t *)"REC Primary Cuts");
809a4336 536 if(IsRequireDCAToVertex()){
78ea5ef4 537 //primaryCut->SetDCAToVertex2D(kTRUE);
809a4336 538 primaryCut->SetMaxDCAToVertexXY(fDCAtoVtx[0]);
539 primaryCut->SetMaxDCAToVertexZ(fDCAtoVtx[1]);
540 }
541 if(IsRequireSigmaToVertex()){
542 primaryCut->SetRequireSigmaToVertex(kTRUE);
543 primaryCut->SetMaxNSigmaToVertex(fSigmaToVtx);
544 }
545 primaryCut->SetAcceptKinkDaughters(kFALSE);
e3fc062d 546 if(IsQAOn()) primaryCut->SetQAOn(fHistQA);
809a4336 547
548 TObjArray *primCuts = new TObjArray;
549 primCuts->SetName("fPartPrimCuts");
550 primCuts->AddLast(primaryCut);
551 fCutList->AddLast(primCuts);
552}
553
554//__________________________________________________________________
dbe3abbe 555void AliHFEcuts::SetHFElectronITSCuts(){
809a4336 556 //
dbe3abbe 557 // Special Cuts introduced by the HFElectron Group: ITS
809a4336 558 //
faee3b18 559 AliDebug(2, "Called\n");
dbe3abbe 560 AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupPixels","Extra cuts from the HFE group");
809a4336 561 if(IsRequireITSpixel()){
562 hfecuts->SetRequireITSpixel(AliHFEextraCuts::ITSPixel_t(fCutITSPixel));
0792aa82 563 hfecuts->SetCheckITSstatus(fCheckITSLayerStatus);
809a4336 564 }
dbe3abbe 565
e3fc062d 566 if(IsQAOn()) hfecuts->SetQAOn(fHistQA);
78ea5ef4 567 hfecuts->SetDebugLevel(fDebugLevel);
568
dbe3abbe 569 TObjArray *hfeCuts = new TObjArray;
570 hfeCuts->SetName("fPartHFECutsITS");
571 hfeCuts->AddLast(hfecuts);
572 fCutList->AddLast(hfeCuts);
573}
574
dbe3abbe 575//__________________________________________________________________
576void AliHFEcuts::SetHFElectronTRDCuts(){
577 //
578 // Special Cuts introduced by the HFElectron Group: TRD
579 //
faee3b18 580 AliDebug(2, "Called\n");
dbe3abbe 581 AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupTRD","Extra cuts from the HFE group");
582 if(fMinTrackletsTRD > 0.) hfecuts->SetMinTrackletsTRD(fMinTrackletsTRD);
e3ae862b 583 if(fTOFPIDStep) hfecuts->SetTOFPID(kTRUE);
c2690925 584 if(fTOFMISMATCHStep) hfecuts->SetTOFMISMATCH(kTRUE);
e3fc062d 585 if(IsQAOn()) hfecuts->SetQAOn(fHistQA);
78ea5ef4 586 hfecuts->SetDebugLevel(fDebugLevel);
dbe3abbe 587
588 TObjArray *hfeCuts = new TObjArray;
589 hfeCuts->SetName("fPartHFECutsTRD");
809a4336 590 hfeCuts->AddLast(hfecuts);
591 fCutList->AddLast(hfeCuts);
592}
593
809a4336 594//__________________________________________________________________
3a72645a 595void AliHFEcuts::SetHFElectronDcaCuts(){
596 //
597 // Special Cuts introduced by the HFElectron Group: minimum of impact parameter
598 //
599 AliDebug(2, "Called\n");
600 AliHFEextraCuts *hfecuts = new AliHFEextraCuts("fCutsHFElectronGroupDCA","Extra cuts from the HFE group");
c2690925 601 hfecuts->SetMinHFEImpactParamR(fIPCutParams,fIsIPSigmacut);
3a72645a 602 if(IsQAOn()) hfecuts->SetQAOn(fHistQA);
603 hfecuts->SetDebugLevel(fDebugLevel);
604
605 TObjArray *hfeCuts = new TObjArray;
606 hfeCuts->SetName("fPartHFECutsDca");
607 hfeCuts->AddLast(hfecuts);
608 fCutList->AddLast(hfeCuts);
609}
610
611//__________________________________________________________________
612Bool_t AliHFEcuts::CheckParticleCuts(UInt_t step, TObject *o){
809a4336 613 //
614 // Checks the cuts without using the correction framework manager
615 //
faee3b18 616 AliDebug(2, "Called\n");
c2690925 617 TString stepnames[kNcutStepsMCTrack + kNcutStepsRecTrack + kNcutStepsDETrack + kNcutStepsSecvtxTrack + 1] = {"fPartGenCuts","fPartEvCutPileupZ","fPartEvCut","fPartAccCuts","fPartRecNoCuts","fPartRecKineITSTPCCuts", "fPartPrimCuts", "fPartHFECutsITS","fPartHFECutsTRD","fPartHFECutsDca", "fPartHFECutsSecvtx"};
3a72645a 618 AliDebug(2, Form("Doing cut %s", stepnames[step].Data()));
e3fc062d 619 TObjArray *cuts = dynamic_cast<TObjArray *>(fCutList->FindObject(stepnames[step].Data()));
809a4336 620 if(!cuts) return kTRUE;
3a72645a 621 TIter it(cuts);
809a4336 622 AliCFCutBase *mycut;
623 Bool_t status = kTRUE;
3a72645a 624 while((mycut = dynamic_cast<AliCFCutBase *>(it()))){
809a4336 625 status &= mycut->IsSelected(o);
626 }
809a4336 627 return status;
628}