AliPhysics  608b256 (608b256)
AliRDHFCuts.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2010, 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  **************************************************************************/
15 
16 /* $Id$ */
17 
19 //
20 // Base class for cuts on AOD reconstructed heavy-flavour decay
21 //
22 // Author: A.Dainese, andrea.dainese@pd.infn.it
24 #include <Riostream.h>
25 
26 #include "AliVEvent.h"
27 #include "AliESDEvent.h"
28 #include "AliAODEvent.h"
29 #include "AliVVertex.h"
30 #include "AliESDVertex.h"
31 #include "AliLog.h"
32 #include "AliAODVertex.h"
33 #include "AliESDtrack.h"
34 #include "AliAODTrack.h"
35 #include "AliESDtrackCuts.h"
36 #include "AliCentrality.h"
37 #include "AliAODRecoDecayHF.h"
38 #include "AliAnalysisVertexingHF.h"
39 #include "AliAODMCHeader.h"
40 #include "AliAODMCParticle.h"
41 #include "AliVertexerTracks.h"
42 #include "AliRDHFCuts.h"
43 #include "AliAnalysisManager.h"
44 #include "AliAODHandler.h"
45 #include "AliInputEventHandler.h"
46 #include "AliPIDResponse.h"
47 #include "AliAnalysisUtils.h"
48 #include "AliMultSelection.h"
49 #include "AliAODVZERO.h"
50 #include "AliEventCuts.h"
51 #include "TRandom.h"
52 #include <TF1.h>
53 #include <TFile.h>
54 #include <TKey.h>
55 
56 using std::cout;
57 using std::endl;
58 
60 ClassImp(AliRDHFCuts);
62 
63 
64 //--------------------------------------------------------------------------
66 AliAnalysisCuts(name,title),
67 fMinVtxType(3),
68 fMinVtxContr(1),
69 fMaxVtxRedChi2(1e6),
70 fMaxVtxZ(10.),
71 fMinSPDMultiplicity(0),
72 fMinContrPileupMV(5),
73 fMaxVtxChi2PileupMV(5.),
74 fMinWDzPileupMV(15.),
75 fRejectPlpFromDiffBCMV(kFALSE),
76 fTriggerMask(AliVEvent::kAnyINT),
77 fUseOnlyOneTrigger(kFALSE),
78 fTrackCuts(0),
79 fnPtBins(1),
80 fnPtBinLimits(1),
81 fPtBinLimits(0),
82 fnVars(1),
83 fVarNames(0),
84 fnVarsForOpt(0),
85 fVarsForOpt(0),
86 fGlobalIndex(1),
87 fCutsRD(0),
88 fIsUpperCut(0),
89 fUsePID(kFALSE),
90 fUseAOD049(kFALSE),
91 fPidHF(0),
92 fWhyRejection(0),
93 fEvRejectionBits(0),
94 fRemoveDaughtersFromPrimary(kFALSE),
95 fUseMCVertex(kFALSE),
96 fUsePhysicsSelection(kTRUE),
97 fOptPileup(0),
98 fMinContrPileup(3),
99 fMinDzPileup(0.6),
100 fUseMultDepPileupCut(kFALSE),
101 fUseCentrality(0),
102 fMinCentrality(0.),
103 fMaxCentrality(100.),
104 fMultSelectionObjectName("MultSelection"),
105 fFixRefs(kFALSE),
106 fIsSelectedCuts(0),
107 fIsSelectedPID(0),
108 fMinPtCand(-1.),
109 fMaxPtCand(100000.),
110 fMaxRapidityCand(-999.),
111 fKeepSignalMC(kFALSE),
112 fIsCandTrackSPDFirst(kFALSE),
113 fMaxPtCandTrackSPDFirst(0.),
114 fApplySPDDeadPbPb2011(kFALSE),
115 fApplySPDMisalignedPP2012(kFALSE),
116 fMaxDiffTRKV0Centr(-1.),
117 fRemoveTrackletOutliers(kFALSE),
118 fCutOnzVertexSPD(3),
119 fKinkReject(kFALSE),
120 fUseTrackSelectionWithFilterBits(kTRUE),
121 fUseCentrFlatteningInMC(kFALSE),
122 fHistCentrDistr(0x0),
123 fCutRatioClsOverCrossRowsTPC(0),
124 fCutRatioSignalNOverCrossRowsTPC(0),
125 fCutMinCrossedRowsTPCPtDep(""),
126 f1CutMinNCrossedRowsTPCPtDep(0x0),
127 fUseCutGeoNcrNcl(kFALSE),
128 fDeadZoneWidth(3.),
129 fCutGeoNcrNclLength(130.),
130 fCutGeoNcrNclGeom1Pt(1.5),
131 fCutGeoNcrNclFractionNcr(0.85),
132 fCutGeoNcrNclFractionNcl(0.7),
133 fUseV0ANDSelectionOffline(kFALSE),
134 fUseTPCtrackCutsOnThisDaughter(kTRUE),
135 fApplyZcutOnSPDvtx(kFALSE),
136 fUsePreselect(0),
137 fAliEventCuts(0x0),
138 fApplyCentralityCorrCuts(kFALSE),
139 fApplyPbPbOutOfBunchPileupCuts(0),
140 fUseAliEventCuts(kFALSE)
141 {
142  //
143  // Default Constructor
144  //
145  fAliEventCuts = new AliEventCuts();
146  fAliEventCuts->SetManualMode();
147  fTriggerClass[0]="CINT1"; fTriggerClass[1]="";
148 }
149 //--------------------------------------------------------------------------
151  AliAnalysisCuts(source),
152  fMinVtxType(source.fMinVtxType),
153  fMinVtxContr(source.fMinVtxContr),
155  fMaxVtxZ(source.fMaxVtxZ),
161  fTriggerMask(source.fTriggerMask),
163  fTriggerClass(),
164  fTrackCuts(0),
165  fnPtBins(source.fnPtBins),
167  fPtBinLimits(0),
168  fnVars(source.fnVars),
169  fVarNames(0),
170  fnVarsForOpt(source.fnVarsForOpt),
171  fVarsForOpt(0),
172  fGlobalIndex(source.fGlobalIndex),
173  fCutsRD(0),
174  fIsUpperCut(0),
175  fUsePID(source.fUsePID),
176  fUseAOD049(source.fUseAOD049),
177  fPidHF(0),
181  fUseMCVertex(source.fUseMCVertex),
183  fOptPileup(source.fOptPileup),
185  fMinDzPileup(source.fMinDzPileup),
191  fFixRefs(source.fFixRefs),
194  fMinPtCand(source.fMinPtCand),
195  fMaxPtCand(source.fMaxPtCand),
205  fKinkReject(source.fKinkReject),
208  fHistCentrDistr(0x0),
227 {
228  //
229  // Copy constructor
230  //
231  cout<<"Copy constructor"<<endl;
232  fTriggerClass[0] = source.fTriggerClass[0];
233  fTriggerClass[1] = source.fTriggerClass[1];
234  if(source.GetTrackCuts()) AddTrackCuts(source.GetTrackCuts());
235  if(source.fPtBinLimits) SetPtBins(source.fnPtBinLimits,source.fPtBinLimits);
236  if(source.fVarNames) SetVarNames(source.fnVars,source.fVarNames,source.fIsUpperCut);
237  if(source.fCutsRD) SetCuts(source.fGlobalIndex,source.fCutsRD);
238  if(source.fVarsForOpt) SetVarsForOpt(source.fnVarsForOpt,source.fVarsForOpt);
239  if(source.fPidHF) SetPidHF(source.fPidHF);
240  if(source.fHistCentrDistr) fHistCentrDistr=(TH1F*)(source.fHistCentrDistr->Clone());
243  PrintAll();
244 
245 }
246 //--------------------------------------------------------------------------
248 {
249  //
250  // assignment operator
251  //
252  if(&source == this) return *this;
253 
254  AliAnalysisCuts::operator=(source);
255 
256  fMinVtxType=source.fMinVtxType;
257  fMinVtxContr=source.fMinVtxContr;
259  fMaxVtxZ=source.fMaxVtxZ;
265  fTriggerMask=source.fTriggerMask;
267  fTriggerClass[0]=source.fTriggerClass[0];
268  fTriggerClass[1]=source.fTriggerClass[1];
269  fnPtBins=source.fnPtBins;
271  fnVars=source.fnVars;
272  fGlobalIndex=source.fGlobalIndex;
273  fnVarsForOpt=source.fnVarsForOpt;
274  fUsePID=source.fUsePID;
275  fUseAOD049=source.fUseAOD049;
276  if(fPidHF) delete fPidHF;
277  fPidHF=new AliAODPidHF(*(source.GetPidHF()));
281  fUseMCVertex=source.fUseMCVertex;
283  fOptPileup=source.fOptPileup;
285  fMinDzPileup=source.fMinDzPileup;
291  fFixRefs=source.fFixRefs;
294  fMinPtCand=source.fMinPtCand;
295  fMaxPtCand=source.fMaxPtCand;
305  fKinkReject=source.fKinkReject;
307  if(fHistCentrDistr) delete fHistCentrDistr;
309  if(source.fHistCentrDistr)fHistCentrDistr=(TH1F*)(source.fHistCentrDistr->Clone());
310 
311  if(source.GetTrackCuts()) {delete fTrackCuts; fTrackCuts=new AliESDtrackCuts(*(source.GetTrackCuts()));}
312  if(source.fPtBinLimits) SetPtBins(source.fnPtBinLimits,source.fPtBinLimits);
313  if(source.fVarNames) SetVarNames(source.fnVars,source.fVarNames,source.fIsUpperCut);
314  if(source.fCutsRD) SetCuts(source.fGlobalIndex,source.fCutsRD);
315  if(source.fVarsForOpt) SetVarsForOpt(source.fnVarsForOpt,source.fVarsForOpt);
316 
322 
336  PrintAll();
337 
338  return *this;
339 }
340 //--------------------------------------------------------------------------
342  //
343  // Default Destructor
344  //
345  if(fTrackCuts) { delete fTrackCuts; fTrackCuts=0; }
346  if(fPtBinLimits) {delete [] fPtBinLimits; fPtBinLimits=0;}
347  if(fVarNames) {delete [] fVarNames; fVarNames=0;}
348  if(fVarsForOpt) {delete [] fVarsForOpt; fVarsForOpt=0;}
349  if(fCutsRD) {
350  delete [] fCutsRD;
351  fCutsRD=0;
352  }
353  if(fIsUpperCut) {delete [] fIsUpperCut; fIsUpperCut=0;}
354  if(fPidHF){
355  delete fPidHF;
356  fPidHF=0;
357  }
359 
363  }
364  delete fAliEventCuts;
365 }
366 //---------------------------------------------------------------------------
368  //
369  // Centrality selection
370  //
371  if(fUseCentrality<kCentOff||fUseCentrality>=kCentInvalid){
372  AliWarning("Centrality estimator not valid");
373  return 3;
374  }else{
375  Float_t centvalue=GetCentrality((AliAODEvent*)event);
376  if (centvalue<-998.){//-999 if no centralityP
377  return 3;
379  return 3;
380  }else{
381  if (centvalue<fMinCentrality || centvalue>fMaxCentrality){
382  return 2;
383  }
384  // selection to flatten the centrality distribution
385  if(fHistCentrDistr){
386  if(!IsEventSelectedForCentrFlattening(centvalue))return 4;
387  }
388  }
389  }
390  return 0;
391 }
392 
393 
394 //-------------------------------------------------
395 void AliRDHFCuts::SetHistoForCentralityFlattening(TH1F *h,Double_t minCentr,Double_t maxCentr,Double_t centrRef,Int_t switchTRand){
396  // set the histo for centrality flattening
397  // the centrality is flatten in the range minCentr,maxCentr
398  // if centrRef is zero, the minimum in h within (minCentr,maxCentr) defines the reference
399  // positive, the value of h(centrRef) defines the reference (-> the centrality distribution might be not flat in the whole desired range)
400  // negative, h(bin with max in range)*centrRef is used to define the reference (-> defines the maximum loss of events, also in this case the distribution might be not flat)
401  // switchTRand is used to set the unerflow bin of the histo: if it is < -1 in the analysis the random event selection will be done on using TRandom
402 
403  if(maxCentr<minCentr){
404  AliWarning("AliRDHFCuts::Wrong centralities values while setting the histogram for centrality flattening");
405  }
406 
408  fHistCentrDistr=(TH1F*)h->Clone("hCentralityFlat");
409  fHistCentrDistr->SetTitle("Reference histo for centrality flattening");
410  Int_t minbin=fHistCentrDistr->FindBin(minCentr*1.00001); // fast if fix bin width
411  Int_t maxbin=fHistCentrDistr->FindBin(maxCentr*0.9999);
412  fHistCentrDistr->GetXaxis()->SetRange(minbin,maxbin);
413  Double_t ref=0.,bincont=0.,binrefwidth=1.;
414  Int_t binref=0;
415  if(TMath::Abs(centrRef)<0.0001){
416  binref=fHistCentrDistr->GetMinimumBin();
417  binrefwidth=fHistCentrDistr->GetBinWidth(binref);
418  ref=fHistCentrDistr->GetBinContent(binref)/binrefwidth;
419  }
420  else if(centrRef>0.){
421  binref=h->FindBin(centrRef);
422  if(binref<1||binref>h->GetNbinsX()){
423  AliWarning("AliRDHFCuts::Wrong centrality reference value while setting the histogram for centrality flattening");
424  }
425  binrefwidth=fHistCentrDistr->GetBinWidth(binref);
426  ref=fHistCentrDistr->GetBinContent(binref)/binrefwidth;
427  }
428  else{
429  if(centrRef<-1) AliWarning("AliRDHFCuts: with this centrality reference no flattening will be applied");
430  binref=fHistCentrDistr->GetMaximumBin();
431  binrefwidth=fHistCentrDistr->GetBinWidth(binref);
432  ref=fHistCentrDistr->GetMaximum()*TMath::Abs(centrRef)/binrefwidth;
433  }
434 
435  for(Int_t j=1;j<=h->GetNbinsX();j++){// Now set the "probabilities"
436  if(h->GetBinLowEdge(j)*1.0001>=minCentr&&h->GetBinLowEdge(j+1)*0.9999<=maxCentr){
437  bincont=h->GetBinContent(j);
438  fHistCentrDistr->SetBinContent(j,ref/bincont*h->GetBinWidth(j));
439  fHistCentrDistr->SetBinError(j,h->GetBinError(j)*ref/bincont);
440  }
441  else{
442  h->SetBinContent(j,1.1);// prob > 1 to assure that events will not be rejected
443  }
444  }
445 
446  fHistCentrDistr->SetBinContent(0,switchTRand);
447  return;
448 
449 }
450 
451 //-------------------------------------------------
453  //
454  // Random event selection, based on fHistCentrDistr, to flatten the centrality distribution
455  // Can be faster if it was required that fHistCentrDistr covers
456  // exactly the desired centrality range (e.g. part of the lines below should be done during the
457  // setting of the histo) and TH1::SetMinimum called
458  //
459 
460  if(!fHistCentrDistr) return kTRUE;
461  // Int_t maxbin=fHistCentrDistr->FindBin(fMaxCentrality*0.9999);
462  // if(maxbin>fHistCentrDistr->GetNbinsX()){
463  // AliWarning("AliRDHFCuts: The maximum centrality exceeds the x-axis limit of the histogram for centrality flattening");
464  // }
465 
466  Int_t bin=fHistCentrDistr->FindBin(centvalue); // Fast if the histo has a fix bin
467  Double_t bincont=fHistCentrDistr->GetBinContent(bin);
468  Double_t centDigits=centvalue-(Int_t)(centvalue*100.)/100.;// this is to extract a random number between 0 and 0.01
469 
470  if(fHistCentrDistr->GetBinContent(0)<-0.9999){
471  if(gRandom->Uniform(1.)<bincont)return kTRUE;
472  return kFALSE;
473  }
474 
475  if(centDigits*100.<bincont)return kTRUE;
476  return kFALSE;
477 
478 }
479 //---------------------------------------------------------------------------
480 void AliRDHFCuts::SetupPID(AliVEvent *event) {
481  // Set the PID response object in the AliAODPidHF
482  // in case of old PID sets the TPC dE/dx BB parameterization
483 
484  if(fPidHF){
485  if(fPidHF->GetPidResponse()==0x0){
486  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
487  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
488  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
489  fPidHF->SetPidResponse(pidResp);
490  }
492  if(fPidHF->GetOldPid()) {
493 
494  Bool_t isMC=kFALSE;
495  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)event)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
496  if(mcArray) {isMC=kTRUE;fUseAOD049=kFALSE;}
497 
498  // pp, from LHC10d onwards
499  if((event->GetRunNumber()>121693 && event->GetRunNumber()<136851) ||
500  event->GetRunNumber()>139517) fPidHF->SetOnePad(kTRUE);
501  // pp, 2011 low energy run
502  if((event->GetRunNumber()>=146686 && event->GetRunNumber()<=146860)){
503  fPidHF->SetppLowEn2011(kTRUE);
504  fPidHF->SetOnePad(kFALSE);
505  }
506  // PbPb LHC10h
507  if(event->GetRunNumber()>=136851 && event->GetRunNumber()<=139517) fPidHF->SetPbPb(kTRUE);
508  // MC
509  if(isMC) fPidHF->SetMC(kTRUE);
510  if(isMC && (event->GetRunNumber()>=146686 && event->GetRunNumber()<=146860))
511  fPidHF->SetMClowenpp2011(kTRUE);
513  }else{
514  // check that AliPIDResponse object was properly set in case of using OADB
515  if(fPidHF->GetPidResponse()==0x0) AliFatal("AliPIDResponse object not set");
516  }
517  }
518 }
519 //---------------------------------------------------------------------------
521  //
522  // Event selection
523  //
524  //if(fTriggerMask && event->GetTriggerMask()!=fTriggerMask) return kFALSE;
525 
526  // commented for the time being
527  // if(fUseAliEventCuts) return IsEventSelectedWithAliEventCuts(event);
528 
529  fWhyRejection=0;
531  Bool_t accept=kTRUE;
532 
533 
534  // check if it's MC
535  Bool_t isMC=kFALSE;
536  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)event)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
537  if(mcArray) {isMC=kTRUE;fUseAOD049=kFALSE;}
538 
539 
540  SetupPID(event);
541 
542  // trigger class
543  TString firedTriggerClasses=((AliAODEvent*)event)->GetFiredTriggerClasses();
544  // don't do for MC and for PbPb 2010 data
545  if(!isMC && (event->GetRunNumber()<136851 || event->GetRunNumber()>139517)) {
546  if(!firedTriggerClasses.Contains(fTriggerClass[0].Data()) &&
547  (fTriggerClass[1].CompareTo("")==0 || !firedTriggerClasses.Contains(fTriggerClass[1].Data())) ) {
548  fWhyRejection=5;
550  accept=kFALSE;
551  }
552  }
553 
554 
555  // TEMPORARY FIX FOR GetEvent
556  Int_t nTracks=((AliAODEvent*)event)->GetNumberOfTracks();
557  for(Int_t itr=0; itr<nTracks; itr++){
558  AliAODTrack* tr=(AliAODTrack*)((AliAODEvent*)event)->GetTrack(itr);
559  tr->SetAODEvent((AliAODEvent*)event);
560  }
561 
562  // TEMPORARY FIX FOR REFERENCES
563  // Fix references to daughter tracks
564  // if(fFixRefs) {
565  // AliAnalysisVertexingHF *fixer = new AliAnalysisVertexingHF();
566  // fixer->FixReferences((AliAODEvent*)event);
567  // delete fixer;
568  // }
569  //
570 
571  // cuts used for run 2 Pb-Pb from AliEventCuts
572  Bool_t doAliEvCuts=kFALSE;
574  doAliEvCuts=kTRUE;
575  Int_t runNumb=event->GetRunNumber();
576  if(runNumb >= 244917 && runNumb <= 246994) fAliEventCuts->SetupRun2PbPb();
577  else if(runNumb >= 295369 && runNumb <= 297624) fAliEventCuts->SetupPbPb2018();
578  else doAliEvCuts=kFALSE;
579  }
580 
581  if(doAliEvCuts) fAliEventCuts->AcceptEvent(event);
582 
583  // physics selection requirements
585  Bool_t isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fTriggerMask);
586  if(!isSelected) {
587  if(accept) fWhyRejection=7;
589  accept=kFALSE;
590  }else{
591  if(fUseOnlyOneTrigger){
592  if(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()!=fTriggerMask){
593  if(accept) fWhyRejection=7;
595  accept=kFALSE;
596  }
597  }
599  AliAODVZERO* v0data=(AliAODVZERO*)((AliAODEvent*)event)->GetVZEROData();
600  Int_t tv0a=v0data->GetV0ADecision();
601  Int_t tv0c=v0data->GetV0CDecision();
602  if(!(tv0a==1 && tv0c==1)){
603  if(accept) fWhyRejection=7;
605  accept=kFALSE;
606  }
607  }
608  }
609  }
610 
611  // centrality selection
612  if (fUseCentrality!=kCentOff) {
613  Int_t rejection=IsEventSelectedInCentrality(event);
614  Bool_t okCent=kFALSE;
615  if(rejection==0) okCent=kTRUE;
616  if(isMC && rejection==4 && !fUseCentrFlatteningInMC) okCent=kTRUE;
617  if(!okCent){
618  if(accept) fWhyRejection=rejection;
621  accept=kFALSE;
622  }
623 
624  }
625 
626  // PbPb2011 outliers in tracklets vs. VZERO and centTRK vs. centV0
627  if(event->GetRunNumber()>=167693 && event->GetRunNumber()<=170593){
629  Double_t v0cent=GetCentrality((AliAODEvent*)event,kCentV0M);
630  Double_t ntracklets=((AliAODEvent*)event)->GetTracklets()->GetNumberOfTracklets();
631  Double_t cutval=60.-0.08*ntracklets+1./50000.*ntracklets*ntracklets;
632  if(ntracklets<1000. && v0cent<cutval){
633  if(accept) fWhyRejection=2;
635  accept=kFALSE;
636  }
637  }
638  if(fMaxDiffTRKV0Centr>0.){
639  Double_t v0cent=GetCentrality((AliAODEvent*)event,kCentV0M);
640  Double_t trkcent=GetCentrality((AliAODEvent*)event,kCentTRK);
641  if(TMath::Abs(trkcent-v0cent)>fMaxDiffTRKV0Centr){
642  if(accept) fWhyRejection=1;
644  accept=kFALSE;
645  }
646  }
647  }
648 
649  // cuts on correlations between centrality estimators in Pb-Pb 2015 and Pb-Pb 2018
650  if(fApplyCentralityCorrCuts && doAliEvCuts){
651  if(!fAliEventCuts->PassedCut(AliEventCuts::kMultiplicity)){
652  if(accept) fWhyRejection=1; // for fWhyRejection they are classified as pileup
654  accept=kFALSE;
655  }
656  }
657 
658  // vertex requirements
659 
660  const AliVVertex *vertex = event->GetPrimaryVertex();
661 
662  if(!vertex){
663  accept=kFALSE;
665  }else{
666  TString title=vertex->GetTitle();
667  if(title.Contains("Z") && fMinVtxType>1){
668  accept=kFALSE;
670  }
671  else if(title.Contains("3D") && fMinVtxType>2){
672  accept=kFALSE;
674  }
675  if(vertex->GetNContributors()<fMinVtxContr){
676  accept=kFALSE;
678  }
679  }
680 
681  const AliVVertex *vSPD = ((AliAODEvent*)event)->GetPrimaryVertexSPD();
682  if(fCutOnzVertexSPD>0){
683  if(!vSPD || (vSPD && vSPD->GetNContributors()<fMinVtxContr)){
684  accept=kFALSE;
686  }else{
687  if(fCutOnzVertexSPD==1 && TMath::Abs(vSPD->GetZ())>12.) {
688  // protection for events with bad reconstructed track vertex (introduced for 2011 Pb-Pb)
690  if(accept) fWhyRejection=6;
691  accept=kFALSE;
692  }
693  if(fCutOnzVertexSPD>=2 && vertex){
694  Double_t dz = vSPD->GetZ()-vertex->GetZ();
695  // cut on absolute distance between track and SPD vertex (introduced for 2011 Pb-Pb)
696  if(TMath::Abs(dz)>0.5) {
698  if(accept) fWhyRejection=0;
699  accept=kFALSE;
700  }
701  if(accept && fCutOnzVertexSPD==3){
702  // cut on nsigma distance between track and SPD vertex (for 2015 Pb-Pb)
703  double covTrc[6],covSPD[6];
704  vertex->GetCovarianceMatrix(covTrc);
705  vSPD->GetCovarianceMatrix(covSPD);
706  double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
707  double errTrc = TMath::Sqrt(covTrc[5]);
708  double nsigTot = TMath::Abs(dz)/errTot, nsigTrc = TMath::Abs(dz)/errTrc;
709  if (TMath::Abs(dz)>0.2 || nsigTot>10 || nsigTrc>20){
710  // reject, bad reconstructed track vertex
712  if(accept) fWhyRejection=0;
713  accept=kFALSE;
714  }
715  }
716  }
717  }
718  }
719 
720  Double_t zvert = -999;
721  if(!fApplyZcutOnSPDvtx && vertex) zvert=vertex->GetZ();
722  else if(fApplyZcutOnSPDvtx) {
723  if(!vSPD || (vSPD && vSPD->GetNContributors()<1)){
724  accept=kFALSE;
726  }
727  else zvert = vSPD->GetZ();
728  }
729 
730  if(TMath::Abs(zvert)>fMaxVtxZ) {
732  if(accept) fWhyRejection=6;
733  accept=kFALSE;
734  }
735 
736  // pile-up rejection
738  Bool_t isPileup=kFALSE;
740  isPileup=event->IsPileupFromSPDInMultBins();
741  }else{
744  isPileup=event->IsPileupFromSPD(cutc,cutz,3.,2.,10.);
745  }
746  if(isPileup){
747  if(accept) fWhyRejection=1;
749  accept=kFALSE;
750  }
751  }
753  AliAnalysisUtils utils;
754  utils.SetMinPlpContribMV(fMinContrPileupMV); // min. multiplicity of the pile-up vertex to consider
755  utils.SetMaxPlpChi2MV(fMaxVtxChi2PileupMV); // max chi2 per contributor of the pile-up vertex to consider.
756  utils.SetMinWDistMV(fMinWDzPileupMV); // minimum weighted distance in Z between 2 vertices (i.e. (zv1-zv2)/sqrt(sigZv1^2+sigZv2^2) )
757  utils.SetCheckPlpFromDifferentBCMV(fRejectPlpFromDiffBCMV); // vertex with |BCID|>2 will trigger pile-up (based on TOF)
758  Bool_t isPUMV = utils.IsPileUpMV(event);
759  if(isPUMV) {
760  if(accept) fWhyRejection=1;
762  accept=kFALSE;
763  }
764  }
765 
766  // cut on correlations for out of bunch pileup in PbPb run2
767  if(fApplyPbPbOutOfBunchPileupCuts==1 && doAliEvCuts){
768  if(!fAliEventCuts->PassedCut(AliEventCuts::kCorrelations)){
769  if(accept) fWhyRejection=1; // for fWhyRejection they are classified as pileup
771  accept=kFALSE;
772  }
773  }else if(fApplyPbPbOutOfBunchPileupCuts==2 && event->GetRunNumber() >= 295369 && event->GetRunNumber() <= 297624){
774  // Ionut cut on V0multiplicity vs. n TPC clusters (Pb-Pb 2018)
775  AliAODVZERO* v0data=(AliAODVZERO*)((AliAODEvent*)event)->GetVZEROData();
776  Float_t mTotV0=v0data->GetMTotV0A()+v0data->GetMTotV0C();
777  Int_t nTPCcls=((AliAODEvent*)event)->GetNumberOfTPCClusters();
778  Float_t mV0TPCclsCut=-2000.+(0.013*nTPCcls)+(1.25e-9*nTPCcls*nTPCcls);
779  if(mTotV0<mV0TPCclsCut){
780  if(accept) fWhyRejection=1;
782  accept=kFALSE;
783  }
784  }
785 
786  // Correcting PP2012 flag to remove tracks crossing SPD misaligned staves for periods 12def
787  if(fApplySPDMisalignedPP2012 && !(event->GetRunNumber()>=195681 && event->GetRunNumber()<=197388)) fApplySPDMisalignedPP2012=false;
788 
789  return accept;
790 }
791 //---------------------------------------------------------------------------
793  //
794  // Event selection with AliEventCuts
795  //
796 
797  fWhyRejection=0;
799  Bool_t accept=kTRUE;
800 
801  // check if it's MC
802  Bool_t isMC=kFALSE;
803  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)event)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
804  if(mcArray) {isMC=kTRUE;fUseAOD049=kFALSE;}
805 
806 
807  SetupPID(event);
808 
809  // TEMPORARY FIX FOR GetEvent
810  Int_t nTracks=((AliAODEvent*)event)->GetNumberOfTracks();
811  for(Int_t itr=0; itr<nTracks; itr++){
812  AliAODTrack* tr=(AliAODTrack*)((AliAODEvent*)event)->GetTrack(itr);
813  tr->SetAODEvent((AliAODEvent*)event);
814  }
815 
816  Int_t runNumb=event->GetRunNumber();
817  if(runNumb >= 244917 && runNumb <= 246994) fAliEventCuts->SetupRun2PbPb();
818  else if(runNumb >= 295369 && runNumb <= 297624) fAliEventCuts->SetupPbPb2018();
819  else fAliEventCuts->SetManualMode(kFALSE);
820 
821  // setup cuts
822  TString selTrigClassClass="";
823  if(!isMC && (event->GetRunNumber()<136851 || event->GetRunNumber()>139517)) {
824  // don't do for MC and for PbPb 2010 data
825  if(fTriggerClass[0].Length()>0){
826  selTrigClassClass=fTriggerClass[0].Data();
827  if(fTriggerClass[1].Length()>0) selTrigClassClass.Append(Form(",%s",fTriggerClass[1].Data()));
828  }
829  }
830  fAliEventCuts->OverrideAutomaticTriggerSelection(fTriggerMask);
831  if(fUseOnlyOneTrigger) fAliEventCuts->fRequireExactTriggerMask=kTRUE;
832  fAliEventCuts->OverridePileUpCuts(fMinContrPileup,fMinDzPileup,3.,2.,5.);
833  fAliEventCuts->fTrackletBGcut=kFALSE;
835  fAliEventCuts->fPileUpCutMV=kFALSE;
836  fAliEventCuts->fUseSPDpileUpCut=kTRUE;
837  if(fUseMultDepPileupCut) fAliEventCuts->fUseMultiplicityDependentPileUpCuts=kTRUE;
838  }
840  fAliEventCuts->fPileUpCutMV=kTRUE;
841  fAliEventCuts->fUseSPDpileUpCut=kFALSE;
842  }
843  fAliEventCuts->SetMaxVertexZposition(fMaxVtxZ);
844 
845  fAliEventCuts->AcceptEvent(event);
846 
847  // trigger class
848  if(selTrigClassClass.Length()>0 && !fAliEventCuts->PassedCut(AliEventCuts::kTriggerClasses)){
849  fWhyRejection=5;
851  accept=kFALSE;
852  }
853 
854  // physics selection requirements
856  if(!fAliEventCuts->PassedCut(AliEventCuts::kTrigger)){
857  if(accept) fWhyRejection=7;
859  accept=kFALSE;
860  }else{
862  AliAODVZERO* v0data=(AliAODVZERO*)((AliAODEvent*)event)->GetVZEROData();
863  Int_t tv0a=v0data->GetV0ADecision();
864  Int_t tv0c=v0data->GetV0CDecision();
865  if(!(tv0a==1 && tv0c==1)){
866  if(accept) fWhyRejection=7;
868  accept=kFALSE;
869  }
870  }
871  }
872  }
873 
874  // centrality selection
875  if (fUseCentrality!=kCentOff) {
876  Int_t rejection=IsEventSelectedInCentrality(event);
877  Bool_t okCent=kFALSE;
878  if(rejection==0) okCent=kTRUE;
879  if(isMC && rejection==4 && !fUseCentrFlatteningInMC) okCent=kTRUE;
880  if(!okCent){
881  if(accept) fWhyRejection=rejection;
884  accept=kFALSE;
885  }
886  }
887 
888  // PbPb2011 outliers in tracklets vs. VZERO and centTRK vs. centV0
889  if(event->GetRunNumber()>=167693 && event->GetRunNumber()<=170593){
891  Double_t v0cent=GetCentrality((AliAODEvent*)event,kCentV0M);
892  Double_t ntracklets=((AliAODEvent*)event)->GetTracklets()->GetNumberOfTracklets();
893  Double_t cutval=60.-0.08*ntracklets+1./50000.*ntracklets*ntracklets;
894  if(ntracklets<1000. && v0cent<cutval){
895  if(accept) fWhyRejection=2;
897  accept=kFALSE;
898  }
899  }
900  if(fMaxDiffTRKV0Centr>0.){
901  Double_t v0cent=GetCentrality((AliAODEvent*)event,kCentV0M);
902  Double_t trkcent=GetCentrality((AliAODEvent*)event,kCentTRK);
903  if(TMath::Abs(trkcent-v0cent)>fMaxDiffTRKV0Centr){
904  if(accept) fWhyRejection=1;
906  accept=kFALSE;
907  }
908  }
909  }
910 
911  // cuts on correlations between centrality estimators in Pb-Pb 2015 and Pb-Pb 2018
913  if(!fAliEventCuts->PassedCut(AliEventCuts::kMultiplicity)){
914  if(accept) fWhyRejection=1; // for fWhyRejection they are classified as pileup
916  accept=kFALSE;
917  }
918  }
919 
920  // vertex requirements
921 
922  if(fMinVtxType>2 && !fAliEventCuts->PassedCut(AliEventCuts::kVertexTracks)){
923  accept=kFALSE;
925  }
926  if(fMinVtxType<=2 && !fAliEventCuts->PassedCut(AliEventCuts::kVertexSPD)){
927  accept=kFALSE;
929  }
930 
931  if(fCutOnzVertexSPD>0){
932  if(!fAliEventCuts->PassedCut(AliEventCuts::kVertexSPD)){
933  accept=kFALSE;
935  }else{
936  if(fCutOnzVertexSPD==1 && !fAliEventCuts->PassedCut(AliEventCuts::kVertexPositionSPD)){
937  // protection for events with bad reconstructed track vertex (introduced for 2011 Pb-Pb)
939  if(accept) fWhyRejection=6;
940  accept=kFALSE;
941  }
942  if(fCutOnzVertexSPD>=2 && !fAliEventCuts->PassedCut(AliEventCuts::kVertexQuality)){
944  if(accept) fWhyRejection=0;
945  accept=kFALSE;
946  }
947  }
948  }
949 
950  if(!fAliEventCuts->PassedCut(AliEventCuts::kVertexPosition)){
952  if(accept) fWhyRejection=6;
953  accept=kFALSE;
954  }
955 
956  // pile-up rejection
958  if(!fAliEventCuts->PassedCut(AliEventCuts::kPileUp)){
959  if(accept) fWhyRejection=1;
961  accept=kFALSE;
962  }
963  }
964  // cut on correlations for out of bunch pileup in PbPb run2
966  if(!fAliEventCuts->PassedCut(AliEventCuts::kCorrelations)){
967  if(accept) fWhyRejection=1; // for fWhyRejection they are classified as pileup
969  accept=kFALSE;
970  }
971  }else if(fApplyPbPbOutOfBunchPileupCuts==2 && event->GetRunNumber() >= 295369 && event->GetRunNumber() <= 297624){
972  // Ionut cut on V0multiplicity vs. n TPC clusters (Pb-Pb 2018)
973  AliAODVZERO* v0data=(AliAODVZERO*)((AliAODEvent*)event)->GetVZEROData();
974  Float_t mTotV0=v0data->GetMTotV0A()+v0data->GetMTotV0C();
975  Int_t nTPCcls=((AliAODEvent*)event)->GetNumberOfTPCClusters();
976  Float_t mV0TPCclsCut=-2000.+(0.013*nTPCcls)+(1.25e-9*nTPCcls*nTPCcls);
977  if(mTotV0<mV0TPCclsCut){
978  if(accept) fWhyRejection=1;
980  accept=kFALSE;
981  }
982  }
983 
984  // Correcting PP2012 flag to remove tracks crossing SPD misaligned staves for periods 12def
985  if(fApplySPDMisalignedPP2012 && !(event->GetRunNumber()>=195681 && event->GetRunNumber()<=197388)) fApplySPDMisalignedPP2012=false;
986 
987  return accept;
988 }
989 //---------------------------------------------------------------------------
991  //
992  // Daughter tracks selection
993  //
994  if(!fTrackCuts) return kTRUE;
995 
996  Int_t ndaughters = d->GetNDaughters();
997  AliAODVertex *vAOD = d->GetPrimaryVtx();
998  Double_t pos[3],cov[6];
999  vAOD->GetXYZ(pos);
1000  vAOD->GetCovarianceMatrix(cov);
1001  const AliESDVertex vESD(pos,cov,100.,100);
1002 
1003  Bool_t retval=kTRUE;
1004 
1005  for(Int_t idg=0; idg<ndaughters; idg++) {
1006  AliAODTrack *dgTrack = (AliAODTrack*)d->GetDaughter(idg);
1007  if(!dgTrack) {retval = kFALSE; continue;}
1008  //printf("charge %d\n",dgTrack->Charge());
1009  if(dgTrack->Charge()==0) continue; // it's not a track, but a V0
1010 
1012  { if(!dgTrack->HasPointOnITSLayer(0)) { retval = kFALSE; continue; } }
1013 
1014  if(!IsDaughterSelected(dgTrack,&vESD,fTrackCuts,aod)) retval = kFALSE;
1015  }
1016 
1017  return retval;
1018 }
1019 //---------------------------------------------------------------------------
1021  //
1022  // Check if AOD and deltaAOD files are composed of the same events:
1023  // mismatches were observed in the merged AODs of LHC15o
1024  //
1025  // When AOD+deltaAOD are produced from ESD, mismatches can be found looking at:
1026  // - the AOD trees in AliAOD.root and AliAOD.VertexingHF.root have different number of entries
1027  // - the titles of the TProcessID objects do not match
1028  // When deltaAOD are produced from AOD, mismatches can be found looking at:
1029  // - the AOD trees in AliAOD.root and AliAOD.VertexingHF.root have different number of entries
1030  //
1031  // Return values:
1032  // -1: AOD and deltaAOD trees have different number of entries
1033  // 0: AOD and deltaAOD trees have same number of entries + the titles of the TProcessID objects do not match
1034  // 1: AOD and deltaAOD trees have same number of entries + the titles of the TProcessID objects match
1035  Bool_t okTProcessNames = kTRUE;
1036  AliAODHandler* aodHandler = (AliAODHandler*)((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
1037  TTree *treeAOD = aodHandler->GetTree();
1038  TTree *treeDeltaAOD = treeAOD->GetFriend("aodTree");
1039  if(!treeDeltaAOD || !treeAOD) return -1;
1040  if(treeDeltaAOD && treeAOD){
1041  if(treeAOD->GetEntries()!=treeDeltaAOD->GetEntries()){
1042  printf("AliRDHFCuts::CheckMatchingAODdeltaAODevents: Difference in number of entries in main and friend tree, skipping event\n");
1043  return -1;
1044  }
1045  TFile *mfile = treeAOD->GetCurrentFile();
1046  TFile *dfile = treeDeltaAOD->GetCurrentFile();
1047  TList* lm=mfile->GetListOfKeys();
1048  TList* ld=dfile->GetListOfKeys();
1049  Int_t nentm=lm->GetEntries();
1050  for(Int_t jm=0; jm<nentm; jm++){
1051  TKey* o=(TKey*)lm->At(jm);
1052  TString clnam=o->GetClassName();
1053  if(clnam=="TProcessID"){
1054  TString pname=o->GetName();
1055  TString ptit=o->GetTitle();
1056  if(pname.Contains("ProcessID")){
1057  TObject* od=(TObject*)ld->FindObject(pname.Data());
1058  if(od){
1059  TString ptit2=od->GetTitle();
1060  if(ptit2!=ptit){
1061  printf("AliRDHFCuts::CheckMatchingAODdeltaAODevents: mismatch in %s: AOD: %s -- deltaAOD: %s\n",pname.Data(),ptit.Data(),ptit2.Data());
1062  okTProcessNames = kFALSE;
1063  }
1064  }
1065  }
1066  }
1067  }
1068  }
1069 
1070  if (okTProcessNames) return 1;
1071  else return 0;
1072 }
1073 //---------------------------------------------------------------------------
1075  //
1076  // Check the correctness of the string syntax
1077  //
1078  Bool_t retval=kTRUE;
1079 
1080  if(!rows.Contains("pt")) {
1081  if(print) AliError("string must contain \"pt\"");
1082  retval= kFALSE;
1083  }
1084  return retval;
1085 }
1086 //---------------------------------------------------------------------------
1088  //
1089  //Create the TFormula from TString for TPC crossed rows pT dependent cut
1090  //
1091 
1092 
1093  // setting data member that describes the TPC crossed rows pT dependent cut
1095 
1096  // creating TFormula from TString
1099  // resetting TFormula
1101  }
1102  if(!CheckPtDepCrossedRows(rows,kTRUE))return;
1103 
1104  TString tmp(rows);
1105  tmp.ReplaceAll("pt","x");
1106  f1CutMinNCrossedRowsTPCPtDep = new TFormula("f1CutMinNCrossedRowsTPCPtDep",tmp.Data());
1107 
1108 
1109 }
1110 //---------------------------------------------------------------------------
1111 Bool_t AliRDHFCuts::IsDaughterSelected(AliAODTrack *track,const AliESDVertex *primary,AliESDtrackCuts *cuts, const AliAODEvent* aod) const{
1112  //
1113  // Convert to ESDtrack, relate to vertex and check cuts
1114  //
1115  if(!cuts) return kTRUE;
1116 
1117  if(cuts->GetFlagCutTOFdistance()) cuts->SetFlagCutTOFdistance(kFALSE);
1118 
1119 
1120  // convert to ESD track here
1121  AliESDtrack esdTrack(track);
1122  // set the TPC cluster info
1123  esdTrack.SetTPCClusterMap(track->GetTPCClusterMap());
1124  esdTrack.SetTPCSharedMap(track->GetTPCSharedMap());
1125  esdTrack.SetTPCPointsF(track->GetTPCNclsF());
1126  // needed to calculate the impact parameters
1127  esdTrack.RelateToVertex(primary,0.,3.);
1128 
1129  //applying ESDtrackCut
1130  if(!cuts->IsSelected(&esdTrack)) return kFALSE;
1131 
1132  //appliyng kink rejection
1133  if(fKinkReject){
1134  AliAODVertex *maybeKink=track->GetProdVertex();
1135  if(maybeKink->GetType()==AliAODVertex::kKink) return kFALSE;
1136  }
1137 
1138  //appliyng TPC crossed rows pT dependent cut
1140  Float_t nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
1141  if(nCrossedRowsTPC<f1CutMinNCrossedRowsTPCPtDep->Eval(esdTrack.Pt())) return kFALSE;
1142  }
1143 
1144  //appliyng NTPCcls/NTPCcrossedRows cut
1146  Float_t nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
1147  Float_t nClustersTPC = esdTrack.GetTPCNcls();
1148  if(nCrossedRowsTPC!=0){
1149  Float_t ratio = nClustersTPC/nCrossedRowsTPC;
1150  if(ratio<fCutRatioClsOverCrossRowsTPC) return kFALSE;
1151  }
1152  else return kFALSE;
1153  }
1154 
1155  //appliyng TPCsignalN/NTPCcrossedRows cut
1157  Float_t nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
1158  Float_t nTPCsignal = esdTrack.GetTPCsignalN();
1159  if(nCrossedRowsTPC!=0){
1160  Float_t ratio = nTPCsignal/nCrossedRowsTPC;
1161  if(ratio<fCutRatioSignalNOverCrossRowsTPC) return kFALSE;
1162  }
1163  else return kFALSE;
1164  }
1165 
1166  // geometrical cut (note uses track at vertex instead of at TPC inner wall)
1168  Float_t nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
1169  Float_t lengthInActiveZoneTPC=esdTrack.GetLengthInActiveZone(0,fDeadZoneWidth,220.,aod->GetMagneticField());
1170  Double_t cutGeoNcrNclLength=fCutGeoNcrNclLength-TMath::Power(TMath::Abs(esdTrack.GetSigned1Pt()),fCutGeoNcrNclGeom1Pt);
1171  Bool_t isOK=kTRUE;
1172  if (lengthInActiveZoneTPC<cutGeoNcrNclLength) isOK=kFALSE;
1173  if (nCrossedRowsTPC<fCutGeoNcrNclFractionNcr*cutGeoNcrNclLength) isOK=kFALSE;
1174  if (esdTrack.GetTPCncls()<fCutGeoNcrNclFractionNcl*cutGeoNcrNclLength) isOK=kFALSE;
1175  if(!isOK) return kFALSE;
1176  }
1177 
1178 
1180  // to be implemented
1181  // we need either to have here the AOD Event,
1182  // or to have the pileup vertex object
1183  }
1184 
1186  Bool_t deadSPDLay1PbPb2011[20][4]={
1187  {kTRUE,kTRUE,kTRUE,kTRUE},
1188  {kTRUE,kTRUE,kTRUE,kTRUE},
1189  {kTRUE,kTRUE,kTRUE,kTRUE},
1190  {kTRUE,kTRUE,kTRUE,kTRUE},
1191  {kTRUE,kTRUE,kTRUE,kTRUE},
1192  {kFALSE,kFALSE,kTRUE,kTRUE},
1193  {kTRUE,kTRUE,kFALSE,kFALSE},
1194  {kTRUE,kTRUE,kTRUE,kTRUE},
1195  {kFALSE,kFALSE,kTRUE,kTRUE},
1196  {kTRUE,kTRUE,kTRUE,kTRUE},
1197  {kTRUE,kTRUE,kFALSE,kFALSE},
1198  {kTRUE,kTRUE,kTRUE,kTRUE},
1199  {kFALSE,kFALSE,kFALSE,kFALSE},
1200  {kFALSE,kFALSE,kTRUE,kTRUE},
1201  {kFALSE,kFALSE,kFALSE,kFALSE},
1202  {kFALSE,kFALSE,kFALSE,kFALSE},
1203  {kTRUE,kTRUE,kTRUE,kTRUE},
1204  {kTRUE,kTRUE,kFALSE,kFALSE},
1205  {kFALSE,kFALSE,kFALSE,kFALSE},
1206  {kFALSE,kFALSE,kFALSE,kFALSE}
1207  };
1208  Bool_t deadSPDLay2PbPb2011[40][4]={
1209  {kTRUE,kTRUE,kTRUE,kTRUE},
1210  {kTRUE,kTRUE,kTRUE,kTRUE},
1211  {kTRUE,kTRUE,kTRUE,kTRUE},
1212  {kTRUE,kTRUE,kTRUE,kTRUE},
1213  {kTRUE,kTRUE,kTRUE,kTRUE},
1214  {kTRUE,kTRUE,kTRUE,kTRUE},
1215  {kTRUE,kTRUE,kTRUE,kTRUE},
1216  {kTRUE,kTRUE,kTRUE,kTRUE},
1217  {kTRUE,kTRUE,kTRUE,kTRUE},
1218  {kTRUE,kTRUE,kTRUE,kTRUE},
1219  {kTRUE,kTRUE,kTRUE,kTRUE},
1220  {kTRUE,kTRUE,kTRUE,kTRUE},
1221  {kFALSE,kFALSE,kFALSE,kFALSE},
1222  {kFALSE,kFALSE,kTRUE,kTRUE},
1223  {kTRUE,kTRUE,kTRUE,kTRUE},
1224  {kTRUE,kTRUE,kTRUE,kTRUE},
1225  {kTRUE,kTRUE,kFALSE,kFALSE},
1226  {kTRUE,kTRUE,kTRUE,kTRUE},
1227  {kTRUE,kTRUE,kTRUE,kTRUE},
1228  {kTRUE,kTRUE,kTRUE,kTRUE},
1229  {kFALSE,kFALSE,kFALSE,kFALSE},
1230  {kFALSE,kFALSE,kFALSE,kFALSE},
1231  {kTRUE,kTRUE,kTRUE,kTRUE},
1232  {kTRUE,kTRUE,kTRUE,kTRUE},
1233  {kFALSE,kFALSE,kFALSE,kFALSE},
1234  {kFALSE,kFALSE,kFALSE,kFALSE},
1235  {kTRUE,kTRUE,kTRUE,kTRUE},
1236  {kTRUE,kTRUE,kTRUE,kTRUE},
1237  {kFALSE,kFALSE,kFALSE,kFALSE},
1238  {kFALSE,kFALSE,kFALSE,kFALSE},
1239  {kFALSE,kFALSE,kFALSE,kFALSE},
1240  {kFALSE,kFALSE,kFALSE,kFALSE},
1241  {kTRUE,kTRUE,kTRUE,kTRUE},
1242  {kTRUE,kTRUE,kTRUE,kTRUE},
1243  {kTRUE,kTRUE,kFALSE,kFALSE},
1244  {kTRUE,kTRUE,kTRUE,kTRUE},
1245  {kFALSE,kFALSE,kFALSE,kFALSE},
1246  {kFALSE,kFALSE,kFALSE,kFALSE},
1247  {kFALSE,kFALSE,kFALSE,kFALSE},
1248  {kFALSE,kFALSE,kFALSE,kFALSE}
1249  };
1250  Double_t xyz1[3],xyz2[3];
1251  esdTrack.GetXYZAt(3.9,0.,xyz1);
1252  esdTrack.GetXYZAt(7.6,0.,xyz2);
1253  Double_t phi1=TMath::ATan2(xyz1[1],xyz1[0]);
1254  if(phi1<0) phi1+=2*TMath::Pi();
1255  Int_t lad1=(Int_t)(phi1/(2.*TMath::Pi()/20.));
1256  Double_t phi2=TMath::ATan2(xyz2[1],xyz2[0]);
1257  if(phi2<0) phi2+=2*TMath::Pi();
1258  Int_t lad2=(Int_t)(phi2/(2.*TMath::Pi()/40.));
1259  Int_t mod1=TMath::Floor((xyz1[2]+14)/7.);
1260  Int_t mod2=TMath::Floor((xyz2[2]+14)/7.);
1261  Bool_t lay1ok=kFALSE;
1262  if(mod1>=0 && mod1<4 && lad1<20){
1263  lay1ok=deadSPDLay1PbPb2011[lad1][mod1];
1264  }
1265  Bool_t lay2ok=kFALSE;
1266  if(mod2>=0 && mod2<4 && lad2<40){
1267  lay2ok=deadSPDLay2PbPb2011[lad2][mod2];
1268  }
1269  if(!lay1ok && !lay2ok) return kFALSE;
1270  }
1271 
1273  // Cut tracks crossing the SPD at 5.6<phi<2pi
1274  Double_t xyz1[3],xyz2[3];
1275  esdTrack.GetXYZAt(3.9,0.,xyz1);
1276  esdTrack.GetXYZAt(7.6,0.,xyz2);
1277  Double_t phi1=TMath::ATan2(xyz1[1],xyz1[0]);
1278  if(phi1<0) phi1+=2*TMath::Pi();
1279  Double_t phi2=TMath::ATan2(xyz2[1],xyz2[0]);
1280  if(phi2<0) phi2+=2*TMath::Pi();
1281  Bool_t lay1ok=kTRUE;
1282  if(phi1>5.6 && phi1<2.*TMath::Pi()) lay1ok=kFALSE;
1283  Bool_t lay2ok=kTRUE;
1284  if(phi2>5.6 && phi2<2.*TMath::Pi()) lay2ok=kFALSE;
1285  if(!lay1ok || !lay2ok) return kFALSE;
1286  }
1287 
1288  return kTRUE;
1289 }
1290 //---------------------------------------------------------------------------
1291 void AliRDHFCuts::SetPtBins(Int_t nPtBinLimits,Float_t *ptBinLimits) {
1292  // Set the pt bins
1293 
1294  if(fPtBinLimits) {
1295  delete [] fPtBinLimits;
1296  fPtBinLimits = NULL;
1297  printf("Changing the pt bins\n");
1298  }
1299 
1300  if(nPtBinLimits != fnPtBins+1){
1301  cout<<"Warning: ptBinLimits dimention "<<nPtBinLimits<<" != nPtBins+1 ("<<fnPtBins+1<<")\nSetting nPtBins to "<<nPtBinLimits-1<<endl;
1302  SetNPtBins(nPtBinLimits-1);
1303  }
1304 
1305  fnPtBinLimits = nPtBinLimits;
1306  SetGlobalIndex();
1307  //cout<<"Changing also Global Index -> "<<fGlobalIndex<<endl;
1309  for(Int_t ib=0; ib<nPtBinLimits; ib++) fPtBinLimits[ib]=ptBinLimits[ib];
1310 
1311  return;
1312 }
1313 //---------------------------------------------------------------------------
1314 void AliRDHFCuts::SetVarNames(Int_t nVars,TString *varNames,Bool_t *isUpperCut){
1315  // Set the variable names
1316 
1317  if(fVarNames) {
1318  delete [] fVarNames;
1319  fVarNames = NULL;
1320  //printf("Changing the variable names\n");
1321  }
1322  if(nVars!=fnVars){
1323  printf("Wrong number of variables: it has to be %d\n",fnVars);
1324  return;
1325  }
1326  //fnVars=nVars;
1327  fVarNames = new TString[nVars];
1328  fIsUpperCut = new Bool_t[nVars];
1329  for(Int_t iv=0; iv<nVars; iv++) {
1330  fVarNames[iv] = varNames[iv];
1331  fIsUpperCut[iv] = isUpperCut[iv];
1332  }
1333 
1334  return;
1335 }
1336 //---------------------------------------------------------------------------
1338  // Set the variables to be used for cuts optimization
1339 
1340  if(fVarsForOpt) {
1341  delete [] fVarsForOpt;
1342  fVarsForOpt = NULL;
1343  //printf("Changing the variables for cut optimization\n");
1344  }
1345 
1346  if(nVars==0){
1347  printf("%d not accepted as number of variables: it has to be %d\n",nVars,fnVars);
1348  return;
1349  }
1350 
1351  fnVarsForOpt = 0;
1352  fVarsForOpt = new Bool_t[fnVars];
1353  for(Int_t iv=0; iv<fnVars; iv++) {
1354  fVarsForOpt[iv]=forOpt[iv];
1355  if(fVarsForOpt[iv]) fnVarsForOpt++;
1356  }
1357 
1358  return;
1359 }
1360 
1361 //---------------------------------------------------------------------------
1363  //
1364  // set centrality estimator
1365  //
1366  fUseCentrality=flag;
1367  if(fUseCentrality<kCentOff||fUseCentrality>=kCentInvalid) AliWarning("Centrality estimator not valid");
1368 
1369  return;
1370 }
1371 
1372 
1373 //---------------------------------------------------------------------------
1375  //
1376  // store the cuts
1377  //
1378  if(nVars!=fnVars) {
1379  printf("Wrong number of variables: it has to be %d\n",fnVars);
1380  AliFatal("exiting");
1381  }
1382  if(nPtBins!=fnPtBins) {
1383  printf("Wrong number of pt bins: it has to be %d\n",fnPtBins);
1384  AliFatal("exiting");
1385  }
1386 
1387  if(!fCutsRD) fCutsRD = new Float_t[fGlobalIndex];
1388 
1389 
1390  for(Int_t iv=0; iv<fnVars; iv++) {
1391 
1392  for(Int_t ib=0; ib<fnPtBins; ib++) {
1393 
1394  //check
1395  if(GetGlobalIndex(iv,ib)>=fGlobalIndex) {
1396  cout<<"Overflow, exit..."<<endl;
1397  return;
1398  }
1399 
1400  fCutsRD[GetGlobalIndex(iv,ib)] = cutsRD[iv][ib];
1401 
1402  }
1403  }
1404  return;
1405 }
1406 //---------------------------------------------------------------------------
1407 void AliRDHFCuts::SetCuts(Int_t glIndex,Float_t* cutsRDGlob){
1408  //
1409  // store the cuts
1410  //
1411  if(glIndex != fGlobalIndex){
1412  cout<<"Wrong array size: it has to be "<<fGlobalIndex<<endl;
1413  AliFatal("exiting");
1414  }
1415  if(!fCutsRD) fCutsRD = new Float_t[fGlobalIndex];
1416 
1417  for(Int_t iGl=0;iGl<fGlobalIndex;iGl++){
1418  fCutsRD[iGl] = cutsRDGlob[iGl];
1419  }
1420  return;
1421 }
1422 //---------------------------------------------------------------------------
1424  //
1425  // print all cuts values
1426  //
1427 
1428  printf("Minimum vtx type %d\n",fMinVtxType);
1429  printf("Minimum vtx contr %d\n",fMinVtxContr);
1430  printf("Max vtx red chi2 %f\n",fMaxVtxRedChi2);
1431  printf("Min SPD mult %d\n",fMinSPDMultiplicity);
1432  printf("Use PID %d OldPid=%d\n",(Int_t)fUsePID,fPidHF ? fPidHF->GetOldPid() : -1);
1433  printf("Remove daughters from vtx %d\n",(Int_t)fRemoveDaughtersFromPrimary);
1434  printf("Physics selection: %s\n",fUsePhysicsSelection ? "Yes" : "No");
1435  printf("Pileup rejection: %s\n",(fOptPileup > 0) ? "Yes" : "No");
1436  if(fOptPileup==1) printf(" -- Reject pileup event");
1437  if(fOptPileup==2) printf(" -- Reject tracks from pileup vtx");
1438  if(fUseCentrality>0) {
1439  TString estimator="";
1440  if(fUseCentrality==kCentV0M) estimator = "V0";
1441  if(fUseCentrality==kCentTRK) estimator = "Tracks";
1442  if(fUseCentrality==kCentTKL) estimator = "Tracklets";
1443  if(fUseCentrality==kCentCL1) estimator = "SPD clusters outer";
1444  if(fUseCentrality==kCentZNA) estimator = "ZNA";
1445  if(fUseCentrality==kCentZPA) estimator = "ZPA";
1446  if(fUseCentrality==kCentV0A) estimator = "V0A";
1447  if(fUseCentrality==kCentCL0) estimator = "SPD clusters inner";
1448  printf("Centrality class considered: %.1f-%.1f, estimated with %s\n",fMinCentrality,fMaxCentrality,estimator.Data());
1449  }
1450  if(fIsCandTrackSPDFirst) printf("Check for candidates with pt < %2.2f, that daughters fullfill kFirst criteria\n",fMaxPtCandTrackSPDFirst);
1451 
1452  if(fCutRatioClsOverCrossRowsTPC) printf("N TPC Clusters > %f N TPC Crossed Rows\n", fCutRatioClsOverCrossRowsTPC);
1453  if(fCutRatioSignalNOverCrossRowsTPC) printf("N TPC Points for dE/dx > %f N TPC Crossed Rows\n", fCutRatioSignalNOverCrossRowsTPC);
1454  if(f1CutMinNCrossedRowsTPCPtDep) printf("N TPC Crossed Rows pT-dependent cut: %s\n", fCutMinCrossedRowsTPCPtDep.Data());
1455 
1456  if(fVarNames){
1457  cout<<"Array of variables"<<endl;
1458  for(Int_t iv=0;iv<fnVars;iv++){
1459  cout<<fVarNames[iv]<<"\t";
1460  }
1461  cout<<endl;
1462  }
1463  if(fVarsForOpt){
1464  cout<<"Array of optimization"<<endl;
1465  for(Int_t iv=0;iv<fnVars;iv++){
1466  cout<<fVarsForOpt[iv]<<"\t";
1467  }
1468  cout<<endl;
1469  }
1470  if(fIsUpperCut){
1471  cout<<"Array of upper/lower cut"<<endl;
1472  for(Int_t iv=0;iv<fnVars;iv++){
1473  cout<<fIsUpperCut[iv]<<"\t";
1474  }
1475  cout<<endl;
1476  }
1477  if(fPtBinLimits){
1478  cout<<"Array of ptbin limits"<<endl;
1479  for(Int_t ib=0;ib<fnPtBinLimits;ib++){
1480  cout<<fPtBinLimits[ib]<<"\t";
1481  }
1482  cout<<endl;
1483  }
1484  if(fCutsRD){
1485  cout<<"Matrix of cuts"<<endl;
1486  for(Int_t iv=0;iv<fnVars;iv++){
1487  for(Int_t ib=0;ib<fnPtBins;ib++){
1488  cout<<"fCutsRD["<<iv<<"]["<<ib<<"] = "<<fCutsRD[GetGlobalIndex(iv,ib)]<<"\t";
1489  }
1490  cout<<endl;
1491  }
1492  cout<<endl;
1493  }
1494  printf("fUsePreselect=%d \n",fUsePreselect);
1495  if(fPidHF) fPidHF->PrintAll();
1496  return;
1497 }
1498 
1499 //--------------------------------------------------------------------------
1501  // print the trigger selection
1502 
1503  printf("Selected trigger classes: %s %s\n",fTriggerClass[0].Data(),fTriggerClass[1].Data());
1504 
1505  cout<<" Trigger selection pattern: ";
1506  if( fTriggerMask & AliVEvent::kAny ) cout<<" kAny ";
1507  if( fTriggerMask & AliVEvent::kAnyINT ) cout<<" kAnyINT ";
1508  if( fTriggerMask & AliVEvent::kINT7 ) cout<<" kINT7 ";
1509  if( fTriggerMask & AliVEvent::kMB ) cout<<" kMB ";
1510  if( fTriggerMask & AliVEvent::kCINT5 ) cout<<" kCINT5 ";
1511  if( fTriggerMask & AliVEvent::kCentral ) cout<<" kCentral ";
1512  if( fTriggerMask & AliVEvent::kSemiCentral ) cout<<" kSemiCentral ";
1513  if( fTriggerMask & AliVEvent::kEMCEGA ) cout<<" kEMCEGA ";
1514  if( fTriggerMask & AliVEvent::kHighMult ) cout<<" kHighMult ";
1515  if( fTriggerMask & AliVEvent::kFastOnly ) cout<<" kFastOnly ";
1516  cout << endl<< endl;
1517 
1518 }
1519 
1520 //---------------------------------------------------------------------------
1521 void AliRDHFCuts::GetCuts(Float_t**& cutsRD) const{
1522  //
1523  // get the cuts
1524  //
1525 
1526  //cout<<"Give back a "<<fnVars<<"x"<<fnPtBins<<" matrix."<<endl;
1527 
1528 
1529  Int_t iv,ib;
1530  if(!cutsRD) {
1531  //cout<<"Initialization..."<<endl;
1532  cutsRD=new Float_t*[fnVars];
1533  for(iv=0; iv<fnVars; iv++) {
1534  cutsRD[iv] = new Float_t[fnPtBins];
1535  }
1536  }
1537 
1538  for(Int_t iGlobal=0; iGlobal<fGlobalIndex; iGlobal++) {
1539  GetVarPtIndex(iGlobal,iv,ib);
1540  cutsRD[iv][ib] = fCutsRD[iGlobal];
1541  }
1542 
1543  return;
1544 }
1545 
1546 //---------------------------------------------------------------------------
1548  //
1549  // give the global index from variable and pt bin
1550  //
1551  return iPtBin*fnVars+iVar;
1552 }
1553 
1554 //---------------------------------------------------------------------------
1555 void AliRDHFCuts::GetVarPtIndex(Int_t iGlob, Int_t& iVar, Int_t& iPtBin) const {
1556  //
1557  //give the index of the variable and of the pt bin from the global index
1558  //
1559  iPtBin=(Int_t)iGlob/fnVars;
1560  iVar=iGlob%fnVars;
1561 
1562  return;
1563 }
1564 
1565 //---------------------------------------------------------------------------
1567  //
1568  //give the pt bin where the pt lies.
1569  //
1570  Int_t ptbin=-1;
1571  if(pt<fPtBinLimits[0])return ptbin;
1572  for (Int_t i=0;i<fnPtBins;i++){
1573  if(pt<fPtBinLimits[i+1]) {
1574  ptbin=i;
1575  break;
1576  }
1577  }
1578  return ptbin;
1579 }
1580 //-------------------------------------------------------------------
1582  //
1583  // Give the value of cut set for the variable iVar and the pt bin iPtBin
1584  //
1585  if(!fCutsRD){
1586  cout<<"Cuts not iniziaisez yet"<<endl;
1587  return 0;
1588  }
1589  return fCutsRD[GetGlobalIndex(iVar,iPtBin)];
1590 }
1591 
1592 //-------------------------------------------------------------------
1594 
1595  if(aodEvent->GetRunNumber()<244824)return GetCentralityOldFramework(aodEvent,estimator);
1596  Double_t cent=-999;
1597 
1598  if(estimator==kCentOff) return -999;
1599 
1600  AliMultSelection *multSelection = (AliMultSelection*)aodEvent->FindListObject(fMultSelectionObjectName);
1601  if(!multSelection){
1602  AliWarning("AliMultSelection could not be found in the aod event list of objects");
1603  return cent;
1604  }
1605 
1606  // Compare centrality with the centrality at AOD filtering and on-the-fly
1607  if( fMultSelectionObjectName.CompareTo("MultSelection")!=0 ){
1608  AliMultSelection *defaultmultSelection = (AliMultSelection*)aodEvent->FindListObject("MultSelection");
1609  if(!defaultmultSelection){
1610  AliWarning("AliMultSelection default method could not be found in the aod event list of objects");
1611  return cent;
1612  }
1613  Float_t defaultCent = defaultmultSelection->GetMultiplicityPercentile("V0M");
1614  Float_t newCent = multSelection->GetMultiplicityPercentile("V0M");
1615  if( defaultCent<20. && newCent>20.) fEvRejectionBits+=1<<kMismatchOldNewCentrality;
1616  else if (defaultCent>20. && newCent<20.) fEvRejectionBits+=1<<kMismatchOldNewCentrality;
1617  }
1618 
1619  if(estimator==kCentV0M){
1620  cent=multSelection->GetMultiplicityPercentile("V0M");
1621  }else if(estimator==kCentV0A){
1622  cent=multSelection->GetMultiplicityPercentile("V0A");
1623  }else if(estimator==kCentZNA){
1624  cent=multSelection->GetMultiplicityPercentile("ZNA");
1625  }else if(estimator==kCentCL1){
1626  cent=multSelection->GetMultiplicityPercentile("CL1");
1627  }else if(estimator==kCentCL0){
1628  cent=multSelection->GetMultiplicityPercentile("CL0");
1629  }else {
1630  AliWarning(Form("CENTRALITY ESTIMATE WITH ESTIMATOR %d NOT YET IMPLEMENTED FOR NEW FRAMEWORK",(Int_t)estimator));
1631  return cent;
1632  }
1633  Int_t qual = multSelection->GetEvSelCode();
1634  if(qual == 199 ) cent=-999;
1635  return cent;
1636 }
1637 //-------------------------------------------------------------------
1639  //
1640  // Get centrality percentile
1641  //
1642 
1643  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)aodEvent)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1644  if(mcArray) {fUseAOD049=kFALSE;}
1645 
1646  AliAODHeader *header=dynamic_cast<AliAODHeader*>(aodEvent->GetHeader());
1647  if(!header) AliFatal("Not a standard AOD");
1648  AliCentrality *centrality=header->GetCentralityP();
1649  Float_t cent=-999.;
1650  Bool_t isSelRun=kFALSE;
1651  Int_t selRun[5]={138364, 138826, 138828, 138836, 138871};
1652  if(!centrality) return cent;
1653  else{
1654  if (estimator==kCentV0M){
1655  cent=(Float_t)(centrality->GetCentralityPercentile("V0M"));
1656  if(cent<0){
1657  Int_t quality = centrality->GetQuality();
1658  if(quality<=1){ // fQuality==1 means rejected by zVertex cut that we apply a part and we want to keep separate (Giacomo)
1659  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0M");
1660  }else{
1661  Int_t runnum=aodEvent->GetRunNumber();
1662  for(Int_t ir=0;ir<5;ir++){
1663  if(runnum==selRun[ir]){
1664  isSelRun=kTRUE;
1665  break;
1666  }
1667  }
1668  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0M");
1669  }
1670  }
1671 
1672  //temporary fix for AOD049 outliers
1673  if(fUseAOD049&&cent>=0){
1674  Float_t v0=0;
1675  AliAODVZERO* aodV0 = aodEvent->GetVZEROData();
1676  v0+=aodV0->GetMTotV0A();
1677  v0+=aodV0->GetMTotV0C();
1678  if(cent==0&&v0<19500)return -1;//filtering issue
1679  Float_t tkl = (Float_t)(aodEvent->GetTracklets()->GetNumberOfTracklets());
1680  Float_t val= 1.30552 + 0.147931 * v0;
1681  Float_t tklSigma[101]={176.644, 156.401, 153.789, 153.015, 142.476, 137.951, 136.127, 129.852, 127.436, 124.86, 120.788, 115.611, 113.172, 110.496, 109.127, 104.421, 102.479, 99.9766, 97.5152, 94.0654, 92.4602, 89.3364, 87.1342, 83.3497, 82.6216, 81.1084, 78.0793, 76.1234, 72.9434, 72.1334, 68.0056, 68.2755, 66.0376, 62.9666, 62.4274, 59.65, 58.3776, 56.6361, 54.5184, 53.4224, 51.932, 50.8922, 48.2848, 47.912, 46.5717, 43.4114, 43.2083, 41.3065, 40.1863, 38.5255, 37.2851, 37.5396, 34.4949, 33.8366, 31.8043, 31.7412, 30.8392, 30.0274, 28.8793, 27.6398, 26.6488, 25.0183, 25.1489, 24.4185, 22.9107, 21.2002, 21.6977, 20.1242, 20.4963, 19.0235, 19.298, 17.4103, 16.868, 15.2939, 15.2939, 16.0295, 14.186, 14.186, 15.2173, 12.9504, 12.9504, 12.9504, 15.264, 12.3674, 12.3674, 12.3674, 12.3674, 12.3674, 18.3811, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544};
1682  if ( TMath::Abs(tkl-val) > 6.*tklSigma[(Int_t)cent] )return -1;//outlier
1683  }
1684  }
1685  else {
1686  if (estimator==kCentTRK) {
1687  cent=(Float_t)(centrality->GetCentralityPercentile("TRK"));
1688  if(cent<0){
1689  Int_t quality = centrality->GetQuality();
1690  if(quality<=1){
1691  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("TRK");
1692  }else{
1693  Int_t runnum=aodEvent->GetRunNumber();
1694  for(Int_t ir=0;ir<5;ir++){
1695  if(runnum==selRun[ir]){
1696  isSelRun=kTRUE;
1697  break;
1698  }
1699  }
1700  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("TRK");
1701  }
1702  }
1703  }
1704  else{
1705  if (estimator==kCentTKL){
1706  cent=(Float_t)(centrality->GetCentralityPercentile("TKL"));
1707  if(cent<0){
1708  Int_t quality = centrality->GetQuality();
1709  if(quality<=1){
1710  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("TKL");
1711  }else{
1712  Int_t runnum=aodEvent->GetRunNumber();
1713  for(Int_t ir=0;ir<5;ir++){
1714  if(runnum==selRun[ir]){
1715  isSelRun=kTRUE;
1716  break;
1717  }
1718  }
1719  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("TKL");
1720  }
1721  }
1722  }
1723  else{
1724  if (estimator==kCentCL1){
1725  cent=(Float_t)(centrality->GetCentralityPercentile("CL1"));
1726  if(cent<0){
1727  Int_t quality = centrality->GetQuality();
1728  if(quality<=1){
1729  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("CL1");
1730  }else{
1731  Int_t runnum=aodEvent->GetRunNumber();
1732  for(Int_t ir=0;ir<5;ir++){
1733  if(runnum==selRun[ir]){
1734  isSelRun=kTRUE;
1735  break;
1736  }
1737  }
1738  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("CL1");
1739  }
1740  }
1741  }
1742  else{
1743  if (estimator==kCentZNA){
1744  cent=(Float_t)(centrality->GetCentralityPercentile("ZNA"));
1745  if(cent<0){
1746  Int_t quality = centrality->GetQuality();
1747  if(quality<=1){
1748  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("ZNA");
1749  }else{
1750  Int_t runnum=aodEvent->GetRunNumber();
1751  for(Int_t ir=0;ir<5;ir++){
1752  if(runnum==selRun[ir]){
1753  isSelRun=kTRUE;
1754  break;
1755  }
1756  }
1757  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("ZNA");
1758  }
1759  }
1760  }
1761  else{
1762  if (estimator==kCentZPA){
1763  cent=(Float_t)(centrality->GetCentralityPercentile("ZPA"));
1764  if(cent<0){
1765  Int_t quality = centrality->GetQuality();
1766  if(quality<=1){
1767  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("ZPA");
1768  }else{
1769  Int_t runnum=aodEvent->GetRunNumber();
1770  for(Int_t ir=0;ir<5;ir++){
1771  if(runnum==selRun[ir]){
1772  isSelRun=kTRUE;
1773  break;
1774  }
1775  }
1776  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("ZPA");
1777  }
1778  }
1779  }
1780  else{
1781  if (estimator==kCentV0A){
1782  cent=(Float_t)(centrality->GetCentralityPercentile("V0A"));
1783  if(cent<0){
1784  Int_t quality = centrality->GetQuality();
1785  if(quality<=1){
1786  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0A");
1787  }else{
1788  Int_t runnum=aodEvent->GetRunNumber();
1789  for(Int_t ir=0;ir<5;ir++){
1790  if(runnum==selRun[ir]){
1791  isSelRun=kTRUE;
1792  break;
1793  }
1794  }
1795  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0A");
1796  }
1797  }
1798  }
1799  else {
1800  AliWarning("Centrality estimator not valid");
1801 
1802  }
1803  }
1804  }
1805  }
1806  }
1807  }
1808  }
1809  }
1810  return cent;
1811 }
1812 //-------------------------------------------------------------------
1814  //
1815  // Compare two cuts objects
1816  //
1817 
1818  Bool_t areEqual=kTRUE;
1819 
1820  if(fMinVtxType!=obj->fMinVtxType) { printf("Minimum vtx type %d %d\n",fMinVtxType,obj->fMinVtxType); areEqual=kFALSE;}
1821 
1822  if(fMinVtxContr!=obj->fMinVtxContr) { printf("Minimum vtx contr %d %d\n",fMinVtxContr,obj->fMinVtxContr); areEqual=kFALSE;}
1823 
1824  if(TMath::Abs(fMaxVtxRedChi2-obj->fMaxVtxRedChi2)>1.e-10) { printf("Max vtx red chi2 %f %f\n",fMaxVtxRedChi2,obj->fMaxVtxRedChi2);areEqual=kFALSE;}
1825 
1826  if(fMinSPDMultiplicity!=obj->fMinSPDMultiplicity) { printf("Min SPD mult %d\n %d",fMinSPDMultiplicity,obj->fMinSPDMultiplicity);areEqual=kFALSE;}
1827 
1828  if(fUsePID!=obj->fUsePID) { printf("Use PID %d %d\n",(Int_t)fUsePID,(Int_t)obj->fUsePID); areEqual=kFALSE;}
1829 
1830  if(fRemoveDaughtersFromPrimary!=obj->fRemoveDaughtersFromPrimary) {printf("Remove daughters from vtx %d %d\n",(Int_t)fRemoveDaughtersFromPrimary,(Int_t)obj->fRemoveDaughtersFromPrimary); areEqual=kFALSE;}
1831  if(fTrackCuts){
1832  if(fTrackCuts->GetMinNClusterTPC()!=obj->fTrackCuts->GetMinNClusterTPC()) {printf("MinNClsTPC %d %d\n",fTrackCuts->GetMinNClusterTPC(),obj->fTrackCuts->GetMinNClusterTPC()); areEqual=kFALSE;}
1833 
1834  if(fTrackCuts->GetMinNClustersITS()!=obj->fTrackCuts->GetMinNClustersITS()) {printf("MinNClsITS %d %d\n",fTrackCuts->GetMinNClustersITS(),obj->fTrackCuts->GetMinNClustersITS()); areEqual=kFALSE;}
1835 
1836  if(TMath::Abs(fTrackCuts->GetMaxChi2PerClusterTPC()-obj->fTrackCuts->GetMaxChi2PerClusterTPC())>1.e-10) {printf("MaxChi2ClsTPC %f %f\n",fTrackCuts->GetMaxChi2PerClusterTPC(),obj->fTrackCuts->GetMaxChi2PerClusterTPC()); areEqual=kFALSE;}
1837 
1838  if(fTrackCuts->GetClusterRequirementITS(AliESDtrackCuts::kSPD)!=obj->fTrackCuts->GetClusterRequirementITS(AliESDtrackCuts::kSPD)) {printf("ClusterReq SPD %d %d\n",fTrackCuts->GetClusterRequirementITS(AliESDtrackCuts::kSPD),obj->fTrackCuts->GetClusterRequirementITS(AliESDtrackCuts::kSPD)); areEqual=kFALSE;}
1839  }
1840 
1841  if(fUsePreselect!=obj->fUsePreselect){printf("fUsePreselect: %d %d\n",fUsePreselect,obj->fUsePreselect);areEqual=kFALSE;}
1842 
1843  if(fCutsRD) {
1844  for(Int_t iv=0;iv<fnVars;iv++) {
1845  for(Int_t ib=0;ib<fnPtBins;ib++) {
1846  if(TMath::Abs(fCutsRD[GetGlobalIndex(iv,ib)]-obj->fCutsRD[GetGlobalIndex(iv,ib)])>1.e-10) {
1847  cout<<"fCutsRD["<<iv<<"]["<<ib<<"] = "<<fCutsRD[GetGlobalIndex(iv,ib)]<<" "<<obj->fCutsRD[GetGlobalIndex(iv,ib)]<<"\n";
1848  areEqual=kFALSE;
1849  }
1850  }
1851  }
1852  }
1853 
1854  return areEqual;
1855 }
1856 //---------------------------------------------------------------------------
1858  //
1859  // print cuts values in table format
1860  //
1861 
1862  TString ptString = "pT range";
1863  if(fVarNames && fPtBinLimits && fCutsRD){
1864  TString firstLine(Form("* %-15s",ptString.Data()));
1865  for (Int_t ivar=0; ivar<fnVars; ivar++){
1866  firstLine+=Form("* %-15s ",fVarNames[ivar].Data());
1867  if (ivar == fnVars){
1868  firstLine+="*\n";
1869  }
1870  }
1871  Printf("%s",firstLine.Data());
1872 
1873  for (Int_t ipt=0; ipt<fnPtBins; ipt++){
1874  TString line;
1875  if (ipt==fnPtBins-1){
1876  line=Form("* %5.1f < pt < inf ",fPtBinLimits[ipt]);
1877  }
1878  else{
1879  line=Form("* %5.1f < pt < %4.1f ",fPtBinLimits[ipt],fPtBinLimits[ipt+1]);
1880  }
1881  for (Int_t ivar=0; ivar<fnVars; ivar++){
1882  line+=Form("* %-15f ",fCutsRD[GetGlobalIndex(ivar,ipt)]);
1883  }
1884  Printf("%s",line.Data());
1885  }
1886 
1887  }
1888 
1889 
1890  return;
1891 }
1892 //--------------------------------------------------------------------------
1894  AliAODEvent *aod) const
1895 {
1896  //
1897  // Recalculate primary vertex without daughters
1898  //
1899 
1900  if(!aod) {
1901  AliError("Can not remove daughters from vertex without AOD event");
1902  return 0;
1903  }
1904 
1905  AliAODVertex *recvtx=d->RemoveDaughtersFromPrimaryVtx(aod);
1906  if(!recvtx){
1907  AliDebug(2,"Removal of daughter tracks failed");
1908  return kFALSE;
1909  }
1910 
1911 
1912  //set recalculed primary vertex
1913  d->SetOwnPrimaryVtx(recvtx);
1914  delete recvtx;
1915 
1916  return kTRUE;
1917 }
1918 //--------------------------------------------------------------------------
1920 {
1921  //
1922  // Recalculate primary vertex without daughters
1923  //
1924 
1925  if(!aod) {
1926  AliError("Can not get MC vertex without AOD event");
1927  return kFALSE;
1928  }
1929 
1930  // load MC header
1931  AliAODMCHeader *mcHeader =
1932  (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1933  if(!mcHeader) {
1934  AliError("Can not get MC vertex without AODMCHeader event");
1935  return kFALSE;
1936  }
1937  Double_t pos[3];
1938  Double_t covmatrix[6]={0.,0.,0.,0.,0.,0.};
1939  mcHeader->GetVertex(pos);
1940  AliAODVertex *recvtx=new AliAODVertex(pos,covmatrix);
1941 
1942  if(!recvtx){
1943  AliDebug(2,"Removal of daughter tracks failed");
1944  return kFALSE;
1945  }
1946 
1947  //set recalculed primary vertex
1948  d->SetOwnPrimaryVtx(recvtx);
1949 
1950  d->RecalculateImpPars(recvtx,aod);
1951 
1952  delete recvtx;
1953 
1954  return kTRUE;
1955 }
1956 //--------------------------------------------------------------------------
1958  AliAODEvent *aod,
1959  AliAODVertex *origownvtx) const
1960 {
1961  //
1962  // Clean-up own primary vertex if needed
1963  //
1964 
1966  d->UnsetOwnPrimaryVtx();
1967  if(origownvtx) {
1968  d->SetOwnPrimaryVtx(origownvtx);
1969  delete origownvtx; origownvtx=NULL;
1970  }
1971  d->RecalculateImpPars(d->GetPrimaryVtx(),aod);
1972  } else {
1973  if(origownvtx) {
1974  delete origownvtx; origownvtx=NULL;
1975  }
1976  }
1977  return;
1978 }
1979 //--------------------------------------------------------------------------
1980 Bool_t AliRDHFCuts::IsSignalMC(AliAODRecoDecay *d,AliAODEvent *aod,Int_t pdg) const
1981 {
1982  //
1983  // Checks if this candidate is matched to MC signal
1984  //
1985 
1986  if(!aod) return kFALSE;
1987 
1988  // get the MC array
1989  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)aod)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1990 
1991  if(!mcArray) return kFALSE;
1992 
1993  // try to match
1994  Int_t label = d->MatchToMC(pdg,mcArray);
1995 
1996  if(label>=0) {
1997  //printf("MATCH!\n");
1998  return kTRUE;
1999  }
2000 
2001  return kFALSE;
2002 }
2003 
2004 
2005 //--------------------------------------------------------------------------
2007  // recompute event primary vertex from AOD tracks
2008 
2009  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
2010  vertexer->SetITSMode();
2011  vertexer->SetMinClusters(3);
2012 
2013  AliAODVertex* pvtx=event->GetPrimaryVertex();
2014  if(strstr(pvtx->GetTitle(),"VertexerTracksWithConstraint")) {
2015  Float_t diamondcovxy[3];
2016  event->GetDiamondCovXY(diamondcovxy);
2017  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
2018  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
2019  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
2020  vertexer->SetVtxStart(diamond);
2021  delete diamond; diamond=NULL;
2022  }
2023 
2024  AliESDVertex* vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
2025  if(!vertexESD) return kFALSE;
2026  if(vertexESD->GetNContributors()<=0) {
2027  //AliDebug(2,"vertexing failed");
2028  delete vertexESD; vertexESD=NULL;
2029  return kFALSE;
2030  }
2031  delete vertexer; vertexer=NULL;
2032 
2033  // convert to AliAODVertex
2034  Double_t pos[3],cov[6],chi2perNDF;
2035  vertexESD->GetXYZ(pos); // position
2036  vertexESD->GetCovMatrix(cov); //covariance matrix
2037  chi2perNDF = vertexESD->GetChi2toNDF();
2038  delete vertexESD; vertexESD=NULL;
2039 
2040  pvtx->SetPosition(pos[0],pos[1],pos[2]);
2041  pvtx->SetChi2perNDF(chi2perNDF);
2042  pvtx->SetCovMatrix(cov);
2043 
2044  return kTRUE;
2045 }
void SetNPtBins(Int_t nptBins)
Definition: AliRDHFCuts.h:423
Int_t fIsSelectedCuts
fix the daughter track references
Definition: AliRDHFCuts.h:476
Int_t pdg
Bool_t IsEventSelectedForCentrFlattening(Float_t centvalue)
Float_t fMinDzPileup
min. n. of tracklets in pileup vertex
Definition: AliRDHFCuts.h:465
Double_t fMaxPtCandTrackSPDFirst
flag to select the track kFirst criteria for pt < ptlimit
Definition: AliRDHFCuts.h:483
AliEventCuts * fAliEventCuts
flag that defines whether the PreSelect method has to be used: note that it is up to the task user to...
Definition: AliRDHFCuts.h:507
Int_t fWhyRejection
PID for heavy flavours manager.
Definition: AliRDHFCuts.h:458
double Double_t
Definition: External.C:58
Int_t fCutOnzVertexSPD
flag to apply cut on tracklets vs. centrality for 2011 data
Definition: AliRDHFCuts.h:488
void SetupPID(AliVEvent *event)
Bool_t IsSignalMC(AliAODRecoDecay *d, AliAODEvent *aod, Int_t pdg) const
const char * title
Definition: MakeQAPdf.C:27
Double_t fCutGeoNcrNclFractionNcr
3rd parameter of GeoNcrNcl cut
Definition: AliRDHFCuts.h:501
Bool_t fUseMCVertex
flag to switch on the removal of duaghters from the primary vertex computation
Definition: AliRDHFCuts.h:461
Bool_t fUseOnlyOneTrigger
trigger mask
Definition: AliRDHFCuts.h:440
Int_t IsEventSelectedInCentrality(AliVEvent *event)
Bool_t * fIsUpperCut
Definition: AliRDHFCuts.h:454
Bool_t SetMCPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Bool_t fRemoveDaughtersFromPrimary
Definition: AliRDHFCuts.h:460
void SetHistoForCentralityFlattening(TH1F *h, Double_t minCentr, Double_t maxCentr, Double_t centrRef=0., Int_t switchTRand=0)
Bool_t GetUseCombined()
Definition: AliAODPidHF.h:165
Bool_t fUseMultDepPileupCut
min deltaz between main and pileup vertices
Definition: AliRDHFCuts.h:466
void SetUseCentrality(Int_t flag=1)
Float_t * fPtBinLimits
"number of limits", that is fnPtBins+1
Definition: AliRDHFCuts.h:447
Int_t fMinVtxContr
0: not cut; 1: SPDZ; 2: SPD3D; 3: Tracks
Definition: AliRDHFCuts.h:431
centrality
char Char_t
Definition: External.C:18
static Int_t CheckMatchingAODdeltaAODevents()
Float_t fMaxVtxRedChi2
minimum vertex contributors
Definition: AliRDHFCuts.h:432
void SetMClowenpp2011(Bool_t mc)
Definition: AliAODPidHF.h:102
const Float_t * GetCuts() const
Definition: AliRDHFCuts.h:268
void SetMinCrossedRowsTPCPtDep(const char *rows="")
Float_t fCutRatioClsOverCrossRowsTPC
histogram with reference centrality distribution for centrality distribution flattening ...
Definition: AliRDHFCuts.h:493
Bool_t IsEventSelectedWithAliEventCuts(AliVEvent *event)
Double_t fDeadZoneWidth
flag for enabling/disabling geometrical cut on TPC track
Definition: AliRDHFCuts.h:498
Int_t fMinVtxType
cuts on the event
Definition: AliRDHFCuts.h:430
void SetppLowEn2011(Bool_t opt)
Definition: AliAODPidHF.h:104
Double_t fMaxRapidityCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:480
Double_t fCutGeoNcrNclFractionNcl
4th parameter of GeoNcrNcl cut
Definition: AliRDHFCuts.h:502
void SetGlobalIndex()
Definition: AliRDHFCuts.h:211
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Float_t GetCutValue(Int_t iVar, Int_t iPtBin) const
Int_t fUseCentrality
flag to use a multiplicity dependent pileup selection
Definition: AliRDHFCuts.h:467
Bool_t fUsePID
Definition: AliRDHFCuts.h:455
TRandom * gRandom
Bool_t fRejectPlpFromDiffBCMV
minimum weighted distance in Z between 2 vertices (multi-vertexer)
Definition: AliRDHFCuts.h:438
void PrintAll() const
void SetPidHF(AliAODPidHF *pidObj)
see enum below
Definition: AliRDHFCuts.h:225
Bool_t GetOldPid()
Definition: AliAODPidHF.h:157
TList * GetList(const TDirectory *d, const char *what)
Definition: ExtractData.C:172
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:261
void RecalculateImpPars(AliAODVertex *vtxAODNew, AliAODEvent *aod)
Bool_t fRemoveTrackletOutliers
Max. difference between TRK and V0 centrality (remove TPC pileup for PbPb 2011)
Definition: AliRDHFCuts.h:487
Bool_t fUseV0ANDSelectionOffline
5th parameter of GeoNcrNcl cut
Definition: AliRDHFCuts.h:503
AliRDHFCuts(const Char_t *name="RDHFCuts", const Char_t *title="")
Definition: AliRDHFCuts.cxx:65
const Int_t nPtBins
ULong64_t fTriggerMask
flag to reject pileup from different BC (multi-vertexer)
Definition: AliRDHFCuts.h:439
Bool_t fUseCutGeoNcrNcl
pT-dep cut in TPC minimum n crossed rows
Definition: AliRDHFCuts.h:497
int Int_t
Definition: External.C:63
Bool_t fUseTrackSelectionWithFilterBits
flag to reject kink daughters
Definition: AliRDHFCuts.h:490
void SetCuts(Int_t nVars, Int_t nPtBins, Float_t **cutsRD)
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:450
Float_t fMinWDzPileupMV
max chi2 per contributor of the pile-up vertex to consider (multi-vertexer).
Definition: AliRDHFCuts.h:437
Double_t fCutGeoNcrNclLength
1st parameter of GeoNcrNcl cut
Definition: AliRDHFCuts.h:499
float Float_t
Definition: External.C:68
virtual ~AliRDHFCuts()
void SetPbPb(Bool_t pbpb)
Definition: AliAODPidHF.h:105
TString * fVarNames
number of cut vars for candidates
Definition: AliRDHFCuts.h:449
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:479
AliESDtrackCuts * fTrackCuts
quality cuts on the daughter tracks
Definition: AliRDHFCuts.h:443
void MakeTable() const
Bool_t fFixRefs
name of the AliMultSelection object to be considered
Definition: AliRDHFCuts.h:475
Bool_t fKeepSignalMC
max rapidity of candidate (if !=-999 overrides IsInFiducialAcceptance)
Definition: AliRDHFCuts.h:481
Int_t fOptPileup
use Physics selection criteria
Definition: AliRDHFCuts.h:463
AliESDtrackCuts * GetTrackCuts() const
Definition: AliRDHFCuts.h:276
void PrintTrigger() const
Float_t fMaxVtxZ
maximum chi2/ndf
Definition: AliRDHFCuts.h:433
Float_t GetCentrality(AliAODEvent *aodEvent)
Definition: AliRDHFCuts.h:272
Int_t fIsSelectedPID
outcome of cuts selection
Definition: AliRDHFCuts.h:477
Float_t fMinCentrality
Definition: AliRDHFCuts.h:472
AliAODVertex * RemoveDaughtersFromPrimaryVtx(AliAODEvent *aod)
void SetUpCombinedPID()
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
UInt_t fEvRejectionBits
used to code the step at which candidate was rejected
Definition: AliRDHFCuts.h:459
Int_t fMinContrPileupMV
SPD multiplicity.
Definition: AliRDHFCuts.h:435
Double_t fMaxDiffTRKV0Centr
flag to apply cut on tracks crossing SPD misaligned modules for PP2012 data
Definition: AliRDHFCuts.h:486
Float_t GetCentralityOldFramework(AliAODEvent *aodEvent, AliRDHFCuts::ECentrality estimator)
Int_t fnPtBinLimits
number of pt bins for cuts
Definition: AliRDHFCuts.h:446
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:453
Bool_t CheckPtDepCrossedRows(TString rows, Bool_t print=kFALSE) const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
Int_t fUsePreselect
Definition: AliRDHFCuts.h:506
Bool_t fUseCentrFlatteningInMC
flag to enable/disable the check on filter bits
Definition: AliRDHFCuts.h:491
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
void SetVarNames(Int_t nVars, TString *varNames, Bool_t *isUpperCut)
Int_t fApplyPbPbOutOfBunchPileupCuts
swicth to enable/disable cuts on centrality correlations
Definition: AliRDHFCuts.h:509
void GetVarPtIndex(Int_t iGlob, Int_t &iVar, Int_t &iPtBin) const
void SetBetheBloch()
Bool_t * fVarsForOpt
number of cut vars to be optimized for candidates
Definition: AliRDHFCuts.h:451
Bool_t isMC
Bool_t CompareCuts(const AliRDHFCuts *obj) const
Bool_t AreDaughtersSelected(AliAODRecoDecayHF *rd, const AliAODEvent *aod=0x0) const
Bool_t fApplySPDMisalignedPP2012
flag to apply SPD dead module map of PbPb2011
Definition: AliRDHFCuts.h:485
Bool_t IsEventSelected(AliVEvent *event)
Int_t fMinSPDMultiplicity
maximum |z| of primary vertex
Definition: AliRDHFCuts.h:434
Bool_t fApplyCentralityCorrCuts
AliEventCuts object used in Pb-Pb for cuts on correlations and out-of-bunch pileup.
Definition: AliRDHFCuts.h:508
void SetMC(Bool_t mc)
Definition: AliAODPidHF.h:101
virtual void PrintAll() const
Bool_t fUseAOD049
enable PID usage (off by default)
Definition: AliRDHFCuts.h:456
Bool_t fApplySPDDeadPbPb2011
maximum pt of the candidate for which to check if the daughters fulfill kFirst criteria ...
Definition: AliRDHFCuts.h:484
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
Float_t fMaxVtxChi2PileupMV
min. n. of tracklets in pileup vertex (multi-vertexer)
Definition: AliRDHFCuts.h:436
Bool_t fIsCandTrackSPDFirst
IsSelected returns always kTRUE for MC signal.
Definition: AliRDHFCuts.h:482
TH1F * fHistCentrDistr
flag for enabling/diabling centrality flattening in MC
Definition: AliRDHFCuts.h:492
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
Bool_t fKinkReject
cut on zSPD vertex to remove outliers in centrality vs. tracklets (0=no cut, 1= cut at 12 cm...
Definition: AliRDHFCuts.h:489
Bool_t fUseAliEventCuts
switch for additional correlation cuts for out-of-bunch pileup (0=no cut, 1=AliEVentCuts, 2=Ionut cut vs. nTPC cls)
Definition: AliRDHFCuts.h:510
TString fMultSelectionObjectName
maximum centrality for selected events
Definition: AliRDHFCuts.h:474
Int_t fMinContrPileup
option for pielup selection
Definition: AliRDHFCuts.h:464
Bool_t fUseTPCtrackCutsOnThisDaughter
flag to apply V0AND selection offline
Definition: AliRDHFCuts.h:504
Bool_t fUsePhysicsSelection
use MC primary vertex
Definition: AliRDHFCuts.h:462
TFormula * f1CutMinNCrossedRowsTPCPtDep
pT-dep cut in TPC minimum n crossed rows
Definition: AliRDHFCuts.h:496
AliAODVertex * GetPrimaryVtx() const
void AddTrackCuts(const AliESDtrackCuts *cuts)
Definition: AliRDHFCuts.h:217
TString fTriggerClass[2]
flag to select one trigger only
Definition: AliRDHFCuts.h:441
bool Bool_t
Definition: External.C:53
Int_t fnPtBins
cuts on the candidate
Definition: AliRDHFCuts.h:445
Double_t fCutGeoNcrNclGeom1Pt
2nd parameter of GeoNcrNcl cut
Definition: AliRDHFCuts.h:500
Bool_t fApplyZcutOnSPDvtx
flag to apply TPC track quality cuts on specific D-meson daughter (used for different strategies for ...
Definition: AliRDHFCuts.h:505
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:457
Float_t fCutRatioSignalNOverCrossRowsTPC
min. value ratio NTPCClusters/NTPCCrossedRows, cut if !=0
Definition: AliRDHFCuts.h:494
Int_t fGlobalIndex
Definition: AliRDHFCuts.h:452
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Int_t PtBin(Double_t pt) const
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const
TString fCutMinCrossedRowsTPCPtDep
min. value ratio TPCPointsUsedForPID/NTPCCrossedRows, cut if !=0
Definition: AliRDHFCuts.h:495
Double_t fMinPtCand
outcome of PID selection
Definition: AliRDHFCuts.h:478
Bool_t IsDaughterSelected(AliAODTrack *track, const AliESDVertex *primary, AliESDtrackCuts *cuts, const AliAODEvent *aod=0x0) const
void SetOnePad(Bool_t onepad)
Definition: AliAODPidHF.h:103
Float_t fMaxCentrality
minimum centrality for selected events
Definition: AliRDHFCuts.h:473
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:111
Bool_t RecomputePrimaryVertex(AliAODEvent *event) const
Int_t fnVars
Definition: AliRDHFCuts.h:448