AliPhysics  master (3d17d9d)
AliAnalysisTaskSEDvsMultiplicity.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
18 //*************************************************************************
19 // Class AliAnalysisTaskSEDvsMultiplicity
20 // AliAnalysisTaskSE for the charmed haadrons vs. multiplcity analysis
21 // Authors: Renu Bala, Zaida Conesa del Valle, Francesco Prino
23 
24 #include <TClonesArray.h>
25 #include <TCanvas.h>
26 #include <TList.h>
27 #include <TString.h>
28 #include <TDatabasePDG.h>
29 #include <TH1F.h>
30 #include <TH2F.h>
31 #include <TH3F.h>
32 #include <THnSparse.h>
33 #include <TProfile.h>
34 #include "AliAnalysisManager.h"
35 #include "AliRDHFCuts.h"
38 #include "AliRDHFCutsD0toKpi.h"
39 #include "AliRDHFCutsDstoKKpi.h"
40 #include "AliRDHFCutsLctoV0.h"
41 #include "AliRDHFCutsLctopKpi.h"
42 #include "AliAODHandler.h"
43 #include "AliAODEvent.h"
44 #include "AliAODVertex.h"
45 #include "AliAODTrack.h"
46 #include "AliAODRecoDecayHF.h"
47 #include "AliAODRecoCascadeHF.h"
48 #include "AliAnalysisVertexingHF.h"
49 #include "AliAnalysisTaskSE.h"
52 #include "AliVertexingHFUtils.h"
53 #include "AliAODVZERO.h"
54 #include "AliESDUtils.h"
55 
59 
60 //________________________________________________________________________
63  fOutput(0),
64  fListCuts(0),
65  fOutputCounters(0),
66  fListProfiles(0),
67  fHistNEvents(0),
68  fHistNtrEta16vsNtrEta1EvSel(0),
69  fHistNtrEta05vsNtrEta1EvSel(0),
70  fHistNtrEta03vsNtrEta1EvSel(0),
71  fHistNtrEtaV0AvsNtrEta1EvSel(0),
72  fHistNtrEtaV0MvsNtrEta1EvSel(0),
73  fHistNtrEtaV0AvsV0AEqEvSel(0),
74  fHistNtrEtaV0MvsV0MEqEvSel(0),
75  fHistNtrCorrEta1vsNtrRawEta1EvSel(0),
76  fHistMultCorrvsMultRawEvSel(0),
77  fHistNtrEta16vsNtrEta1EvWithCand(0),
78  fHistNtrEta05vsNtrEta1EvWithCand(0),
79  fHistNtrEta03vsNtrEta1EvWithCand(0),
80  fHistNtrEtaV0AvsNtrEta1EvWithCand(0),
81  fHistNtrEtaV0MvsNtrEta1EvWithCand(0),
82  fHistNtrEtaV0AvsV0AEqEvWithCand(0),
83  fHistNtrEtaV0MvsV0MEqEvWithCand(0),
84  fHistNtrCorrEta1vsNtrRawEta1EvWithCand(0),
85  fHistMultCorrvsMultRawEvWithCand(0),
86  fHistNtrEta16vsNtrEta1EvWithD(0),
87  fHistNtrEta05vsNtrEta1EvWithD(0),
88  fHistNtrEta03vsNtrEta1EvWithD(0),
89  fHistNtrEtaV0AvsNtrEta1EvWithD(0),
90  fHistNtrEtaV0MvsNtrEta1EvWithD(0),
91  fHistNtrEtaV0AvsV0AEqEvWithD(0),
92  fHistNtrEtaV0MvsV0MEqEvWithD(0),
93  fHistNtrCorrEta1vsNtrRawEta1EvWithD(0),
94  fHistMultCorrvsMultRawEvWithD(0),
95  fHistNtrVsZvtx(0),
96  fHistNtrCorrVsZvtx(0),
97  fHistNtrVsNchMC(0),
98  fHistNtrCorrVsNchMC(0),
99  fHistNtrVsNchMCPrimary(0),
100  fHistNtrCorrVsNchMCPrimary(0),
101  fHistNtrVsNchMCPhysicalPrimary(0),
102  fHistNtrCorrVsNchMCPhysicalPrimary(0),
103  fHistGenPrimaryParticlesInelGt0(0),
104  fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary(0),
105  fHistNtrUnCorrPSSel(0),
106  fHistNtrUnCorrPSTrigSel(0),
107  fHistNtrUnCorrPSTrigPileUpSel(0),
108  fHistNtrUnCorrPSTrigPileUpVtxSel(0),
109  fHistNtrUnCorrPSTrigPileUpVtxContSel(0),
110  fHistNtrUnCorrPSTrigPileUpVtxRangeSel(0),
111  fHistNtrUnCorrPSTrigPileUpVtxRangeCentrSel(0),
112  fHistNtrUnCorrEvSel(0),
113  fHistNtrUnCorrEvWithCand(0),
114  fHistNtrUnCorrEvWithD(0),
115  fHistNtrCorrPSSel(0),
116  fHistNtrCorrEvSel(0),
117  fHistNtrCorrEvWithCand(0),
118  fHistNtrCorrEvWithD(0),
119  fPtVsMassVsMult(0),
120  fPtVsMassVsMultNoPid(0),
121  fPtVsMassVsMultUncorr(0),
122  fPtVsMassVsMultPart(0),
123  fPtVsMassVsMultAntiPart(0),
124  fPtVsMassVsMultMC(0),
125  fUpmasslimit(1.965),
126  fLowmasslimit(1.765),
127  fNMassBins(200),
128  fRDCutsAnalysis(0),
129  fCounterC(0),
130  fCounterU(0),
131  fCounterCandidates(0),
132  fDoImpPar(kFALSE),
133  fNImpParBins(400),
134  fLowerImpPar(-2000.),
135  fHigherImpPar(2000.),
136  fReadMC(kFALSE),
137  fMCOption(0),
138  fisPPbData(kFALSE),
139  fUseBit(kTRUE),
140  fSubtractTrackletsFromDau(kFALSE),
141  fKeepCorrPlots(kFALSE),
142  fAODProtection(1),
143  fUseNchWeight(0),
144  fHistoMCNch(0),
145  fHistoMeasNch(0),
146  fRefMult(9.26),
147  fPdgMeson(411),
148  fLctoV0(kTRUE),
149  fMultiplicityEstimator(kNtrk10),
150  fMCPrimariesEstimator(kEta10),
151  fDoVZER0ParamVertexCorr(1),
152  fYearNumber(16)
153 {
155  for(Int_t i=0; i<5; i++) fHistMassPtImpPar[i]=0;
156  for(Int_t i=0; i<14; i++) fMultEstimatorAvg[i]=0;
157 }
158 
159 //________________________________________________________________________
161  AliAnalysisTaskSE(name),
162  fOutput(0),
163  fListCuts(0),
164  fOutputCounters(0),
165  fListProfiles(0),
166  fHistNEvents(0),
194  fHistNtrVsZvtx(0),
196  fHistNtrVsNchMC(0),
218  fPtVsMassVsMult(0),
224  fUpmasslimit(1.965),
225  fLowmasslimit(1.765),
226  fNMassBins(200),
227  fRDCutsAnalysis(cuts),
228  fCounterC(0),
229  fCounterU(0),
231  fDoImpPar(kFALSE),
232  fNImpParBins(400),
233  fLowerImpPar(-2000.),
234  fHigherImpPar(2000.),
235  fReadMC(kFALSE),
236  fMCOption(0),
237  fisPPbData(switchPPb),
238  fUseBit(kTRUE),
240  fKeepCorrPlots(kFALSE),
241  fAODProtection(1),
242  fUseNchWeight(0),
243  fHistoMCNch(0),
244  fHistoMeasNch(0),
245  fRefMult(9.26),
246  fPdgMeson(pdgMeson),
247  fLctoV0(kTRUE),
251  fYearNumber(16)
252 {
253  //
255  //
256 
257  for(Int_t i=0; i<5; i++) fHistMassPtImpPar[i]=0;
258  for(Int_t i=0; i<14; i++) fMultEstimatorAvg[i]=0;
259  if(fPdgMeson==413){
260  fNMassBins=200;
261  SetMassLimits(0.12,0.2);
262  }else if(fPdgMeson == 431) {
263  Double_t MassBinSize = 0.002;
264  Int_t nInvMassBins = (Int_t)(0.7/MassBinSize+0.5);
265  Double_t massDs = TDatabasePDG::Instance()->GetParticle(431)->Mass();
266  Double_t minMass = massDs-0.5*nInvMassBins*MassBinSize;
267  Double_t maxMass = massDs+0.5*nInvMassBins*MassBinSize;
268  SetMassLimits(minMass,maxMass);
269  SetNMassBins(nInvMassBins);
270  }else if(fPdgMeson == 4122) {
271  Double_t massLc = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
272  Int_t nInvMassBins = 500;
273  Double_t minMass = massLc-0.180;
274  Double_t maxMass = massLc+0.180;
275  SetMassLimits(minMass,maxMass);
276  SetNMassBins(nInvMassBins);
277  }
278  else{
279  fNMassBins=200;
281  }
282  // Default constructor
283  // Otput slot #1 writes into a TList container
284  DefineOutput(1,TList::Class()); //My private output
285  // Output slot #2 writes cut to private output
286  DefineOutput(2,TList::Class());
287  // Output slot #3 writes cut to private output
288  DefineOutput(3,TList::Class());
289  // Output slot #4 writes cut to private output
290  DefineOutput(4,TList::Class());
291 }
292 //________________________________________________________________________
294 {
295  //
297  //
298  delete fOutput;
299  delete fHistNEvents;
300  delete fListCuts;
301  delete fListProfiles;
302  delete fRDCutsAnalysis;
303  delete fCounterC;
304  delete fCounterU;
305  delete fCounterCandidates;
306  for(Int_t i=0; i<14; i++) {
307  if (fMultEstimatorAvg[i]) delete fMultEstimatorAvg[i];
308  }
309 
310  for(Int_t i=0; i<5; i++){
311  delete fHistMassPtImpPar[i];
312  }
313  if(fHistoMCNch) delete fHistoMCNch;
314  if(fHistoMeasNch) delete fHistoMeasNch;
315 }
316 
317 //_________________________________________________________________
320  if(uplimit>lowlimit){
321  fLowmasslimit = lowlimit;
322  fUpmasslimit = uplimit;
323  }else{
324  AliError("Wrong mass limits: upper value should be larger than lower one");
325  }
326 }
327 //_________________________________________________________________
330  Double_t mass=TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg))->Mass();
331  SetMassLimits(mass-range,mass+range);
332 }
333 //________________________________________________________________________
335  //
337  //
338  printf("AnalysisTaskSEDvsMultiplicity_0::Init() \n");
339 
340  if(fUseNchWeight && !fReadMC){ AliFatal("Nch weights can only be used in MC mode"); return; }
341  if(fUseNchWeight && !fHistoMCNch){ AliFatal("Nch weights can only be used without histogram"); return; }
342  if(fUseNchWeight==1 && !fHistoMeasNch) {//Nch weights
343  if(fisPPbData){ AliFatal("Nch weights can only be used with MC and data histogram in pPb"); return; }
344  else CreateMeasuredNchHisto();
345  }
346  if(fUseNchWeight==2 && !fHistoMeasNch){ AliFatal("Ntrk weights can only be used with MC and data histogram"); return; } //for pp, pPb Ntrk weights
347 
348 
349  fListCuts=new TList();
350  fListCuts->SetOwner();
351  fListCuts->SetName("CutsList");
352 
353 
354  if(fPdgMeson==411){
355  AliRDHFCutsDplustoKpipi* copycut=new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fRDCutsAnalysis)));
356  copycut->SetName("AnalysisCutsDplus");
357  fListCuts->Add(copycut);
358  }else if(fPdgMeson==421){
359  AliRDHFCutsD0toKpi* copycut=new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fRDCutsAnalysis)));
360  copycut->SetName("AnalysisCutsDzero");
361  fListCuts->Add(copycut);
362  }else if(fPdgMeson==413){
363  AliRDHFCutsDStartoKpipi* copycut=new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fRDCutsAnalysis)));
364  copycut->SetName("AnalysisCutsDStar");
365  fListCuts->Add(copycut);
366  }else if(fPdgMeson==431){
367  AliRDHFCutsDstoKKpi* copycut=new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fRDCutsAnalysis)));
368  copycut->SetName("AnalysisCutsDs");
369  fListCuts->Add(copycut);
370  }else if(fPdgMeson==4122){
371  if(fLctoV0){
372  AliRDHFCutsLctoV0* copycut=new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fRDCutsAnalysis)));
373  copycut->SetName("AnalysisCutsLc2pK0S");
374  fListCuts->Add(copycut);
375  }else{
376  AliRDHFCutsLctopKpi *copycut=new AliRDHFCutsLctopKpi(*(static_cast<AliRDHFCutsLctopKpi*>(fRDCutsAnalysis)));
377  copycut->SetName("LctopKpiProdCuts");
378  fListCuts->Add(copycut);
379  }
380  }
383 
384  PostData(2,fListCuts);
385 
386  fListProfiles = new TList();
387  fListProfiles->SetOwner();
388  TString period[14];
389  Int_t nProfiles=14;
390  if (fisPPbData) {
391  if(fYearNumber == 13) {
392  period[0]="LHC13b";
393  period[1]="LHC13c";
394  nProfiles = 2;
395  } else if(fYearNumber == 16) {
396  period[0]="LHC16qt_1stBunch";
397  period[1]="LHC16qt_2ndBunch";
398  period[2]="LHC16qt_3rdBunch";
399  period[3]="LHC16qt_4thBunch";
400  nProfiles = 4;
401  }
402  }
403  else {
404  if(fYearNumber == 10){
405  period[0]="LHC10b";
406  period[1]="LHC10c";
407  period[2]="LHC10d";
408  period[3]="LHC10e";
409  nProfiles = 4;
410  }else if(fYearNumber == 16){
411  period[0]="LHC16d";
412  period[1]="LHC16e";
413  period[2]="LHC16g";
414  period[3]="LHC16h1";
415  period[4]="LHC16h2";
416  period[5]="LHC16j";
417  period[6]="LHC16k";
418  period[7]="LHC16l";
419  period[8]="LHC16o";
420  period[9]="LHC16p";
421  nProfiles = 10;
422  }else if(fYearNumber == 17){
423  period[0]="LHC17e";
424  period[1]="LHC17f";
425  period[2]="LHC17h";
426  period[3]="LHC17i";
427  period[4]="LHC17j";
428  period[5]="LHC17k";
429  period[6]="LHC17l";
430  period[7]="LHC17m";
431  period[8]="LHC17o";
432  period[9]="LHC17r";
433  nProfiles = 10;
434  }else if(fYearNumber == 18){
435  period[0]="LHC18b";
436  period[1]="LHC18d";
437  period[2]="LHC18e";
438  period[3]="LHC18f";
439  period[4]="LHC18g";
440  period[5]="LHC18h";
441  period[6]="LHC18i";
442  period[7]="LHC18j";
443  period[8]="LHC18k";
444  period[9]="LHC18l";
445  period[10]="LHC18m";
446  period[11]="LHC18n";
447  period[12]="LHC18o";
448  period[13]="LHC18p";
449  nProfiles = 14;
450  }
451  }
452  for(Int_t i=0; i<nProfiles; i++){
453  if(fMultEstimatorAvg[i]){
454  TProfile* hprof=new TProfile(*fMultEstimatorAvg[i]);
455  hprof->SetName(Form("ProfileTrkVsZvtx%s\n",period[i].Data()));
456  fListProfiles->Add(hprof);
457  }
458  }
459 
460  PostData(4,fListProfiles);
461 
462  return;
463 }
464 
465 //________________________________________________________________________
467 {
469  //
470  if(fDebug > 1) printf("AnalysisTaskSEDvsMultiplicity::UserCreateOutputObjects() \n");
471 
472  // Several histograms are more conveniently managed in a TList
473  fOutput = new TList();
474  fOutput->SetOwner();
475  fOutput->SetName("OutputHistos");
476 
477  Int_t nMultBins = 200;
478  Float_t firstMultBin = -0.5;
479  Float_t lastMultBin = 199.5;
480  Int_t nMultBinsNtrk = nMultBins;
481  Float_t lastMultBinNtrk = lastMultBin;
482  Int_t nMultBinsV0 = 200;
483  Float_t lastMultBinV0 = 799.5;
484  const char *estimatorName="tracklets";
485  if(fisPPbData) {
486  nMultBinsNtrk = 375;
487  lastMultBinNtrk = 374.5;
488  nMultBins = nMultBinsNtrk;
489  lastMultBin = lastMultBinNtrk;
490  }
492  nMultBins = nMultBinsV0;
493  lastMultBin = lastMultBinV0;
494  estimatorName = "vzero";
495  }
496 
497  fHistNtrUnCorrPSSel = new TH1F("hNtrUnCorrPSSel",Form("Uncorrected %s multiplicity for PS selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
498  fHistNtrUnCorrPSTrigSel = new TH1F("hNtrUnCorrPSTrigSel",Form("Uncorrected %s multiplicity for PS + trigger name selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
499  fHistNtrUnCorrPSTrigPileUpSel = new TH1F("hNtrUnCorrPSTrigPileUpSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
500  fHistNtrUnCorrPSTrigPileUpVtxSel = new TH1F("hNtrUnCorrPSTrigPileUpVtxSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup + with-vertex selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
501  fHistNtrUnCorrPSTrigPileUpVtxContSel = new TH1F("hNtrUnCorrPSTrigPileUpVtxContSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup + with-vertex-contrib selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
502  fHistNtrUnCorrPSTrigPileUpVtxRangeSel = new TH1F("hNtrUnCorrPSTrigPileUpVtxRangeSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup + with-vertex-contrib-range selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
503  fHistNtrUnCorrPSTrigPileUpVtxRangeCentrSel = new TH1F("hNtrUnCorrPSTrigPileUpVtxRangeCentrSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup + with-vertex-contrib-range + centrality selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
504  fHistNtrUnCorrEvSel = new TH1F("hNtrUnCorrEvSel",Form("Uncorrected %s multiplicity for selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
505  fHistNtrUnCorrEvWithCand = new TH1F("hNtrUnCorrEvWithCand",Form("Uncorrected %s multiplicity for events with D candidates; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);// Total multiplicity
506  fHistNtrUnCorrEvWithD = new TH1F("hNtrUnCorrEvWithD",Form("Uncorrected %s multiplicity for events with D in mass region ; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin); //
507  fHistNtrCorrPSSel = new TH1F("hNtrCorrPSSel",Form("Corrected %s multiplicity for PS selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
508  fHistNtrCorrEvSel = new TH1F("hNtrCorrEvSel",Form("Corrected %s multiplicity for selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
509  fHistNtrCorrEvWithCand = new TH1F("hNtrCorrEvWithCand", Form("%s multiplicity for events with D candidates; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);// Total multiplicity
510  fHistNtrCorrEvWithD = new TH1F("hNtrCorrEvWithD", Form("%s multiplicity for events with D in mass region ; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin); //
511 
512  if(fKeepCorrPlots){
513  fHistNtrEta16vsNtrEta1EvSel = new TH2F("hNtrEta16vsNtrEta1EvSel","Uncorrected Eta1.6 vs Eta1.0 (events selected); Ntracklets #eta<1.0; Ntracklets #eta<1.6",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 1.6 vs eta 1.0 histogram
514  fHistNtrEta05vsNtrEta1EvSel = new TH2F("hNtrEta05vsNtrEta1EvSel","Uncorrected Eta0.5 vs Eta1.0 (events selected); Ntracklets #eta<1.0; Ntracklets #eta<0.5",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 0.5 vs eta 1.0 histogram
515  fHistNtrEta03vsNtrEta1EvSel = new TH2F("hNtrEta03vsNtrEta1EvSel","Uncorrected Eta0.3 vs Eta1.0 (events selected); Ntracklets #eta<1.0; Ntracklets #eta<0.3",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 0.3 vs eta 1.0 histogram
516  fHistNtrEtaV0AvsNtrEta1EvSel = new TH2F("hNtrEtaV0AvsNtrEta1EvSel","Uncorrected Eta-V0A vs Eta1.0 (events selected); Ntracklets #eta<1.0; Multiplicity V0A",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsV0,firstMultBin,lastMultBinV0); //eta V0A vs eta 1.0 histogram
517  fHistNtrEtaV0MvsNtrEta1EvSel = new TH2F("hNtrEtaV0MvsNtrEta1EvSel","Uncorrected Eta-V0M vs Eta1.0 (events selected); Ntracklets #eta<1.0; Multiplicity V0A+V0C",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsV0,firstMultBin,lastMultBinV0); //eta V0M vs eta 1.0 histogram
518  fHistNtrEtaV0AvsV0AEqEvSel = new TH2F("hNtrEtaV0AvsV0AEqEvSel","Corrected V0A vs corrected V0A-Equalized (events selected); Vzero-A; Vzero-A Equalized",nMultBinsV0,firstMultBin,lastMultBinV0,nMultBinsV0,firstMultBin,lastMultBinV0); // comparison V0A - V0Aeq
519  fHistNtrEtaV0MvsV0MEqEvSel = new TH2F("hNtrEtaV0MvsV0MEqEvSel","Corrected V0M vs corrected V0M-Equalized (events selected); Vzero-M; Vzero-M Equalized",nMultBinsV0,firstMultBin,lastMultBinV0,nMultBinsV0,firstMultBin,lastMultBinV0); // comparison V0M - V0Meq
520  fHistNtrCorrEta1vsNtrRawEta1EvSel = new TH2F("hNtrCorrEta1vsNtrRawEta1EvSel","Corrected Eta1 vs Eta1.0 (events selected); Ntracklets #eta<1.0 corrected; Ntracklets #eta<1",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 1.6 vs eta 1.0 histogram
521  fHistMultCorrvsMultRawEvSel = new TH2F("hMultCorrvsMultRawEvSel",Form("Corrected multiplicity vs uncorrected multiplicity (events selected); %s corrected; %s",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); // corrected vs uncorrected multiplicity
522 
523  fHistNtrEta16vsNtrEta1EvWithCand = new TH2F("hNtrEta16vsNtrEta1EvWithCand","Uncorrected Eta1.6 vs Eta1.0 (events selected with a D candidate); Ntracklets #eta<1.0; Ntracklets #eta<1.6",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 1.6 vs eta 1.0 histogram
524  fHistNtrEta05vsNtrEta1EvWithCand = new TH2F("hNtrEta05vsNtrEta1EvWithCand","Uncorrected Eta0.5 vs Eta1.0 (events selected with a D candidate); Ntracklets #eta<1.0; Ntracklets #eta<0.5",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 0.5 vs eta 1.0 histogram
525  fHistNtrEta03vsNtrEta1EvWithCand = new TH2F("hNtrEta03vsNtrEta1EvWithCand","Uncorrected Eta0.3 vs Eta1.0 (events selected with a D candidate); Ntracklets #eta<1.0; Ntracklets #eta<0.3",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 0.3 vs eta 1.0 histogram
526  fHistNtrEtaV0AvsNtrEta1EvWithCand = new TH2F("hNtrEtaV0AvsNtrEta1EvWithCand","Uncorrected Eta-V0A vs Eta1.0 (events selected with a D candidate); Ntracklets #eta<1.0; Multiplicity V0A",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsV0,firstMultBin,lastMultBinV0); //eta V0A vs eta 1.0 histogram
527  fHistNtrEtaV0MvsNtrEta1EvWithCand = new TH2F("hNtrEtaV0MvsNtrEta1EvWithCand","Uncorrected Eta-V0M vs Eta1.0 (events selected with a D candidate); Ntracklets #eta<1.0; Multiplicity V0A+V0C",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsV0,firstMultBin,lastMultBinV0); //eta V0M vs eta 1.0 histogram
528  fHistNtrEtaV0AvsV0AEqEvWithCand = new TH2F("hNtrEtaV0AvsV0AEqEvWithCand","Corrected V0A vs corrected V0A-Equalized (events selected with a D candidate); Vzero-A; Vzero-A Equalized",nMultBinsV0,firstMultBin,lastMultBinV0,nMultBinsV0,firstMultBin,lastMultBinV0); // comparison V0A - V0Aeq
529  fHistNtrEtaV0MvsV0MEqEvWithCand = new TH2F("hNtrEtaV0MvsV0MEqEvWithCand","Corrected V0M vs corrected V0M-Equalized (events selected with a D candidate); Vzero-M; Vzero-M Equalized",nMultBinsV0,firstMultBin,lastMultBinV0,nMultBinsV0,firstMultBin,lastMultBinV0); // comparison V0M - V0Meq
530  fHistNtrCorrEta1vsNtrRawEta1EvWithCand = new TH2F("hNtrCorrEta1vsNtrRawEta1EvWithCand","Corrected Eta1 vs Eta1.0 (events selected with a D candidate); Ntracklets #eta<1.0 corrected; Ntracklets #eta<1",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 1.6 vs eta 1.0 histogram
531  fHistMultCorrvsMultRawEvWithCand = new TH2F("hMultCorrvsMultRawEvWithCand",Form("Corrected multiplicity vs uncorrected multiplicity (events selected) with a D candidate; %s corrected; %s",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); // corrected vs uncorrected multiplicity
532 
533 
534  fHistNtrEta16vsNtrEta1EvWithD = new TH2F("hNtrEta16vsNtrEta1EvWithD","Uncorrected Eta1.6 vs Eta1.0 (events selected with D in mass range); Ntracklets #eta<1.0; Ntracklets #eta<1.6",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 1.6 vs eta 1.0 histogram
535  fHistNtrEta05vsNtrEta1EvWithD = new TH2F("hNtrEta05vsNtrEta1EvWithD","Uncorrected Eta0.5 vs Eta1.0 (events selected with D in mass range); Ntracklets #eta<1.0; Ntracklets #eta<0.5",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 0.5 vs eta 1.0 histogram
536  fHistNtrEta03vsNtrEta1EvWithD = new TH2F("hNtrEta03vsNtrEta1EvWithD","Uncorrected Eta0.3 vs Eta1.0 (events selected with D in mass range); Ntracklets #eta<1.0; Ntracklets #eta<0.3",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 0.3 vs eta 1.0 histogram
537  fHistNtrEtaV0AvsNtrEta1EvWithD = new TH2F("hNtrEtaV0AvsNtrEta1EvWithD","Uncorrected Eta-V0A vs Eta1.0 (events selected with D in mass range); Ntracklets #eta<1.0; Multiplicity V0A",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsV0,firstMultBin,lastMultBinV0); //eta V0A vs eta 1.0 histogram
538  fHistNtrEtaV0MvsNtrEta1EvWithD = new TH2F("hNtrEtaV0MvsNtrEta1EvWithD","Uncorrected Eta-V0M vs Eta1.0 (events selected with D in mass range); Ntracklets #eta<1.0; Multiplicity V0A+V0C",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsV0,firstMultBin,lastMultBinV0); //eta V0M vs eta 1.0 histogram
539  fHistNtrEtaV0AvsV0AEqEvWithD = new TH2F("hNtrEtaV0AvsV0AEqEvWithD","Corrected V0A vs corrected V0A-Equalized (events selected with D in mass range); Vzero-A; Vzero-A Equalized",nMultBinsV0,firstMultBin,lastMultBinV0,nMultBinsV0,firstMultBin,lastMultBinV0); // comparison V0A - V0Aeq
540  fHistNtrEtaV0MvsV0MEqEvWithD = new TH2F("hNtrEtaV0MvsV0MEqEvWithD","Corrected V0M vs corrected V0M-Equalized (events selected with D in mass range); Vzero-M; Vzero-M Equalized",nMultBinsV0,firstMultBin,lastMultBinV0,nMultBinsV0,firstMultBin,lastMultBinV0); // comparison V0M - V0Meq
541  fHistNtrCorrEta1vsNtrRawEta1EvWithD = new TH2F("hNtrCorrEta1vsNtrRawEta1EvWithD","Corrected Eta1 vs Eta1.0 (events selected with D in mass range); Ntracklets #eta<1.0 corrected; Ntracklets #eta<1",nMultBinsNtrk,firstMultBin,lastMultBinNtrk,nMultBinsNtrk,firstMultBin,lastMultBinNtrk); //eta 1.6 vs eta 1.0 histogram
542  fHistMultCorrvsMultRawEvWithD = new TH2F("hMultCorrvsMultRawEvWithD",Form("Corrected multiplicity vs uncorrected multiplicity (events selected with D in mass range); %s corrected; %s",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); // corrected vs uncorrected multiplicity
543 
544  }
545  fHistNtrVsZvtx = new TH2F("hNtrVsZvtx",Form("N%s vs VtxZ; VtxZ;N_{%s};",estimatorName,estimatorName),300,-15,15,nMultBins,firstMultBin,lastMultBin); //
546  fHistNtrCorrVsZvtx = new TH2F("hNtrCorrVsZvtx",Form("N%s vs VtxZ; VtxZ;N_{%s};",estimatorName,estimatorName),300,-15,15,nMultBins,firstMultBin,lastMultBin); //
547 
548  fHistNtrVsNchMC = new TH2F("hNtrVsNchMC",Form("N%s vs NchMC; Nch;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
549  fHistNtrCorrVsNchMC = new TH2F("hNtrCorrVsNchMC",Form("N%s vs Nch; Nch;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
550 
551  fHistNtrVsNchMCPrimary = new TH2F("hNtrVsNchMCPrimary",Form("N%s vs Nch (Primary); Nch (Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
552  fHistNtrCorrVsNchMCPrimary = new TH2F("hNtrCorrVsNchMCPrimary",Form("N%s vs Nch (Primary); Nch(Primary) ;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
553 
554  fHistNtrVsNchMCPhysicalPrimary = new TH2F("hNtrVsNchMCPhysicalPrimary",Form("N%s vs Nch (Physical Primary); Nch (Physical Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
555  fHistNtrCorrVsNchMCPhysicalPrimary = new TH2F("hNtrCorrVsMCPhysicalPrimary",Form("N%s vs Nch (Physical Primary); Nch (Physical Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
556 
557  fHistGenPrimaryParticlesInelGt0 = new TH1F("hGenPrimaryParticlesInelGt0","Multiplcity of generated charged particles ; Nparticles ; Entries",nMultBins,firstMultBin,lastMultBin);
558 
559  fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary = new TH3F("fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary", "MC: Nch (Physical Primary) vs Nch (Primary) vs Nch (Generated); Nch (Generated); Nch (Primary); Nch (Physical Primary)",nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin);
560 
561  fHistNtrUnCorrPSSel->Sumw2();
562  fHistNtrUnCorrPSTrigSel->Sumw2();
568  fHistNtrUnCorrEvSel->Sumw2();
569  fHistNtrUnCorrEvWithCand->Sumw2();
570  fHistNtrUnCorrEvWithD->Sumw2();
571  fHistNtrCorrPSSel->Sumw2();
572  fHistNtrCorrEvSel->Sumw2();
573  fHistNtrCorrEvWithCand->Sumw2();
574  fHistNtrCorrEvWithD->Sumw2();
590  if(fKeepCorrPlots){
618  }
619  fOutput->Add(fHistNtrVsZvtx);
621 
622  fOutput->Add(fHistNtrVsNchMC);
630 
631 
632  fHistNEvents = new TH1F("fHistNEvents", "number of events ",11,-0.5,10.5);
633  fHistNEvents->GetXaxis()->SetBinLabel(1,"nEvents total");
634  fHistNEvents->GetXaxis()->SetBinLabel(2,"nEvents with Z vertex");
635  fHistNEvents->GetXaxis()->SetBinLabel(3,"nEvents selected");
636  fHistNEvents->GetXaxis()->SetBinLabel(4,"Rejected due to trigger");
637  fHistNEvents->GetXaxis()->SetBinLabel(5,"Rejected due to phys sel");
638  fHistNEvents->GetXaxis()->SetBinLabel(6,"Rejected due to vertex cuts");
639  fHistNEvents->GetXaxis()->SetBinLabel(7,"Rejected due to pileup");
640  fHistNEvents->GetXaxis()->SetBinLabel(8,"Total no. of candidate");
641  fHistNEvents->GetXaxis()->SetBinLabel(9,"no. of cand wo bitmask");
642  fHistNEvents->GetXaxis()->SetBinLabel(10,"D after cuts (No PID)");
643  fHistNEvents->GetXaxis()->SetBinLabel(11,"D after cuts + PID)");
644  fHistNEvents->GetXaxis()->SetNdivisions(1,kFALSE);
645  fHistNEvents->Sumw2();
646  fHistNEvents->SetMinimum(0);
647  fOutput->Add(fHistNEvents);
648 
649  fPtVsMassVsMult=new TH3F("hPtVsMassvsMult", "D candidates: p_{t} vs mass vs tracklets multiplicity; Tracklets; Mass M [GeV/c^{2}]; p_{t} [GeV/c]",nMultBins,firstMultBin,lastMultBin,fNMassBins,fLowmasslimit,fUpmasslimit,48,0.,24.);
650 
651  fPtVsMassVsMultNoPid=new TH3F("hPtVsMassvsMultNoPid", "D candidates: p_{t} vs mass vs tracklets multiplicity; Tracklets; Mass M [GeV/c^{2}]; p_{t} [GeV/c]",nMultBins,firstMultBin,lastMultBin,fNMassBins,fLowmasslimit,fUpmasslimit,48,0.,24.);
652 
653  fPtVsMassVsMultUncorr=new TH3F("hPtVsMassvsMultUncorr", "D candidates: p_{t} vs mass vs tracklets multiplicity; Tracklets; Mass M [GeV/c^{2}]; p_{t} [GeV/c]",nMultBins,firstMultBin,lastMultBin,fNMassBins,fLowmasslimit,fUpmasslimit,48,0.,24.);
654 
655  fPtVsMassVsMultPart=new TH3F("hPtVsMassvsMultPart", "D candidates: p_{t} vs mass vs tracklets multiplicity; Tracklets; Mass M [GeV/c^{2}]; p_{t} [GeV/c]",nMultBins,firstMultBin,lastMultBin,fNMassBins,fLowmasslimit,fUpmasslimit,48,0.,24.);
656 
657  fPtVsMassVsMultAntiPart=new TH3F("hPtVsMassvsMultAntiPart", "D candidates: p_{t} vs mass vs tracklets multiplicity; Tracklets; Mass M [GeV/c^{2}]; p_{t} [GeV/c]",nMultBins,firstMultBin,lastMultBin,fNMassBins,fLowmasslimit,fUpmasslimit,48,0.,24.);
658 
659  fPtVsMassVsMultMC=new TH3F("hPtVsMassvsMultMC", "D true candidates: p_{t} vs mass vs tracklets multiplicity; Tracklets; Mass M [GeV/c^{2}]; p_{t} [GeV/c]",nMultBins,firstMultBin,lastMultBin,fNMassBins,fLowmasslimit,fUpmasslimit,48,0.,24.);
660 
661  fOutput->Add(fPtVsMassVsMult);
667 
669 
670  fCounterC = new AliNormalizationCounter("NormCounterCorrMult");
671  fCounterC->SetStudyMultiplicity(kTRUE,1.);
672  fCounterC->Init();
673 
674  fCounterU = new AliNormalizationCounter("NormCounterUnCorrMult");
675  fCounterU->SetStudyMultiplicity(kTRUE,1.);
676  fCounterU->Init();
677 
678  fCounterCandidates = new AliNormalizationCounter("NormCounterCorrMultCandidates");
681 
682 
683  fOutputCounters = new TList();
684  fOutputCounters->SetOwner();
685  fOutputCounters->SetName("OutputCounters");
689 
690 
691  PostData(1,fOutput);
692  PostData(2,fListCuts);
693  PostData(3,fOutputCounters);
694  PostData(4,fListProfiles);
695 
696  return;
697 }
698 
699 
700 
701 //________________________________________________________________________
703 {
706 
707  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
708 
709  // AliAODTracklets* tracklets = aod->GetTracklets();
710  //Int_t ntracklets = tracklets->GetNumberOfTracklets();
711  if(fAODProtection>=0){
712  // Protection against different number of events in the AOD and deltaAOD
713  // In case of discrepancy the event is rejected.
714  Int_t matchingAODdeltaAODlevel = AliRDHFCuts::CheckMatchingAODdeltaAODevents();
715  if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 && fAODProtection==1)) {
716  // AOD/deltaAOD trees have different number of entries || TProcessID do not match while it was required
717  return;
718  }
719  }
720 
721  TClonesArray *arrayCand = 0;
722  TString arrayName="";
723  UInt_t pdgDau[3];
724  Int_t nDau=0;
725  Int_t selbit=0;
726  if(fPdgMeson==411){
727  arrayName="Charm3Prong";
728  pdgDau[0]=211; pdgDau[1]=321; pdgDau[2]=211;
729  nDau=3;
731  }else if(fPdgMeson==421){
732  arrayName="D0toKpi";
733  pdgDau[0]=211; pdgDau[1]=321; pdgDau[2]=0;
734  nDau=2;
736  }else if(fPdgMeson==413){
737  arrayName="Dstar";
738  pdgDau[0]=321; pdgDau[1]=211; pdgDau[2]=0; // Quoting here D0 daughters (D* ones on another variable later)
739  nDau=2;
741  }else if(fPdgMeson==431){
742  arrayName="Charm3Prong";
743  pdgDau[0]=321; pdgDau[1]=321; pdgDau[2]=211;
744  nDau=3;
745  selbit=AliRDHFCuts::kDsCuts;
746  }else if(fPdgMeson==4122){
747  if(fLctoV0){
748  arrayName="CascadesHF";
749  pdgDau[0]=211; pdgDau[1]=211; pdgDau[2]=0; // Quoting here K0S daughters (Lc ones on another variable later)
750  nDau=2;
752  }else{
753  arrayName="Charm3Prong";
754  pdgDau[0]=2212; pdgDau[1]=321; pdgDau[2]=211;
755  nDau=3;
756  selbit=AliRDHFCuts::kLcCuts;
757  }
758  }
759 
760  if(!aod && AODEvent() && IsStandardAOD()) {
761  // In case there is an AOD handler writing a standard AOD, use the AOD
762  // event in memory rather than the input (ESD) event.
763  aod = dynamic_cast<AliAODEvent*> (AODEvent());
764  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
765  // have to taken from the AOD event hold by the AliAODExtension
766  AliAODHandler* aodHandler = (AliAODHandler*)
767  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
768  if(aodHandler->GetExtensions()) {
769  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
770  AliAODEvent *aodFromExt = ext->GetAOD();
771  arrayCand=(TClonesArray*)aodFromExt->GetList()->FindObject(arrayName.Data());
772  }
773  } else if(aod) {
774  arrayCand=(TClonesArray*)aod->GetList()->FindObject(arrayName.Data());
775  }
776 
777  if(!aod || !arrayCand) {
778  printf("AliAnalysisTaskSEDvsMultiplicity::UserExec: Charm3Prong branch not found!\n");
779  return;
780  }
781 
782  if(fisPPbData && fReadMC){
783  Int_t runnumber = aod->GetRunNumber();
784  if(aod->GetTriggerMask()==0 &&
785  (runnumber>=195344 && runnumber<=195677)){
786  AliDebug(3,"Event rejected because of null trigger mask");
787  return;
788  }
789  }
790 
791 
792  // fix for temporary bug in ESDfilter
793  // the AODs with null vertex pointer didn't pass the PhysSel
794  if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001) return;
795 
796  // Int_t countTreta1=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.);
797  // Int_t countTreta03=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-0.3,0.3);
798  // Int_t countTreta05=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-0.5,0.5);
799  // Int_t countTreta16=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.6,1.6);
800  Int_t countTreta1=0, countTreta03=0, countTreta05=0, countTreta16=0;
801  AliAODTracklets* tracklets=aod->GetTracklets();
802  Int_t nTr=tracklets->GetNumberOfTracklets();
803  for(Int_t iTr=0; iTr<nTr; iTr++){
804  Double_t theta=tracklets->GetTheta(iTr);
805  Double_t eta=-TMath::Log(TMath::Tan(theta/2.));
806  if(eta>-0.3 && eta<0.3) countTreta03++;
807  if(eta>-0.5 && eta<0.5) countTreta05++;
808  if(eta>-1.0 && eta<1.0) countTreta1++;
809  if(eta>-1.6 && eta<1.6) countTreta16++;
810  }
811 
812 
813  Int_t vzeroMult=0, vzeroMultA=0, vzeroMultC=0;
814  Int_t vzeroMultEq=0, vzeroMultAEq=0, vzeroMultCEq=0;
815  AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
816  if(vzeroAOD) {
817  vzeroMultA = static_cast<Int_t>(vzeroAOD->GetMTotV0A());
818  vzeroMultC = static_cast<Int_t>(vzeroAOD->GetMTotV0C());
819  vzeroMult = vzeroMultA + vzeroMultC;
820  vzeroMultAEq = static_cast<Int_t>(AliVertexingHFUtils::GetVZEROAEqualizedMultiplicity(aod));
821  vzeroMultCEq = static_cast<Int_t>(AliVertexingHFUtils::GetVZEROCEqualizedMultiplicity(aod));
822  vzeroMultEq = vzeroMultAEq + vzeroMultCEq;
823  }
824 
825  Int_t countMult = countTreta1;
826  if(fMultiplicityEstimator==kNtrk03) { countMult = countTreta03; }
827  else if(fMultiplicityEstimator==kNtrk05) { countMult = countTreta05; }
828  else if(fMultiplicityEstimator==kNtrk10to16) { countMult = countTreta16 - countTreta1; }
829  else if(fMultiplicityEstimator==kVZERO) { countMult = vzeroMult; }
830  else if(fMultiplicityEstimator==kVZEROA) { countMult = vzeroMultA; }
831  else if(fMultiplicityEstimator==kVZEROEq) { countMult = vzeroMultEq; }
832  else if(fMultiplicityEstimator==kVZEROAEq) { countMult = vzeroMultAEq; }
833 
834 
836  fHistNEvents->Fill(0); // count event
837 
838  Double_t countTreta1corr=countTreta1;
839  Double_t countCorr=countMult;
840  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
841  // In case of VZERO multiplicity, consider the zvtx correction flag
842  // fDoVZER0ParamVertexCorr: 0= none, 1= usual d2h, 2=AliESDUtils
843  Bool_t isDataDrivenZvtxCorr=kTRUE;
844  Bool_t isVtxOk=kFALSE;
845  Int_t vzeroMultACorr=vzeroMultA, vzeroMultCCorr=vzeroMultC, vzeroMultCorr=vzeroMult;
846  Int_t vzeroMultAEqCorr=vzeroMultAEq, vzeroMultCEqCorr=vzeroMultCEq, vzeroMultEqCorr=vzeroMultEq;
847  if(vtx1){
848  if(vtx1->GetNContributors()>0){
849  fHistNEvents->Fill(1);
850  isVtxOk=kTRUE;
851  }
852  }
853  if(isVtxOk){
857  // do not correct
858  isDataDrivenZvtxCorr=kFALSE;
859  } else if (fDoVZER0ParamVertexCorr==2){
860  // use AliESDUtils correction
861  Float_t zvtx = vtx1->GetZ();
862  isDataDrivenZvtxCorr=kFALSE;
863  vzeroMultACorr = static_cast<Int_t>(AliESDUtils::GetCorrV0A(vzeroMultA,zvtx));
864  vzeroMultCCorr = static_cast<Int_t>(AliESDUtils::GetCorrV0C(vzeroMultC,zvtx));
865  vzeroMultCorr = vzeroMultACorr + vzeroMultCCorr;
866  vzeroMultAEqCorr = static_cast<Int_t>(AliESDUtils::GetCorrV0A(vzeroMultAEq,zvtx));
867  vzeroMultCEqCorr =static_cast<Int_t>( AliESDUtils::GetCorrV0C(vzeroMultCEq,zvtx));
868  vzeroMultEqCorr = vzeroMultAEqCorr + vzeroMultCEqCorr;
869  if(fMultiplicityEstimator==kVZERO) { countCorr = vzeroMultCorr; }
870  else if(fMultiplicityEstimator==kVZEROA) { countCorr = vzeroMultACorr; }
871  else if(fMultiplicityEstimator==kVZEROEq) { countCorr = vzeroMultEqCorr; }
872  else if(fMultiplicityEstimator==kVZEROAEq) { countCorr = vzeroMultAEqCorr; }
873  }
874  }
875  }
876  // Data driven multiplicity z-vertex correction
877  if(isVtxOk && isDataDrivenZvtxCorr){
878  TProfile* estimatorAvg = GetEstimatorHistogram(aod);
879  if(estimatorAvg){
880  countTreta1corr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,countTreta1,vtx1->GetZ(),fRefMult));
881  // vzeroMultACorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultA,vtx1->GetZ(),fRefMult));
882  // vzeroMultCorr= vzeroMultACorr + static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultC,vtx1->GetZ(),fRefMult));
883  // vzeroMultAEqCorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultAEq,vtx1->GetZ(),fRefMult));
884  // vzeroMultEqCorr= vzeroMultAEqCorr + static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultCEq,vtx1->GetZ(),fRefMult));
885  countCorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,countMult,vtx1->GetZ(),fRefMult));
886  }
887  }
888 
889 
891 
892  Bool_t isEvSel=fRDCutsAnalysis->IsEventSelected(aod);
893 
894  if(fRDCutsAnalysis->GetWhyRejection()==5) fHistNEvents->Fill(3);
895  if(fRDCutsAnalysis->GetWhyRejection()==7) fHistNEvents->Fill(4);
896  if(fRDCutsAnalysis->GetWhyRejection()==6) fHistNEvents->Fill(5);
897  if(fRDCutsAnalysis->GetWhyRejection()==1) fHistNEvents->Fill(6);
898 
900  Bool_t isEvTrigNameRejected = fRDCutsAnalysis->IsEventRejectedDueToTrigger();
901  Bool_t isEvPileUpRejected = fRDCutsAnalysis->IsEventRejectedDueToPileup();
905  Bool_t isEvCentralityRejected = fRDCutsAnalysis->IsEventRejectedDueToCentrality();
906  if(!isEvPSRejected){
907  fHistNtrUnCorrPSSel->Fill(countMult);
908  fHistNtrCorrPSSel->Fill(countCorr);
909  if(!isEvTrigNameRejected){
910  fHistNtrUnCorrPSTrigSel->Fill(countMult);
911  if(!isEvPileUpRejected){
912  fHistNtrUnCorrPSTrigPileUpSel->Fill(countMult);
913  if(!isEvNoVtxRejected){
914  fHistNtrUnCorrPSTrigPileUpVtxSel->Fill(countMult);
915  if(!isEvVtxContribRejected){
916  fHistNtrUnCorrPSTrigPileUpVtxContSel->Fill(countMult);
917  if(!isEvVtxRangeRejected){
918  fHistNtrUnCorrPSTrigPileUpVtxRangeSel->Fill(countMult);
919  if(!isEvCentralityRejected){
921  }
922  }
923  }
924  }
925  }
926  }
927  }
928 
929  if(!isEvSel)return;
930  fHistNEvents->Fill(2);
931  if(fKeepCorrPlots){
932  fHistNtrEta16vsNtrEta1EvSel->Fill(countTreta1,countTreta16);
933  fHistNtrEta05vsNtrEta1EvSel->Fill(countTreta1,countTreta05);
934  fHistNtrEta03vsNtrEta1EvSel->Fill(countTreta1,countTreta03);
935  fHistNtrEtaV0AvsNtrEta1EvSel->Fill(countTreta1,vzeroMultA);
936  fHistNtrEtaV0MvsNtrEta1EvSel->Fill(countTreta1,vzeroMult);
937  fHistNtrEtaV0AvsV0AEqEvSel->Fill(vzeroMultA,vzeroMultAEq);
938  fHistNtrEtaV0MvsV0MEqEvSel->Fill(vzeroMult,vzeroMultEq);
939  fHistNtrCorrEta1vsNtrRawEta1EvSel->Fill(countTreta1,countTreta1corr);
940  fHistMultCorrvsMultRawEvSel->Fill(countMult,countCorr);
941  }
942  if(vtx1){
943  fHistNtrVsZvtx->Fill(vtx1->GetZ(),countMult);
944  fHistNtrCorrVsZvtx->Fill(vtx1->GetZ(),countCorr);
945  }
946 
947  TClonesArray *arrayMC=0;
948  AliAODMCHeader *mcHeader=0;
949 
950  Double_t nchWeight=1.0;
951 
952  // load MC particles
953  if(fReadMC){
954 
955  arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
956  if(!arrayMC) {
957  printf("AliAnalysisTaskSEDvsMultiplicity::UserExec: MC particles branch not found!\n");
958  return;
959  }
960  // load MC header
961  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
962  if(!mcHeader) {
963  printf("AliAnalysisTaskSEDvsMultiplicity::UserExec: MC header branch not found!\n");
964  return;
965  }
966 
967 
968  // Int_t nChargedMC=AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-1.0,1.0);
969  // Int_t nChargedMCPrimary=AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-1.0,1.0);
970  // Int_t nChargedMCPhysicalPrimary=AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-1.0,1.0);
971  //
972  Int_t nChargedMCEta10=0, nChargedMCEta03=0, nChargedMCEta05=0, nChargedMCEta16=0, nChargedMCEtam37tm17=0, nChargedMCEta28t51=0;
973  Int_t nChargedMCPrimaryEta10=0, nChargedMCPrimaryEta03=0, nChargedMCPrimaryEta05=0, nChargedMCPrimaryEta16=0, nChargedMCPrimaryEtam37tm17=0, nChargedMCPrimaryEta28t51=0;
974  Int_t nChargedMCPhysicalPrimaryEta10=0, nChargedMCPhysicalPrimaryEta03=0, nChargedMCPhysicalPrimaryEta05=0, nChargedMCPhysicalPrimaryEta16=0, nChargedMCPhysicalPrimaryEtam37tm17=0, nChargedMCPhysicalPrimaryEta28t51=0;
975  for(Int_t i=0; i<arrayMC->GetEntriesFast(); i++){
976  AliAODMCParticle *part=(AliAODMCParticle*)arrayMC->UncheckedAt(i);
977  Int_t charge = part->Charge();
978  Double_t eta = part->Eta();
979  Bool_t isPrim = part->IsPrimary();
980  Bool_t isPhysPrim = part->IsPhysicalPrimary();
981  if(charge!=0) {
982  if(eta>-0.3 && eta< 0.3) {
983  nChargedMCEta03++;
984  if(isPrim) nChargedMCPrimaryEta03++;
985  if(isPhysPrim) nChargedMCPhysicalPrimaryEta03++;
986  }
987  if(eta>-0.5 && eta< 0.5) {
988  nChargedMCEta05++;
989  if(isPrim) nChargedMCPrimaryEta05++;
990  if(isPhysPrim) nChargedMCPhysicalPrimaryEta05++;
991  }
992  if(eta>-1.0 && eta< 1.0) {
993  nChargedMCEta10++;
994  if(isPrim) nChargedMCPrimaryEta10++;
995  if(isPhysPrim) nChargedMCPhysicalPrimaryEta10++;
996  }
997  if(eta>-1.6 && eta< 1.6) {
998  nChargedMCEta16++;
999  if(isPrim) nChargedMCPrimaryEta16++;
1000  if(isPhysPrim) nChargedMCPhysicalPrimaryEta16++;
1001  }
1002  if(eta>-3.7 && eta<-1.7) {
1003  nChargedMCEtam37tm17++;
1004  if(isPrim) nChargedMCPrimaryEtam37tm17++;
1005  if(isPhysPrim) nChargedMCPhysicalPrimaryEtam37tm17++;
1006  }
1007  if(eta> 2.8 && eta< 5.1) {
1008  nChargedMCEta28t51++;
1009  if(isPrim) nChargedMCPrimaryEta28t51++;
1010  if(isPhysPrim) nChargedMCPhysicalPrimaryEta28t51++;
1011  }
1012  }
1013  }
1014  Int_t nChargedMC=nChargedMCEta10;
1015  Int_t nChargedMCPrimary=nChargedMCPrimaryEta10;
1016  Int_t nChargedMCPhysicalPrimary=nChargedMCPhysicalPrimaryEta10;
1017 
1018  // Compute the Nch weights (reference is Ntracklets within |eta|<1.0)
1019  if(fUseNchWeight>0){
1020 
1021  Double_t tmpweight = 1.0;
1022  Double_t tmpXweight=nChargedMCPhysicalPrimary; // Nch weights
1023  if(fUseNchWeight==2) tmpXweight=countMult; // Ntrk weights
1024 
1025  if(tmpXweight<=0) tmpweight = 0.0;
1026  else{
1027  Double_t pMeas = fHistoMeasNch->GetBinContent(fHistoMeasNch->FindBin(tmpXweight));
1028  //printf(" pMeas=%2.2f and histo MCNch %s \n",pMeas,fHistoMCNch);
1029  Double_t pMC = fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(tmpXweight));
1030  tmpweight = pMC>0 ? pMeas/pMC : 0.;
1031  }
1032  nchWeight *= tmpweight;
1033  AliDebug(2,Form("Using Nch weights, Mult=%f Weight=%f\n",tmpXweight,nchWeight));
1034 
1035  }
1036 
1037  // Now recompute the variables in case another MC estimator is considered
1038  // Int_t nChargedMCEta10 = nChargedMC;
1039  // Int_t nChargedMCEta16 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-1.6,1.6);
1040  // Int_t nChargedMCEta05 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-0.5,0.5);
1041  // Int_t nChargedMCEta03 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-0.3,0.3);
1042  // Int_t nChargedMCEtam37tm17 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-3.7,-1.7);
1043  // Int_t nChargedMCEta28t51 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,2.8,5.1);
1044  // Int_t nChargedMCPrimaryEta10 = nChargedMCPrimary;
1045  // Int_t nChargedMCPrimaryEta16 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-1.6,1.6);
1046  // Int_t nChargedMCPrimaryEta05 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-0.5,0.5);
1047  // Int_t nChargedMCPrimaryEta03 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-0.3,0.3);
1048  // Int_t nChargedMCPrimaryEtam37tm17 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-3.7,-1.7);
1049  // Int_t nChargedMCPrimaryEta28t51 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,2.8,5.1);
1050  // Int_t nChargedMCPhysicalPrimaryEta10 = nChargedMCPhysicalPrimary;
1051  // Int_t nChargedMCPhysicalPrimaryEta16 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-1.6,1.6);
1052  // Int_t nChargedMCPhysicalPrimaryEta05 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-0.5,0.5);
1053  // Int_t nChargedMCPhysicalPrimaryEta03 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-0.3,0.3);
1054  // Int_t nChargedMCPhysicalPrimaryEtam37tm17 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-3.7,-1.7);
1055  // Int_t nChargedMCPhysicalPrimaryEta28t51 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,2.8,5.1);
1057  nChargedMC = nChargedMCEta16 - nChargedMCEta10;
1058  nChargedMCPrimary = nChargedMCPrimaryEta16 - nChargedMCPrimaryEta10;
1059  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta16 - nChargedMCPhysicalPrimaryEta10;
1060  } else if(fMCPrimariesEstimator==kEta05){
1061  nChargedMC = nChargedMCEta05;
1062  nChargedMCPrimary = nChargedMCPrimaryEta05;
1063  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta05;
1064  } else if(fMCPrimariesEstimator==kEta03){
1065  nChargedMC = nChargedMCEta03;
1066  nChargedMCPrimary = nChargedMCPrimaryEta03;
1067  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta03;
1068  } else if(fMCPrimariesEstimator==kEtaVZERO){
1069  nChargedMC = nChargedMCEtam37tm17 + nChargedMCEta28t51;
1070  nChargedMCPrimary = nChargedMCPrimaryEtam37tm17 + nChargedMCPrimaryEta28t51;
1071  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEtam37tm17 + nChargedMCPhysicalPrimaryEta28t51;
1072  } else if(fMCPrimariesEstimator==kEtaVZEROA){
1073  nChargedMC = nChargedMCEta28t51;
1074  nChargedMCPrimary = nChargedMCPrimaryEta28t51;
1075  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta28t51;
1076  }
1077 
1078  // Here fill the MC correlation plots
1079  if(nChargedMCPhysicalPrimary>0){ // INEL>0 for |eta|<1
1080  fHistGenPrimaryParticlesInelGt0->Fill(nChargedMCPhysicalPrimary,nchWeight);
1081  }
1082 
1083  fHistNtrVsNchMC->Fill(nChargedMC,countMult,nchWeight);
1084  fHistNtrCorrVsNchMC->Fill(nChargedMC,countCorr,nchWeight);
1085 
1086  fHistNtrVsNchMCPrimary->Fill(nChargedMCPrimary,countMult,nchWeight);
1087  fHistNtrCorrVsNchMCPrimary->Fill(nChargedMCPrimary,countCorr,nchWeight);
1088 
1089  fHistNtrVsNchMCPhysicalPrimary->Fill(nChargedMCPhysicalPrimary,countMult,nchWeight);
1090  fHistNtrCorrVsNchMCPhysicalPrimary->Fill(nChargedMCPhysicalPrimary,countCorr,nchWeight);
1091 
1092  fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary->Fill(nChargedMC,nChargedMCPrimary,nChargedMCPhysicalPrimary,nchWeight);
1093  }
1094 
1095  Int_t nCand = arrayCand->GetEntriesFast();
1096  Int_t nSelectedNoPID=0,nSelectedPID=0,nSelectedInMassPeak=0;
1097  Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
1098  Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
1099  Double_t mDstarPDG = TDatabasePDG::Instance()->GetParticle(413)->Mass();
1100  Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
1101  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
1102 
1103  // pdg of daughters needed for D* too
1104  UInt_t pdgDgDStartoD0pi[2]={421,211};
1105 
1106  // pdg of daughters needed for Lc2pK0S too
1107  UInt_t pdgDgLctopK0S[2]={2212,310};
1108 
1109  Double_t aveMult=0.;
1110  Double_t nSelCand=0.;
1111  for (Int_t iCand = 0; iCand < nCand; iCand++) {
1112  AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayCand->UncheckedAt(iCand);
1113  AliAODRecoCascadeHF *dCascade = NULL;
1114  if(fPdgMeson==413 || (fPdgMeson==4122 && fLctoV0)) dCascade = (AliAODRecoCascadeHF*)d;
1115 
1116  fHistNEvents->Fill(7);
1117 
1118  if(fPdgMeson==4122){
1119  if(fLctoV0){
1120  AliAODv0 * v0part = (AliAODv0*)dCascade->Getv0();
1121  Bool_t onFlyV0 = v0part->GetOnFlyStatus(); // on-the-flight V0s
1122  if (onFlyV0){fHistNEvents->Fill(8); continue;}
1123  }else if(!fLctoV0 && fUseBit && !d->HasSelectionBit(selbit)) {
1124  fHistNEvents->Fill(8);
1125  continue;
1126  }
1127  }
1128 
1129  if(fPdgMeson!=4122 && fUseBit && !d->HasSelectionBit(selbit)) {
1130  fHistNEvents->Fill(8);
1131  continue;
1132  }
1133 
1134  Double_t ptCand = d->Pt();
1135  Double_t rapid=d->Y(fPdgMeson);
1136  Bool_t isFidAcc=fRDCutsAnalysis->IsInFiducialAcceptance(ptCand,rapid);
1137  if(!isFidAcc) continue;
1138 
1139  Int_t labD=-1;
1140  if(fReadMC) {
1141  if(fPdgMeson==413){
1142  labD = dCascade->MatchToMC(fPdgMeson,421,(Int_t*)pdgDgDStartoD0pi,(Int_t*)pdgDau,arrayMC);
1143  } else if(fPdgMeson==4122 && fLctoV0){
1144  labD = dCascade->MatchToMC(fPdgMeson,pdgDgLctopK0S[1],(Int_t*)pdgDgLctopK0S,(Int_t*)pdgDau,arrayMC,kTRUE);
1145  } else {
1146  labD = d->MatchToMC(fPdgMeson,arrayMC,nDau,(Int_t*)pdgDau);
1147  }
1148  FillMCMassHistos(arrayMC,labD, countMult,nchWeight);
1149  }
1150 
1151  Int_t passAllCuts=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kAll,aod);
1153  Int_t passTopolCuts=fRDCutsAnalysis->GetIsSelectedCuts();
1154  if (fPdgMeson == 4122){
1156  else passTopolCuts=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kCandidate,aod);
1157  }
1158  if (fPdgMeson != 431 && passTopolCuts==0) continue;
1159  nSelectedNoPID++;
1160  fHistNEvents->Fill(9);
1161  if(fPdgMeson == 431 && passAllCuts==0) continue;
1162  if(passAllCuts){
1163  nSelectedPID++;
1164  fHistNEvents->Fill(10);
1165  }
1166  Double_t multForCand = countCorr;
1167 
1169  if(fPdgMeson==4122 && fLctoV0) {
1170  // For the Lc2pK0S case, subtract only the proton daughter track <=== FIXME !!
1171  AliAODTrack *t = (AliAODTrack *)dCascade->GetBachelor();
1172  if(!t) continue;
1173  if(t->HasPointOnITSLayer(0) && t->HasPointOnITSLayer(1)){
1174  if(multForCand>0) multForCand-=1;
1175  }
1176  } else {
1177  // For the D* case, subtract only the D0 daughter tracks <=== FIXME !!
1178  AliAODRecoDecayHF2Prong* d0fromDstar = NULL;
1179  if(fPdgMeson==413) d0fromDstar = (AliAODRecoDecayHF2Prong*)dCascade->Get2Prong();
1180 
1181  for(Int_t iDau=0; iDau<nDau; iDau++){
1182  AliAODTrack *t = NULL;
1183  if(fPdgMeson==413){ t = (AliAODTrack*)d0fromDstar->GetDaughter(iDau); }
1184  else{ t = (AliAODTrack*)d->GetDaughter(iDau); }
1185  if(!t) continue;
1186  if(t->HasPointOnITSLayer(0) && t->HasPointOnITSLayer(1)){
1187  if(multForCand>0) multForCand-=1;
1188  }
1189  }
1190  }
1191  }
1192  Bool_t isPrimary=kTRUE;
1193  Double_t trueImpParXY=9999.;
1194  Double_t impparXY=d->ImpParXY()*10000.;
1195  Double_t dlen=0.1; //FIXME
1196  Double_t mass[2];
1197  if(fPdgMeson==411){
1198  mass[0]=d->InvMass(nDau,pdgDau);
1199  mass[1]=-1.;
1200  if(TMath::Abs(mass[0]-mDplusPDG)<0.02) nSelectedInMassPeak++; //20 MeV for now... FIXME
1201  }else if(fPdgMeson==421){
1202  UInt_t pdgdaughtersD0[2]={211,321};//pi,K
1203  UInt_t pdgdaughtersD0bar[2]={321,211};//K,pi
1204  mass[0]=d->InvMass(2,pdgdaughtersD0);
1205  mass[1]=d->InvMass(2,pdgdaughtersD0bar);
1206  if(TMath::Abs(mass[0]-mD0PDG)<0.02 || TMath::Abs(mass[1]-mD0PDG)<0.02 ) nSelectedInMassPeak++; //20 MeV for now... FIXME
1207  }else if(fPdgMeson==413){
1208  // FIXME
1209  mass[0]=dCascade->DeltaInvMass();
1210  mass[1]=-1.;
1211  if(TMath::Abs(mass[0]-(mDstarPDG-mD0PDG))<0.0015) nSelectedInMassPeak++; //1 MeV for now... FIXME
1212  }else if(fPdgMeson==431){
1213  UInt_t pdgDsKKpi[3]={321,321,211};
1214  UInt_t pdgDspiKK[3]={211,321,321};
1215  mass[0]=d->InvMass(nDau,pdgDsKKpi);
1216  mass[1]=d->InvMass(nDau,pdgDspiKK);
1217  if(TMath::Abs(mass[0]-mDsPDG)<0.02 || TMath::Abs(mass[1]-mDsPDG)<0.02 ) nSelectedInMassPeak++; //20 MeV for now... FIXME
1218  }else if(fPdgMeson==4122){
1219  if(fLctoV0){
1220  mass[0]=d->InvMass(2,pdgDgLctopK0S);
1221  mass[1]=-1.;
1222  if(TMath::Abs(mass[0]-mLcPDG)<0.02) nSelectedInMassPeak++; //20 MeV for now... FIXME
1223  }else{
1224  UInt_t pdgpKpi[3]={2212,321,211};
1225  UInt_t pdgpiKp[3]={211,321,2212};
1226  if(passTopolCuts==3 || passTopolCuts==1)mass[0]=d->InvMass(3,pdgpKpi);
1227  if(passTopolCuts>=2) mass[1]=d->InvMass(3,pdgpiKp);
1228  if(TMath::Abs(mass[0]-mLcPDG)<0.02) nSelectedInMassPeak++; //20 MeV for now... FIXME
1229  }
1230  }
1231 
1232  for(Int_t iHyp=0; iHyp<2; iHyp++){
1233  if(mass[iHyp]<0.) continue; // for D+,D* and Lc2pK0S we have 1 mass hypothesis
1234  Double_t invMass=mass[iHyp];
1235  Double_t arrayForSparse[5]={invMass,ptCand,impparXY,dlen,multForCand};
1236 
1237  if(fReadMC){
1238 
1239  if(fPdgMeson==413){
1240  labD = dCascade->MatchToMC(fPdgMeson,421,(Int_t*)pdgDgDStartoD0pi,(Int_t*)pdgDau,arrayMC);
1241  }else if(fPdgMeson==4122 && fLctoV0){
1242  labD = dCascade->MatchToMC(fPdgMeson,pdgDgLctopK0S[1],(Int_t*)pdgDgLctopK0S,(Int_t*)pdgDau,arrayMC,kTRUE);
1243  }else {
1244  labD = d->MatchToMC(fPdgMeson,arrayMC,nDau,(Int_t*)pdgDau);
1245  }
1246 
1247  Bool_t fillHisto=fDoImpPar;
1248  if(labD>=0){
1249  AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
1250  Int_t code=partD->GetPdgCode();
1251  if(CheckOrigin(arrayMC,partD)==5) isPrimary=kFALSE;
1252  if(code<0 && iHyp==0) fillHisto=kFALSE;
1253  if(code>0 && iHyp==1) fillHisto=kFALSE;
1254  if(!isPrimary){
1255  if(fPdgMeson==411){
1256  trueImpParXY=AliVertexingHFUtils::GetTrueImpactParameterDplus(mcHeader,arrayMC,partD)*10000.;
1257  }else if(fPdgMeson==421){
1258  trueImpParXY=AliVertexingHFUtils::GetTrueImpactParameterDzero(mcHeader,arrayMC,partD)*10000.;
1259  }else if(fPdgMeson==413 || fPdgMeson==4122){
1260  trueImpParXY=0.;
1261  }
1262  Double_t arrayForSparseTrue[5]={invMass,ptCand,trueImpParXY,dlen,multForCand};
1263  if(fillHisto && passAllCuts){
1264  fHistMassPtImpPar[2]->Fill(arrayForSparse);
1265  fHistMassPtImpPar[3]->Fill(arrayForSparseTrue);
1266  }
1267  }else{
1268  if(fillHisto && passAllCuts) fHistMassPtImpPar[1]->Fill(arrayForSparse);
1269  }
1270  }else{
1271  if(fillHisto && passAllCuts)fHistMassPtImpPar[4]->Fill(arrayForSparse);
1272  }
1273 
1274  if(TMath::Abs(labD)==fPdgMeson && fMCOption==2) continue;
1275  if(TMath::Abs(labD)!=fPdgMeson && fMCOption==1) continue;
1276 
1277  }
1278 
1279  if(fPdgMeson==421){
1280  if(iHyp==0 && !(passTopolCuts&1)) continue; // candidate not passing as D0
1281  if(iHyp==1 && !(passTopolCuts&2)) continue; // candidate not passing as D0bar
1282  }
1283 
1284  if(fPdgMeson != 431) fPtVsMassVsMultNoPid->Fill(multForCand,invMass,ptCand);
1285 
1286  if(fPdgMeson==421){
1287  if(iHyp==0 && !(passAllCuts&1)) continue; // candidate not passing as D0
1288  if(iHyp==1 && !(passAllCuts&2)) continue; // candidate not passing as D0bar
1289  }
1290  if(fPdgMeson==431){
1291  if(iHyp==0 && !(passAllCuts&4)) continue; // candidates Ds not passing as kk(phi)pi
1292  if(iHyp==1 && !(passAllCuts&8)) continue; // candidates Ds not passing as pikk(phi)
1293  }
1294  if(fPdgMeson==4122 && !fLctoV0){
1295  if(iHyp==0 && !(passTopolCuts&1)) continue; // candidate not passing as Lc-> pKpi
1296  if(iHyp==1 && !(passTopolCuts&2)) continue; // candidate not passing as Lc-> piKp
1297  }
1298 
1299  if(passAllCuts){
1300  aveMult+=multForCand;
1301  nSelCand+=1.;
1302  fPtVsMassVsMult->Fill(multForCand,invMass,ptCand,nchWeight);
1303  fPtVsMassVsMultUncorr->Fill(countTreta1,invMass,ptCand,nchWeight);
1304  // Add separation between part antipart
1305  if(fPdgMeson==411 || fPdgMeson==413 || fPdgMeson==431 || fPdgMeson==4122){
1306  if(d->GetCharge()>0) fPtVsMassVsMultPart->Fill(multForCand,invMass,ptCand,nchWeight);
1307  else fPtVsMassVsMultAntiPart->Fill(multForCand,invMass,ptCand,nchWeight);
1308  }else if(fPdgMeson==421){
1309  if(passAllCuts&1) fPtVsMassVsMultPart->Fill(multForCand,invMass,ptCand,nchWeight);
1310  if(passAllCuts&2) fPtVsMassVsMultAntiPart->Fill(multForCand,invMass,ptCand,nchWeight);
1311  }
1312 
1313  if(fDoImpPar){
1314  fHistMassPtImpPar[0]->Fill(arrayForSparse);
1315  }
1316 
1317  }
1318 
1319  }
1320  }
1321  if(fSubtractTrackletsFromDau && nSelCand>0){
1322  aveMult/=nSelCand;
1323  fCounterCandidates->StoreEvent(aod,fRDCutsAnalysis,fReadMC,(Int_t)(aveMult+0.5001));
1324  }else{
1326  }
1327 
1328 
1329  fCounterCandidates->StoreCandidates(aod,nSelectedNoPID,kTRUE);
1330  fCounterCandidates->StoreCandidates(aod,nSelectedPID,kFALSE);
1331  fHistNtrUnCorrEvSel->Fill(countMult,nchWeight);
1332  fHistNtrCorrEvSel->Fill(countCorr,nchWeight);
1333  if(nSelectedPID>0) {
1334  fHistNtrUnCorrEvWithCand->Fill(countMult,nchWeight);
1335  fHistNtrCorrEvWithCand->Fill(countCorr,nchWeight);
1336  if(fKeepCorrPlots){
1337  fHistNtrEta16vsNtrEta1EvWithCand->Fill(countTreta1,countTreta16);
1338  fHistNtrEta05vsNtrEta1EvWithCand->Fill(countTreta1,countTreta05);
1339  fHistNtrEta03vsNtrEta1EvWithCand->Fill(countTreta1,countTreta03);
1340  fHistNtrEtaV0AvsNtrEta1EvWithCand->Fill(countTreta1,vzeroMultA);
1341  fHistNtrEtaV0MvsNtrEta1EvWithCand->Fill(countTreta1,vzeroMult);
1342  fHistNtrEtaV0AvsV0AEqEvWithCand->Fill(vzeroMultA,vzeroMultAEq);
1343  fHistNtrEtaV0MvsV0MEqEvWithCand->Fill(vzeroMult,vzeroMultEq);
1344  fHistNtrCorrEta1vsNtrRawEta1EvWithCand->Fill(countTreta1,countTreta1corr);
1345  fHistMultCorrvsMultRawEvWithCand->Fill(countMult,countCorr);
1346  }
1347  }
1348  if(nSelectedInMassPeak>0) {
1349  fHistNtrUnCorrEvWithD->Fill(countMult,nchWeight);
1350  fHistNtrCorrEvWithD->Fill(countCorr,nchWeight);
1351  if(fKeepCorrPlots){
1352  fHistNtrEta16vsNtrEta1EvWithD->Fill(countTreta1,countTreta16);
1353  fHistNtrEta05vsNtrEta1EvWithD->Fill(countTreta1,countTreta05);
1354  fHistNtrEta03vsNtrEta1EvWithD->Fill(countTreta1,countTreta03);
1355  fHistNtrEtaV0AvsNtrEta1EvWithD->Fill(countTreta1,vzeroMultA);
1356  fHistNtrEtaV0MvsNtrEta1EvWithD->Fill(countTreta1,vzeroMult);
1357  fHistNtrEtaV0AvsV0AEqEvWithD->Fill(vzeroMultA,vzeroMultAEq);
1358  fHistNtrEtaV0MvsV0MEqEvWithD->Fill(vzeroMult,vzeroMultEq);
1359  fHistNtrCorrEta1vsNtrRawEta1EvWithD->Fill(countTreta1,countTreta1corr);
1360  fHistMultCorrvsMultRawEvWithD->Fill(countMult,countCorr);
1361  }
1362  }
1363 
1364  PostData(1,fOutput);
1365  PostData(2,fListCuts);
1366  PostData(3,fOutputCounters);
1367 
1368  return;
1369 }
1370 
1371 //________________________________________________________________________
1375 
1376  Int_t nbins[5]={fNMassBins,200,fNImpParBins,50,100};
1377  Double_t xmin[5]={fLowmasslimit,0.,fLowerImpPar,0.,0.};
1378  Double_t xmax[5]={fUpmasslimit,20.,fHigherImpPar,1.,100.};
1379 
1380  fHistMassPtImpPar[0]=new THnSparseF("hMassPtImpParAll",
1381  "Mass vs. pt vs.imppar - All",
1382  5,nbins,xmin,xmax);
1383  fHistMassPtImpPar[1]=new THnSparseF("hMassPtImpParPrompt",
1384  "Mass vs. pt vs.imppar - promptD",
1385  5,nbins,xmin,xmax);
1386  fHistMassPtImpPar[2]=new THnSparseF("hMassPtImpParBfeed",
1387  "Mass vs. pt vs.imppar - DfromB",
1388  5,nbins,xmin,xmax);
1389  fHistMassPtImpPar[3]=new THnSparseF("hMassPtImpParTrueBfeed",
1390  "Mass vs. pt vs.true imppar -DfromB",
1391  5,nbins,xmin,xmax);
1392  fHistMassPtImpPar[4]=new THnSparseF("hMassPtImpParBkg",
1393  "Mass vs. pt vs.imppar - backgr.",
1394  5,nbins,xmin,xmax);
1395  for(Int_t i=0; i<5;i++){
1396  fOutput->Add(fHistMassPtImpPar[i]);
1397  }
1398 }
1399 
1400 //________________________________________________________________________
1402 {
1404  //
1405  if(fDebug > 1) printf("AnalysisTaskSEDvsMultiplicity: Terminate() \n");
1406 
1407  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1408  if (!fOutput) {
1409  printf("ERROR: fOutput not available\n");
1410  return;
1411  }
1412 
1413  fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
1414  if(!fHistNEvents){
1415  printf("ERROR: fHistNEvents not available\n");
1416  return;
1417  }
1418  printf("Number of Analyzed Events = %d\n",(Int_t)fHistNEvents->GetBinContent(3));
1419 
1420  return;
1421 }
1422 //_________________________________________________________________________________________________
1423 Int_t AliAnalysisTaskSEDvsMultiplicity::CheckOrigin(TClonesArray* arrayMC, AliAODMCParticle *mcPartCandidate) const {
1424  //
1426  //
1427 
1428  Int_t pdgGranma = 0;
1429  Int_t mother = 0;
1430  mother = mcPartCandidate->GetMother();
1431  Int_t istep = 0;
1432  Int_t abspdgGranma =0;
1433  Bool_t isFromB=kFALSE;
1434  // Bool_t isQuarkFound=kFALSE;
1435  while (mother >0 ){
1436  istep++;
1437  AliAODMCParticle* mcGranma = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mother));
1438  if (mcGranma){
1439  pdgGranma = mcGranma->GetPdgCode();
1440  abspdgGranma = TMath::Abs(pdgGranma);
1441  if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
1442  isFromB=kTRUE;
1443  }
1444  // if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
1445  mother = mcGranma->GetMother();
1446  }else{
1447  AliError("Failed casting the mother particle!");
1448  break;
1449  }
1450  }
1451 
1452  if(isFromB) return 5;
1453  else return 4;
1454 }
1455 
1456 
1457 
1458 //____________________________________________________________________________
1464 
1465  Int_t runNo = event->GetRunNumber();
1466  Int_t period = -1; // pp: 0-LHC10b, 1-LHC10c, 2-LHC10d, 3-LHC10e
1467  // pPb 2013: 0-LHC13b, 1-LHC13c
1468  // pPb 2016: 0-LHC16q: 265499->265525; 265309->265387, 1-LHC16q:265435, 2-LHC16q:265388->265427, LHC16t: 267163->267166
1469  if (fisPPbData) {
1470  if(fYearNumber==13) {
1471  if (runNo>195343 && runNo<195484) period = 0; //13b
1472  else if (runNo>195528 && runNo<195678) period = 1; //13c
1473  if (period < 0 || period > 1) return 0;
1474  }
1475  else if(fYearNumber==16) {
1476  if ((runNo>=265499 && runNo<=265525) || (runNo>=265309 && runNo<=265387)) period = 0; //16q
1477  else if (runNo == 265435) period = 1; //16q
1478  else if (runNo>=265388 && runNo<=265427) period = 2; //16q
1479  else if (runNo>=267163 && runNo<=267166) period = 3; //16t
1480  if (period < 0 || period > 3) return 0;
1481  }
1482  }
1483  else {
1484  if(fYearNumber==10){
1485  if(runNo>114930 && runNo<117223) period = 0;
1486  if(runNo>119158 && runNo<120830) period = 1;
1487  if(runNo>122373 && runNo<126438) period = 2;
1488  if(runNo>127711 && runNo<130851) period = 3;
1489  if(period<0 || period>3) return 0;
1490  }else if(fYearNumber==16){
1491  if(runNo>=252235 && runNo<=252375)period = 0;//16d
1492  if(runNo>=252603 && runNo<=253591)period = 1;//16e
1493  if(runNo>=254124 && runNo<=254332)period = 2;//16g
1494  if(runNo>=254378 && runNo<=255469 )period = 3;//16h_1
1495  if(runNo>=254418 && runNo<=254422 )period = 4;//16h_2 negative mag
1496  if(runNo>=256146 && runNo<=256420 )period = 5;//16j
1497  if(runNo>=256504 && runNo<=258537 )period = 6;//16k
1498  if(runNo>=258883 && runNo<=260187)period = 7;//16l
1499  if(runNo>=262395 && runNo<=264035 )period = 8;//16o
1500  if(runNo>=264076 && runNo<=264347 )period = 9;//16p
1501  }else if(fYearNumber==17){
1502  if(runNo>=270822 && runNo<=270830)period = 0;//17e
1503  if(runNo>=270854 && runNo<=270865)period = 1;//17f
1504  if(runNo>=271868 && runNo<=273103)period = 2;//17h
1505  if(runNo>=273591 && runNo<=274442)period = 3;//17i
1506  if(runNo>=274593 && runNo<=274671)period = 4;//17j
1507  if(runNo>=274690 && runNo<=276508)period = 5;//17k
1508  if(runNo>=276551 && runNo<=278216)period = 6;//17l
1509  if(runNo>=278914 && runNo<=280140)period = 7;//17m
1510  if(runNo>=280282 && runNo<=281961)period = 8;//17o
1511  if(runNo>=282504 && runNo<=282704)period = 9;//17r
1512  }else if(fYearNumber==18){
1513  if(runNo>=285008 && runNo<=285447)period = 0;//18b
1514  if(runNo>=285978 && runNo<=286350)period = 1;//18d
1515  if(runNo>=286380 && runNo<=286937)period = 2;//18e
1516  if(runNo>=287000 && runNo<=287977)period = 3;//18f
1517  if(runNo>=288619 && runNo<=288750)period = 4;//18g
1518  if(runNo>=288804 && runNo<=288806)period = 5;//18h
1519  if(runNo>=288861 && runNo<=288909 )period = 6;//18i
1520  if(runNo==288943)period = 7;//18j
1521  if(runNo>=289165 && runNo<=289201)period = 8;//18k
1522  if(runNo>=289240 && runNo<=289971)period = 9;//18l
1523  if(runNo>=290222 && runNo<=292839)period = 10;//18m
1524  if(runNo>=293357 && runNo<=293359)period = 11;//18n
1525  if(runNo>=293368 && runNo<=293898)period = 12;//18o
1526  if(runNo>=294009 && runNo<=294925)period = 13;//18p
1527  }
1528  }
1529  return fMultEstimatorAvg[period];
1530 }
1531 //__________________________________________________________________________________________________
1534  //
1535  // for Nch > 70 the points were obtainedwith a double NBD distribution
1536  // 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
1537  // fit1->SetParameter(1,1.63); // k parameter
1538  // fit1->SetParameter(2,12.8); // mean multiplicity
1539  Double_t nchbins[82]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1540  10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1541  20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1542  30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1543  40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1544  50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1545  60.50,62.50,64.50,66.50,68.50,70.50,72.50,74.50,76.50,78.50,
1546  80.50,82.50,84.50,86.50,88.50,90.50,92.50,94.50,96.50,98.50,
1547  100.50,102.50};
1548  Double_t pch[81]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1549  0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1550  0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1551  0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1552  0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1553  0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1554  0.000296,0.000265,0.000193,0.00016,0.000126,0.0000851, 0.0000676,0.0000537,0.0000426, 0.0000338,
1555  0.0000268,0.0000213,0.0000166,0.0000133,0.0000106,0.00000837,0.00000662, 0.00000524,0.00000414, 0.00000327,
1556  0.00000258};
1557 
1558  if(fHistoMeasNch) delete fHistoMeasNch;
1559  fHistoMeasNch=new TH1F("hMeaseNch","",81,nchbins);
1560  for(Int_t i=0; i<81; i++){
1561  fHistoMeasNch->SetBinContent(i+1,pch[i]);
1562  fHistoMeasNch->SetBinError(i+1,0.);
1563  }
1564 }
1565 
1566 //__________________________________________________________________________________________________
1567 void AliAnalysisTaskSEDvsMultiplicity::FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Int_t countMult,Double_t nchWeight)
1568 {
1569  //
1571  //
1572 
1573  if(labD>=0){
1574  AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
1575  Double_t mass = partD->M();
1576  Double_t pt = partD->Pt();
1577  fPtVsMassVsMultMC->Fill(countMult,mass,pt,nchWeight);
1578  }
1579 
1580 }
Int_t charge
Bool_t IsEventRejectedDueToCentrality() const
Definition: AliRDHFCuts.h:361
TH2F * fHistMultCorrvsMultRawEvSel
!hist. for multiplicity with and w/o corrections
TH3F * fPtVsMassVsMult
! hist. of Pt vs Mult vs. mass (
Int_t pdg
Bool_t IsEventRejectedDueToZVertexOutsideFiducialRegion() const
Definition: AliRDHFCuts.h:355
Int_t fAODProtection
flag to look at the correlation of different estimators (eta ranges)
TH2F * fHistNtrCorrVsZvtx
! hist of ntracklets vs Zvertex
Int_t fDoVZER0ParamVertexCorr
Definition of the primaries estimator eta range: |eta|<1.0=0, -1.6<|eta|<1.0=1, VZEROrange=2.
TH2F * fHistNtrVsNchMCPhysicalPrimary
! hist of ntracklets vs Nch (Physical Primary)
TH2F * fHistNtrEtaV0MvsNtrEta1EvSel
!hist. for Ntracklets in eta-V0M vs. eta<1.
TH1F * fHistNtrCorrEvSel
! hist. of ntracklets for selected events
TH2F * fHistNtrEta05vsNtrEta1EvSel
!hist. for Ntracklets in eta<0.5 vs. eta<1.
Bool_t IsEventRejectedDueToNotRecoVertex() const
Definition: AliRDHFCuts.h:346
TH3F * fPtVsMassVsMultPart
! hist. of Pt vs Mult vs. mass (particle)
TH2F * fHistNtrEtaV0MvsNtrEta1EvWithD
!hist. for Ntracklets in eta-V0M vs. eta<1. for events with a candidate in D mass peak ...
double Double_t
Definition: External.C:58
Definition: External.C:260
TH2F * fHistNtrVsNchMCPrimary
! hist of ntracklets vs Nch (Primary)
TH2F * fHistMultCorrvsMultRawEvWithD
!hist. for multiplicity with and w/o corrections for events with a candidate in D mass peak ...
TH1F * fHistNtrUnCorrPSTrigPileUpVtxSel
! hist. of ntracklets for physics selection + trigger name + pileup + with-vertex selected events ...
TH2F * fHistNtrEta03vsNtrEta1EvSel
!hist. for Ntracklets in eta<0.3 vs. eta<1.
AliRDHFCuts * fRDCutsAnalysis
nbins for invariant mass histos
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
Definition: External.C:236
Double_t fHigherImpPar
lower limit in impact parameter (um)
Double_t DeltaInvMass() const
TH1F * fHistNtrUnCorrPSSel
! hist. of ntracklets for physics selection only selected events
Int_t GetIsSelectedCuts() const
Definition: AliRDHFCuts.h:403
TH1F * fHistoMCNch
weight on the MC on the generated multiplicity (0->no weights, 1->Nch weights, 2->Ntrk weights) ...
TH3F * fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary
! hist of Nch (generated) vs Nch (Primary) vs Nch (Physical Primary)
Bool_t HasSelectionBit(Int_t i) const
Int_t fUseNchWeight
-1: no protection, 0: check AOD/dAOD nEvents only, 1: check AOD/dAOD nEvents + TProcessID names ...
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray, Bool_t isV0=kFALSE) const
TH2F * fHistNtrCorrVsNchMC
! hist of ntracklets vs Nch (Generated)
TH1F * fHistNtrUnCorrEvSel
! hist. of ntracklets for selected events
virtual void UserCreateOutputObjects()
Implementation of interface methods.
Double_t mass
AliAODv0 * Getv0() const
Double_t ImpParXY() const
TH1F * fHistNtrUnCorrPSTrigPileUpVtxRangeSel
! hist. of ntracklets for physics selection + trigger name + pileup + with-vertex-contrib-range selec...
static Int_t CheckMatchingAODdeltaAODevents()
TH2F * fHistNtrEta16vsNtrEta1EvSel
!hist. for Ntracklets in eta<1.6 vs. eta<1.
TH2F * fHistNtrEta03vsNtrEta1EvWithD
!hist. for Ntracklets in eta<0.3 vs. eta<1. for events with a candidate in D mass peak ...
TH2F * fHistNtrVsNchMC
! hist of ntracklets vs Nch (Generated)
Bool_t IsEventRejectedDueToVertexContributors() const
Definition: AliRDHFCuts.h:349
TH1F * fHistNtrCorrPSSel
! hist. of ntracklets for physics selection only selected events
TH2F * fHistNtrEta05vsNtrEta1EvWithD
!hist. for Ntracklets in eta<0.5 vs. eta<1. for events with a candidate in D mass peak ...
Int_t GetWhyRejection() const
Definition: AliRDHFCuts.h:341
AliNormalizationCounter * fCounterU
!Counter for normalization, uncorrected multiplicity
TH1F * fHistNtrUnCorrPSTrigSel
! hist. of ntracklets for physics selection + trigger name selected events
AliNormalizationCounter * fCounterC
Cuts for Analysis.
TH1F * fHistNtrCorrEvWithCand
! hist. of ntracklets for evnts with a candidate
TH1F * fHistNtrCorrEvWithD
! hist. of ntracklets for evnts with a candidate in D mass peak
Int_t fMCPrimariesEstimator
Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2.
void SetMassLimits(Double_t lowlimit, Double_t uplimit)
TH2F * fHistNtrEtaV0MvsV0MEqEvWithCand
!hist. for V0M raw mult vs V0M equalized multiplicity for events with a candidate ...
Int_t fYearNumber
Flag to use the zvtx correction from (0=none, 1=usual d2h, 2=AliESDUtils for VZERO multiplicity) ...
TH1F * fHistNtrUnCorrPSTrigPileUpSel
! hist. of ntracklets for physics selection + trigger name + pileup selected events ...
TH1F * fHistNtrUnCorrEvWithD
! hist. of ntracklets for evnts with a candidate in D mass peak
void FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Int_t countMult, Double_t nchWeight)
static Double_t GetVZEROCEqualizedMultiplicity(AliAODEvent *ev)
Class for cuts on AOD reconstructed D+->Kpipi.
void SetStudyMultiplicity(Bool_t flag, Float_t etaRange)
TH2F * fHistNtrEtaV0AvsNtrEta1EvSel
!hist. for Ntracklets in eta-V0A vs. eta<1.
TH2F * fHistNtrEtaV0MvsNtrEta1EvWithCand
!hist. for Ntracklets in eta-V0M vs. eta<1. for events with a candidate
Bool_t fisPPbData
0=keep all cand, 1=keep only signal, 2= keep only back
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
AliNormalizationCounter * fCounterCandidates
!Counter for normalization, corrected multiplicity for candidates
TH2F * fHistNtrEtaV0MvsV0MEqEvWithD
!hist. for V0M raw mult vs V0M equalized multiplicity with a candidate in D mass peak ...
Int_t fMultiplicityEstimator
flag for Lc in K0sp decay
float Float_t
Definition: External.C:68
TH3F * fPtVsMassVsMultMC
! hist. of Pt vs Mult vs. mass (MC true candidates before reconstruction)
TList * fOutput
! list send on output slot 1
AliAODTrack * GetBachelor() const
TH2F * fHistNtrEtaV0MvsV0MEqEvSel
!hist. for V0M raw mult vs V0M equalized multiplicity
TH2F * fHistNtrEta16vsNtrEta1EvWithD
!hist. for Ntracklets in eta<1.6 vs. eta<1. for events with a candidate in D mass peak ...
TH1F * fHistGenPrimaryParticlesInelGt0
!hist. of geenrated multiplcity
Bool_t IsEventRejectedDueToPileup() const
Definition: AliRDHFCuts.h:358
TH1F * fHistNtrUnCorrEvWithCand
! hist. of ntracklets for evnts with a candidate
TH2F * fHistNtrEtaV0AvsNtrEta1EvWithD
!hist. for Ntracklets in eta-V0A vs. eta<1. for events with a candidate in D mass peak ...
Int_t fNImpParBins
swicth for D impact parameter THnSparse
TH2F * fHistNtrEtaV0AvsNtrEta1EvWithCand
!hist. for Ntracklets in eta-V0A vs. eta<1. for events with a candidate
TProfile * fMultEstimatorAvg[14]
weight histogram on the true measured multiplicity
Int_t fNMassBins
lower inv mass limit for histos
TH2F * fHistNtrEtaV0AvsV0AEqEvSel
!hist. for V0A raw mult vs V0A equalized multiplicity
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)
TH2F * fHistNtrEta05vsNtrEta1EvWithCand
!hist. for Ntracklets in eta<0.5 vs. eta<1. for events with a candidate
Bool_t IsEventRejectedDuePhysicsSelection() const
Definition: AliRDHFCuts.h:379
TH1F * fHistNtrUnCorrPSTrigPileUpVtxRangeCentrSel
! hist. of ntracklets for physics selection + trigger name + pileup + with-vertex-contrib-range + cen...
TH2F * fHistNtrCorrEta1vsNtrRawEta1EvSel
!hist. for Ntracklets in eta<1 with and w/o corrections
Bool_t fLctoV0
pdg code of analyzed meson
TH2F * fHistNtrCorrEta1vsNtrRawEta1EvWithCand
!hist. for Ntracklets in eta<1 with and w/o corrections for events with a candidate ...
TH1F * fHistNtrUnCorrPSTrigPileUpVtxContSel
! hist. of ntracklets for physics selection + trigger name + pileup + with-vertex-contrib selected ev...
Bool_t fUseBit
flag to run on pPb data (differen histogram bining)
static Double_t GetCorrectedNtracklets(TProfile *estimatorAvg, Double_t uncorrectedNacc, Double_t vtxZ, Double_t refMult)
TH3F * fPtVsMassVsMultAntiPart
! hist. of Pt vs Mult vs. mass (antiparticle)
Bool_t IsEventSelected(AliVEvent *event)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
Double_t minMass
THnSparseF * fHistMassPtImpPar[5]
! histograms for impact paramter studies
TH2F * fHistNtrEtaV0AvsV0AEqEvWithCand
!hist. for V0A raw mult vs V0A equalized multiplicity for events with a candidate ...
TH3F * fPtVsMassVsMultNoPid
! hist. of Pt vs Mult vs. mass (no pid)
Bool_t IsSelected(TObject *obj)
Definition: AliRDHFCuts.h:312
TH2F * fHistMultCorrvsMultRawEvWithCand
!hist. for multiplicity with and w/o corrections for events with a candidate
TH2F * fHistNtrEtaV0AvsV0AEqEvWithD
!hist. for V0A raw mult vs V0A equalized multiplicity with a candidate in D mass peak ...
Double_t fLowerImpPar
nunber of bins in impact parameter histos
const char Option_t
Definition: External.C:48
TH2F * fHistNtrCorrVsNchMCPrimary
! hist of ntracklets vs Nch (Primary)
TH2F * fHistNtrEta03vsNtrEta1EvWithCand
!hist. for Ntracklets in eta<0.3 vs. eta<1. for events with a candidate
static Double_t GetVZEROAEqualizedMultiplicity(AliAODEvent *ev)
Utilities for V0 multiplicity checks.
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:343
TH2F * fHistNtrVsZvtx
! hist of ntracklets vs Zvertex
TH1F * fHistNEvents
list of profile histos for z-vtx correction
static Double_t GetTrueImpactParameterDzero(AliAODMCHeader *mcHeader, TClonesArray *arrayMC, AliAODMCParticle *partDp)
Functions for computing true impact parameter of D meson.
const Int_t nbins
Double_t maxMass
TH2F * fHistNtrCorrEta1vsNtrRawEta1EvWithD
!hist. for Ntracklets in eta<1 with and w/o corrections for events with a candidate in D mass peak ...
bool Bool_t
Definition: External.C:53
Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPartCandidate) const
Bool_t fKeepCorrPlots
flag for subtracting D meson daughter contribution to N of tracklets
AliAODRecoDecayHF2Prong * Get2Prong() const
static Double_t GetTrueImpactParameterDplus(AliAODMCHeader *mcHeader, TClonesArray *arrayMC, AliAODMCParticle *partDp)
TProfile * GetEstimatorHistogram(const AliVEvent *event)
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
Definition: AliRDHFCuts.h:338
Double_t fRefMult
TProfile with mult vs. Z per period.
Double_t fLowmasslimit
upper inv mass limit for histos
TH2F * fHistNtrEta16vsNtrEta1EvWithCand
!hist. for Ntracklets in eta<1.6 vs. eta<1. for events with a candidate
Bool_t fReadMC
higher limit in impact parameter (um)
TH3F * fPtVsMassVsMultUncorr
! hist. of Pt vs Mult vs. mass (raw mult)
TH1F * fHistoMeasNch
weight histogram for the MC on the generated multiplicity
TH2F * fHistNtrCorrVsNchMCPhysicalPrimary
! hist of ntracklets vs Nch (Physical Primary)
Int_t fPdgMeson
refrence multiplcity (period b)