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