AliPhysics  9b6b435 (9b6b435)
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<4; 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<4; 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 = 1000;
273  Double_t minMass = massLc-0.250;
274  Double_t maxMass = massLc+0.250;
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<4; 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[4];
389  Int_t nProfiles=4;
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  period[0]="LHC10b";
405  period[1]="LHC10c";
406  period[2]="LHC10d";
407  period[3]="LHC10e";
408  nProfiles = 4;
409  }
410 
411  for(Int_t i=0; i<nProfiles; i++){
412  if(fMultEstimatorAvg[i]){
413  TProfile* hprof=new TProfile(*fMultEstimatorAvg[i]);
414  hprof->SetName(Form("ProfileTrkVsZvtx%s\n",period[i].Data()));
415  fListProfiles->Add(hprof);
416  }
417  }
418 
419  PostData(4,fListProfiles);
420 
421  return;
422 }
423 
424 //________________________________________________________________________
426 {
428  //
429  if(fDebug > 1) printf("AnalysisTaskSEDvsMultiplicity::UserCreateOutputObjects() \n");
430 
431  // Several histograms are more conveniently managed in a TList
432  fOutput = new TList();
433  fOutput->SetOwner();
434  fOutput->SetName("OutputHistos");
435 
436  Int_t nMultBins = 200;
437  Float_t firstMultBin = -0.5;
438  Float_t lastMultBin = 199.5;
439  Int_t nMultBinsNtrk = nMultBins;
440  Float_t lastMultBinNtrk = lastMultBin;
441  Int_t nMultBinsV0 = 400;
442  Float_t lastMultBinV0 = 799.5;
443  const char *estimatorName="tracklets";
444  if(fisPPbData) {
445  nMultBinsNtrk = 375;
446  lastMultBinNtrk = 374.5;
447  nMultBins = nMultBinsNtrk;
448  lastMultBin = lastMultBinNtrk;
449  }
451  nMultBins = nMultBinsV0;
452  lastMultBin = lastMultBinV0;
453  estimatorName = "vzero";
454  }
455 
456  fHistNtrUnCorrPSSel = new TH1F("hNtrUnCorrPSSel",Form("Uncorrected %s multiplicity for PS selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
457  fHistNtrUnCorrPSTrigSel = new TH1F("hNtrUnCorrPSTrigSel",Form("Uncorrected %s multiplicity for PS + trigger name selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
458  fHistNtrUnCorrPSTrigPileUpSel = new TH1F("hNtrUnCorrPSTrigPileUpSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
459  fHistNtrUnCorrPSTrigPileUpVtxSel = new TH1F("hNtrUnCorrPSTrigPileUpVtxSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup + with-vertex selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
460  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);
461  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);
462  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);
463  fHistNtrUnCorrEvSel = new TH1F("hNtrUnCorrEvSel",Form("Uncorrected %s multiplicity for selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
464  fHistNtrUnCorrEvWithCand = new TH1F("hNtrUnCorrEvWithCand",Form("Uncorrected %s multiplicity for events with D candidates; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);// Total multiplicity
465  fHistNtrUnCorrEvWithD = new TH1F("hNtrUnCorrEvWithD",Form("Uncorrected %s multiplicity for events with D in mass region ; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin); //
466  fHistNtrCorrPSSel = new TH1F("hNtrCorrPSSel",Form("Corrected %s multiplicity for PS selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
467  fHistNtrCorrEvSel = new TH1F("hNtrCorrEvSel",Form("Corrected %s multiplicity for selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
468  fHistNtrCorrEvWithCand = new TH1F("hNtrCorrEvWithCand", Form("%s multiplicity for events with D candidates; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);// Total multiplicity
469  fHistNtrCorrEvWithD = new TH1F("hNtrCorrEvWithD", Form("%s multiplicity for events with D in mass region ; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin); //
470 
471  if(fKeepCorrPlots){
472  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
473  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
474  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
475  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
476  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
477  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
478  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
479  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
480  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
481 
482  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
483  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
484  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
485  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
486  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
487  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
488  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
489  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
490  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
491 
492 
493  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
494  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
495  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
496  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
497  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
498  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
499  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
500  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
501  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
502 
503  }
504  fHistNtrVsZvtx = new TH2F("hNtrVsZvtx",Form("N%s vs VtxZ; VtxZ;N_{%s};",estimatorName,estimatorName),300,-15,15,nMultBins,firstMultBin,lastMultBin); //
505  fHistNtrCorrVsZvtx = new TH2F("hNtrCorrVsZvtx",Form("N%s vs VtxZ; VtxZ;N_{%s};",estimatorName,estimatorName),300,-15,15,nMultBins,firstMultBin,lastMultBin); //
506 
507  fHistNtrVsNchMC = new TH2F("hNtrVsNchMC",Form("N%s vs NchMC; Nch;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
508  fHistNtrCorrVsNchMC = new TH2F("hNtrCorrVsNchMC",Form("N%s vs Nch; Nch;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
509 
510  fHistNtrVsNchMCPrimary = new TH2F("hNtrVsNchMCPrimary",Form("N%s vs Nch (Primary); Nch (Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
511  fHistNtrCorrVsNchMCPrimary = new TH2F("hNtrCorrVsNchMCPrimary",Form("N%s vs Nch (Primary); Nch(Primary) ;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
512 
513  fHistNtrVsNchMCPhysicalPrimary = new TH2F("hNtrVsNchMCPhysicalPrimary",Form("N%s vs Nch (Physical Primary); Nch (Physical Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
514  fHistNtrCorrVsNchMCPhysicalPrimary = new TH2F("hNtrCorrVsMCPhysicalPrimary",Form("N%s vs Nch (Physical Primary); Nch (Physical Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
515 
516  fHistGenPrimaryParticlesInelGt0 = new TH1F("hGenPrimaryParticlesInelGt0","Multiplcity of generated charged particles ; Nparticles ; Entries",nMultBins,firstMultBin,lastMultBin);
517 
518  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);
519 
520  fHistNtrUnCorrPSSel->Sumw2();
521  fHistNtrUnCorrPSTrigSel->Sumw2();
527  fHistNtrUnCorrEvSel->Sumw2();
528  fHistNtrUnCorrEvWithCand->Sumw2();
529  fHistNtrUnCorrEvWithD->Sumw2();
530  fHistNtrCorrPSSel->Sumw2();
531  fHistNtrCorrEvSel->Sumw2();
532  fHistNtrCorrEvWithCand->Sumw2();
533  fHistNtrCorrEvWithD->Sumw2();
549  if(fKeepCorrPlots){
577  }
578  fOutput->Add(fHistNtrVsZvtx);
580 
581  fOutput->Add(fHistNtrVsNchMC);
589 
590 
591  fHistNEvents = new TH1F("fHistNEvents", "number of events ",11,-0.5,10.5);
592  fHistNEvents->GetXaxis()->SetBinLabel(1,"nEvents total");
593  fHistNEvents->GetXaxis()->SetBinLabel(2,"nEvents with Z vertex");
594  fHistNEvents->GetXaxis()->SetBinLabel(3,"nEvents selected");
595  fHistNEvents->GetXaxis()->SetBinLabel(4,"Rejected due to trigger");
596  fHistNEvents->GetXaxis()->SetBinLabel(5,"Rejected due to phys sel");
597  fHistNEvents->GetXaxis()->SetBinLabel(6,"Rejected due to vertex cuts");
598  fHistNEvents->GetXaxis()->SetBinLabel(7,"Rejected due to pileup");
599  fHistNEvents->GetXaxis()->SetBinLabel(8,"Total no. of candidate");
600  fHistNEvents->GetXaxis()->SetBinLabel(9,"no. of cand wo bitmask");
601  fHistNEvents->GetXaxis()->SetBinLabel(10,"D after cuts (No PID)");
602  fHistNEvents->GetXaxis()->SetBinLabel(11,"D after cuts + PID)");
603  fHistNEvents->GetXaxis()->SetNdivisions(1,kFALSE);
604  fHistNEvents->Sumw2();
605  fHistNEvents->SetMinimum(0);
606  fOutput->Add(fHistNEvents);
607 
608  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.);
609 
610  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.);
611 
612  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.);
613 
614  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.);
615 
616  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.);
617 
618  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.);
619 
620  fOutput->Add(fPtVsMassVsMult);
626 
628 
629  fCounterC = new AliNormalizationCounter("NormCounterCorrMult");
630  fCounterC->SetStudyMultiplicity(kTRUE,1.);
631  fCounterC->Init();
632 
633  fCounterU = new AliNormalizationCounter("NormCounterUnCorrMult");
634  fCounterU->SetStudyMultiplicity(kTRUE,1.);
635  fCounterU->Init();
636 
637  fCounterCandidates = new AliNormalizationCounter("NormCounterCorrMultCandidates");
640 
641 
642  fOutputCounters = new TList();
643  fOutputCounters->SetOwner();
644  fOutputCounters->SetName("OutputCounters");
648 
649 
650  PostData(1,fOutput);
651  PostData(2,fListCuts);
652  PostData(3,fOutputCounters);
653  PostData(4,fListProfiles);
654 
655  return;
656 }
657 
658 
659 
660 //________________________________________________________________________
662 {
665 
666  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
667 
668  // AliAODTracklets* tracklets = aod->GetTracklets();
669  //Int_t ntracklets = tracklets->GetNumberOfTracklets();
670  if(fAODProtection>=0){
671  // Protection against different number of events in the AOD and deltaAOD
672  // In case of discrepancy the event is rejected.
673  Int_t matchingAODdeltaAODlevel = AliRDHFCuts::CheckMatchingAODdeltaAODevents();
674  if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 && fAODProtection==1)) {
675  // AOD/deltaAOD trees have different number of entries || TProcessID do not match while it was required
676  return;
677  }
678  }
679 
680 
681  TClonesArray *arrayCand = 0;
682  TString arrayName="";
683  UInt_t pdgDau[3];
684  Int_t nDau=0;
685  Int_t selbit=0;
686  if(fPdgMeson==411){
687  arrayName="Charm3Prong";
688  pdgDau[0]=211; pdgDau[1]=321; pdgDau[2]=211;
689  nDau=3;
691  }else if(fPdgMeson==421){
692  arrayName="D0toKpi";
693  pdgDau[0]=211; pdgDau[1]=321; pdgDau[2]=0;
694  nDau=2;
696  }else if(fPdgMeson==413){
697  arrayName="Dstar";
698  pdgDau[0]=321; pdgDau[1]=211; pdgDau[2]=0; // Quoting here D0 daughters (D* ones on another variable later)
699  nDau=2;
701  }else if(fPdgMeson==431){
702  arrayName="Charm3Prong";
703  pdgDau[0]=321; pdgDau[1]=321; pdgDau[2]=211;
704  nDau=3;
705  selbit=AliRDHFCuts::kDsCuts;
706  }else if(fPdgMeson==4122){
707  if(fLctoV0){
708  arrayName="CascadesHF";
709  pdgDau[0]=211; pdgDau[1]=211; pdgDau[2]=0; // Quoting here K0S daughters (Lc ones on another variable later)
710  nDau=2;
712  }else{
713  arrayName="Charm3Prong";
714  pdgDau[0]=2212; pdgDau[1]=321; pdgDau[2]=211;
715  nDau=3;
716  selbit=AliRDHFCuts::kLcCuts;
717  }
718  }
719 
720  if(!aod && AODEvent() && IsStandardAOD()) {
721  // In case there is an AOD handler writing a standard AOD, use the AOD
722  // event in memory rather than the input (ESD) event.
723  aod = dynamic_cast<AliAODEvent*> (AODEvent());
724  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
725  // have to taken from the AOD event hold by the AliAODExtension
726  AliAODHandler* aodHandler = (AliAODHandler*)
727  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
728  if(aodHandler->GetExtensions()) {
729  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
730  AliAODEvent *aodFromExt = ext->GetAOD();
731  arrayCand=(TClonesArray*)aodFromExt->GetList()->FindObject(arrayName.Data());
732  }
733  } else if(aod) {
734  arrayCand=(TClonesArray*)aod->GetList()->FindObject(arrayName.Data());
735  }
736 
737  if(!aod || !arrayCand) {
738  printf("AliAnalysisTaskSEDvsMultiplicity::UserExec: Charm3Prong branch not found!\n");
739  return;
740  }
741 
742  if(fisPPbData && fReadMC){
743  Int_t runnumber = aod->GetRunNumber();
744  if(aod->GetTriggerMask()==0 &&
745  (runnumber>=195344 && runnumber<=195677)){
746  AliDebug(3,"Event rejected because of null trigger mask");
747  return;
748  }
749  }
750 
751 
752  // fix for temporary bug in ESDfilter
753  // the AODs with null vertex pointer didn't pass the PhysSel
754  if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001) return;
755 
756  // Int_t countTreta1=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.);
757  // Int_t countTreta03=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-0.3,0.3);
758  // Int_t countTreta05=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-0.5,0.5);
759  // Int_t countTreta16=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.6,1.6);
760  Int_t countTreta1=0, countTreta03=0, countTreta05=0, countTreta16=0;
761  AliAODTracklets* tracklets=aod->GetTracklets();
762  Int_t nTr=tracklets->GetNumberOfTracklets();
763  for(Int_t iTr=0; iTr<nTr; iTr++){
764  Double_t theta=tracklets->GetTheta(iTr);
765  Double_t eta=-TMath::Log(TMath::Tan(theta/2.));
766  if(eta>-0.3 && eta<0.3) countTreta03++;
767  if(eta>-0.5 && eta<0.5) countTreta05++;
768  if(eta>-1.0 && eta<1.0) countTreta1++;
769  if(eta>-1.6 && eta<1.6) countTreta16++;
770  }
771 
772 
773  Int_t vzeroMult=0, vzeroMultA=0, vzeroMultC=0;
774  Int_t vzeroMultEq=0, vzeroMultAEq=0, vzeroMultCEq=0;
775  AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
776  if(vzeroAOD) {
777  vzeroMultA = static_cast<Int_t>(vzeroAOD->GetMTotV0A());
778  vzeroMultC = static_cast<Int_t>(vzeroAOD->GetMTotV0C());
779  vzeroMult = vzeroMultA + vzeroMultC;
780  vzeroMultAEq = static_cast<Int_t>(AliVertexingHFUtils::GetVZEROAEqualizedMultiplicity(aod));
781  vzeroMultCEq = static_cast<Int_t>(AliVertexingHFUtils::GetVZEROCEqualizedMultiplicity(aod));
782  vzeroMultEq = vzeroMultAEq + vzeroMultCEq;
783  }
784 
785  Int_t countMult = countTreta1;
786  if(fMultiplicityEstimator==kNtrk03) { countMult = countTreta03; }
787  else if(fMultiplicityEstimator==kNtrk05) { countMult = countTreta05; }
788  else if(fMultiplicityEstimator==kNtrk10to16) { countMult = countTreta16 - countTreta1; }
789  else if(fMultiplicityEstimator==kVZERO) { countMult = vzeroMult; }
790  else if(fMultiplicityEstimator==kVZEROA) { countMult = vzeroMultA; }
791  else if(fMultiplicityEstimator==kVZEROEq) { countMult = vzeroMultEq; }
792  else if(fMultiplicityEstimator==kVZEROAEq) { countMult = vzeroMultAEq; }
793 
794 
796  fHistNEvents->Fill(0); // count event
797 
798  Double_t countTreta1corr=countTreta1;
799  Double_t countCorr=countMult;
800  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
801  // In case of VZERO multiplicity, consider the zvtx correction flag
802  // fDoVZER0ParamVertexCorr: 0= none, 1= usual d2h, 2=AliESDUtils
803  Bool_t isDataDrivenZvtxCorr=kTRUE;
804  Bool_t isVtxOk=kFALSE;
805  Int_t vzeroMultACorr=vzeroMultA, vzeroMultCCorr=vzeroMultC, vzeroMultCorr=vzeroMult;
806  Int_t vzeroMultAEqCorr=vzeroMultAEq, vzeroMultCEqCorr=vzeroMultCEq, vzeroMultEqCorr=vzeroMultEq;
807  if(vtx1){
808  if(vtx1->GetNContributors()>0){
809  fHistNEvents->Fill(1);
810  isVtxOk=kTRUE;
811  }
812  }
813  if(isVtxOk){
817  // do not correct
818  isDataDrivenZvtxCorr=kFALSE;
819  } else if (fDoVZER0ParamVertexCorr==2){
820  // use AliESDUtils correction
821  Float_t zvtx = vtx1->GetZ();
822  isDataDrivenZvtxCorr=kFALSE;
823  vzeroMultACorr = static_cast<Int_t>(AliESDUtils::GetCorrV0A(vzeroMultA,zvtx));
824  vzeroMultCCorr = static_cast<Int_t>(AliESDUtils::GetCorrV0C(vzeroMultC,zvtx));
825  vzeroMultCorr = vzeroMultACorr + vzeroMultCCorr;
826  vzeroMultAEqCorr = static_cast<Int_t>(AliESDUtils::GetCorrV0A(vzeroMultAEq,zvtx));
827  vzeroMultCEqCorr =static_cast<Int_t>( AliESDUtils::GetCorrV0C(vzeroMultCEq,zvtx));
828  vzeroMultEqCorr = vzeroMultAEqCorr + vzeroMultCEqCorr;
829  if(fMultiplicityEstimator==kVZERO) { countCorr = vzeroMultCorr; }
830  else if(fMultiplicityEstimator==kVZEROA) { countCorr = vzeroMultACorr; }
831  else if(fMultiplicityEstimator==kVZEROEq) { countCorr = vzeroMultEqCorr; }
832  else if(fMultiplicityEstimator==kVZEROAEq) { countCorr = vzeroMultAEqCorr; }
833  }
834  }
835  }
836  // Data driven multiplicity z-vertex correction
837  if(isVtxOk && isDataDrivenZvtxCorr){
838  TProfile* estimatorAvg = GetEstimatorHistogram(aod);
839  if(estimatorAvg){
840  countTreta1corr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,countTreta1,vtx1->GetZ(),fRefMult));
841  // vzeroMultACorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultA,vtx1->GetZ(),fRefMult));
842  // vzeroMultCorr= vzeroMultACorr + static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultC,vtx1->GetZ(),fRefMult));
843  // vzeroMultAEqCorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultAEq,vtx1->GetZ(),fRefMult));
844  // vzeroMultEqCorr= vzeroMultAEqCorr + static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,vzeroMultCEq,vtx1->GetZ(),fRefMult));
845  countCorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,countMult,vtx1->GetZ(),fRefMult));
846  }
847  }
848 
849 
851 
852  Bool_t isEvSel=fRDCutsAnalysis->IsEventSelected(aod);
853 
854  if(fRDCutsAnalysis->GetWhyRejection()==5) fHistNEvents->Fill(3);
855  if(fRDCutsAnalysis->GetWhyRejection()==7) fHistNEvents->Fill(4);
856  if(fRDCutsAnalysis->GetWhyRejection()==6) fHistNEvents->Fill(5);
857  if(fRDCutsAnalysis->GetWhyRejection()==1) fHistNEvents->Fill(6);
858 
860  Bool_t isEvTrigNameRejected = fRDCutsAnalysis->IsEventRejectedDueToTrigger();
861  Bool_t isEvPileUpRejected = fRDCutsAnalysis->IsEventRejectedDueToPileup();
865  Bool_t isEvCentralityRejected = fRDCutsAnalysis->IsEventRejectedDueToCentrality();
866  if(!isEvPSRejected){
867  fHistNtrUnCorrPSSel->Fill(countMult);
868  fHistNtrCorrPSSel->Fill(countCorr);
869  if(!isEvTrigNameRejected){
870  fHistNtrUnCorrPSTrigSel->Fill(countMult);
871  if(!isEvPileUpRejected){
872  fHistNtrUnCorrPSTrigPileUpSel->Fill(countMult);
873  if(!isEvNoVtxRejected){
874  fHistNtrUnCorrPSTrigPileUpVtxSel->Fill(countMult);
875  if(!isEvVtxContribRejected){
876  fHistNtrUnCorrPSTrigPileUpVtxContSel->Fill(countMult);
877  if(!isEvVtxRangeRejected){
878  fHistNtrUnCorrPSTrigPileUpVtxRangeSel->Fill(countMult);
879  if(!isEvCentralityRejected){
881  }
882  }
883  }
884  }
885  }
886  }
887  }
888 
889  if(!isEvSel)return;
890  fHistNEvents->Fill(2);
891  if(fKeepCorrPlots){
892  fHistNtrEta16vsNtrEta1EvSel->Fill(countTreta1,countTreta16);
893  fHistNtrEta05vsNtrEta1EvSel->Fill(countTreta1,countTreta05);
894  fHistNtrEta03vsNtrEta1EvSel->Fill(countTreta1,countTreta03);
895  fHistNtrEtaV0AvsNtrEta1EvSel->Fill(countTreta1,vzeroMultA);
896  fHistNtrEtaV0MvsNtrEta1EvSel->Fill(countTreta1,vzeroMult);
897  fHistNtrEtaV0AvsV0AEqEvSel->Fill(vzeroMultA,vzeroMultAEq);
898  fHistNtrEtaV0MvsV0MEqEvSel->Fill(vzeroMult,vzeroMultEq);
899  fHistNtrCorrEta1vsNtrRawEta1EvSel->Fill(countTreta1,countTreta1corr);
900  fHistMultCorrvsMultRawEvSel->Fill(countMult,countCorr);
901  }
902  if(vtx1){
903  fHistNtrVsZvtx->Fill(vtx1->GetZ(),countMult);
904  fHistNtrCorrVsZvtx->Fill(vtx1->GetZ(),countCorr);
905  }
906 
907  TClonesArray *arrayMC=0;
908  AliAODMCHeader *mcHeader=0;
909 
910  Double_t nchWeight=1.0;
911 
912  // load MC particles
913  if(fReadMC){
914 
915  arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
916  if(!arrayMC) {
917  printf("AliAnalysisTaskSEDvsMultiplicity::UserExec: MC particles branch not found!\n");
918  return;
919  }
920  // load MC header
921  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
922  if(!mcHeader) {
923  printf("AliAnalysisTaskSEDvsMultiplicity::UserExec: MC header branch not found!\n");
924  return;
925  }
926 
927 
928  // Int_t nChargedMC=AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-1.0,1.0);
929  // Int_t nChargedMCPrimary=AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-1.0,1.0);
930  // Int_t nChargedMCPhysicalPrimary=AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-1.0,1.0);
931  //
932  Int_t nChargedMCEta10=0, nChargedMCEta03=0, nChargedMCEta05=0, nChargedMCEta16=0, nChargedMCEtam37tm17=0, nChargedMCEta28t51=0;
933  Int_t nChargedMCPrimaryEta10=0, nChargedMCPrimaryEta03=0, nChargedMCPrimaryEta05=0, nChargedMCPrimaryEta16=0, nChargedMCPrimaryEtam37tm17=0, nChargedMCPrimaryEta28t51=0;
934  Int_t nChargedMCPhysicalPrimaryEta10=0, nChargedMCPhysicalPrimaryEta03=0, nChargedMCPhysicalPrimaryEta05=0, nChargedMCPhysicalPrimaryEta16=0, nChargedMCPhysicalPrimaryEtam37tm17=0, nChargedMCPhysicalPrimaryEta28t51=0;
935  for(Int_t i=0; i<arrayMC->GetEntriesFast(); i++){
936  AliAODMCParticle *part=(AliAODMCParticle*)arrayMC->UncheckedAt(i);
937  Int_t charge = part->Charge();
938  Double_t eta = part->Eta();
939  Bool_t isPrim = part->IsPrimary();
940  Bool_t isPhysPrim = part->IsPhysicalPrimary();
941  if(charge!=0) {
942  if(eta>-0.3 && eta< 0.3) {
943  nChargedMCEta03++;
944  if(isPrim) nChargedMCPrimaryEta03++;
945  if(isPhysPrim) nChargedMCPhysicalPrimaryEta03++;
946  }
947  if(eta>-0.5 && eta< 0.5) {
948  nChargedMCEta05++;
949  if(isPrim) nChargedMCPrimaryEta05++;
950  if(isPhysPrim) nChargedMCPhysicalPrimaryEta05++;
951  }
952  if(eta>-1.0 && eta< 1.0) {
953  nChargedMCEta10++;
954  if(isPrim) nChargedMCPrimaryEta10++;
955  if(isPhysPrim) nChargedMCPhysicalPrimaryEta10++;
956  }
957  if(eta>-1.6 && eta< 1.6) {
958  nChargedMCEta16++;
959  if(isPrim) nChargedMCPrimaryEta16++;
960  if(isPhysPrim) nChargedMCPhysicalPrimaryEta16++;
961  }
962  if(eta>-3.7 && eta<-1.7) {
963  nChargedMCEtam37tm17++;
964  if(isPrim) nChargedMCPrimaryEtam37tm17++;
965  if(isPhysPrim) nChargedMCPhysicalPrimaryEtam37tm17++;
966  }
967  if(eta> 2.8 && eta< 5.1) {
968  nChargedMCEta28t51++;
969  if(isPrim) nChargedMCPrimaryEta28t51++;
970  if(isPhysPrim) nChargedMCPhysicalPrimaryEta28t51++;
971  }
972  }
973  }
974  Int_t nChargedMC=nChargedMCEta10;
975  Int_t nChargedMCPrimary=nChargedMCPrimaryEta10;
976  Int_t nChargedMCPhysicalPrimary=nChargedMCPhysicalPrimaryEta10;
977 
978  // Compute the Nch weights (reference is Ntracklets within |eta|<1.0)
979  if(fUseNchWeight>0){
980 
981  Double_t tmpweight = 1.0;
982  Double_t tmpXweight=nChargedMCPhysicalPrimary; // Nch weights
983  if(fUseNchWeight==2) tmpXweight=countMult; // Ntrk weights
984 
985  if(tmpXweight<=0) tmpweight = 0.0;
986  else{
987  Double_t pMeas = fHistoMeasNch->GetBinContent(fHistoMeasNch->FindBin(tmpXweight));
988  //printf(" pMeas=%2.2f and histo MCNch %s \n",pMeas,fHistoMCNch);
989  Double_t pMC = fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(tmpXweight));
990  tmpweight = pMC>0 ? pMeas/pMC : 0.;
991  }
992  nchWeight *= tmpweight;
993  AliDebug(2,Form("Using Nch weights, Mult=%f Weight=%f\n",tmpXweight,nchWeight));
994 
995  }
996 
997  // Now recompute the variables in case another MC estimator is considered
998  // Int_t nChargedMCEta10 = nChargedMC;
999  // Int_t nChargedMCEta16 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-1.6,1.6);
1000  // Int_t nChargedMCEta05 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-0.5,0.5);
1001  // Int_t nChargedMCEta03 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-0.3,0.3);
1002  // Int_t nChargedMCEtam37tm17 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,-3.7,-1.7);
1003  // Int_t nChargedMCEta28t51 = AliVertexingHFUtils::GetGeneratedMultiplicityInEtaRange(arrayMC,2.8,5.1);
1004  // Int_t nChargedMCPrimaryEta10 = nChargedMCPrimary;
1005  // Int_t nChargedMCPrimaryEta16 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-1.6,1.6);
1006  // Int_t nChargedMCPrimaryEta05 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-0.5,0.5);
1007  // Int_t nChargedMCPrimaryEta03 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-0.3,0.3);
1008  // Int_t nChargedMCPrimaryEtam37tm17 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,-3.7,-1.7);
1009  // Int_t nChargedMCPrimaryEta28t51 = AliVertexingHFUtils::GetGeneratedPrimariesInEtaRange(arrayMC,2.8,5.1);
1010  // Int_t nChargedMCPhysicalPrimaryEta10 = nChargedMCPhysicalPrimary;
1011  // Int_t nChargedMCPhysicalPrimaryEta16 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-1.6,1.6);
1012  // Int_t nChargedMCPhysicalPrimaryEta05 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-0.5,0.5);
1013  // Int_t nChargedMCPhysicalPrimaryEta03 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-0.3,0.3);
1014  // Int_t nChargedMCPhysicalPrimaryEtam37tm17 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,-3.7,-1.7);
1015  // Int_t nChargedMCPhysicalPrimaryEta28t51 = AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(arrayMC,2.8,5.1);
1017  nChargedMC = nChargedMCEta16 - nChargedMCEta10;
1018  nChargedMCPrimary = nChargedMCPrimaryEta16 - nChargedMCPrimaryEta10;
1019  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta16 - nChargedMCPhysicalPrimaryEta10;
1020  } else if(fMCPrimariesEstimator==kEta05){
1021  nChargedMC = nChargedMCEta05;
1022  nChargedMCPrimary = nChargedMCPrimaryEta05;
1023  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta05;
1024  } else if(fMCPrimariesEstimator==kEta03){
1025  nChargedMC = nChargedMCEta03;
1026  nChargedMCPrimary = nChargedMCPrimaryEta03;
1027  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta03;
1028  } else if(fMCPrimariesEstimator==kEtaVZERO){
1029  nChargedMC = nChargedMCEtam37tm17 + nChargedMCEta28t51;
1030  nChargedMCPrimary = nChargedMCPrimaryEtam37tm17 + nChargedMCPrimaryEta28t51;
1031  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEtam37tm17 + nChargedMCPhysicalPrimaryEta28t51;
1032  } else if(fMCPrimariesEstimator==kEtaVZEROA){
1033  nChargedMC = nChargedMCEta28t51;
1034  nChargedMCPrimary = nChargedMCPrimaryEta28t51;
1035  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta28t51;
1036  }
1037 
1038  // Here fill the MC correlation plots
1039  if(nChargedMCPhysicalPrimary>0){ // INEL>0 for |eta|<1
1040  fHistGenPrimaryParticlesInelGt0->Fill(nChargedMCPhysicalPrimary,nchWeight);
1041  }
1042 
1043  fHistNtrVsNchMC->Fill(nChargedMC,countMult,nchWeight);
1044  fHistNtrCorrVsNchMC->Fill(nChargedMC,countCorr,nchWeight);
1045 
1046  fHistNtrVsNchMCPrimary->Fill(nChargedMCPrimary,countMult,nchWeight);
1047  fHistNtrCorrVsNchMCPrimary->Fill(nChargedMCPrimary,countCorr,nchWeight);
1048 
1049  fHistNtrVsNchMCPhysicalPrimary->Fill(nChargedMCPhysicalPrimary,countMult,nchWeight);
1050  fHistNtrCorrVsNchMCPhysicalPrimary->Fill(nChargedMCPhysicalPrimary,countCorr,nchWeight);
1051 
1052  fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary->Fill(nChargedMC,nChargedMCPrimary,nChargedMCPhysicalPrimary,nchWeight);
1053  }
1054 
1055  Int_t nCand = arrayCand->GetEntriesFast();
1056  Int_t nSelectedNoPID=0,nSelectedPID=0,nSelectedInMassPeak=0;
1057  Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
1058  Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
1059  Double_t mDstarPDG = TDatabasePDG::Instance()->GetParticle(413)->Mass();
1060  Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
1061  Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
1062 
1063  // pdg of daughters needed for D* too
1064  UInt_t pdgDgDStartoD0pi[2]={421,211};
1065 
1066  // pdg of daughters needed for Lc2pK0S too
1067  UInt_t pdgDgLctopK0S[2]={2212,310};
1068 
1069  Double_t aveMult=0.;
1070  Double_t nSelCand=0.;
1071  for (Int_t iCand = 0; iCand < nCand; iCand++) {
1072  AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayCand->UncheckedAt(iCand);
1073  AliAODRecoCascadeHF *dCascade = NULL;
1074  if(fPdgMeson==413 || (fPdgMeson==4122 && fLctoV0)) dCascade = (AliAODRecoCascadeHF*)d;
1075 
1076  fHistNEvents->Fill(7);
1077 
1078  if(fPdgMeson==4122){
1079  if(fLctoV0){
1080  AliAODv0 * v0part = (AliAODv0*)dCascade->Getv0();
1081  Bool_t onFlyV0 = v0part->GetOnFlyStatus(); // on-the-flight V0s
1082  if (onFlyV0){fHistNEvents->Fill(8); continue;}
1083  }else if(!fLctoV0 && fUseBit && !d->HasSelectionBit(selbit)) {
1084  fHistNEvents->Fill(8);
1085  continue;
1086  }
1087  }
1088 
1089  if(fPdgMeson!=4122 && fUseBit && !d->HasSelectionBit(selbit)) {
1090  fHistNEvents->Fill(8);
1091  continue;
1092  }
1093 
1094  Double_t ptCand = d->Pt();
1095  Double_t rapid=d->Y(fPdgMeson);
1096  Bool_t isFidAcc=fRDCutsAnalysis->IsInFiducialAcceptance(ptCand,rapid);
1097  if(!isFidAcc) continue;
1098 
1099  Int_t labD=-1;
1100  if(fReadMC) {
1101  if(fPdgMeson==413){
1102  labD = dCascade->MatchToMC(fPdgMeson,421,(Int_t*)pdgDgDStartoD0pi,(Int_t*)pdgDau,arrayMC);
1103  } else if(fPdgMeson==4122 && fLctoV0){
1104  labD = dCascade->MatchToMC(fPdgMeson,pdgDgLctopK0S[1],(Int_t*)pdgDgLctopK0S,(Int_t*)pdgDau,arrayMC,kTRUE);
1105  } else {
1106  labD = d->MatchToMC(fPdgMeson,arrayMC,nDau,(Int_t*)pdgDau);
1107  }
1108  FillMCMassHistos(arrayMC,labD, countMult,nchWeight);
1109  }
1110 
1111  Int_t passAllCuts=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kAll,aod);
1113  Int_t passTopolCuts=fRDCutsAnalysis->GetIsSelectedCuts();
1114  if (fPdgMeson == 4122){
1116  else passTopolCuts=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kCandidate,aod);
1117  }
1118  if (fPdgMeson != 431 && passTopolCuts==0) continue;
1119  nSelectedNoPID++;
1120  fHistNEvents->Fill(9);
1121  if(fPdgMeson == 431 && passAllCuts==0) continue;
1122  if(passAllCuts){
1123  nSelectedPID++;
1124  fHistNEvents->Fill(10);
1125  }
1126  Double_t multForCand = countCorr;
1127 
1129  if(fPdgMeson==4122 && fLctoV0) {
1130  // For the Lc2pK0S case, subtract only the proton daughter track <=== FIXME !!
1131  AliAODTrack *t = (AliAODTrack *)dCascade->GetBachelor();
1132  if(!t) continue;
1133  if(t->HasPointOnITSLayer(0) && t->HasPointOnITSLayer(1)){
1134  if(multForCand>0) multForCand-=1;
1135  }
1136  } else {
1137  // For the D* case, subtract only the D0 daughter tracks <=== FIXME !!
1138  AliAODRecoDecayHF2Prong* d0fromDstar = NULL;
1139  if(fPdgMeson==413) d0fromDstar = (AliAODRecoDecayHF2Prong*)dCascade->Get2Prong();
1140 
1141  for(Int_t iDau=0; iDau<nDau; iDau++){
1142  AliAODTrack *t = NULL;
1143  if(fPdgMeson==413){ t = (AliAODTrack*)d0fromDstar->GetDaughter(iDau); }
1144  else{ t = (AliAODTrack*)d->GetDaughter(iDau); }
1145  if(!t) continue;
1146  if(t->HasPointOnITSLayer(0) && t->HasPointOnITSLayer(1)){
1147  if(multForCand>0) multForCand-=1;
1148  }
1149  }
1150  }
1151  }
1152  Bool_t isPrimary=kTRUE;
1153  Double_t trueImpParXY=9999.;
1154  Double_t impparXY=d->ImpParXY()*10000.;
1155  Double_t dlen=0.1; //FIXME
1156  Double_t mass[2];
1157  if(fPdgMeson==411){
1158  mass[0]=d->InvMass(nDau,pdgDau);
1159  mass[1]=-1.;
1160  if(TMath::Abs(mass[0]-mDplusPDG)<0.02) nSelectedInMassPeak++; //20 MeV for now... FIXME
1161  }else if(fPdgMeson==421){
1162  UInt_t pdgdaughtersD0[2]={211,321};//pi,K
1163  UInt_t pdgdaughtersD0bar[2]={321,211};//K,pi
1164  mass[0]=d->InvMass(2,pdgdaughtersD0);
1165  mass[1]=d->InvMass(2,pdgdaughtersD0bar);
1166  if(TMath::Abs(mass[0]-mD0PDG)<0.02 || TMath::Abs(mass[1]-mD0PDG)<0.02 ) nSelectedInMassPeak++; //20 MeV for now... FIXME
1167  }else if(fPdgMeson==413){
1168  // FIXME
1169  mass[0]=dCascade->DeltaInvMass();
1170  mass[1]=-1.;
1171  if(TMath::Abs(mass[0]-(mDstarPDG-mD0PDG))<0.0015) nSelectedInMassPeak++; //1 MeV for now... FIXME
1172  }else if(fPdgMeson==431){
1173  UInt_t pdgDsKKpi[3]={321,321,211};
1174  UInt_t pdgDspiKK[3]={211,321,321};
1175  mass[0]=d->InvMass(nDau,pdgDsKKpi);
1176  mass[1]=d->InvMass(nDau,pdgDspiKK);
1177  if(TMath::Abs(mass[0]-mDsPDG)<0.02 || TMath::Abs(mass[1]-mDsPDG)<0.02 ) nSelectedInMassPeak++; //20 MeV for now... FIXME
1178  }else if(fPdgMeson==4122){
1179  if(fLctoV0){
1180  mass[0]=d->InvMass(2,pdgDgLctopK0S);
1181  mass[1]=-1.;
1182  if(TMath::Abs(mass[0]-mLcPDG)<0.02) nSelectedInMassPeak++; //20 MeV for now... FIXME
1183  }else{
1184  UInt_t pdgpKpi[3]={2212,321,211};
1185  UInt_t pdgpiKp[3]={211,321,2212};
1186  if(passTopolCuts==3 || passTopolCuts==1)mass[0]=d->InvMass(3,pdgpKpi);
1187  if(passTopolCuts>=2) mass[1]=d->InvMass(3,pdgpiKp);
1188  if(TMath::Abs(mass[0]-mLcPDG)<0.02) nSelectedInMassPeak++; //20 MeV for now... FIXME
1189  }
1190  }
1191 
1192  for(Int_t iHyp=0; iHyp<2; iHyp++){
1193  if(mass[iHyp]<0.) continue; // for D+,D* and Lc2pK0S we have 1 mass hypothesis
1194  Double_t invMass=mass[iHyp];
1195  Double_t arrayForSparse[5]={invMass,ptCand,impparXY,dlen,multForCand};
1196 
1197  if(fReadMC){
1198 
1199  if(fPdgMeson==413){
1200  labD = dCascade->MatchToMC(fPdgMeson,421,(Int_t*)pdgDgDStartoD0pi,(Int_t*)pdgDau,arrayMC);
1201  }else if(fPdgMeson==4122 && fLctoV0){
1202  labD = dCascade->MatchToMC(fPdgMeson,pdgDgLctopK0S[1],(Int_t*)pdgDgLctopK0S,(Int_t*)pdgDau,arrayMC,kTRUE);
1203  }else {
1204  labD = d->MatchToMC(fPdgMeson,arrayMC,nDau,(Int_t*)pdgDau);
1205  }
1206 
1207  Bool_t fillHisto=fDoImpPar;
1208  if(labD>=0){
1209  AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
1210  Int_t code=partD->GetPdgCode();
1211  if(CheckOrigin(arrayMC,partD)==5) isPrimary=kFALSE;
1212  if(code<0 && iHyp==0) fillHisto=kFALSE;
1213  if(code>0 && iHyp==1) fillHisto=kFALSE;
1214  if(!isPrimary){
1215  if(fPdgMeson==411){
1216  trueImpParXY=AliVertexingHFUtils::GetTrueImpactParameterDplus(mcHeader,arrayMC,partD)*10000.;
1217  }else if(fPdgMeson==421){
1218  trueImpParXY=AliVertexingHFUtils::GetTrueImpactParameterDzero(mcHeader,arrayMC,partD)*10000.;
1219  }else if(fPdgMeson==413 || fPdgMeson==4122){
1220  trueImpParXY=0.;
1221  }
1222  Double_t arrayForSparseTrue[5]={invMass,ptCand,trueImpParXY,dlen,multForCand};
1223  if(fillHisto && passAllCuts){
1224  fHistMassPtImpPar[2]->Fill(arrayForSparse);
1225  fHistMassPtImpPar[3]->Fill(arrayForSparseTrue);
1226  }
1227  }else{
1228  if(fillHisto && passAllCuts) fHistMassPtImpPar[1]->Fill(arrayForSparse);
1229  }
1230  }else{
1231  if(fillHisto && passAllCuts)fHistMassPtImpPar[4]->Fill(arrayForSparse);
1232  }
1233 
1234  if(TMath::Abs(labD)==fPdgMeson && fMCOption==2) continue;
1235  if(TMath::Abs(labD)!=fPdgMeson && fMCOption==1) continue;
1236 
1237  }
1238 
1239  if(fPdgMeson==421){
1240  if(iHyp==0 && !(passTopolCuts&1)) continue; // candidate not passing as D0
1241  if(iHyp==1 && !(passTopolCuts&2)) continue; // candidate not passing as D0bar
1242  }
1243 
1244  if(fPdgMeson != 431) fPtVsMassVsMultNoPid->Fill(multForCand,invMass,ptCand);
1245 
1246  if(fPdgMeson==421){
1247  if(iHyp==0 && !(passAllCuts&1)) continue; // candidate not passing as D0
1248  if(iHyp==1 && !(passAllCuts&2)) continue; // candidate not passing as D0bar
1249  }
1250  if(fPdgMeson==431){
1251  if(iHyp==0 && !(passAllCuts&4)) continue; // candidates Ds not passing as kk(phi)pi
1252  if(iHyp==1 && !(passAllCuts&8)) continue; // candidates Ds not passing as pikk(phi)
1253  }
1254  if(fPdgMeson==4122 && !fLctoV0){
1255  if(iHyp==0 && !(passTopolCuts&1)) continue; // candidate not passing as Lc-> pKpi
1256  if(iHyp==1 && !(passTopolCuts&2)) continue; // candidate not passing as Lc-> piKp
1257  }
1258 
1259  if(passAllCuts){
1260  aveMult+=multForCand;
1261  nSelCand+=1.;
1262  fPtVsMassVsMult->Fill(multForCand,invMass,ptCand,nchWeight);
1263  fPtVsMassVsMultUncorr->Fill(countTreta1,invMass,ptCand,nchWeight);
1264  // Add separation between part antipart
1265  if(fPdgMeson==411 || fPdgMeson==413 || fPdgMeson==431 || fPdgMeson==4122){
1266  if(d->GetCharge()>0) fPtVsMassVsMultPart->Fill(multForCand,invMass,ptCand,nchWeight);
1267  else fPtVsMassVsMultAntiPart->Fill(multForCand,invMass,ptCand,nchWeight);
1268  }else if(fPdgMeson==421){
1269  if(passAllCuts&1) fPtVsMassVsMultPart->Fill(multForCand,invMass,ptCand,nchWeight);
1270  if(passAllCuts&2) fPtVsMassVsMultAntiPart->Fill(multForCand,invMass,ptCand,nchWeight);
1271  }
1272 
1273  if(fDoImpPar){
1274  fHistMassPtImpPar[0]->Fill(arrayForSparse);
1275  }
1276 
1277  }
1278 
1279  }
1280  }
1281  if(fSubtractTrackletsFromDau && nSelCand>0){
1282  aveMult/=nSelCand;
1283  fCounterCandidates->StoreEvent(aod,fRDCutsAnalysis,fReadMC,(Int_t)(aveMult+0.5001));
1284  }else{
1286  }
1287 
1288 
1289  fCounterCandidates->StoreCandidates(aod,nSelectedNoPID,kTRUE);
1290  fCounterCandidates->StoreCandidates(aod,nSelectedPID,kFALSE);
1291  fHistNtrUnCorrEvSel->Fill(countMult,nchWeight);
1292  fHistNtrCorrEvSel->Fill(countCorr,nchWeight);
1293  if(nSelectedPID>0) {
1294  fHistNtrUnCorrEvWithCand->Fill(countMult,nchWeight);
1295  fHistNtrCorrEvWithCand->Fill(countCorr,nchWeight);
1296  if(fKeepCorrPlots){
1297  fHistNtrEta16vsNtrEta1EvWithCand->Fill(countTreta1,countTreta16);
1298  fHistNtrEta05vsNtrEta1EvWithCand->Fill(countTreta1,countTreta05);
1299  fHistNtrEta03vsNtrEta1EvWithCand->Fill(countTreta1,countTreta03);
1300  fHistNtrEtaV0AvsNtrEta1EvWithCand->Fill(countTreta1,vzeroMultA);
1301  fHistNtrEtaV0MvsNtrEta1EvWithCand->Fill(countTreta1,vzeroMult);
1302  fHistNtrEtaV0AvsV0AEqEvWithCand->Fill(vzeroMultA,vzeroMultAEq);
1303  fHistNtrEtaV0MvsV0MEqEvWithCand->Fill(vzeroMult,vzeroMultEq);
1304  fHistNtrCorrEta1vsNtrRawEta1EvWithCand->Fill(countTreta1,countTreta1corr);
1305  fHistMultCorrvsMultRawEvWithCand->Fill(countMult,countCorr);
1306  }
1307  }
1308  if(nSelectedInMassPeak>0) {
1309  fHistNtrUnCorrEvWithD->Fill(countMult,nchWeight);
1310  fHistNtrCorrEvWithD->Fill(countCorr,nchWeight);
1311  if(fKeepCorrPlots){
1312  fHistNtrEta16vsNtrEta1EvWithD->Fill(countTreta1,countTreta16);
1313  fHistNtrEta05vsNtrEta1EvWithD->Fill(countTreta1,countTreta05);
1314  fHistNtrEta03vsNtrEta1EvWithD->Fill(countTreta1,countTreta03);
1315  fHistNtrEtaV0AvsNtrEta1EvWithD->Fill(countTreta1,vzeroMultA);
1316  fHistNtrEtaV0MvsNtrEta1EvWithD->Fill(countTreta1,vzeroMult);
1317  fHistNtrEtaV0AvsV0AEqEvWithD->Fill(vzeroMultA,vzeroMultAEq);
1318  fHistNtrEtaV0MvsV0MEqEvWithD->Fill(vzeroMult,vzeroMultEq);
1319  fHistNtrCorrEta1vsNtrRawEta1EvWithD->Fill(countTreta1,countTreta1corr);
1320  fHistMultCorrvsMultRawEvWithD->Fill(countMult,countCorr);
1321  }
1322  }
1323 
1324  PostData(1,fOutput);
1325  PostData(2,fListCuts);
1326  PostData(3,fOutputCounters);
1327 
1328  return;
1329 }
1330 
1331 //________________________________________________________________________
1335 
1336  Int_t nbins[5]={fNMassBins,200,fNImpParBins,50,100};
1337  Double_t xmin[5]={fLowmasslimit,0.,fLowerImpPar,0.,0.};
1338  Double_t xmax[5]={fUpmasslimit,20.,fHigherImpPar,1.,100.};
1339 
1340  fHistMassPtImpPar[0]=new THnSparseF("hMassPtImpParAll",
1341  "Mass vs. pt vs.imppar - All",
1342  5,nbins,xmin,xmax);
1343  fHistMassPtImpPar[1]=new THnSparseF("hMassPtImpParPrompt",
1344  "Mass vs. pt vs.imppar - promptD",
1345  5,nbins,xmin,xmax);
1346  fHistMassPtImpPar[2]=new THnSparseF("hMassPtImpParBfeed",
1347  "Mass vs. pt vs.imppar - DfromB",
1348  5,nbins,xmin,xmax);
1349  fHistMassPtImpPar[3]=new THnSparseF("hMassPtImpParTrueBfeed",
1350  "Mass vs. pt vs.true imppar -DfromB",
1351  5,nbins,xmin,xmax);
1352  fHistMassPtImpPar[4]=new THnSparseF("hMassPtImpParBkg",
1353  "Mass vs. pt vs.imppar - backgr.",
1354  5,nbins,xmin,xmax);
1355  for(Int_t i=0; i<5;i++){
1356  fOutput->Add(fHistMassPtImpPar[i]);
1357  }
1358 }
1359 
1360 //________________________________________________________________________
1362 {
1364  //
1365  if(fDebug > 1) printf("AnalysisTaskSEDvsMultiplicity: Terminate() \n");
1366 
1367  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1368  if (!fOutput) {
1369  printf("ERROR: fOutput not available\n");
1370  return;
1371  }
1372 
1373  fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
1374  if(!fHistNEvents){
1375  printf("ERROR: fHistNEvents not available\n");
1376  return;
1377  }
1378  printf("Number of Analyzed Events = %d\n",(Int_t)fHistNEvents->GetBinContent(3));
1379 
1380  return;
1381 }
1382 //_________________________________________________________________________________________________
1383 Int_t AliAnalysisTaskSEDvsMultiplicity::CheckOrigin(TClonesArray* arrayMC, AliAODMCParticle *mcPartCandidate) const {
1384  //
1386  //
1387 
1388  Int_t pdgGranma = 0;
1389  Int_t mother = 0;
1390  mother = mcPartCandidate->GetMother();
1391  Int_t istep = 0;
1392  Int_t abspdgGranma =0;
1393  Bool_t isFromB=kFALSE;
1394  // Bool_t isQuarkFound=kFALSE;
1395  while (mother >0 ){
1396  istep++;
1397  AliAODMCParticle* mcGranma = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mother));
1398  if (mcGranma){
1399  pdgGranma = mcGranma->GetPdgCode();
1400  abspdgGranma = TMath::Abs(pdgGranma);
1401  if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
1402  isFromB=kTRUE;
1403  }
1404  // if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
1405  mother = mcGranma->GetMother();
1406  }else{
1407  AliError("Failed casting the mother particle!");
1408  break;
1409  }
1410  }
1411 
1412  if(isFromB) return 5;
1413  else return 4;
1414 }
1415 
1416 
1417 
1418 //____________________________________________________________________________
1424 
1425  Int_t runNo = event->GetRunNumber();
1426  Int_t period = -1; // pp: 0-LHC10b, 1-LHC10c, 2-LHC10d, 3-LHC10e
1427  // pPb 2013: 0-LHC13b, 1-LHC13c
1428  // pPb 2016: 0-LHC16q: 265499->265525; 265309->265387, 1-LHC16q:265435, 2-LHC16q:265388->265427, LHC16t: 267163->267166
1429  if (fisPPbData) {
1430  if(fYearNumber==13) {
1431  if (runNo>195343 && runNo<195484) period = 0; //13b
1432  else if (runNo>195528 && runNo<195678) period = 1; //13c
1433  if (period < 0 || period > 1) return 0;
1434  }
1435  else if(fYearNumber==16) {
1436  if ((runNo>=265499 && runNo<=265525) || (runNo>=265309 && runNo<=265387)) period = 0; //16q
1437  else if (runNo == 265435) period = 1; //16q
1438  else if (runNo>=265388 && runNo<=265427) period = 2; //16q
1439  else if (runNo>=267163 && runNo<=267166) period = 3; //16t
1440  if (period < 0 || period > 3) return 0;
1441  }
1442  }
1443  else {
1444  if(runNo>114930 && runNo<117223) period = 0;
1445  if(runNo>119158 && runNo<120830) period = 1;
1446  if(runNo>122373 && runNo<126438) period = 2;
1447  if(runNo>127711 && runNo<130851) period = 3;
1448  if(period<0 || period>3) return 0;
1449 
1450  }
1451 
1452  return fMultEstimatorAvg[period];
1453 }
1454 
1455 //__________________________________________________________________________________________________
1458  //
1459  // for Nch > 70 the points were obtainedwith a double NBD distribution
1460  // 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
1461  // fit1->SetParameter(1,1.63); // k parameter
1462  // fit1->SetParameter(2,12.8); // mean multiplicity
1463  Double_t nchbins[82]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1464  10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1465  20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1466  30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1467  40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1468  50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1469  60.50,62.50,64.50,66.50,68.50,70.50,72.50,74.50,76.50,78.50,
1470  80.50,82.50,84.50,86.50,88.50,90.50,92.50,94.50,96.50,98.50,
1471  100.50,102.50};
1472  Double_t pch[81]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1473  0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1474  0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1475  0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1476  0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1477  0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1478  0.000296,0.000265,0.000193,0.00016,0.000126,0.0000851, 0.0000676,0.0000537,0.0000426, 0.0000338,
1479  0.0000268,0.0000213,0.0000166,0.0000133,0.0000106,0.00000837,0.00000662, 0.00000524,0.00000414, 0.00000327,
1480  0.00000258};
1481 
1482  if(fHistoMeasNch) delete fHistoMeasNch;
1483  fHistoMeasNch=new TH1F("hMeaseNch","",81,nchbins);
1484  for(Int_t i=0; i<81; i++){
1485  fHistoMeasNch->SetBinContent(i+1,pch[i]);
1486  fHistoMeasNch->SetBinError(i+1,0.);
1487  }
1488 }
1489 
1490 //__________________________________________________________________________________________________
1491 void AliAnalysisTaskSEDvsMultiplicity::FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Int_t countMult,Double_t nchWeight)
1492 {
1493  //
1495  //
1496 
1497  if(labD>=0){
1498  AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
1499  Double_t mass = partD->M();
1500  Double_t pt = partD->Pt();
1501  fPtVsMassVsMultMC->Fill(countMult,mass,pt,nchWeight);
1502  }
1503 
1504 }
Int_t charge
Bool_t IsEventRejectedDueToCentrality() const
Definition: AliRDHFCuts.h:337
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:331
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:322
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:373
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:325
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:317
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
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:334
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:352
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:293
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:319
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:314
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)