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