AliPhysics  2c6b7ad (2c6b7ad)
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 "AliAODHandler.h"
42 #include "AliAODEvent.h"
43 #include "AliAODVertex.h"
44 #include "AliAODTrack.h"
45 #include "AliAODRecoDecayHF.h"
46 #include "AliAODRecoCascadeHF.h"
47 #include "AliAnalysisVertexingHF.h"
48 #include "AliAnalysisTaskSE.h"
51 #include "AliVertexingHFUtils.h"
52 #include "AliAODVZERO.h"
53 #include "AliESDUtils.h"
54 
58 
59 //________________________________________________________________________
62  fOutput(0),
63  fListCuts(0),
64  fOutputCounters(0),
65  fListProfiles(0),
66  fHistNEvents(0),
67  fHistNtrEta16vsNtrEta1EvSel(0),
68  fHistNtrEta05vsNtrEta1EvSel(0),
69  fHistNtrEta03vsNtrEta1EvSel(0),
70  fHistNtrEtaV0AvsNtrEta1EvSel(0),
71  fHistNtrEtaV0MvsNtrEta1EvSel(0),
72  fHistNtrEtaV0AvsV0AEqEvSel(0),
73  fHistNtrEtaV0MvsV0MEqEvSel(0),
74  fHistNtrCorrEta1vsNtrRawEta1EvSel(0),
75  fHistMultCorrvsMultRawEvSel(0),
76  fHistNtrEta16vsNtrEta1EvWithCand(0),
77  fHistNtrEta05vsNtrEta1EvWithCand(0),
78  fHistNtrEta03vsNtrEta1EvWithCand(0),
79  fHistNtrEtaV0AvsNtrEta1EvWithCand(0),
80  fHistNtrEtaV0MvsNtrEta1EvWithCand(0),
81  fHistNtrEtaV0AvsV0AEqEvWithCand(0),
82  fHistNtrEtaV0MvsV0MEqEvWithCand(0),
83  fHistNtrCorrEta1vsNtrRawEta1EvWithCand(0),
84  fHistMultCorrvsMultRawEvWithCand(0),
85  fHistNtrEta16vsNtrEta1EvWithD(0),
86  fHistNtrEta05vsNtrEta1EvWithD(0),
87  fHistNtrEta03vsNtrEta1EvWithD(0),
88  fHistNtrEtaV0AvsNtrEta1EvWithD(0),
89  fHistNtrEtaV0MvsNtrEta1EvWithD(0),
90  fHistNtrEtaV0AvsV0AEqEvWithD(0),
91  fHistNtrEtaV0MvsV0MEqEvWithD(0),
92  fHistNtrCorrEta1vsNtrRawEta1EvWithD(0),
93  fHistMultCorrvsMultRawEvWithD(0),
94  fHistNtrVsZvtx(0),
95  fHistNtrCorrVsZvtx(0),
96  fHistNtrVsNchMC(0),
97  fHistNtrCorrVsNchMC(0),
98  fHistNtrVsNchMCPrimary(0),
99  fHistNtrCorrVsNchMCPrimary(0),
100  fHistNtrVsNchMCPhysicalPrimary(0),
101  fHistNtrCorrVsNchMCPhysicalPrimary(0),
102  fHistGenPrimaryParticlesInelGt0(0),
103  fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary(0),
104  fHistNtrUnCorrPSSel(0),
105  fHistNtrUnCorrPSTrigSel(0),
106  fHistNtrUnCorrPSTrigPileUpSel(0),
107  fHistNtrUnCorrPSTrigPileUpVtxSel(0),
108  fHistNtrUnCorrPSTrigPileUpVtxContSel(0),
109  fHistNtrUnCorrPSTrigPileUpVtxRangeSel(0),
110  fHistNtrUnCorrPSTrigPileUpVtxRangeCentrSel(0),
111  fHistNtrUnCorrEvSel(0),
112  fHistNtrUnCorrEvWithCand(0),
113  fHistNtrUnCorrEvWithD(0),
114  fHistNtrCorrPSSel(0),
115  fHistNtrCorrEvSel(0),
116  fHistNtrCorrEvWithCand(0),
117  fHistNtrCorrEvWithD(0),
118  fPtVsMassVsMult(0),
119  fPtVsMassVsMultNoPid(0),
120  fPtVsMassVsMultUncorr(0),
121  fPtVsMassVsMultPart(0),
122  fPtVsMassVsMultAntiPart(0),
123  fPtVsMassVsMultMC(0),
124  fUpmasslimit(1.965),
125  fLowmasslimit(1.765),
126  fNMassBins(200),
127  fRDCutsAnalysis(0),
128  fCounterC(0),
129  fCounterU(0),
130  fCounterCandidates(0),
131  fDoImpPar(kFALSE),
132  fNImpParBins(400),
133  fLowerImpPar(-2000.),
134  fHigherImpPar(2000.),
135  fReadMC(kFALSE),
136  fMCOption(0),
137  fisPPbData(kFALSE),
138  fUseBit(kTRUE),
139  fSubtractTrackletsFromDau(kFALSE),
140  fKeepCorrPlots(kFALSE),
141  fAODProtection(1),
142  fUseNchWeight(0),
143  fHistoMCNch(0),
144  fHistoMeasNch(0),
145  fRefMult(9.26),
146  fPdgMeson(411),
147  fMultiplicityEstimator(kNtrk10),
148  fMCPrimariesEstimator(kEta10),
149  fDoVZER0ParamVertexCorr(1),
150  fYearNumber(16)
151 {
153  for(Int_t i=0; i<5; i++) fHistMassPtImpPar[i]=0;
154  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
155 }
156 
157 //________________________________________________________________________
159  AliAnalysisTaskSE(name),
160  fOutput(0),
161  fListCuts(0),
162  fOutputCounters(0),
163  fListProfiles(0),
164  fHistNEvents(0),
192  fHistNtrVsZvtx(0),
194  fHistNtrVsNchMC(0),
216  fPtVsMassVsMult(0),
222  fUpmasslimit(1.965),
223  fLowmasslimit(1.765),
224  fNMassBins(200),
225  fRDCutsAnalysis(cuts),
226  fCounterC(0),
227  fCounterU(0),
229  fDoImpPar(kFALSE),
230  fNImpParBins(400),
231  fLowerImpPar(-2000.),
232  fHigherImpPar(2000.),
233  fReadMC(kFALSE),
234  fMCOption(0),
235  fisPPbData(switchPPb),
236  fUseBit(kTRUE),
238  fKeepCorrPlots(kFALSE),
239  fAODProtection(1),
240  fUseNchWeight(0),
241  fHistoMCNch(0),
242  fHistoMeasNch(0),
243  fRefMult(9.26),
244  fPdgMeson(pdgMeson),
248  fYearNumber(16)
249 {
250  //
252  //
253 
254  for(Int_t i=0; i<5; i++) fHistMassPtImpPar[i]=0;
255  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
256  if(fPdgMeson==413){
257  fNMassBins=200;
258  SetMassLimits(0.12,0.2);
259  }else if(fPdgMeson == 431) {
260  Double_t MassBinSize = 0.002;
261  Int_t nInvMassBins = (Int_t)(0.7/MassBinSize+0.5);
262  Double_t massDs = TDatabasePDG::Instance()->GetParticle(431)->Mass();
263  Double_t minMass = massDs-0.5*nInvMassBins*MassBinSize;
264  Double_t maxMass = massDs+0.5*nInvMassBins*MassBinSize;
265  SetMassLimits(minMass,maxMass);
266  SetNMassBins(nInvMassBins);
267  }else if(fPdgMeson == 4122) {
268  Double_t massLc = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
269  Int_t nInvMassBins = 1000;
270  Double_t minMass = massLc-0.250;
271  Double_t maxMass = massLc+0.250;
272  SetMassLimits(minMass,maxMass);
273  SetNMassBins(nInvMassBins);
274  }
275  else{
276  fNMassBins=200;
278  }
279  // Default constructor
280  // Otput slot #1 writes into a TList container
281  DefineOutput(1,TList::Class()); //My private output
282  // Output slot #2 writes cut to private output
283  DefineOutput(2,TList::Class());
284  // Output slot #3 writes cut to private output
285  DefineOutput(3,TList::Class());
286  // Output slot #4 writes cut to private output
287  DefineOutput(4,TList::Class());
288 }
289 //________________________________________________________________________
291 {
292  //
294  //
295  delete fOutput;
296  delete fHistNEvents;
297  delete fListCuts;
298  delete fListProfiles;
299  delete fRDCutsAnalysis;
300  delete fCounterC;
301  delete fCounterU;
302  delete fCounterCandidates;
303  for(Int_t i=0; i<4; i++) {
304  if (fMultEstimatorAvg[i]) delete fMultEstimatorAvg[i];
305  }
306 
307  for(Int_t i=0; i<5; i++){
308  delete fHistMassPtImpPar[i];
309  }
310  if(fHistoMCNch) delete fHistoMCNch;
311  if(fHistoMeasNch) delete fHistoMeasNch;
312 }
313 
314 //_________________________________________________________________
317  if(uplimit>lowlimit){
318  fLowmasslimit = lowlimit;
319  fUpmasslimit = uplimit;
320  }else{
321  AliError("Wrong mass limits: upper value should be larger than lower one");
322  }
323 }
324 //_________________________________________________________________
327  Double_t mass=TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg))->Mass();
328  SetMassLimits(mass-range,mass+range);
329 }
330 //________________________________________________________________________
332  //
334  //
335  printf("AnalysisTaskSEDvsMultiplicity_0::Init() \n");
336 
337  if(fUseNchWeight && !fReadMC){ AliFatal("Nch weights can only be used in MC mode"); return; }
338  if(fUseNchWeight && !fHistoMCNch){ AliFatal("Nch weights can only be used without histogram"); return; }
339  if(fUseNchWeight==1 && !fHistoMeasNch) {//Nch weights
340  if(fisPPbData){ AliFatal("Nch weights can only be used with MC and data histogram in pPb"); return; }
341  else CreateMeasuredNchHisto();
342  }
343  if(fUseNchWeight==2 && !fHistoMeasNch){ AliFatal("Ntrk weights can only be used with MC and data histogram"); return; } //for pp, pPb Ntrk weights
344 
345 
346  fListCuts=new TList();
347  fListCuts->SetOwner();
348  fListCuts->SetName("CutsList");
349 
350 
351  if(fPdgMeson==411){
352  AliRDHFCutsDplustoKpipi* copycut=new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fRDCutsAnalysis)));
353  copycut->SetName("AnalysisCutsDplus");
354  fListCuts->Add(copycut);
355  }else if(fPdgMeson==421){
356  AliRDHFCutsD0toKpi* copycut=new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fRDCutsAnalysis)));
357  copycut->SetName("AnalysisCutsDzero");
358  fListCuts->Add(copycut);
359  }else if(fPdgMeson==413){
360  AliRDHFCutsDStartoKpipi* copycut=new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fRDCutsAnalysis)));
361  copycut->SetName("AnalysisCutsDStar");
362  fListCuts->Add(copycut);
363  }else if(fPdgMeson==431){
364  AliRDHFCutsDstoKKpi* copycut=new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fRDCutsAnalysis)));
365  copycut->SetName("AnalysisCutsDs");
366  fListCuts->Add(copycut);
367  }else if(fPdgMeson==4122){
368  AliRDHFCutsLctoV0* copycut=new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fRDCutsAnalysis)));
369  copycut->SetName("AnalysisCutsLc2pK0S");
370  fListCuts->Add(copycut);
371  }
374 
375  PostData(2,fListCuts);
376 
377  fListProfiles = new TList();
378  fListProfiles->SetOwner();
379  TString period[4];
380  Int_t nProfiles=4;
381  if (fisPPbData) {
382  if(fYearNumber == 13) {
383  period[0]="LHC13b";
384  period[1]="LHC13c";
385  nProfiles = 2;
386  } else if(fYearNumber == 16) {
387  period[0]="LHC16qt_1stBunch";
388  period[1]="LHC16qt_2ndBunch";
389  period[2]="LHC16qt_3rdBunch";
390  period[3]="LHC16qt_4thBunch";
391  nProfiles = 4;
392  }
393  }
394  else {
395  period[0]="LHC10b";
396  period[1]="LHC10c";
397  period[2]="LHC10d";
398  period[3]="LHC10e";
399  nProfiles = 4;
400  }
401 
402  for(Int_t i=0; i<nProfiles; i++){
403  if(fMultEstimatorAvg[i]){
404  TProfile* hprof=new TProfile(*fMultEstimatorAvg[i]);
405  hprof->SetName(Form("ProfileTrkVsZvtx%s\n",period[i].Data()));
406  fListProfiles->Add(hprof);
407  }
408  }
409 
410  PostData(4,fListProfiles);
411 
412  return;
413 }
414 
415 //________________________________________________________________________
417 {
419  //
420  if(fDebug > 1) printf("AnalysisTaskSEDvsMultiplicity::UserCreateOutputObjects() \n");
421 
422  // Several histograms are more conveniently managed in a TList
423  fOutput = new TList();
424  fOutput->SetOwner();
425  fOutput->SetName("OutputHistos");
426 
427  Int_t nMultBins = 200;
428  Float_t firstMultBin = -0.5;
429  Float_t lastMultBin = 199.5;
430  Int_t nMultBinsNtrk = nMultBins;
431  Float_t lastMultBinNtrk = lastMultBin;
432  Int_t nMultBinsV0 = 400;
433  Float_t lastMultBinV0 = 799.5;
434  const char *estimatorName="tracklets";
435  if(fisPPbData) {
436  nMultBinsNtrk = 375;
437  lastMultBinNtrk = 374.5;
438  nMultBins = nMultBinsNtrk;
439  lastMultBin = lastMultBinNtrk;
440  }
442  nMultBins = nMultBinsV0;
443  lastMultBin = lastMultBinV0;
444  estimatorName = "vzero";
445  }
446 
447  fHistNtrUnCorrPSSel = new TH1F("hNtrUnCorrPSSel",Form("Uncorrected %s multiplicity for PS selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
448  fHistNtrUnCorrPSTrigSel = new TH1F("hNtrUnCorrPSTrigSel",Form("Uncorrected %s multiplicity for PS + trigger name selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
449  fHistNtrUnCorrPSTrigPileUpSel = new TH1F("hNtrUnCorrPSTrigPileUpSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
450  fHistNtrUnCorrPSTrigPileUpVtxSel = new TH1F("hNtrUnCorrPSTrigPileUpVtxSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup + with-vertex selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
451  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);
452  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);
453  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);
454  fHistNtrUnCorrEvSel = new TH1F("hNtrUnCorrEvSel",Form("Uncorrected %s multiplicity for selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
455  fHistNtrUnCorrEvWithCand = new TH1F("hNtrUnCorrEvWithCand",Form("Uncorrected %s multiplicity for events with D candidates; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);// Total multiplicity
456  fHistNtrUnCorrEvWithD = new TH1F("hNtrUnCorrEvWithD",Form("Uncorrected %s multiplicity for events with D in mass region ; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin); //
457  fHistNtrCorrPSSel = new TH1F("hNtrCorrPSSel",Form("Corrected %s multiplicity for PS selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
458  fHistNtrCorrEvSel = new TH1F("hNtrCorrEvSel",Form("Corrected %s multiplicity for selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
459  fHistNtrCorrEvWithCand = new TH1F("hNtrCorrEvWithCand", Form("%s multiplicity for events with D candidates; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);// Total multiplicity
460  fHistNtrCorrEvWithD = new TH1F("hNtrCorrEvWithD", Form("%s multiplicity for events with D in mass region ; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin); //
461 
462  if(fKeepCorrPlots){
463  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
464  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
465  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
466  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
467  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
468  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
469  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
470  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
471  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
472 
473  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
474  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
475  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
476  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
477  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
478  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
479  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
480  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
481  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
482 
483 
484  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
485  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
486  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
487  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
488  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
489  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
490  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
491  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
492  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
493 
494  }
495  fHistNtrVsZvtx = new TH2F("hNtrVsZvtx",Form("N%s vs VtxZ; VtxZ;N_{%s};",estimatorName,estimatorName),300,-15,15,nMultBins,firstMultBin,lastMultBin); //
496  fHistNtrCorrVsZvtx = new TH2F("hNtrCorrVsZvtx",Form("N%s vs VtxZ; VtxZ;N_{%s};",estimatorName,estimatorName),300,-15,15,nMultBins,firstMultBin,lastMultBin); //
497 
498  fHistNtrVsNchMC = new TH2F("hNtrVsNchMC",Form("N%s vs NchMC; Nch;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
499  fHistNtrCorrVsNchMC = new TH2F("hNtrCorrVsNchMC",Form("N%s vs Nch; Nch;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
500 
501  fHistNtrVsNchMCPrimary = new TH2F("hNtrVsNchMCPrimary",Form("N%s vs Nch (Primary); Nch (Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
502  fHistNtrCorrVsNchMCPrimary = new TH2F("hNtrCorrVsNchMCPrimary",Form("N%s vs Nch (Primary); Nch(Primary) ;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
503 
504  fHistNtrVsNchMCPhysicalPrimary = new TH2F("hNtrVsNchMCPhysicalPrimary",Form("N%s vs Nch (Physical Primary); Nch (Physical Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
505  fHistNtrCorrVsNchMCPhysicalPrimary = new TH2F("hNtrCorrVsMCPhysicalPrimary",Form("N%s vs Nch (Physical Primary); Nch (Physical Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
506 
507  fHistGenPrimaryParticlesInelGt0 = new TH1F("hGenPrimaryParticlesInelGt0","Multiplcity of generated charged particles ; Nparticles ; Entries",nMultBins,firstMultBin,lastMultBin);
508 
509  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);
510 
511  fHistNtrUnCorrPSSel->Sumw2();
512  fHistNtrUnCorrPSTrigSel->Sumw2();
518  fHistNtrUnCorrEvSel->Sumw2();
519  fHistNtrUnCorrEvWithCand->Sumw2();
520  fHistNtrUnCorrEvWithD->Sumw2();
521  fHistNtrCorrPSSel->Sumw2();
522  fHistNtrCorrEvSel->Sumw2();
523  fHistNtrCorrEvWithCand->Sumw2();
524  fHistNtrCorrEvWithD->Sumw2();
540  if(fKeepCorrPlots){
568  }
569  fOutput->Add(fHistNtrVsZvtx);
571 
572  fOutput->Add(fHistNtrVsNchMC);
580 
581 
582  fHistNEvents = new TH1F("fHistNEvents", "number of events ",11,-0.5,10.5);
583  fHistNEvents->GetXaxis()->SetBinLabel(1,"nEvents total");
584  fHistNEvents->GetXaxis()->SetBinLabel(2,"nEvents with Z vertex");
585  fHistNEvents->GetXaxis()->SetBinLabel(3,"nEvents selected");
586  fHistNEvents->GetXaxis()->SetBinLabel(4,"Rejected due to trigger");
587  fHistNEvents->GetXaxis()->SetBinLabel(5,"Rejected due to phys sel");
588  fHistNEvents->GetXaxis()->SetBinLabel(6,"Rejected due to vertex cuts");
589  fHistNEvents->GetXaxis()->SetBinLabel(7,"Rejected due to pileup");
590  fHistNEvents->GetXaxis()->SetBinLabel(8,"Total no. of candidate");
591  fHistNEvents->GetXaxis()->SetBinLabel(9,"no. of cand wo bitmask");
592  fHistNEvents->GetXaxis()->SetBinLabel(10,"D after cuts (No PID)");
593  fHistNEvents->GetXaxis()->SetBinLabel(11,"D after cuts + PID)");
594  fHistNEvents->GetXaxis()->SetNdivisions(1,kFALSE);
595  fHistNEvents->Sumw2();
596  fHistNEvents->SetMinimum(0);
597  fOutput->Add(fHistNEvents);
598 
599  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.);
600 
601  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.);
602 
603  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.);
604 
605  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.);
606 
607  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.);
608 
609  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.);
610 
611  fOutput->Add(fPtVsMassVsMult);
617 
619 
620  fCounterC = new AliNormalizationCounter("NormCounterCorrMult");
621  fCounterC->SetStudyMultiplicity(kTRUE,1.);
622  fCounterC->Init();
623 
624  fCounterU = new AliNormalizationCounter("NormCounterUnCorrMult");
625  fCounterU->SetStudyMultiplicity(kTRUE,1.);
626  fCounterU->Init();
627 
628  fCounterCandidates = new AliNormalizationCounter("NormCounterCorrMultCandidates");
631 
632 
633  fOutputCounters = new TList();
634  fOutputCounters->SetOwner();
635  fOutputCounters->SetName("OutputCounters");
639 
640 
641  PostData(1,fOutput);
642  PostData(2,fListCuts);
643  PostData(3,fOutputCounters);
644  PostData(4,fListProfiles);
645 
646  return;
647 }
648 
649 
650 
651 //________________________________________________________________________
653 {
656 
657  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
658 
659  // AliAODTracklets* tracklets = aod->GetTracklets();
660  //Int_t ntracklets = tracklets->GetNumberOfTracklets();
661  if(fAODProtection>=0){
662  // Protection against different number of events in the AOD and deltaAOD
663  // In case of discrepancy the event is rejected.
664  Int_t matchingAODdeltaAODlevel = AliRDHFCuts::CheckMatchingAODdeltaAODevents();
665  if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 && fAODProtection==1)) {
666  // AOD/deltaAOD trees have different number of entries || TProcessID do not match while it was required
667  return;
668  }
669  }
670 
671 
672  TClonesArray *arrayCand = 0;
673  TString arrayName="";
674  UInt_t pdgDau[3];
675  Int_t nDau=0;
676  Int_t selbit=0;
677  if(fPdgMeson==411){
678  arrayName="Charm3Prong";
679  pdgDau[0]=211; pdgDau[1]=321; pdgDau[2]=211;
680  nDau=3;
682  }else if(fPdgMeson==421){
683  arrayName="D0toKpi";
684  pdgDau[0]=211; pdgDau[1]=321; pdgDau[2]=0;
685  nDau=2;
687  }else if(fPdgMeson==413){
688  arrayName="Dstar";
689  pdgDau[0]=321; pdgDau[1]=211; pdgDau[2]=0; // Quoting here D0 daughters (D* ones on another variable later)
690  nDau=2;
692  }else if(fPdgMeson==431){
693  arrayName="Charm3Prong";
694  pdgDau[0]=321; pdgDau[1]=321; pdgDau[2]=211;
695  nDau=3;
696  selbit=AliRDHFCuts::kDsCuts;
697  }else if(fPdgMeson==4122){
698  arrayName="CascadesHF";
699  pdgDau[0]=211; pdgDau[1]=211; pdgDau[2]=0; // Quoting here K0S daughters (Lc ones on another variable later)
700  nDau=2;
702  }
703 
704  if(!aod && AODEvent() && IsStandardAOD()) {
705  // In case there is an AOD handler writing a standard AOD, use the AOD
706  // event in memory rather than the input (ESD) event.
707  aod = dynamic_cast<AliAODEvent*> (AODEvent());
708  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
709  // have to taken from the AOD event hold by the AliAODExtension
710  AliAODHandler* aodHandler = (AliAODHandler*)
711  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
712  if(aodHandler->GetExtensions()) {
713  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
714  AliAODEvent *aodFromExt = ext->GetAOD();
715  arrayCand=(TClonesArray*)aodFromExt->GetList()->FindObject(arrayName.Data());
716  }
717  } else if(aod) {
718  arrayCand=(TClonesArray*)aod->GetList()->FindObject(arrayName.Data());
719  }
720 
721  if(!aod || !arrayCand) {
722  printf("AliAnalysisTaskSEDvsMultiplicity::UserExec: Charm3Prong branch not found!\n");
723  return;
724  }
725 
726  if(fisPPbData && fReadMC){
727  Int_t runnumber = aod->GetRunNumber();
728  if(aod->GetTriggerMask()==0 &&
729  (runnumber>=195344 && runnumber<=195677)){
730  AliDebug(3,"Event rejected because of null trigger mask");
731  return;
732  }
733  }
734 
735 
736  // fix for temporary bug in ESDfilter
737  // the AODs with null vertex pointer didn't pass the PhysSel
738  if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001) return;
739 
740  // Int_t countTreta1=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.);
741  // Int_t countTreta03=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-0.3,0.3);
742  // Int_t countTreta05=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-0.5,0.5);
743  // Int_t countTreta16=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.6,1.6);
744  Int_t countTreta1=0, countTreta03=0, countTreta05=0, countTreta16=0;
745  AliAODTracklets* tracklets=aod->GetTracklets();
746  Int_t nTr=tracklets->GetNumberOfTracklets();
747  for(Int_t iTr=0; iTr<nTr; iTr++){
748  Double_t theta=tracklets->GetTheta(iTr);
749  Double_t eta=-TMath::Log(TMath::Tan(theta/2.));
750  if(eta>-0.3 && eta<0.3) countTreta03++;
751  if(eta>-0.5 && eta<0.5) countTreta05++;
752  if(eta>-1.0 && eta<1.0) countTreta1++;
753  if(eta>-1.6 && eta<1.6) countTreta16++;
754  }
755 
756 
757  Int_t vzeroMult=0, vzeroMultA=0, vzeroMultC=0;
758  Int_t vzeroMultEq=0, vzeroMultAEq=0, vzeroMultCEq=0;
759  AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
760  if(vzeroAOD) {
761  vzeroMultA = static_cast<Int_t>(vzeroAOD->GetMTotV0A());
762  vzeroMultC = static_cast<Int_t>(vzeroAOD->GetMTotV0C());
763  vzeroMult = vzeroMultA + vzeroMultC;
764  vzeroMultAEq = static_cast<Int_t>(AliVertexingHFUtils::GetVZEROAEqualizedMultiplicity(aod));
765  vzeroMultCEq = static_cast<Int_t>(AliVertexingHFUtils::GetVZEROCEqualizedMultiplicity(aod));
766  vzeroMultEq = vzeroMultAEq + vzeroMultCEq;
767  }
768 
769  Int_t countMult = countTreta1;
770  if(fMultiplicityEstimator==kNtrk03) { countMult = countTreta03; }
771  else if(fMultiplicityEstimator==kNtrk05) { countMult = countTreta05; }
772  else if(fMultiplicityEstimator==kNtrk10to16) { countMult = countTreta16 - countTreta1; }
773  else if(fMultiplicityEstimator==kVZERO) { countMult = vzeroMult; }
774  else if(fMultiplicityEstimator==kVZEROA) { countMult = vzeroMultA; }
775  else if(fMultiplicityEstimator==kVZEROEq) { countMult = vzeroMultEq; }
776  else if(fMultiplicityEstimator==kVZEROAEq) { countMult = vzeroMultAEq; }
777 
778 
780  fHistNEvents->Fill(0); // count event
781 
782  Double_t countTreta1corr=countTreta1;
783  Double_t countCorr=countMult;
784  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
785  // In case of VZERO multiplicity, consider the zvtx correction flag
786  // fDoVZER0ParamVertexCorr: 0= none, 1= usual d2h, 2=AliESDUtils
787  Bool_t isDataDrivenZvtxCorr=kTRUE;
788  Bool_t isVtxOk=kFALSE;
789  Int_t vzeroMultACorr=vzeroMultA, vzeroMultCCorr=vzeroMultC, vzeroMultCorr=vzeroMult;
790  Int_t vzeroMultAEqCorr=vzeroMultAEq, vzeroMultCEqCorr=vzeroMultCEq, vzeroMultEqCorr=vzeroMultEq;
791  if(vtx1){
792  if(vtx1->GetNContributors()>0){
793  fHistNEvents->Fill(1);
794  isVtxOk=kTRUE;
795  }
796  }
797  if(isVtxOk){
801  // do not correct
802  isDataDrivenZvtxCorr=kFALSE;
803  } else if (fDoVZER0ParamVertexCorr==2){
804  // use AliESDUtils correction
805  Float_t zvtx = vtx1->GetZ();
806  isDataDrivenZvtxCorr=kFALSE;
807  vzeroMultACorr = static_cast<Int_t>(AliESDUtils::GetCorrV0A(vzeroMultA,zvtx));
808  vzeroMultCCorr = static_cast<Int_t>(AliESDUtils::GetCorrV0C(vzeroMultC,zvtx));
809  vzeroMultCorr = vzeroMultACorr + vzeroMultCCorr;
810  vzeroMultAEqCorr = static_cast<Int_t>(AliESDUtils::GetCorrV0A(vzeroMultAEq,zvtx));
811  vzeroMultCEqCorr =static_cast<Int_t>( AliESDUtils::GetCorrV0C(vzeroMultCEq,zvtx));
812  vzeroMultEqCorr = vzeroMultAEqCorr + vzeroMultCEqCorr;
813  if(fMultiplicityEstimator==kVZERO) { countCorr = vzeroMultCorr; }
814  else if(fMultiplicityEstimator==kVZEROA) { countCorr = vzeroMultACorr; }
815  else if(fMultiplicityEstimator==kVZEROEq) { countCorr = vzeroMultEqCorr; }
816  else if(fMultiplicityEstimator==kVZEROAEq) { countCorr = vzeroMultAEqCorr; }
817  }
818  }
819  }
820  // Data driven multiplicity z-vertex correction
821  if(isVtxOk && isDataDrivenZvtxCorr){
822  TProfile* estimatorAvg = GetEstimatorHistogram(aod);
823  if(estimatorAvg){
824  countTreta1corr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,countTreta1,vtx1->GetZ(),fRefMult));
825  // vzeroMultACorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultA,vtx1->GetZ(),fRefMult));
826  // vzeroMultCorr= vzeroMultACorr + static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultC,vtx1->GetZ(),fRefMult));
827  // vzeroMultAEqCorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultAEq,vtx1->GetZ(),fRefMult));
828  // vzeroMultEqCorr= vzeroMultAEqCorr + static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultCEq,vtx1->GetZ(),fRefMult));
829  countCorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,countMult,vtx1->GetZ(),fRefMult));
830  }
831  }
832 
833 
835 
836  Bool_t isEvSel=fRDCutsAnalysis->IsEventSelected(aod);
837 
838  if(fRDCutsAnalysis->GetWhyRejection()==5) fHistNEvents->Fill(3);
839  if(fRDCutsAnalysis->GetWhyRejection()==7) fHistNEvents->Fill(4);
840  if(fRDCutsAnalysis->GetWhyRejection()==6) fHistNEvents->Fill(5);
841  if(fRDCutsAnalysis->GetWhyRejection()==1) fHistNEvents->Fill(6);
842 
844  Bool_t isEvTrigNameRejected = fRDCutsAnalysis->IsEventRejectedDueToTrigger();
845  Bool_t isEvPileUpRejected = fRDCutsAnalysis->IsEventRejectedDueToPileup();
849  Bool_t isEvCentralityRejected = fRDCutsAnalysis->IsEventRejectedDueToCentrality();
850  if(!isEvPSRejected){
851  fHistNtrUnCorrPSSel->Fill(countMult);
852  fHistNtrCorrPSSel->Fill(countCorr);
853  if(!isEvTrigNameRejected){
854  fHistNtrUnCorrPSTrigSel->Fill(countMult);
855  if(!isEvPileUpRejected){
856  fHistNtrUnCorrPSTrigPileUpSel->Fill(countMult);
857  if(!isEvNoVtxRejected){
858  fHistNtrUnCorrPSTrigPileUpVtxSel->Fill(countMult);
859  if(!isEvVtxContribRejected){
860  fHistNtrUnCorrPSTrigPileUpVtxContSel->Fill(countMult);
861  if(!isEvVtxRangeRejected){
862  fHistNtrUnCorrPSTrigPileUpVtxRangeSel->Fill(countMult);
863  if(!isEvCentralityRejected){
865  }
866  }
867  }
868  }
869  }
870  }
871  }
872 
873  if(!isEvSel)return;
874  fHistNEvents->Fill(2);
875  if(fKeepCorrPlots){
876  fHistNtrEta16vsNtrEta1EvSel->Fill(countTreta1,countTreta16);
877  fHistNtrEta05vsNtrEta1EvSel->Fill(countTreta1,countTreta05);
878  fHistNtrEta03vsNtrEta1EvSel->Fill(countTreta1,countTreta03);
879  fHistNtrEtaV0AvsNtrEta1EvSel->Fill(countTreta1,vzeroMultA);
880  fHistNtrEtaV0MvsNtrEta1EvSel->Fill(countTreta1,vzeroMult);
881  fHistNtrEtaV0AvsV0AEqEvSel->Fill(vzeroMultA,vzeroMultAEq);
882  fHistNtrEtaV0MvsV0MEqEvSel->Fill(vzeroMult,vzeroMultEq);
883  fHistNtrCorrEta1vsNtrRawEta1EvSel->Fill(countTreta1,countTreta1corr);
884  fHistMultCorrvsMultRawEvSel->Fill(countMult,countCorr);
885  }
886  if(vtx1){
887  fHistNtrVsZvtx->Fill(vtx1->GetZ(),countMult);
888  fHistNtrCorrVsZvtx->Fill(vtx1->GetZ(),countCorr);
889  }
890 
891  TClonesArray *arrayMC=0;
892  AliAODMCHeader *mcHeader=0;
893 
894  Double_t nchWeight=1.0;
895 
896  // load MC particles
897  if(fReadMC){
898 
899  arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
900  if(!arrayMC) {
901  printf("AliAnalysisTaskSEDvsMultiplicity::UserExec: MC particles branch not found!\n");
902  return;
903  }
904  // load MC header
905  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
906  if(!mcHeader) {
907  printf("AliAnalysisTaskSEDvsMultiplicity::UserExec: MC header branch not found!\n");
908  return;
909  }
910 
911 
912  // Int_t nChargedMC=AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-1.0,1.0);
913  // Int_t nChargedMCPrimary=AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-1.0,1.0);
914  // Int_t nChargedMCPhysicalPrimary=AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-1.0,1.0);
915  //
916  Int_t nChargedMCEta10=0, nChargedMCEta03=0, nChargedMCEta05=0, nChargedMCEta16=0, nChargedMCEtam37tm17=0, nChargedMCEta28t51=0;
917  Int_t nChargedMCPrimaryEta10=0, nChargedMCPrimaryEta03=0, nChargedMCPrimaryEta05=0, nChargedMCPrimaryEta16=0, nChargedMCPrimaryEtam37tm17=0, nChargedMCPrimaryEta28t51=0;
918  Int_t nChargedMCPhysicalPrimaryEta10=0, nChargedMCPhysicalPrimaryEta03=0, nChargedMCPhysicalPrimaryEta05=0, nChargedMCPhysicalPrimaryEta16=0, nChargedMCPhysicalPrimaryEtam37tm17=0, nChargedMCPhysicalPrimaryEta28t51=0;
919  for(Int_t i=0; i<arrayMC->GetEntriesFast(); i++){
920  AliAODMCParticle *part=(AliAODMCParticle*)arrayMC->UncheckedAt(i);
921  Int_t charge = part->Charge();
922  Double_t eta = part->Eta();
923  Bool_t isPrim = part->IsPrimary();
924  Bool_t isPhysPrim = part->IsPhysicalPrimary();
925  if(charge!=0) {
926  if(eta>-0.3 && eta< 0.3) {
927  nChargedMCEta03++;
928  if(isPrim) nChargedMCPrimaryEta03++;
929  if(isPhysPrim) nChargedMCPhysicalPrimaryEta03++;
930  }
931  if(eta>-0.5 && eta< 0.5) {
932  nChargedMCEta05++;
933  if(isPrim) nChargedMCPrimaryEta05++;
934  if(isPhysPrim) nChargedMCPhysicalPrimaryEta05++;
935  }
936  if(eta>-1.0 && eta< 1.0) {
937  nChargedMCEta10++;
938  if(isPrim) nChargedMCPrimaryEta10++;
939  if(isPhysPrim) nChargedMCPhysicalPrimaryEta10++;
940  }
941  if(eta>-1.6 && eta< 1.6) {
942  nChargedMCEta16++;
943  if(isPrim) nChargedMCPrimaryEta16++;
944  if(isPhysPrim) nChargedMCPhysicalPrimaryEta16++;
945  }
946  if(eta>-3.7 && eta<-1.7) {
947  nChargedMCEtam37tm17++;
948  if(isPrim) nChargedMCPrimaryEtam37tm17++;
949  if(isPhysPrim) nChargedMCPhysicalPrimaryEtam37tm17++;
950  }
951  if(eta> 2.8 && eta< 5.1) {
952  nChargedMCEta28t51++;
953  if(isPrim) nChargedMCPrimaryEta28t51++;
954  if(isPhysPrim) nChargedMCPhysicalPrimaryEta28t51++;
955  }
956  }
957  }
958  Int_t nChargedMC=nChargedMCEta10;
959  Int_t nChargedMCPrimary=nChargedMCPrimaryEta10;
960  Int_t nChargedMCPhysicalPrimary=nChargedMCPhysicalPrimaryEta10;
961 
962  // Compute the Nch weights (reference is Ntracklets within |eta|<1.0)
963  if(fUseNchWeight>0){
964 
965  Double_t tmpweight = 1.0;
966  Double_t tmpXweight=nChargedMCPhysicalPrimary; // Nch weights
967  if(fUseNchWeight==2) tmpXweight=countMult; // Ntrk weights
968 
969  if(tmpXweight<=0) tmpweight = 0.0;
970  else{
971  Double_t pMeas = fHistoMeasNch->GetBinContent(fHistoMeasNch->FindBin(tmpXweight));
972  //printf(" pMeas=%2.2f and histo MCNch %s \n",pMeas,fHistoMCNch);
973  Double_t pMC = fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(tmpXweight));
974  tmpweight = pMC>0 ? pMeas/pMC : 0.;
975  }
976  nchWeight *= tmpweight;
977  AliDebug(2,Form("Using Nch weights, Mult=%f Weight=%f\n",tmpXweight,nchWeight));
978 
979  }
980 
981  // Now recompute the variables in case another MC estimator is considered
982  // Int_t nChargedMCEta10 = nChargedMC;
983  // Int_t nChargedMCEta16 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-1.6,1.6);
984  // Int_t nChargedMCEta05 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-0.5,0.5);
985  // Int_t nChargedMCEta03 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-0.3,0.3);
986  // Int_t nChargedMCEtam37tm17 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-3.7,-1.7);
987  // Int_t nChargedMCEta28t51 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,2.8,5.1);
988  // Int_t nChargedMCPrimaryEta10 = nChargedMCPrimary;
989  // Int_t nChargedMCPrimaryEta16 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-1.6,1.6);
990  // Int_t nChargedMCPrimaryEta05 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-0.5,0.5);
991  // Int_t nChargedMCPrimaryEta03 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-0.3,0.3);
992  // Int_t nChargedMCPrimaryEtam37tm17 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-3.7,-1.7);
993  // Int_t nChargedMCPrimaryEta28t51 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,2.8,5.1);
994  // Int_t nChargedMCPhysicalPrimaryEta10 = nChargedMCPhysicalPrimary;
995  // Int_t nChargedMCPhysicalPrimaryEta16 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-1.6,1.6);
996  // Int_t nChargedMCPhysicalPrimaryEta05 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-0.5,0.5);
997  // Int_t nChargedMCPhysicalPrimaryEta03 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-0.3,0.3);
998  // Int_t nChargedMCPhysicalPrimaryEtam37tm17 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-3.7,-1.7);
999  // Int_t nChargedMCPhysicalPrimaryEta28t51 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,2.8,5.1);
1001  nChargedMC = nChargedMCEta16 - nChargedMCEta10;
1002  nChargedMCPrimary = nChargedMCPrimaryEta16 - nChargedMCPrimaryEta10;
1003  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta16 - nChargedMCPhysicalPrimaryEta10;
1004  } else if(fMCPrimariesEstimator==kEta05){
1005  nChargedMC = nChargedMCEta05;
1006  nChargedMCPrimary = nChargedMCPrimaryEta05;
1007  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta05;
1008  } else if(fMCPrimariesEstimator==kEta03){
1009  nChargedMC = nChargedMCEta03;
1010  nChargedMCPrimary = nChargedMCPrimaryEta03;
1011  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta03;
1012  } else if(fMCPrimariesEstimator==kEtaVZERO){
1013  nChargedMC = nChargedMCEtam37tm17 + nChargedMCEta28t51;
1014  nChargedMCPrimary = nChargedMCPrimaryEtam37tm17 + nChargedMCPrimaryEta28t51;
1015  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEtam37tm17 + nChargedMCPhysicalPrimaryEta28t51;
1016  } else if(fMCPrimariesEstimator==kEtaVZEROA){
1017  nChargedMC = nChargedMCEta28t51;
1018  nChargedMCPrimary = nChargedMCPrimaryEta28t51;
1019  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta28t51;
1020  }
1021 
1022  // Here fill the MC correlation plots
1023  if(nChargedMCPhysicalPrimary>0){ // INEL>0 for |eta|<1
1024  fHistGenPrimaryParticlesInelGt0->Fill(nChargedMCPhysicalPrimary,nchWeight);
1025  }
1026 
1027  fHistNtrVsNchMC->Fill(nChargedMC,countMult,nchWeight);
1028  fHistNtrCorrVsNchMC->Fill(nChargedMC,countCorr,nchWeight);
1029 
1030  fHistNtrVsNchMCPrimary->Fill(nChargedMCPrimary,countMult,nchWeight);
1031  fHistNtrCorrVsNchMCPrimary->Fill(nChargedMCPrimary,countCorr,nchWeight);
1032 
1033  fHistNtrVsNchMCPhysicalPrimary->Fill(nChargedMCPhysicalPrimary,countMult,nchWeight);
1034  fHistNtrCorrVsNchMCPhysicalPrimary->Fill(nChargedMCPhysicalPrimary,countCorr,nchWeight);
1035 
1036  fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary->Fill(nChargedMC,nChargedMCPrimary,nChargedMCPhysicalPrimary,nchWeight);
1037  }
1038 
1039  Int_t nCand = arrayCand->GetEntriesFast();
1040  Int_t nSelectedNoPID=0,nSelectedPID=0,nSelectedInMassPeak=0;
1041  Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
1042  Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
1043  Double_t mDstarPDG = TDatabasePDG::Instance()->GetParticle(413)->Mass();
1044  Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
1045  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
1046 
1047  // pdg of daughters needed for D* too
1048  UInt_t pdgDgDStartoD0pi[2]={421,211};
1049 
1050  // pdg of daughters needed for Lc2pK0S too
1051  UInt_t pdgDgLctopK0S[2]={2212,310};
1052 
1053  Double_t aveMult=0.;
1054  Double_t nSelCand=0.;
1055  for (Int_t iCand = 0; iCand < nCand; iCand++) {
1056  AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayCand->UncheckedAt(iCand);
1057  AliAODRecoCascadeHF *dCascade = NULL;
1058  if(fPdgMeson==413 || fPdgMeson==4122) dCascade = (AliAODRecoCascadeHF*)d;
1059 
1060  if(fPdgMeson==4122) {
1061  AliAODv0 * v0part = (AliAODv0*)dCascade->Getv0();
1062  Bool_t onFlyV0 = v0part->GetOnFlyStatus(); // on-the-flight V0s
1063  if (onFlyV0) continue;
1064  }
1065 
1066  fHistNEvents->Fill(7);
1067  if(fPdgMeson!=4122 && fUseBit && !d->HasSelectionBit(selbit)) {
1068  fHistNEvents->Fill(8);
1069  continue;
1070  }
1071 
1072  Double_t ptCand = d->Pt();
1073  Double_t rapid=d->Y(fPdgMeson);
1074  Bool_t isFidAcc=fRDCutsAnalysis->IsInFiducialAcceptance(ptCand,rapid);
1075  if(!isFidAcc) continue;
1076 
1077  Int_t labD=-1;
1078  if(fReadMC) {
1079  if(fPdgMeson==413){
1080  labD = dCascade->MatchToMC(fPdgMeson,421,(Int_t*)pdgDgDStartoD0pi,(Int_t*)pdgDau,arrayMC);
1081  } else if(fPdgMeson==4122){
1082  labD = dCascade->MatchToMC(fPdgMeson,pdgDgLctopK0S[1],(Int_t*)pdgDgLctopK0S,(Int_t*)pdgDau,arrayMC,kTRUE);
1083  } else {
1084  labD = d->MatchToMC(fPdgMeson,arrayMC,nDau,(Int_t*)pdgDau);
1085  }
1086  FillMCMassHistos(arrayMC,labD, countMult,nchWeight);
1087  }
1088 
1089  Int_t passAllCuts=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kAll,aod);
1091  Int_t passTopolCuts=fRDCutsAnalysis->GetIsSelectedCuts();
1093  if (fPdgMeson != 431 && passTopolCuts==0) continue;
1094  nSelectedNoPID++;
1095  fHistNEvents->Fill(9);
1096  if(fPdgMeson == 431 && passAllCuts==0) continue;
1097  if(passAllCuts){
1098  nSelectedPID++;
1099  fHistNEvents->Fill(10);
1100  }
1101  Double_t multForCand = countCorr;
1102 
1104  if(fPdgMeson==4122) {
1105  // For the Lc2pK0S case, subtract only the proton daughter track <=== FIXME !!
1106  AliAODTrack *t = (AliAODTrack *)dCascade->GetBachelor();
1107  if(!t) continue;
1108  if(t->HasPointOnITSLayer(0) && t->HasPointOnITSLayer(1)){
1109  if(multForCand>0) multForCand-=1;
1110  }
1111  } else {
1112  // For the D* case, subtract only the D0 daughter tracks <=== FIXME !!
1113  AliAODRecoDecayHF2Prong* d0fromDstar = NULL;
1114  if(fPdgMeson==413) d0fromDstar = (AliAODRecoDecayHF2Prong*)dCascade->Get2Prong();
1115 
1116  for(Int_t iDau=0; iDau<nDau; iDau++){
1117  AliAODTrack *t = NULL;
1118  if(fPdgMeson==413){ t = (AliAODTrack*)d0fromDstar->GetDaughter(iDau); }
1119  else{ t = (AliAODTrack*)d->GetDaughter(iDau); }
1120  if(!t) continue;
1121  if(t->HasPointOnITSLayer(0) && t->HasPointOnITSLayer(1)){
1122  if(multForCand>0) multForCand-=1;
1123  }
1124  }
1125  }
1126  }
1127  Bool_t isPrimary=kTRUE;
1128  Double_t trueImpParXY=9999.;
1129  Double_t impparXY=d->ImpParXY()*10000.;
1130  Double_t dlen=0.1; //FIXME
1131  Double_t mass[2];
1132  if(fPdgMeson==411){
1133  mass[0]=d->InvMass(nDau,pdgDau);
1134  mass[1]=-1.;
1135  if(TMath::Abs(mass[0]-mDplusPDG)<0.02) nSelectedInMassPeak++; //20 MeV for now... FIXME
1136  }else if(fPdgMeson==421){
1137  UInt_t pdgdaughtersD0[2]={211,321};//pi,K
1138  UInt_t pdgdaughtersD0bar[2]={321,211};//K,pi
1139  mass[0]=d->InvMass(2,pdgdaughtersD0);
1140  mass[1]=d->InvMass(2,pdgdaughtersD0bar);
1141  if(TMath::Abs(mass[0]-mD0PDG)<0.02 || TMath::Abs(mass[1]-mD0PDG)<0.02 ) nSelectedInMassPeak++; //20 MeV for now... FIXME
1142  }else if(fPdgMeson==413){
1143  // FIXME
1144  mass[0]=dCascade->DeltaInvMass();
1145  mass[1]=-1.;
1146  if(TMath::Abs(mass[0]-(mDstarPDG-mD0PDG))<0.0015) nSelectedInMassPeak++; //1 MeV for now... FIXME
1147  }else if(fPdgMeson==431){
1148  UInt_t pdgDsKKpi[3]={321,321,211};
1149  UInt_t pdgDspiKK[3]={211,321,321};
1150  mass[0]=d->InvMass(nDau,pdgDsKKpi);
1151  mass[1]=d->InvMass(nDau,pdgDspiKK);
1152  if(TMath::Abs(mass[0]-mDsPDG)<0.02 || TMath::Abs(mass[1]-mDsPDG)<0.02 ) nSelectedInMassPeak++; //20 MeV for now... FIXME
1153  }else if(fPdgMeson==4122){
1154  mass[0]=d->InvMass(2,pdgDgLctopK0S);
1155  mass[1]=-1.;
1156  if(TMath::Abs(mass[0]-mLcPDG)<0.02) nSelectedInMassPeak++; //20 MeV for now... FIXME
1157  }
1158 
1159  for(Int_t iHyp=0; iHyp<2; iHyp++){
1160  if(mass[iHyp]<0.) continue; // for D+,D* and Lc2pK0S we have 1 mass hypothesis
1161  Double_t invMass=mass[iHyp];
1162  Double_t arrayForSparse[5]={invMass,ptCand,impparXY,dlen,multForCand};
1163 
1164  if(fReadMC){
1165 
1166  if(fPdgMeson==413){
1167  labD = dCascade->MatchToMC(fPdgMeson,421,(Int_t*)pdgDgDStartoD0pi,(Int_t*)pdgDau,arrayMC);
1168  }else if(fPdgMeson==4122){
1169  labD = dCascade->MatchToMC(fPdgMeson,pdgDgLctopK0S[1],(Int_t*)pdgDgLctopK0S,(Int_t*)pdgDau,arrayMC,kTRUE);
1170  } else {
1171  labD = d->MatchToMC(fPdgMeson,arrayMC,nDau,(Int_t*)pdgDau);
1172  }
1173 
1174  Bool_t fillHisto=fDoImpPar;
1175  if(labD>=0){
1176  AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
1177  Int_t code=partD->GetPdgCode();
1178  if(CheckOrigin(arrayMC,partD)==5) isPrimary=kFALSE;
1179  if(code<0 && iHyp==0) fillHisto=kFALSE;
1180  if(code>0 && iHyp==1) fillHisto=kFALSE;
1181  if(!isPrimary){
1182  if(fPdgMeson==411){
1183  trueImpParXY=AliVertexingHFUtils::GetTrueImpactParameterDplus(mcHeader,arrayMC,partD)*10000.;
1184  }else if(fPdgMeson==421){
1185  trueImpParXY=AliVertexingHFUtils::GetTrueImpactParameterDzero(mcHeader,arrayMC,partD)*10000.;
1186  }else if(fPdgMeson==413 || fPdgMeson==4122){
1187  trueImpParXY=0.;
1188  }
1189  Double_t arrayForSparseTrue[5]={invMass,ptCand,trueImpParXY,dlen,multForCand};
1190  if(fillHisto && passAllCuts){
1191  fHistMassPtImpPar[2]->Fill(arrayForSparse);
1192  fHistMassPtImpPar[3]->Fill(arrayForSparseTrue);
1193  }
1194  }else{
1195  if(fillHisto && passAllCuts) fHistMassPtImpPar[1]->Fill(arrayForSparse);
1196  }
1197  }else{
1198  if(fillHisto && passAllCuts)fHistMassPtImpPar[4]->Fill(arrayForSparse);
1199  }
1200 
1201  if(TMath::Abs(labD)==fPdgMeson && fMCOption==2) continue;
1202  if(TMath::Abs(labD)!=fPdgMeson && fMCOption==1) continue;
1203 
1204  }
1205 
1206  if(fPdgMeson==421){
1207  if(iHyp==0 && !(passTopolCuts&1)) continue; // candidate not passing as D0
1208  if(iHyp==1 && !(passTopolCuts&2)) continue; // candidate not passing as D0bar
1209  }
1210 
1211  if(fPdgMeson != 431) fPtVsMassVsMultNoPid->Fill(multForCand,invMass,ptCand);
1212 
1213  if(fPdgMeson==421){
1214  if(iHyp==0 && !(passAllCuts&1)) continue; // candidate not passing as D0
1215  if(iHyp==1 && !(passAllCuts&2)) continue; // candidate not passing as D0bar
1216  }
1217  if(fPdgMeson==431){
1218  if(iHyp==0 && !(passAllCuts&4)) continue; // candidates Ds not passing as kk(phi)pi
1219  if(iHyp==1 && !(passAllCuts&8)) continue; // candidates Ds not passing as pikk(phi)
1220  }
1221 
1222  if(passAllCuts){
1223  aveMult+=multForCand;
1224  nSelCand+=1.;
1225  fPtVsMassVsMult->Fill(multForCand,invMass,ptCand,nchWeight);
1226  fPtVsMassVsMultUncorr->Fill(countTreta1,invMass,ptCand,nchWeight);
1227  // Add separation between part antipart
1228  if(fPdgMeson==411 || fPdgMeson==413 || fPdgMeson==431 || fPdgMeson==4122){
1229  if(d->GetCharge()>0) fPtVsMassVsMultPart->Fill(multForCand,invMass,ptCand,nchWeight);
1230  else fPtVsMassVsMultAntiPart->Fill(multForCand,invMass,ptCand,nchWeight);
1231  }else if(fPdgMeson==421){
1232  if(passAllCuts&1) fPtVsMassVsMultPart->Fill(multForCand,invMass,ptCand,nchWeight);
1233  if(passAllCuts&2) fPtVsMassVsMultAntiPart->Fill(multForCand,invMass,ptCand,nchWeight);
1234  }
1235 
1236  if(fDoImpPar){
1237  fHistMassPtImpPar[0]->Fill(arrayForSparse);
1238  }
1239 
1240  }
1241 
1242  }
1243  }
1244  if(fSubtractTrackletsFromDau && nSelCand>0){
1245  aveMult/=nSelCand;
1246  fCounterCandidates->StoreEvent(aod,fRDCutsAnalysis,fReadMC,(Int_t)(aveMult+0.5001));
1247  }else{
1249  }
1250 
1251 
1252  fCounterCandidates->StoreCandidates(aod,nSelectedNoPID,kTRUE);
1253  fCounterCandidates->StoreCandidates(aod,nSelectedPID,kFALSE);
1254  fHistNtrUnCorrEvSel->Fill(countMult,nchWeight);
1255  fHistNtrCorrEvSel->Fill(countCorr,nchWeight);
1256  if(nSelectedPID>0) {
1257  fHistNtrUnCorrEvWithCand->Fill(countMult,nchWeight);
1258  fHistNtrCorrEvWithCand->Fill(countCorr,nchWeight);
1259  if(fKeepCorrPlots){
1260  fHistNtrEta16vsNtrEta1EvWithCand->Fill(countTreta1,countTreta16);
1261  fHistNtrEta05vsNtrEta1EvWithCand->Fill(countTreta1,countTreta05);
1262  fHistNtrEta03vsNtrEta1EvWithCand->Fill(countTreta1,countTreta03);
1263  fHistNtrEtaV0AvsNtrEta1EvWithCand->Fill(countTreta1,vzeroMultA);
1264  fHistNtrEtaV0MvsNtrEta1EvWithCand->Fill(countTreta1,vzeroMult);
1265  fHistNtrEtaV0AvsV0AEqEvWithCand->Fill(vzeroMultA,vzeroMultAEq);
1266  fHistNtrEtaV0MvsV0MEqEvWithCand->Fill(vzeroMult,vzeroMultEq);
1267  fHistNtrCorrEta1vsNtrRawEta1EvWithCand->Fill(countTreta1,countTreta1corr);
1268  fHistMultCorrvsMultRawEvWithCand->Fill(countMult,countCorr);
1269  }
1270  }
1271  if(nSelectedInMassPeak>0) {
1272  fHistNtrUnCorrEvWithD->Fill(countMult,nchWeight);
1273  fHistNtrCorrEvWithD->Fill(countCorr,nchWeight);
1274  if(fKeepCorrPlots){
1275  fHistNtrEta16vsNtrEta1EvWithD->Fill(countTreta1,countTreta16);
1276  fHistNtrEta05vsNtrEta1EvWithD->Fill(countTreta1,countTreta05);
1277  fHistNtrEta03vsNtrEta1EvWithD->Fill(countTreta1,countTreta03);
1278  fHistNtrEtaV0AvsNtrEta1EvWithD->Fill(countTreta1,vzeroMultA);
1279  fHistNtrEtaV0MvsNtrEta1EvWithD->Fill(countTreta1,vzeroMult);
1280  fHistNtrEtaV0AvsV0AEqEvWithD->Fill(vzeroMultA,vzeroMultAEq);
1281  fHistNtrEtaV0MvsV0MEqEvWithD->Fill(vzeroMult,vzeroMultEq);
1282  fHistNtrCorrEta1vsNtrRawEta1EvWithD->Fill(countTreta1,countTreta1corr);
1283  fHistMultCorrvsMultRawEvWithD->Fill(countMult,countCorr);
1284  }
1285  }
1286 
1287  PostData(1,fOutput);
1288  PostData(2,fListCuts);
1289  PostData(3,fOutputCounters);
1290 
1291  return;
1292 }
1293 
1294 //________________________________________________________________________
1298 
1299  Int_t nbins[5]={fNMassBins,200,fNImpParBins,50,100};
1300  Double_t xmin[5]={fLowmasslimit,0.,fLowerImpPar,0.,0.};
1301  Double_t xmax[5]={fUpmasslimit,20.,fHigherImpPar,1.,100.};
1302 
1303  fHistMassPtImpPar[0]=new THnSparseF("hMassPtImpParAll",
1304  "Mass vs. pt vs.imppar - All",
1305  5,nbins,xmin,xmax);
1306  fHistMassPtImpPar[1]=new THnSparseF("hMassPtImpParPrompt",
1307  "Mass vs. pt vs.imppar - promptD",
1308  5,nbins,xmin,xmax);
1309  fHistMassPtImpPar[2]=new THnSparseF("hMassPtImpParBfeed",
1310  "Mass vs. pt vs.imppar - DfromB",
1311  5,nbins,xmin,xmax);
1312  fHistMassPtImpPar[3]=new THnSparseF("hMassPtImpParTrueBfeed",
1313  "Mass vs. pt vs.true imppar -DfromB",
1314  5,nbins,xmin,xmax);
1315  fHistMassPtImpPar[4]=new THnSparseF("hMassPtImpParBkg",
1316  "Mass vs. pt vs.imppar - backgr.",
1317  5,nbins,xmin,xmax);
1318  for(Int_t i=0; i<5;i++){
1319  fOutput->Add(fHistMassPtImpPar[i]);
1320  }
1321 }
1322 
1323 //________________________________________________________________________
1325 {
1327  //
1328  if(fDebug > 1) printf("AnalysisTaskSEDvsMultiplicity: Terminate() \n");
1329 
1330  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1331  if (!fOutput) {
1332  printf("ERROR: fOutput not available\n");
1333  return;
1334  }
1335 
1336  fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
1337  if(!fHistNEvents){
1338  printf("ERROR: fHistNEvents not available\n");
1339  return;
1340  }
1341  printf("Number of Analyzed Events = %d\n",(Int_t)fHistNEvents->GetBinContent(3));
1342 
1343  return;
1344 }
1345 //_________________________________________________________________________________________________
1346 Int_t AliAnalysisTaskSEDvsMultiplicity::CheckOrigin(TClonesArray* arrayMC, AliAODMCParticle *mcPartCandidate) const {
1347  //
1349  //
1350 
1351  Int_t pdgGranma = 0;
1352  Int_t mother = 0;
1353  mother = mcPartCandidate->GetMother();
1354  Int_t istep = 0;
1355  Int_t abspdgGranma =0;
1356  Bool_t isFromB=kFALSE;
1357  // Bool_t isQuarkFound=kFALSE;
1358  while (mother >0 ){
1359  istep++;
1360  AliAODMCParticle* mcGranma = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mother));
1361  if (mcGranma){
1362  pdgGranma = mcGranma->GetPdgCode();
1363  abspdgGranma = TMath::Abs(pdgGranma);
1364  if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
1365  isFromB=kTRUE;
1366  }
1367  // if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
1368  mother = mcGranma->GetMother();
1369  }else{
1370  AliError("Failed casting the mother particle!");
1371  break;
1372  }
1373  }
1374 
1375  if(isFromB) return 5;
1376  else return 4;
1377 }
1378 
1379 
1380 
1381 //____________________________________________________________________________
1387 
1388  Int_t runNo = event->GetRunNumber();
1389  Int_t period = -1; // pp: 0-LHC10b, 1-LHC10c, 2-LHC10d, 3-LHC10e
1390  // pPb 2013: 0-LHC13b, 1-LHC13c
1391  // pPb 2016: 0-LHC16q: 265499->265525; 265309->265387, 1-LHC16q:265435, 2-LHC16q:265388->265427, LHC16t: 267163->267166
1392  if (fisPPbData) {
1393  if(fYearNumber==13) {
1394  if (runNo>195343 && runNo<195484) period = 0; //13b
1395  else if (runNo>195528 && runNo<195678) period = 1; //13c
1396  if (period < 0 || period > 1) return 0;
1397  }
1398  else if(fYearNumber==16) {
1399  if ((runNo>=265499 && runNo<=265525) || (runNo>=265309 && runNo<=265387)) period = 0; //16q
1400  else if (runNo == 265435) period = 1; //16q
1401  else if (runNo>=265388 && runNo<=265427) period = 2; //16q
1402  else if (runNo>=267163 && runNo<=267166) period = 3; //16t
1403  if (period < 0 || period > 3) return 0;
1404  }
1405  }
1406  else {
1407  if(runNo>114930 && runNo<117223) period = 0;
1408  if(runNo>119158 && runNo<120830) period = 1;
1409  if(runNo>122373 && runNo<126438) period = 2;
1410  if(runNo>127711 && runNo<130851) period = 3;
1411  if(period<0 || period>3) return 0;
1412 
1413  }
1414 
1415  return fMultEstimatorAvg[period];
1416 }
1417 
1418 //__________________________________________________________________________________________________
1421  //
1422  // for Nch > 70 the points were obtainedwith a double NBD distribution
1423  // 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
1424  // fit1->SetParameter(1,1.63); // k parameter
1425  // fit1->SetParameter(2,12.8); // mean multiplicity
1426  Double_t nchbins[82]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1427  10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1428  20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1429  30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1430  40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1431  50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1432  60.50,62.50,64.50,66.50,68.50,70.50,72.50,74.50,76.50,78.50,
1433  80.50,82.50,84.50,86.50,88.50,90.50,92.50,94.50,96.50,98.50,
1434  100.50,102.50};
1435  Double_t pch[81]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1436  0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1437  0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1438  0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1439  0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1440  0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1441  0.000296,0.000265,0.000193,0.00016,0.000126,0.0000851, 0.0000676,0.0000537,0.0000426, 0.0000338,
1442  0.0000268,0.0000213,0.0000166,0.0000133,0.0000106,0.00000837,0.00000662, 0.00000524,0.00000414, 0.00000327,
1443  0.00000258};
1444 
1445  if(fHistoMeasNch) delete fHistoMeasNch;
1446  fHistoMeasNch=new TH1F("hMeaseNch","",81,nchbins);
1447  for(Int_t i=0; i<81; i++){
1448  fHistoMeasNch->SetBinContent(i+1,pch[i]);
1449  fHistoMeasNch->SetBinError(i+1,0.);
1450  }
1451 }
1452 
1453 //__________________________________________________________________________________________________
1454 void AliAnalysisTaskSEDvsMultiplicity::FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Int_t countMult,Double_t nchWeight)
1455 {
1456  //
1458  //
1459 
1460  if(labD>=0){
1461  AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
1462  Double_t mass = partD->M();
1463  Double_t pt = partD->Pt();
1464  fPtVsMassVsMultMC->Fill(countMult,mass,pt,nchWeight);
1465  }
1466 
1467 }
Int_t charge
Bool_t IsEventRejectedDueToCentrality() const
Definition: AliRDHFCuts.h:335
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:329
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:320
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:370
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:323
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:315
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
pdg code of analyzed meson
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
TProfile * fMultEstimatorAvg[4]
weight histogram on the true measured 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:332
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
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:350
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
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:292
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:317
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:312
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)