AliPhysics  8bb951a (8bb951a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskSEDvsEventShapes.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 AliAnalysisTaskSEDvsEventShapes
20 // AliAnalysisTaskSE for the D meson vs. Event shape analysis in different mutiplicity window
21 // Authors: Renu Bala, Manoj Bhanudas Jadhav
22 //*************************************************************************
23 
24 //Offline Class
25 
26 #include <TClonesArray.h>
27 #include <TCanvas.h>
28 #include <TList.h>
29 #include <TString.h>
30 #include <TDatabasePDG.h>
31 #include <TH1F.h>
32 #include <TH2F.h>
33 #include <TH3F.h>
34 #include <THnSparse.h>
35 #include <TProfile.h>
36 #include "AliAnalysisManager.h"
37 #include "AliRDHFCuts.h"
40 #include "AliRDHFCutsD0toKpi.h"
41 #include "AliAODHandler.h"
42 #include "AliAODEvent.h"
43 #include "AliAODVertex.h"
44 #include "AliAODTrack.h"
45 #include "AliAODRecoDecayHF.h"
46 #include "AliAODRecoCascadeHF.h"
47 #include "AliAnalysisVertexingHF.h"
48 #include "AliAnalysisTaskSE.h"
51 #include "AliVertexingHFUtils.h"
52 #include "AliAODVZERO.h"
53 #include "AliESDUtils.h"
55 
56 //________________________________________________________________________
58 AliAnalysisTaskSE(),
59 fOutput(0),
60 fListCuts(0),
61 fOutputCounters(0),
62 fListProfiles(0),
63 fOutputEffCorr(0),
64 fHistNEvents(0),
65 fHistNtrEta16vsNtrEta1EvSel(0),
66 fHistNtrEta05vsNtrEta1EvSel(0),
67 fHistNtrEta03vsNtrEta1EvSel(0),
68 fHistNtrEtaV0AvsNtrEta1EvSel(0),
69 fHistNtrEtaV0MvsNtrEta1EvSel(0),
70 fHistNtrEtaV0AvsV0AEqEvSel(0),
71 fHistNtrEtaV0MvsV0MEqEvSel(0),
72 fHistNtrCorrEta1vsNtrRawEta1EvSel(0),
73 fHistMultCorrvsMultRawEvSel(0),
74 fHistNtrEta16vsNtrEta1EvWithCand(0),
75 fHistNtrEta05vsNtrEta1EvWithCand(0),
76 fHistNtrEta03vsNtrEta1EvWithCand(0),
77 fHistNtrEtaV0AvsNtrEta1EvWithCand(0),
78 fHistNtrEtaV0MvsNtrEta1EvWithCand(0),
79 fHistNtrEtaV0AvsV0AEqEvWithCand(0),
80 fHistNtrEtaV0MvsV0MEqEvWithCand(0),
81 fHistNtrCorrEta1vsNtrRawEta1EvWithCand(0),
82 fHistMultCorrvsMultRawEvWithCand(0),
83 fHistNtrEta16vsNtrEta1EvWithD(0),
84 fHistNtrEta05vsNtrEta1EvWithD(0),
85 fHistNtrEta03vsNtrEta1EvWithD(0),
86 fHistNtrEtaV0AvsNtrEta1EvWithD(0),
87 fHistNtrEtaV0MvsNtrEta1EvWithD(0),
88 fHistNtrEtaV0AvsV0AEqEvWithD(0),
89 fHistNtrEtaV0MvsV0MEqEvWithD(0),
90 fHistNtrCorrEta1vsNtrRawEta1EvWithD(0),
91 fHistMultCorrvsMultRawEvWithD(0),
92 fHistNtrVsZvtx(0),
93 fHistNtrCorrVsZvtx(0),
94 fHistNtrVsSo(0),
95 fHistNtrCorrVsSo(0),
96 fHistNtrVsNchMC(0),
97 fHistNtrCorrVsNchMC(0),
98 fHistNtrVsNchMCPrimary(0),
99 fHistNtrCorrVsNchMCPrimary(0),
100 fHistNtrVsNchMCPhysicalPrimary(0),
101 fHistNtrCorrVsNchMCPhysicalPrimary(0),
102 fHistGenPrimaryParticlesInelGt0(0),
103 fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary(0),
104 fHistNtrUnCorrPSSel(0),
105 fHistNtrUnCorrPSTrigSel(0),
106 fHistNtrUnCorrPSTrigPileUpSel(0),
107 fHistNtrUnCorrPSTrigPileUpVtxSel(0),
108 fHistNtrUnCorrPSTrigPileUpVtxContSel(0),
109 fHistNtrUnCorrPSTrigPileUpVtxRangeSel(0),
110 fHistNtrUnCorrPSTrigPileUpVtxRangeCentrSel(0),
111 fHistNtrUnCorrEvSel(0),
112 fHistNtrUnCorrEvWithCand(0),
113 fHistNtrUnCorrEvWithD(0),
114 fHistNtrCorrPSSel(0),
115 fHistNtrCorrEvSel(0),
116 fHistNtrCorrEvWithCand(0),
117 fHistNtrCorrEvWithD(0),
118 fSparseSpherocity(0),
119 fSparseSpherocitywithNoPid(0),
120 fMCAccGenPrompt(0),
121 fMCAccGenFeeddown(0),
122 fMCRecoPrompt(0),
123 fMCRecoFeeddown(0),
124 fMCRecoBothPromptFD(0),
125 fPtVsMassVsMultMC(0),
126 fUpmasslimit(1.965),
127 fLowmasslimit(1.765),
128 fNMassBins(200),
129 fRDCutsAnalysis(0),
130 fCounterC(0),
131 fCounterU(0),
132 fCounterCandidates(0),
133 fDoImpPar(kFALSE),
134 fNImpParBins(400),
135 fLowerImpPar(-2000.),
136 fHigherImpPar(2000.),
137 fReadMC(kFALSE),
138 fMCOption(0),
139 fisPPbData(kFALSE),
140 fUseBit(kTRUE),
141 fSubtractTrackletsFromDau(kFALSE),
142 fKeepCorrPlots(kFALSE),
143 fUseNchWeight(0),
144 fHistoMCNch(0),
145 fHistoMeasNch(0),
146 fRefMult(9.26),
147 fPdgMeson(411),
148 fMultiplicityEstimator(kNtrk10),
149 fMCPrimariesEstimator(kEta10),
150 fFillSoSparseChecks(0),
151 fptMin(0.15),
152 fptMax(10.),
153 fetaMin(-0.8),
154 fetaMax(0.8),
155 ffiltbit1(256),
156 ffiltbit2(512),
157 fminMult(3),
158 fphiStepSizeDeg(0.1),
159 fEtaAccCut(0.9),
160 fPtAccCut(0.1),
161 fUseQuarkTag(kTRUE),
162 fCalculateSphericity(kFALSE),
163 fDoVZER0ParamVertexCorr(1)
164 {
165  // Default constructor
166  for(Int_t i=0; i<5; i++) fHistMassPtImpPar[i]=0;
167  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
168 }
169 
170 //________________________________________________________________________
171 AliAnalysisTaskSEDvsEventShapes::AliAnalysisTaskSEDvsEventShapes(const char *name, Int_t pdgMeson,AliRDHFCuts *cuts, Bool_t switchPPb):
172 AliAnalysisTaskSE(name),
173 fOutput(0),
174 fListCuts(0),
175 fOutputCounters(0),
176 fListProfiles(0),
177 fOutputEffCorr(0),
178 fHistNEvents(0),
179 fHistNtrEta16vsNtrEta1EvSel(0),
180 fHistNtrEta05vsNtrEta1EvSel(0),
181 fHistNtrEta03vsNtrEta1EvSel(0),
182 fHistNtrEtaV0AvsNtrEta1EvSel(0),
183 fHistNtrEtaV0MvsNtrEta1EvSel(0),
184 fHistNtrEtaV0AvsV0AEqEvSel(0),
185 fHistNtrEtaV0MvsV0MEqEvSel(0),
186 fHistNtrCorrEta1vsNtrRawEta1EvSel(0),
187 fHistMultCorrvsMultRawEvSel(0),
188 fHistNtrEta16vsNtrEta1EvWithCand(0),
189 fHistNtrEta05vsNtrEta1EvWithCand(0),
190 fHistNtrEta03vsNtrEta1EvWithCand(0),
191 fHistNtrEtaV0AvsNtrEta1EvWithCand(0),
192 fHistNtrEtaV0MvsNtrEta1EvWithCand(0),
193 fHistNtrEtaV0AvsV0AEqEvWithCand(0),
194 fHistNtrEtaV0MvsV0MEqEvWithCand(0),
195 fHistNtrCorrEta1vsNtrRawEta1EvWithCand(0),
196 fHistMultCorrvsMultRawEvWithCand(0),
197 fHistNtrEta16vsNtrEta1EvWithD(0),
198 fHistNtrEta05vsNtrEta1EvWithD(0),
199 fHistNtrEta03vsNtrEta1EvWithD(0),
200 fHistNtrEtaV0AvsNtrEta1EvWithD(0),
201 fHistNtrEtaV0MvsNtrEta1EvWithD(0),
202 fHistNtrEtaV0AvsV0AEqEvWithD(0),
203 fHistNtrEtaV0MvsV0MEqEvWithD(0),
204 fHistNtrCorrEta1vsNtrRawEta1EvWithD(0),
205 fHistMultCorrvsMultRawEvWithD(0),
206 fHistNtrVsZvtx(0),
207 fHistNtrCorrVsZvtx(0),
208 fHistNtrVsSo(0),
209 fHistNtrCorrVsSo(0),
210 fHistNtrVsNchMC(0),
211 fHistNtrCorrVsNchMC(0),
212 fHistNtrVsNchMCPrimary(0),
213 fHistNtrCorrVsNchMCPrimary(0),
214 fHistNtrVsNchMCPhysicalPrimary(0),
215 fHistNtrCorrVsNchMCPhysicalPrimary(0),
216 fHistGenPrimaryParticlesInelGt0(0),
217 fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary(0),
218 fHistNtrUnCorrPSSel(0),
219 fHistNtrUnCorrPSTrigSel(0),
220 fHistNtrUnCorrPSTrigPileUpSel(0),
221 fHistNtrUnCorrPSTrigPileUpVtxSel(0),
222 fHistNtrUnCorrPSTrigPileUpVtxContSel(0),
223 fHistNtrUnCorrPSTrigPileUpVtxRangeSel(0),
224 fHistNtrUnCorrPSTrigPileUpVtxRangeCentrSel(0),
225 fHistNtrUnCorrEvSel(0),
226 fHistNtrUnCorrEvWithCand(0),
227 fHistNtrUnCorrEvWithD(0),
228 fHistNtrCorrPSSel(0),
229 fHistNtrCorrEvSel(0),
230 fHistNtrCorrEvWithCand(0),
231 fHistNtrCorrEvWithD(0),
232 fSparseSpherocity(0),
233 fSparseSpherocitywithNoPid(0),
234 fMCAccGenPrompt(0),
235 fMCAccGenFeeddown(0),
236 fMCRecoPrompt(0),
237 fMCRecoFeeddown(0),
238 fMCRecoBothPromptFD(0),
239 fPtVsMassVsMultMC(0),
240 fUpmasslimit(1.965),
241 fLowmasslimit(1.765),
242 fNMassBins(200),
243 fRDCutsAnalysis(cuts),
244 fCounterC(0),
245 fCounterU(0),
246 fCounterCandidates(0),
247 fDoImpPar(kFALSE),
248 fNImpParBins(400),
249 fLowerImpPar(-2000.),
250 fHigherImpPar(2000.),
251 fReadMC(kFALSE),
252 fMCOption(0),
253 fisPPbData(switchPPb),
254 fUseBit(kTRUE),
255 fSubtractTrackletsFromDau(kFALSE),
256 fKeepCorrPlots(kFALSE),
257 fUseNchWeight(0),
258 fHistoMCNch(0),
259 fHistoMeasNch(0),
260 fRefMult(9.26),
261 fPdgMeson(pdgMeson),
262 fMultiplicityEstimator(kNtrk10),
263 fMCPrimariesEstimator(kEta10),
264 fFillSoSparseChecks(0),
265 fptMin(0.15),
266 fptMax(10.),
267 fetaMin(-0.8),
268 fetaMax(0.8),
269 ffiltbit1(256),
270 ffiltbit2(512),
271 fminMult(3),
272 fphiStepSizeDeg(0.1),
273 fEtaAccCut(0.9),
274 fPtAccCut(0.1),
275 fUseQuarkTag(kTRUE),
276 fCalculateSphericity(kFALSE),
277 fDoVZER0ParamVertexCorr(1)
278 {
279  //
280  // Standard constructor
281  //
282 
283  for(Int_t i=0; i<5; i++) fHistMassPtImpPar[i]=0;
284  for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
285  if(fPdgMeson==413){
286  fNMassBins=200;
287  SetMassLimits(0.12,0.2);
288  }else{
289  fNMassBins=200;
291  }
292  // Default constructor
293  // Otput slot #1 writes into a TList container
294  DefineOutput(1,TList::Class()); //My private output
295  // Output slot #2 writes cut to private output
296  DefineOutput(2,TList::Class());
297  // Output slot #3 writes cut to private output
298  DefineOutput(3,TList::Class());
299  // Output slot #4 writes cut to private output
300  DefineOutput(4,TList::Class());
301  // Output slot #5 writes cut to private output
302  DefineOutput(5,TList::Class());
303 }
304 //________________________________________________________________________
306 {
307  //
308  // Destructor
309  //
310  delete fOutput;
311  delete fHistNEvents;
312  delete fListCuts;
313  delete fListProfiles;
314  delete fOutputEffCorr;
315  delete fRDCutsAnalysis;
316  delete fCounterC;
317  delete fCounterU;
318  delete fCounterCandidates;
319 
320  for(Int_t i=0; i<4; i++) {
321  if (fMultEstimatorAvg[i]) delete fMultEstimatorAvg[i];
322  }
323 
324  for(Int_t i=0; i<5; i++){
325  delete fHistMassPtImpPar[i];
326  }
327  if(fHistoMCNch) delete fHistoMCNch;
328  if(fHistoMeasNch) delete fHistoMeasNch;
329 }
330 
331 //_________________________________________________________________
332 void AliAnalysisTaskSEDvsEventShapes::SetMassLimits(Double_t lowlimit, Double_t uplimit){
333  // set invariant mass limits
334  if(uplimit>lowlimit){
335  fLowmasslimit = lowlimit;
336  fUpmasslimit = uplimit;
337  }else{
338  AliError("Wrong mass limits: upper value should be larger than lower one");
339  }
340 }
341 //_________________________________________________________________
343  // set invariant mass limits
344  Double_t mass=TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg))->Mass();
345  SetMassLimits(mass-range,mass+range);
346 }
347 //________________________________________________________________________
349  //
350  // Initialization
351  //
352  printf("AnalysisTaskSEDvsMultiplicity_0::Init() \n");
353 
354  if(fUseNchWeight && !fReadMC){ AliFatal("Nch weights can only be used in MC mode"); return; }
355  if(fUseNchWeight && !fHistoMCNch){ AliFatal("Nch weights can only be used without histogram"); return; }
356  if(fUseNchWeight==1 && !fHistoMeasNch) {//Nch weights
357  if(fisPPbData){ AliFatal("Nch weights can only be used with MC and data histogram in pPb"); return; }
358  else CreateMeasuredNchHisto();
359  }
360  if(fUseNchWeight==2 && !fHistoMeasNch){ AliFatal("Ntrk weights can only be used with MC and data histogram"); return; } //for pp, pPb Ntrk weights
361 
362  fListCuts=new TList();
363  fListCuts->SetOwner();
364  fListCuts->SetName("CutsList");
365 
366  if(fPdgMeson==411){
367  AliRDHFCutsDplustoKpipi* copycut=new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fRDCutsAnalysis)));
368  copycut->SetName("AnalysisCutsDplus");
369  fListCuts->Add(copycut);
370  }else if(fPdgMeson==421){
371  AliRDHFCutsD0toKpi* copycut=new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fRDCutsAnalysis)));
372  copycut->SetName("AnalysisCutsDzero");
373  fListCuts->Add(copycut);
374  }else if(fPdgMeson==413){
375  AliRDHFCutsDStartoKpipi* copycut=new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fRDCutsAnalysis)));
376  copycut->SetName("AnalysisCutsDStar");
377  fListCuts->Add(copycut);
378  }
381 
382  PostData(2,fListCuts);
383 
384  fListProfiles = new TList();
385  fListProfiles->SetOwner();
386  TString period[4];
387  Int_t nProfiles=4;
388  if (fisPPbData) {period[0]="LHC13b"; period[1]="LHC13c"; nProfiles = 2;}
389  else {period[0]="LHC10b"; period[1]="LHC10c"; period[2]="LHC10d"; period[3]="LHC10e"; nProfiles = 4;}
390 
391  for(Int_t i=0; i<nProfiles; i++){
392  if(fMultEstimatorAvg[i]){
393  TProfile* hprof=new TProfile(*fMultEstimatorAvg[i]);
394  hprof->SetName(Form("ProfileTrkVsZvtx%s\n",period[i].Data()));
395  fListProfiles->Add(hprof);
396  }
397  }
398 
399  PostData(4,fListProfiles);
400 
401  return;
402 }
403 
404 //________________________________________________________________________
406 {
407  // Create the output container
408  //
409  if(fDebug > 1) printf("AnalysisTaskSEDvsMultiplicity::UserCreateOutputObjects() \n");
410 
411  // Several histograms are more conveniently managed in a TList
412  fOutput = new TList();
413  fOutput->SetOwner();
414  fOutput->SetName("OutputHistos");
415 
416  fOutputEffCorr = new TList();
417  fOutputEffCorr->SetOwner();
418  fOutputEffCorr->SetName("OutputEffCorrHistos");
419 
420  Int_t nMultBins = 200;
421  Float_t firstMultBin = -0.5;
422  Float_t lastMultBin = 199.5;
423  Int_t nMultBinsNtrk = nMultBins;
424  Float_t lastMultBinNtrk = lastMultBin;
425  Int_t nMultBinsV0 = 400;
426  Float_t lastMultBinV0 = 799.5;
427  const char *estimatorName="tracklets";
428  if(fisPPbData) {
429  nMultBinsNtrk = 375;
430  lastMultBinNtrk = 374.5;
431  nMultBins = nMultBinsNtrk;
432  lastMultBin = lastMultBinNtrk;
433  }
435  nMultBins = nMultBinsV0;
436  lastMultBin = lastMultBinV0;
437  estimatorName = "vzero";
438  }
439 
440  fHistNtrUnCorrPSSel = new TH1F("hNtrUnCorrPSSel",Form("Uncorrected %s multiplicity for PS selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
441  fHistNtrUnCorrPSTrigSel = new TH1F("hNtrUnCorrPSTrigSel",Form("Uncorrected %s multiplicity for PS + trigger name selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
442  fHistNtrUnCorrPSTrigPileUpSel = new TH1F("hNtrUnCorrPSTrigPileUpSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
443  fHistNtrUnCorrPSTrigPileUpVtxSel = new TH1F("hNtrUnCorrPSTrigPileUpVtxSel",Form("Uncorrected %s multiplicity for PS + trigger name + pileup + with-vertex selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
444  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);
445  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);
446  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);
447  fHistNtrUnCorrEvSel = new TH1F("hNtrUnCorrEvSel",Form("Uncorrected %s multiplicity for selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
448  fHistNtrUnCorrEvWithCand = new TH1F("hNtrUnCorrEvWithCand",Form("Uncorrected %s multiplicity for events with D candidates; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);// Total multiplicity
449  fHistNtrUnCorrEvWithD = new TH1F("hNtrUnCorrEvWithD",Form("Uncorrected %s multiplicity for events with D in mass region ; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin); //
450  fHistNtrCorrPSSel = new TH1F("hNtrCorrPSSel",Form("Corrected %s multiplicity for PS selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
451  fHistNtrCorrEvSel = new TH1F("hNtrCorrEvSel",Form("Corrected %s multiplicity for selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
452  fHistNtrCorrEvWithCand = new TH1F("hNtrCorrEvWithCand", Form("%s multiplicity for events with D candidates; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);// Total multiplicity
453  fHistNtrCorrEvWithD = new TH1F("hNtrCorrEvWithD", Form("%s multiplicity for events with D in mass region ; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin); //
454 
455  if(fKeepCorrPlots){
456  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
457  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
458  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
459  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
460  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
461  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
462  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
463  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
464  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
465 
466  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
467  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
468  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
469  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
470  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
471  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
472  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
473  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
474  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
475 
476 
477  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
478  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
479  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
480  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
481  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
482  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
483  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
484  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
485  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
486 
487  }
488  fHistNtrVsZvtx = new TH2F("hNtrVsZvtx",Form("N%s vs VtxZ; VtxZ;N_{%s};",estimatorName,estimatorName),300,-15,15,nMultBins,firstMultBin,lastMultBin); //
489  fHistNtrCorrVsZvtx = new TH2F("hNtrCorrVsZvtx",Form("N%s vs VtxZ; VtxZ;N_{%s};",estimatorName,estimatorName),300,-15,15,nMultBins,firstMultBin,lastMultBin); //
490 
491  TString histoNtrName;
492  TString histoNtrCorrName;
493  TString parNameNtr;
495  histoNtrName = "hNtrVsSpheri";
496  histoNtrCorrName = "hNtrCorrVsSpheri";
497  parNameNtr = "Spheri";
498  }
499  else{
500  histoNtrName = "hNtrVsSphero";
501  histoNtrCorrName = "hNtrCorrVsSphero";
502  parNameNtr = "Sphero";
503  }
504 
505  fHistNtrVsSo = new TH2F(histoNtrName.Data(),Form("N_{%s} vs %s; %s; N_{%s};",estimatorName,parNameNtr.Data(),parNameNtr.Data(),estimatorName), 20, 0., 1., nMultBins,firstMultBin,lastMultBin); //
506  fHistNtrCorrVsSo = new TH2F(histoNtrCorrName.Data(),Form("N_{%s} vs %s; %s; N_{%s};",estimatorName,parNameNtr.Data(),parNameNtr.Data(),estimatorName), 20, 0., 1., nMultBins, firstMultBin,lastMultBin); //
507 
508  fHistNtrVsNchMC = new TH2F("hNtrVsNchMC",Form("N%s vs NchMC; Nch;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
509  fHistNtrCorrVsNchMC = new TH2F("hNtrCorrVsNchMC",Form("N%s vs Nch; Nch;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
510 
511  fHistNtrVsNchMCPrimary = new TH2F("hNtrVsNchMCPrimary",Form("N%s vs Nch (Primary); Nch (Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
512  fHistNtrCorrVsNchMCPrimary = new TH2F("hNtrCorrVsNchMCPrimary",Form("N%s vs Nch (Primary); Nch(Primary) ;N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
513 
514  fHistNtrVsNchMCPhysicalPrimary = new TH2F("hNtrVsNchMCPhysicalPrimary",Form("N%s vs Nch (Physical Primary); Nch (Physical Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
515  fHistNtrCorrVsNchMCPhysicalPrimary = new TH2F("hNtrCorrVsMCPhysicalPrimary",Form("N%s vs Nch (Physical Primary); Nch (Physical Primary);N_{%s};",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin,nMultBins,firstMultBin,lastMultBin); //
516 
517  fHistGenPrimaryParticlesInelGt0 = new TH1F("hGenPrimaryParticlesInelGt0","Multiplcity of generated charged particles ; Nparticles ; Entries",nMultBins,firstMultBin,lastMultBin);
518 
519  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);
520 
521  fHistNtrUnCorrPSSel->Sumw2();
522  fHistNtrUnCorrPSTrigSel->Sumw2();
528  fHistNtrUnCorrEvSel->Sumw2();
529  fHistNtrUnCorrEvWithCand->Sumw2();
530  fHistNtrUnCorrEvWithD->Sumw2();
531  fHistNtrCorrPSSel->Sumw2();
532  fHistNtrCorrEvSel->Sumw2();
533  fHistNtrCorrEvWithCand->Sumw2();
534  fHistNtrCorrEvWithD->Sumw2();
550  if(fKeepCorrPlots){
578  }
579  fOutput->Add(fHistNtrVsZvtx);
581  fOutput->Add(fHistNtrVsSo);
583 
584  fOutput->Add(fHistNtrVsNchMC);
592 
593  fHistNEvents = new TH1F("fHistNEvents", "number of events ",11,-0.5,10.5);
594  fHistNEvents->GetXaxis()->SetBinLabel(1,"nEvents total");
595  fHistNEvents->GetXaxis()->SetBinLabel(2,"nEvents with Z vertex");
596  fHistNEvents->GetXaxis()->SetBinLabel(3,"nEvents selected");
597  fHistNEvents->GetXaxis()->SetBinLabel(4,"Rejected due to trigger");
598  fHistNEvents->GetXaxis()->SetBinLabel(5,"Rejected due to phys sel");
599  fHistNEvents->GetXaxis()->SetBinLabel(6,"Rejected due to vertex cuts");
600  fHistNEvents->GetXaxis()->SetBinLabel(7,"Rejected due to pileup");
601  fHistNEvents->GetXaxis()->SetBinLabel(8,"Total no. of candidate");
602  fHistNEvents->GetXaxis()->SetBinLabel(9,"no. of cand wo bitmask");
603  fHistNEvents->GetXaxis()->SetBinLabel(10,"D after cuts (No PID)");
604  fHistNEvents->GetXaxis()->SetBinLabel(11,"D after cuts + PID)");
605  fHistNEvents->GetXaxis()->SetNdivisions(1,kFALSE);
606  fHistNEvents->Sumw2();
607  fHistNEvents->SetMinimum(0);
608  fOutput->Add(fHistNEvents);
609 
610  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.);
611 
612  // With flag fFillSoSparseChecks to fill THnSparse with MultUncorr and NoPid cases ( 0 = only Mult, 1 = Mult and multUncorr, 2 = NoPid and 3 is All)
613  Int_t nbinsSo[4]={48, fNMassBins, 20, nMultBins};
614  Double_t xminSo[4]={0., fLowmasslimit,0., firstMultBin};
615  Double_t xmaxSo[4]={24., fUpmasslimit, 1., lastMultBin};
616 
617  TString histoName;
618  TString histoNameNoPid;
619  TString parName;
620 
622  histoName = "hSparseSphericity";
623  histoNameNoPid = "hSparseSphericitywithNoPid";
624  parName = "Sphericity";
625  }
626  else{
627  histoName = "hSparseSpherocity";
628  histoNameNoPid = "hSparseSpherocitywithNoPid";
629  parName = "Spherocity";
630  }
631  if(fFillSoSparseChecks == 1 || fFillSoSparseChecks == 3){
632  Int_t nbinsSowithMultUncorr[5]={48, fNMassBins, 20, nMultBins, nMultBins};
633  Double_t xminSowithMultUncorr[5]={0., fLowmasslimit,0., firstMultBin, firstMultBin};
634  Double_t xmaxSowithMultUncorr[5]={24., fUpmasslimit, 1., lastMultBin, lastMultBin};
635  fSparseSpherocity = new THnSparseD(histoName.Data(), Form("D candidates:; p_{T} [GeV/c]; InvMass [GeV/c^{2}]; %s; Multipicity; MultipicityUncorr;", parName.Data()), 5 , nbinsSowithMultUncorr, xminSowithMultUncorr, xmaxSowithMultUncorr);
636  }
637  else{
638  fSparseSpherocity = new THnSparseD(histoName.Data(), Form("D candidates:; p_{T} [GeV/c]; InvMass [GeV/c^{2}]; %s; Multipicity;", parName.Data()), 4 , nbinsSo, xminSo, xmaxSo);
639  }
640 
641  if(fFillSoSparseChecks == 2|| fFillSoSparseChecks == 3) fSparseSpherocitywithNoPid = new THnSparseD(histoNameNoPid.Data(), Form("D candidates with NoPID:; p_{T} [GeV/c]; InvMass [GeV/c^{2}]; %s; Multipicity;", parName.Data()), 4 , nbinsSo, xminSo, xmaxSo);
642 
646 
647  Int_t nbinsPrompt[4]={48, nMultBins, 20, 100};
648  Int_t nbinsFeeddown[4]={48, nMultBins, 20, 100};
649  Double_t xminPrompt[4] = {0.,firstMultBin, 0., -1.};
650  Double_t xmaxPrompt[4] = {24.,lastMultBin, 1., 1.};
651  Double_t xminFeeddown[4] = {0.,firstMultBin, 0., -1.};
652  Double_t xmaxFeeddown[4] = {24.,lastMultBin, 1., 1.};
653 
654  //Prompt
655  fMCAccGenPrompt = new THnSparseD("hMCAccGenPrompt","kStepMCAcceptance pt vs. Multiplicity vs. Spherocity vs. y - promptD",4,nbinsPrompt,xminPrompt,xmaxPrompt);
656  fMCAccGenPrompt->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
657  fMCAccGenPrompt->GetAxis(1)->SetTitle("Multipicity");
658  fMCAccGenPrompt->GetAxis(2)->SetTitle("Spherocity");
659  fMCAccGenPrompt->GetAxis(3)->SetTitle("y");
660 
661  fMCRecoPrompt = new THnSparseD("hMCRecoPrompt","kStepRecoPID pt vs. Multiplicity vs. Spherocity vs. y - promptD",4,nbinsPrompt,xminPrompt,xmaxPrompt);
662  fMCRecoPrompt->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
663  fMCRecoPrompt->GetAxis(1)->SetTitle("Multipicity");
664  fMCRecoPrompt->GetAxis(2)->SetTitle("Spherocity");
665  fMCRecoPrompt->GetAxis(3)->SetTitle("y");
666 
667  //Feeddown
668  fMCAccGenFeeddown = new THnSparseD("hMCAccGenBFeeddown","kStepMCAcceptance pt vs. Multiplicity vs. Spherocity vs. y - DfromB",4,nbinsFeeddown,xminFeeddown,xmaxFeeddown);
669  fMCAccGenFeeddown->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
670  fMCAccGenFeeddown->GetAxis(1)->SetTitle("Multipicity");
671  fMCAccGenFeeddown->GetAxis(2)->SetTitle("Spherocity");
672  fMCAccGenFeeddown->GetAxis(3)->SetTitle("y");
673 
674  fMCRecoFeeddown = new THnSparseD("hMCRecoFeeddown","kStepRecoPID pt vs. Multiplicity vs. Spherocity vs. y - DfromB",4,nbinsFeeddown,xminFeeddown,xmaxFeeddown);
675  fMCRecoFeeddown->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
676  fMCRecoFeeddown->GetAxis(1)->SetTitle("Multipicity");
677  fMCRecoFeeddown->GetAxis(2)->SetTitle("Spherocity");
678  fMCRecoFeeddown->GetAxis(3)->SetTitle("y");
679 
680  //BothPromptFeeddown
681  fMCRecoBothPromptFD = new THnSparseD("hMCRecoBothPromptFD","kStepRecoPID pt vs. Multiplicity vs. Spherocity vs. y - BothPromptFD",4,nbinsPrompt,xminPrompt,xmaxPrompt);
682  fMCRecoBothPromptFD->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
683  fMCRecoBothPromptFD->GetAxis(1)->SetTitle("Multipicity");
684  fMCRecoBothPromptFD->GetAxis(2)->SetTitle("Spherocity");
685  fMCRecoBothPromptFD->GetAxis(3)->SetTitle("y");
686 
692 
693 
695 
696  fCounterC = new AliNormalizationCounter("NormCounterCorrMult");
697  fCounterC->SetStudyMultiplicity(kTRUE,1.);
698  fCounterC->SetStudySpherocity(kTRUE,10.);
699  fCounterC->Init();
700 
701  fCounterU = new AliNormalizationCounter("NormCounterUnCorrMult");
702  fCounterU->SetStudyMultiplicity(kTRUE,1.);
703  fCounterU->SetStudySpherocity(kTRUE,10.);
704  fCounterU->Init();
705 
706  fCounterCandidates = new AliNormalizationCounter("NormCounterCorrMultCandidates");
710 
711 
712  fOutputCounters = new TList();
713  fOutputCounters->SetOwner();
714  fOutputCounters->SetName("OutputCounters");
718 
719 
720  PostData(1,fOutput);
721  PostData(2,fListCuts);
722  PostData(3,fOutputCounters);
723  PostData(4,fListProfiles);
724  PostData(5,fOutputEffCorr);
725 
726  return;
727 }
728 
729 //________________________________________________________________________
731 {
732  // Execute analysis for current event:
733  // heavy flavor candidates association to MC truth
734 
735  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
736 
737  TClonesArray *arrayCand = 0;
738  TString arrayName="";
739  UInt_t pdgDau[3];
740  Int_t nDau=0;
741  Int_t selbit=0;
742  if(fPdgMeson==411){
743  arrayName="Charm3Prong";
744  pdgDau[0]=211; pdgDau[1]=321; pdgDau[2]=211;
745  nDau=3;
747  }else if(fPdgMeson==421){
748  arrayName="D0toKpi";
749  pdgDau[0]=211; pdgDau[1]=321; pdgDau[2]=0;
750  nDau=2;
752  }else if(fPdgMeson==413){
753  arrayName="Dstar";
754  pdgDau[0]=321; pdgDau[1]=211; pdgDau[2]=0; // Quoting here D0 daughters (D* ones on another variable later)
755  nDau=2;
757  }
758 
759  if(!aod && AODEvent() && IsStandardAOD()) {
760  // In case there is an AOD handler writing a standard AOD, use the AOD
761  // event in memory rather than the input (ESD) event.
762  aod = dynamic_cast<AliAODEvent*> (AODEvent());
763  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
764  // have to taken from the AOD event hold by the AliAODExtension
765  AliAODHandler* aodHandler = (AliAODHandler*)
766  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
767  if(aodHandler->GetExtensions()) {
768  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
769  AliAODEvent *aodFromExt = ext->GetAOD();
770  arrayCand=(TClonesArray*)aodFromExt->GetList()->FindObject(arrayName.Data());
771  }
772  } else if(aod) {
773  arrayCand=(TClonesArray*)aod->GetList()->FindObject(arrayName.Data());
774  }
775 
776  if(!aod || !arrayCand) {
777  printf("AliAnalysisTaskSEDvsEventShapes::UserExec: Charm3Prong branch not found!\n");
778  return;
779  }
780 
781  if(fisPPbData && fReadMC){
782  Int_t runnumber = aod->GetRunNumber();
783  if(aod->GetTriggerMask()==0 &&
784  (runnumber>=195344 && runnumber<=195677)){
785  AliDebug(3,"Event rejected because of null trigger mask");
786  return;
787  }
788  }
789 
790  // fix for temporary bug in ESDfilter
791  // the AODs with null vertex pointer didn't pass the PhysSel
792  if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001) return;
793 
794  Int_t countTreta1=0, countTreta03=0, countTreta05=0, countTreta16=0;
795  AliAODTracklets* tracklets=aod->GetTracklets();
796  Int_t nTr=tracklets->GetNumberOfTracklets();
797  for(Int_t iTr=0; iTr<nTr; iTr++){
798  Double_t theta=tracklets->GetTheta(iTr);
799  Double_t eta=-TMath::Log(TMath::Tan(theta/2.));
800  if(eta>-0.3 && eta<0.3) countTreta03++;
801  if(eta>-0.5 && eta<0.5) countTreta05++;
802  if(eta>-1.0 && eta<1.0) countTreta1++;
803  if(eta>-1.6 && eta<1.6) countTreta16++;
804  }
805 
806 
807  Int_t vzeroMult=0, vzeroMultA=0, vzeroMultC=0;
808  Int_t vzeroMultEq=0, vzeroMultAEq=0, vzeroMultCEq=0;
809  AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
810  if(vzeroAOD) {
811  vzeroMultA = static_cast<Int_t>(vzeroAOD->GetMTotV0A());
812  vzeroMultC = static_cast<Int_t>(vzeroAOD->GetMTotV0C());
813  vzeroMult = vzeroMultA + vzeroMultC;
814  vzeroMultAEq = static_cast<Int_t>(AliVertexingHFUtils::GetVZEROAEqualizedMultiplicity(aod));
815  vzeroMultCEq = static_cast<Int_t>(AliVertexingHFUtils::GetVZEROCEqualizedMultiplicity(aod));
816  vzeroMultEq = vzeroMultAEq + vzeroMultCEq;
817  }
818 
819  Int_t countMult = countTreta1;
820  if(fMultiplicityEstimator==kNtrk03) { countMult = countTreta03; }
821  else if(fMultiplicityEstimator==kNtrk05) { countMult = countTreta05; }
822  else if(fMultiplicityEstimator==kNtrk10to16) { countMult = countTreta16 - countTreta1; }
823  else if(fMultiplicityEstimator==kVZERO) { countMult = vzeroMult; }
824  else if(fMultiplicityEstimator==kVZEROA) { countMult = vzeroMultA; }
825  else if(fMultiplicityEstimator==kVZEROEq) { countMult = vzeroMultEq; }
826  else if(fMultiplicityEstimator==kVZEROAEq) { countMult = vzeroMultAEq; }
827 
828  Double_t spherocity;
829  if(fCalculateSphericity){ //When kTRUE, it calculates Sphericity and THnSparse filled for sphericity
831  }
832  else{
834  }
835  Double_t St=1;
836  // printf("hello \n");
837  fCounterU->StoreEvent(aod,fRDCutsAnalysis,fReadMC,countMult,spherocity);
838  fHistNEvents->Fill(0); // count event
839 
840  Double_t countTreta1corr=countTreta1;
841  Double_t countCorr=countMult;
842  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
843  // In case of VZERO multiplicity, consider the zvtx correction flag
844  // fDoVZER0ParamVertexCorr: 0= none, 1= usual d2h, 2=AliESDUtils
845  Bool_t isDataDrivenZvtxCorr=kTRUE;
846  Bool_t isVtxOk=kFALSE;
847  Int_t vzeroMultACorr=vzeroMultA, vzeroMultCCorr=vzeroMultC, vzeroMultCorr=vzeroMult;
848  Int_t vzeroMultAEqCorr=vzeroMultAEq, vzeroMultCEqCorr=vzeroMultCEq, vzeroMultEqCorr=vzeroMultEq;
849  if(vtx1){
850  if(vtx1->GetNContributors()>0){
851  fHistNEvents->Fill(1);
852  isVtxOk=kTRUE;
853  }
854  }
855  if(isVtxOk){
859  // do not correct
860  isDataDrivenZvtxCorr=kFALSE;
861  } else if (fDoVZER0ParamVertexCorr==2){
862  // use AliESDUtils correction
863  Float_t zvtx = vtx1->GetZ();
864  isDataDrivenZvtxCorr=kFALSE;
865  vzeroMultACorr = static_cast<Int_t>(AliESDUtils::GetCorrV0A(vzeroMultA,zvtx));
866  vzeroMultCCorr = static_cast<Int_t>(AliESDUtils::GetCorrV0C(vzeroMultC,zvtx));
867  vzeroMultCorr = vzeroMultACorr + vzeroMultCCorr;
868  vzeroMultAEqCorr = static_cast<Int_t>(AliESDUtils::GetCorrV0A(vzeroMultAEq,zvtx));
869  vzeroMultCEqCorr =static_cast<Int_t>( AliESDUtils::GetCorrV0C(vzeroMultCEq,zvtx));
870  vzeroMultEqCorr = vzeroMultAEqCorr + vzeroMultCEqCorr;
871  if(fMultiplicityEstimator==kVZERO) { countCorr = vzeroMultCorr; }
872  else if(fMultiplicityEstimator==kVZEROA) { countCorr = vzeroMultACorr; }
873  else if(fMultiplicityEstimator==kVZEROEq) { countCorr = vzeroMultEqCorr; }
874  else if(fMultiplicityEstimator==kVZEROAEq) { countCorr = vzeroMultAEqCorr; }
875  }
876  }
877  }
878  // Data driven multiplicity z-vertex correction
879  if(isVtxOk && isDataDrivenZvtxCorr){
880  TProfile* estimatorAvg = GetEstimatorHistogram(aod);
881  if(estimatorAvg){
882  countTreta1corr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,countTreta1,vtx1->GetZ(),fRefMult));
883  countCorr=static_cast<Int_t>(AliVertexingHFUtils::GetCorrectedNtracklets(estimatorAvg,countMult,vtx1->GetZ(),fRefMult));
884  }
885  }
886 
887  fCounterC->StoreEvent(aod,fRDCutsAnalysis,fReadMC,countCorr,spherocity);
888 
889  Bool_t isEvSel=fRDCutsAnalysis->IsEventSelected(aod);
890 
891  if(fRDCutsAnalysis->GetWhyRejection()==5) fHistNEvents->Fill(3);
892  if(fRDCutsAnalysis->GetWhyRejection()==7) fHistNEvents->Fill(4);
893  if(fRDCutsAnalysis->GetWhyRejection()==6) fHistNEvents->Fill(5);
894  if(fRDCutsAnalysis->GetWhyRejection()==1) fHistNEvents->Fill(6);
895 
896  Bool_t isEvPSRejected = fRDCutsAnalysis->IsEventRejectedDuePhysicsSelection();
897  Bool_t isEvTrigNameRejected = fRDCutsAnalysis->IsEventRejectedDueToTrigger();
898  Bool_t isEvPileUpRejected = fRDCutsAnalysis->IsEventRejectedDueToPileup();
899  Bool_t isEvNoVtxRejected = fRDCutsAnalysis->IsEventRejectedDueToNotRecoVertex();
900  Bool_t isEvVtxContribRejected = fRDCutsAnalysis->IsEventRejectedDueToVertexContributors();
902  Bool_t isEvCentralityRejected = fRDCutsAnalysis->IsEventRejectedDueToCentrality();
903  if(!isEvPSRejected){
904  fHistNtrUnCorrPSSel->Fill(countMult);
905  fHistNtrCorrPSSel->Fill(countCorr);
906  if(!isEvTrigNameRejected){
907  fHistNtrUnCorrPSTrigSel->Fill(countMult);
908  if(!isEvPileUpRejected){
909  fHistNtrUnCorrPSTrigPileUpSel->Fill(countMult);
910  if(!isEvNoVtxRejected){
911  fHistNtrUnCorrPSTrigPileUpVtxSel->Fill(countMult);
912  if(!isEvVtxContribRejected){
913  fHistNtrUnCorrPSTrigPileUpVtxContSel->Fill(countMult);
914  if(!isEvVtxRangeRejected){
915  fHistNtrUnCorrPSTrigPileUpVtxRangeSel->Fill(countMult);
916  if(!isEvCentralityRejected){
918  }
919  }
920  }
921  }
922  }
923  }
924  }
925 
926  TClonesArray *arrayMC=0;
927  AliAODMCHeader *mcHeader=0;
928 
929  // load MC particles
930  if(fReadMC){
931 
932  arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
933  if(!arrayMC) {
934  printf("AliAnalysisTaskSEDvsEventShapes::UserExec: MC particles branch not found!\n");
935  return;
936  }
937  // load MC header
938  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
939  if(!mcHeader) {
940  printf("AliAnalysisTaskSEDvsEventShapes::UserExec: MC header branch not found!\n");
941  return;
942  }
943 
944  FillMCGenAccHistos(arrayMC, mcHeader, countCorr, spherocity);//Fill 2 separate THnSparses, one for prompt andf one for feeddown
945  }
946 
947 
948  if(!isEvSel)return;
949 
950  if(fKeepCorrPlots){
951  fHistNtrEta16vsNtrEta1EvSel->Fill(countTreta1,countTreta16);
952  fHistNtrEta05vsNtrEta1EvSel->Fill(countTreta1,countTreta05);
953  fHistNtrEta03vsNtrEta1EvSel->Fill(countTreta1,countTreta03);
954  fHistNtrEtaV0AvsNtrEta1EvSel->Fill(countTreta1,vzeroMultA);
955  fHistNtrEtaV0MvsNtrEta1EvSel->Fill(countTreta1,vzeroMult);
956  fHistNtrEtaV0AvsV0AEqEvSel->Fill(vzeroMultA,vzeroMultAEq);
957  fHistNtrEtaV0MvsV0MEqEvSel->Fill(vzeroMult,vzeroMultEq);
958  fHistNtrCorrEta1vsNtrRawEta1EvSel->Fill(countTreta1,countTreta1corr);
959  fHistMultCorrvsMultRawEvSel->Fill(countMult,countCorr);
960  }
961  if(vtx1){
962  fHistNtrVsZvtx->Fill(vtx1->GetZ(),countMult);
963  fHistNtrCorrVsZvtx->Fill(vtx1->GetZ(),countCorr);
964  fHistNtrVsSo->Fill(spherocity,countMult);
965  fHistNtrCorrVsSo->Fill(spherocity,countCorr);
966  }
967 
968 
969 
970  Double_t nchWeight=1.0;
971 
972  if(fReadMC){
973  Int_t nChargedMCEta10=0, nChargedMCEta03=0, nChargedMCEta05=0, nChargedMCEta16=0, nChargedMCEtam37tm17=0, nChargedMCEta28t51=0;
974  Int_t nChargedMCPrimaryEta10=0, nChargedMCPrimaryEta03=0, nChargedMCPrimaryEta05=0, nChargedMCPrimaryEta16=0, nChargedMCPrimaryEtam37tm17=0, nChargedMCPrimaryEta28t51=0;
975  Int_t nChargedMCPhysicalPrimaryEta10=0, nChargedMCPhysicalPrimaryEta03=0, nChargedMCPhysicalPrimaryEta05=0, nChargedMCPhysicalPrimaryEta16=0, nChargedMCPhysicalPrimaryEtam37tm17=0, nChargedMCPhysicalPrimaryEta28t51=0;
976  for(Int_t i=0; i<arrayMC->GetEntriesFast(); i++){
977  AliAODMCParticle *part=(AliAODMCParticle*)arrayMC->UncheckedAt(i);
978  Int_t charge = part->Charge();
979  Double_t eta = part->Eta();
980  Bool_t isPrim = part->IsPrimary();
981  Bool_t isPhysPrim = part->IsPhysicalPrimary();
982  if(charge!=0) {
983  if(eta>-0.3 && eta< 0.3) {
984  nChargedMCEta03++;
985  if(isPrim) nChargedMCPrimaryEta03++;
986  if(isPhysPrim) nChargedMCPhysicalPrimaryEta03++;
987  }
988  if(eta>-0.5 && eta< 0.5) {
989  nChargedMCEta05++;
990  if(isPrim) nChargedMCPrimaryEta05++;
991  if(isPhysPrim) nChargedMCPhysicalPrimaryEta05++;
992  }
993  if(eta>-1.0 && eta< 1.0) {
994  nChargedMCEta10++;
995  if(isPrim) nChargedMCPrimaryEta10++;
996  if(isPhysPrim) nChargedMCPhysicalPrimaryEta10++;
997  }
998  if(eta>-1.6 && eta< 1.6) {
999  nChargedMCEta16++;
1000  if(isPrim) nChargedMCPrimaryEta16++;
1001  if(isPhysPrim) nChargedMCPhysicalPrimaryEta16++;
1002  }
1003  if(eta>-3.7 && eta<-1.7) {
1004  nChargedMCEtam37tm17++;
1005  if(isPrim) nChargedMCPrimaryEtam37tm17++;
1006  if(isPhysPrim) nChargedMCPhysicalPrimaryEtam37tm17++;
1007  }
1008  if(eta> 2.8 && eta< 5.1) {
1009  nChargedMCEta28t51++;
1010  if(isPrim) nChargedMCPrimaryEta28t51++;
1011  if(isPhysPrim) nChargedMCPhysicalPrimaryEta28t51++;
1012  }
1013  }
1014  }
1015  Int_t nChargedMC=nChargedMCEta10;
1016  Int_t nChargedMCPrimary=nChargedMCPrimaryEta10;
1017  Int_t nChargedMCPhysicalPrimary=nChargedMCPhysicalPrimaryEta10;
1018 
1019  // Compute the Nch weights (reference is Ntracklets within |eta|<1.0)
1020  if(fUseNchWeight>0){
1021 
1022  Double_t tmpweight = 1.0;
1023  Double_t tmpXweight=nChargedMCPhysicalPrimary; // Nch weights
1024  if(fUseNchWeight==2) tmpXweight=countMult; // Ntrk weights
1025 
1026  if(tmpXweight<=0) tmpweight = 0.0;
1027  else{
1028  Double_t pMeas = fHistoMeasNch->GetBinContent(fHistoMeasNch->FindBin(tmpXweight));
1029  //printf(" pMeas=%2.2f and histo MCNch %s \n",pMeas,fHistoMCNch);
1030  Double_t pMC = fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(tmpXweight));
1031  tmpweight = pMC>0 ? pMeas/pMC : 0.;
1032  }
1033  nchWeight *= tmpweight;
1034  AliDebug(2,Form("Using Nch weights, Mult=%f Weight=%f\n",tmpXweight,nchWeight));
1035 
1036  }
1037 
1038  // Now recompute the variables in case another MC estimator is considered
1040  nChargedMC = nChargedMCEta16 - nChargedMCEta10;
1041  nChargedMCPrimary = nChargedMCPrimaryEta16 - nChargedMCPrimaryEta10;
1042  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta16 - nChargedMCPhysicalPrimaryEta10;
1043  } else if(fMCPrimariesEstimator==kEta05){
1044  nChargedMC = nChargedMCEta05;
1045  nChargedMCPrimary = nChargedMCPrimaryEta05;
1046  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta05;
1047  } else if(fMCPrimariesEstimator==kEta03){
1048  nChargedMC = nChargedMCEta03;
1049  nChargedMCPrimary = nChargedMCPrimaryEta03;
1050  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta03;
1051  } else if(fMCPrimariesEstimator==kEtaVZERO){
1052  nChargedMC = nChargedMCEtam37tm17 + nChargedMCEta28t51;
1053  nChargedMCPrimary = nChargedMCPrimaryEtam37tm17 + nChargedMCPrimaryEta28t51;
1054  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEtam37tm17 + nChargedMCPhysicalPrimaryEta28t51;
1055  } else if(fMCPrimariesEstimator==kEtaVZEROA){
1056  nChargedMC = nChargedMCEta28t51;
1057  nChargedMCPrimary = nChargedMCPrimaryEta28t51;
1058  nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta28t51;
1059  }
1060 
1061  // Here fill the MC correlation plots
1062  if(nChargedMCPhysicalPrimary>0){ // INEL>0 for |eta|<1
1063  fHistGenPrimaryParticlesInelGt0->Fill(nChargedMCPhysicalPrimary,nchWeight);
1064  }
1065 
1066  fHistNtrVsNchMC->Fill(nChargedMC,countMult,nchWeight);
1067  fHistNtrCorrVsNchMC->Fill(nChargedMC,countCorr,nchWeight);
1068 
1069  fHistNtrVsNchMCPrimary->Fill(nChargedMCPrimary,countMult,nchWeight);
1070  fHistNtrCorrVsNchMCPrimary->Fill(nChargedMCPrimary,countCorr,nchWeight);
1071 
1072  fHistNtrVsNchMCPhysicalPrimary->Fill(nChargedMCPhysicalPrimary,countMult,nchWeight);
1073  fHistNtrCorrVsNchMCPhysicalPrimary->Fill(nChargedMCPhysicalPrimary,countCorr,nchWeight);
1074 
1075  fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary->Fill(nChargedMC,nChargedMCPrimary,nChargedMCPhysicalPrimary,nchWeight);
1076  }
1077 
1078  Int_t nCand = arrayCand->GetEntriesFast();
1079  Int_t nSelectedNoPID=0,nSelectedPID=0,nSelectedInMassPeak=0;
1080  Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
1081  Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
1082  Double_t mDstarPDG = TDatabasePDG::Instance()->GetParticle(413)->Mass();
1083 
1084  // pdg of daughters needed for D* too
1085  UInt_t pdgDgDStartoD0pi[2]={421,211};
1086 
1087  Double_t aveMult=0.;
1088  Double_t nSelCand=0.;
1089  for (Int_t iCand = 0; iCand < nCand; iCand++) {
1090  AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayCand->UncheckedAt(iCand);
1091  AliAODRecoCascadeHF *dCascade = NULL;
1092  if(fPdgMeson==413) dCascade = (AliAODRecoCascadeHF*)d;
1093 
1094  fHistNEvents->Fill(7);
1095  if(fUseBit && !d->HasSelectionBit(selbit)){
1096  fHistNEvents->Fill(8);
1097  continue;
1098  }
1099 
1100  Double_t ptCand = d->Pt();
1101  Double_t rapid=d->Y(fPdgMeson);
1102  Bool_t isFidAcc=fRDCutsAnalysis->IsInFiducialAcceptance(ptCand,rapid);
1103  if(!isFidAcc) continue;
1104 
1105  Int_t labD=-1;
1106  if(fReadMC) {
1107  if(fPdgMeson==413){
1108  labD = dCascade->MatchToMC(fPdgMeson,421,(Int_t*)pdgDgDStartoD0pi,(Int_t*)pdgDau,arrayMC);
1109  } else {
1110  labD = d->MatchToMC(fPdgMeson,arrayMC,nDau,(Int_t*)pdgDau);
1111  }
1112 
1113  if(labD>=0){
1114  AliAODMCParticle *parD = (AliAODMCParticle*)arrayMC->At(labD);
1115  Double_t massD = parD->M();
1116  Double_t ptD = parD->Pt();
1117  fPtVsMassVsMultMC->Fill(countMult,massD,ptD,nchWeight);
1118  }
1119  }
1120 
1121  Int_t passAllCuts=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kAll,aod);
1122  Int_t passTopolCuts=fRDCutsAnalysis->GetIsSelectedCuts();
1123  if(passTopolCuts==0) continue;
1124  nSelectedNoPID++;
1125  fHistNEvents->Fill(9);
1126  if(passAllCuts){
1127  nSelectedPID++;
1128  fHistNEvents->Fill(10);
1129  }
1130  Double_t multForCand = countCorr;
1131 
1133  // For the D* case, subtract only the D0 daughter tracks <=== FIXME !!
1134  AliAODRecoDecayHF2Prong* d0fromDstar = NULL;
1135  if(fPdgMeson==413) d0fromDstar = (AliAODRecoDecayHF2Prong*)dCascade->Get2Prong();
1136 
1137  for(Int_t iDau=0; iDau<nDau; iDau++){
1138  AliAODTrack *t = NULL;
1139  if(fPdgMeson==413){ t = (AliAODTrack*)d0fromDstar->GetDaughter(iDau); }
1140  else{ t = (AliAODTrack*)d->GetDaughter(iDau); }
1141  if(!t) continue;
1142  if(t->HasPointOnITSLayer(0) && t->HasPointOnITSLayer(1)){
1143  if(multForCand>0) multForCand-=1;
1144  }
1145  }
1146  }
1147  Bool_t isPrimary=kTRUE;
1148  Double_t trueImpParXY=9999.;
1149  Double_t impparXY=d->ImpParXY()*10000.;
1150  Double_t dlen=0.1; //FIXME
1151  Double_t mass[2];
1152  if(fPdgMeson==411){
1153  mass[0]=d->InvMass(nDau,pdgDau);
1154  mass[1]=-1.;
1155  if(TMath::Abs(mass[0]-mDplusPDG)<0.02) nSelectedInMassPeak++; //20 MeV for now... FIXME
1156  }else if(fPdgMeson==421){
1157  UInt_t pdgdaughtersD0[2]={211,321};//pi,K
1158  UInt_t pdgdaughtersD0bar[2]={321,211};//K,pi
1159  mass[0]=d->InvMass(2,pdgdaughtersD0);
1160  mass[1]=d->InvMass(2,pdgdaughtersD0bar);
1161  if(TMath::Abs(mass[0]-mD0PDG)<0.02 || TMath::Abs(mass[1]-mD0PDG)<0.02 ) nSelectedInMassPeak++; //20 MeV for now... FIXME
1162  }else if(fPdgMeson==413){
1163  // FIXME
1164  mass[0]=dCascade->DeltaInvMass();
1165  mass[1]=-1.;
1166  if(TMath::Abs(mass[0]-(mDstarPDG-mD0PDG))<0.0015) nSelectedInMassPeak++; //1 MeV for now... FIXME
1167  }
1168  for(Int_t iHyp=0; iHyp<2; iHyp++){
1169  if(mass[iHyp]<0.) continue; // for D+ and D* we have 1 mass hypothesis
1170  Double_t invMass=mass[iHyp];
1171  Double_t arrayForSparse[5]={invMass,ptCand,impparXY,dlen,multForCand};
1172 
1173  if(fReadMC){
1174 
1175  if(fPdgMeson==413){
1176  labD = dCascade->MatchToMC(fPdgMeson,421,(Int_t*)pdgDgDStartoD0pi,(Int_t*)pdgDau,arrayMC);
1177  } else {
1178  labD = d->MatchToMC(fPdgMeson,arrayMC,nDau,(Int_t*)pdgDau);
1179  }
1180 
1181  Bool_t fillHisto=fDoImpPar;
1182  if(labD>=0){
1183  AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
1184  Int_t code=partD->GetPdgCode();
1185  Int_t Origin = AliVertexingHFUtils::CheckOrigin(arrayMC,partD, fUseQuarkTag);
1186  if(Origin==5) isPrimary=kFALSE;
1187  if(code<0 && iHyp==0) fillHisto=kFALSE;
1188  if(code>0 && iHyp==1) fillHisto=kFALSE;
1189  if(!isPrimary){
1190  if(fPdgMeson==411){
1191  trueImpParXY=AliVertexingHFUtils::GetTrueImpactParameterDplus(mcHeader,arrayMC,partD)*10000.;
1192  }else if(fPdgMeson==421){
1193  trueImpParXY=AliVertexingHFUtils::GetTrueImpactParameterDzero(mcHeader,arrayMC,partD)*10000.;
1194  }else if(fPdgMeson==413){
1195  trueImpParXY=0.;
1196  }
1197  Double_t arrayForSparseTrue[5]={invMass,ptCand,trueImpParXY,dlen,multForCand};
1198  if(fillHisto && passAllCuts){
1199  fHistMassPtImpPar[2]->Fill(arrayForSparse);
1200  fHistMassPtImpPar[3]->Fill(arrayForSparseTrue);
1201  }
1202  }else{
1203  if(fillHisto && passAllCuts) fHistMassPtImpPar[1]->Fill(arrayForSparse);
1204  }
1205  }else{
1206  if(fillHisto && passAllCuts)fHistMassPtImpPar[4]->Fill(arrayForSparse);
1207  }
1208 
1209  if(TMath::Abs(labD)==fPdgMeson && fMCOption==2) continue;
1210  if(TMath::Abs(labD)!=fPdgMeson && fMCOption==1) continue;
1211 
1212  }
1213 
1214  if(fPdgMeson==421){
1215  if(iHyp==0 && !(passTopolCuts&1)) continue; // candidate not passing as D0
1216  if(iHyp==1 && !(passTopolCuts&2)) continue; // candidate not passing as D0bar
1217  }
1218 
1219  if(fFillSoSparseChecks == 2 || fFillSoSparseChecks == 3){ //Filling THnSparse for Spherocity without PID
1220  fSparseSpherocitywithNoPid->Sumw2();
1221  Double_t arrayForSparseSoNoPid[4]={ptCand, invMass, spherocity, multForCand};
1222  fSparseSpherocitywithNoPid->Fill(arrayForSparseSoNoPid);
1223  }
1224  if(fPdgMeson==421){
1225  if(iHyp==0 && !(passAllCuts&1)) continue; // candidate not passing as D0
1226  if(iHyp==1 && !(passAllCuts&2)) continue; // candidate not passing as D0bar
1227  }
1228  if(passAllCuts){
1229  aveMult+=multForCand;
1230  nSelCand+=1.;
1231 
1232  if(fFillSoSparseChecks == 1 || fFillSoSparseChecks == 3){
1233  fSparseSpherocity->Sumw2();
1234  Double_t arrayForSparseSowithMultUnncorr[5]={ptCand, invMass, spherocity, multForCand, (Double_t)countTreta1};
1235  fSparseSpherocity->Fill(arrayForSparseSowithMultUnncorr);
1236  }
1237  else{
1238  fSparseSpherocity->Sumw2();
1239  Double_t arrayForSparseSo[4]={ptCand, invMass, spherocity, multForCand};
1240  fSparseSpherocity->Fill(arrayForSparseSo);
1241  }
1242 
1243  if(labD>=0) FillMCMassHistos(arrayMC,labD, multForCand, spherocity);
1244 
1245  if(fDoImpPar){
1246  fHistMassPtImpPar[0]->Fill(arrayForSparse);
1247  }
1248 
1249  }
1250 
1251  }
1252  }
1253  if(fSubtractTrackletsFromDau && nSelCand>0){
1254  aveMult/=nSelCand;
1255  fCounterCandidates->StoreEvent(aod,fRDCutsAnalysis,fReadMC,(Int_t)(aveMult+0.5001),spherocity);
1256  }else{
1257  fCounterCandidates->StoreEvent(aod,fRDCutsAnalysis,fReadMC,(Int_t)countCorr,spherocity);
1258  }
1259 
1260 
1261  fCounterCandidates->StoreCandidates(aod,nSelectedNoPID,kTRUE);
1262  fCounterCandidates->StoreCandidates(aod,nSelectedPID,kFALSE);
1263  fHistNtrUnCorrEvSel->Fill(countMult,nchWeight);
1264  fHistNtrCorrEvSel->Fill(countCorr,nchWeight);
1265  if(nSelectedPID>0) {
1266  fHistNtrUnCorrEvWithCand->Fill(countMult,nchWeight);
1267  fHistNtrCorrEvWithCand->Fill(countCorr,nchWeight);
1268  if(fKeepCorrPlots){
1269  fHistNtrEta16vsNtrEta1EvWithCand->Fill(countTreta1,countTreta16);
1270  fHistNtrEta05vsNtrEta1EvWithCand->Fill(countTreta1,countTreta05);
1271  fHistNtrEta03vsNtrEta1EvWithCand->Fill(countTreta1,countTreta03);
1272  fHistNtrEtaV0AvsNtrEta1EvWithCand->Fill(countTreta1,vzeroMultA);
1273  fHistNtrEtaV0MvsNtrEta1EvWithCand->Fill(countTreta1,vzeroMult);
1274  fHistNtrEtaV0AvsV0AEqEvWithCand->Fill(vzeroMultA,vzeroMultAEq);
1275  fHistNtrEtaV0MvsV0MEqEvWithCand->Fill(vzeroMult,vzeroMultEq);
1276  fHistNtrCorrEta1vsNtrRawEta1EvWithCand->Fill(countTreta1,countTreta1corr);
1277  fHistMultCorrvsMultRawEvWithCand->Fill(countMult,countCorr);
1278  }
1279  }
1280  if(nSelectedInMassPeak>0) {
1281  fHistNtrUnCorrEvWithD->Fill(countMult,nchWeight);
1282  fHistNtrCorrEvWithD->Fill(countCorr,nchWeight);
1283  if(fKeepCorrPlots){
1284  fHistNtrEta16vsNtrEta1EvWithD->Fill(countTreta1,countTreta16);
1285  fHistNtrEta05vsNtrEta1EvWithD->Fill(countTreta1,countTreta05);
1286  fHistNtrEta03vsNtrEta1EvWithD->Fill(countTreta1,countTreta03);
1287  fHistNtrEtaV0AvsNtrEta1EvWithD->Fill(countTreta1,vzeroMultA);
1288  fHistNtrEtaV0MvsNtrEta1EvWithD->Fill(countTreta1,vzeroMult);
1289  fHistNtrEtaV0AvsV0AEqEvWithD->Fill(vzeroMultA,vzeroMultAEq);
1290  fHistNtrEtaV0MvsV0MEqEvWithD->Fill(vzeroMult,vzeroMultEq);
1291  fHistNtrCorrEta1vsNtrRawEta1EvWithD->Fill(countTreta1,countTreta1corr);
1292  fHistMultCorrvsMultRawEvWithD->Fill(countMult,countCorr);
1293  }
1294  }
1295 
1296  PostData(1,fOutput);
1297  PostData(2,fListCuts);
1298  PostData(3,fOutputCounters);
1299  PostData(5,fOutputEffCorr);
1300 
1301  return;
1302 }
1303 
1304 //________________________________________________________________________
1306  // Histos for impact paramter study
1307  // mass . pt , impact parameter , decay length , multiplicity
1308 
1309  Int_t nbins[5]={fNMassBins,200,fNImpParBins,50,100};
1310  Double_t xmin[5]={fLowmasslimit,0.,fLowerImpPar,0.,0.};
1311  Double_t xmax[5]={fUpmasslimit,20.,fHigherImpPar,1.,100.};
1312 
1313  fHistMassPtImpPar[0]=new THnSparseF("hMassPtImpParAll",
1314  "Mass vs. pt vs.imppar - All",
1315  5,nbins,xmin,xmax);
1316  fHistMassPtImpPar[1]=new THnSparseF("hMassPtImpParPrompt",
1317  "Mass vs. pt vs.imppar - promptD",
1318  5,nbins,xmin,xmax);
1319  fHistMassPtImpPar[2]=new THnSparseF("hMassPtImpParBfeed",
1320  "Mass vs. pt vs.imppar - DfromB",
1321  5,nbins,xmin,xmax);
1322  fHistMassPtImpPar[3]=new THnSparseF("hMassPtImpParTrueBfeed",
1323  "Mass vs. pt vs.true imppar -DfromB",
1324  5,nbins,xmin,xmax);
1325  fHistMassPtImpPar[4]=new THnSparseF("hMassPtImpParBkg",
1326  "Mass vs. pt vs.imppar - backgr.",
1327  5,nbins,xmin,xmax);
1328  for(Int_t i=0; i<5;i++){
1329  fOutput->Add(fHistMassPtImpPar[i]);
1330  }
1331 }
1332 
1333 //________________________________________________________________________
1335 {
1336  // Terminate analysis
1337  //
1338  if(fDebug > 1) printf("AnalysisTaskSEDvsMultiplicity: Terminate() \n");
1339 
1340  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1341  if (!fOutput) {
1342  printf("ERROR: fOutput not available\n");
1343  return;
1344  }
1345 
1346  fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
1347  if(!fHistNEvents){
1348  printf("ERROR: fHistNEvents not available\n");
1349  return;
1350  }
1351  printf("Number of Analyzed Events = %d\n",(Int_t)fHistNEvents->GetBinContent(3));
1352 
1353  return;
1354 }
1355 
1356 //____________________________________________________________________________
1358  // Get Estimator Histogram from period event->GetRunNumber();
1359  //
1360  // If you select SPD tracklets in |eta|<1 you should use type == 1
1361  //
1362 
1363  Int_t runNo = event->GetRunNumber();
1364  Int_t period = -1; // pp: 0-LHC10b, 1-LHC10c, 2-LHC10d, 3-LHC10e
1365  // pPb: 0-LHC13b, 1-LHC13c
1366  if (fisPPbData) {
1367  if (runNo>195343 && runNo<195484) period = 0;
1368  if (runNo>195528 && runNo<195678) period = 1;
1369  if (period < 0 || period > 1) return 0;
1370  }
1371  else {
1372  if(runNo>114930 && runNo<117223) period = 0;
1373  if(runNo>119158 && runNo<120830) period = 1;
1374  if(runNo>122373 && runNo<126438) period = 2;
1375  if(runNo>127711 && runNo<130841) period = 3;
1376  if(period<0 || period>3) return 0;
1377 
1378  }
1379 
1380  return fMultEstimatorAvg[period];
1381 }
1382 
1383 //__________________________________________________________________________________________________
1385  // creates historgam with measured multiplcity distribution in pp 7 TeV collisions (from Eur. Phys. J. C (2010) 68: 345–354)
1386  //
1387  // for Nch > 70 the points were obtainedwith a double NBD distribution
1388  // 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
1389  // fit1->SetParameter(1,1.63); // k parameter
1390  // fit1->SetParameter(2,12.8); // mean multiplicity
1391  Double_t nchbins[82]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1392  10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1393  20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1394  30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1395  40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1396  50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1397  60.50,62.50,64.50,66.50,68.50,70.50,72.50,74.50,76.50,78.50,
1398  80.50,82.50,84.50,86.50,88.50,90.50,92.50,94.50,96.50,98.50,
1399  100.50,102.50};
1400  Double_t pch[81]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1401  0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1402  0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1403  0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1404  0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1405  0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1406  0.000296,0.000265,0.000193,0.00016,0.000126,0.0000851, 0.0000676,0.0000537,0.0000426, 0.0000338,
1407  0.0000268,0.0000213,0.0000166,0.0000133,0.0000106,0.00000837,0.00000662, 0.00000524,0.00000414, 0.00000327,
1408  0.00000258};
1409 
1410  if(fHistoMeasNch) delete fHistoMeasNch;
1411  fHistoMeasNch=new TH1F("hMeaseNch","",81,nchbins);
1412  for(Int_t i=0; i<81; i++){
1413  fHistoMeasNch->SetBinContent(i+1,pch[i]);
1414  fHistoMeasNch->SetBinError(i+1,0.);
1415  }
1416 }
1417 
1418 //__________________________________________________________________________________________________
1419 void AliAnalysisTaskSEDvsEventShapes::FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Double_t countMult, Double_t spherocity)
1420 {
1421  // Function to fill the true MC signal
1422 
1423  AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
1424 
1425  Double_t mass = partD->M();
1426  Double_t pt = partD->Pt();
1427  Double_t rapid = partD->Y();
1428 
1429  Int_t orig=AliVertexingHFUtils::CheckOrigin(arrayMC,partD,fUseQuarkTag); // Prompt = 4, FeedDown = 5
1430 
1431  //for prompt
1432  if(orig == 4){
1433  //fill histo for prompt
1434  Double_t arrayMCRecoPrompt[4] = {pt, countMult, spherocity, rapid};
1435  fMCRecoPrompt->Fill(arrayMCRecoPrompt);
1436  }
1437  //for FD
1438  else if(orig == 5){
1439  //fill histo for FD
1440  Double_t arrayMCRecoFeeddown[4] = {pt, countMult, spherocity, rapid};
1441  fMCRecoFeeddown->Fill(arrayMCRecoFeeddown);
1442  }
1443 
1444  Double_t arrayMCReco[4] = {pt, countMult, spherocity, rapid};
1445  fMCRecoBothPromptFD->Fill(arrayMCReco);
1446 
1447 }
1448 
1449 //__________________________________________________________________________________________________
1450 void AliAnalysisTaskSEDvsEventShapes::FillMCGenAccHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t countMult, Double_t spherocity){
1451 
1453 
1454  Int_t nProng=2;
1455  Int_t totPart = arrayMC->GetEntriesFast();
1456 
1457  if(fPdgMeson==421){
1458  nProng=2;
1459  }else if(fPdgMeson==411 || fPdgMeson==431){
1460  nProng=3;
1461  }
1462 
1463  Double_t zMCVertex = mcHeader->GetVtxZ(); //vertex MC
1464 
1465  for(Int_t iPart=0; iPart<totPart; iPart++){
1466  AliAODMCParticle* mcGenPart = dynamic_cast<AliAODMCParticle*>(arrayMC->At(iPart));
1467 
1468  if (TMath::Abs(mcGenPart->GetPdgCode()) == fPdgMeson){
1469  Int_t orig=AliVertexingHFUtils::CheckOrigin(arrayMC,mcGenPart,fUseQuarkTag);//Prompt = 4, FeedDown = 5
1470 
1471  Int_t deca = 0;
1472  Bool_t isGoodDecay=kFALSE;
1473  Int_t labDau[4]={-1,-1,-1,-1};
1474  Bool_t isInAcc = kFALSE;
1475  Bool_t isFidAcc = kFALSE;
1476 
1477  if(fPdgMeson==421){
1478  deca=AliVertexingHFUtils::CheckD0Decay(arrayMC,mcGenPart,labDau);
1479  if(mcGenPart->GetNDaughters()!=2) continue;
1480  if(deca==1) isGoodDecay=kTRUE;
1481  }else if(fPdgMeson==411){
1482  deca=AliVertexingHFUtils::CheckDplusDecay(arrayMC,mcGenPart,labDau);
1483  if(deca>0) isGoodDecay=kTRUE;
1484  }else if(fPdgMeson==431){
1485  deca=AliVertexingHFUtils::CheckDsDecay(arrayMC,mcGenPart,labDau);
1486  if(deca==1) isGoodDecay=kTRUE;
1487  }else if(fPdgMeson==413){
1488  deca=AliVertexingHFUtils::CheckDstarDecay(arrayMC,mcGenPart,labDau);
1489  if(deca==1) isGoodDecay=kTRUE;
1490  }
1491 
1492  if(labDau[0]==-1){
1493  continue; //protection against unfilled array of labels
1494  }
1495 
1496  Double_t pt = mcGenPart->Pt();
1497  Double_t rapid = mcGenPart->Y();
1498 
1499  isFidAcc=fRDCutsAnalysis->IsInFiducialAcceptance(pt,rapid);
1500  isInAcc=CheckGenAcc(arrayMC,nProng,labDau);
1501 
1502  if(isGoodDecay && TMath::Abs(zMCVertex) < fRDCutsAnalysis->GetMaxVtxZ() && isFidAcc && isInAcc) {
1503  //for prompt
1504  if(orig == 4){
1505  //fill histo for prompt
1506  Double_t arrayMCGenPrompt[4] = {pt, countMult, spherocity, rapid};
1507  fMCAccGenPrompt->Fill(arrayMCGenPrompt);
1508  }
1509  //for FD
1510  else if(orig == 5){
1511  //fill histo for FD
1512  Double_t arrayMCGenFeeddown[4] = {pt, countMult, spherocity, rapid};
1513  fMCAccGenFeeddown->Fill(arrayMCGenFeeddown);
1514  }
1515  else
1516  continue;
1517  }
1518  }
1519  }
1520 }
1521 
1522 //_________________________________________________________________
1523 Bool_t AliAnalysisTaskSEDvsEventShapes::CheckGenAcc(TClonesArray* arrayMC, Int_t nProng, Int_t *labDau){
1525  for (Int_t iProng = 0; iProng<nProng; iProng++){
1526  AliAODMCParticle* mcPartDaughter=dynamic_cast<AliAODMCParticle*>(arrayMC->At(labDau[iProng]));
1527  if(!mcPartDaughter) return kFALSE;
1528  Double_t eta = mcPartDaughter->Eta();
1529  Double_t pt = mcPartDaughter->Pt();
1530  if (TMath::Abs(eta) > fEtaAccCut || pt < fPtAccCut) return kFALSE;
1531  }
1532  return kTRUE;
1533 }
Double_t fetaMin
pt limits for acceptance step
Int_t charge
Bool_t IsEventRejectedDueToCentrality() const
Definition: AliRDHFCuts.h:311
Bool_t CheckGenAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
Int_t pdg
TH2F * fHistMultCorrvsMultRawEvWithD
hist. for Ntracklets in eta<1 with and w/o corrections for events with a candidate in D mass peak ...
Bool_t IsEventRejectedDueToZVertexOutsideFiducialRegion() const
Definition: AliRDHFCuts.h:305
TH2F * fHistNtrEta05vsNtrEta1EvWithD
hist. for Ntracklets in eta<1.6 vs. eta<1. for events with a candidate in D mass peak ...
TH2F * fHistNtrEta05vsNtrEta1EvSel
hist. for Ntracklets in eta<1.6 vs. eta<1.
TH2F * fHistNtrCorrVsSo
hist of ntracklets vs So
static Int_t CheckDplusDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
TH2F * fHistNtrEtaV0AvsNtrEta1EvWithCand
hist. for Ntracklets in eta<0.3 vs. eta<1. for events with a candidate
Bool_t IsEventRejectedDueToNotRecoVertex() const
Definition: AliRDHFCuts.h:299
TH1F * fHistNtrUnCorrPSTrigPileUpVtxContSel
hist. of ntracklets for physics selection + trigger name + pileup + with-vertex selected events ...
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
TH2F * fHistNtrEta03vsNtrEta1EvWithD
hist. for Ntracklets in eta<0.5 vs. eta<1. for events with a candidate in D mass peak ...
Double_t DeltaInvMass() const
TH2F * fHistNtrCorrEta1vsNtrRawEta1EvWithCand
hist. for V0M raw mult vs V0M equalized multiplicity for events with a candidate
void FillMCGenAccHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t countMult, Double_t spherocity)
AliNormalizationCounter * fCounterCandidates
Counter for normalization, uncorrected multiplicity.
TH2F * fHistNtrCorrEta1vsNtrRawEta1EvWithD
hist. for V0M raw mult vs V0M equalized multiplicity with a candidate in D mass peak ...
Int_t GetIsSelectedCuts() const
Definition: AliRDHFCuts.h:334
TH1F * fHistNtrUnCorrPSSel
hist of Nch (generated) vs Nch (Primary) vs Nch (Physical Primary)
static Int_t CheckDstarDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
TH2F * fHistNtrEta03vsNtrEta1EvSel
hist. for Ntracklets in eta<0.5 vs. eta<1.
Bool_t HasSelectionBit(Int_t i) const
TH2F * fHistNtrEta16vsNtrEta1EvWithCand
hist. for multiplicity with and w/o corrections
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray, Bool_t isV0=kFALSE) const
TH1F * fHistNtrUnCorrPSTrigPileUpVtxRangeSel
hist. of ntracklets for physics selection + trigger name + pileup + with-vertex-contrib selected even...
TH2F * fHistNtrEtaV0AvsV0AEqEvWithCand
hist. for Ntracklets in eta-V0M vs. eta<1. for events with a candidate
Double_t mass
TH2F * fHistMultCorrvsMultRawEvWithCand
hist. for Ntracklets in eta<1 with and w/o corrections for events with a candidate ...
THnSparseD * fMCAccGenFeeddown
histo for StepMCGenAcc for D meson prompt
TH2F * fHistNtrEtaV0AvsV0AEqEvWithD
hist. for Ntracklets in eta-V0M vs. eta<1. for events with a candidate in D mass peak ...
THnSparseD * fSparseSpherocity
hist. of Pt vs Mult vs. mass (MC true candidates before reconstruction)
Double_t ImpParXY() const
THnSparseD * fMCRecoFeeddown
histo for StepMCReco for D meson feeddown
TH2F * fHistNtrVsNchMCPhysicalPrimary
hist of ntracklets vs Nch (Primary)
TH2F * fHistNtrCorrVsNchMCPhysicalPrimary
hist of ntracklets vs Nch (Physical Primary)
Bool_t IsEventRejectedDueToVertexContributors() const
Definition: AliRDHFCuts.h:302
TH3F * fPtVsMassVsMultMC
hist. of ntracklets for evnts with a candidate in D mass peak
static Int_t CheckDsDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
Int_t GetWhyRejection() const
Definition: AliRDHFCuts.h:294
TH2F * fHistNtrVsNchMC
hist of ntracklets vs So
TH1F * fHistNtrCorrPSSel
hist. of ntracklets for evnts with a candidate in D mass peak
TH2F * fHistNtrEtaV0AvsNtrEta1EvWithD
hist. for Ntracklets in eta<0.3 vs. eta<1. for events with a candidate in D mass peak ...
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:241
void FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Double_t countMult, Double_t spherocity)
TH2F * fHistNtrCorrVsZvtx
hist of ntracklets vs Zvertex
TH2F * fHistNtrEta16vsNtrEta1EvWithD
hist. for multiplicity with and w/o corrections for events with a candidate
THnSparseF * fHistMassPtImpPar[5]
histo for StepMCReco for D meson Both Prompt Feeddown
TH2F * fHistNtrVsZvtx
hist. for multiplicity with and w/o corrections for events with a candidate in D mass peak ...
TH1F * fHistNtrUnCorrPSTrigPileUpVtxRangeCentrSel
hist. of ntracklets for physics selection + trigger name + pileup + with-vertex-contrib-range selecte...
Bool_t fDoImpPar
Counter for normalization, corrected multiplicity for candidates.
TList * fListProfiles
list send on output slot 3
THnSparseD * fMCRecoPrompt
histo for StepMCGenAcc for D meson feeddown
static Double_t GetVZEROCEqualizedMultiplicity(AliAODEvent *ev)
Class for cuts on AOD reconstructed D+->Kpipi.
void SetStudyMultiplicity(Bool_t flag, Float_t etaRange)
Double_t massD
static Double_t GetSpherocity(AliAODEvent *aod, Double_t etaMin=-0.8, Double_t etaMax=0.8, Double_t ptMin=0.15, Double_t ptMax=10., Int_t filtbit1=256, Int_t filtbit2=512, Int_t minMult=3, Double_t phiStepSizeDeg=0.1)
Functions for event shape variables.
TH2F * fHistNtrCorrVsNchMC
hist of ntracklets vs Nch (Generated)
TH2F * fHistNtrEtaV0MvsNtrEta1EvWithD
hist. for Ntracklets in eta-V0A vs. eta<1. for events with a candidate in D mass peak ...
TH2F * fHistNtrEtaV0MvsV0MEqEvSel
hist. for V0A raw mult vs V0A equalized multiplicity
THnSparseD * fSparseSpherocitywithNoPid
THnSparse histograms for Spherocity studies.
TH2F * fHistNtrEtaV0MvsV0MEqEvWithD
hist. for V0A raw mult vs V0A equalized multiplicity with a candidate in D mass peak ...
TH2F * fHistNtrVsNchMCPrimary
hist of ntracklets vs Nch (Generated)
TH3F * fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary
hist. of geenrated multiplcity
AliNormalizationCounter * fCounterU
Counter for normalization, corrected multiplicity.
static Int_t CheckD0Decay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
TH2F * fHistNtrEtaV0AvsV0AEqEvSel
hist. for Ntracklets in eta-V0M vs. eta<1.
void SetStudySpherocity(Bool_t flag, Double_t nsteps=100.)
TH2F * fHistNtrEta05vsNtrEta1EvWithCand
hist. for Ntracklets in eta<1.6 vs. eta<1. for events with a candidate
Bool_t IsEventRejectedDueToPileup() const
Definition: AliRDHFCuts.h:308
TH1F * fHistNtrCorrEvSel
hist. of ntracklets for physics selection only selected events
void SetMassLimits(Double_t lowlimit, Double_t uplimit)
TH2F * fHistNtrEtaV0MvsV0MEqEvWithCand
hist. for V0A raw mult vs V0A equalized multiplicity for events with a candidate
TH2F * fHistNtrEta16vsNtrEta1EvSel
hist. for No. of events
TH2F * fHistNtrVsSo
hist of ntracklets vs Zvertex
TH1F * fHistNtrUnCorrEvWithD
hist. of ntracklets for evnts with a candidate
TH2F * fHistNtrEta03vsNtrEta1EvWithCand
hist. for Ntracklets in eta<0.5 vs. eta<1. for events with a candidate
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)
TH1F * fHistNtrCorrEvWithD
hist. of ntracklets for evnts with a candidate
Bool_t IsEventRejectedDuePhysicsSelection() const
Definition: AliRDHFCuts.h:320
TProfile * GetEstimatorHistogram(const AliVEvent *event)
TH1F * fHistNtrCorrEvWithCand
hist. of ntracklets for selected events
ClassImp(AliAnalysisTaskSEDvsEventShapes) AliAnalysisTaskSEDvsEventShapes
static Double_t GetCorrectedNtracklets(TProfile *estimatorAvg, Double_t uncorrectedNacc, Double_t vtxZ, Double_t refMult)
THnSparseD * fMCRecoBothPromptFD
histo for StepMCReco for D meson feeddown
Bool_t IsEventSelected(AliVEvent *event)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
Double_t fUpmasslimit
histograms for impact paramter studies
TList * fOutputEffCorr
list of profile histos for z-vtx correction
Double_t fPtAccCut
eta limits for acceptance step
Bool_t IsSelected(TObject *obj)
Definition: AliRDHFCuts.h:274
TH1F * fHistNtrUnCorrPSTrigSel
hist. of ntracklets for physics selection only selected events
TH1F * fHistNtrUnCorrEvSel
hist. of ntracklets for physics selection + trigger name + pileup + with-vertex-contrib-range + centr...
TList * fListCuts
list send on output slot 1
TH1F * fHistGenPrimaryParticlesInelGt0
hist of ntracklets vs Nch (Physical Primary)
static Double_t GetVZEROAEqualizedMultiplicity(AliAODEvent *ev)
Utilities for V0 multiplicity checks.
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:296
TH1F * fHistNtrUnCorrPSTrigPileUpSel
hist. of ntracklets for physics selection + trigger name selected events
static Double_t GetTrueImpactParameterDzero(AliAODMCHeader *mcHeader, TClonesArray *arrayMC, AliAODMCParticle *partDp)
Functions for computing true impact parameter of D meson.
const Int_t nbins
TH2F * fHistMultCorrvsMultRawEvSel
hist. for Ntracklets in eta<1 with and w/o corrections
TH2F * fHistNtrCorrVsNchMCPrimary
hist of ntracklets vs Nch (Primary)
TH1F * fHistNtrUnCorrPSTrigPileUpVtxSel
hist. of ntracklets for physics selection + trigger name + pileup selected events ...
AliAODRecoDecayHF2Prong * Get2Prong() const
THnSparseD * fMCAccGenPrompt
THnSparse histograms for Spherocity studies.
static Double_t GetTrueImpactParameterDplus(AliAODMCHeader *mcHeader, TClonesArray *arrayMC, AliAODMCParticle *partDp)
Double_t fEtaAccCut
flag for quark/hadron level identification of prompt and feeddown
TH2F * fHistNtrEtaV0MvsNtrEta1EvSel
hist. for Ntracklets in eta-V0A vs. eta<1.
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
Definition: AliRDHFCuts.h:291
TH2F * fHistNtrEtaV0MvsNtrEta1EvWithCand
hist. for Ntracklets in eta-V0A vs. eta<1. for events with a candidate
static Double_t GetSphericity(AliAODEvent *aod, Double_t etaMin=-0.8, Double_t etaMax=0.8, Double_t ptMin=0.15, Double_t ptMax=10., Int_t filtbit1=256, Int_t filtbit2=512, Int_t minMult=3)
TH2F * fHistNtrEtaV0AvsNtrEta1EvSel
hist. for Ntracklets in eta<0.3 vs. eta<1.
TH1F * fHistNtrUnCorrEvWithCand
hist. of ntracklets for selected events
TH1F * fHistNEvents
list send on output slot 5
TH2F * fHistNtrCorrEta1vsNtrRawEta1EvSel
hist. for V0M raw mult vs V0M equalized multiplicity