AliPhysics  9fe175b (9fe175b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliCFTaskVertexingHF.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 
16 //-----------------------------------------------------------------------
17 // Class for HF corrections as a function of many variables
18 // 6 Steps introduced: MC, MC Acc, Reco, Reco Acc, Reco Acc + ITS Cl,
19 // Reco Acc + ITS Cl + PPR cuts
20 // 12 variables used: pt, y, cosThetaStar, ptPi, ptK, ct,
21 // dca, d0Pi, d0K, d0Pixd0K, cosPointingAngle, phi
22 //
23 //-----------------------------------------------------------------------
24 // Author : C. Zampolli, CERN
25 // D. Caffarri, Univ & INFN Padova caffarri@pd.infn.it
26 //-----------------------------------------------------------------------
27 //-----------------------------------------------------------------------
28 // Base class for HF Unfolding (pt and eta)
29 // correlation matrix filled at Acceptance and PPR level
30 // Author: A.Grelli , Utrecht - agrelli@uu.nl
31 //-----------------------------------------------------------------------
32 #include <TCanvas.h>
33 #include <TParticle.h>
34 #include <TDatabasePDG.h>
35 #include <TProfile.h>
36 #include <TH1I.h>
37 #include <TStyle.h>
38 #include <TFile.h>
39 #include <TF1.h>
40 
41 #include "AliCFTaskVertexingHF.h"
42 #include "AliStack.h"
43 #include "AliMCEvent.h"
44 #include "AliCFManager.h"
45 #include "AliCFContainer.h"
46 #include "AliLog.h"
47 #include "AliInputEventHandler.h"
48 #include "AliAnalysisManager.h"
49 #include "AliAODHandler.h"
50 #include "AliAODEvent.h"
51 #include "AliAODRecoDecay.h"
52 #include "AliAODRecoDecayHF.h"
56 #include "AliAODRecoCascadeHF.h"
57 #include "AliAODMCParticle.h"
58 #include "AliAODMCHeader.h"
59 #include "AliESDtrack.h"
60 #include "TChain.h"
61 #include "THnSparse.h"
62 #include "TH2D.h"
63 #include "AliESDtrackCuts.h"
64 #include "AliRDHFCuts.h"
65 #include "AliRDHFCutsD0toKpi.h"
68 #include "AliRDHFCutsDstoKKpi.h"
69 #include "AliRDHFCutsLctopKpi.h"
70 #include "AliRDHFCutsD0toKpipipi.h"
71 #include "AliRDHFCutsLctoV0.h"
72 #include "AliCFVertexingHF2Prong.h"
73 #include "AliCFVertexingHF3Prong.h"
76 #include "AliCFVertexingHF.h"
77 #include "AliVertexingHFUtils.h"
78 #include "AliAnalysisDataSlot.h"
79 #include "AliAnalysisDataContainer.h"
80 #include "AliAnalysisVertexingHF.h"
81 #include "AliPIDResponse.h"
82 
83 //__________________________________________________________________________
85  AliAnalysisTaskSE(),
86  fCFManager(0x0),
87  fHistEventsProcessed(0x0),
88  fCorrelation(0x0),
89  fListProfiles(0),
90  fCountMC(0),
91  fCountGenLimAcc(0),
92  fCountGenLimAccNoAcc(0),
93  fCountAcc(0),
94  fCountVertex(0),
95  fCountRefit(0),
96  fCountReco(0),
97  fCountRecoAcc(0),
98  fCountRecoITSClusters(0),
99  fCountRecoPPR(0),
100  fCountRecoPID(0),
101  fEvents(0),
102  fDecayChannel(0),
103  fFillFromGenerated(kFALSE),
104  fOriginDselection(0),
105  fAcceptanceUnf(kTRUE),
106  fCuts(0),
107  fUseWeight(kFALSE),
108  fWeight(1.),
109  fUseFlatPtWeight(kFALSE),
110  fUseZWeight(kFALSE),
111  fUseNchWeight(kFALSE),
112  fUseTrackletsWeight(kFALSE),
113  fUseMultRatioAsWeight(kFALSE),
114  fNvar(0),
115  fPartName(""),
116  fDauNames(""),
117  fSign(2),
118  fCentralitySelection(kTRUE),
119  fFakeSelection(0),
120  fRejectIfNoQuark(kTRUE),
121  fUseMCVertex(kFALSE),
122  fDsOption(1),
123  fGenDsOption(3),
124  fConfiguration(kCheetah), // by default, setting the fast configuration
125  fFuncWeight(0x0),
126  fHistoPtWeight(0x0),
127  fHistoMeasNch(0x0),
128  fHistoMCNch(0x0),
129  fResonantDecay(0),
130  fLctoV0bachelorOption(1),
131  fGenLctoV0bachelorOption(0),
132  fUseSelectionBit(kTRUE),
133  fPDGcode(0),
134  fMultiplicityEstimator(kNtrk10),
135  fRefMult(9.26),
136  fZvtxCorrectedNtrkEstimator(kFALSE),
137  fIsPPData(kFALSE),
138  fIsPPbData(kFALSE),
139  fUseAdditionalCuts(kFALSE),
140  fUseCutsForTMVA(kFALSE),
141  fUseCascadeTaskForLctoV0bachelor(kFALSE),
142  fCutOnMomConservation(0.00001)
143 {
144  //
145  //Default ctor
146  //
147  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
148 }
149 //___________________________________________________________________________
150 AliCFTaskVertexingHF::AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts, TF1* func) :
151  AliAnalysisTaskSE(name),
152  fCFManager(0x0),
153  fHistEventsProcessed(0x0),
154  fCorrelation(0x0),
155  fListProfiles(0),
156  fCountMC(0),
157  fCountGenLimAcc(0),
158  fCountGenLimAccNoAcc(0),
159  fCountAcc(0),
160  fCountVertex(0),
161  fCountRefit(0),
162  fCountReco(0),
163  fCountRecoAcc(0),
164  fCountRecoITSClusters(0),
165  fCountRecoPPR(0),
166  fCountRecoPID(0),
167  fEvents(0),
168  fDecayChannel(0),
169  fFillFromGenerated(kFALSE),
170  fOriginDselection(0),
171  fAcceptanceUnf(kTRUE),
172  fCuts(cuts),
173  fUseWeight(kFALSE),
174  fWeight(1.),
175  fUseFlatPtWeight(kFALSE),
176  fUseZWeight(kFALSE),
177  fUseNchWeight(kFALSE),
178  fUseTrackletsWeight(kFALSE),
179  fUseMultRatioAsWeight(kFALSE),
180  fNvar(0),
181  fPartName(""),
182  fDauNames(""),
183  fSign(2),
184  fCentralitySelection(kTRUE),
185  fFakeSelection(0),
186  fRejectIfNoQuark(kTRUE),
187  fUseMCVertex(kFALSE),
188  fDsOption(1),
189  fGenDsOption(3),
190  fConfiguration(kCheetah), // by default, setting the fast configuration
191  fFuncWeight(func),
192  fHistoPtWeight(0x0),
193  fHistoMeasNch(0x0),
194  fHistoMCNch(0x0),
195  fResonantDecay(0),
196  fLctoV0bachelorOption(1),
197  fGenLctoV0bachelorOption(0),
198  fUseSelectionBit(kTRUE),
199  fPDGcode(0),
200  fMultiplicityEstimator(kNtrk10),
201  fRefMult(9.26),
202  fZvtxCorrectedNtrkEstimator(kFALSE),
203  fIsPPData(kFALSE),
204  fIsPPbData(kFALSE),
205  fUseAdditionalCuts(kFALSE),
206  fUseCutsForTMVA(kFALSE),
207  fUseCascadeTaskForLctoV0bachelor(kFALSE),
208  fCutOnMomConservation(0.00001)
209 {
210  //
211  // Constructor. Initialization of Inputs and Outputs
212  //
213  /*
214  DefineInput(0) and DefineOutput(0)
215  are taken care of by AliAnalysisTaskSE constructor
216  */
217  DefineOutput(1,TH1I::Class());
218  DefineOutput(2,AliCFContainer::Class());
219  DefineOutput(3,THnSparseD::Class());
220  DefineOutput(4,AliRDHFCuts::Class());
221  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
222  DefineOutput(5,TList::Class()); // slot #5 keeps the zvtx Ntrakclets correction profiles
223 
224  fCuts->PrintAll();
225 }
226 
227 //___________________________________________________________________________
229 {
230  //
231  // Assignment operator
232  //
233  if (this!=&c) {
234  AliAnalysisTaskSE::operator=(c) ;
237  fCuts = c.fCuts;
242  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=c.fMultEstimatorAvg[i];
243  }
244  return *this;
245 }
246 
247 //___________________________________________________________________________
249  AliAnalysisTaskSE(c),
250  fCFManager(c.fCFManager),
251  fHistEventsProcessed(c.fHistEventsProcessed),
252  fCorrelation(c.fCorrelation),
253  fListProfiles(c.fListProfiles),
254  fCountMC(c.fCountMC),
255  fCountGenLimAcc(c.fCountGenLimAcc),
256  fCountGenLimAccNoAcc(c.fCountGenLimAccNoAcc),
257  fCountAcc(c.fCountAcc),
258  fCountVertex(c.fCountVertex),
259  fCountRefit(c.fCountRefit),
260  fCountReco(c.fCountReco),
261  fCountRecoAcc(c.fCountRecoAcc),
262  fCountRecoITSClusters(c.fCountRecoITSClusters),
263  fCountRecoPPR(c.fCountRecoPPR),
264  fCountRecoPID(c.fCountRecoPID),
265  fEvents(c.fEvents),
266  fDecayChannel(c.fDecayChannel),
267  fFillFromGenerated(c.fFillFromGenerated),
268  fOriginDselection(c.fOriginDselection),
269  fAcceptanceUnf(c.fAcceptanceUnf),
270  fCuts(c.fCuts),
271  fUseWeight(c.fUseWeight),
272  fWeight(c.fWeight),
273  fUseFlatPtWeight(c.fUseFlatPtWeight),
274  fUseZWeight(c.fUseZWeight),
275  fUseNchWeight(c.fUseNchWeight),
276  fUseTrackletsWeight(c.fUseTrackletsWeight),
277  fUseMultRatioAsWeight(c.fUseMultRatioAsWeight),
278  fNvar(c.fNvar),
279  fPartName(c.fPartName),
280  fDauNames(c.fDauNames),
281  fSign(c.fSign),
282  fCentralitySelection(c.fCentralitySelection),
283  fFakeSelection(c.fFakeSelection),
284  fRejectIfNoQuark(c.fRejectIfNoQuark),
285  fUseMCVertex(c.fUseMCVertex),
286  fDsOption(c.fDsOption),
287  fGenDsOption(c.fGenDsOption),
288  fConfiguration(c.fConfiguration),
289  fFuncWeight(c.fFuncWeight),
290  fHistoPtWeight(c.fHistoPtWeight),
291  fHistoMeasNch(c.fHistoMeasNch),
292  fHistoMCNch(c.fHistoMCNch),
293  fResonantDecay(c.fResonantDecay),
294  fLctoV0bachelorOption(c.fLctoV0bachelorOption),
295  fGenLctoV0bachelorOption(c.fGenLctoV0bachelorOption),
296  fUseSelectionBit(c.fUseSelectionBit),
297  fPDGcode(c.fPDGcode),
298  fMultiplicityEstimator(c.fMultiplicityEstimator),
299  fRefMult(c.fRefMult),
300  fZvtxCorrectedNtrkEstimator(c.fZvtxCorrectedNtrkEstimator),
301  fIsPPData(c.fIsPPData),
302  fIsPPbData(c.fIsPPbData),
303  fUseAdditionalCuts(c.fUseAdditionalCuts),
304  fUseCutsForTMVA(c.fUseCutsForTMVA),
305  fUseCascadeTaskForLctoV0bachelor(c.fUseCascadeTaskForLctoV0bachelor),
306  fCutOnMomConservation(c.fCutOnMomConservation)
307 {
308  //
309  // Copy Constructor
310  //
311  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=c.fMultEstimatorAvg[i];
312 }
313 
314 //___________________________________________________________________________
316 {
317  //
318  //destructor
319  //
320  if (fCFManager) delete fCFManager ;
322  if (fCorrelation) delete fCorrelation ;
323  if (fListProfiles) delete fListProfiles;
324  if (fCuts) delete fCuts;
325  if (fFuncWeight) delete fFuncWeight;
326  if (fHistoPtWeight) delete fHistoPtWeight;
327  if (fHistoMeasNch) delete fHistoMeasNch;
328  if (fHistoMCNch) delete fHistoMCNch;
329  for(Int_t i=0; i<4; i++) { if(fMultEstimatorAvg[i]) delete fMultEstimatorAvg[i]; }
330 }
331 
332 //_________________________________________________________________________-
334 {
335  //
336  // Initialization
337  //
338 
339  if (fDebug>1) printf("AliCFTaskVertexingHF::Init()");
340  if(fUseWeight && fUseZWeight) { AliFatal("Can not use at the same time pt and z-vtx weights, please choose"); return; }
341  if(fUseWeight && fUseNchWeight) { AliInfo("Beware, using at the same time pt and Nch weights, please check"); }
342  if(fUseNchWeight && !fHistoMCNch) { AliFatal("Need to pass the MC Nch distribution to use Nch weights"); return; }
344 
345  AliRDHFCuts *copyfCuts = 0x0;
346  if (!fCuts){
347  AliFatal("No cuts defined - Exiting...");
348  return;
349  }
350 
351  switch (fDecayChannel){
352  case 2:{
353  fPDGcode = 421;
354  copyfCuts = new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fCuts)));
355  switch (fConfiguration) {
356  case kSnail: // slow configuration: all variables in
357  fNvar = 16;
358  break;
359  case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
360  fNvar = 8;
361  break;
362  }
363  fPartName="D0";
364  fDauNames="K+pi";
365  break;
366  }
367  case 21:{
368  fPDGcode = 413;
369  copyfCuts = new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fCuts)));
370  switch (fConfiguration) {
371  case kSnail: // slow configuration: all variables in
372  fNvar = 16;
373  break;
374  case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
375  fNvar = 8;
376  break;
377  }
378  fPartName="Dstar";
379  fDauNames="K+pi+pi";
380  break;
381  }
382  case 22:{
383  fPDGcode = 4122;
384  copyfCuts = new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fCuts)));
385  switch (fConfiguration) {
386  case kSnail: // slow configuration: all variables in
387  fNvar = 16;
388  break;
389  case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
390  fNvar = 8;
391  break;
392  }
393  fPartName="Lambdac";
394  fDauNames="V0+bachelor";
395  break;
396  }
397  case 31:{
398  fPDGcode = 411;
399  copyfCuts = new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fCuts)));
400  switch (fConfiguration) {
401  case kSnail: // slow configuration: all variables in
402  fNvar = 14;
403  break;
404  case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
405  fNvar = 8;
406  break;
407  }
408  fPartName="Dplus";
409  fDauNames="K+pi+pi";
410  break;
411  }
412  case 32:{
413  fPDGcode = 4122;
414  copyfCuts = new AliRDHFCutsLctopKpi(*(static_cast<AliRDHFCutsLctopKpi*>(fCuts)));
415  switch (fConfiguration) {
416  case kSnail: // slow configuration: all variables in
417  fNvar = 18;
418  break;
419  case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
420  fNvar = 8;
421  break;
422  }
423  fPartName="Lambdac";
424  fDauNames="p+K+pi";
425  break;
426  }
427  case 33:{
428  fPDGcode = 431;
429  copyfCuts = new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fCuts)));
430  switch (fConfiguration) {
431  case kSnail: // slow configuration: all variables in
432  fNvar = 14;
433  break;
434  case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
435  fNvar = 8;
436  break;
437  }
438  fPartName="Ds";
439  fDauNames="K+K+pi";
440  break;
441  }
442  case 4:{
443  fPDGcode = 421;
444  copyfCuts = new AliRDHFCutsD0toKpipipi(*(static_cast<AliRDHFCutsD0toKpipipi*>(fCuts)));
445  switch (fConfiguration) {
446  case kSnail: // slow configuration: all variables in
447  fNvar = 16;
448  break;
449  case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
450  fNvar = 8;
451  break;
452  }
453  fPartName="D0";
454  fDauNames="K+pi+pi+pi";
455  break;
456  }
457  default:
458  AliFatal("The decay channel MUST be defined according to AliCFVertexing::DecayChannel - Exiting...");
459  break;
460  }
461 
462  const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
463  if (copyfCuts){
464  copyfCuts->SetName(nameoutput);
465 
466  //Post the data
467  PostData(4, copyfCuts);
468  }
469  else{
470  AliFatal("Failing initializing AliRDHFCuts object - Exiting...");
471  }
472 
473  fListProfiles = new TList();
474  fListProfiles->SetOwner();
475  TString period[4];
476  Int_t nProfiles=4;
477 
478  if (fIsPPbData) { //if pPb, use only two estimator histos
479  period[0] = "LHC13b"; period[1] = "LHC13c";
480  nProfiles = 2;
481  } else { // else assume pp (four histos for LHC10)
482  period[0] = "LHC10b"; period[1] = "LHC10c"; period[2] = "LHC10d"; period[3] = "LHC10e";
483  nProfiles = 4;
484  }
485 
486  for(Int_t i=0; i<nProfiles; i++){
487  if(fMultEstimatorAvg[i]){
488  TProfile* hprof=new TProfile(*fMultEstimatorAvg[i]);
489  hprof->SetName(Form("ProfileTrkVsZvtx%s\n",period[i].Data()));
490  fListProfiles->Add(hprof);
491  }
492  }
493 
494  // Save also the weight functions or histograms
499 
500  PostData(5,fListProfiles);
501 
502  return;
503 }
504 
505 //_________________________________________________
507 {
508  //
509  // Main loop function
510  //
511 
512  PostData(1,fHistEventsProcessed) ;
513  PostData(2,fCFManager->GetParticleContainer()) ;
514  PostData(3,fCorrelation) ;
515 
516  AliDebug(3,Form("*** Processing event %d\n", fEvents));
517 
518  if (fFillFromGenerated){
519  AliWarning("Flag to fill container with generated value ON ---> dca, d0pi, d0K, d0xd0, cosPointingAngle will be set as dummy!");
520  }
521 
522  if (!fInputEvent) {
523  Error("UserExec","NO EVENT FOUND!");
524  return;
525  }
526 
527  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
528 
529  TClonesArray *arrayBranch=0;
530 
531  if(!aodEvent && AODEvent() && IsStandardAOD()) {
532  // In case there is an AOD handler writing a standard AOD, use the AOD
533  // event in memory rather than the input (ESD) event.
534  aodEvent = dynamic_cast<AliAODEvent*> (AODEvent());
535  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
536  // have to taken from the AOD event hold by the AliAODExtension
537  AliAODHandler* aodHandler = (AliAODHandler*)
538  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
539  if(aodHandler->GetExtensions()) {
540  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
541  AliAODEvent *aodFromExt = ext->GetAOD();
542 
543  switch (fDecayChannel){
544  case 2:{
545  arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
546  break;
547  }
548  case 21:{
549  arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
550  break;
551  }
552  case 22:{
553  arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
554  break;
555  }
556  case 31:
557  case 32:
558  case 33:{
559  arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
560  break;
561  }
562  case 4:{
563  arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm4Prong");
564  break;
565  }
566  default:
567  break;
568  }
569  }
570  }
571  else {
572  switch (fDecayChannel){
573  case 2:{
574  arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("D0toKpi");
575  break;
576  }
577  case 21:{
578  arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Dstar");
579  break;
580  }
581  case 22:{
582  arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("CascadesHF");
583  break;
584  }
585  case 31:
586  case 32:
587  case 33:{
588  arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Charm3Prong");
589  break;
590  }
591  case 4:{
592  arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Charm4Prong");
593  break;
594  }
595  default:
596  break;
597  }
598  }
599 
600  AliAODVertex *aodVtx = (AliAODVertex*)aodEvent->GetPrimaryVertex();
601  if (!aodVtx) {
602  AliDebug(3, "The event was skipped due to missing vertex");
603  return;
604  }
605 
606  if (!arrayBranch) {
607  AliError("Could not find array of HF vertices");
608  return;
609  }
610 
611  fEvents++;
612 
613  fCFManager->SetRecEventInfo(aodEvent);
614  fCFManager->SetMCEventInfo(aodEvent);
615 
616  //******** DEFINE number of variables of the container***** for now set at 13, in the future in the config macro.
617 
618  //loop on the MC event
619 
620  TClonesArray* mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
621  if (!mcArray) {
622  AliError("Could not find Monte-Carlo in AOD");
623  return;
624  }
625  Int_t icountMC = 0;
626  Int_t icountGenLimAcc = 0;
627  Int_t icountGenLimAccNoAcc = 0;
628  Int_t icountAcc = 0;
629  Int_t icountReco = 0;
630  Int_t icountVertex = 0;
631  Int_t icountRefit = 0;
632  Int_t icountRecoAcc = 0;
633  Int_t icountRecoITSClusters = 0;
634  Int_t icountRecoPPR = 0;
635  Int_t icountRecoPID = 0;
636  Int_t cquarks = 0;
637 
638  AliAODMCHeader *mcHeader = dynamic_cast<AliAODMCHeader*>(aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
639  if (!mcHeader) {
640  AliError("Could not find MC Header in AOD");
641  return;
642  }
643 
644  fHistEventsProcessed->Fill(0.5);
645 
646  Double_t* containerInput = new Double_t[fNvar];
647  Double_t* containerInputMC = new Double_t[fNvar];
648 
649 
650  AliCFVertexingHF* cfVtxHF=0x0;
651  switch (fDecayChannel){
652  case 2:{
653  cfVtxHF = new AliCFVertexingHF2Prong(mcArray, fOriginDselection);
654  break;
655  }
656  case 21:{
657  cfVtxHF = new AliCFVertexingHFCascade(mcArray, fOriginDselection);
658  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGcascade(413);
659  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGbachelor(211);
660  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGneutrDaugh(421);
661  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGneutrDaughForMC(421);
662  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGneutrDaughPositive(211);
663  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGneutrDaughNegative(321);
664  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPrimaryVertex(aodVtx);
665  break;
666  }
667  case 22:{
668  // Lc -> K0S+proton
670  cfVtxHF = new AliCFVertexingHFCascade(mcArray, fOriginDselection);
671  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGcascade(4122);
672  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGbachelor(2212);
673  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGneutrDaugh(310);
674  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGneutrDaughForMC(311);
675  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGneutrDaughPositive(211);
676  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPDGneutrDaughNegative(211);
677  ((AliCFVertexingHFCascade*)cfVtxHF)->SetPrimaryVertex(aodVtx);
678  ((AliCFVertexingHFCascade*)cfVtxHF)->SetCutOnMomConservation(fCutOnMomConservation);
679  if (fUseAdditionalCuts) ((AliCFVertexingHFCascade*)cfVtxHF)->SetUseCutsForTMVA(fUseCutsForTMVA);
680  }
681  else {
683  }
684  break;
685  }
686  case 31:
687  // case 32:
688  case 33:{
689  cfVtxHF = new AliCFVertexingHF3Prong(mcArray, fOriginDselection, fDecayChannel);
690  if(fDecayChannel==33){
691  ((AliCFVertexingHF3Prong*)cfVtxHF)->SetGeneratedDsOption(fGenDsOption);
692  }
693  break;
694  }
695  case 32:{
697  }
698  case 4:{
699  //cfVtxHF = new AliCFVertexingHF4Prong(mcArray, originDselection); // not there yet
700  break;
701  }
702  default:
703  break;
704  }
705  if (!cfVtxHF){
706  AliError("No AliCFVertexingHF initialized");
707  delete[] containerInput;
708  delete[] containerInputMC;
709  return;
710  }
711 
712  Double_t zPrimVertex = aodVtx ->GetZ();
713  Double_t zMCVertex = mcHeader->GetVtxZ();
714  Int_t runnumber = aodEvent->GetRunNumber();
715 
716  // Multiplicity definition with tracklets
717  Double_t nTracklets = 0;
718  Int_t nTrackletsEta10 = static_cast<Int_t>(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aodEvent,-1.,1.));
719  Int_t nTrackletsEta16 = static_cast<Int_t>(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aodEvent,-1.6,1.6));
720  nTracklets = (Double_t)nTrackletsEta10;
721  if(fMultiplicityEstimator==kNtrk10to16) { nTracklets = (Double_t)(nTrackletsEta16 - nTrackletsEta10); }
722 
723  // Apply the Ntracklets z-vtx data driven correction
725  TProfile* estimatorAvg = GetEstimatorHistogram(aodEvent);
726  if(estimatorAvg) {
727  Int_t nTrackletsEta10Corr = static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,nTrackletsEta10,zPrimVertex,fRefMult));
728  Int_t nTrackletsEta16Corr = static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,nTrackletsEta16,zPrimVertex,fRefMult));
729  nTracklets = (Double_t)nTrackletsEta10Corr;
730  if(fMultiplicityEstimator==kNtrk10to16) { nTracklets = (Double_t)(nTrackletsEta16Corr - nTrackletsEta10Corr); }
731  }
732  }
733 
734 
735  fWeight=1.;
736  if(fUseZWeight) fWeight *= GetZWeight(zMCVertex,runnumber);
737  if(fUseNchWeight){
738  Int_t nChargedMCPhysicalPrimary=AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(mcArray,-1.0,1.0);
739  if(!fUseTrackletsWeight) fWeight *= GetNchWeight(nChargedMCPhysicalPrimary);
740  else fWeight *= GetNchWeight(static_cast<Int_t>(nTracklets));
741  AliDebug(2,Form("Using Nch weights, Mult=%d Weight=%f\n",nChargedMCPhysicalPrimary,fWeight));
742  }
743  Double_t eventWeight=fWeight;
744 
745  if (TMath::Abs(zMCVertex) > fCuts->GetMaxVtxZ()){
746  AliDebug(3,Form("z coordinate of MC vertex = %f, it was required to be within [-%f, +%f], skipping event", zMCVertex, fCuts->GetMaxVtxZ(), fCuts->GetMaxVtxZ()));
747  delete[] containerInput;
748  delete[] containerInputMC;
749  delete cfVtxHF;
750  return;
751  }
752 
753  if(aodEvent->GetTriggerMask()==0 &&
754  (runnumber>=195344 && runnumber<=195677)){
755  AliDebug(3,"Event rejected because of null trigger mask");
756  delete[] containerInput;
757  delete[] containerInputMC;
758  delete cfVtxHF;
759  return;
760  }
761 
762  AliESDtrackCuts** trackCuts = new AliESDtrackCuts*[cfVtxHF->GetNProngs()];
763  if (fDecayChannel == 21){
764  // for the D*, setting the third element of the array of the track cuts to those for the soft pion
765  for (Int_t iProng = 0; iProng<cfVtxHF->GetNProngs()-1; iProng++){
766  trackCuts[iProng]=fCuts->GetTrackCuts();
767  }
768  trackCuts[2] = fCuts->GetTrackCutsSoftPi();
769  }
770  else if (fDecayChannel == 22) {
771  // for the Lc->V0+bachelor, setting the second and third elements of the array of the track cuts to those for the V0 daughters
772  trackCuts[0]=fCuts->GetTrackCuts();
773  trackCuts[1]=fCuts->GetTrackCutsV0daughters();
774  trackCuts[2]=fCuts->GetTrackCutsV0daughters();
775  }
776  else {
777  for (Int_t iProng = 0; iProng<cfVtxHF->GetNProngs(); iProng++){
778  trackCuts[iProng]=fCuts->GetTrackCuts();
779  }
780  }
781 
782  //General settings: vertex, feed down and fill reco container with generated values.
783  cfVtxHF->SetRecoPrimVertex(zPrimVertex);
784  cfVtxHF->SetMCPrimaryVertex(zMCVertex);
786  cfVtxHF->SetNVar(fNvar);
790 
791  // switch-off the trigger class selection (doesn't work for MC)
792  fCuts->SetTriggerClass("");
793 
794  // MC vertex, to be used, in case, for pp
796 
797  if (fCentralitySelection){ // keep only the requested centrality
798 
799  if(fCuts->IsEventSelectedInCentrality(aodEvent)!=0) {
800  delete[] containerInput;
801  delete[] containerInputMC;
802  delete [] trackCuts;
803  delete cfVtxHF;
804  return;
805  }
806  } else { // keep all centralities
807  fCuts->SetMinCentrality(0.);
808  fCuts->SetMaxCentrality(100.);
809  }
810 
811  Float_t centValue = 0.;
812  if(!fIsPPData) centValue = fCuts->GetCentrality(aodEvent);
813  cfVtxHF->SetCentralityValue(centValue);
814 
815  // multiplicity estimator with VZERO
816  Double_t vzeroMult=0;
817  AliAODVZERO *vzeroAOD = (AliAODVZERO*)aodEvent->GetVZEROData();
818  if(vzeroAOD) vzeroMult = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
819 
820  Double_t multiplicity = nTracklets; // set to the Ntracklet estimator
821  if(fMultiplicityEstimator==kVZERO) { multiplicity = vzeroMult; }
822 
823  cfVtxHF->SetMultiplicity(multiplicity);
824 
825  // printf("Multiplicity estimator %d, value %2.2f\n",fMultiplicityEstimator,multiplicity);
826 
827  for (Int_t iPart=0; iPart<mcArray->GetEntriesFast(); iPart++) {
828  AliAODMCParticle* mcPart = dynamic_cast<AliAODMCParticle*>(mcArray->At(iPart));
829  if (!mcPart){
830  AliError("Failed casting particle from MC array!, Skipping particle");
831  continue;
832  }
833 
834  //counting c quarks
835  cquarks += cfVtxHF->MCcquarkCounting(mcPart);
836 
837  // check the MC-level cuts, must be the desidered particle
838  if (!fCFManager->CheckParticleCuts(0, mcPart)) {
839  AliDebug(2,"Check the MC-level cuts - not desidered particle");
840  continue; // 0 stands for MC level
841  }
842  else {
843  AliDebug(3, Form("\n\n---> COOL! we found a particle (particle %d)!!! with PDG code = %d \n\n", iPart, mcPart->GetPdgCode()));
844  }
845  cfVtxHF->SetMCCandidateParam(iPart);
846 
847 
848  if (!(cfVtxHF->SetLabelArray())){
849  AliDebug(2,Form("Impossible to set the label array for particle %d (decaychannel = %d)", iPart, fDecayChannel));
850  continue;
851  }
852 
853  //check the candiate family at MC level
854  if (!(cfVtxHF->CheckMCPartFamily(mcPart, mcArray))) {
855  AliDebug(2,Form("Check on the family wrong for particle %d!!! (decaychannel = %d)", iPart, fDecayChannel));
856  continue;
857  }
858  else{
859  AliDebug(2,Form("Check on the family OK for particle %d!!! (decaychannel = %d)", iPart, fDecayChannel));
860  }
861 
862  //Fill the MC container
863  Bool_t mcContainerFilled = cfVtxHF -> FillMCContainer(containerInputMC);
864  AliDebug(2, Form("particle = %d mcContainerFilled = %d", iPart, mcContainerFilled));
865  if (mcContainerFilled) {
866  if (fUseWeight){
867  if (fHistoPtWeight) { // using an histogram as weight function
868  AliDebug(2,"Using Histogram as Pt weight function");
869  fWeight = eventWeight*GetPtWeightFromHistogram(containerInputMC[0]);
870  }
871  else if (fFuncWeight){ // using user-defined function
872  AliDebug(2,"Using function");
873  fWeight = eventWeight*fFuncWeight->Eval(containerInputMC[0]);
874  }
875  else{ // using FONLL
876  AliDebug(2,"Using FONLL");
877  fWeight = eventWeight*GetWeight(containerInputMC[0]);
878  }
879  AliDebug(2,Form("pt = %f, weight = %f",containerInputMC[0], fWeight));
880  }
881  if (!fCuts->IsInFiducialAcceptance(containerInputMC[0],containerInputMC[1])) {
882  AliDebug(3, Form("Not in limited acceptance, containerInputMC[0] = %f, containerInputMC[1] = %f", containerInputMC[0], containerInputMC[1]));
883  continue;
884  }
885  else{
886  AliDebug(3, Form("YES!! in limited acceptance, containerInputMC[0] = %f, containerInputMC[1] = %f", containerInputMC[0],containerInputMC[1]));
887  }
888 
889  //MC Limited Acceptance
890  if (TMath::Abs(containerInputMC[1]) < 0.5) {
891  fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepGeneratedLimAcc, fWeight);
892  icountGenLimAcc++;
893  AliDebug(3,"MC Lim Acc container filled\n");
894  if (fCFManager->GetParticleContainer()->GetNStep() == kStepGenLimAccNoAcc+1) {
895  if (!(cfVtxHF-> MCAcceptanceStep())) {
896  fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepGenLimAccNoAcc, fWeight);
897  icountGenLimAccNoAcc++;
898  AliDebug(3,"MC Lim Acc No Acc container filled\n");
899  }
900  }
901  }
902 
903  //MC
904  fCFManager->GetParticleContainer()->Fill(containerInputMC, kStepGenerated, fWeight);
905  icountMC++;
906  AliDebug(3,"MC container filled \n");
907 
908  // MC in acceptance
909  // check the MC-Acceptance level cuts
910  // since standard CF functions are not applicable, using Kine Cuts on daughters
911  Bool_t mcAccepStep = cfVtxHF-> MCAcceptanceStep();
912  if (mcAccepStep){
913  fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepAcceptance, fWeight);
914  AliDebug(3,"MC acceptance cut passed\n");
915  icountAcc++;
916 
917  //MC Vertex step
918  if (fCuts->IsEventSelected(aodEvent)){
919  // filling the container if the vertex is ok
920  fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepVertex, fWeight) ;
921  AliDebug(3,"Vertex cut passed and container filled\n");
922  icountVertex++;
923 
924  //mc Refit requirement
925  Bool_t mcRefitStep = cfVtxHF->MCRefitStep(aodEvent, &trackCuts[0]);
926  if (mcRefitStep){
927  fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepRefit, fWeight);
928  AliDebug(3,"MC Refit cut passed and container filled\n");
929  icountRefit++;
930  }
931  else{
932  AliDebug(3,"MC Refit cut not passed\n");
933  continue;
934  }
935  }
936  else{
937  AliDebug (3, "MC vertex step not passed\n");
938  continue;
939  }
940  }
941  else{
942  AliDebug (3, "MC in acceptance step not passed\n");
943  continue;
944  }
945  }
946  else {
947  AliDebug (3, "MC container not filled\n");
948  }
949  }
950 
951  if (cquarks<2) AliDebug(2,Form("Event with %d c-quarks", cquarks));
952  AliDebug(2,Form("Found %i MC particles that are %s!!",icountMC,fPartName.Data()));
953  AliDebug(2,Form("Found %i MC particles that are %s and satisfy Acc cuts!!",icountAcc,fPartName.Data()));
954  AliDebug(2,Form("Found %i MC particles that are %s and satisfy Vertex cuts!!",icountVertex,fPartName.Data()));
955  AliDebug(2,Form("Found %i MC particles that are %s and satisfy Refit cuts!!",icountRefit,fPartName.Data()));
956 
957  // Now go to rec level
958  fCountMC += icountMC;
959  fCountGenLimAcc += icountGenLimAcc;
960  fCountGenLimAccNoAcc += icountGenLimAccNoAcc;
961  fCountAcc += icountAcc;
962  fCountVertex+= icountVertex;
963  fCountRefit+= icountRefit;
964 
965  AliDebug(2,Form("Found %d vertices for decay channel %d",arrayBranch->GetEntriesFast(),fDecayChannel));
967 
968  for(Int_t iCandid = 0; iCandid<arrayBranch->GetEntriesFast();iCandid++){
969  AliAODRecoDecayHF* charmCandidate=0x0;
970  switch (fDecayChannel){
971  case 2:{
972  charmCandidate = (AliAODRecoDecayHF2Prong*)arrayBranch->At(iCandid);
973  vHF->FillRecoCand(aodEvent,(AliAODRecoDecayHF2Prong*)charmCandidate);
974  break;
975  }
976  case 21:{
977  charmCandidate = (AliAODRecoCascadeHF*)arrayBranch->At(iCandid);
978  vHF->FillRecoCasc(aodEvent,((AliAODRecoCascadeHF*)charmCandidate),kTRUE);//DStar
979  break;
980  }
981  case 22:{
982  charmCandidate = (AliAODRecoCascadeHF*)arrayBranch->At(iCandid);
983  vHF->FillRecoCasc(aodEvent,((AliAODRecoCascadeHF*)charmCandidate),kFALSE);//Cascade
984  break;
985  }
986  case 31:
987  case 32:
988  case 33:{
989  charmCandidate = (AliAODRecoDecayHF3Prong*)arrayBranch->At(iCandid);
990  vHF->FillRecoCand(aodEvent,(AliAODRecoDecayHF3Prong*)charmCandidate);
991  break;
992  }
993  case 4:{
994  charmCandidate = (AliAODRecoDecayHF4Prong*)arrayBranch->At(iCandid);
995  break;
996  }
997  default:
998  break;
999  }
1000 
1001  Bool_t unsetvtx=kFALSE;
1002  if(!charmCandidate->GetOwnPrimaryVtx()) {
1003  charmCandidate->SetOwnPrimaryVtx(aodVtx); // needed to compute all variables
1004  unsetvtx=kTRUE;
1005  }
1006 
1007  Bool_t signAssociation = cfVtxHF->SetRecoCandidateParam((AliAODRecoDecayHF*)charmCandidate);
1008  if (!signAssociation){
1009  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1010  continue;
1011  }
1012 
1013  Int_t isPartOrAntipart = cfVtxHF->CheckReflexion(fSign);
1014  if (isPartOrAntipart == 0){
1015  AliDebug(2, Form("The candidate pdg code doesn't match the requirement set in the task (fSign = %d)",fSign));
1016  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1017  continue;
1018  }
1019 
1020  AliDebug(3,Form("iCandid=%d - signAssociation=%d, isPartOrAntipart=%d",iCandid, signAssociation, isPartOrAntipart));
1021 
1022  Bool_t recoContFilled = cfVtxHF->FillRecoContainer(containerInput);
1023  AliDebug(3, Form("CF task: RecoContFilled for candidate %d is %d", iCandid, (Int_t)recoContFilled));
1024  if (recoContFilled){
1025 
1026  // weight according to pt
1027  if (fUseWeight){
1028  if (fHistoPtWeight) {
1029  AliDebug(2,"Using Histogram as Pt weight function");
1030  fWeight = eventWeight*GetPtWeightFromHistogram(containerInput[0]);
1031  }
1032  else if (fFuncWeight){ // using user-defined function
1033  AliDebug(2, "Using function");
1034  fWeight = eventWeight*fFuncWeight->Eval(containerInput[0]);
1035  }
1036  else{ // using FONLL
1037  AliDebug(2, "Using FONLL");
1038  fWeight = eventWeight*GetWeight(containerInput[0]);
1039  }
1040  AliDebug(2, Form("pt = %f, weight = %f",containerInput[0], fWeight));
1041  }
1042 
1043  if (!fCuts->IsInFiducialAcceptance(containerInput[0],containerInput[1])){
1044  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1045  continue;
1046  }
1047  //Reco Step
1048  Bool_t recoStep = cfVtxHF->RecoStep();
1049  if (recoStep) AliDebug(2, Form("particle = %d --> CF task: Reco step for candidate %d is %d", iCandid, iCandid, (Int_t)recoStep));
1050  Bool_t vtxCheck = fCuts->IsEventSelected(aodEvent);
1051 
1052 
1053  // Selection on the filtering bit
1054  Bool_t isBitSelected = kTRUE;
1055  if(fDecayChannel==2) {
1056  if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) isBitSelected = kFALSE;
1057  }else if(fDecayChannel==31){
1058  if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kDplusCuts)) isBitSelected = kFALSE;
1059  }else if(fDecayChannel==33){
1060  if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kDsCuts)) isBitSelected = kFALSE;
1061  }else if(fDecayChannel==32){
1062  if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kLcCuts)) isBitSelected = kFALSE;
1063  }
1064  if(!isBitSelected){
1065  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1066  continue;
1067  }
1068 
1069 
1070  if (recoStep && recoContFilled && vtxCheck){
1071  fCFManager->GetParticleContainer()->Fill(containerInput,kStepReconstructed, fWeight) ;
1072  icountReco++;
1073  AliDebug(3,"Reco step passed and container filled\n");
1074 
1075  //Reco in the acceptance -- take care of UNFOLDING!!!!
1076  Bool_t recoAcceptanceStep = cfVtxHF->RecoAcceptStep(&trackCuts[0]);
1077  if (recoAcceptanceStep) {
1078  fCFManager->GetParticleContainer()->Fill(containerInput,kStepRecoAcceptance, fWeight) ;
1079  icountRecoAcc++;
1080  AliDebug(3,"Reco acceptance cut passed and container filled\n");
1081 
1082  if(fAcceptanceUnf){
1083  Double_t fill[4]; //fill response matrix
1084  Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(fPDGcode,fill);
1085  if (bUnfolding) fCorrelation->Fill(fill);
1086  }
1087 
1088  //Number of ITS cluster requirements
1089  Int_t recoITSnCluster = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kTracks, aodEvent);
1090  if (recoITSnCluster){
1091  fCFManager->GetParticleContainer()->Fill(containerInput,kStepRecoITSClusters, fWeight) ;
1092  icountRecoITSClusters++;
1093  AliDebug(3,"Reco n ITS cluster cut passed and container filled\n");
1094 
1095  Bool_t iscutsusingpid = fCuts->GetIsUsePID();
1096  Int_t recoAnalysisCuts = -1, recoPidSelection = -1;
1097  fCuts->SetUsePID(kFALSE);
1098  recoAnalysisCuts = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kCandidate, aodEvent);
1099 
1100  if (fDecayChannel==33){ // Ds case, where more possibilities are considered
1101  Bool_t keepDs=ProcessDs(recoAnalysisCuts);
1102  if(keepDs) recoAnalysisCuts=3;
1103  }
1104  else if (fDecayChannel==22){ // Lc->V0+bachelor case, where more possibilities are considered
1105  Bool_t keepLctoV0bachelor = ProcessLctoV0Bachelor(recoAnalysisCuts);
1106  if (keepLctoV0bachelor) recoAnalysisCuts=3;
1107  AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
1108  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
1109  AliPIDResponse* pidResponse = inputHandler->GetPIDResponse();
1110  if (fUseAdditionalCuts){
1111  if (!((AliCFVertexingHFCascade*)cfVtxHF)->CheckAdditionalCuts(pidResponse)) recoAnalysisCuts = -1;
1112  }
1113  }
1114 
1115  fCuts->SetUsePID(iscutsusingpid); //restoring usage of the PID from the cuts object
1116  Bool_t tempAn=(recoAnalysisCuts == 3 || recoAnalysisCuts == isPartOrAntipart);
1117  if (fDecayChannel == 22) tempAn = (recoAnalysisCuts == 3);
1118  if (fDecayChannel == 32) tempAn=(recoAnalysisCuts >0 || recoAnalysisCuts == isPartOrAntipart);
1119 
1120  if (tempAn){
1121  fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPPR, fWeight);
1122  icountRecoPPR++;
1123  AliDebug(3,"Reco Analysis cuts passed and container filled \n");
1124  //pid selection
1125  //recoPidSelection = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kPID);
1126  //if((fCuts->CombineSelectionLevels(3,recoAnalysisCuts,recoPidSelection)==isPartOrAntipart)||(fCuts->CombineSelectionLevels(3,recoAnalysisCuts,recoPidSelection)==3)){
1127  recoPidSelection = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kCandidate, aodEvent);
1128 
1129  if (fDecayChannel==33){ // Ds case, where more possibilities are considered
1130  Bool_t keepDs=ProcessDs(recoPidSelection);
1131  if(keepDs) recoPidSelection=3;
1132  } else if (fDecayChannel==22){ // Lc->V0+bachelor case, where more possibilities are considered
1133  Bool_t keepLctoV0bachelor=ProcessLctoV0Bachelor(recoPidSelection);
1134  if (keepLctoV0bachelor) recoPidSelection=3;
1135  }
1136 
1137  Bool_t tempPid=(recoPidSelection == 3 || recoPidSelection == isPartOrAntipart);
1138  if (fDecayChannel == 22) tempPid = (recoPidSelection == 3);
1139  if (fDecayChannel == 32) tempPid=(recoPidSelection >0 || recoPidSelection == isPartOrAntipart);
1140 
1141  if (tempPid){
1142  Double_t weigPID = 1.;
1143  if (fDecayChannel == 2){ // D0 with Bayesian PID using weights
1144  if(((AliRDHFCutsD0toKpi*)fCuts)->GetCombPID() && (((AliRDHFCutsD0toKpi*)fCuts)->GetBayesianStrategy() == AliRDHFCutsD0toKpi::kBayesWeight || ((AliRDHFCutsD0toKpi*)fCuts)->GetBayesianStrategy() == AliRDHFCutsD0toKpi::kBayesWeightNoFilter)){
1145  if (isPartOrAntipart == 1){
1146  weigPID = ((AliRDHFCutsD0toKpi*)fCuts)->GetWeightsNegative()[AliPID::kKaon] * ((AliRDHFCutsD0toKpi*)fCuts)->GetWeightsPositive()[AliPID::kPion];
1147  }else if (isPartOrAntipart == 2){
1148  weigPID = ((AliRDHFCutsD0toKpi*)fCuts)->GetWeightsPositive()[AliPID::kKaon] * ((AliRDHFCutsD0toKpi*)fCuts)->GetWeightsNegative()[AliPID::kPion];
1149  }
1150  if ((weigPID < 0) || (weigPID > 1)) weigPID = 0.;
1151  }
1152  }else if (fDecayChannel == 33){ // Ds with Bayesian PID using weights
1154  Int_t labDau0=((AliAODTrack*)charmCandidate->GetDaughter(0))->GetLabel();
1155  AliAODMCParticle* firstDau=(AliAODMCParticle*)mcArray->UncheckedAt(TMath::Abs(labDau0));
1156  if(firstDau){
1157  Int_t pdgCode0=TMath::Abs(firstDau->GetPdgCode());
1158  if(pdgCode0==321){
1159  weigPID=((AliRDHFCutsDstoKKpi*)fCuts)->GetWeightForKKpi();
1160  }else if(pdgCode0==211){
1161  weigPID=((AliRDHFCutsDstoKKpi*)fCuts)->GetWeightForpiKK();
1162  }
1163  if ((weigPID < 0) || (weigPID > 1)) weigPID = 0.;
1164  }else{
1165  weigPID=0.;
1166  }
1167  }
1168  }
1169  fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPID, fWeight*weigPID);
1170  icountRecoPID++;
1171  AliDebug(3,"Reco PID cuts passed and container filled \n");
1172  if(!fAcceptanceUnf){
1173  Double_t fill[4]; //fill response matrix
1174  Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(fPDGcode,fill);
1175  if (bUnfolding) fCorrelation->Fill(fill);
1176  }
1177  }
1178  else {
1179  AliDebug(3, "Analysis Cuts step not passed \n");
1180  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1181  continue;
1182  }
1183  }
1184  else {
1185  AliDebug(3, "PID selection not passed \n");
1186  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1187  continue;
1188  }
1189  }
1190  else{
1191  AliDebug(3, "Number of ITS cluster step not passed\n");
1192  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1193  continue;
1194  }
1195  }
1196  else{
1197  AliDebug(3, "Reco acceptance step not passed\n");
1198  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1199  continue;
1200  }
1201  }
1202  else {
1203  AliDebug(3, "Reco step not passed\n");
1204  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1205  continue;
1206  }
1207  }
1208 
1209  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1210  } // end loop on candidate
1211  delete vHF;
1212  fCountReco+= icountReco;
1213  fCountRecoAcc+= icountRecoAcc;
1214  fCountRecoITSClusters+= icountRecoITSClusters;
1215  fCountRecoPPR+= icountRecoPPR;
1216  fCountRecoPID+= icountRecoPID;
1217 
1218  fHistEventsProcessed->Fill(1.5);
1219 
1220  delete[] containerInput;
1221  delete[] containerInputMC;
1222  delete cfVtxHF;
1223  if (trackCuts){
1224  // for (Int_t i=0; i<cfVtxHF->GetNProngs(); i++){
1225  // delete [] trackCuts[i];
1226  // }
1227  delete [] trackCuts;
1228  }
1229 
1230 
1231 }
1232 
1233 //___________________________________________________________________________
1235 {
1236  // The Terminate() function is the last function to be called during
1237  // a query. It always runs on the client, it can be used to present
1238  // the results graphically or save the results to file.
1239 
1240  AliAnalysisTaskSE::Terminate();
1241 
1242  AliInfo(Form("Found %i MC particles that are %s in MC, in %d events",fCountMC,fPartName.Data(),fEvents));
1243  AliInfo(Form("Found %i MC particles that are %s in MC in limited acceptance, in %d events",fCountGenLimAcc,fPartName.Data(),fEvents));
1244  AliInfo(Form("Found %i MC particles that are %s in MC in limited acceptance and don't satisfy Acc cuts, in %d events",fCountGenLimAccNoAcc,fPartName.Data(),fEvents));
1245  AliInfo(Form("Found %i MC particles that are %s in MC and satisfy Acc cuts, in %d events",fCountAcc,fPartName.Data(),fEvents));
1246  AliInfo(Form("Found %i MC particles that are %s in MC and satisfy Acc cuts, and satisfy Vertex requirement in %d events",fCountVertex,fPartName.Data(),fEvents));
1247  AliInfo(Form("Found %i MC particles that are %s in MC and satisfy Acc cuts, and satisfy ITS+TPC refit requirementin %d events",fCountRefit,fPartName.Data(),fEvents));
1248  AliInfo(Form("Found %i reco %s that are decaying in %s, in %d events",fCountReco,fPartName.Data(),fDauNames.Data(),fEvents));
1249  AliInfo(Form("Among the above, found %i reco %s that are decaying in %s and are in the requested acceptance, in %d events",fCountRecoAcc,fPartName.Data(),fDauNames.Data(),fEvents));
1250  AliInfo(Form("Among the above, found %i reco %s that are decaying in %s and have at least 5 clusters in ITS, in %d events",fCountRecoITSClusters,fPartName.Data(),fDauNames.Data(),fEvents));
1251  AliInfo(Form("Among the above, found %i reco %s that are decaying in %s and satisfy PPR cuts, in %d events",fCountRecoPPR,fPartName.Data(),fDauNames.Data(),fEvents));
1252  AliInfo(Form("Among the above, found %i reco %s that are decaying in %s and satisfy PPR+PID cuts, in %d events",fCountRecoPID,fPartName.Data(),fDauNames.Data(),fEvents));
1253 
1254  // draw some example plots....
1255  AliCFContainer *cont= dynamic_cast<AliCFContainer*> (GetOutputData(2));
1256  if(!cont) {
1257  printf("CONTAINER NOT FOUND\n");
1258  return;
1259  }
1260  // projecting the containers to obtain histograms
1261  // first argument = variable, second argument = step
1262 
1263  TH1D** h = new TH1D*[3];
1264  Int_t nvarToPlot = 0;
1265  if (fConfiguration == kSnail){
1266  //h = new TH1D[3][12];
1267  for (Int_t ih = 0; ih<3; ih++){
1268  if(fDecayChannel==22){
1269  nvarToPlot = 16;
1270  } else {
1271  nvarToPlot = 12;
1272  }
1273  h[ih] = new TH1D[nvarToPlot];
1274  }
1275  for(Int_t iC=1;iC<nvarToPlot; iC++){
1276  // MC-level
1277  h[0][iC] = *(cont->ShowProjection(iC,0));
1278  // MC-Acceptance level
1279  h[1][iC] = *(cont->ShowProjection(iC,1));
1280  // Reco-level
1281  h[2][iC] = *(cont->ShowProjection(iC,4));
1282  }
1283  }
1284  else {
1285  //h = new TH1D[3][12];
1286  nvarToPlot = 8;
1287  for (Int_t ih = 0; ih<3; ih++){
1288  h[ih] = new TH1D[nvarToPlot];
1289  }
1290  for(Int_t iC=0;iC<nvarToPlot; iC++){
1291  // MC-level
1292  h[0][iC] = *(cont->ShowProjection(iC,0));
1293  // MC-Acceptance level
1294  h[1][iC] = *(cont->ShowProjection(iC,1));
1295  // Reco-level
1296  h[2][iC] = *(cont->ShowProjection(iC,4));
1297  }
1298  }
1299  TString* titles;
1300  //Int_t nvarToPlot = 0;
1301  if (fConfiguration == kSnail){
1302  if(fDecayChannel==31){
1303  //nvarToPlot = 12;
1304  titles = new TString[nvarToPlot];
1305  titles[0]="pT_Dplus (GeV/c)";
1306  titles[1]="rapidity";
1307  titles[2]="phi (rad)";
1308  titles[3]="cT (#mum)";
1309  titles[4]="cosPointingAngle";
1310  titles[5]="pT_1 (GeV/c)";
1311  titles[6]="pT_2 (GeV/c)";
1312  titles[7]="pT_3 (GeV/c)";
1313  titles[8]="d0_1 (#mum)";
1314  titles[9]="d0_2 (#mum)";
1315  titles[10]="d0_3 (#mum)";
1316  titles[11]="zVertex (cm)";
1317  } else if (fDecayChannel==22) {
1318  //nvarToPlot = 16;
1319  titles = new TString[nvarToPlot];
1320  titles[0]="p_{T}(#Lambda_{c}) [GeV/c]";
1321  titles[1]="y(#Lambda_{c})";
1322  titles[2]="#varphi(#Lambda_{c}) [rad]";
1323  titles[3]="onTheFlyStatusV0";
1324  titles[4]="z_{vtx} [cm]";
1325  titles[5]="centrality";
1326  titles[6]="fake";
1327  titles[7]="multiplicity";
1328  //titles[8]="pT(bachelor) [GeV/c]";
1329  titles[8]="p(bachelor) [GeV/c]";
1330  titles[9]="p_{T}(V0) [GeV/c]";
1331  titles[10]="y(V0)";
1332  titles[11]="#varphi(V0) [rad]";
1333  titles[12]="m_{inv}(#pi^{+}#pi^{+}) [GeV/c^{2}]";
1334  titles[13]="dcaV0 (nSigma)";
1335  titles[14]="cosine pointing angle (V0)";
1336  titles[15]="cosine pointing angle (#Lambda_{c})";
1337  //titles[16]="c#tauV0 (#mum)";
1338  //titles[17]="c#tau (#mum)";
1339  } else {
1340  //nvarToPlot = 12;
1341  titles = new TString[nvarToPlot];
1342  titles[0]="pT_D0 (GeV/c)";
1343  titles[1]="rapidity";
1344  titles[2]="cosThetaStar";
1345  titles[3]="pT_pi (GeV/c)";
1346  titles[4]="pT_K (Gev/c)";
1347  titles[5]="cT (#mum)";
1348  titles[6]="dca (#mum)";
1349  titles[7]="d0_pi (#mum)";
1350  titles[8]="d0_K (#mum)";
1351  titles[9]="d0xd0 (#mum^2)";
1352  titles[10]="cosPointingAngle";
1353  titles[11]="phi (rad)";
1354  }
1355  }
1356  else {
1357  //nvarToPlot = 8;
1358  titles = new TString[nvarToPlot];
1359  if (fDecayChannel==22) {
1360  titles[0]="p_{T}(#Lambda_{c}) [GeV/c]";
1361  titles[1]="y(#Lambda_{c})";
1362  titles[2]="#varphi(#Lambda_{c}) [rad]";
1363  titles[3]="onTheFlyStatusV0";
1364  titles[4]="z_{vtx} [cm]";
1365  titles[5]="centrality";
1366  titles[6]="fake";
1367  titles[7]="multiplicity";
1368  } else {
1369  titles[0]="pT_candidate (GeV/c)";
1370  titles[1]="rapidity";
1371  titles[2]="cT (#mum)";
1372  titles[3]="phi";
1373  titles[4]="z_{vtx}";
1374  titles[5]="centrality";
1375  titles[6]="fake";
1376  titles[7]="multiplicity";
1377  }
1378  }
1379 
1380  Int_t markers[16]={20,24,21,25,27,28,
1381  20,24,21,25,27,28,
1382  20,24,21,25};
1383  Int_t colors[3]={2,8,4};
1384  for(Int_t iC=0;iC<nvarToPlot; iC++){
1385  for(Int_t iStep=0;iStep<3;iStep++){
1386  h[iStep][iC].SetTitle(titles[iC].Data());
1387  h[iStep][iC].GetXaxis()->SetTitle(titles[iC].Data());
1388  Double_t maxh=h[iStep][iC].GetMaximum();
1389  h[iStep][iC].GetYaxis()->SetRangeUser(0,maxh*1.2);
1390  h[iStep][iC].SetMarkerStyle(markers[iC]);
1391  h[iStep][iC].SetMarkerColor(colors[iStep]);
1392  }
1393  }
1394 
1395  gStyle->SetCanvasColor(0);
1396  gStyle->SetFrameFillColor(0);
1397  gStyle->SetTitleFillColor(0);
1398  gStyle->SetStatColor(0);
1399 
1400  // drawing in 2 separate canvas for a matter of clearity
1401  TCanvas * c1 =new TCanvas(Form("c1New_%d",fDecayChannel),"Vars 0, 1, 2, 3",1100,1200);
1402  c1->Divide(3,4);
1403  Int_t iPad=1;
1404  for(Int_t iVar=0; iVar<4; iVar++){
1405  c1->cd(iPad++);
1406  h[0][iVar].DrawCopy("p");
1407  c1->cd(iPad++);
1408  h[1][iVar].DrawCopy("p");
1409  c1->cd(iPad++);
1410  h[2][iVar].DrawCopy("p");
1411  }
1412 
1413  TCanvas * c2 =new TCanvas(Form("c2New_%d",fDecayChannel),"Vars 4, 5, 6, 7",1100,1200);
1414  c2->Divide(3,4);
1415  iPad=1;
1416  for(Int_t iVar=4; iVar<8; iVar++){
1417  c2->cd(iPad++);
1418  h[0][iVar].DrawCopy("p");
1419  c2->cd(iPad++);
1420  h[1][iVar].DrawCopy("p");
1421  c2->cd(iPad++);
1422  h[2][iVar].DrawCopy("p");
1423  }
1424 
1425  if (fConfiguration == kSnail){
1426  TCanvas * c3 =new TCanvas(Form("c3New_%d",fDecayChannel),"Vars 8, 9, 10, 11",1100,1200);
1427  c3->Divide(3,4);
1428  iPad=1;
1429  for(Int_t iVar=8; iVar<12; iVar++){
1430  c3->cd(iPad++);
1431  h[0][iVar].DrawCopy("p");
1432  c3->cd(iPad++);
1433  h[1][iVar].DrawCopy("p");
1434  c3->cd(iPad++);
1435  h[2][iVar].DrawCopy("p");
1436  }
1437  if (fDecayChannel==22) {
1438  TCanvas * c4 =new TCanvas(Form("c4New_%d",fDecayChannel),"Vars 12, 13, 14, 15",1100,1200);
1439  c4->Divide(3,4);
1440  iPad=1;
1441  for(Int_t iVar=12; iVar<16; iVar++){
1442  c4->cd(iPad++);
1443  h[0][iVar].DrawCopy("p");
1444  c4->cd(iPad++);
1445  h[1][iVar].DrawCopy("p");
1446  c4->cd(iPad++);
1447  h[2][iVar].DrawCopy("p");
1448  }
1449  }
1450  }
1451 
1452  /*
1453  THnSparseD* hcorr = dynamic_cast<THnSparseD*> (GetOutputData(3));
1454 
1455  TH2D* corr1 = hcorr->Projection(0,2);
1456  TH2D* corr2 = hcorr->Projection(1,3);
1457 
1458  TCanvas * c7 =new TCanvas(Form("c7New_%d",fDecayChannel),"",800,400);
1459  c7->Divide(2,1);
1460  c7->cd(1);
1461  corr1->DrawCopy("text");
1462  c7->cd(2);
1463  corr2->DrawCopy("text");
1464  */
1465  TFile* file_projection = new TFile("CFtaskHFprojectionNew.root","RECREATE");
1466 
1467  // corr1->Write();
1468  // corr2->Write();
1469 
1470  for(Int_t iC=0;iC<nvarToPlot; iC++){
1471  for(Int_t iStep=0;iStep<3;iStep++){
1472  h[iStep][iC].Write(Form("Step%d_%s",iStep,titles[iC].Data()));
1473  }
1474  }
1475  file_projection->Close();
1476  for (Int_t ih = 0; ih<3; ih++) delete [] h[ih];
1477  delete [] h;
1478  delete [] titles;
1479 
1480 }
1481 
1482 //___________________________________________________________________________
1484 {
1485  //HERE ONE CAN CREATE OUTPUT OBJECTS, IN PARTICULAR IF THE OBJECT PARAMETERS DON'T NEED
1486  //TO BE SET BEFORE THE EXECUTION OF THE TASK
1487  //
1488  Info("UserCreateOutputObjects","CreateOutputObjects of task %s\n", GetName());
1489 
1490  //slot #1
1491  OpenFile(1);
1492  const char* nameoutput=GetOutputSlot(1)->GetContainer()->GetName();
1493  fHistEventsProcessed = new TH1I(nameoutput,"",2,0,2) ;
1494  fHistEventsProcessed->GetXaxis()->SetBinLabel(1,"Events processed (all)");
1495  fHistEventsProcessed->GetXaxis()->SetBinLabel(2,"Events analyzed (after selection)");
1496 
1497  PostData(1,fHistEventsProcessed) ;
1498  PostData(2,fCFManager->GetParticleContainer()) ;
1499  PostData(3,fCorrelation) ;
1500 
1501 }
1502 
1503 
1504 //_________________________________________________________________________
1506  // ad-hoc weight function from ratio of
1507  // pt spectra from FONLL 2.76 TeV and
1508  // pt spectra from MC production LHC12a17a (PYTHIA Perugia0 with pthard bins)
1509  if(fFuncWeight) delete fFuncWeight;
1510  fFuncWeight=new TF1("funcWeight","[0]+[1]*TMath::Exp(-[2]*x)",0.,50.);
1511  fFuncWeight->SetParameter(0,4.63891e-02);
1512  fFuncWeight->SetParameter(1,1.51674e+01);
1513  fFuncWeight->SetParameter(2,4.09941e-01);
1514  fUseWeight=kTRUE;
1515 }
1516 //_________________________________________________________________________
1518  // ad-hoc weight function from ratio of
1519  // D0 pt spectra in PbPb 2011 0-10% centrality and
1520  // pt spectra from MC production LHC12a17a (PYTHIA Perugia0 with pthard bins)
1521  if(fFuncWeight) delete fFuncWeight;
1522  fFuncWeight=new TF1("funcWeight","[0]+[1]/TMath::Power(x,[2])",0.05,50.);
1523  fFuncWeight->SetParameter(0,1.43116e-02);
1524  fFuncWeight->SetParameter(1,4.37758e+02);
1525  fFuncWeight->SetParameter(2,3.08583);
1526  fUseWeight=kTRUE;
1527 }
1528 
1529 //_________________________________________________________________________
1531  // weight function from the ratio of the LHC12a17b MC
1532  // and FONLL calculations for pp data
1533  if(fFuncWeight) delete fFuncWeight;
1534  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,50.);
1535  fFuncWeight->SetParameters(1.92381e+01, 5.05055e+00, 1.05314e+01, 2.5, 1.88214e-03, 3.44871e+00, -9.74325e-02, 1.97671e+00, -3.21278e-01);
1536  fUseWeight=kTRUE;
1537 }
1538 
1539 //_________________________________________________________________________
1541  // weight function from the ratio of the LHC12a17b MC
1542  // and FONLL calculations for pp data
1543  // corrected by the BAMPS Raa calculation for 30-50% CC
1544  if(fFuncWeight) delete fFuncWeight;
1545  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,50.);
1546  fFuncWeight->SetParameters(6.10443e+00, 1.53487e+00, 1.99474e+00, 2.5, 5.51172e-03, 5.86590e+00, -5.46963e-01, 9.41201e-02, -1.64323e-01);
1547  fUseWeight=kTRUE;
1548 }
1549 
1550 //_________________________________________________________________________
1552  // weight function from the ratio of the LHC13d3 MC
1553  // and FONLL calculations for pp data
1554  if(fFuncWeight) delete fFuncWeight;
1555  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,30.);
1556  fFuncWeight->SetParameters(2.94999e+00,3.47032e+00,2.81278e+00,2.5,1.93370e-02,3.86865e+00,-1.54113e-01,8.86944e-02,2.56267e-02);
1557  fUseWeight=kTRUE;
1558 }
1559 
1560 //_________________________________________________________________________
1562  // weight function from the ratio of the LHC10f6a MC
1563  // and FONLL calculations for pp data
1564  if(fFuncWeight) delete fFuncWeight;
1565  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,40.);
1566  fFuncWeight->SetParameters(2.41522e+01,4.92146e+00,6.72495e+00,2.5,6.15361e-03,4.78995e+00,-4.29135e-01,3.99421e-01,-1.57220e-02);
1567  fUseWeight=kTRUE;
1568 }
1569 
1570 //_________________________________________________________________________
1572  // weight function from the ratio of the LHC12a12 MC
1573  // and FONLL calculations for pp data
1574  if(fFuncWeight) delete fFuncWeight;
1575  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x+[9])",0.15,50.);
1576  fFuncWeight->SetParameters(1.31497e+01,3.30503e+00,3.45594e+00,2.5,2.28642e-02,1.42372e+00,2.32892e-04,5.21986e-02,-2.14236e-01,3.86200e+00);
1577  fUseWeight=kTRUE;
1578 }
1579 
1580 //_________________________________________________________________________
1582  // weight function from the ratio of the LHC12a12bis MC
1583  // and FONLL calculations for pp data
1584  if(fFuncWeight) delete fFuncWeight;
1585  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x+[9])",0.15,50.);
1586  fFuncWeight->SetParameters(6.54519e+00,2.74007e+00,2.48325e+00,2.5,1.61113e-01,-5.32546e-01,-3.75916e-04,2.38189e-01,-2.17561e-01,2.35975e+00);
1587  fUseWeight=kTRUE;
1588 }
1589 
1590 //_________________________________________________________________________
1592  // weight function from the ratio of the LHC13e2fix MC
1593  // and FONLL calculations for pp data
1594  if(fFuncWeight) delete fFuncWeight;
1595  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x+[9])",0.15,50.);
1596  fFuncWeight->SetParameters(1.85862e+01,2.48171e+00,3.39356e+00,2.5,1.70426e-02,2.28453e+00,-4.57749e-02,5.84585e-02,-3.19719e-01,4.16789e+00);
1597  fUseWeight=kTRUE;
1598 }
1599 
1600 //________________________________________________________________
1602  // weight function from the ratio of the LHC10f6a MC
1603  // and FONLL calculations for pp data
1604  if(fFuncWeight) delete fFuncWeight;
1605  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,40.);
1606  fFuncWeight->SetParameters(2.77730e+01,4.78942e+00,7.45378e+00,2.5,9.86255e-02,2.30120e+00,-4.16435e-01,3.43770e-01,-2.29380e-02);
1607  fUseWeight=kTRUE;
1608 }
1609 
1610 //________________________________________________________________
1612  // weight function from the ratio of the LHC10f6a MC
1613  // and FONLL calculations for pp data
1614  if(fFuncWeight) delete fFuncWeight;
1615  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x+[9])",0.15,40.);
1616  fFuncWeight->SetParameters(1.34412e+01,3.20068e+00,5.14481e+00,2.5,7.59405e-04,7.51821e+00,-3.93811e-01,2.16849e-02,-3.37768e-02,2.40308e+00);
1617  fUseWeight=kTRUE;
1618 }
1619 
1620 //_________________________________________________________________________
1622  // weight function from the ratio of the LHC13d3 MC
1623  // and FONLL calculations for pPb data
1624  // using Lc simulated pt distribution
1625  if(fFuncWeight) delete fFuncWeight;
1626  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",0.15,20.);
1627  fFuncWeight->SetParameters(5.94428e+01,1.63585e+01,9.65555e+00,6.71944e+00,8.88338e-02,2.40477e+00,-4.88649e-02,-6.78599e-01,-2.10951e-01);
1628  fUseWeight=kTRUE;
1629 }
1630 
1631 //_________________________________________________________________________
1633  // weight function from the ratio of the LHC11b2 MC
1634  // and FONLL calculations for pp data
1635  // using Lc simulated pt distribution
1636  if(fFuncWeight) delete fFuncWeight;
1637  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",1.,20.);
1638  fFuncWeight->SetParameters(2.11879e+02,3.73290e+00,2.01235e+01,1.41508e+00,1.06268e-01,1.86285e+00,-4.52956e-02,-9.90631e-01,-1.31615e+00);
1639  fUseWeight=kTRUE;
1640 }
1641 
1642 //_________________________________________________________________________
1644  // weight function from the ratio of the LHC10f7a MC
1645  // and FONLL calculations for pp data
1646  // using Lc simulated pt distribution
1647  if(fFuncWeight) delete fFuncWeight;
1648  fFuncWeight=new TF1("funcWeight","([0]*x)/TMath::Power([2],(1+TMath::Power([3],x/[1])))+[4]*TMath::Exp([5]+[6]*x)+[7]*TMath::Exp([8]*x)",1.,20.);
1649  fFuncWeight->SetParameters(2.84268e+02,2.18850e+01,2.36298e+01,7.46144e+00,1.69747e-01,1.66993e+00,-5.54726e-02,-1.53869e+00,-1.18404e+00);
1650  fUseWeight=kTRUE;
1651 }
1652 
1653 //_________________________________________________________________________
1655 {
1656  //
1657  // calculating the weight to fill the container
1658  //
1659 
1660  // FNOLL central:
1661  // p0 = 1.63297e-01 --> 0.322643
1662  // p1 = 2.96275e+00
1663  // p2 = 2.30301e+00
1664  // p3 = 2.50000e+00
1665 
1666  // PYTHIA
1667  // p0 = 1.85906e-01 --> 0.36609
1668  // p1 = 1.94635e+00
1669  // p2 = 1.40463e+00
1670  // p3 = 2.50000e+00
1671 
1672  Double_t func1[4] = {0.322643,2.96275,2.30301,2.5};
1673  Double_t func2[4] = {0.36609,1.94635,1.40463,2.5};
1674 
1675  Double_t dndpt_func1 = dNdptFit(pt,func1);
1676  if(fUseFlatPtWeight) dndpt_func1 = 1./30.;
1677  Double_t dndpt_func2 = dNdptFit(pt,func2);
1678  AliDebug(2,Form("pt = %f, FONLL = %f, Pythia = %f, ratio = %f",pt,dndpt_func1,dndpt_func2,dndpt_func1/dndpt_func2));
1679  return dndpt_func1/dndpt_func2;
1680 }
1681 
1682 //__________________________________________________________________________________________________
1683 Double_t AliCFTaskVertexingHF::dNdptFit(Float_t pt, Double_t* par)
1684 {
1685  //
1686  // calculating dNdpt
1687  //
1688 
1689  Double_t denom = TMath::Power((pt/par[1]), par[3] );
1690  Double_t dNdpt = par[0]*pt/TMath::Power(1.+denom, par[2]);
1691 
1692  return dNdpt;
1693 }
1694 
1695 //_________________________________________________________________________
1697 {
1698  //
1699  // Using an histogram as weight function
1700  // weight = 0 in the range outside the function
1701  //
1702  Double_t weight = 0.0;
1703  Int_t histoNbins = fHistoPtWeight->GetNbinsX();
1704  Int_t histobin = fHistoPtWeight->FindBin(pt);
1705  if( (histobin>0) && (histobin<=histoNbins) ) {
1706  weight = fHistoPtWeight->GetBinContent(histobin);
1707  }
1708 
1709  return weight;
1710 }
1711 
1712 //__________________________________________________________________________________________________
1713 Double_t AliCFTaskVertexingHF::GetZWeight(Float_t z, Int_t runnumber){
1714  //
1715  // calculating the z-vtx weight for the given run range
1716  //
1717 
1718  if(runnumber>146824 || runnumber<146803) return 1.0;
1719 
1720  Double_t func1[3] = {1.0, -0.5, 6.5 };
1721  Double_t func2[3] = {1.0, -0.5, 5.5 };
1722 
1723  Double_t dzFunc1 = DodzFit(z,func1);
1724  Double_t dzFunc2 = DodzFit(z,func2);
1725 
1726  return dzFunc1/dzFunc2;
1727 }
1728 
1729 //__________________________________________________________________________________________________
1730 Double_t AliCFTaskVertexingHF::DodzFit(Float_t z, Double_t* par) {
1731 
1732  //
1733  // Gaussian z-vtx shape
1734  //
1735  //gaussian = [0]/TMath::Sqrt(2.*TMath::Pi())/[2]*exp[-(x-[1])*(x-[1])/(2*[2]*[2])]
1736 
1737  Double_t value = par[0]/TMath::Sqrt(2.*TMath::Pi())/par[2]*TMath::Exp(-(z-par[1])*(z-par[1])/2./par[2]/par[2]);
1738 
1739  return value;
1740 }
1741 //__________________________________________________________________________________________________
1743  //
1744  // calculates the Nch weight using the measured and generateed Nch distributions
1745  //
1746  if(nch<=0) return 0.;
1747  if(!fHistoMeasNch || !fHistoMCNch) { AliError("Input histos to evaluate Nch weights missing"); return 0.; }
1748  Double_t pMeas=fHistoMeasNch->GetBinContent(fHistoMeasNch->FindBin(nch));
1749  Double_t pMC=fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(nch));
1750  Double_t weight = pMC>0 ? pMeas/pMC : 0.;
1751  if(fUseMultRatioAsWeight) weight = pMC;
1752  return weight;
1753 }
1754 //__________________________________________________________________________________________________
1756  // creates historgam with measured multiplcity distribution in pp 7 TeV collisions (from Eur. Phys. J. C (2010) 68: 345–354)
1757  //
1758  // for Nch > 70 the points were obtained with a double NBD distribution fit
1759  // TF1 *fit1 = new TF1("fit1","[0]*(TMath::Gamma(x+[1])/(TMath::Gamma(x+1)*TMath::Gamma([1])))*(TMath::Power(([2]/[1]),x))*(TMath::Power((1+([2]/[1])),-x-[1]))"); fit1->SetParameter(0,1.);// normalization constant
1760  // fit1->SetParameter(1,1.63); // k parameter
1761  // fit1->SetParameter(2,12.8); // mean multiplicity
1762  //
1763  Double_t nchbins[82]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1764  10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1765  20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1766  30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1767  40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1768  50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1769  60.50,62.50,64.50,66.50,68.50,70.50,72.50,74.50,76.50,78.50,
1770  80.50,82.50,84.50,86.50,88.50,90.50,92.50,94.50,96.50,98.50,
1771  100.50,102.50};
1772  Double_t pch[81]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1773  0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1774  0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1775  0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1776  0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1777  0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1778  0.000296,0.000265,0.000193,0.00016,0.000126,0.0000851, 0.0000676,0.0000537,0.0000426, 0.0000338,
1779  0.0000268,0.0000213,0.0000166,0.0000133,0.0000106,0.00000837,0.00000662, 0.00000524,0.00000414, 0.00000327,
1780  0.00000258};
1781 
1782  if(fHistoMeasNch) delete fHistoMeasNch;
1783  fHistoMeasNch=new TH1F("hMeaseNch","",81,nchbins);
1784  for(Int_t i=0; i<81; i++){
1785  fHistoMeasNch->SetBinContent(i+1,pch[i]);
1786  fHistoMeasNch->SetBinError(i+1,0.);
1787  }
1788 }
1789 
1790 //__________________________________________________________________________________________________
1791 Bool_t AliCFTaskVertexingHF::ProcessDs(Int_t recoAnalysisCuts) const{
1792  // processes output of Ds is selected
1793  Bool_t keep=kFALSE;
1794  if(recoAnalysisCuts > 0){
1795  Int_t isKKpi=recoAnalysisCuts&1;
1796  Int_t ispiKK=recoAnalysisCuts&2;
1797  Int_t isPhiKKpi=recoAnalysisCuts&4;
1798  Int_t isPhipiKK=recoAnalysisCuts&8;
1799  Int_t isK0starKKpi=recoAnalysisCuts&16;
1800  Int_t isK0starpiKK=recoAnalysisCuts&32;
1801  if(fDsOption==1){
1802  if(isKKpi && isPhiKKpi) keep=kTRUE;
1803  if(ispiKK && isPhipiKK) keep=kTRUE;
1804  }
1805  else if(fDsOption==2){
1806  if(isKKpi && isK0starKKpi) keep=kTRUE;
1807  if(ispiKK && isK0starpiKK) keep=kTRUE;
1808  }
1809  else if(fDsOption==3)keep=kTRUE;
1810  }
1811  return keep;
1812 }
1813 //__________________________________________________________________________________________________
1814 Bool_t AliCFTaskVertexingHF::ProcessLctoV0Bachelor(Int_t recoAnalysisCuts) const{
1815 
1816  // processes output of Lc->V0+bnachelor is selected
1817 
1818  Bool_t keep=kFALSE;
1819 
1820  if (recoAnalysisCuts > 0){
1821 
1822  Int_t isK0Sp = recoAnalysisCuts&1;
1823  Int_t isLambdaBarpi = recoAnalysisCuts&2;
1824  Int_t isLambdapi = recoAnalysisCuts&4;
1825 
1826  if(fLctoV0bachelorOption == 1){
1827  if(isK0Sp) keep=kTRUE;
1828  }
1829  else if(fLctoV0bachelorOption == 2){
1830  if(isLambdaBarpi) keep=kTRUE;
1831  }
1832  else if(fLctoV0bachelorOption == 4){
1833  if(isLambdapi) keep=kTRUE;
1834  }
1835  else if(fLctoV0bachelorOption == 7) {
1836  if (isK0Sp || isLambdaBarpi || isLambdapi) keep=kTRUE;
1837  }
1838  }
1839  return keep;
1840 }
1841 
1842 //____________________________________________________________________________
1843 TProfile* AliCFTaskVertexingHF::GetEstimatorHistogram(const AliVEvent* event){
1844  // Get Estimator Histogram from period event->GetRunNumber();
1845  //
1846  // If you select SPD tracklets in |eta|<1 you should use type == 1
1847  //
1848 
1849  Int_t runNo = event->GetRunNumber();
1850  Int_t period = -1; // pp: 0-LHC10b, 1-LHC10c, 2-LHC10d, 3-LHC10e
1851  // pPb: 0-LHC13b, 1-LHC13c
1852 
1853  if (fIsPPbData) { // setting run numbers for LHC13 if pPb
1854  if (runNo>195343 && runNo<195484) period = 0;
1855  if (runNo>195528 && runNo<195678) period = 1;
1856  if (period<0 || period>1) return 0;
1857  } else { //else assume pp 2010
1858  if(runNo>114930 && runNo<117223) period = 0;
1859  if(runNo>119158 && runNo<120830) period = 1;
1860  if(runNo>122373 && runNo<126438) period = 2;
1861  if(runNo>127711 && runNo<130841) period = 3;
1862  if(period<0 || period>3) return 0;
1863  }
1864 
1865  return fMultEstimatorAvg[period];
1866 }
void SetCentralityValue(Float_t centValue)
virtual AliESDtrackCuts * GetTrackCutsV0daughters() const
Definition: AliRDHFCuts.h:248
void SetFillFromGenerated(Bool_t flag)
Double_t GetPtWeightFromHistogram(Float_t pt)
Bool_t fUseAdditionalCuts
flag for pPb data (used for multiplicity corrections)
Bool_t fUseZWeight
flag to decide to use a flat pt shape
AliCFTaskVertexingHF & operator=(const AliCFTaskVertexingHF &c)
Bool_t fFillFromGenerated
decay channel to configure the task
Double_t GetWeight(Float_t pt)
virtual AliESDtrackCuts * GetTrackCutsSoftPi() const
Definition: AliRDHFCuts.h:247
Int_t fCountAcc
MC particle found in limited acceptance that doesn't satisfy acceptance cuts.
void SetUseMCVertex()
Definition: AliRDHFCuts.h:337
Int_t fCountRefit
Reco particle found that satisfy vertex constrained.
Int_t MCcquarkCounting(AliAODMCParticle *mcPart) const
Class for HF corrections as a function of many variables and steps For D* and other cascades...
Int_t IsEventSelectedInCentrality(AliVEvent *event)
Int_t fCountReco
Reco particle found that satisfy kTPCrefit and kITSrefit.
Bool_t HasSelectionBit(Int_t i) const
UInt_t fPDGcode
flag to use selection bit
Class for HF corrections as a function of many variables and step.
Bool_t FillRecoContainer(Double_t *containerInput)
Int_t fCountGenLimAcc
MC particle found.
Bool_t fIsPPbData
flag for pp data (not checking centrality)
TH1F * fHistoPtWeight
user-defined function to be used to calculate weights
Bool_t fUseSelectionBit
Lc->V0+bachelor decay option (generation level)
AliCFTaskVertexingHF()
multiplicity estimators
Int_t fCountRecoITSClusters
Reco particle found that satisfy cuts in requested acceptance.
Int_t fNvar
flag to use directly the ratio of the distributions (fHistoMCNch) instead of computing it ...
void SetNVar(Int_t nVar)
void SetRejectCandidateIfNotFromQuark(Bool_t opt)
virtual Bool_t SetLabelArray()
Int_t fGenLctoV0bachelorOption
Lc->V0+bachelor decay option (selection level)
Double_t GetZWeight(Float_t z, Int_t runnumber)
void SetPtWeightsFromFONLL276andBAMPSoverLHC12a17b()
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
Int_t fCountGenLimAccNoAcc
MC particle found in limited acceptance.
Double_t dNdptFit(Float_t pt, Double_t *par)
Int_t GetNProngs() const
TString fPartName
number of variables for the container
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:241
Double_t fRefMult
TProfile with mult vas. Z per period.
Bool_t FillRecoCasc(AliVEvent *event, AliAODRecoCascadeHF *rc, Bool_t isDStar)
Bool_t ProcessDs(Int_t returnCodeDs) const
Float_t fCutOnMomConservation
flag to define which task to use for Lc –> K0S+p
Bool_t fZvtxCorrectedNtrkEstimator
refrence multiplcity (period b)
TList * fListProfiles
response matrix for unfolding
Class for cuts on AOD reconstructed D+->Kpipi.
Bool_t fAcceptanceUnf
flag to select D0 origins. 0 Only from charm 1 only from beauty 2 both from charm and beauty ...
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
Bool_t fUseTrackletsWeight
flag to decide whether to use Ncharged weights != 1 when filling the container or not ...
Int_t fCountVertex
MC particle found that satisfy acceptance cuts.
void SetMinCentrality(Float_t minCentrality=0.)
Definition: AliRDHFCuts.h:51
Double_t DodzFit(Float_t z, Double_t *par)
Bool_t fUseCascadeTaskForLctoV0bachelor
these are the pre-selection cuts for the TMVA
Double_t GetNchWeight(Int_t nch)
UShort_t fOriginDselection
flag to indicate whether data container should be filled with generated values also for reconstructed...
Bool_t fUseFlatPtWeight
weight used to fill the container
AliAODVertex * GetOwnPrimaryVtx() const
Char_t fSign
daughter in fin state
AliESDtrackCuts * GetTrackCuts() const
Definition: AliRDHFCuts.h:246
Float_t GetCentrality(AliAODEvent *aodEvent)
Definition: AliRDHFCuts.h:242
AliRDHFCuts * fCuts
flag for unfolding before or after cuts.
Int_t fFakeSelection
flag to switch off the centrality selection
void SetFakeSelection(Int_t fakeSel)
TF1 * fFuncWeight
configuration (slow / fast) of the CF –> different variables will be allocated (all / reduced number)...
UInt_t fResonantDecay
histogram with Nch distribution from MC production
Bool_t fCentralitySelection
flag to decide wheter to keep D0 only (0), D0bar only (1), or both D0 and D0bar (2) ...
Int_t fCountRecoAcc
Reco particle found that satisfy cuts.
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)
Int_t fGenDsOption
Ds decay option (selection level)
void SetMaxCentrality(Float_t maxCentrality=100.)
Definition: AliRDHFCuts.h:52
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
void SetRecoPrimVertex(Double_t zPrimVertex)
Bool_t fIsPPData
flag to use the z-vtx corrected (if not use uncorrected) multiplicity estimator
void SetMCCandidateParam(Int_t label)
Bool_t CheckMCPartFamily(AliAODMCParticle *, TClonesArray *) const
virtual Bool_t SetRecoCandidateParam(AliAODRecoDecayHF *)
static Double_t GetCorrectedNtracklets(TProfile *estimatorAvg, Double_t uncorrectedNacc, Double_t vtxZ, Double_t refMult)
Int_t fConfiguration
Ds decay option (generation level)
Int_t CheckReflexion(Char_t isSign)
Bool_t IsEventSelected(AliVEvent *event)
Int_t fLctoV0bachelorOption
resonant deacy channel to be used if the CF should be run on resonant channels only ...
Bool_t fRejectIfNoQuark
selection flag for fakes tracks
slow configuration, all variables
void SetUsePID(Bool_t flag=kTRUE)
Definition: AliRDHFCuts.h:204
TH1I * fHistEventsProcessed
pointer to the CF manager
virtual void PrintAll() const
TString fDauNames
D meson name.
Bool_t RecoAcceptStep(AliESDtrackCuts **trackCuts) const
Int_t fCountRecoPID
Reco particle found that satisfy cuts in PPR.
Bool_t fUseMultRatioAsWeight
flag to decide whether to use Ncharged weights != 1 when filling the container or not ...
static Int_t GetGeneratedPhysicalPrimariesInEtaRange(TClonesArray *arrayMC, Double_t mineta, Double_t maxeta)
Bool_t IsSelected(TObject *obj)
Definition: AliRDHFCuts.h:274
Int_t fEvents
Reco PID step.
Bool_t MCRefitStep(AliAODEvent *aodEvent, AliESDtrackCuts **trackCuts) const
Bool_t fUseCutsForTMVA
flag to use additional cuts needed for Lc –> K0S + p, TMVA
Int_t fDecayChannel
n. of events
Bool_t GetIsUsePID() const
Definition: AliRDHFCuts.h:254
void UserExec(Option_t *option)
Int_t fCountRecoPPR
Reco particle found that satisfy cuts in n. of ITS clusters.
Bool_t fUseMCVertex
flag to remove events not geenrated with PYTHIA
void SetTriggerClass(TString trclass0, TString trclass1="")
Definition: AliRDHFCuts.h:192
Int_t fDsOption
flag to use MC vertex (useful when runnign in pp)
Bool_t fUseNchWeight
flag to decide whether to use z-vtx weights != 1 when filling the container or not ...
Class to compute variables for correction framework // for 3-body decays of D mesons (D+...
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
Definition: AliRDHFCuts.h:291
TProfile * GetEstimatorHistogram(const AliVEvent *event)
void SetConfiguration(Int_t configuration)
void SetMultiplicity(Double_t multiplicity)
void SetMCPrimaryVertex(Double_t zMCVertex)
Int_t fMultiplicityEstimator
PDG code.
void UserCreateOutputObjects()
ANALYSIS FRAMEWORK STUFF to loop on data and fill output objects.
TH1F * fHistoMCNch
histogram with measured Nch distribution (pp 7 TeV)
TProfile * fMultEstimatorAvg[4]
Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2.
Double_t fWeight
flag to decide whether to use pt-weights != 1 when filling the container or not
TH1F * fHistoMeasNch
user-defined histogram to calculate the Pt weights
Bool_t ProcessLctoV0Bachelor(Int_t returnCodeDs) const
Class for HF corrections as a function of many variables and step.