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