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