AliPhysics  0e0bd91 (0e0bd91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 "AliInputEventHandler.h"
45 #include "AliPIDResponse.h"
46 #include "AliAnalysisUtils.h"
47 #include "AliMultSelection.h"
48 #include "TRandom.h"
49 #include <TF1.h>
50 
51 using std::cout;
52 using std::endl;
53 
57 
58 
59 //--------------------------------------------------------------------------
60 AliRDHFCuts::AliRDHFCuts(const Char_t* name, const Char_t* title) :
61 AliAnalysisCuts(name,title),
62 fMinVtxType(3),
63 fMinVtxContr(1),
64 fMaxVtxRedChi2(1e6),
65 fMaxVtxZ(10.),
66 fMinSPDMultiplicity(0),
67 fTriggerMask(AliVEvent::kAnyINT),
68 fUseOnlyOneTrigger(kFALSE),
69 fTrackCuts(0),
70 fnPtBins(1),
71 fnPtBinLimits(1),
72 fPtBinLimits(0),
73 fnVars(1),
74 fVarNames(0),
75 fnVarsForOpt(0),
76 fVarsForOpt(0),
77 fGlobalIndex(1),
78 fCutsRD(0),
79 fIsUpperCut(0),
80 fUsePID(kFALSE),
81 fUseAOD049(kFALSE),
82 fPidHF(0),
83 fWhyRejection(0),
84 fEvRejectionBits(0),
85 fRemoveDaughtersFromPrimary(kFALSE),
86 fUseMCVertex(kFALSE),
87 fUsePhysicsSelection(kTRUE),
88 fOptPileup(0),
89 fMinContrPileup(3),
90 fMinDzPileup(0.6),
91 fUseCentrality(0),
92 fMinCentrality(0.),
93 fMaxCentrality(100.),
94 fFixRefs(kFALSE),
95 fIsSelectedCuts(0),
96 fIsSelectedPID(0),
97 fMinPtCand(-1.),
98 fMaxPtCand(100000.),
99 fMaxRapidityCand(-999.),
100 fKeepSignalMC(kFALSE),
101 fIsCandTrackSPDFirst(kFALSE),
102 fMaxPtCandTrackSPDFirst(0.),
103 fApplySPDDeadPbPb2011(kFALSE),
104 fApplySPDMisalignedPP2012(kFALSE),
105 fMaxDiffTRKV0Centr(-1.),
106 fRemoveTrackletOutliers(kFALSE),
107 fCutOnzVertexSPD(0),
108 fKinkReject(kFALSE),
109 fUseTrackSelectionWithFilterBits(kTRUE),
110 fUseCentrFlatteningInMC(kFALSE),
111 fHistCentrDistr(0x0),
112 fCutRatioClsOverCrossRowsTPC(0),
113 fCutRatioSignalNOverCrossRowsTPC(0),
114 fCutMinCrossedRowsTPCPtDep(""),
115 f1CutMinNCrossedRowsTPCPtDep(0x0)
116 {
117  //
118  // Default Constructor
119  //
120  fTriggerClass[0]="CINT1"; fTriggerClass[1]="";
121 }
122 //--------------------------------------------------------------------------
124  AliAnalysisCuts(source),
125  fMinVtxType(source.fMinVtxType),
126  fMinVtxContr(source.fMinVtxContr),
127  fMaxVtxRedChi2(source.fMaxVtxRedChi2),
128  fMaxVtxZ(source.fMaxVtxZ),
129  fMinSPDMultiplicity(source.fMinSPDMultiplicity),
130  fTriggerMask(source.fTriggerMask),
131  fUseOnlyOneTrigger(source.fUseOnlyOneTrigger),
132  fTriggerClass(),
133  fTrackCuts(0),
134  fnPtBins(source.fnPtBins),
135  fnPtBinLimits(source.fnPtBinLimits),
136  fPtBinLimits(0),
137  fnVars(source.fnVars),
138  fVarNames(0),
139  fnVarsForOpt(source.fnVarsForOpt),
140  fVarsForOpt(0),
141  fGlobalIndex(source.fGlobalIndex),
142  fCutsRD(0),
143  fIsUpperCut(0),
144  fUsePID(source.fUsePID),
145  fUseAOD049(source.fUseAOD049),
146  fPidHF(0),
147  fWhyRejection(source.fWhyRejection),
148  fEvRejectionBits(source.fEvRejectionBits),
149  fRemoveDaughtersFromPrimary(source.fRemoveDaughtersFromPrimary),
150  fUseMCVertex(source.fUseMCVertex),
151  fUsePhysicsSelection(source.fUsePhysicsSelection),
152  fOptPileup(source.fOptPileup),
153  fMinContrPileup(source.fMinContrPileup),
154  fMinDzPileup(source.fMinDzPileup),
155  fUseCentrality(source.fUseCentrality),
156  fMinCentrality(source.fMinCentrality),
157  fMaxCentrality(source.fMaxCentrality),
158  fFixRefs(source.fFixRefs),
159  fIsSelectedCuts(source.fIsSelectedCuts),
160  fIsSelectedPID(source.fIsSelectedPID),
161  fMinPtCand(source.fMinPtCand),
162  fMaxPtCand(source.fMaxPtCand),
163  fMaxRapidityCand(source.fMaxRapidityCand),
164  fKeepSignalMC(source.fKeepSignalMC),
165  fIsCandTrackSPDFirst(source.fIsCandTrackSPDFirst),
166  fMaxPtCandTrackSPDFirst(source.fMaxPtCandTrackSPDFirst),
167  fApplySPDDeadPbPb2011(source.fApplySPDDeadPbPb2011),
168  fApplySPDMisalignedPP2012(source.fApplySPDMisalignedPP2012),
169  fMaxDiffTRKV0Centr(source.fMaxDiffTRKV0Centr),
170  fRemoveTrackletOutliers(source.fRemoveTrackletOutliers),
171  fCutOnzVertexSPD(source.fCutOnzVertexSPD),
172  fKinkReject(source.fKinkReject),
173  fUseTrackSelectionWithFilterBits(source.fUseTrackSelectionWithFilterBits),
174  fUseCentrFlatteningInMC(source.fUseCentrFlatteningInMC),
175  fHistCentrDistr(0x0),
176  fCutRatioClsOverCrossRowsTPC(source.fCutRatioClsOverCrossRowsTPC),
177  fCutRatioSignalNOverCrossRowsTPC(source.fCutRatioSignalNOverCrossRowsTPC),
178  fCutMinCrossedRowsTPCPtDep(""),
179  f1CutMinNCrossedRowsTPCPtDep(0x0)
180 {
181  //
182  // Copy constructor
183  //
184  cout<<"Copy constructor"<<endl;
185  fTriggerClass[0] = source.fTriggerClass[0];
186  fTriggerClass[1] = source.fTriggerClass[1];
187  if(source.GetTrackCuts()) AddTrackCuts(source.GetTrackCuts());
188  if(source.fPtBinLimits) SetPtBins(source.fnPtBinLimits,source.fPtBinLimits);
189  if(source.fVarNames) SetVarNames(source.fnVars,source.fVarNames,source.fIsUpperCut);
190  if(source.fCutsRD) SetCuts(source.fGlobalIndex,source.fCutsRD);
191  if(source.fVarsForOpt) SetVarsForOpt(source.fnVarsForOpt,source.fVarsForOpt);
192  if(source.fPidHF) SetPidHF(source.fPidHF);
193  if(source.fHistCentrDistr) fHistCentrDistr=(TH1F*)(source.fHistCentrDistr->Clone());
196  PrintAll();
197 
198 }
199 //--------------------------------------------------------------------------
201 {
202  //
203  // assignment operator
204  //
205  if(&source == this) return *this;
206 
207  AliAnalysisCuts::operator=(source);
208 
209  fMinVtxType=source.fMinVtxType;
210  fMinVtxContr=source.fMinVtxContr;
212  fMaxVtxZ=source.fMaxVtxZ;
214  fTriggerMask=source.fTriggerMask;
216  fTriggerClass[0]=source.fTriggerClass[0];
217  fTriggerClass[1]=source.fTriggerClass[1];
218  fnPtBins=source.fnPtBins;
220  fnVars=source.fnVars;
221  fGlobalIndex=source.fGlobalIndex;
222  fnVarsForOpt=source.fnVarsForOpt;
223  fUsePID=source.fUsePID;
224  fUseAOD049=source.fUseAOD049;
225  if(fPidHF) delete fPidHF;
226  fPidHF=new AliAODPidHF(*(source.GetPidHF()));
230  fUseMCVertex=source.fUseMCVertex;
232  fOptPileup=source.fOptPileup;
234  fMinDzPileup=source.fMinDzPileup;
238  fFixRefs=source.fFixRefs;
241  fMinPtCand=source.fMinPtCand;
242  fMaxPtCand=source.fMaxPtCand;
252  fKinkReject=source.fKinkReject;
254  if(fHistCentrDistr) delete fHistCentrDistr;
256  if(source.fHistCentrDistr)fHistCentrDistr=(TH1F*)(source.fHistCentrDistr->Clone());
257 
258  if(source.GetTrackCuts()) {delete fTrackCuts; fTrackCuts=new AliESDtrackCuts(*(source.GetTrackCuts()));}
259  if(source.fPtBinLimits) SetPtBins(source.fnPtBinLimits,source.fPtBinLimits);
260  if(source.fVarNames) SetVarNames(source.fnVars,source.fVarNames,source.fIsUpperCut);
261  if(source.fCutsRD) SetCuts(source.fGlobalIndex,source.fCutsRD);
262  if(source.fVarsForOpt) SetVarsForOpt(source.fnVarsForOpt,source.fVarsForOpt);
263 
269  PrintAll();
270 
271  return *this;
272 }
273 //--------------------------------------------------------------------------
275  //
276  // Default Destructor
277  //
278  if(fTrackCuts) { delete fTrackCuts; fTrackCuts=0; }
279  if(fPtBinLimits) {delete [] fPtBinLimits; fPtBinLimits=0;}
280  if(fVarNames) {delete [] fVarNames; fVarNames=0;}
281  if(fVarsForOpt) {delete [] fVarsForOpt; fVarsForOpt=0;}
282  if(fCutsRD) {
283  delete [] fCutsRD;
284  fCutsRD=0;
285  }
286  if(fIsUpperCut) {delete [] fIsUpperCut; fIsUpperCut=0;}
287  if(fPidHF){
288  delete fPidHF;
289  fPidHF=0;
290  }
292 
296  }
297 
298 }
299 //---------------------------------------------------------------------------
301  //
302  // Centrality selection
303  //
304  if(fUseCentrality<kCentOff||fUseCentrality>=kCentInvalid){
305  AliWarning("Centrality estimator not valid");
306  return 3;
307  }else{
308  Float_t centvalue=GetCentrality((AliAODEvent*)event);
309  if (centvalue<-998.){//-999 if no centralityP
310  return 0;
311  }else{
312  if (centvalue<fMinCentrality || centvalue>fMaxCentrality){
313  return 2;
314  }
315  // selection to flatten the centrality distribution
316  if(fHistCentrDistr){
317  if(!IsEventSelectedForCentrFlattening(centvalue))return 4;
318  }
319  }
320  }
321  return 0;
322 }
323 
324 
325 //-------------------------------------------------
326 void AliRDHFCuts::SetHistoForCentralityFlattening(TH1F *h,Double_t minCentr,Double_t maxCentr,Double_t centrRef,Int_t switchTRand){
327  // set the histo for centrality flattening
328  // the centrality is flatten in the range minCentr,maxCentr
329  // if centrRef is zero, the minimum in h within (minCentr,maxCentr) defines the reference
330  // positive, the value of h(centrRef) defines the reference (-> the centrality distribution might be not flat in the whole desired range)
331  // 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)
332  // 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
333 
334  if(maxCentr<minCentr){
335  AliWarning("AliRDHFCuts::Wrong centralities values while setting the histogram for centrality flattening");
336  }
337 
339  fHistCentrDistr=(TH1F*)h->Clone("hCentralityFlat");
340  fHistCentrDistr->SetTitle("Reference histo for centrality flattening");
341  Int_t minbin=fHistCentrDistr->FindBin(minCentr*1.00001); // fast if fix bin width
342  Int_t maxbin=fHistCentrDistr->FindBin(maxCentr*0.9999);
343  fHistCentrDistr->GetXaxis()->SetRange(minbin,maxbin);
344  Double_t ref=0.,bincont=0.,binrefwidth=1.;
345  Int_t binref=0;
346  if(TMath::Abs(centrRef)<0.0001){
347  binref=fHistCentrDistr->GetMinimumBin();
348  binrefwidth=fHistCentrDistr->GetBinWidth(binref);
349  ref=fHistCentrDistr->GetBinContent(binref)/binrefwidth;
350  }
351  else if(centrRef>0.){
352  binref=h->FindBin(centrRef);
353  if(binref<1||binref>h->GetNbinsX()){
354  AliWarning("AliRDHFCuts::Wrong centrality reference value while setting the histogram for centrality flattening");
355  }
356  binrefwidth=fHistCentrDistr->GetBinWidth(binref);
357  ref=fHistCentrDistr->GetBinContent(binref)/binrefwidth;
358  }
359  else{
360  if(centrRef<-1) AliWarning("AliRDHFCuts: with this centrality reference no flattening will be applied");
361  binref=fHistCentrDistr->GetMaximumBin();
362  binrefwidth=fHistCentrDistr->GetBinWidth(binref);
363  ref=fHistCentrDistr->GetMaximum()*TMath::Abs(centrRef)/binrefwidth;
364  }
365 
366  for(Int_t j=1;j<=h->GetNbinsX();j++){// Now set the "probabilities"
367  if(h->GetBinLowEdge(j)*1.0001>=minCentr&&h->GetBinLowEdge(j+1)*0.9999<=maxCentr){
368  bincont=h->GetBinContent(j);
369  fHistCentrDistr->SetBinContent(j,ref/bincont*h->GetBinWidth(j));
370  fHistCentrDistr->SetBinError(j,h->GetBinError(j)*ref/bincont);
371  }
372  else{
373  h->SetBinContent(j,1.1);// prob > 1 to assure that events will not be rejected
374  }
375  }
376 
377  fHistCentrDistr->SetBinContent(0,switchTRand);
378  return;
379 
380 }
381 
382 //-------------------------------------------------
384  //
385  // Random event selection, based on fHistCentrDistr, to flatten the centrality distribution
386  // Can be faster if it was required that fHistCentrDistr covers
387  // exactly the desired centrality range (e.g. part of the lines below should be done during the
388  // setting of the histo) and TH1::SetMinimum called
389  //
390 
391  if(!fHistCentrDistr) return kTRUE;
392  // Int_t maxbin=fHistCentrDistr->FindBin(fMaxCentrality*0.9999);
393  // if(maxbin>fHistCentrDistr->GetNbinsX()){
394  // AliWarning("AliRDHFCuts: The maximum centrality exceeds the x-axis limit of the histogram for centrality flattening");
395  // }
396 
397  Int_t bin=fHistCentrDistr->FindBin(centvalue); // Fast if the histo has a fix bin
398  Double_t bincont=fHistCentrDistr->GetBinContent(bin);
399  Double_t centDigits=centvalue-(Int_t)(centvalue*100.)/100.;// this is to extract a random number between 0 and 0.01
400 
401  if(fHistCentrDistr->GetBinContent(0)<-0.9999){
402  if(gRandom->Uniform(1.)<bincont)return kTRUE;
403  return kFALSE;
404  }
405 
406  if(centDigits*100.<bincont)return kTRUE;
407  return kFALSE;
408 
409 }
410 //---------------------------------------------------------------------------
411 void AliRDHFCuts::SetupPID(AliVEvent *event) {
412  // Set the PID response object in the AliAODPidHF
413  // in case of old PID sets the TPC dE/dx BB parameterization
414 
415  if(fPidHF){
416  if(fPidHF->GetPidResponse()==0x0){
417  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
418  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
419  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
420  fPidHF->SetPidResponse(pidResp);
421  }
423  if(fPidHF->GetOldPid()) {
424 
425  Bool_t isMC=kFALSE;
426  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)event)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
427  if(mcArray) {isMC=kTRUE;fUseAOD049=kFALSE;}
428 
429  // pp, from LHC10d onwards
430  if((event->GetRunNumber()>121693 && event->GetRunNumber()<136851) ||
431  event->GetRunNumber()>139517) fPidHF->SetOnePad(kTRUE);
432  // pp, 2011 low energy run
433  if((event->GetRunNumber()>=146686 && event->GetRunNumber()<=146860)){
434  fPidHF->SetppLowEn2011(kTRUE);
435  fPidHF->SetOnePad(kFALSE);
436  }
437  // PbPb LHC10h
438  if(event->GetRunNumber()>=136851 && event->GetRunNumber()<=139517) fPidHF->SetPbPb(kTRUE);
439  // MC
440  if(isMC) fPidHF->SetMC(kTRUE);
441  if(isMC && (event->GetRunNumber()>=146686 && event->GetRunNumber()<=146860))
442  fPidHF->SetMClowenpp2011(kTRUE);
444  }else{
445  // check that AliPIDResponse object was properly set in case of using OADB
446  if(fPidHF->GetPidResponse()==0x0) AliFatal("AliPIDResponse object not set");
447  }
448  }
449 }
450 //---------------------------------------------------------------------------
451 Bool_t AliRDHFCuts::IsEventSelected(AliVEvent *event) {
452  //
453  // Event selection
454  //
455  //if(fTriggerMask && event->GetTriggerMask()!=fTriggerMask) return kFALSE;
456 
457 
458 
459  fWhyRejection=0;
461  Bool_t accept=kTRUE;
462 
463 
464  // check if it's MC
465  Bool_t isMC=kFALSE;
466  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)event)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
467  if(mcArray) {isMC=kTRUE;fUseAOD049=kFALSE;}
468 
469 
470  SetupPID(event);
471 
472  // trigger class
473  TString firedTriggerClasses=((AliAODEvent*)event)->GetFiredTriggerClasses();
474  // don't do for MC and for PbPb 2010 data
475  if(!isMC && (event->GetRunNumber()<136851 || event->GetRunNumber()>139517)) {
476  if(!firedTriggerClasses.Contains(fTriggerClass[0].Data()) &&
477  (fTriggerClass[1].CompareTo("")==0 || !firedTriggerClasses.Contains(fTriggerClass[1].Data())) ) {
478  fWhyRejection=5;
480  accept=kFALSE;
481  }
482  }
483 
484  // TEMPORARY FIX FOR GetEvent
485  Int_t nTracks=((AliAODEvent*)event)->GetNumberOfTracks();
486  for(Int_t itr=0; itr<nTracks; itr++){
487  AliAODTrack* tr=(AliAODTrack*)((AliAODEvent*)event)->GetTrack(itr);
488  tr->SetAODEvent((AliAODEvent*)event);
489  }
490 
491  // TEMPORARY FIX FOR REFERENCES
492  // Fix references to daughter tracks
493  // if(fFixRefs) {
494  // AliAnalysisVertexingHF *fixer = new AliAnalysisVertexingHF();
495  // fixer->FixReferences((AliAODEvent*)event);
496  // delete fixer;
497  // }
498  //
499 
500 
501  // physics selection requirements
503  Bool_t isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fTriggerMask);
504  if(!isSelected) {
505  if(accept) fWhyRejection=7;
507  accept=kFALSE;
508  }else{
509  if(fUseOnlyOneTrigger){
510  if(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()!=fTriggerMask){
511  if(accept) fWhyRejection=7;
513  accept=kFALSE;
514  }
515  }
516  }
517  }
518 
519  // vertex requirements
520 
521  const AliVVertex *vertex = event->GetPrimaryVertex();
522 
523  if(!vertex){
524  accept=kFALSE;
526  }else{
527  TString title=vertex->GetTitle();
528  if(title.Contains("Z") && fMinVtxType>1){
529  accept=kFALSE;
531  }
532  else if(title.Contains("3D") && fMinVtxType>2){
533  accept=kFALSE;
535  }
536  if(vertex->GetNContributors()<fMinVtxContr){
537  accept=kFALSE;
539  }
540  if(TMath::Abs(vertex->GetZ())>fMaxVtxZ) {
542  if(accept) fWhyRejection=6;
543  accept=kFALSE;
544  }
545  }
546 
547  if(fCutOnzVertexSPD>0){
548  const AliVVertex *vSPD = ((AliAODEvent*)event)->GetPrimaryVertexSPD();
549  if(!vSPD || (vSPD && vSPD->GetNContributors()<fMinVtxContr)){
550  accept=kFALSE;
552  }else{
553  if(fCutOnzVertexSPD==1 && TMath::Abs(vSPD->GetZ())>12.) {
555  if(accept) fWhyRejection=6;
556  accept=kFALSE;
557  }
558  if(fCutOnzVertexSPD==2 && vertex){
559  if(TMath::Abs(vSPD->GetZ()-vertex->GetZ())>0.5) {
561  if(accept) fWhyRejection=6;
562  accept=kFALSE;
563  }
564  }
565  }
566  }
567 
568  // pile-up rejection
570  Int_t cutc=(Int_t)fMinContrPileup;
571  Double_t cutz=(Double_t)fMinDzPileup;
572  if(event->IsPileupFromSPD(cutc,cutz,3.,2.,10.)) {
573  if(accept) fWhyRejection=1;
575  accept=kFALSE;
576  }
577  }
579  AliAnalysisUtils utils;
580  Bool_t isPUMV = utils.IsPileUpMV(event);
581  if(isPUMV) {
582  if(accept) fWhyRejection=1;
584  accept=kFALSE;
585  }
586  }
587 
588  // centrality selection
589  if (fUseCentrality!=kCentOff) {
590  Int_t rejection=IsEventSelectedInCentrality(event);
591  Bool_t okCent=kFALSE;
592  if(rejection==0) okCent=kTRUE;
593  if(isMC && rejection==4 && !fUseCentrFlatteningInMC) okCent=kTRUE;
594  if(!okCent){
595  if(accept) fWhyRejection=rejection;
598  accept=kFALSE;
599  }
600 
601  }
602 
603  // PbPb2011 outliers in tracklets vs. VZERO and centTRK vs. centV0
604  if(event->GetRunNumber()>=167693 && event->GetRunNumber()<=170593){
606  Double_t v0cent=GetCentrality((AliAODEvent*)event,kCentV0M);
607  Double_t ntracklets=((AliAODEvent*)event)->GetTracklets()->GetNumberOfTracklets();
608  Double_t cutval=60.-0.08*ntracklets+1./50000.*ntracklets*ntracklets;
609  if(ntracklets<1000. && v0cent<cutval){
610  if(accept) fWhyRejection=2;
612  accept=kFALSE;
613  }
614  }
615  if(fMaxDiffTRKV0Centr>0.){
616  Double_t v0cent=GetCentrality((AliAODEvent*)event,kCentV0M);
617  Double_t trkcent=GetCentrality((AliAODEvent*)event,kCentTRK);
618  if(TMath::Abs(trkcent-v0cent)>fMaxDiffTRKV0Centr){
619  if(accept) fWhyRejection=1;
621  accept=kFALSE;
622  }
623  }
624  }
625 
626  // Correcting PP2012 flag to remoce tracks crossing SPD misaligned staves for periods 12def
627  if(fApplySPDMisalignedPP2012 && !(event->GetRunNumber()>=195681 && event->GetRunNumber()<=197388)) fApplySPDMisalignedPP2012=false;
628 
629  return accept;
630 }
631 //---------------------------------------------------------------------------
633  //
634  // Daughter tracks selection
635  //
636  if(!fTrackCuts) return kTRUE;
637 
638  Int_t ndaughters = d->GetNDaughters();
639  AliAODVertex *vAOD = d->GetPrimaryVtx();
640  Double_t pos[3],cov[6];
641  vAOD->GetXYZ(pos);
642  vAOD->GetCovarianceMatrix(cov);
643  const AliESDVertex vESD(pos,cov,100.,100);
644 
645  Bool_t retval=kTRUE;
646 
647  for(Int_t idg=0; idg<ndaughters; idg++) {
648  AliAODTrack *dgTrack = (AliAODTrack*)d->GetDaughter(idg);
649  if(!dgTrack) {retval = kFALSE; continue;}
650  //printf("charge %d\n",dgTrack->Charge());
651  if(dgTrack->Charge()==0) continue; // it's not a track, but a V0
652 
654  { if(!dgTrack->HasPointOnITSLayer(0)) { retval = kFALSE; continue; } }
655 
656  if(!IsDaughterSelected(dgTrack,&vESD,fTrackCuts)) retval = kFALSE;
657  }
658 
659  return retval;
660 }
661 //---------------------------------------------------------------------------
662 Bool_t AliRDHFCuts::CheckPtDepCrossedRows(TString rows,Bool_t print) const {
663  //
664  // Check the correctness of the string syntax
665  //
666  Bool_t retval=kTRUE;
667 
668  if(!rows.Contains("pt")) {
669  if(print) AliError("string must contain \"pt\"");
670  retval= kFALSE;
671  }
672  return retval;
673 }
674 //---------------------------------------------------------------------------
676  //
677  //Create the TFormula from TString for TPC crossed rows pT dependent cut
678  //
679 
680 
681  // setting data member that describes the TPC crossed rows pT dependent cut
683 
684  // creating TFormula from TString
687  // resetting TFormula
689  }
690  if(!CheckPtDepCrossedRows(rows,kTRUE))return;
691 
692  TString tmp(rows);
693  tmp.ReplaceAll("pt","x");
694  f1CutMinNCrossedRowsTPCPtDep = new TFormula("f1CutMinNCrossedRowsTPCPtDep",tmp.Data());
695 
696 
697 }
698 //---------------------------------------------------------------------------
699 Bool_t AliRDHFCuts::IsDaughterSelected(AliAODTrack *track,const AliESDVertex *primary,AliESDtrackCuts *cuts) const{
700  //
701  // Convert to ESDtrack, relate to vertex and check cuts
702  //
703  if(!cuts) return kTRUE;
704 
705  if(cuts->GetFlagCutTOFdistance()) cuts->SetFlagCutTOFdistance(kFALSE);
706 
707 
708  // convert to ESD track here
709  AliESDtrack esdTrack(track);
710  // set the TPC cluster info
711  esdTrack.SetTPCClusterMap(track->GetTPCClusterMap());
712  esdTrack.SetTPCSharedMap(track->GetTPCSharedMap());
713  esdTrack.SetTPCPointsF(track->GetTPCNclsF());
714  // needed to calculate the impact parameters
715  esdTrack.RelateToVertex(primary,0.,3.);
716 
717  //applying ESDtrackCut
718  if(!cuts->IsSelected(&esdTrack)) return kFALSE;
719 
720  //appliyng kink rejection
721  if(fKinkReject){
722  AliAODVertex *maybeKink=track->GetProdVertex();
723  if(maybeKink->GetType()==AliAODVertex::kKink) return kFALSE;
724  }
725 
726  //appliyng TPC crossed rows pT dependent cut
728  Float_t nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
729  if(nCrossedRowsTPC<f1CutMinNCrossedRowsTPCPtDep->Eval(esdTrack.Pt())) return kFALSE;
730  }
731 
732  //appliyng NTPCcls/NTPCcrossedRows cut
734  Float_t nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
735  Float_t nClustersTPC = esdTrack.GetTPCNcls();
736  if(nCrossedRowsTPC!=0){
737  Float_t ratio = nClustersTPC/nCrossedRowsTPC;
738  if(ratio<fCutRatioClsOverCrossRowsTPC) return kFALSE;
739  }
740  else return kFALSE;
741  }
742 
743  //appliyng TPCsignalN/NTPCcrossedRows cut
745  Float_t nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
746  Float_t nTPCsignal = esdTrack.GetTPCsignalN();
747  if(nCrossedRowsTPC!=0){
748  Float_t ratio = nTPCsignal/nCrossedRowsTPC;
749  if(ratio<fCutRatioSignalNOverCrossRowsTPC) return kFALSE;
750  }
751  else return kFALSE;
752  }
753 
754 
756  // to be implemented
757  // we need either to have here the AOD Event,
758  // or to have the pileup vertex object
759  }
760 
762  Bool_t deadSPDLay1PbPb2011[20][4]={
763  {kTRUE,kTRUE,kTRUE,kTRUE},
764  {kTRUE,kTRUE,kTRUE,kTRUE},
765  {kTRUE,kTRUE,kTRUE,kTRUE},
766  {kTRUE,kTRUE,kTRUE,kTRUE},
767  {kTRUE,kTRUE,kTRUE,kTRUE},
768  {kFALSE,kFALSE,kTRUE,kTRUE},
769  {kTRUE,kTRUE,kFALSE,kFALSE},
770  {kTRUE,kTRUE,kTRUE,kTRUE},
771  {kFALSE,kFALSE,kTRUE,kTRUE},
772  {kTRUE,kTRUE,kTRUE,kTRUE},
773  {kTRUE,kTRUE,kFALSE,kFALSE},
774  {kTRUE,kTRUE,kTRUE,kTRUE},
775  {kFALSE,kFALSE,kFALSE,kFALSE},
776  {kFALSE,kFALSE,kTRUE,kTRUE},
777  {kFALSE,kFALSE,kFALSE,kFALSE},
778  {kFALSE,kFALSE,kFALSE,kFALSE},
779  {kTRUE,kTRUE,kTRUE,kTRUE},
780  {kTRUE,kTRUE,kFALSE,kFALSE},
781  {kFALSE,kFALSE,kFALSE,kFALSE},
782  {kFALSE,kFALSE,kFALSE,kFALSE}
783  };
784  Bool_t deadSPDLay2PbPb2011[40][4]={
785  {kTRUE,kTRUE,kTRUE,kTRUE},
786  {kTRUE,kTRUE,kTRUE,kTRUE},
787  {kTRUE,kTRUE,kTRUE,kTRUE},
788  {kTRUE,kTRUE,kTRUE,kTRUE},
789  {kTRUE,kTRUE,kTRUE,kTRUE},
790  {kTRUE,kTRUE,kTRUE,kTRUE},
791  {kTRUE,kTRUE,kTRUE,kTRUE},
792  {kTRUE,kTRUE,kTRUE,kTRUE},
793  {kTRUE,kTRUE,kTRUE,kTRUE},
794  {kTRUE,kTRUE,kTRUE,kTRUE},
795  {kTRUE,kTRUE,kTRUE,kTRUE},
796  {kTRUE,kTRUE,kTRUE,kTRUE},
797  {kFALSE,kFALSE,kFALSE,kFALSE},
798  {kFALSE,kFALSE,kTRUE,kTRUE},
799  {kTRUE,kTRUE,kTRUE,kTRUE},
800  {kTRUE,kTRUE,kTRUE,kTRUE},
801  {kTRUE,kTRUE,kFALSE,kFALSE},
802  {kTRUE,kTRUE,kTRUE,kTRUE},
803  {kTRUE,kTRUE,kTRUE,kTRUE},
804  {kTRUE,kTRUE,kTRUE,kTRUE},
805  {kFALSE,kFALSE,kFALSE,kFALSE},
806  {kFALSE,kFALSE,kFALSE,kFALSE},
807  {kTRUE,kTRUE,kTRUE,kTRUE},
808  {kTRUE,kTRUE,kTRUE,kTRUE},
809  {kFALSE,kFALSE,kFALSE,kFALSE},
810  {kFALSE,kFALSE,kFALSE,kFALSE},
811  {kTRUE,kTRUE,kTRUE,kTRUE},
812  {kTRUE,kTRUE,kTRUE,kTRUE},
813  {kFALSE,kFALSE,kFALSE,kFALSE},
814  {kFALSE,kFALSE,kFALSE,kFALSE},
815  {kFALSE,kFALSE,kFALSE,kFALSE},
816  {kFALSE,kFALSE,kFALSE,kFALSE},
817  {kTRUE,kTRUE,kTRUE,kTRUE},
818  {kTRUE,kTRUE,kTRUE,kTRUE},
819  {kTRUE,kTRUE,kFALSE,kFALSE},
820  {kTRUE,kTRUE,kTRUE,kTRUE},
821  {kFALSE,kFALSE,kFALSE,kFALSE},
822  {kFALSE,kFALSE,kFALSE,kFALSE},
823  {kFALSE,kFALSE,kFALSE,kFALSE},
824  {kFALSE,kFALSE,kFALSE,kFALSE}
825  };
826  Double_t xyz1[3],xyz2[3];
827  esdTrack.GetXYZAt(3.9,0.,xyz1);
828  esdTrack.GetXYZAt(7.6,0.,xyz2);
829  Double_t phi1=TMath::ATan2(xyz1[1],xyz1[0]);
830  if(phi1<0) phi1+=2*TMath::Pi();
831  Int_t lad1=(Int_t)(phi1/(2.*TMath::Pi()/20.));
832  Double_t phi2=TMath::ATan2(xyz2[1],xyz2[0]);
833  if(phi2<0) phi2+=2*TMath::Pi();
834  Int_t lad2=(Int_t)(phi2/(2.*TMath::Pi()/40.));
835  Int_t mod1=(Int_t)((xyz1[2]+14)/7.);
836  Int_t mod2=(Int_t)((xyz2[2]+14)/7.);
837  Bool_t lay1ok=kFALSE;
838  if(mod1>=0 && mod1<4 && lad1<20){
839  lay1ok=deadSPDLay1PbPb2011[lad1][mod1];
840  }
841  Bool_t lay2ok=kFALSE;
842  if(mod2>=0 && mod2<4 && lad2<40){
843  lay2ok=deadSPDLay2PbPb2011[lad2][mod2];
844  }
845  if(!lay1ok && !lay2ok) return kFALSE;
846  }
847 
849  // Cut tracks crossing the SPD at 5.6<phi<2pi
850  Double_t xyz1[3],xyz2[3];
851  esdTrack.GetXYZAt(3.9,0.,xyz1);
852  esdTrack.GetXYZAt(7.6,0.,xyz2);
853  Double_t phi1=TMath::ATan2(xyz1[1],xyz1[0]);
854  if(phi1<0) phi1+=2*TMath::Pi();
855  Double_t phi2=TMath::ATan2(xyz2[1],xyz2[0]);
856  if(phi2<0) phi2+=2*TMath::Pi();
857  Bool_t lay1ok=kTRUE;
858  if(phi1>5.6 && phi1<2.*TMath::Pi()) lay1ok=kFALSE;
859  Bool_t lay2ok=kTRUE;
860  if(phi2>5.6 && phi2<2.*TMath::Pi()) lay2ok=kFALSE;
861  if(!lay1ok || !lay2ok) return kFALSE;
862  }
863 
864  return kTRUE;
865 }
866 //---------------------------------------------------------------------------
867 void AliRDHFCuts::SetPtBins(Int_t nPtBinLimits,Float_t *ptBinLimits) {
868  // Set the pt bins
869 
870  if(fPtBinLimits) {
871  delete [] fPtBinLimits;
872  fPtBinLimits = NULL;
873  printf("Changing the pt bins\n");
874  }
875 
876  if(nPtBinLimits != fnPtBins+1){
877  cout<<"Warning: ptBinLimits dimention "<<nPtBinLimits<<" != nPtBins+1 ("<<fnPtBins+1<<")\nSetting nPtBins to "<<nPtBinLimits-1<<endl;
878  SetNPtBins(nPtBinLimits-1);
879  }
880 
881  fnPtBinLimits = nPtBinLimits;
882  SetGlobalIndex();
883  //cout<<"Changing also Global Index -> "<<fGlobalIndex<<endl;
884  fPtBinLimits = new Float_t[fnPtBinLimits];
885  for(Int_t ib=0; ib<nPtBinLimits; ib++) fPtBinLimits[ib]=ptBinLimits[ib];
886 
887  return;
888 }
889 //---------------------------------------------------------------------------
890 void AliRDHFCuts::SetVarNames(Int_t nVars,TString *varNames,Bool_t *isUpperCut){
891  // Set the variable names
892 
893  if(fVarNames) {
894  delete [] fVarNames;
895  fVarNames = NULL;
896  //printf("Changing the variable names\n");
897  }
898  if(nVars!=fnVars){
899  printf("Wrong number of variables: it has to be %d\n",fnVars);
900  return;
901  }
902  //fnVars=nVars;
903  fVarNames = new TString[nVars];
904  fIsUpperCut = new Bool_t[nVars];
905  for(Int_t iv=0; iv<nVars; iv++) {
906  fVarNames[iv] = varNames[iv];
907  fIsUpperCut[iv] = isUpperCut[iv];
908  }
909 
910  return;
911 }
912 //---------------------------------------------------------------------------
913 void AliRDHFCuts::SetVarsForOpt(Int_t nVars,Bool_t *forOpt) {
914  // Set the variables to be used for cuts optimization
915 
916  if(fVarsForOpt) {
917  delete [] fVarsForOpt;
918  fVarsForOpt = NULL;
919  //printf("Changing the variables for cut optimization\n");
920  }
921 
922  if(nVars==0){
923  printf("%d not accepted as number of variables: it has to be %d\n",nVars,fnVars);
924  return;
925  }
926 
927  fnVarsForOpt = 0;
928  fVarsForOpt = new Bool_t[fnVars];
929  for(Int_t iv=0; iv<fnVars; iv++) {
930  fVarsForOpt[iv]=forOpt[iv];
931  if(fVarsForOpt[iv]) fnVarsForOpt++;
932  }
933 
934  return;
935 }
936 
937 //---------------------------------------------------------------------------
939  //
940  // set centrality estimator
941  //
942  fUseCentrality=flag;
943  if(fUseCentrality<kCentOff||fUseCentrality>=kCentInvalid) AliWarning("Centrality estimator not valid");
944 
945  return;
946 }
947 
948 
949 //---------------------------------------------------------------------------
950 void AliRDHFCuts::SetCuts(Int_t nVars,Int_t nPtBins,Float_t **cutsRD) {
951  //
952  // store the cuts
953  //
954  if(nVars!=fnVars) {
955  printf("Wrong number of variables: it has to be %d\n",fnVars);
956  AliFatal("exiting");
957  }
958  if(nPtBins!=fnPtBins) {
959  printf("Wrong number of pt bins: it has to be %d\n",fnPtBins);
960  AliFatal("exiting");
961  }
962 
963  if(!fCutsRD) fCutsRD = new Float_t[fGlobalIndex];
964 
965 
966  for(Int_t iv=0; iv<fnVars; iv++) {
967 
968  for(Int_t ib=0; ib<fnPtBins; ib++) {
969 
970  //check
971  if(GetGlobalIndex(iv,ib)>=fGlobalIndex) {
972  cout<<"Overflow, exit..."<<endl;
973  return;
974  }
975 
976  fCutsRD[GetGlobalIndex(iv,ib)] = cutsRD[iv][ib];
977 
978  }
979  }
980  return;
981 }
982 //---------------------------------------------------------------------------
983 void AliRDHFCuts::SetCuts(Int_t glIndex,Float_t* cutsRDGlob){
984  //
985  // store the cuts
986  //
987  if(glIndex != fGlobalIndex){
988  cout<<"Wrong array size: it has to be "<<fGlobalIndex<<endl;
989  AliFatal("exiting");
990  }
991  if(!fCutsRD) fCutsRD = new Float_t[fGlobalIndex];
992 
993  for(Int_t iGl=0;iGl<fGlobalIndex;iGl++){
994  fCutsRD[iGl] = cutsRDGlob[iGl];
995  }
996  return;
997 }
998 //---------------------------------------------------------------------------
999 void AliRDHFCuts::PrintAll() const {
1000  //
1001  // print all cuts values
1002  //
1003 
1004  printf("Minimum vtx type %d\n",fMinVtxType);
1005  printf("Minimum vtx contr %d\n",fMinVtxContr);
1006  printf("Max vtx red chi2 %f\n",fMaxVtxRedChi2);
1007  printf("Min SPD mult %d\n",fMinSPDMultiplicity);
1008  printf("Use PID %d OldPid=%d\n",(Int_t)fUsePID,fPidHF ? fPidHF->GetOldPid() : -1);
1009  printf("Remove daughters from vtx %d\n",(Int_t)fRemoveDaughtersFromPrimary);
1010  printf("Physics selection: %s\n",fUsePhysicsSelection ? "Yes" : "No");
1011  printf("Pileup rejection: %s\n",(fOptPileup > 0) ? "Yes" : "No");
1012  if(fOptPileup==1) printf(" -- Reject pileup event");
1013  if(fOptPileup==2) printf(" -- Reject tracks from pileup vtx");
1014  if(fUseCentrality>0) {
1015  TString estimator="";
1016  if(fUseCentrality==1) estimator = "V0";
1017  if(fUseCentrality==2) estimator = "Tracks";
1018  if(fUseCentrality==3) estimator = "Tracklets";
1019  if(fUseCentrality==4) estimator = "SPD clusters outer";
1020  if(fUseCentrality==5) estimator = "ZNA";
1021  if(fUseCentrality==6) estimator = "ZPA";
1022  if(fUseCentrality==7) estimator = "V0A";
1023  printf("Centrality class considered: %.1f-%.1f, estimated with %s\n",fMinCentrality,fMaxCentrality,estimator.Data());
1024  }
1025  if(fIsCandTrackSPDFirst) printf("Check for candidates with pt < %2.2f, that daughters fullfill kFirst criteria\n",fMaxPtCandTrackSPDFirst);
1026 
1027  if(fCutRatioClsOverCrossRowsTPC) printf("N TPC Clusters > %f N TPC Crossed Rows\n", fCutRatioClsOverCrossRowsTPC);
1028  if(fCutRatioSignalNOverCrossRowsTPC) printf("N TPC Points for dE/dx > %f N TPC Crossed Rows\n", fCutRatioSignalNOverCrossRowsTPC);
1029  if(f1CutMinNCrossedRowsTPCPtDep) printf("N TPC Crossed Rows pT-dependent cut: %s\n", fCutMinCrossedRowsTPCPtDep.Data());
1030 
1031  if(fVarNames){
1032  cout<<"Array of variables"<<endl;
1033  for(Int_t iv=0;iv<fnVars;iv++){
1034  cout<<fVarNames[iv]<<"\t";
1035  }
1036  cout<<endl;
1037  }
1038  if(fVarsForOpt){
1039  cout<<"Array of optimization"<<endl;
1040  for(Int_t iv=0;iv<fnVars;iv++){
1041  cout<<fVarsForOpt[iv]<<"\t";
1042  }
1043  cout<<endl;
1044  }
1045  if(fIsUpperCut){
1046  cout<<"Array of upper/lower cut"<<endl;
1047  for(Int_t iv=0;iv<fnVars;iv++){
1048  cout<<fIsUpperCut[iv]<<"\t";
1049  }
1050  cout<<endl;
1051  }
1052  if(fPtBinLimits){
1053  cout<<"Array of ptbin limits"<<endl;
1054  for(Int_t ib=0;ib<fnPtBinLimits;ib++){
1055  cout<<fPtBinLimits[ib]<<"\t";
1056  }
1057  cout<<endl;
1058  }
1059  if(fCutsRD){
1060  cout<<"Matrix of cuts"<<endl;
1061  for(Int_t iv=0;iv<fnVars;iv++){
1062  for(Int_t ib=0;ib<fnPtBins;ib++){
1063  cout<<"fCutsRD["<<iv<<"]["<<ib<<"] = "<<fCutsRD[GetGlobalIndex(iv,ib)]<<"\t";
1064  }
1065  cout<<endl;
1066  }
1067  cout<<endl;
1068  }
1069  if(fPidHF) fPidHF->PrintAll();
1070  return;
1071 }
1072 
1073 //--------------------------------------------------------------------------
1075  // print the trigger selection
1076 
1077  printf("Selected trigger classes: %s %s\n",fTriggerClass[0].Data(),fTriggerClass[1].Data());
1078 
1079  cout<<" Trigger selection pattern: ";
1080  if( fTriggerMask & AliVEvent::kAny ) cout<<" kAny ";
1081  if( fTriggerMask & AliVEvent::kAnyINT ) cout<<" kAnyINT ";
1082  if( fTriggerMask & AliVEvent::kINT7 ) cout<<" kINT7 ";
1083  if( fTriggerMask & AliVEvent::kMB ) cout<<" kMB ";
1084  if( fTriggerMask & AliVEvent::kCINT5 ) cout<<" kCINT5 ";
1085  if( fTriggerMask & AliVEvent::kCentral ) cout<<" kCentral ";
1086  if( fTriggerMask & AliVEvent::kSemiCentral ) cout<<" kSemiCentral ";
1087  if( fTriggerMask & AliVEvent::kEMCEGA ) cout<<" kEMCEGA ";
1088  if( fTriggerMask & AliVEvent::kHighMult ) cout<<" kHighMult ";
1089  if( fTriggerMask & AliVEvent::kFastOnly ) cout<<" kFastOnly ";
1090  cout << endl<< endl;
1091 
1092 }
1093 
1094 //---------------------------------------------------------------------------
1095 void AliRDHFCuts::GetCuts(Float_t**& cutsRD) const{
1096  //
1097  // get the cuts
1098  //
1099 
1100  //cout<<"Give back a "<<fnVars<<"x"<<fnPtBins<<" matrix."<<endl;
1101 
1102 
1103  Int_t iv,ib;
1104  if(!cutsRD) {
1105  //cout<<"Initialization..."<<endl;
1106  cutsRD=new Float_t*[fnVars];
1107  for(iv=0; iv<fnVars; iv++) {
1108  cutsRD[iv] = new Float_t[fnPtBins];
1109  }
1110  }
1111 
1112  for(Int_t iGlobal=0; iGlobal<fGlobalIndex; iGlobal++) {
1113  GetVarPtIndex(iGlobal,iv,ib);
1114  cutsRD[iv][ib] = fCutsRD[iGlobal];
1115  }
1116 
1117  return;
1118 }
1119 
1120 //---------------------------------------------------------------------------
1121 Int_t AliRDHFCuts::GetGlobalIndex(Int_t iVar,Int_t iPtBin) const{
1122  //
1123  // give the global index from variable and pt bin
1124  //
1125  return iPtBin*fnVars+iVar;
1126 }
1127 
1128 //---------------------------------------------------------------------------
1129 void AliRDHFCuts::GetVarPtIndex(Int_t iGlob, Int_t& iVar, Int_t& iPtBin) const {
1130  //
1131  //give the index of the variable and of the pt bin from the global index
1132  //
1133  iPtBin=(Int_t)iGlob/fnVars;
1134  iVar=iGlob%fnVars;
1135 
1136  return;
1137 }
1138 
1139 //---------------------------------------------------------------------------
1140 Int_t AliRDHFCuts::PtBin(Double_t pt) const {
1141  //
1142  //give the pt bin where the pt lies.
1143  //
1144  Int_t ptbin=-1;
1145  if(pt<fPtBinLimits[0])return ptbin;
1146  for (Int_t i=0;i<fnPtBins;i++){
1147  if(pt<fPtBinLimits[i+1]) {
1148  ptbin=i;
1149  break;
1150  }
1151  }
1152  return ptbin;
1153 }
1154 //-------------------------------------------------------------------
1155 Float_t AliRDHFCuts::GetCutValue(Int_t iVar,Int_t iPtBin) const {
1156  //
1157  // Give the value of cut set for the variable iVar and the pt bin iPtBin
1158  //
1159  if(!fCutsRD){
1160  cout<<"Cuts not iniziaisez yet"<<endl;
1161  return 0;
1162  }
1163  return fCutsRD[GetGlobalIndex(iVar,iPtBin)];
1164 }
1165 
1166 //-------------------------------------------------------------------
1167 Float_t AliRDHFCuts::GetCentrality(AliAODEvent* aodEvent,AliRDHFCuts::ECentrality estimator) {
1168 
1169  if(aodEvent->GetRunNumber()<244824)return GetCentralityOldFramework(aodEvent,estimator);
1170  Double_t cent=-999;
1171  AliMultSelection *multSelection = (AliMultSelection * ) aodEvent->FindListObject("MultSelection");
1172  if(!multSelection){
1173  AliWarning("AliMultSelection could not be found in the aod event list of objects");
1174  return cent;
1175  }
1176  if(estimator==kCentV0M){
1177  cent=multSelection->GetMultiplicityPercentile("V0M");
1178  Int_t qual = multSelection->GetEvSelCode();
1179  if(qual == 199 ) cent=-999;
1180  return cent;
1181  }
1182  else {
1183  AliWarning(Form("CENTRALITY ESTIMATE WITH ESTIMATEOR %d NOT YET IMPLEMENTED FOR NEW FRAMEWORK",(Int_t)estimator));
1184  return cent;
1185  }
1186 
1187 }
1188 //-------------------------------------------------------------------
1189 Float_t AliRDHFCuts::GetCentralityOldFramework(AliAODEvent* aodEvent,AliRDHFCuts::ECentrality estimator) {
1190  //
1191  // Get centrality percentile
1192  //
1193 
1194  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)aodEvent)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1195  if(mcArray) {fUseAOD049=kFALSE;}
1196 
1197  AliAODHeader *header=dynamic_cast<AliAODHeader*>(aodEvent->GetHeader());
1198  if(!header) AliFatal("Not a standard AOD");
1199  AliCentrality *centrality=header->GetCentralityP();
1200  Float_t cent=-999.;
1201  Bool_t isSelRun=kFALSE;
1202  Int_t selRun[5]={138364, 138826, 138828, 138836, 138871};
1203  if(!centrality) return cent;
1204  else{
1205  if (estimator==kCentV0M){
1206  cent=(Float_t)(centrality->GetCentralityPercentile("V0M"));
1207  if(cent<0){
1208  Int_t quality = centrality->GetQuality();
1209  if(quality<=1){ // fQuality==1 means rejected by zVertex cut that we apply a part and we want to keep separate (Giacomo)
1210  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0M");
1211  }else{
1212  Int_t runnum=aodEvent->GetRunNumber();
1213  for(Int_t ir=0;ir<5;ir++){
1214  if(runnum==selRun[ir]){
1215  isSelRun=kTRUE;
1216  break;
1217  }
1218  }
1219  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0M");
1220  }
1221  }
1222 
1223  //temporary fix for AOD049 outliers
1224  if(fUseAOD049&&cent>=0){
1225  Float_t v0=0;
1226  AliAODVZERO* aodV0 = aodEvent->GetVZEROData();
1227  v0+=aodV0->GetMTotV0A();
1228  v0+=aodV0->GetMTotV0C();
1229  if(cent==0&&v0<19500)return -1;//filtering issue
1230  Float_t tkl = (Float_t)(aodEvent->GetTracklets()->GetNumberOfTracklets());
1231  Float_t val= 1.30552 + 0.147931 * v0;
1232  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};
1233  if ( TMath::Abs(tkl-val) > 6.*tklSigma[(Int_t)cent] )return -1;//outlier
1234  }
1235  }
1236  else {
1237  if (estimator==kCentTRK) {
1238  cent=(Float_t)(centrality->GetCentralityPercentile("TRK"));
1239  if(cent<0){
1240  Int_t quality = centrality->GetQuality();
1241  if(quality<=1){
1242  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("TRK");
1243  }else{
1244  Int_t runnum=aodEvent->GetRunNumber();
1245  for(Int_t ir=0;ir<5;ir++){
1246  if(runnum==selRun[ir]){
1247  isSelRun=kTRUE;
1248  break;
1249  }
1250  }
1251  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("TRK");
1252  }
1253  }
1254  }
1255  else{
1256  if (estimator==kCentTKL){
1257  cent=(Float_t)(centrality->GetCentralityPercentile("TKL"));
1258  if(cent<0){
1259  Int_t quality = centrality->GetQuality();
1260  if(quality<=1){
1261  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("TKL");
1262  }else{
1263  Int_t runnum=aodEvent->GetRunNumber();
1264  for(Int_t ir=0;ir<5;ir++){
1265  if(runnum==selRun[ir]){
1266  isSelRun=kTRUE;
1267  break;
1268  }
1269  }
1270  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("TKL");
1271  }
1272  }
1273  }
1274  else{
1275  if (estimator==kCentCL1){
1276  cent=(Float_t)(centrality->GetCentralityPercentile("CL1"));
1277  if(cent<0){
1278  Int_t quality = centrality->GetQuality();
1279  if(quality<=1){
1280  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("CL1");
1281  }else{
1282  Int_t runnum=aodEvent->GetRunNumber();
1283  for(Int_t ir=0;ir<5;ir++){
1284  if(runnum==selRun[ir]){
1285  isSelRun=kTRUE;
1286  break;
1287  }
1288  }
1289  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("CL1");
1290  }
1291  }
1292  }
1293  else{
1294  if (estimator==kCentZNA){
1295  cent=(Float_t)(centrality->GetCentralityPercentile("ZNA"));
1296  if(cent<0){
1297  Int_t quality = centrality->GetQuality();
1298  if(quality<=1){
1299  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("ZNA");
1300  }else{
1301  Int_t runnum=aodEvent->GetRunNumber();
1302  for(Int_t ir=0;ir<5;ir++){
1303  if(runnum==selRun[ir]){
1304  isSelRun=kTRUE;
1305  break;
1306  }
1307  }
1308  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("ZNA");
1309  }
1310  }
1311  }
1312  else{
1313  if (estimator==kCentZPA){
1314  cent=(Float_t)(centrality->GetCentralityPercentile("ZPA"));
1315  if(cent<0){
1316  Int_t quality = centrality->GetQuality();
1317  if(quality<=1){
1318  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("ZPA");
1319  }else{
1320  Int_t runnum=aodEvent->GetRunNumber();
1321  for(Int_t ir=0;ir<5;ir++){
1322  if(runnum==selRun[ir]){
1323  isSelRun=kTRUE;
1324  break;
1325  }
1326  }
1327  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("ZPA");
1328  }
1329  }
1330  }
1331  else{
1332  if (estimator==kCentV0A){
1333  cent=(Float_t)(centrality->GetCentralityPercentile("V0A"));
1334  if(cent<0){
1335  Int_t quality = centrality->GetQuality();
1336  if(quality<=1){
1337  cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0A");
1338  }else{
1339  Int_t runnum=aodEvent->GetRunNumber();
1340  for(Int_t ir=0;ir<5;ir++){
1341  if(runnum==selRun[ir]){
1342  isSelRun=kTRUE;
1343  break;
1344  }
1345  }
1346  if((quality==8||quality==9)&&isSelRun)cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0A");
1347  }
1348  }
1349  }
1350  else {
1351  AliWarning("Centrality estimator not valid");
1352 
1353  }
1354  }
1355  }
1356  }
1357  }
1358  }
1359  }
1360  }
1361  return cent;
1362 }
1363 //-------------------------------------------------------------------
1364 Bool_t AliRDHFCuts::CompareCuts(const AliRDHFCuts *obj) const {
1365  //
1366  // Compare two cuts objects
1367  //
1368 
1369  Bool_t areEqual=kTRUE;
1370 
1371  if(fMinVtxType!=obj->fMinVtxType) { printf("Minimum vtx type %d %d\n",fMinVtxType,obj->fMinVtxType); areEqual=kFALSE;}
1372 
1373  if(fMinVtxContr!=obj->fMinVtxContr) { printf("Minimum vtx contr %d %d\n",fMinVtxContr,obj->fMinVtxContr); areEqual=kFALSE;}
1374 
1375  if(TMath::Abs(fMaxVtxRedChi2-obj->fMaxVtxRedChi2)>1.e-10) { printf("Max vtx red chi2 %f %f\n",fMaxVtxRedChi2,obj->fMaxVtxRedChi2);areEqual=kFALSE;}
1376 
1377  if(fMinSPDMultiplicity!=obj->fMinSPDMultiplicity) { printf("Min SPD mult %d\n %d",fMinSPDMultiplicity,obj->fMinSPDMultiplicity);areEqual=kFALSE;}
1378 
1379  if(fUsePID!=obj->fUsePID) { printf("Use PID %d %d\n",(Int_t)fUsePID,(Int_t)obj->fUsePID); areEqual=kFALSE;}
1380 
1381  if(fRemoveDaughtersFromPrimary!=obj->fRemoveDaughtersFromPrimary) {printf("Remove daughters from vtx %d %d\n",(Int_t)fRemoveDaughtersFromPrimary,(Int_t)obj->fRemoveDaughtersFromPrimary); areEqual=kFALSE;}
1382  if(fTrackCuts){
1383  if(fTrackCuts->GetMinNClusterTPC()!=obj->fTrackCuts->GetMinNClusterTPC()) {printf("MinNClsTPC %d %d\n",fTrackCuts->GetMinNClusterTPC(),obj->fTrackCuts->GetMinNClusterTPC()); areEqual=kFALSE;}
1384 
1385  if(fTrackCuts->GetMinNClustersITS()!=obj->fTrackCuts->GetMinNClustersITS()) {printf("MinNClsITS %d %d\n",fTrackCuts->GetMinNClustersITS(),obj->fTrackCuts->GetMinNClustersITS()); areEqual=kFALSE;}
1386 
1387  if(TMath::Abs(fTrackCuts->GetMaxChi2PerClusterTPC()-obj->fTrackCuts->GetMaxChi2PerClusterTPC())>1.e-10) {printf("MaxChi2ClsTPC %f %f\n",fTrackCuts->GetMaxChi2PerClusterTPC(),obj->fTrackCuts->GetMaxChi2PerClusterTPC()); areEqual=kFALSE;}
1388 
1389  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;}
1390  }
1391 
1392  if(fCutsRD) {
1393  for(Int_t iv=0;iv<fnVars;iv++) {
1394  for(Int_t ib=0;ib<fnPtBins;ib++) {
1395  if(TMath::Abs(fCutsRD[GetGlobalIndex(iv,ib)]-obj->fCutsRD[GetGlobalIndex(iv,ib)])>1.e-10) {
1396  cout<<"fCutsRD["<<iv<<"]["<<ib<<"] = "<<fCutsRD[GetGlobalIndex(iv,ib)]<<" "<<obj->fCutsRD[GetGlobalIndex(iv,ib)]<<"\n";
1397  areEqual=kFALSE;
1398  }
1399  }
1400  }
1401  }
1402 
1403  return areEqual;
1404 }
1405 //---------------------------------------------------------------------------
1407  //
1408  // print cuts values in table format
1409  //
1410 
1411  TString ptString = "pT range";
1412  if(fVarNames && fPtBinLimits && fCutsRD){
1413  TString firstLine(Form("* %-15s",ptString.Data()));
1414  for (Int_t ivar=0; ivar<fnVars; ivar++){
1415  firstLine+=Form("* %-15s ",fVarNames[ivar].Data());
1416  if (ivar == fnVars){
1417  firstLine+="*\n";
1418  }
1419  }
1420  Printf("%s",firstLine.Data());
1421 
1422  for (Int_t ipt=0; ipt<fnPtBins; ipt++){
1423  TString line;
1424  if (ipt==fnPtBins-1){
1425  line=Form("* %5.1f < pt < inf ",fPtBinLimits[ipt]);
1426  }
1427  else{
1428  line=Form("* %5.1f < pt < %4.1f ",fPtBinLimits[ipt],fPtBinLimits[ipt+1]);
1429  }
1430  for (Int_t ivar=0; ivar<fnVars; ivar++){
1431  line+=Form("* %-15f ",fCutsRD[GetGlobalIndex(ivar,ipt)]);
1432  }
1433  Printf("%s",line.Data());
1434  }
1435 
1436  }
1437 
1438 
1439  return;
1440 }
1441 //--------------------------------------------------------------------------
1443  AliAODEvent *aod) const
1444 {
1445  //
1446  // Recalculate primary vertex without daughters
1447  //
1448 
1449  if(!aod) {
1450  AliError("Can not remove daughters from vertex without AOD event");
1451  return 0;
1452  }
1453 
1454  AliAODVertex *recvtx=d->RemoveDaughtersFromPrimaryVtx(aod);
1455  if(!recvtx){
1456  AliDebug(2,"Removal of daughter tracks failed");
1457  return kFALSE;
1458  }
1459 
1460 
1461  //set recalculed primary vertex
1462  d->SetOwnPrimaryVtx(recvtx);
1463  delete recvtx;
1464 
1465  return kTRUE;
1466 }
1467 //--------------------------------------------------------------------------
1468 Bool_t AliRDHFCuts::SetMCPrimaryVtx(AliAODRecoDecayHF *d,AliAODEvent *aod) const
1469 {
1470  //
1471  // Recalculate primary vertex without daughters
1472  //
1473 
1474  if(!aod) {
1475  AliError("Can not get MC vertex without AOD event");
1476  return kFALSE;
1477  }
1478 
1479  // load MC header
1480  AliAODMCHeader *mcHeader =
1481  (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1482  if(!mcHeader) {
1483  AliError("Can not get MC vertex without AODMCHeader event");
1484  return kFALSE;
1485  }
1486  Double_t pos[3];
1487  Double_t covmatrix[6]={0.,0.,0.,0.,0.,0.};
1488  mcHeader->GetVertex(pos);
1489  AliAODVertex *recvtx=new AliAODVertex(pos,covmatrix);
1490 
1491  if(!recvtx){
1492  AliDebug(2,"Removal of daughter tracks failed");
1493  return kFALSE;
1494  }
1495 
1496  //set recalculed primary vertex
1497  d->SetOwnPrimaryVtx(recvtx);
1498 
1499  d->RecalculateImpPars(recvtx,aod);
1500 
1501  delete recvtx;
1502 
1503  return kTRUE;
1504 }
1505 //--------------------------------------------------------------------------
1507  AliAODEvent *aod,
1508  AliAODVertex *origownvtx) const
1509 {
1510  //
1511  // Clean-up own primary vertex if needed
1512  //
1513 
1515  d->UnsetOwnPrimaryVtx();
1516  if(origownvtx) {
1517  d->SetOwnPrimaryVtx(origownvtx);
1518  delete origownvtx; origownvtx=NULL;
1519  }
1520  d->RecalculateImpPars(d->GetPrimaryVtx(),aod);
1521  } else {
1522  if(origownvtx) {
1523  delete origownvtx; origownvtx=NULL;
1524  }
1525  }
1526  return;
1527 }
1528 //--------------------------------------------------------------------------
1529 Bool_t AliRDHFCuts::IsSignalMC(AliAODRecoDecay *d,AliAODEvent *aod,Int_t pdg) const
1530 {
1531  //
1532  // Checks if this candidate is matched to MC signal
1533  //
1534 
1535  if(!aod) return kFALSE;
1536 
1537  // get the MC array
1538  TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)aod)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1539 
1540  if(!mcArray) return kFALSE;
1541 
1542  // try to match
1543  Int_t label = d->MatchToMC(pdg,mcArray);
1544 
1545  if(label>=0) {
1546  //printf("MATCH!\n");
1547  return kTRUE;
1548  }
1549 
1550  return kFALSE;
1551 }
1552 
1553 
1554 //--------------------------------------------------------------------------
1555 Bool_t AliRDHFCuts::RecomputePrimaryVertex(AliAODEvent* event) const{
1556  // recompute event primary vertex from AOD tracks
1557 
1558  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
1559  vertexer->SetITSMode();
1560  vertexer->SetMinClusters(3);
1561 
1562  AliAODVertex* pvtx=event->GetPrimaryVertex();
1563  if(strstr(pvtx->GetTitle(),"VertexerTracksWithConstraint")) {
1564  Float_t diamondcovxy[3];
1565  event->GetDiamondCovXY(diamondcovxy);
1566  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
1567  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
1568  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
1569  vertexer->SetVtxStart(diamond);
1570  delete diamond; diamond=NULL;
1571  }
1572 
1573  AliESDVertex* vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
1574  if(!vertexESD) return kFALSE;
1575  if(vertexESD->GetNContributors()<=0) {
1576  //AliDebug(2,"vertexing failed");
1577  delete vertexESD; vertexESD=NULL;
1578  return kFALSE;
1579  }
1580  delete vertexer; vertexer=NULL;
1581 
1582  // convert to AliAODVertex
1583  Double_t pos[3],cov[6],chi2perNDF;
1584  vertexESD->GetXYZ(pos); // position
1585  vertexESD->GetCovMatrix(cov); //covariance matrix
1586  chi2perNDF = vertexESD->GetChi2toNDF();
1587  delete vertexESD; vertexESD=NULL;
1588 
1589  pvtx->SetPosition(pos[0],pos[1],pos[2]);
1590  pvtx->SetChi2perNDF(chi2perNDF);
1591  pvtx->SetCovMatrix(cov);
1592 
1593  return kTRUE;
1594 }
void SetNPtBins(Int_t nptBins)
Definition: AliRDHFCuts.h:361
Int_t fIsSelectedCuts
fix the daughter track references
Definition: AliRDHFCuts.h:408
Int_t pdg
Bool_t IsEventSelectedForCentrFlattening(Float_t centvalue)
Float_t fMinDzPileup
min. n. of tracklets in pileup vertex
Definition: AliRDHFCuts.h:399
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Double_t fMaxPtCandTrackSPDFirst
flag to select the track kFirst criteria for pt < ptlimit
Definition: AliRDHFCuts.h:415
Int_t fWhyRejection
PID for heavy flavours manager.
Definition: AliRDHFCuts.h:392
Int_t fCutOnzVertexSPD
flag to apply cut on tracklets vs. centrality for 2011 data
Definition: AliRDHFCuts.h:420
void SetupPID(AliVEvent *event)
Bool_t IsSignalMC(AliAODRecoDecay *d, AliAODEvent *aod, Int_t pdg) const
const char * title
Definition: MakeQAPdf.C:26
Bool_t fUseMCVertex
flag to switch on the removal of duaghters from the primary vertex computation
Definition: AliRDHFCuts.h:395
Bool_t fUseOnlyOneTrigger
trigger mask
Definition: AliRDHFCuts.h:374
Int_t IsEventSelectedInCentrality(AliVEvent *event)
Bool_t * fIsUpperCut
Definition: AliRDHFCuts.h:388
Bool_t SetMCPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Bool_t fRemoveDaughtersFromPrimary
Definition: AliRDHFCuts.h:394
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
void SetUseCentrality(Int_t flag=1)
Float_t * fPtBinLimits
"number of limits", that is fnPtBins+1
Definition: AliRDHFCuts.h:381
Int_t fMinVtxContr
0: not cut; 1: SPDZ; 2: SPD3D; 3: Tracks
Definition: AliRDHFCuts.h:369
centrality
Float_t fMaxVtxRedChi2
minimum vertex contributors
Definition: AliRDHFCuts.h:370
void SetMClowenpp2011(Bool_t mc)
Definition: AliAODPidHF.h:102
const Float_t * GetCuts() const
Definition: AliRDHFCuts.h:238
void SetMinCrossedRowsTPCPtDep(const char *rows="")
Float_t fCutRatioClsOverCrossRowsTPC
histogram with reference centrality distribution for centrality distribution flattening ...
Definition: AliRDHFCuts.h:425
Int_t fMinVtxType
cuts on the event
Definition: AliRDHFCuts.h:368
void SetppLowEn2011(Bool_t opt)
Definition: AliAODPidHF.h:104
Double_t fMaxRapidityCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:412
void SetGlobalIndex()
Definition: AliRDHFCuts.h:196
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Float_t GetCutValue(Int_t iVar, Int_t iPtBin) const
Int_t fUseCentrality
min deltaz between main and pileup vertices
Definition: AliRDHFCuts.h:400
Bool_t fUsePID
Definition: AliRDHFCuts.h:389
TRandom * gRandom
void PrintAll() const
void SetPidHF(AliAODPidHF *pidObj)
see enum below
Definition: AliRDHFCuts.h:210
Bool_t GetOldPid()
Definition: AliAODPidHF.h:157
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:231
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:419
AliRDHFCuts(const Char_t *name="RDHFCuts", const Char_t *title="")
Definition: AliRDHFCuts.cxx:60
ULong64_t fTriggerMask
SPD multiplicity.
Definition: AliRDHFCuts.h:373
Bool_t fUseTrackSelectionWithFilterBits
flag to reject kink daughters
Definition: AliRDHFCuts.h:422
void SetCuts(Int_t nVars, Int_t nPtBins, Float_t **cutsRD)
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:384
virtual ~AliRDHFCuts()
void SetPbPb(Bool_t pbpb)
Definition: AliAODPidHF.h:105
TString * fVarNames
number of cut vars for candidates
Definition: AliRDHFCuts.h:383
Double_t fMaxPtCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:411
AliESDtrackCuts * fTrackCuts
quality cuts on the daughter tracks
Definition: AliRDHFCuts.h:377
void MakeTable() const
Bool_t IsDaughterSelected(AliAODTrack *track, const AliESDVertex *primary, AliESDtrackCuts *cuts) const
Bool_t fFixRefs
maximum centrality for selected events
Definition: AliRDHFCuts.h:407
Bool_t fKeepSignalMC
max rapidity of candidate (if !=-999 overrides IsInFiducialAcceptance)
Definition: AliRDHFCuts.h:413
Bool_t AreDaughtersSelected(AliAODRecoDecayHF *rd) const
Int_t fOptPileup
use Physics selection criteria
Definition: AliRDHFCuts.h:397
AliESDtrackCuts * GetTrackCuts() const
Definition: AliRDHFCuts.h:246
void PrintTrigger() const
Float_t fMaxVtxZ
maximum chi2/ndf
Definition: AliRDHFCuts.h:371
Float_t GetCentrality(AliAODEvent *aodEvent)
Definition: AliRDHFCuts.h:242
Int_t fIsSelectedPID
outcome of cuts selection
Definition: AliRDHFCuts.h:409
Float_t fMinCentrality
Definition: AliRDHFCuts.h:405
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:393
Double_t fMaxDiffTRKV0Centr
flag to apply cut on tracks crossing SPD misaligned modules for PP2012 data
Definition: AliRDHFCuts.h:418
Float_t GetCentralityOldFramework(AliAODEvent *aodEvent, AliRDHFCuts::ECentrality estimator)
Int_t fnPtBinLimits
number of pt bins for cuts
Definition: AliRDHFCuts.h:380
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:387
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)
Bool_t fUseCentrFlatteningInMC
flag to enable/disable the check on filter bits
Definition: AliRDHFCuts.h:423
void SetVarsForOpt(Int_t nVars, Bool_t *forOpt)
void SetVarNames(Int_t nVars, TString *varNames, Bool_t *isUpperCut)
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:385
Bool_t isMC
Bool_t CompareCuts(const AliRDHFCuts *obj) const
Bool_t fApplySPDMisalignedPP2012
flag to apply SPD dead module map of PbPb2011
Definition: AliRDHFCuts.h:417
Bool_t IsEventSelected(AliVEvent *event)
Int_t fMinSPDMultiplicity
maximum |z| of primary vertex
Definition: AliRDHFCuts.h:372
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:390
Bool_t fApplySPDDeadPbPb2011
maximum pt of the candidate for which to check if the daughters fulfill kFirst criteria ...
Definition: AliRDHFCuts.h:416
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
Bool_t fIsCandTrackSPDFirst
IsSelected returns always kTRUE for MC signal.
Definition: AliRDHFCuts.h:414
TH1F * fHistCentrDistr
flag for enabling/diabling centrality flattening in MC
Definition: AliRDHFCuts.h:424
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:421
Int_t fMinContrPileup
option for pielup selection
Definition: AliRDHFCuts.h:398
Bool_t fUsePhysicsSelection
use MC primary vertex
Definition: AliRDHFCuts.h:396
TFormula * f1CutMinNCrossedRowsTPCPtDep
pT-dep cut in TPC minimum n crossed rows
Definition: AliRDHFCuts.h:428
AliAODVertex * GetPrimaryVtx() const
void AddTrackCuts(const AliESDtrackCuts *cuts)
Definition: AliRDHFCuts.h:202
TString fTriggerClass[2]
flag to select one trigger only
Definition: AliRDHFCuts.h:375
Int_t fnPtBins
cuts on the candidate
Definition: AliRDHFCuts.h:379
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:391
Float_t fCutRatioSignalNOverCrossRowsTPC
min. value ratio NTPCClusters/NTPCCrossedRows, cut if !=0
Definition: AliRDHFCuts.h:426
Int_t fGlobalIndex
Definition: AliRDHFCuts.h:386
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:427
const Int_t nPtBins
Double_t fMinPtCand
outcome of PID selection
Definition: AliRDHFCuts.h:410
void SetOnePad(Bool_t onepad)
Definition: AliAODPidHF.h:103
Float_t fMaxCentrality
minimum centrality for selected events
Definition: AliRDHFCuts.h:406
void SetPidResponse(AliPIDResponse *pidResp)
Definition: AliAODPidHF.h:111
Bool_t RecomputePrimaryVertex(AliAODEvent *event) const
Int_t fnVars
Definition: AliRDHFCuts.h:382