AliPhysics  f05a842 (f05a842)
 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 //__________________________________________________________________________
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 //___________________________________________________________________________
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 //___________________________________________________________________________
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  if(!vHF->FillRecoCand(aodEvent,(AliAODRecoDecayHF2Prong*)charmCandidate)) break;
974  }
975  case 21:{
976  charmCandidate = (AliAODRecoCascadeHF*)arrayBranch->At(iCandid);
977  if(!vHF->FillRecoCasc(aodEvent,((AliAODRecoCascadeHF*)charmCandidate),kTRUE)) break; //DStar
978  }
979  case 22:{
980  charmCandidate = (AliAODRecoCascadeHF*)arrayBranch->At(iCandid);
981  if(vHF->FillRecoCasc(aodEvent,((AliAODRecoCascadeHF*)charmCandidate),kFALSE)) break; //Cascade
982  }
983  case 31:
984  case 32:
985  case 33:{
986  charmCandidate = (AliAODRecoDecayHF3Prong*)arrayBranch->At(iCandid);
987  if(vHF->FillRecoCand(aodEvent,(AliAODRecoDecayHF3Prong*)charmCandidate)) break;
988  }
989  case 4:{
990  charmCandidate = (AliAODRecoDecayHF4Prong*)arrayBranch->At(iCandid);
991  break;
992  }
993  default:
994  break;
995  }
996 
997  Bool_t unsetvtx=kFALSE;
998  if(!charmCandidate->GetOwnPrimaryVtx()) {
999  charmCandidate->SetOwnPrimaryVtx(aodVtx); // needed to compute all variables
1000  unsetvtx=kTRUE;
1001  }
1002 
1003  Bool_t signAssociation = cfVtxHF->SetRecoCandidateParam((AliAODRecoDecayHF*)charmCandidate);
1004  if (!signAssociation){
1005  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1006  continue;
1007  }
1008 
1009  Int_t isPartOrAntipart = cfVtxHF->CheckReflexion(fSign);
1010  if (isPartOrAntipart == 0){
1011  AliDebug(2, Form("The candidate pdg code doesn't match the requirement set in the task (fSign = %d)",fSign));
1012  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1013  continue;
1014  }
1015 
1016  AliDebug(3,Form("iCandid=%d - signAssociation=%d, isPartOrAntipart=%d",iCandid, signAssociation, isPartOrAntipart));
1017 
1018  Bool_t recoContFilled = cfVtxHF->FillRecoContainer(containerInput);
1019  AliDebug(3, Form("CF task: RecoContFilled for candidate %d is %d", iCandid, (Int_t)recoContFilled));
1020  if (recoContFilled){
1021 
1022  // weight according to pt
1023  if (fUseWeight){
1024  if (fHistoPtWeight) {
1025  AliDebug(2,"Using Histogram as Pt weight function");
1026  fWeight = eventWeight*GetPtWeightFromHistogram(containerInput[0]);
1027  }
1028  else if (fFuncWeight){ // using user-defined function
1029  AliDebug(2, "Using function");
1030  fWeight = eventWeight*fFuncWeight->Eval(containerInput[0]);
1031  }
1032  else{ // using FONLL
1033  AliDebug(2, "Using FONLL");
1034  fWeight = eventWeight*GetWeight(containerInput[0]);
1035  }
1036  AliDebug(2, Form("pt = %f, weight = %f",containerInput[0], fWeight));
1037  }
1038 
1039  if (!fCuts->IsInFiducialAcceptance(containerInput[0],containerInput[1])){
1040  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1041  continue;
1042  }
1043  //Reco Step
1044  Bool_t recoStep = cfVtxHF->RecoStep();
1045  if (recoStep) AliDebug(2, Form("particle = %d --> CF task: Reco step for candidate %d is %d", iCandid, iCandid, (Int_t)recoStep));
1046  Bool_t vtxCheck = fCuts->IsEventSelected(aodEvent);
1047 
1048 
1049  // Selection on the filtering bit
1050  Bool_t isBitSelected = kTRUE;
1051  if(fDecayChannel==2) {
1052  if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) isBitSelected = kFALSE;
1053  }else if(fDecayChannel==31){
1054  if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kDplusCuts)) isBitSelected = kFALSE;
1055  }else if(fDecayChannel==33){
1056  if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kDsCuts)) isBitSelected = kFALSE;
1057  }else if(fDecayChannel==32){
1058  if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kLcCuts)) isBitSelected = kFALSE;
1059  }else if(fDecayChannel==22){
1060  if(!((dynamic_cast<AliAODRecoCascadeHF*>(charmCandidate))->CheckCascadeFlags())) isBitSelected = kFALSE; // select only Lc among cascade candidates
1061  }
1062  if(!isBitSelected){
1063  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1064  continue;
1065  }
1066 
1067 
1068  if (recoStep && recoContFilled && vtxCheck){
1069  fCFManager->GetParticleContainer()->Fill(containerInput,kStepReconstructed, fWeight) ;
1070  icountReco++;
1071  AliDebug(3,"Reco step passed and container filled\n");
1072 
1073  //Reco in the acceptance -- take care of UNFOLDING!!!!
1074  Bool_t recoAcceptanceStep = cfVtxHF->RecoAcceptStep(&trackCuts[0]);
1075  if (recoAcceptanceStep) {
1076  fCFManager->GetParticleContainer()->Fill(containerInput,kStepRecoAcceptance, fWeight) ;
1077  icountRecoAcc++;
1078  AliDebug(3,"Reco acceptance cut passed and container filled\n");
1079 
1080  if(fAcceptanceUnf){
1081  Double_t fill[4]; //fill response matrix
1082  Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(fPDGcode,fill);
1083  if (bUnfolding) fCorrelation->Fill(fill);
1084  }
1085 
1086  //Number of ITS cluster requirements
1087  Int_t recoITSnCluster = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kTracks, aodEvent);
1088  if (recoITSnCluster){
1089  fCFManager->GetParticleContainer()->Fill(containerInput,kStepRecoITSClusters, fWeight) ;
1090  icountRecoITSClusters++;
1091  AliDebug(3,"Reco n ITS cluster cut passed and container filled\n");
1092 
1093  Bool_t iscutsusingpid = fCuts->GetIsUsePID();
1094  Int_t recoAnalysisCuts = -1, recoPidSelection = -1;
1095  fCuts->SetUsePID(kFALSE);
1096  recoAnalysisCuts = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kCandidate, aodEvent);
1097 
1098  if (fDecayChannel==33){ // Ds case, where more possibilities are considered
1099  Bool_t keepDs=ProcessDs(recoAnalysisCuts);
1100  if(keepDs) recoAnalysisCuts=3;
1101  }
1102  else if (fDecayChannel==22){ // Lc->V0+bachelor case, where more possibilities are considered
1103  Bool_t keepLctoV0bachelor = ProcessLctoV0Bachelor(recoAnalysisCuts);
1104  if (keepLctoV0bachelor) recoAnalysisCuts=3;
1105  AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
1106  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
1107  AliPIDResponse* pidResponse = inputHandler->GetPIDResponse();
1108  if (fUseAdditionalCuts){
1109  if (!((AliCFVertexingHFCascade*)cfVtxHF)->CheckAdditionalCuts(pidResponse)) recoAnalysisCuts = -1;
1110  }
1111  }
1112 
1113  fCuts->SetUsePID(iscutsusingpid); //restoring usage of the PID from the cuts object
1114  Bool_t tempAn=(recoAnalysisCuts == 3 || recoAnalysisCuts == isPartOrAntipart);
1115  if (fDecayChannel == 22) tempAn = (recoAnalysisCuts == 3);
1116  if (fDecayChannel == 32) tempAn=(recoAnalysisCuts >0 || recoAnalysisCuts == isPartOrAntipart);
1117 
1118  if (tempAn){
1119  fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPPR, fWeight);
1120  icountRecoPPR++;
1121  AliDebug(3,"Reco Analysis cuts passed and container filled \n");
1122  //pid selection
1123  //recoPidSelection = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kPID);
1124  //if((fCuts->CombineSelectionLevels(3,recoAnalysisCuts,recoPidSelection)==isPartOrAntipart)||(fCuts->CombineSelectionLevels(3,recoAnalysisCuts,recoPidSelection)==3)){
1125  recoPidSelection = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kCandidate, aodEvent);
1126 
1127  if (fDecayChannel==33){ // Ds case, where more possibilities are considered
1128  Bool_t keepDs=ProcessDs(recoPidSelection);
1129  if(keepDs) recoPidSelection=3;
1130  } else if (fDecayChannel==22){ // Lc->V0+bachelor case, where more possibilities are considered
1131  Bool_t keepLctoV0bachelor=ProcessLctoV0Bachelor(recoPidSelection);
1132  if (keepLctoV0bachelor) recoPidSelection=3;
1133  }
1134 
1135  Bool_t tempPid=(recoPidSelection == 3 || recoPidSelection == isPartOrAntipart);
1136  if (fDecayChannel == 22) tempPid = (recoPidSelection == 3);
1137  if (fDecayChannel == 32) tempPid=(recoPidSelection >0 || recoPidSelection == isPartOrAntipart);
1138 
1139  if (tempPid){
1140  Double_t weigPID = 1.;
1141  if (fDecayChannel == 2){ // D0 with Bayesian PID using weights
1142  if(((AliRDHFCutsD0toKpi*)fCuts)->GetCombPID() && (((AliRDHFCutsD0toKpi*)fCuts)->GetBayesianStrategy() == AliRDHFCutsD0toKpi::kBayesWeight || ((AliRDHFCutsD0toKpi*)fCuts)->GetBayesianStrategy() == AliRDHFCutsD0toKpi::kBayesWeightNoFilter)){
1143  if (isPartOrAntipart == 1){
1144  weigPID = ((AliRDHFCutsD0toKpi*)fCuts)->GetWeightsNegative()[AliPID::kKaon] * ((AliRDHFCutsD0toKpi*)fCuts)->GetWeightsPositive()[AliPID::kPion];
1145  }else if (isPartOrAntipart == 2){
1146  weigPID = ((AliRDHFCutsD0toKpi*)fCuts)->GetWeightsPositive()[AliPID::kKaon] * ((AliRDHFCutsD0toKpi*)fCuts)->GetWeightsNegative()[AliPID::kPion];
1147  }
1148  if ((weigPID < 0) || (weigPID > 1)) weigPID = 0.;
1149  }
1150  }else if (fDecayChannel == 33){ // Ds with Bayesian PID using weights
1152  Int_t labDau0=((AliAODTrack*)charmCandidate->GetDaughter(0))->GetLabel();
1153  AliAODMCParticle* firstDau=(AliAODMCParticle*)mcArray->UncheckedAt(TMath::Abs(labDau0));
1154  if(firstDau){
1155  Int_t pdgCode0=TMath::Abs(firstDau->GetPdgCode());
1156  if(pdgCode0==321){
1157  weigPID=((AliRDHFCutsDstoKKpi*)fCuts)->GetWeightForKKpi();
1158  }else if(pdgCode0==211){
1159  weigPID=((AliRDHFCutsDstoKKpi*)fCuts)->GetWeightForpiKK();
1160  }
1161  if ((weigPID < 0) || (weigPID > 1)) weigPID = 0.;
1162  }else{
1163  weigPID=0.;
1164  }
1165  }
1166  }
1167  fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPID, fWeight*weigPID);
1168  icountRecoPID++;
1169  AliDebug(3,"Reco PID cuts passed and container filled \n");
1170  if(!fAcceptanceUnf){
1171  Double_t fill[4]; //fill response matrix
1172  Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(fPDGcode,fill);
1173  if (bUnfolding) fCorrelation->Fill(fill);
1174  }
1175  }
1176  else {
1177  AliDebug(3, "Analysis Cuts step not passed \n");
1178  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1179  continue;
1180  }
1181  }
1182  else {
1183  AliDebug(3, "PID selection not passed \n");
1184  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1185  continue;
1186  }
1187  }
1188  else{
1189  AliDebug(3, "Number of ITS cluster step not passed\n");
1190  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1191  continue;
1192  }
1193  }
1194  else{
1195  AliDebug(3, "Reco acceptance step not passed\n");
1196  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1197  continue;
1198  }
1199  }
1200  else {
1201  AliDebug(3, "Reco step not passed\n");
1202  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1203  continue;
1204  }
1205  }
1206 
1207  if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
1208  } // end loop on candidate
1209  delete vHF;
1210  fCountReco+= icountReco;
1211  fCountRecoAcc+= icountRecoAcc;
1212  fCountRecoITSClusters+= icountRecoITSClusters;
1213  fCountRecoPPR+= icountRecoPPR;
1214  fCountRecoPID+= icountRecoPID;
1215 
1216  fHistEventsProcessed->Fill(1.5);
1217 
1218  delete[] containerInput;
1219  delete[] containerInputMC;
1220  delete cfVtxHF;
1221  if (trackCuts){
1222  // for (Int_t i=0; i<cfVtxHF->GetNProngs(); i++){
1223  // delete [] trackCuts[i];
1224  // }
1225  delete [] trackCuts;
1226  }
1227 
1228 
1229 }
1230 
1231 //___________________________________________________________________________
1233 {
1234  // The Terminate() function is the last function to be called during
1235  // a query. It always runs on the client, it can be used to present
1236  // the results graphically or save the results to file.
1237 
1238  AliAnalysisTaskSE::Terminate();
1239 
1240  AliInfo(Form("Found %i MC particles that are %s in MC, in %d events",fCountMC,fPartName.Data(),fEvents));
1241  AliInfo(Form("Found %i MC particles that are %s in MC in limited acceptance, in %d events",fCountGenLimAcc,fPartName.Data(),fEvents));
1242  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));
1243  AliInfo(Form("Found %i MC particles that are %s in MC and satisfy Acc cuts, in %d events",fCountAcc,fPartName.Data(),fEvents));
1244  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));
1245  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));
1246  AliInfo(Form("Found %i reco %s that are decaying in %s, in %d events",fCountReco,fPartName.Data(),fDauNames.Data(),fEvents));
1247  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));
1248  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));
1249  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));
1250  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));
1251 
1252  // draw some example plots....
1253  AliCFContainer *cont= dynamic_cast<AliCFContainer*> (GetOutputData(2));
1254  if(!cont) {
1255  printf("CONTAINER NOT FOUND\n");
1256  return;
1257  }
1258  // projecting the containers to obtain histograms
1259  // first argument = variable, second argument = step
1260 
1261  TH1D** h = new TH1D*[3];
1262  Int_t nvarToPlot = 0;
1263  if (fConfiguration == kSnail){
1264  //h = new TH1D[3][12];
1265  for (Int_t ih = 0; ih<3; ih++){
1266  if(fDecayChannel==22){
1267  nvarToPlot = 16;
1268  } else {
1269  nvarToPlot = 12;
1270  }
1271  h[ih] = new TH1D[nvarToPlot];
1272  }
1273  for(Int_t iC=1;iC<nvarToPlot; iC++){
1274  // MC-level
1275  h[0][iC] = *(cont->ShowProjection(iC,0));
1276  // MC-Acceptance level
1277  h[1][iC] = *(cont->ShowProjection(iC,1));
1278  // Reco-level
1279  h[2][iC] = *(cont->ShowProjection(iC,4));
1280  }
1281  }
1282  else {
1283  //h = new TH1D[3][12];
1284  nvarToPlot = 8;
1285  for (Int_t ih = 0; ih<3; ih++){
1286  h[ih] = new TH1D[nvarToPlot];
1287  }
1288  for(Int_t iC=0;iC<nvarToPlot; iC++){
1289  // MC-level
1290  h[0][iC] = *(cont->ShowProjection(iC,0));
1291  // MC-Acceptance level
1292  h[1][iC] = *(cont->ShowProjection(iC,1));
1293  // Reco-level
1294  h[2][iC] = *(cont->ShowProjection(iC,4));
1295  }
1296  }
1297  TString* titles;
1298  //Int_t nvarToPlot = 0;
1299  if (fConfiguration == kSnail){
1300  if(fDecayChannel==31){
1301  //nvarToPlot = 12;
1302  titles = new TString[nvarToPlot];
1303  titles[0]="pT_Dplus (GeV/c)";
1304  titles[1]="rapidity";
1305  titles[2]="phi (rad)";
1306  titles[3]="cT (#mum)";
1307  titles[4]="cosPointingAngle";
1308  titles[5]="pT_1 (GeV/c)";
1309  titles[6]="pT_2 (GeV/c)";
1310  titles[7]="pT_3 (GeV/c)";
1311  titles[8]="d0_1 (#mum)";
1312  titles[9]="d0_2 (#mum)";
1313  titles[10]="d0_3 (#mum)";
1314  titles[11]="zVertex (cm)";
1315  } else if (fDecayChannel==22) {
1316  //nvarToPlot = 16;
1317  titles = new TString[nvarToPlot];
1318  titles[0]="p_{T}(#Lambda_{c}) [GeV/c]";
1319  titles[1]="y(#Lambda_{c})";
1320  titles[2]="#varphi(#Lambda_{c}) [rad]";
1321  titles[3]="onTheFlyStatusV0";
1322  titles[4]="z_{vtx} [cm]";
1323  titles[5]="centrality";
1324  titles[6]="fake";
1325  titles[7]="multiplicity";
1326  //titles[8]="pT(bachelor) [GeV/c]";
1327  titles[8]="p(bachelor) [GeV/c]";
1328  titles[9]="p_{T}(V0) [GeV/c]";
1329  titles[10]="y(V0)";
1330  titles[11]="#varphi(V0) [rad]";
1331  titles[12]="m_{inv}(#pi^{+}#pi^{+}) [GeV/c^{2}]";
1332  titles[13]="dcaV0 (nSigma)";
1333  titles[14]="cosine pointing angle (V0)";
1334  titles[15]="cosine pointing angle (#Lambda_{c})";
1335  //titles[16]="c#tauV0 (#mum)";
1336  //titles[17]="c#tau (#mum)";
1337  } else {
1338  //nvarToPlot = 12;
1339  titles = new TString[nvarToPlot];
1340  titles[0]="pT_D0 (GeV/c)";
1341  titles[1]="rapidity";
1342  titles[2]="cosThetaStar";
1343  titles[3]="pT_pi (GeV/c)";
1344  titles[4]="pT_K (Gev/c)";
1345  titles[5]="cT (#mum)";
1346  titles[6]="dca (#mum)";
1347  titles[7]="d0_pi (#mum)";
1348  titles[8]="d0_K (#mum)";
1349  titles[9]="d0xd0 (#mum^2)";
1350  titles[10]="cosPointingAngle";
1351  titles[11]="phi (rad)";
1352  }
1353  }
1354  else {
1355  //nvarToPlot = 8;
1356  titles = new TString[nvarToPlot];
1357  if (fDecayChannel==22) {
1358  titles[0]="p_{T}(#Lambda_{c}) [GeV/c]";
1359  titles[1]="y(#Lambda_{c})";
1360  titles[2]="#varphi(#Lambda_{c}) [rad]";
1361  titles[3]="onTheFlyStatusV0";
1362  titles[4]="z_{vtx} [cm]";
1363  titles[5]="centrality";
1364  titles[6]="fake";
1365  titles[7]="multiplicity";
1366  } else {
1367  titles[0]="pT_candidate (GeV/c)";
1368  titles[1]="rapidity";
1369  titles[2]="cT (#mum)";
1370  titles[3]="phi";
1371  titles[4]="z_{vtx}";
1372  titles[5]="centrality";
1373  titles[6]="fake";
1374  titles[7]="multiplicity";
1375  }
1376  }
1377 
1378  Int_t markers[16]={20,24,21,25,27,28,
1379  20,24,21,25,27,28,
1380  20,24,21,25};
1381  Int_t colors[3]={2,8,4};
1382  for(Int_t iC=0;iC<nvarToPlot; iC++){
1383  for(Int_t iStep=0;iStep<3;iStep++){
1384  h[iStep][iC].SetTitle(titles[iC].Data());
1385  h[iStep][iC].GetXaxis()->SetTitle(titles[iC].Data());
1386  Double_t maxh=h[iStep][iC].GetMaximum();
1387  h[iStep][iC].GetYaxis()->SetRangeUser(0,maxh*1.2);
1388  h[iStep][iC].SetMarkerStyle(markers[iC]);
1389  h[iStep][iC].SetMarkerColor(colors[iStep]);
1390  }
1391  }
1392 
1393  gStyle->SetCanvasColor(0);
1394  gStyle->SetFrameFillColor(0);
1395  gStyle->SetTitleFillColor(0);
1396  gStyle->SetStatColor(0);
1397 
1398  // drawing in 2 separate canvas for a matter of clearity
1399  TCanvas * c1 =new TCanvas(Form("c1New_%d",fDecayChannel),"Vars 0, 1, 2, 3",1100,1200);
1400  c1->Divide(3,4);
1401  Int_t iPad=1;
1402  for(Int_t iVar=0; iVar<4; iVar++){
1403  c1->cd(iPad++);
1404  h[0][iVar].DrawCopy("p");
1405  c1->cd(iPad++);
1406  h[1][iVar].DrawCopy("p");
1407  c1->cd(iPad++);
1408  h[2][iVar].DrawCopy("p");
1409  }
1410 
1411  TCanvas * c2 =new TCanvas(Form("c2New_%d",fDecayChannel),"Vars 4, 5, 6, 7",1100,1200);
1412  c2->Divide(3,4);
1413  iPad=1;
1414  for(Int_t iVar=4; iVar<8; iVar++){
1415  c2->cd(iPad++);
1416  h[0][iVar].DrawCopy("p");
1417  c2->cd(iPad++);
1418  h[1][iVar].DrawCopy("p");
1419  c2->cd(iPad++);
1420  h[2][iVar].DrawCopy("p");
1421  }
1422 
1423  if (fConfiguration == kSnail){
1424  TCanvas * c3 =new TCanvas(Form("c3New_%d",fDecayChannel),"Vars 8, 9, 10, 11",1100,1200);
1425  c3->Divide(3,4);
1426  iPad=1;
1427  for(Int_t iVar=8; iVar<12; iVar++){
1428  c3->cd(iPad++);
1429  h[0][iVar].DrawCopy("p");
1430  c3->cd(iPad++);
1431  h[1][iVar].DrawCopy("p");
1432  c3->cd(iPad++);
1433  h[2][iVar].DrawCopy("p");
1434  }
1435  if (fDecayChannel==22) {
1436  TCanvas * c4 =new TCanvas(Form("c4New_%d",fDecayChannel),"Vars 12, 13, 14, 15",1100,1200);
1437  c4->Divide(3,4);
1438  iPad=1;
1439  for(Int_t iVar=12; iVar<16; iVar++){
1440  c4->cd(iPad++);
1441  h[0][iVar].DrawCopy("p");
1442  c4->cd(iPad++);
1443  h[1][iVar].DrawCopy("p");
1444  c4->cd(iPad++);
1445  h[2][iVar].DrawCopy("p");
1446  }
1447  }
1448  }
1449 
1450  /*
1451  THnSparseD* hcorr = dynamic_cast<THnSparseD*> (GetOutputData(3));
1452 
1453  TH2D* corr1 = hcorr->Projection(0,2);
1454  TH2D* corr2 = hcorr->Projection(1,3);
1455 
1456  TCanvas * c7 =new TCanvas(Form("c7New_%d",fDecayChannel),"",800,400);
1457  c7->Divide(2,1);
1458  c7->cd(1);
1459  corr1->DrawCopy("text");
1460  c7->cd(2);
1461  corr2->DrawCopy("text");
1462  */
1463  TFile* file_projection = new TFile("CFtaskHFprojectionNew.root","RECREATE");
1464 
1465  // corr1->Write();
1466  // corr2->Write();
1467 
1468  for(Int_t iC=0;iC<nvarToPlot; iC++){
1469  for(Int_t iStep=0;iStep<3;iStep++){
1470  h[iStep][iC].Write(Form("Step%d_%s",iStep,titles[iC].Data()));
1471  }
1472  }
1473  file_projection->Close();
1474  for (Int_t ih = 0; ih<3; ih++) delete [] h[ih];
1475  delete [] h;
1476  delete [] titles;
1477 
1478 }
1479 
1480 //___________________________________________________________________________
1482 {
1483  //HERE ONE CAN CREATE OUTPUT OBJECTS, IN PARTICULAR IF THE OBJECT PARAMETERS DON'T NEED
1484  //TO BE SET BEFORE THE EXECUTION OF THE TASK
1485  //
1486  Info("UserCreateOutputObjects","CreateOutputObjects of task %s\n", GetName());
1487 
1488  //slot #1
1489  OpenFile(1);
1490  const char* nameoutput=GetOutputSlot(1)->GetContainer()->GetName();
1491  fHistEventsProcessed = new TH1I(nameoutput,"",2,0,2) ;
1492  fHistEventsProcessed->GetXaxis()->SetBinLabel(1,"Events processed (all)");
1493  fHistEventsProcessed->GetXaxis()->SetBinLabel(2,"Events analyzed (after selection)");
1494 
1495  PostData(1,fHistEventsProcessed) ;
1496  PostData(2,fCFManager->GetParticleContainer()) ;
1497  PostData(3,fCorrelation) ;
1498 
1499 }
1500 
1501 
1502 //_________________________________________________________________________
1504  // ad-hoc weight function from ratio of
1505  // pt spectra from FONLL 2.76 TeV and
1506  // pt spectra from MC production LHC12a17a (PYTHIA Perugia0 with pthard bins)
1507  if(fFuncWeight) delete fFuncWeight;
1508  fFuncWeight=new TF1("funcWeight","[0]+[1]*TMath::Exp(-[2]*x)",0.,50.);
1509  fFuncWeight->SetParameter(0,4.63891e-02);
1510  fFuncWeight->SetParameter(1,1.51674e+01);
1511  fFuncWeight->SetParameter(2,4.09941e-01);
1512  fUseWeight=kTRUE;
1513 }
1514 //_________________________________________________________________________
1516  // ad-hoc weight function from ratio of
1517  // D0 pt spectra in PbPb 2011 0-10% centrality and
1518  // pt spectra from MC production LHC12a17a (PYTHIA Perugia0 with pthard bins)
1519  if(fFuncWeight) delete fFuncWeight;
1520  fFuncWeight=new TF1("funcWeight","[0]+[1]/TMath::Power(x,[2])",0.05,50.);
1521  fFuncWeight->SetParameter(0,1.43116e-02);
1522  fFuncWeight->SetParameter(1,4.37758e+02);
1523  fFuncWeight->SetParameter(2,3.08583);
1524  fUseWeight=kTRUE;
1525 }
1526 
1527 //_________________________________________________________________________
1529  // weight function from the ratio of the LHC12a17b MC
1530  // and FONLL calculations for pp data
1531  if(fFuncWeight) delete fFuncWeight;
1532  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.);
1533  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);
1534  fUseWeight=kTRUE;
1535 }
1536 
1537 //_________________________________________________________________________
1539  // weight function from the ratio of the LHC12a17b MC
1540  // and FONLL calculations for pp data
1541  // corrected by the BAMPS Raa calculation for 30-50% CC
1542  if(fFuncWeight) delete fFuncWeight;
1543  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.);
1544  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);
1545  fUseWeight=kTRUE;
1546 }
1547 
1548 //_________________________________________________________________________
1550  // weight function from the ratio of the LHC13d3 MC
1551  // and FONLL calculations for pp data
1552  if(fFuncWeight) delete fFuncWeight;
1553  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.);
1554  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);
1555  fUseWeight=kTRUE;
1556 }
1557 
1558 //_________________________________________________________________________
1560  // weight function from the ratio of the LHC10f6a MC
1561  // and FONLL calculations for pp data
1562  if(fFuncWeight) delete fFuncWeight;
1563  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.);
1564  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);
1565  fUseWeight=kTRUE;
1566 }
1567 
1568 //_________________________________________________________________________
1570  // weight function from the ratio of the LHC12a12 MC
1571  // and FONLL calculations for pp data
1572  if(fFuncWeight) delete fFuncWeight;
1573  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.);
1574  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);
1575  fUseWeight=kTRUE;
1576 }
1577 
1578 //_________________________________________________________________________
1580  // weight function from the ratio of the LHC12a12bis MC
1581  // and FONLL calculations for pp data
1582  if(fFuncWeight) delete fFuncWeight;
1583  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.);
1584  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);
1585  fUseWeight=kTRUE;
1586 }
1587 
1588 //_________________________________________________________________________
1590  // weight function from the ratio of the LHC13e2fix MC
1591  // and FONLL calculations for pp data
1592  if(fFuncWeight) delete fFuncWeight;
1593  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.);
1594  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);
1595  fUseWeight=kTRUE;
1596 }
1597 
1598 //________________________________________________________________
1600  // weight function from the ratio of the LHC10f6a MC
1601  // and FONLL calculations for pp data
1602  if(fFuncWeight) delete fFuncWeight;
1603  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.);
1604  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);
1605  fUseWeight=kTRUE;
1606 }
1607 
1608 //________________________________________________________________
1610  // weight function from the ratio of the LHC10f6a MC
1611  // and FONLL calculations for pp data
1612  if(fFuncWeight) delete fFuncWeight;
1613  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.);
1614  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);
1615  fUseWeight=kTRUE;
1616 }
1617 
1618 //_________________________________________________________________________
1620  // weight function from the ratio of the LHC13d3 MC
1621  // and FONLL calculations for pPb data
1622  // using Lc simulated pt distribution
1623  if(fFuncWeight) delete fFuncWeight;
1624  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.);
1625  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);
1626  fUseWeight=kTRUE;
1627 }
1628 
1629 //_________________________________________________________________________
1631  // weight function from the ratio of the LHC11b2 MC
1632  // and FONLL calculations for pp data
1633  // using Lc simulated pt distribution
1634  if(fFuncWeight) delete fFuncWeight;
1635  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.);
1636  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);
1637  fUseWeight=kTRUE;
1638 }
1639 
1640 //_________________________________________________________________________
1642  // weight function from the ratio of the LHC10f7a MC
1643  // and FONLL calculations for pp data
1644  // using Lc simulated pt distribution
1645  if(fFuncWeight) delete fFuncWeight;
1646  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.);
1647  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);
1648  fUseWeight=kTRUE;
1649 }
1650 
1651 //_________________________________________________________________________
1653 {
1654  //
1655  // calculating the weight to fill the container
1656  //
1657 
1658  // FNOLL central:
1659  // p0 = 1.63297e-01 --> 0.322643
1660  // p1 = 2.96275e+00
1661  // p2 = 2.30301e+00
1662  // p3 = 2.50000e+00
1663 
1664  // PYTHIA
1665  // p0 = 1.85906e-01 --> 0.36609
1666  // p1 = 1.94635e+00
1667  // p2 = 1.40463e+00
1668  // p3 = 2.50000e+00
1669 
1670  Double_t func1[4] = {0.322643,2.96275,2.30301,2.5};
1671  Double_t func2[4] = {0.36609,1.94635,1.40463,2.5};
1672 
1673  Double_t dndpt_func1 = dNdptFit(pt,func1);
1674  if(fUseFlatPtWeight) dndpt_func1 = 1./30.;
1675  Double_t dndpt_func2 = dNdptFit(pt,func2);
1676  AliDebug(2,Form("pt = %f, FONLL = %f, Pythia = %f, ratio = %f",pt,dndpt_func1,dndpt_func2,dndpt_func1/dndpt_func2));
1677  return dndpt_func1/dndpt_func2;
1678 }
1679 
1680 //__________________________________________________________________________________________________
1682 {
1683  //
1684  // calculating dNdpt
1685  //
1686 
1687  Double_t denom = TMath::Power((pt/par[1]), par[3] );
1688  Double_t dNdpt = par[0]*pt/TMath::Power(1.+denom, par[2]);
1689 
1690  return dNdpt;
1691 }
1692 
1693 //_________________________________________________________________________
1695 {
1696  //
1697  // Using an histogram as weight function
1698  // weight = 0 in the range outside the function
1699  //
1700  Double_t weight = 0.0;
1701  Int_t histoNbins = fHistoPtWeight->GetNbinsX();
1702  Int_t histobin = fHistoPtWeight->FindBin(pt);
1703  if( (histobin>0) && (histobin<=histoNbins) ) {
1704  weight = fHistoPtWeight->GetBinContent(histobin);
1705  }
1706 
1707  return weight;
1708 }
1709 
1710 //__________________________________________________________________________________________________
1712  //
1713  // calculating the z-vtx weight for the given run range
1714  //
1715 
1716  if(runnumber>146824 || runnumber<146803) return 1.0;
1717 
1718  Double_t func1[3] = {1.0, -0.5, 6.5 };
1719  Double_t func2[3] = {1.0, -0.5, 5.5 };
1720 
1721  Double_t dzFunc1 = DodzFit(z,func1);
1722  Double_t dzFunc2 = DodzFit(z,func2);
1723 
1724  return dzFunc1/dzFunc2;
1725 }
1726 
1727 //__________________________________________________________________________________________________
1729 
1730  //
1731  // Gaussian z-vtx shape
1732  //
1733  //gaussian = [0]/TMath::Sqrt(2.*TMath::Pi())/[2]*exp[-(x-[1])*(x-[1])/(2*[2]*[2])]
1734 
1735  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]);
1736 
1737  return value;
1738 }
1739 //__________________________________________________________________________________________________
1741  //
1742  // calculates the Nch weight using the measured and generateed Nch distributions
1743  //
1744  if(nch<=0) return 0.;
1745  if(!fHistoMeasNch || !fHistoMCNch) { AliError("Input histos to evaluate Nch weights missing"); return 0.; }
1746  Double_t pMeas=fHistoMeasNch->GetBinContent(fHistoMeasNch->FindBin(nch));
1747  Double_t pMC=fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(nch));
1748  Double_t weight = pMC>0 ? pMeas/pMC : 0.;
1749  if(fUseMultRatioAsWeight) weight = pMC;
1750  return weight;
1751 }
1752 //__________________________________________________________________________________________________
1754  // creates historgam with measured multiplcity distribution in pp 7 TeV collisions (from Eur. Phys. J. C (2010) 68: 345–354)
1755  //
1756  // for Nch > 70 the points were obtained with a double NBD distribution fit
1757  // 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
1758  // fit1->SetParameter(1,1.63); // k parameter
1759  // fit1->SetParameter(2,12.8); // mean multiplicity
1760  //
1761  Double_t nchbins[82]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1762  10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1763  20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1764  30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1765  40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1766  50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1767  60.50,62.50,64.50,66.50,68.50,70.50,72.50,74.50,76.50,78.50,
1768  80.50,82.50,84.50,86.50,88.50,90.50,92.50,94.50,96.50,98.50,
1769  100.50,102.50};
1770  Double_t pch[81]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1771  0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1772  0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1773  0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1774  0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1775  0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1776  0.000296,0.000265,0.000193,0.00016,0.000126,0.0000851, 0.0000676,0.0000537,0.0000426, 0.0000338,
1777  0.0000268,0.0000213,0.0000166,0.0000133,0.0000106,0.00000837,0.00000662, 0.00000524,0.00000414, 0.00000327,
1778  0.00000258};
1779 
1780  if(fHistoMeasNch) delete fHistoMeasNch;
1781  fHistoMeasNch=new TH1F("hMeaseNch","",81,nchbins);
1782  for(Int_t i=0; i<81; i++){
1783  fHistoMeasNch->SetBinContent(i+1,pch[i]);
1784  fHistoMeasNch->SetBinError(i+1,0.);
1785  }
1786 }
1787 
1788 //__________________________________________________________________________________________________
1790  // processes output of Ds is selected
1791  Bool_t keep=kFALSE;
1792  if(recoAnalysisCuts > 0){
1793  Int_t isKKpi=recoAnalysisCuts&1;
1794  Int_t ispiKK=recoAnalysisCuts&2;
1795  Int_t isPhiKKpi=recoAnalysisCuts&4;
1796  Int_t isPhipiKK=recoAnalysisCuts&8;
1797  Int_t isK0starKKpi=recoAnalysisCuts&16;
1798  Int_t isK0starpiKK=recoAnalysisCuts&32;
1799  if(fDsOption==1){
1800  if(isKKpi && isPhiKKpi) keep=kTRUE;
1801  if(ispiKK && isPhipiKK) keep=kTRUE;
1802  }
1803  else if(fDsOption==2){
1804  if(isKKpi && isK0starKKpi) keep=kTRUE;
1805  if(ispiKK && isK0starpiKK) keep=kTRUE;
1806  }
1807  else if(fDsOption==3)keep=kTRUE;
1808  }
1809  return keep;
1810 }
1811 //__________________________________________________________________________________________________
1813 
1814  // processes output of Lc->V0+bnachelor is selected
1815 
1816  Bool_t keep=kFALSE;
1817 
1818  if (recoAnalysisCuts > 0){
1819 
1820  Int_t isK0Sp = recoAnalysisCuts&1;
1821  Int_t isLambdaBarpi = recoAnalysisCuts&2;
1822  Int_t isLambdapi = recoAnalysisCuts&4;
1823 
1824  if(fLctoV0bachelorOption == 1){
1825  if(isK0Sp) keep=kTRUE;
1826  }
1827  else if(fLctoV0bachelorOption == 2){
1828  if(isLambdaBarpi) keep=kTRUE;
1829  }
1830  else if(fLctoV0bachelorOption == 4){
1831  if(isLambdapi) keep=kTRUE;
1832  }
1833  else if(fLctoV0bachelorOption == 7) {
1834  if (isK0Sp || isLambdaBarpi || isLambdapi) keep=kTRUE;
1835  }
1836  }
1837  return keep;
1838 }
1839 
1840 //____________________________________________________________________________
1841 TProfile* AliCFTaskVertexingHF::GetEstimatorHistogram(const AliVEvent* event){
1842  // Get Estimator Histogram from period event->GetRunNumber();
1843  //
1844  // If you select SPD tracklets in |eta|<1 you should use type == 1
1845  //
1846 
1847  Int_t runNo = event->GetRunNumber();
1848  Int_t period = -1; // pp: 0-LHC10b, 1-LHC10c, 2-LHC10d, 3-LHC10e
1849  // pPb: 0-LHC13b, 1-LHC13c
1850 
1851  if (fIsPPbData) { // setting run numbers for LHC13 if pPb
1852  if (runNo>195343 && runNo<195484) period = 0;
1853  if (runNo>195528 && runNo<195678) period = 1;
1854  if (period<0 || period>1) return 0;
1855  } else { //else assume pp 2010
1856  if(runNo>114930 && runNo<117223) period = 0;
1857  if(runNo>119158 && runNo<120830) period = 1;
1858  if(runNo>122373 && runNo<126438) period = 2;
1859  if(runNo>127711 && runNo<130841) period = 3;
1860  if(period<0 || period>3) return 0;
1861  }
1862 
1863  return fMultEstimatorAvg[period];
1864 }
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)
double Double_t
Definition: External.C:58
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)
char Char_t
Definition: External.C:18
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)
TCanvas * c
Definition: TestFitELoss.C:172
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
Bool_t FillRecoCasc(AliVEvent *event, AliAODRecoCascadeHF *rc, Bool_t isDStar, Bool_t recoSecVtx=kFALSE)
Double_t fRefMult
TProfile with mult vas. Z per period.
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 Int_t
Definition: External.C:63
Int_t fCountVertex
MC particle found that satisfy acceptance cuts.
Definition: External.C:204
void SetMinCentrality(Float_t minCentrality=0.)
Definition: AliRDHFCuts.h:51
float Float_t
Definition: External.C:68
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
Definition: External.C:212
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
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
const char Option_t
Definition: External.C:48
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
bool Bool_t
Definition: External.C:53
slow configuration, all variables
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.
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65