AliPhysics  master (3d17d9d)
AliAnalysisTaskTrackingSysPropagation.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2009, 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 
17 // AliAnalysisTask for Tracking Systematics (matching efficiency //
18 // + tracking efficiency) porpagation at the D-meson level //
19 // (including daughter's kinematics) //
21 
22 #include <TFile.h>
23 #include <TH1F.h>
24 #include <TF1.h>
25 #include <TH2F.h>
26 #include <TH3F.h>
27 #include <TChain.h>
28 #include <Rtypes.h>
29 #include "AliAnalysisTaskSE.h"
30 #include "AliAnalysisManager.h"
31 #include "AliAnalysisDataContainer.h"
32 #include "AliAODHandler.h"
33 #include "AliLog.h"
34 #include "AliMCEventHandler.h"
35 #include "AliMCEvent.h"
37 #include "AliMultiplicity.h"
38 #include "AliRDHFCuts.h"
40 #include "AliRDHFCutsDstoKKpi.h"
41 #include "AliRDHFCutsD0toKpi.h"
43 #include "AliRDHFCutsLctoV0.h"
44 #include "AliRDHFCutsLctopKpi.h"
45 #include "AliAODMCParticle.h"
46 #include "AliAODMCHeader.h"
47 #include "AliAODRecoDecay.h"
50 #include "AliAODRecoCascadeHF.h"
51 #include "AliAnalysisVertexingHF.h"
52 
53 
55 /* $Id$ */
56 
57 //________________________________________________________________________
59 AliAnalysisTaskSE("taskTrackingSysProp"),
60  fPartName(""),
61  fOutput(0x0),
62  fAnalysisCuts(0),
63  fHistNEvents(0x0),
64  fHistMESyst(0x0),
65  fHistMESystPr(0x0),
66  fHistTrEffSyst(0x0),
67  fhPtDauVsD(0x0),
68  fhSystMatchEffD(0x0),
69  fDecayChannel(AliAnalysisTaskTrackingSysPropagation::kDplustoKpipi),
70  fPDGcode(411),
71  fAODProtection(1),
72  fMaxPt(60.)
73 {
74  DefineInput(0, TChain::Class());
75  DefineOutput(1, TList::Class());
76 }
77 
78 //________________________________________________________________________
80  AliAnalysisTaskSE("taskTrackingSysProp"),
81  fPartName(""),
82  fOutput(0x0),
83  fAnalysisCuts(cuts),
84  fHistNEvents(0x0),
85  fHistMESyst(0x0),
86  fHistMESystPr(0x0),
87  fHistTrEffSyst(0x0),
88  fhPtDauVsD(0x0),
89  fhSystMatchEffD(0x0),
90  fDecayChannel(ch),
91  fPDGcode(411),
92  fAODProtection(1),
93  fMaxPt(60.)
94 {
95  fHistMESyst = new TH1F(*(static_cast<TH1F*>(HistMESys)));
96  if (HistMESysPr) fHistMESystPr = new TH1F(*(static_cast<TH1F*>(HistMESysPr)));
97  fHistTrEffSyst = new TH1F(*(static_cast<TH1F*>(HistTrEffSys)));
98 
99  DefineInput(0, TChain::Class());
100  DefineOutput(1, TList::Class());
101 }
102 
103 //___________________________________________________________________________
105 
106  if(fOutput && !fOutput->IsOwner()){
107  delete fHistNEvents;
108  delete fHistMESyst;
109  delete fHistMESystPr;
110  delete fHistTrEffSyst;
111  delete fhPtDauVsD;
112  delete fhSystMatchEffD;
113  }
114  delete fOutput;
115  delete fAnalysisCuts;
116  fOutput = 0;
117 }
118 
119 //________________________________________________________________________
121 
122  fOutput = new TList();
123  fOutput->SetOwner();
124  fOutput->SetName("OutputHistos");
125 
126  fHistNEvents = new TH1F("hNEvents", "number of events ",15,-0.5,14.5);
127  fHistNEvents->GetXaxis()->SetBinLabel(1,"nEventsRead");
128  fHistNEvents->GetXaxis()->SetBinLabel(2,"nEvents Matched dAOD");
129  fHistNEvents->GetXaxis()->SetBinLabel(3,"nEvents Mismatched dAOD");
130  fHistNEvents->GetXaxis()->SetBinLabel(4,"nEventsAnal");
131  fHistNEvents->GetXaxis()->SetBinLabel(5,"n. passing IsEvSelected");
132  fHistNEvents->GetXaxis()->SetBinLabel(6,"n. rejected due to trigger");
133  fHistNEvents->GetXaxis()->SetBinLabel(7,"n. rejected due to not reco vertex");
134  fHistNEvents->GetXaxis()->SetBinLabel(8,"n. rejected for contr vertex");
135  fHistNEvents->GetXaxis()->SetBinLabel(9,"n. rejected for vertex out of accept");
136  fHistNEvents->GetXaxis()->SetBinLabel(10,"n. rejected for pileup events");
137  fHistNEvents->GetXaxis()->SetBinLabel(11,"no. of out centrality events");
138  fHistNEvents->GetXaxis()->SetBinLabel(12,"no. of 3 prong candidates");
139  fHistNEvents->GetXaxis()->SetBinLabel(13,"no. of D after filtering cuts");
140  fHistNEvents->GetXaxis()->SetBinLabel(14,"no. of D after selection cuts");
141  fHistNEvents->GetXaxis()->SetBinLabel(15,"no. of not on-the-fly rec D");
142 
143  fHistNEvents->GetXaxis()->SetNdivisions(1,kFALSE);
144 
145  fHistNEvents->Sumw2();
146  fHistNEvents->SetMinimum(0);
147  fOutput->Add(fHistNEvents);
148 
149  int nbins = (int)(10*fMaxPt);
150  fhSystMatchEffD = new TH2F("fhSystMatchEffD","Matching Efficiency; p_{T} D; syst. (\%)",nbins,0.,fMaxPt,50,0.,25.);
151  fhPtDauVsD = new TH2F("fhPtDauVsD","Pt Dau vs D; p_{T} D; p_{T} daugh",nbins,0.,fMaxPt,nbins,0.,fMaxPt);
152 
153  fOutput->Add(fHistMESyst);
155  fOutput->Add(fHistTrEffSyst);
156  fOutput->Add(fhSystMatchEffD);
157  fOutput->Add(fhPtDauVsD);
158 
159  PostData(1,fOutput);
160 }
161 //________________________________________________________________________
163 
165  fAnalysisCuts = new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fAnalysisCuts)));
166  }
167  else if(fDecayChannel == kDstoKKpi) {
168  fAnalysisCuts = new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fAnalysisCuts)));
169  }
170  else if(fDecayChannel == kD0toKpi) {
171  fAnalysisCuts = new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fAnalysisCuts)));
172  }
173  else if(fDecayChannel == kDstartoKpipi) {
174  fAnalysisCuts = new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fAnalysisCuts)));
175  }
176  else if(fDecayChannel == kLctopKpi) {
177  fAnalysisCuts = new AliRDHFCutsLctopKpi(*(static_cast<AliRDHFCutsLctopKpi*>(fAnalysisCuts)));
178  }
179  else if(fDecayChannel == kLctopK0s) {
180  fAnalysisCuts = new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fAnalysisCuts)));
181  }
182  else {
183  AliFatal("The decay channel MUST be defined according to AliCFVertexing::DecayChannel - Exiting...");
184  }
185 }
186 //________________________________________________________________________
188 
189  AliAODEvent* aod = dynamic_cast<AliAODEvent*>(fInputEvent);
190  fHistNEvents->Fill(0); // all events
191 
192  if(fAODProtection>=0){
193  // Protection against different number of events in the AOD and deltaAOD
194  // In case of discrepancy the event is rejected.
195  Int_t matchingAODdeltaAODlevel = AliRDHFCuts::CheckMatchingAODdeltaAODevents();
196  if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 && fAODProtection==1)) {
197  // AOD/deltaAOD trees have different number of entries || TProcessID do not match while it was required
198  fHistNEvents->Fill(2);
199  PostData(1,fOutput);
200  return;
201  }
202  }
203  TClonesArray *arrayBranch=0;
204 
205  if(!aod && AODEvent() && IsStandardAOD()) {
206  // In case there is an AOD handler writing a standard AOD, use the AOD
207  // event in memory rather than the input (ESD) event.
208  aod = dynamic_cast<AliAODEvent*> (AODEvent());
209  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
210  // have to taken from the AOD event hold by the AliAODExtension
211  AliAODHandler* aodHandler = (AliAODHandler*)
212  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
213  if(aodHandler->GetExtensions()) {
214  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
215  AliAODEvent *aodFromExt = ext->GetAOD();
217  arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
218  else if(fDecayChannel == kD0toKpi)
219  arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
220  else if(fDecayChannel == kDstartoKpipi)
221  arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
222  else if(fDecayChannel == kLctopK0s)
223  arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
224  }
225  }
226  else {
228  arrayBranch=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
229  else if(fDecayChannel == kD0toKpi)
230  arrayBranch=(TClonesArray*)aod->GetList()->FindObject("D0toKpi");
231  else if(fDecayChannel == kDstartoKpipi)
232  arrayBranch=(TClonesArray*)aod->GetList()->FindObject("Dstar");
233  else if(fDecayChannel == kLctopK0s)
234  arrayBranch=(TClonesArray*)aod->GetList()->FindObject("CascadesHF");
235  }
236 
237  if (!arrayBranch) {
238  AliError("Could not find array of HF vertices");
239  PostData(1,fOutput);
240  return;
241  }
242 
243  AliAODVertex *aodVtx = (AliAODVertex*)aod->GetPrimaryVertex();
244  if (!aodVtx || TMath::Abs(aod->GetMagneticField())<0.001) {
245  AliDebug(3, "The event was skipped due to missing vertex or magnetic field issue");
246  PostData(1,fOutput);
247  return;
248  }
249  fHistNEvents->Fill(3); // count event
251  fPDGcode = 411;
252  }else if(fDecayChannel == kDstoKKpi){
253  fPDGcode = 431;
254  }else if(fDecayChannel == kD0toKpi){
255  fPDGcode = 421;
256  }else if(fDecayChannel == kDstartoKpipi){
257  fPDGcode = 413;
258  }else if(fDecayChannel == kLctopKpi || fDecayChannel == kLctopK0s){
259  fPDGcode = 4122;
260  }
261  Bool_t isEvSel = fAnalysisCuts->IsEventSelected(aod);
262  Float_t ntracks = aod->GetNumberOfTracks();
263 
270 
271  Int_t runNumber = aod->GetRunNumber();
272 
273  TClonesArray *arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
274  AliAODMCHeader *mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
275 
276  if(!arrayMC) {
277  AliError("AliAnalysisTaskTrackingSysPropagation::UserExec: MC particles branch not found!\n");
278  PostData(1,fOutput);
279  return;
280  }
281  if(!mcHeader) {
282  AliError("AliAnalysisTaskTrackingSysPropagation::UserExec: MC header branch not found!\n");
283  PostData(1,fOutput);
284  return;
285  }
286 
287  // arrayMC->Print();
288  if(aod->GetTriggerMask()==0 && (runNumber>=195344 && runNumber<=195677)) {
289  // protection for events with empty trigger mask in p-Pb
290  PostData(1,fOutput);
291  return;
292  }
294  // events not passing the centrality selection can be removed immediately.
295  PostData(1,fOutput);
296  return;
297  }
298  Double_t zMCVertex = mcHeader->GetVtxZ();
299  if (TMath::Abs(zMCVertex) > fAnalysisCuts->GetMaxVtxZ()) {
300  PostData(1,fOutput);
301  return;
302  }
303  if(!isEvSel){
304  PostData(1,fOutput);
305  return;
306  }
307  fHistNEvents->Fill(4);
308 
309  Int_t nCand = arrayBranch->GetEntriesFast();
310 
311  Int_t nprongs = -1;
312  Int_t pdgDaughter[3];
313  Int_t pdg2Daughter[2];
315  fPDGcode = 411;
316  nprongs = 3;
317  fPartName="Dplus";
318  pdgDaughter[0]=321;
319  pdgDaughter[1]=211;
320  pdgDaughter[2]=211;
321  }else if(fDecayChannel == kDstoKKpi){
322  fPDGcode = 431;
323  nprongs = 3;
324  fPartName="Ds";
325  pdgDaughter[0]=321;
326  pdgDaughter[1]=321;
327  pdgDaughter[2]=211;
328  }else if(fDecayChannel == kD0toKpi){
329  fPDGcode = 421;
330  nprongs = 2;
331  fPartName="D0";
332  pdgDaughter[0]=321;
333  pdgDaughter[1]=211;
334  }else if(fDecayChannel == kDstartoKpipi){
335  fPDGcode = 413;
336  nprongs = 2;
337  fPartName="Dstar";
338  pdgDaughter[0]=421;
339  pdgDaughter[1]=211;
340  pdg2Daughter[0]=321;
341  pdg2Daughter[1]=211;
342  }else if(fDecayChannel == kLctopKpi){
343  fPDGcode = 4122;
344  nprongs = 3;
345  fPartName="LctopKpi";
346  pdgDaughter[0]=2212;
347  pdgDaughter[1]=321;
348  pdgDaughter[2]=211;
349  }else if(fDecayChannel == kLctopK0s){
350  fPDGcode = 4122;
351  nprongs = 3;
352  fPartName="LctopK0s";
353  pdgDaughter[0]=2212;
354  pdgDaughter[1]=211;
355  pdgDaughter[2]=211;
356  }else{
357  AliError("WRONG DECAY SETTING");
358  PostData(1,fOutput);
359  return;
360  }
361 
362  // vHF object is needed to call the method that refills the missing info of the candidates
363  // if they have been deleted in dAOD reconstruction phase
364  // in order to reduce the size of the file
366 
367  for (Int_t iCand = 0; iCand < nCand; iCand++) {
368 
369  AliAODRecoDecayHF* d = 0x0;
370 
372  d = (AliAODRecoDecayHF3Prong*)arrayBranch->UncheckedAt(iCand);
373  if(!vHF->FillRecoCand(aod,(AliAODRecoDecayHF3Prong*)d)) {
374  fHistNEvents->Fill(14);
375  continue;
376  }
377  }
378  else if(fDecayChannel == kD0toKpi) {
379  d = (AliAODRecoDecayHF2Prong*)arrayBranch->UncheckedAt(iCand);
380  if(!vHF->FillRecoCand(aod,(AliAODRecoDecayHF2Prong*)d)) {
381  fHistNEvents->Fill(14);
382  continue;
383  }
384  }
385  else if(fDecayChannel == kDstartoKpipi) {
386  d = (AliAODRecoCascadeHF*)arrayBranch->At(iCand);
387  if(!d) continue;
388  Bool_t isDStarCand =kTRUE;
389  if(!vHF->FillRecoCasc(aod,(AliAODRecoCascadeHF*)d,isDStarCand)) {
390  fHistNEvents->Fill(14);
391  continue;
392  }
393  if(!d->GetSecondaryVtx()) continue;
394  }
395  else if(fDecayChannel == kLctopK0s) {
396  d = (AliAODRecoCascadeHF*)arrayBranch->At(iCand);
397  if(!d) continue;
398  AliAODv0 * v0part = (AliAODv0*) dynamic_cast<AliAODRecoCascadeHF*>(d)->Getv0();
399  Bool_t onFlyV0 = v0part->GetOnFlyStatus(); // on-the-flight V0s
400  if (onFlyV0) continue;
401  Bool_t isLctopK0sCand =kTRUE;
402  if(!vHF->FillRecoCasc(aod,(AliAODRecoCascadeHF*)d,isLctopK0sCand)) {
403  fHistNEvents->Fill(14);
404  continue;
405  }
406  if(!d->GetSecondaryVtx()) continue;
407  }
408 
409  fHistNEvents->Fill(11);
410  Bool_t unsetvtx=kFALSE;
411  if(!d->GetOwnPrimaryVtx()){
412  d->SetOwnPrimaryVtx(aodVtx);
413  unsetvtx=kTRUE;
414  }
415 
416  Bool_t recVtx=kFALSE;
417  AliAODVertex *origownvtx=0x0;
418 
419  Double_t ptD = d->Pt();
420  Double_t rapid = d->Y(fPDGcode);
421  Bool_t isFidAcc = fAnalysisCuts->IsInFiducialAcceptance(ptD,rapid);
422 
423  if(isFidAcc){
424  Int_t retCodeAnalysisCuts = fAnalysisCuts->IsSelected(d,AliRDHFCuts::kAll,aod);
425  if(retCodeAnalysisCuts > 0) {
426  fHistNEvents->Fill(13);
427  if(fDecayChannel == kDstoKKpi){
428  Int_t isPhiKKpi = retCodeAnalysisCuts&4; //for Ds
429  Int_t isPhipiKK = retCodeAnalysisCuts&8; //for Ds
430  if(!(isPhiKKpi || isPhipiKK)) continue;
431  }
432 
433  double syst = 0.;
434  Int_t nDau = d->GetNDaughters();
435  AliAODTrack *track;
436 
437  Int_t mcLabel=-1;
438  int nbinsME = fHistMESyst->GetNbinsX();
439  int bin = 0;
440 
441  if(!(fDecayChannel == kLctopK0s) && !(fDecayChannel == kLctopKpi)) {
442  if(!(fDecayChannel == kDstartoKpipi)) {
443  mcLabel = d->MatchToMC(fPDGcode,arrayMC,nprongs,pdgDaughter);
444  if (mcLabel < 0) continue;
445  for(Int_t iDau=0; iDau < nDau; iDau++){
446  track = (AliAODTrack*)d->GetDaughter(iDau);
447  if(!track){
448  AliError("Daughter particle track not found");
449  PostData(1,fOutput);
450  return;
451  }
452  Int_t labDau = track->GetLabel();
453  AliAODMCParticle* p = (AliAODMCParticle*)arrayMC->UncheckedAt(TMath::Abs(labDau));
454  double ptdau = track->Pt();
455 
456  bin = fHistMESyst->FindBin(ptdau);
457  if(bin > 0 && bin <= nbinsME) syst += fHistMESyst->GetBinContent(bin);
458  else if(bin > nbinsME) syst += fHistMESyst->GetBinContent(nbinsME);
459  else if(bin == 0) {
460  AliError("Check input histo at low pt!");
461  PostData(1,fOutput);
462  return;
463  }
464  fhPtDauVsD->Fill(ptD,ptdau);
465  }
466  }
467  else { //D*
468  mcLabel = ((AliAODRecoCascadeHF*)d)->MatchToMC(413,421,pdgDaughter,pdg2Daughter,arrayMC,kFALSE);
469  if (mcLabel < 0) continue;
470 
471  //soft pion
472  //Update 17/07/18: Soft pion not prolonged from TPC to ITS, so matching should not be applied
473 
474  //D0
475  AliAODRecoDecayHF2Prong *D0 = ((AliAODRecoCascadeHF*)d)->Get2Prong();
476  for(Int_t iDau=0; iDau < 2; iDau++){
477  track = 0x0;
478  track = (AliAODTrack*)D0->GetDaughter(iDau);
479  if(!track) {
480  PostData(1,fOutput);
481  return;
482  }
483  Int_t labDau = track->GetLabel();
484  AliAODMCParticle* p=(AliAODMCParticle*)arrayMC->UncheckedAt(TMath::Abs(labDau));
485  double ptdau = track->Pt();
486 
487  bin = fHistMESyst->FindBin(ptdau);
488  if(bin > 0 && bin <= nbinsME) syst += fHistMESyst->GetBinContent(bin);
489  else if(bin > nbinsME) syst += fHistMESyst->GetBinContent(nbinsME);
490  else if(bin == 0) {
491  AliError("Check input histo at low pt!");
492  PostData(1,fOutput);
493  return;
494  }
495  fhPtDauVsD->Fill(ptD,ptdau);
496  }
497  }
498  }
499  else if (fDecayChannel == kLctopK0s) { //Lc->pK0S
500  Int_t pdgDgLctoV0bachelor[2]={2212,310}; // always 1st bachelor, 2nd V0
501  Int_t pdgDgV0toDaughters[2]={211,211};
502  mcLabel = ((AliAODRecoCascadeHF*)d)->MatchToMC(fPDGcode,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,arrayMC,kTRUE);
503  if (mcLabel < 0) continue;
504  /*
505  //K0S
506  --> no ITS-TPC matching efficiency since no ITS requirement for the daughter pions.
507  */
508 
509  //proton
510  track = (AliAODTrack*)(((AliAODRecoCascadeHF*)d)->GetBachelor());
511  if(!track) {
512  PostData(1,fOutput);
513  return;
514  }
515  Int_t labDau = track->GetLabel();
516  AliAODMCParticle* p = (AliAODMCParticle*)arrayMC->UncheckedAt(TMath::Abs(labDau));
517  double ptdau = track->Pt();
518 
519  bin = fHistMESyst->FindBin(ptdau);
520  if(bin > 0 && bin <= nbinsME) syst += fHistMESyst->GetBinContent(bin);
521  else if(bin > nbinsME) syst += fHistMESyst->GetBinContent(nbinsME);
522  else if(bin == 0) {
523  AliError("Check input histo at low pt!");
524  PostData(1,fOutput);
525  return;
526  }
527  fhPtDauVsD->Fill(ptD,ptdau);
528 
529  }
530  else /*if (fDecayChannel == kLctopKpi)*/ { // Lc->pKpi case
531 
532  for (Int_t ii=0; ii<3; ii++) {
533  track = (AliAODTrack*)(((AliAODRecoDecayHF3Prong*)d)->GetDaughter(ii));
534  if(!track) {
535  PostData(1,fOutput);
536  return;
537  }
538  Int_t labDau = track->GetLabel();
539  AliAODMCParticle* p = (AliAODMCParticle*)arrayMC->UncheckedAt(TMath::Abs(labDau));
540  double ptdau = track->Pt();
541  if (abs(p->GetPdgCode())==2212) {
542  bin = fHistMESystPr->FindBin(ptdau);
543  Int_t nbinsMEpr = fHistMESystPr->GetNbinsX();
544  if(bin > 0 && bin <= nbinsMEpr) syst += fHistMESystPr->GetBinContent(bin);
545  else if(bin > nbinsMEpr) syst += fHistMESystPr->GetBinContent(nbinsMEpr);
546  else if(bin == 0) {
547  AliError("Check input histo at low pt!");
548  PostData(1,fOutput);
549  return;
550  }
551  }
552  else {
553  bin = fHistMESyst->FindBin(ptdau);
554  if(bin > 0 && bin <= nbinsME) syst += fHistMESyst->GetBinContent(bin);
555  else if(bin > nbinsME) syst += fHistMESyst->GetBinContent(nbinsME);
556  else if(bin == 0) {
557  AliError("Check input histo at low pt!");
558  PostData(1,fOutput);
559  return;
560  }
561  }
562  fhPtDauVsD->Fill(ptD,ptdau);
563  }
564  }
565 
566  int nbinsTE = fHistTrEffSyst->GetNbinsX();
567  bin = fHistTrEffSyst->FindBin(ptD);
568  double trackEffSys = 0.;
569  if(bin > 0 && bin <= nbinsTE) trackEffSys = fHistTrEffSyst->GetBinContent(bin);
570  else if(bin > nbinsTE) trackEffSys = fHistTrEffSyst->GetBinContent(nbinsTE);
571  else if(bin == 0) {
572  AliError("Check input histo at low pt!");
573  PostData(1,fOutput);
574  return;
575  }
576  syst = TMath::Sqrt(syst*syst+trackEffSys*trackEffSys);
577  fhSystMatchEffD->Fill(ptD,syst);
578  }
579  }
580  if(unsetvtx) d->UnsetOwnPrimaryVtx();
581  }
582  PostData(1,fOutput);
583  return;
584 }
585 
586 //________________________________________________________________________
588 
589  fOutput = dynamic_cast<TList*>(GetOutputData(1));
590  if (!fOutput) {
591  AliError("ERROR: fOutput not available\n");
592  return;
593  }
594  if(fHistNEvents){
595  Printf("Number of Analyzed Events = %f",fHistNEvents->GetBinContent(1));
596  }else{
597  AliError("ERROR: fHistNEvents not available\n");
598  }
599 
600  Printf("end of Terminate");
601  return;
602 }
Bool_t IsEventRejectedDueToCentrality() const
Definition: AliRDHFCuts.h:361
Bool_t IsEventRejectedDueToZVertexOutsideFiducialRegion() const
Definition: AliRDHFCuts.h:355
Bool_t IsEventRejectedDueToNotRecoVertex() const
Definition: AliRDHFCuts.h:346
double Double_t
Definition: External.C:58
Definition: External.C:236
Int_t IsEventSelectedInCentrality(AliVEvent *event)
static Int_t CheckMatchingAODdeltaAODevents()
Bool_t IsEventRejectedDueToVertexContributors() const
Definition: AliRDHFCuts.h:349
TH2F * fhSystMatchEffD
histo with Pt daughters vs pt candidate
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
TH1F * fHistTrEffSyst
histo with match. eff. systematics vs pt for protons (need to be passed as input) ...
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:274
Bool_t FillRecoCasc(AliVEvent *event, AliAODRecoCascadeHF *rc, Bool_t isDStar, Bool_t recoSecVtx=kFALSE)
DecChannel fDecayChannel
histo with systematic uncertainty on the candidate
Class for cuts on AOD reconstructed D+->Kpipi.
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
Double_t fMaxPt
flag to activate protection against AOD-dAOD mismatch.
TH1F * fHistMESystPr
histo with match. eff. systematics vs pt (need to be passed as input)
AliAODVertex * GetOwnPrimaryVtx() const
TH2F * fhPtDauVsD
histo with track. eff. systematics vs pt (need to be passed as input)
Bool_t IsEventRejectedDueToPileup() const
Definition: AliRDHFCuts.h:358
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
Bool_t IsEventSelected(AliVEvent *event)
Bool_t IsSelected(TObject *obj)
Definition: AliRDHFCuts.h:312
const char Option_t
Definition: External.C:48
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:343
const Int_t nbins
bool Bool_t
Definition: External.C:53
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
Definition: AliRDHFCuts.h:338
Int_t GetUseCentrality() const
Definition: AliRDHFCuts.h:297
AliRDHFCuts * fAnalysisCuts
max pt in the outputs histos