AliPhysics  ed43440 (ed43440)
AliAnalysisTaskSEDs.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 2007-2009, 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 
19 // //
20 // Analysis task to produce Ds candidates mass spectra //
21 // Origin: F.Prino, Torino, prino@to.infn.it //
22 // //
24 
25 #include <TClonesArray.h>
26 #include <TNtuple.h>
27 #include <TList.h>
28 #include <TString.h>
29 #include <TH1F.h>
30 #include <TMath.h>
31 #include <THnSparse.h>
32 #include <TDatabasePDG.h>
33 #include <Riostream.h>
34 
35 #include "AliAnalysisManager.h"
36 #include "AliAODHandler.h"
37 #include "AliAODEvent.h"
38 #include "AliAODVertex.h"
39 #include "AliAODTrack.h"
40 #include "AliAODMCHeader.h"
41 #include "AliAODMCParticle.h"
42 #include "AliAODRecoDecay.h"
44 #include "AliAnalysisVertexingHF.h"
45 #include "AliRDHFCutsDstoKKpi.h"
46 #include "AliAnalysisTaskSE.h"
48 #include "AliAnalysisTaskSEDs.h"
49 #include "AliVertexingHFUtils.h"
50 
52 ClassImp(AliAnalysisTaskSEDs);
54 
55 //________________________________________________________________________
57  fOutput(0),
58  fHistNEvents(0),
59  fHistoPtWeight(0x0),
60  fPtVsMass(0),
61  fPtVsMassPhi(0),
62  fPtVsMassK0st(0),
63  fYVsPt(0),
64  fYVsPtSig(0),
65  fHistAllV0multNTPCout(0),
66  fHistSelV0multNTPCout(0),
67  fCosPHist3D(0x0),
68  fCosPxyHist3D(0x0),
69  fDLenHist3D(0x0),
70  fDLenxyHist3D(0x0),
71  fNDLenxyHist3D(0x0),
72  fSigVertHist3D(0x0),
73  fDCAHist3D(0x0),
74  fNormIPHist3D(0x0),
75  fCosPiDsHist3D(0x0),
76  fCosPiKPhiHist3D(0x0),
77  fPtProng0Hist3D(0x0),
78  fPtProng1Hist3D(0x0),
79  fPtProng2Hist3D(0x0),
80  fNtupleDs(0),
81  fFillNtuple(0),
82  fUseCentrAxis(0),
83  fSystem(0),
84  fReadMC(kFALSE),
85  fWriteOnlySignal(kFALSE),
86  fDoCutVarHistos(kTRUE),
87  fUseSelectionBit(kFALSE),
88  fFillSparse(kTRUE),
89  fFillSparseDplus(kFALSE),
90  fFillImpParSparse(kFALSE),
91  fFillAcceptanceLevel(kTRUE),
92  fDoRotBkg(kFALSE),
93  fDoBkgPhiSB(kFALSE),
94  fDoCutV0multTPCout(kFALSE),
95  fUseWeight(kFALSE),
96  fUseTrkl(kFALSE),
97  fAODProtection(1),
98  fNPtBins(0),
99  fListCuts(0),
100  fMassRange(0.8),
101  fMassBinSize(0.002),
102  fminMass(1.6),
103  fmaxMass(2.5),
104  fMaxDeltaPhiMass4Rot(0.010),
105  fCounter(0),
106  fAnalysisCuts(0),
107  fnSparse(0),
108  fImpParSparse(0x0),
109  fMultSelectionObjectName("MultSelection"),
110  fCentEstName("off")
111 {
113 
114  for (Int_t i = 0; i < 3; i++)
115  {
116  fHistCentrality[i] = 0;
117  fHistCentralityMult[i] = 0;
118  }
119  for (Int_t i = 0; i < 4; i++)
120  {
121  fChanHist[i] = 0;
122  }
123  for (Int_t i = 0; i < 4 * kMaxPtBins; i++)
124  {
125  fPtCandHist[i] = 0;
126  fMassHist[i] = 0;
127  fMassHistPhi[i] = 0;
128  fMassHistK0st[i] = 0;
129  fCosPHist[i] = 0;
130  fDLenHist[i] = 0;
131  fSumd02Hist[i] = 0;
132  fSigVertHist[i] = 0;
133  fPtMaxHist[i] = 0;
134  fDCAHist[i] = 0;
135  fPtProng0Hist[i] = 0;
136  fPtProng1Hist[i] = 0;
137  fPtProng2Hist[i] = 0;
138  fDalitz[i] = 0;
139  fDalitzPhi[i] = 0;
140  fDalitzK0st[i] = 0;
141  }
142  for (Int_t i = 0; i < kMaxPtBins; i++)
143  {
144  fMassHistKK[i] = 0;
145  fMassHistKpi[i] = 0;
146  fMassRotBkgHistPhi[i] = 0;
147  fMassLSBkgHistPhi[i] = 0;
148  fMassRSBkgHistPhi[i] = 0;
149  }
150  for (Int_t i = 0; i < kMaxPtBins + 1; i++)
151  {
152  fPtLimits[i] = 0;
153  }
154  for (Int_t i = 0; i < 4; i++)
155  {
156  fnSparseMC[i] = 0;
157  fnSparseMCDplus[i] = 0;
158  fImpParSparseMC[i] = 0;
159  }
160 }
161 
162 //________________________________________________________________________
163 AliAnalysisTaskSEDs::AliAnalysisTaskSEDs(const char *name, AliRDHFCutsDstoKKpi *analysiscuts, Int_t fillNtuple) : AliAnalysisTaskSE(name),
164  fOutput(0),
165  fHistNEvents(0),
166  fHistoPtWeight(0x0),
167  fPtVsMass(0),
168  fPtVsMassPhi(0),
169  fPtVsMassK0st(0),
170  fYVsPt(0),
171  fYVsPtSig(0),
174  fCosPHist3D(0x0),
175  fCosPxyHist3D(0x0),
176  fDLenHist3D(0x0),
177  fDLenxyHist3D(0x0),
178  fNDLenxyHist3D(0x0),
179  fSigVertHist3D(0x0),
180  fDCAHist3D(0x0),
181  fNormIPHist3D(0x0),
182  fCosPiDsHist3D(0x0),
183  fCosPiKPhiHist3D(0x0),
184  fPtProng0Hist3D(0x0),
185  fPtProng1Hist3D(0x0),
186  fPtProng2Hist3D(0x0),
187  fNtupleDs(0),
188  fFillNtuple(fillNtuple),
189  fUseCentrAxis(0),
190  fSystem(0),
191  fReadMC(kFALSE),
192  fWriteOnlySignal(kFALSE),
193  fDoCutVarHistos(kTRUE),
194  fUseSelectionBit(kFALSE),
195  fFillSparse(kTRUE),
196  fFillSparseDplus(kFALSE),
197  fFillImpParSparse(kFALSE),
198  fFillAcceptanceLevel(kTRUE),
199  fDoRotBkg(kTRUE),
200  fDoBkgPhiSB(kTRUE),
201  fDoCutV0multTPCout(kFALSE),
202  fUseWeight(kFALSE),
203  fUseTrkl(kFALSE),
204  fAODProtection(1),
205  fNPtBins(0),
206  fListCuts(0),
207  fMassRange(0.8),
208  fMassBinSize(0.002),
209  fminMass(1.6),
210  fmaxMass(2.5),
211  fMaxDeltaPhiMass4Rot(0.010),
212  fCounter(0),
213  fAnalysisCuts(analysiscuts),
214  fnSparse(0),
215  fImpParSparse(0x0),
216  fMultSelectionObjectName("MultSelection"),
217  fCentEstName("off")
218 {
221 
222  for (Int_t i = 0; i < 3; i++)
223  {
224  fHistCentrality[i] = 0;
225  fHistCentralityMult[i] = 0;
226  }
227  for (Int_t i = 0; i < 4; i++)
228  {
229  fChanHist[i] = 0;
230  }
231  for (Int_t i = 0; i < 4 * kMaxPtBins; i++)
232  {
233  fPtCandHist[i] = 0;
234  fMassHist[i] = 0;
235  fMassHistPhi[i] = 0;
236  fMassHistK0st[i] = 0;
237  fCosPHist[i] = 0;
238  fDLenHist[i] = 0;
239  fSumd02Hist[i] = 0;
240  fSigVertHist[i] = 0;
241  fPtMaxHist[i] = 0;
242  fDCAHist[i] = 0;
243  fPtProng0Hist[i] = 0;
244  fPtProng1Hist[i] = 0;
245  fPtProng2Hist[i] = 0;
246  fDalitz[i] = 0;
247  fDalitzPhi[i] = 0;
248  fDalitzK0st[i] = 0;
249  }
250  for (Int_t i = 0; i < kMaxPtBins; i++)
251  {
252  fMassHistKK[i] = 0;
253  fMassHistKpi[i] = 0;
254  fMassRotBkgHistPhi[i] = 0;
255  fMassLSBkgHistPhi[i] = 0;
256  fMassRSBkgHistPhi[i] = 0;
257  }
258  for (Int_t i = 0; i < kMaxPtBins + 1; i++)
259  {
260  fPtLimits[i] = 0;
261  }
262 
263  for (Int_t i = 0; i < 4; i++)
264  {
265  fnSparseMC[i] = 0;
266  fnSparseMCDplus[i] = 0;
267  fImpParSparseMC[i] = 0;
268  }
269 
272  SetPtBins(nptbins, ptlim);
273 
274  DefineOutput(1, TList::Class()); //My private output
275 
276  DefineOutput(2, TList::Class());
277 
278  DefineOutput(3, AliNormalizationCounter::Class());
279 
280  if (fFillNtuple > 0)
281  {
282  // Output slot #4 writes into a TNtuple container
283  DefineOutput(4, TNtuple::Class()); //My private output
284  }
285 }
286 
287 //________________________________________________________________________
289 {
291  if (n > kMaxPtBins)
292  {
293  printf("Max. number of Pt bins = %d\n", kMaxPtBins);
295  fPtLimits[0] = 0.;
296  fPtLimits[1] = 1.;
297  fPtLimits[2] = 3.;
298  fPtLimits[3] = 5.;
299  fPtLimits[4] = 10.;
300  for (Int_t i = 5; i < kMaxPtBins + 1; i++)
301  fPtLimits[i] = 99999999.;
302  }
303  else
304  {
305  fNPtBins = n;
306  for (Int_t i = 0; i < fNPtBins + 1; i++)
307  fPtLimits[i] = lim[i];
308  for (Int_t i = fNPtBins + 1; i < kMaxPtBins + 1; i++)
309  fPtLimits[i] = 99999999.;
310  }
311  if (fDebug > 1)
312  {
313  printf("Number of Pt bins = %d\n", fNPtBins);
314  for (Int_t i = 0; i < fNPtBins; i++)
315  printf(" Bin%d = %8.2f-%8.2f\n", i, fPtLimits[i], fPtLimits[i + 1]);
316  }
317 }
318 //________________________________________________________________________
320 {
321  // Destructor
322  if (fOutput && !fOutput->IsOwner())
323  {
324  delete fHistNEvents;
325  delete fHistAllV0multNTPCout;
326  delete fHistSelV0multNTPCout;
327  delete fCosPHist3D;
328  delete fCosPxyHist3D;
329  delete fDLenHist3D;
330  delete fDLenxyHist3D;
331  delete fNDLenxyHist3D;
332  delete fSigVertHist3D;
333  delete fDCAHist3D;
334  delete fNormIPHist3D;
335  delete fCosPiDsHist3D;
336  delete fCosPiKPhiHist3D;
337  delete fPtProng0Hist3D;
338  delete fPtProng1Hist3D;
339  delete fPtProng2Hist3D;
340 
341  for (Int_t i = 0; i < 4; i++)
342  {
343  delete fChanHist[i];
344  }
345  for (Int_t i = 0; i < 4 * fNPtBins; i++)
346  {
347  delete fMassHist[i];
348  delete fMassHistPhi[i];
349  delete fMassHistK0st[i];
350  delete fCosPHist[i];
351  delete fDLenHist[i];
352  delete fSumd02Hist[i];
353  delete fSigVertHist[i];
354  delete fPtMaxHist[i];
355  delete fPtCandHist[i];
356  delete fDCAHist[i];
357  delete fPtProng0Hist[i];
358  delete fPtProng1Hist[i];
359  delete fPtProng2Hist[i];
360  delete fDalitz[i];
361  delete fDalitzPhi[i];
362  delete fDalitzK0st[i];
363  }
364  for (Int_t i = 0; i < fNPtBins; i++)
365  {
366  delete fMassHistKK[i];
367  delete fMassHistKpi[i];
368  delete fMassRotBkgHistPhi[i];
369  delete fMassLSBkgHistPhi[i];
370  delete fMassRSBkgHistPhi[i];
371  }
372  delete fPtVsMass;
373  delete fPtVsMassPhi;
374  delete fPtVsMassK0st;
375  delete fYVsPt;
376  delete fYVsPtSig;
377  for (Int_t i = 0; i < 3; i++)
378  {
379  delete fHistCentrality[i];
380  delete fHistCentralityMult[i];
381  }
382 
383  delete fnSparse;
384  if (fFillImpParSparse)
385  {
386  delete fImpParSparse;
387  for (Int_t i = 0; i < 4; i++)
388  delete fImpParSparseMC[i];
389  }
390  for (Int_t i = 0; i < 4; i++)
391  {
392  delete fnSparseMC[i];
393  if (fFillSparseDplus)
394  delete fnSparseMCDplus[i];
395  }
396  }
397  if (fHistoPtWeight)
398  delete fHistoPtWeight;
399  delete fOutput;
400  delete fListCuts;
401  delete fNtupleDs;
402  delete fCounter;
403  delete fAnalysisCuts;
404 }
405 
406 //________________________________________________________________________
408 {
409  //
410  // set centrality estimator
411  //
412  switch(flag)
413  {
414  case 0:
415  fCentEstName = "off";
416  break;
417  case 1:
418  fCentEstName = "V0M";
419  break;
420  case 2:
421  fCentEstName = "TRK";
422  break;
423  case 3:
424  fCentEstName = "TKL";
425  break;
426  case 4:
427  fCentEstName = "CL1";
428  break;
429  case 5:
430  fCentEstName = "ZNA";
431  break;
432  case 6:
433  fCentEstName = "ZPA";
434  break;
435  case 7:
436  fCentEstName = "V0A";
437  break;
438  case 8:
439  fCentEstName = "CL0";
440  break;
441  default:
442  AliWarning("Centrality estimator not valid");
443  break;
444  }
445 
446  return;
447 }
448 
449 //________________________________________________________________________
451 {
453 
454  if (fDebug > 1)
455  printf("AnalysisTaskSEDs::Init() \n");
456 
457  fListCuts = new TList();
458  fListCuts->SetOwner();
459  fListCuts->SetName("CutObjects");
460 
462  analysis->SetName("AnalysisCuts");
463 
464  if(fUseCentrAxis) {
465  Int_t centest = fAnalysisCuts->GetUseCentrality();
466  GetCentralityAxisName(centest);
467  }
468 
469  fListCuts->Add(analysis);
470  PostData(2, fListCuts);
471  return;
472 }
473 
474 //________________________________________________________________________
476 {
478  //
479  if (fDebug > 1)
480  printf("AnalysisTaskSEDs::UserCreateOutputObjects() \n");
481 
482  // Several histograms are more conveniently managed in a TList
483  fOutput = new TList();
484  fOutput->SetOwner();
485  fOutput->SetName("OutputHistos");
486 
487  fHistNEvents = new TH1F("hNEvents", "number of events ", 16, -0.5, 15.5);
488  fHistNEvents->GetXaxis()->SetBinLabel(1, "nEventsRead");
489  fHistNEvents->GetXaxis()->SetBinLabel(2, "nEvents Matched dAOD");
490  fHistNEvents->GetXaxis()->SetBinLabel(3, "nEvents Mismatched dAOD");
491  fHistNEvents->GetXaxis()->SetBinLabel(4, "nEventsAnal");
492  fHistNEvents->GetXaxis()->SetBinLabel(5, "n. passing IsEvSelected");
493  fHistNEvents->GetXaxis()->SetBinLabel(6, "n. rejected due to trigger");
494  fHistNEvents->GetXaxis()->SetBinLabel(7, "n. rejected due to not reco vertex");
495  fHistNEvents->GetXaxis()->SetBinLabel(8, "n. rejected for contr vertex");
496  fHistNEvents->GetXaxis()->SetBinLabel(9, "n. rejected for vertex out of accept");
497  fHistNEvents->GetXaxis()->SetBinLabel(10, "n. rejected for pileup events");
498  fHistNEvents->GetXaxis()->SetBinLabel(11, "no. of out centrality events");
499  fHistNEvents->GetXaxis()->SetBinLabel(12, "no. of 3 prong candidates");
500  fHistNEvents->GetXaxis()->SetBinLabel(13, "no. of Ds after filtering cuts");
501  fHistNEvents->GetXaxis()->SetBinLabel(14, "no. of Ds after selection cuts");
502  fHistNEvents->GetXaxis()->SetBinLabel(15, "no. of not on-the-fly rec Ds");
503  fHistNEvents->GetXaxis()->SetBinLabel(16, "no. of Ds rejected by preselect");
504 
505  fHistNEvents->GetXaxis()->SetNdivisions(1, kFALSE);
506 
507  fHistNEvents->SetMinimum(0);
508  fOutput->Add(fHistNEvents);
509 
510  fHistCentrality[0] = new TH1F("hCentr", "centrality", 10000, 0., 100.);
511  fHistCentrality[1] = new TH1F("hCentr(selectedCent)", "centrality(selectedCent)", 10000, 0., 100.);
512  fHistCentrality[2] = new TH1F("hCentr(OutofCent)", "centrality(OutofCent)", 10000, 0., 100.);
513  fHistCentralityMult[0] = new TH2F("hCentrMult", "centrality vs mult", 100, 0.5, 30000.5, 40, 0., 100.);
514  fHistCentralityMult[1] = new TH2F("hCentrMult(selectedCent)", "centrality vs mult(selectedCent)", 100, 0.5, 30000.5, 40, 0., 100.);
515  fHistCentralityMult[2] = new TH2F("hCentrMult(OutofCent)", "centrality vs mult(OutofCent)", 100, 0.5, 30000.5, 40, 0., 100.);
516  for (Int_t i = 0; i < 3; i++)
517  {
518  fOutput->Add(fHistCentrality[i]);
519  fOutput->Add(fHistCentralityMult[i]);
520  }
521  if (fDoCutV0multTPCout)
522  {
523  fHistAllV0multNTPCout = new TH2F("HistAllV0multNTPCout", "V0mult vs # TPCout (all) ;V0mult ;# TPCout", 1000, 0., 40000, 1000, 0, 30000);
524  fHistSelV0multNTPCout = new TH2F("HistSelV0multNTPCout", "V0mult vs # TPCout (sel) ;V0mult ;# TPCout", 1000, 0., 40000, 1000, 0, 30000);
527  }
528 
529  Double_t massDs = TDatabasePDG::Instance()->GetParticle(431)->Mass();
530 
531  Int_t nInvMassBins = (Int_t)(fMassRange / fMassBinSize + 0.5);
532  if (nInvMassBins % 2 == 1)
533  nInvMassBins++;
534  Double_t minMass = massDs - 0.5 * nInvMassBins * fMassBinSize;
535  Double_t maxMass = massDs + 0.5 * nInvMassBins * fMassBinSize;
536  fminMass = minMass;
537  fmaxMass = maxMass;
538 
539  TString hisname;
540  TString htype;
541  Int_t index;
542  for (Int_t iType = 0; iType < 4; iType++)
543  {
544  for (Int_t i = 0; i < fNPtBins; i++)
545  {
546  if (iType == 0)
547  {
548  htype = "All";
549  index = GetHistoIndex(i);
550  }
551  else if (iType == 1)
552  {
553  htype = "Sig";
554  index = GetSignalHistoIndex(i);
555  }
556  else if (iType == 2)
557  {
558  htype = "Bkg";
559  index = GetBackgroundHistoIndex(i);
560  }
561  else
562  {
563  htype = "ReflSig";
564  index = GetReflSignalHistoIndex(i);
565  }
566  hisname.Form("hMass%sPt%d", htype.Data(), i);
567  fMassHist[index] = new TH1F(hisname.Data(), hisname.Data(), nInvMassBins, minMass, maxMass);
568  fMassHist[index]->Sumw2();
569  hisname.Form("hMass%sPt%dphi", htype.Data(), i);
570  fMassHistPhi[index] = new TH1F(hisname.Data(), hisname.Data(), nInvMassBins, minMass, maxMass);
571  fMassHistPhi[index]->Sumw2();
572  hisname.Form("hMass%sPt%dk0st", htype.Data(), i);
573  fMassHistK0st[index] = new TH1F(hisname.Data(), hisname.Data(), nInvMassBins, minMass, maxMass);
574  fMassHistK0st[index]->Sumw2();
575  hisname.Form("hCosP%sPt%d", htype.Data(), i);
576  fCosPHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0.5, 1.);
577  hisname.Form("hCosPxy%sPt%d", htype.Data(), i);
578  fCosPxyHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0.5, 1.);
579  hisname.Form("hDLen%sPt%d", htype.Data(), i);
580  fDLenHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0., 0.5);
581  hisname.Form("hDLenxy%sPt%d", htype.Data(), i);
582  fDLenxyHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0., 0.5);
583  hisname.Form("hNDLenxy%sPt%d", htype.Data(), i);
584  fNDLenxyHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0., 11.);
585  hisname.Form("hSumd02%sPt%d", htype.Data(), i);
586  fSumd02Hist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0., 1.);
587  hisname.Form("hSigVert%sPt%d", htype.Data(), i);
588  fSigVertHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0., 0.1);
589  hisname.Form("hPtMax%sPt%d", htype.Data(), i);
590  fPtMaxHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0.5, 20.);
591  hisname.Form("hPtCand%sPt%d", htype.Data(), i);
592  fPtCandHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0.5, 20.);
593  hisname.Form("hDCA%sPt%d", htype.Data(), i);
594  fDCAHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0., 0.1);
595  hisname.Form("hNormIP%sPt%d", htype.Data(), i);
596  fNormIPHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0., 6.);
597  hisname.Form("hCosPiDs%sPt%d", htype.Data(), i);
598  fCosPiDsHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0.5, 1.);
599  hisname.Form("hCosPiKPhi%sPt%d", htype.Data(), i);
600  fCosPiKPhiHist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0., 0.5);
601  hisname.Form("hPtProng0%sPt%d", htype.Data(), i);
602  fPtProng0Hist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0.0, 20.);
603  hisname.Form("hPtProng1%sPt%d", htype.Data(), i);
604  fPtProng1Hist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0.0, 20.);
605  hisname.Form("hPtProng2%sPt%d", htype.Data(), i);
606  fPtProng2Hist[index] = new TH1F(hisname.Data(), hisname.Data(), 100, 0.0, 20.);
607  hisname.Form("hDalitz%sPt%d", htype.Data(), i);
608  fDalitz[index] = new TH2F(hisname.Data(), hisname.Data(), 100, 0., 2., 100, 0., 2.);
609  hisname.Form("hDalitz%sPt%dphi", htype.Data(), i);
610  fDalitzPhi[index] = new TH2F(hisname.Data(), hisname.Data(), 100, 0., 2., 100, 0., 2.);
611  hisname.Form("hDalitz%sPt%dk0st", htype.Data(), i);
612  fDalitzK0st[index] = new TH2F(hisname.Data(), hisname.Data(), 100, 0., 2., 100, 0., 2.);
613  }
614  }
615 
616  for (Int_t i = 0; i < 4 * fNPtBins; i++)
617  {
618  fOutput->Add(fMassHist[i]);
619  fOutput->Add(fMassHistPhi[i]);
620  fOutput->Add(fMassHistK0st[i]);
621  fOutput->Add(fPtCandHist[i]);
622  if (fDoCutVarHistos)
623  {
624  fOutput->Add(fCosPHist[i]);
625  fOutput->Add(fCosPxyHist[i]);
626  fOutput->Add(fDLenHist[i]);
627  fOutput->Add(fDLenxyHist[i]);
628  fOutput->Add(fNDLenxyHist[i]);
629  fOutput->Add(fSumd02Hist[i]);
630  fOutput->Add(fSigVertHist[i]);
631  fOutput->Add(fPtMaxHist[i]);
632  fOutput->Add(fDCAHist[i]);
633  fOutput->Add(fNormIPHist[i]);
634  fOutput->Add(fCosPiDsHist[i]);
635  fOutput->Add(fCosPiKPhiHist[i]);
636  fOutput->Add(fPtProng0Hist[i]);
637  fOutput->Add(fPtProng1Hist[i]);
638  fOutput->Add(fPtProng2Hist[i]);
639  fOutput->Add(fDalitz[i]);
640  fOutput->Add(fDalitzPhi[i]);
641  fOutput->Add(fDalitzK0st[i]);
642  }
643  }
644 
645  fChanHist[0] = new TH1F("hChanAll", "KKpi and piKK candidates", 64, -0.5, 63.5);
646  fChanHist[1] = new TH1F("hChanSig", "KKpi and piKK candidates", 64, -0.5, 63.5);
647  fChanHist[2] = new TH1F("hChanBkg", "KKpi and piKK candidates", 64, -0.5, 63.5);
648  fChanHist[3] = new TH1F("hChanReflSig", "KKpi and piKK candidates", 64, -0.5, 63.5);
649  for (Int_t i = 0; i < 4; i++)
650  {
651  fChanHist[i]->SetMinimum(0);
652  fOutput->Add(fChanHist[i]);
653  }
654 
655  fCosPHist3D = new TH3F("fCosPHist3D", "CosP vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0.5, 1.);
656  fCosPxyHist3D = new TH3F("fCosPxyHist3D", "CosPxy vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0.5, 1.);
657  fDLenHist3D = new TH3F("fDLenHist3D", "DLen vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0., 0.5);
658  fDLenxyHist3D = new TH3F("fDLenxyHist3D", "DLenxy vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0., 0.5);
659  fNDLenxyHist3D = new TH3F("fNDLenxyHist3D", "NDLenxy vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0., 11.);
660  fSigVertHist3D = new TH3F("fSigVertHist3D", "SigVert vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0., 0.1);
661  fDCAHist3D = new TH3F("fDCAHist3D", "DCA vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0., 0.1);
662  fNormIPHist3D = new TH3F("fNormIPHist3D", "nIP vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0., 6.);
663  fCosPiDsHist3D = new TH3F("fCosPiDsHist3D", "CosPiDs vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0.5, 1.);
664  fCosPiKPhiHist3D = new TH3F("fCosPiKPhiHist3D", "CosPiKPhi vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0., 0.5);
665  fPtProng0Hist3D = new TH3F("fPtProng0Hist3D", "Pt prong0 vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0.0, 20.);
666  fPtProng1Hist3D = new TH3F("fPtProng1Hist3D", "Pt prong1 vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0.0, 20.);
667  fPtProng2Hist3D = new TH3F("fPtProng2Hist3D", "Pt prong2 vs Ds mass", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins], 0., fPtLimits[fNPtBins], 100, 0.0, 20.);
668 
669  if (!fReadMC && fDoCutVarHistos)
670  {
671  fOutput->Add(fCosPHist3D);
672  fOutput->Add(fCosPxyHist3D);
673  fOutput->Add(fDLenHist3D);
674  fOutput->Add(fDLenxyHist3D);
675  fOutput->Add(fNDLenxyHist3D);
676  fOutput->Add(fSigVertHist3D);
677  fOutput->Add(fDCAHist3D);
678  fOutput->Add(fNormIPHist3D);
679  fOutput->Add(fCosPiDsHist3D);
681  fOutput->Add(fPtProng0Hist3D);
682  fOutput->Add(fPtProng1Hist3D);
683  fOutput->Add(fPtProng2Hist3D);
684  }
685 
686  fPtVsMass = new TH2F("hPtVsMass", "PtVsMass (prod. cuts)", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins] * 2, 0., fPtLimits[fNPtBins]);
687  fPtVsMassPhi = new TH2F("hPtVsMassPhi", "PtVsMass (phi selection)", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins] * 10, 0., fPtLimits[fNPtBins]);
688  fPtVsMassK0st = new TH2F("hPtVsMassK0st", "PtVsMass (K0* selection)", nInvMassBins, minMass, maxMass, (Int_t)fPtLimits[fNPtBins] * 10, 0., fPtLimits[fNPtBins]);
689  fYVsPt = new TH2F("hYVsPt", "YvsPt (prod. cuts)", (Int_t)fPtLimits[fNPtBins] * 2, 0., fPtLimits[fNPtBins], 80, -2., 2.);
690  fYVsPtSig = new TH2F("hYVsPtSig", "YvsPt (MC, only sig., prod. cuts)", (Int_t)fPtLimits[fNPtBins] * 2, 0., fPtLimits[fNPtBins], 80, -2., 2.);
691 
692  for (Int_t i = 0; i < fNPtBins; i++)
693  {
694  hisname.Form("hMassKKPt%d", i);
695  fMassHistKK[i] = new TH1F(hisname.Data(), hisname.Data(), 200, 0.95, 1.35);
696  fMassHistKK[i]->Sumw2();
697  fOutput->Add(fMassHistKK[i]);
698  hisname.Form("hMassKpiPt%d", i);
699  fMassHistKpi[i] = new TH1F(hisname.Data(), hisname.Data(), 200, 0.7, 1.1);
700  fMassHistKpi[i]->Sumw2();
701  fOutput->Add(fMassHistKpi[i]);
702  if (fDoRotBkg)
703  {
704  hisname.Form("hMassAllPt%dphi_RotBkg", i);
705  fMassRotBkgHistPhi[i] = new TH1F(hisname.Data(), hisname.Data(), nInvMassBins, minMass, maxMass);
706  fMassRotBkgHistPhi[i]->Sumw2();
707  fOutput->Add(fMassRotBkgHistPhi[i]);
708  }
709  if (fDoBkgPhiSB)
710  {
711  hisname.Form("fMassLSBkgHistPhiPt%d", i);
712  fMassLSBkgHistPhi[i] = new TH1F(hisname.Data(), hisname.Data(), nInvMassBins, minMass, maxMass);
713  fMassLSBkgHistPhi[i]->Sumw2();
714  fOutput->Add(fMassLSBkgHistPhi[i]);
715  hisname.Form("fMassRSBkgHistPhiPt%d", i);
716  fMassRSBkgHistPhi[i] = new TH1F(hisname.Data(), hisname.Data(), nInvMassBins, minMass, maxMass);
717  fMassRSBkgHistPhi[i]->Sumw2();
718  fOutput->Add(fMassRSBkgHistPhi[i]);
719  }
720  }
721 
722  fOutput->Add(fPtVsMass);
723  fOutput->Add(fPtVsMassPhi);
724  fOutput->Add(fPtVsMassK0st);
725  fOutput->Add(fYVsPt);
726  fOutput->Add(fYVsPtSig);
727 
728  //Sparses for Cut variation
729  if (fFillSparse)
731 
732  //Sparses for Impact parameter fits
733  if (fFillImpParSparse)
735 
736  //Counter for Normalization
737  fCounter = new AliNormalizationCounter("NormalizationCounter");
738  fCounter->Init();
739 
740  PostData(1, fOutput);
741  PostData(3, fCounter);
742 
743  if (fFillNtuple > 0 && fFillNtuple < 4)
744  {
745  OpenFile(4); // 4 is the slot number of the ntuple
746 
747  fNtupleDs = new TNtuple("fNtupleDs", "Ds", "labDs:retcode:pdgcode0:Pt0:Pt1:Pt2:PtRec:P0:P1:P2:PidTrackBit0:PidTrackBit1:PidTrackBit2:PointingAngle:PointingAngleXY:DecLeng:DecLengXY:NorDecLeng:NorDecLengXY:InvMassKKpi:InvMasspiKK:sigvert:d00:d01:d02:dca:d0square:InvMassPhiKKpi:InvMassPhipiKK:InvMassK0starKKpi:InvMassK0starpiKK:cosinePiDsFrameKKpi:cosinePiDsFramepiKK:cosineKPhiFrameKKpi:cosineKPhiFramepiKK:centrality:runNumber");
748  }
749  else if (fFillNtuple == 4)
750  {
751  OpenFile(4); // 4 is the slot number of the ntuple
752 
753  fNtupleDs = new TNtuple("fNtupleDs", "Ds", "Pt:InvMass:d0:origin");
754  }
755 
756  return;
757 }
758 
759 //________________________________________________________________________
761 {
764 
765  AliAODEvent *aod = dynamic_cast<AliAODEvent *>(InputEvent());
766 
767  fHistNEvents->Fill(0); // all events
768  if (fAODProtection >= 0)
769  {
770  // Protection against different number of events in the AOD and deltaAOD
771  // In case of discrepancy the event is rejected.
772  Int_t matchingAODdeltaAODlevel = AliRDHFCuts::CheckMatchingAODdeltaAODevents();
773  if (matchingAODdeltaAODlevel < 0 || (matchingAODdeltaAODlevel == 0 && fAODProtection == 1))
774  {
775  // AOD/deltaAOD trees have different number of entries || TProcessID do not match while it was required
776  fHistNEvents->Fill(2);
777  return;
778  }
779  fHistNEvents->Fill(1);
780  }
781 
782  TClonesArray *array3Prong = 0;
783  if (!aod && AODEvent() && IsStandardAOD())
784  {
785  // In case there is an AOD handler writing a standard AOD, use the AOD
786  // event in memory rather than the input (ESD) event.
787  aod = dynamic_cast<AliAODEvent *>(AODEvent());
788  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
789  // have to taken from the AOD event hold by the AliAODExtension
790  AliAODHandler *aodHandler = (AliAODHandler *)((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
791  if (aodHandler->GetExtensions())
792  {
793  AliAODExtension *ext = (AliAODExtension *)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
794  AliAODEvent *aodFromExt = ext->GetAOD();
795  array3Prong = (TClonesArray *)aodFromExt->GetList()->FindObject("Charm3Prong");
796  }
797  }
798  else if (aod)
799  {
800  array3Prong = (TClonesArray *)aod->GetList()->FindObject("Charm3Prong");
801  }
802 
803  if (!aod || !array3Prong)
804  {
805  printf("AliAnalysisTaskSEDs::UserExec: Charm3Prong branch not found!\n");
806  return;
807  }
808 
809  // fix for temporary bug in ESDfilter
810  // the AODs with null vertex pointer didn't pass the PhysSel
811  if (!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField()) < 0.001) return;
812 
813  fHistNEvents->Fill(3); // count event
814  // Post the data already here
815  PostData(1, fOutput);
816 
818 
819  Bool_t isEvSel = fAnalysisCuts->IsEventSelected(aod);
820  Float_t ntracks = aod->GetNumberOfTracks();
821  Float_t evCentr = fAnalysisCuts->GetCentrality(aod);
822 
823  fHistCentrality[0]->Fill(evCentr);
824  fHistCentralityMult[0]->Fill(ntracks, evCentr);
826  fHistNEvents->Fill(5);
828  fHistNEvents->Fill(6);
830  fHistNEvents->Fill(7);
832  fHistNEvents->Fill(8);
834  fHistNEvents->Fill(9);
836  {
837  fHistNEvents->Fill(10);
838  fHistCentrality[2]->Fill(evCentr);
839  fHistCentralityMult[2]->Fill(ntracks, evCentr);
840  }
841 
842  Int_t runNumber = aod->GetRunNumber();
843 
844  TClonesArray *arrayMC = 0;
845  AliAODMCHeader *mcHeader = 0;
846 
847  // AOD primary vertex
848  AliAODVertex *vtx1 = (AliAODVertex *)aod->GetPrimaryVertex();
849  // vtx1->Print();
850 
851  // load MC particles
852  if (fReadMC)
853  {
854 
855  arrayMC = (TClonesArray *)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
856  if (!arrayMC)
857  {
858  printf("AliAnalysisTaskSEDs::UserExec: MC particles branch not found!\n");
859  return;
860  }
861 
862  // load MC header
863  mcHeader = (AliAODMCHeader *)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
864  if (!mcHeader)
865  {
866  printf("AliAnalysisTaskSEDs::UserExec: MC header branch not found!\n");
867  return;
868  }
869  }
870 
872 
873  if (fReadMC && fFillSparse)
874  {
875  if (aod->GetTriggerMask() == 0 && (runNumber >= 195344 && runNumber <= 195677))
876  // protection for events with empty trigger mask in p-Pb
877  return;
879  // events not passing the centrality selection can be removed immediately.
880  return;
881  Double_t zMCVertex = mcHeader->GetVtxZ();
882  if (TMath::Abs(zMCVertex) > fAnalysisCuts->GetMaxVtxZ())
883  return;
884  FillMCGenAccHistos(arrayMC, mcHeader, nTracklets);
885  }
886 
887  if (!isEvSel) return;
888 
889  fHistNEvents->Fill(4);
890  fHistCentrality[1]->Fill(evCentr);
891  fHistCentralityMult[1]->Fill(ntracks, evCentr);
892 
893  if (fDoCutV0multTPCout)
894  {
895  //cut on V0mult. vs #tracks kTPCout
896  Float_t V0mult = 0.;
897  AliAODVZERO *aodVZERO = (AliAODVZERO *)aod->GetVZEROData();
898  if (aodVZERO)
899  {
900  for (int ich = 0; ich < 64; ich++)
901  V0mult += aodVZERO->GetMultiplicity(ich);
902  }
903  Int_t nTPCout = 0;
904  for (Int_t i = 0; i < aod->GetNumberOfTracks(); ++i)
905  {
906  AliVTrack *track = aod->GetTrack(i);
907  if (!track)
908  continue;
909  if ((track->GetStatus() & AliVTrack::kTPCout))
910  nTPCout++;
911  }
912  fHistAllV0multNTPCout->Fill(V0mult, nTPCout);
913  if (nTPCout > (0.32 * V0mult + 750))
914  return;
915  else
916  fHistSelV0multNTPCout->Fill(V0mult, nTPCout);
917  }
918 
919  Int_t n3Prong = array3Prong->GetEntriesFast();
920  if (fDebug > 1)
921  printf("Number of Ds->KKpi: %d\n", n3Prong);
922 
923  Int_t pdgDstoKKpi[3] = {321, 321, 211};
924  Int_t nSelected = 0;
925  Int_t nFiltered = 0;
926  Double_t massPhi = TDatabasePDG::Instance()->GetParticle(333)->Mass();
927 
928  // vHF object is needed to call the method that refills the missing info of the candidates
929  // if they have been deleted in dAOD reconstruction phase
930  // in order to reduce the size of the file
932 
933  for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++)
934  {
935 
936  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong *)array3Prong->UncheckedAt(i3Prong);
937  fHistNEvents->Fill(11);
938 
939  if (fUseSelectionBit && !(d->HasSelectionBit(AliRDHFCuts::kDsCuts))) continue;
940  nFiltered++;
941  fHistNEvents->Fill(12);
942 
943  TObjArray arrTracks(3);
944  for(Int_t ipr=0;ipr<3;ipr++){
945  AliAODTrack *tr=vHF->GetProng(aod,d,ipr);
946  arrTracks.AddAt(tr,ipr);
947  }
948  if(!fAnalysisCuts->PreSelect(arrTracks)){
949  fHistNEvents->Fill(15);
950  continue;
951  }
952 
953  if (!(vHF->FillRecoCand(aod, d)))
954  {
955  fHistNEvents->Fill(14); //monitor how often this fails
956  continue;
957  }
958 
959  Bool_t unsetvtx = kFALSE;
960  if (!d->GetOwnPrimaryVtx())
961  {
962  d->SetOwnPrimaryVtx(vtx1);
963  unsetvtx = kTRUE;
964  // NOTE: the ow primary vertex should be unset, otherwise there is a memory leak
965  // Pay attention if you use continue inside this loop!!!
966  }
967 
968  Bool_t recVtx = kFALSE;
969  AliAODVertex *origownvtx = 0x0;
970 
971  Double_t ptCand = d->Pt();
972  Int_t iPtBin = TMath::BinarySearch(fNPtBins, fPtLimits, (Float_t)ptCand);
973  Double_t rapid = d->YDs();
974  fYVsPt->Fill(ptCand, rapid);
975  Bool_t isFidAcc = fAnalysisCuts->IsInFiducialAcceptance(ptCand, rapid);
976  Double_t massKK_KKpi = 0.;
977  Double_t massKK_piKK = 0.;
978  Double_t massKp = 0;
979  Double_t masspK = 0;
980 
981  if (isFidAcc)
982  {
983 
984  Int_t retCodeAnalysisCuts = fAnalysisCuts->IsSelected(d, AliRDHFCuts::kAll, aod);
985  Int_t retCodeNoRes = retCodeAnalysisCuts;
987  if (origRes)
988  {
990  retCodeNoRes = fAnalysisCuts->IsSelected(d, AliRDHFCuts::kAll, aod);
992  }
993 
994  if (retCodeNoRes & 1)
995  { //KKpi
996  massKK_KKpi = d->InvMass2Prongs(0, 1, 321, 321);
997  massKp = d->InvMass2Prongs(1, 2, 321, 211);
998  fMassHistKK[iPtBin]->Fill(massKK_KKpi);
999  fMassHistKpi[iPtBin]->Fill(massKp);
1000  }
1001  if (retCodeNoRes & 2)
1002  { //piKK
1003  massKK_piKK = d->InvMass2Prongs(1, 2, 321, 321);
1004  masspK = d->InvMass2Prongs(0, 1, 211, 321);
1005  fMassHistKK[iPtBin]->Fill(massKK_piKK);
1006  fMassHistKpi[iPtBin]->Fill(masspK);
1007  }
1008 
1009  Int_t isKKpi = retCodeAnalysisCuts & 1;
1010  Int_t ispiKK = retCodeAnalysisCuts & 2;
1011  Int_t isPhiKKpi = retCodeAnalysisCuts & 4;
1012  Int_t isPhipiKK = retCodeAnalysisCuts & 8;
1013  Int_t isK0starKKpi = retCodeAnalysisCuts & 16;
1014  Int_t isK0starpiKK = retCodeAnalysisCuts & 32;
1015 
1016  if (retCodeAnalysisCuts > 0)
1017  {
1019  {
1020  if (d->GetOwnPrimaryVtx())
1021  origownvtx = new AliAODVertex(*d->GetOwnPrimaryVtx());
1022  if (fAnalysisCuts->RecalcOwnPrimaryVtx(d, aod))
1023  recVtx = kTRUE;
1024  else
1025  fAnalysisCuts->CleanOwnPrimaryVtx(d, aod, origownvtx);
1026  }
1027 
1028  fHistNEvents->Fill(13);
1029  nSelected++;
1030 
1031  Int_t index = GetHistoIndex(iPtBin);
1032  fPtCandHist[index]->Fill(ptCand);
1033 
1034  Double_t weightKKpi = 1.;
1035  Double_t weightpiKK = 1.;
1037  {
1038  weightKKpi = fAnalysisCuts->GetWeightForKKpi();
1039  weightpiKK = fAnalysisCuts->GetWeightForpiKK();
1040  if (weightKKpi > 1. || weightKKpi < 0.)
1041  weightKKpi = 0.;
1042  if (weightpiKK > 1. || weightpiKK < 0.)
1043  weightpiKK = 0.;
1044  }
1045 
1046  fChanHist[0]->Fill(retCodeAnalysisCuts);
1047 
1048  const Int_t nProng = 3;
1049  Double_t invMass_KKpi = 0.;
1050  Double_t invMass_piKK = 0.;
1051  Int_t indexMCKKpi = -1;
1052  Int_t indexMCpiKK = -1;
1053  Int_t labDs = -1;
1054  Int_t labDplus = -1;
1055  Int_t pdgCode0 = -999;
1056  Int_t isMCSignal = -1;
1057 
1058  AliAODMCParticle *partDs = 0x0;
1059  Int_t orig=0;
1060  Float_t trueImpParDsFromB = 99999.;
1061 
1062  if (fReadMC)
1063  {
1064  labDs = d->MatchToMC(431, arrayMC, nProng, pdgDstoKKpi);
1065  if (labDs >= 0)
1066  {
1067  partDs = (AliAODMCParticle*)arrayMC->At(labDs);
1068  Int_t labDau0 = ((AliAODTrack *)d->GetDaughter(0))->GetLabel();
1069  AliAODMCParticle *p = (AliAODMCParticle *)arrayMC->UncheckedAt(TMath::Abs(labDau0));
1070  pdgCode0 = TMath::Abs(p->GetPdgCode());
1071 
1072  if (isKKpi)
1073  {
1074  if (pdgCode0 == 321)
1075  {
1076  indexMCKKpi = GetSignalHistoIndex(iPtBin);
1077  fYVsPtSig->Fill(ptCand, rapid);
1078  fChanHist[1]->Fill(retCodeAnalysisCuts);
1079  isMCSignal = 1;
1080  }
1081  else
1082  {
1083  indexMCKKpi = GetReflSignalHistoIndex(iPtBin);
1084  fChanHist[3]->Fill(retCodeAnalysisCuts);
1085  isMCSignal = 0;
1086  }
1087  }
1088  if (ispiKK)
1089  {
1090  if (pdgCode0 == 211)
1091  {
1092  indexMCpiKK = GetSignalHistoIndex(iPtBin);
1093  fYVsPtSig->Fill(ptCand, rapid);
1094  fChanHist[1]->Fill(retCodeAnalysisCuts);
1095  isMCSignal = 1;
1096  }
1097  else
1098  {
1099  indexMCpiKK = GetReflSignalHistoIndex(iPtBin);
1100  fChanHist[3]->Fill(retCodeAnalysisCuts);
1101  isMCSignal = 0;
1102  }
1103  }
1104  }
1105  else
1106  {
1107  labDplus = d->MatchToMC(411, arrayMC, nProng, pdgDstoKKpi);
1108  indexMCpiKK = GetBackgroundHistoIndex(iPtBin);
1109  indexMCKKpi = GetBackgroundHistoIndex(iPtBin);
1110  fChanHist[2]->Fill(retCodeAnalysisCuts);
1111  if (labDplus >= 0)
1112  {
1113  partDs = (AliAODMCParticle*)arrayMC->At(labDplus);
1114  Int_t labDau0 = ((AliAODTrack *)d->GetDaughter(0))->GetLabel();
1115  AliAODMCParticle *p = (AliAODMCParticle *)arrayMC->UncheckedAt(TMath::Abs(labDau0));
1116  pdgCode0 = TMath::Abs(p->GetPdgCode());
1117  }
1118  }
1119  if(partDs) orig = AliVertexingHFUtils::CheckOrigin(arrayMC,partDs,kTRUE);
1120  }
1121 
1122  if (isKKpi)
1123  {
1124  if (fDoRotBkg && TMath::Abs(massKK_KKpi - massPhi) <= fMaxDeltaPhiMass4Rot)
1125  GenerateRotBkg(d, 1, iPtBin);
1126 
1127  invMass_KKpi = d->InvMassDsKKpi();
1128  fMassHist[index]->Fill(invMass_KKpi, weightKKpi);
1129  fPtVsMass->Fill(invMass_KKpi, ptCand, weightKKpi);
1130 
1131  if (fDoBkgPhiSB && (0.010 < TMath::Abs(massKK_KKpi - massPhi)) && (TMath::Abs(massKK_KKpi - massPhi) < 0.030))
1132  {
1133  if (massKK_KKpi < massPhi)
1134  fMassLSBkgHistPhi[iPtBin]->Fill(invMass_KKpi);
1135  else
1136  fMassRSBkgHistPhi[iPtBin]->Fill(invMass_KKpi);
1137  }
1138 
1139  if (isPhiKKpi)
1140  {
1141  fMassHistPhi[index]->Fill(invMass_KKpi, weightKKpi);
1142  fPtVsMassPhi->Fill(invMass_KKpi, ptCand, weightKKpi);
1143  }
1144  if (isK0starKKpi)
1145  {
1146  fMassHistK0st[index]->Fill(invMass_KKpi, weightKKpi);
1147  fPtVsMassK0st->Fill(invMass_KKpi, ptCand, weightKKpi);
1148  }
1149  if (fReadMC && indexMCKKpi != -1)
1150  {
1151  fMassHist[indexMCKKpi]->Fill(invMass_KKpi, weightKKpi);
1152  if (isPhiKKpi)
1153  fMassHistPhi[indexMCKKpi]->Fill(invMass_KKpi, weightKKpi);
1154  if (isK0starKKpi)
1155  fMassHistK0st[indexMCKKpi]->Fill(invMass_KKpi, weightKKpi);
1156  }
1157  if (isPhiKKpi && fFillImpParSparse)
1158  {
1159  Double_t impParxy = d->ImpParXY() * 10000.;
1160  Double_t array4ImpPar[3] = {invMass_KKpi, ptCand, impParxy};
1161  if (!fReadMC) fImpParSparse->Fill(array4ImpPar);
1162  else
1163  {
1164  if (orig == 4 && indexMCKKpi == GetSignalHistoIndex(iPtBin)) fImpParSparseMC[0]->Fill(array4ImpPar);
1165  else if (orig == 5 && indexMCKKpi == GetSignalHistoIndex(iPtBin))
1166  {
1167  fImpParSparseMC[1]->Fill(array4ImpPar);
1168  trueImpParDsFromB = GetTrueImpactParameterDstoPhiPi(mcHeader, arrayMC, partDs) * 10000;
1169  Double_t array4ImpParTrueB[3] = {invMass_KKpi, ptCand, trueImpParDsFromB};
1170  fImpParSparseMC[2]->Fill(array4ImpParTrueB);
1171  }
1172  else
1173  fImpParSparseMC[3]->Fill(array4ImpPar);
1174  }
1175  }
1176  if (isPhiKKpi && fFillNtuple == 4)
1177  {
1178  Float_t impParxy = d->ImpParXY() * 10000.;
1179  Float_t tmp[4] = {(Float_t)ptCand, (Float_t)invMass_KKpi, impParxy, (Float_t)orig};
1180  fNtupleDs->Fill(tmp);
1181  PostData(4, fNtupleDs);
1182  }
1183  }
1184  if (ispiKK)
1185  {
1186  if (fDoRotBkg && TMath::Abs(massKK_piKK - massPhi) <= fMaxDeltaPhiMass4Rot)
1187  GenerateRotBkg(d, 2, iPtBin);
1188 
1189  invMass_piKK = d->InvMassDspiKK();
1190  fMassHist[index]->Fill(invMass_piKK, weightpiKK);
1191  fPtVsMass->Fill(invMass_piKK, ptCand, weightpiKK);
1192 
1193  if (fDoBkgPhiSB && (0.010 < TMath::Abs(massKK_piKK - massPhi)) && (TMath::Abs(massKK_piKK - massPhi) < 0.030))
1194  {
1195  if (massKK_piKK < massPhi)
1196  fMassLSBkgHistPhi[iPtBin]->Fill(invMass_piKK);
1197  else
1198  fMassRSBkgHistPhi[iPtBin]->Fill(invMass_piKK);
1199  }
1200 
1201  if (isPhipiKK)
1202  {
1203  fMassHistPhi[index]->Fill(invMass_piKK, weightpiKK);
1204  fPtVsMassPhi->Fill(invMass_piKK, ptCand, weightpiKK);
1205  }
1206  if (isK0starpiKK)
1207  {
1208  fMassHistK0st[index]->Fill(invMass_piKK, weightpiKK);
1209  fPtVsMassK0st->Fill(invMass_piKK, ptCand, weightpiKK);
1210  }
1211  if (fReadMC && indexMCpiKK != -1)
1212  {
1213  fMassHist[indexMCpiKK]->Fill(invMass_piKK, weightpiKK);
1214  if (isPhipiKK)
1215  fMassHistPhi[indexMCpiKK]->Fill(invMass_piKK, weightpiKK);
1216  if (isK0starpiKK)
1217  fMassHistK0st[indexMCpiKK]->Fill(invMass_piKK, weightpiKK);
1218  }
1219  if (isPhipiKK && fFillImpParSparse)
1220  {
1221  Double_t impParxy = d->ImpParXY() * 10000.;
1222  Double_t array4ImpPar[3] = {invMass_piKK, ptCand, impParxy};
1223  if (!fReadMC)
1224  fImpParSparse->Fill(array4ImpPar);
1225  else
1226  {
1227  if (orig == 4 && indexMCpiKK == GetSignalHistoIndex(iPtBin))
1228  fImpParSparseMC[0]->Fill(array4ImpPar);
1229  else if (orig == 5 && indexMCpiKK == GetSignalHistoIndex(iPtBin))
1230  {
1231  fImpParSparseMC[1]->Fill(array4ImpPar);
1232  trueImpParDsFromB = GetTrueImpactParameterDstoPhiPi(mcHeader, arrayMC, partDs) * 10000;
1233  Double_t array4ImpParTrueB[3] = {invMass_piKK, ptCand, trueImpParDsFromB};
1234  fImpParSparseMC[2]->Fill(array4ImpParTrueB);
1235  }
1236  else
1237  fImpParSparseMC[3]->Fill(array4ImpPar);
1238  }
1239  }
1240  if (isPhipiKK && fFillNtuple == 4)
1241  {
1242  Float_t impParxy = d->ImpParXY() * 10000.;
1243  Float_t tmp[4] = {(Float_t)ptCand, (Float_t)invMass_piKK, impParxy, (Float_t)orig};
1244  fNtupleDs->Fill(tmp);
1245  PostData(4, fNtupleDs);
1246  }
1247  }
1248 
1250 
1251  if (fFillSparse && (isPhiKKpi || isPhipiKK))
1252  {
1253  Double_t ptWeight = 1.;
1254  if (fUseWeight && fHistoPtWeight)
1255  {
1256  AliDebug(2, "Using Histogram as Pt weight function");
1257  ptWeight = GetPtWeightFromHistogram(ptCand);
1258  }
1259 
1260  Double_t deltaMassKK = -999.;
1261  Double_t dlen = d->DecayLength();
1262  Double_t dlenxy = d->DecayLengthXY();
1263  Double_t normdlxy = d->NormalizedDecayLengthXY();
1264  Double_t cosp = d->CosPointingAngle();
1265  Double_t cospxy = d->CosPointingAngleXY();
1266  Double_t sigvert = d->GetSigmaVert();
1267  Double_t cosPiDs = -99.;
1268  Double_t cosPiKPhi = -99.;
1269  Double_t normIP = -999.; //to store the maximum topomatic var. among the 3 prongs
1270  Double_t normIPprong[nProng]; //to store IP of k,k,pi
1271  Double_t absimpparxy = TMath::Abs(d->ImpParXY());
1272 
1273  for (Int_t ip = 0; ip < nProng; ip++)
1274  {
1275  Double_t diffIP, errdiffIP;
1276  d->Getd0MeasMinusExpProng(ip, aod->GetMagneticField(), diffIP, errdiffIP);
1277  normIPprong[ip] = diffIP / errdiffIP;
1278  if (ip == 0)
1279  normIP = normIPprong[ip];
1280  else if (TMath::Abs(normIPprong[ip]) > TMath::Abs(normIP))
1281  normIP = normIPprong[ip];
1282  }
1283 
1284  if (isPhiKKpi)
1285  {
1286  deltaMassKK = TMath::Abs(massKK_KKpi-massPhi);
1287  cosPiDs = d->CosPiDsLabFrameKKpi();
1288  cosPiKPhi = d->CosPiKPhiRFrameKKpi();
1289  cosPiKPhi = TMath::Abs(cosPiKPhi * cosPiKPhi * cosPiKPhi);
1290 
1291  Double_t var4nSparse[knVarForSparse] = {invMass_KKpi, ptCand, deltaMassKK * 1000, dlen * 1000, dlenxy * 1000, normdlxy, cosp * 100, cospxy * 100, sigvert * 1000, cosPiDs * 10, cosPiKPhi * 10, TMath::Abs(normIP), absimpparxy * 10000, nTracklets, evCentr};
1292 
1293  if (!fReadMC)
1294  {
1295  fnSparse->Fill(var4nSparse);
1296  }
1297  else
1298  {
1299  if (indexMCKKpi == GetSignalHistoIndex(iPtBin))
1300  {
1301  if (orig == 4) fnSparseMC[2]->Fill(var4nSparse, ptWeight);
1302  else if (orig == 5) fnSparseMC[3]->Fill(var4nSparse, ptWeight);
1303  }
1304  else if (fFillSparseDplus && labDplus >= 0 && pdgCode0 == 321)
1305  {
1306  if (orig == 4) fnSparseMCDplus[2]->Fill(var4nSparse, ptWeight);
1307  else if (orig == 5) fnSparseMCDplus[3]->Fill(var4nSparse, ptWeight);
1308  }
1309  }
1310  }
1311  if (isPhipiKK)
1312  {
1313  deltaMassKK = TMath::Abs(massKK_piKK - massPhi);
1314  cosPiDs = d->CosPiDsLabFramepiKK();
1315  cosPiKPhi = d->CosPiKPhiRFramepiKK();
1316  cosPiKPhi = TMath::Abs(cosPiKPhi * cosPiKPhi * cosPiKPhi);
1317 
1318  Double_t var4nSparse[knVarForSparse] = {invMass_piKK, ptCand, deltaMassKK * 1000, dlen * 1000, dlenxy * 1000, normdlxy, cosp * 100, cospxy * 100, sigvert * 1000, cosPiDs * 10, cosPiKPhi * 10, TMath::Abs(normIP), absimpparxy * 10000, nTracklets, evCentr};
1319 
1320  if (!fReadMC)
1321  {
1322  fnSparse->Fill(var4nSparse);
1323  }
1324  else
1325  {
1326  if (indexMCpiKK == GetSignalHistoIndex(iPtBin))
1327  {
1328  if (orig == 4) fnSparseMC[2]->Fill(var4nSparse, ptWeight);
1329  else if (orig == 5) fnSparseMC[3]->Fill(var4nSparse, ptWeight);
1330  }
1331  else if (fFillSparseDplus && labDplus >= 0 && pdgCode0 == 211)
1332  {
1333  if (orig == 4) fnSparseMCDplus[2]->Fill(var4nSparse, ptWeight);
1334  else if (orig == 5) fnSparseMCDplus[3]->Fill(var4nSparse, ptWeight);
1335  }
1336  }
1337  }
1338  }
1340 
1341  if (fDoCutVarHistos)
1342  {
1343  Double_t dlen = d->DecayLength();
1344  Double_t dlenxy = d->DecayLengthXY();
1345  Double_t normdlxy = d->NormalizedDecayLengthXY();
1346  Double_t cosp = d->CosPointingAngle();
1347  Double_t cospxy = d->CosPointingAngleXY();
1348  Double_t pt0 = d->PtProng(0);
1349  Double_t pt1 = d->PtProng(1);
1350  Double_t pt2 = d->PtProng(2);
1351  Double_t sigvert = d->GetSigmaVert();
1352  Double_t cosPiDs = -99.;
1353  Double_t cosPiKPhi = -99.;
1354  Double_t normIP = -999.; //to store the maximum topomatic var. among the 3 prongs
1355  Double_t normIPprong[nProng]; //to store IP of k,k,pi
1356  for (Int_t ip = 0; ip < nProng; ip++)
1357  {
1358  Double_t diffIP, errdiffIP;
1359  d->Getd0MeasMinusExpProng(ip, aod->GetMagneticField(), diffIP, errdiffIP);
1360  normIPprong[ip] = diffIP / errdiffIP;
1361  if (ip == 0)
1362  normIP = normIPprong[ip];
1363  else if (TMath::Abs(normIPprong[ip]) > TMath::Abs(normIP))
1364  normIP = normIPprong[ip];
1365  }
1366  Double_t sumD02 = d->Getd0Prong(0) * d->Getd0Prong(0) + d->Getd0Prong(1) * d->Getd0Prong(1) + d->Getd0Prong(2) * d->Getd0Prong(2);
1367  Double_t dca = d->GetDCA();
1368  Double_t ptmax = 0;
1369  for (Int_t i = 0; i < 3; i++)
1370  {
1371  if (d->PtProng(i) > ptmax)
1372  ptmax = d->PtProng(i);
1373  }
1374 
1375  fCosPHist[index]->Fill(cosp);
1376  fCosPxyHist[index]->Fill(cospxy);
1377  fDLenHist[index]->Fill(dlen);
1378  fDLenxyHist[index]->Fill(dlenxy);
1379  fNDLenxyHist[index]->Fill(normdlxy);
1380  fSigVertHist[index]->Fill(sigvert);
1381  fSumd02Hist[index]->Fill(sumD02);
1382  fPtMaxHist[index]->Fill(ptmax);
1383  fDCAHist[index]->Fill(dca);
1384  fNormIPHist[index]->Fill(normIP);
1385  fCosPiDsHist[index]->Fill(cosPiDs);
1386  fCosPiKPhiHist[index]->Fill(cosPiKPhi);
1387  fPtProng0Hist[index]->Fill(pt0);
1388  fPtProng1Hist[index]->Fill(pt1);
1389  fPtProng2Hist[index]->Fill(pt2);
1390  if (isKKpi)
1391  {
1392  cosPiDs = d->CosPiDsLabFrameKKpi();
1393  cosPiKPhi = d->CosPiKPhiRFrameKKpi();
1394  cosPiKPhi = TMath::Abs(cosPiKPhi * cosPiKPhi * cosPiKPhi);
1395 
1396  if (!fReadMC)
1397  {
1398  fCosPHist3D->Fill(invMass_KKpi, ptCand, cosp);
1399  fCosPxyHist3D->Fill(invMass_KKpi, ptCand, cospxy);
1400  fDLenHist3D->Fill(invMass_KKpi, ptCand, dlen);
1401  fDLenxyHist3D->Fill(invMass_KKpi, ptCand, dlenxy);
1402  fNDLenxyHist3D->Fill(invMass_KKpi, ptCand, normdlxy);
1403  fSigVertHist3D->Fill(invMass_KKpi, ptCand, sigvert);
1404  fDCAHist3D->Fill(invMass_KKpi, ptCand, dca);
1405  fNormIPHist3D->Fill(invMass_KKpi, ptCand, normIP);
1406  fCosPiDsHist3D->Fill(invMass_KKpi, ptCand, cosPiDs);
1407  fCosPiKPhiHist3D->Fill(invMass_KKpi, ptCand, cosPiKPhi);
1408  fPtProng0Hist3D->Fill(invMass_KKpi, ptCand, pt0);
1409  fPtProng1Hist3D->Fill(invMass_KKpi, ptCand, pt1);
1410  fPtProng2Hist3D->Fill(invMass_KKpi, ptCand, pt2);
1411  }
1412  fDalitz[index]->Fill(massKK_KKpi, massKp);
1413  if (isPhiKKpi)
1414  fDalitzPhi[index]->Fill(massKK_KKpi, massKp);
1415  if (isK0starKKpi)
1416  fDalitzK0st[index]->Fill(massKK_KKpi, massKp);
1417  if (fReadMC && indexMCKKpi != -1)
1418  {
1419  fDalitz[indexMCKKpi]->Fill(massKK_KKpi, massKp);
1420  if (isPhiKKpi)
1421  fDalitzPhi[indexMCKKpi]->Fill(massKK_KKpi, massKp);
1422  if (isK0starKKpi)
1423  fDalitzK0st[indexMCKKpi]->Fill(massKK_KKpi, massKp);
1424  fCosPHist[indexMCKKpi]->Fill(cosp);
1425  fCosPxyHist[indexMCKKpi]->Fill(cospxy);
1426  fDLenHist[indexMCKKpi]->Fill(dlen);
1427  fDLenxyHist[indexMCKKpi]->Fill(dlenxy);
1428  fNDLenxyHist[indexMCKKpi]->Fill(normdlxy);
1429  fSigVertHist[indexMCKKpi]->Fill(sigvert);
1430  fSumd02Hist[indexMCKKpi]->Fill(sumD02);
1431  fPtMaxHist[indexMCKKpi]->Fill(ptmax);
1432  fPtCandHist[indexMCKKpi]->Fill(ptCand);
1433  fDCAHist[indexMCKKpi]->Fill(dca);
1434  fNormIPHist[indexMCKKpi]->Fill(normIP);
1435  fCosPiDsHist[indexMCKKpi]->Fill(cosPiDs);
1436  fCosPiKPhiHist[indexMCKKpi]->Fill(cosPiKPhi);
1437  fPtProng0Hist[indexMCKKpi]->Fill(pt0);
1438  fPtProng1Hist[indexMCKKpi]->Fill(pt1);
1439  fPtProng2Hist[indexMCKKpi]->Fill(pt2);
1440  }
1441  }
1442  if (ispiKK)
1443  {
1444  cosPiDs = d->CosPiDsLabFramepiKK();
1445  cosPiKPhi = d->CosPiKPhiRFramepiKK();
1446  cosPiKPhi = TMath::Abs(cosPiKPhi * cosPiKPhi * cosPiKPhi);
1447 
1448  if (!fReadMC)
1449  {
1450  fCosPHist3D->Fill(invMass_piKK, ptCand, cosp);
1451  fCosPxyHist3D->Fill(invMass_piKK, ptCand, cospxy);
1452  fDLenHist3D->Fill(invMass_piKK, ptCand, dlen);
1453  fDLenxyHist3D->Fill(invMass_piKK, ptCand, dlenxy);
1454  fNDLenxyHist3D->Fill(invMass_piKK, ptCand, normdlxy);
1455  fSigVertHist3D->Fill(invMass_piKK, ptCand, sigvert);
1456  fDCAHist3D->Fill(invMass_piKK, ptCand, dca);
1457  fNormIPHist3D->Fill(invMass_piKK, ptCand, normIP);
1458  fCosPiDsHist3D->Fill(invMass_piKK, ptCand, cosPiDs);
1459  fCosPiKPhiHist3D->Fill(invMass_piKK, ptCand, cosPiKPhi);
1460  fPtProng0Hist3D->Fill(invMass_piKK, ptCand, pt0);
1461  fPtProng1Hist3D->Fill(invMass_piKK, ptCand, pt1);
1462  fPtProng2Hist3D->Fill(invMass_piKK, ptCand, pt2);
1463  }
1464  fDalitz[index]->Fill(massKK_piKK, masspK);
1465  if (isPhipiKK)
1466  fDalitzPhi[index]->Fill(massKK_piKK, masspK);
1467  if (isK0starpiKK)
1468  fDalitzK0st[index]->Fill(massKK_piKK, masspK);
1469 
1470  if (fReadMC && indexMCpiKK != -1)
1471  {
1472  fDalitz[indexMCpiKK]->Fill(massKK_piKK, masspK);
1473  if (isPhipiKK)
1474  fDalitzPhi[indexMCpiKK]->Fill(massKK_piKK, masspK);
1475  if (isK0starpiKK)
1476  fDalitzK0st[indexMCpiKK]->Fill(massKK_piKK, masspK);
1477  fCosPHist[indexMCpiKK]->Fill(cosp);
1478  fCosPxyHist[indexMCpiKK]->Fill(cospxy);
1479  fDLenHist[indexMCpiKK]->Fill(dlen);
1480  fDLenxyHist[indexMCpiKK]->Fill(dlenxy);
1481  fNDLenxyHist[indexMCpiKK]->Fill(normdlxy);
1482  fSigVertHist[indexMCpiKK]->Fill(sigvert);
1483  fSumd02Hist[indexMCpiKK]->Fill(sumD02);
1484  fPtMaxHist[indexMCpiKK]->Fill(ptmax);
1485  fPtCandHist[indexMCpiKK]->Fill(ptCand);
1486  fDCAHist[indexMCpiKK]->Fill(dca);
1487  fNormIPHist[indexMCpiKK]->Fill(normIP);
1488  fCosPiDsHist[indexMCpiKK]->Fill(cosPiDs);
1489  fCosPiKPhiHist[indexMCpiKK]->Fill(cosPiKPhi);
1490  fPtProng0Hist[indexMCpiKK]->Fill(pt0);
1491  fPtProng1Hist[indexMCpiKK]->Fill(pt1);
1492  fPtProng2Hist[indexMCpiKK]->Fill(pt2);
1493  }
1494  }
1495  }
1496 
1497  Float_t tmp[37];
1498  if ((fFillNtuple == 1 && (isPhiKKpi || isPhipiKK)) || (fFillNtuple == 2 && (isK0starKKpi || isK0starpiKK)) || (fFillNtuple == 3 && (isKKpi || ispiKK)))
1499  {
1500  AliAODTrack *track0 = (AliAODTrack *)d->GetDaughter(0);
1501  AliAODTrack *track1 = (AliAODTrack *)d->GetDaughter(1);
1502  AliAODTrack *track2 = (AliAODTrack *)d->GetDaughter(2);
1503  UInt_t bitMapPIDTrack0 = fAnalysisCuts->GetPIDTrackTPCTOFBitMap(track0);
1504  UInt_t bitMapPIDTrack1 = fAnalysisCuts->GetPIDTrackTPCTOFBitMap(track1);
1505  UInt_t bitMapPIDTrack2 = fAnalysisCuts->GetPIDTrackTPCTOFBitMap(track2);
1506  tmp[0] = Float_t(labDs);
1507  if (fReadMC && fWriteOnlySignal)
1508  tmp[0] = Float_t(isMCSignal);
1509  tmp[1] = Float_t(retCodeAnalysisCuts);
1510  tmp[2] = Float_t(pdgCode0);
1511  tmp[3] = d->PtProng(0);
1512  tmp[4] = d->PtProng(1);
1513  tmp[5] = d->PtProng(2);
1514  tmp[6] = d->Pt();
1515  tmp[7] = d->PProng(0);
1516  tmp[8] = d->PProng(1);
1517  tmp[9] = d->PProng(2);
1518  tmp[10] = Int_t(bitMapPIDTrack0);
1519  tmp[11] = Int_t(bitMapPIDTrack1);
1520  tmp[12] = Int_t(bitMapPIDTrack2);
1521  tmp[13] = d->CosPointingAngle();
1522  tmp[14] = d->CosPointingAngleXY();
1523  tmp[15] = d->DecayLength();
1524  tmp[16] = d->DecayLengthXY();
1525  tmp[17] = d->NormalizedDecayLength();
1526  tmp[18] = d->NormalizedDecayLengthXY();
1527  tmp[19] = d->InvMassDsKKpi();
1528  tmp[20] = d->InvMassDspiKK();
1529  tmp[21] = d->GetSigmaVert();
1530  tmp[22] = d->Getd0Prong(0);
1531  tmp[23] = d->Getd0Prong(1);
1532  tmp[24] = d->Getd0Prong(2);
1533  tmp[25] = d->GetDCA();
1534  tmp[26] = d->Getd0Prong(0) * d->Getd0Prong(0) + d->Getd0Prong(1) * d->Getd0Prong(1) + d->Getd0Prong(2) * d->Getd0Prong(2);
1535  tmp[27] = d->InvMass2Prongs(0, 1, 321, 321);
1536  tmp[28] = d->InvMass2Prongs(1, 2, 321, 321);
1537  tmp[29] = d->InvMass2Prongs(1, 2, 321, 211);
1538  tmp[30] = d->InvMass2Prongs(0, 1, 211, 321);
1539  tmp[31] = d->CosPiDsLabFrameKKpi();
1540  tmp[32] = d->CosPiDsLabFramepiKK();
1541  tmp[33] = d->CosPiKPhiRFrameKKpi();
1542  tmp[34] = d->CosPiKPhiRFramepiKK();
1543  tmp[35] = (Float_t)(evCentr);
1544  tmp[36] = (Float_t)(runNumber);
1545  if (fReadMC && fWriteOnlySignal)
1546  {
1547  if (isMCSignal >= 0)
1548  fNtupleDs->Fill(tmp);
1549  }
1550  else
1551  {
1552  fNtupleDs->Fill(tmp);
1553  }
1554  PostData(4, fNtupleDs);
1555  }
1556  } //if(retCodeAnalysisCuts
1557  } // if(isFidAcc)
1558 
1559  if (unsetvtx)
1560  d->UnsetOwnPrimaryVtx();
1561  if (recVtx)
1562  fAnalysisCuts->CleanOwnPrimaryVtx(d, aod, origownvtx);
1563  }
1564 
1565  fCounter->StoreCandidates(aod, nFiltered, kTRUE);
1566  fCounter->StoreCandidates(aod, nSelected, kFALSE);
1567 
1568  delete vHF;
1569 
1570  PostData(1, fOutput);
1571  PostData(3, fCounter);
1572 
1573  return;
1574 }
1575 
1576 //_________________________________________________________________
1578 {
1580  //
1581  if (fDebug > 1)
1582  printf("AnalysisTaskSEDs: Terminate() \n");
1583  fOutput = dynamic_cast<TList *>(GetOutputData(1));
1584  if (!fOutput)
1585  {
1586  printf("ERROR: fOutput not available\n");
1587  return;
1588  }
1589  fHistNEvents = dynamic_cast<TH1F *>(fOutput->FindObject("hNEvents"));
1590  if (fHistNEvents)
1591  {
1592  printf("Number of analyzed events = %d\n", (Int_t)fHistNEvents->GetBinContent(2));
1593  }
1594  else
1595  {
1596  printf("ERROR: fHistNEvents not available\n");
1597  return;
1598  }
1599  return;
1600 }
1601 
1602 //_________________________________________________________________
1603 void AliAnalysisTaskSEDs::FillMCGenAccHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t nTracklets)
1604 {
1608 
1609  Int_t nProng = 3;
1610  Double_t zMCVertex = mcHeader->GetVtxZ(); //vertex MC
1611  if (TMath::Abs(zMCVertex) <= fAnalysisCuts->GetMaxVtxZ())
1612  {
1613  for (Int_t iPart = 0; iPart < arrayMC->GetEntriesFast(); iPart++)
1614  {
1615 
1616  AliAODMCParticle *mcPart = dynamic_cast<AliAODMCParticle *>(arrayMC->At(iPart));
1617 
1618  if (TMath::Abs(mcPart->GetPdgCode()) == 431)
1619  {
1620  Int_t orig = AliVertexingHFUtils::CheckOrigin(arrayMC, mcPart, kTRUE); //Prompt = 4, FeedDown = 5
1621 
1622  Int_t deca = 0;
1623  Bool_t isGoodDecay = kFALSE;
1624  Int_t labDau[3] = {-1, -1, -1};
1625  Bool_t isFidAcc = kFALSE;
1626  Bool_t isDaugInAcc = kFALSE;
1627 
1628  deca = AliVertexingHFUtils::CheckDsDecay(arrayMC, mcPart, labDau);
1629  if (deca == 1)
1630  isGoodDecay = kTRUE; // == 1 -> Phi pi -> kkpi
1631 
1632  if (labDau[0] == -1)
1633  continue; //protection against unfilled array of labels
1634 
1635  if (isGoodDecay)
1636  {
1637  Double_t pt = mcPart->Pt();
1638  Double_t rapid = mcPart->Y();
1639  isFidAcc = fAnalysisCuts->IsInFiducialAcceptance(pt, rapid);
1640  isDaugInAcc = CheckDaugAcc(arrayMC, nProng, labDau);
1641 
1642  if ((fFillAcceptanceLevel && isFidAcc && isDaugInAcc) || (!fFillAcceptanceLevel && TMath::Abs(rapid)<0.5))
1643  {
1644  Double_t var4nSparseAcc[knVarForSparseAcc] = {pt, rapid * 10, nTracklets};
1645  Double_t ptWeight = 1.;
1646  if (fUseWeight && fHistoPtWeight)
1647  {
1648  AliDebug(2, "Using Histogram as Pt weight function");
1649  ptWeight = GetPtWeightFromHistogram(pt);
1650  }
1651  if (orig == 4)
1652  fnSparseMC[0]->Fill(var4nSparseAcc, ptWeight);
1653  if (orig == 5)
1654  fnSparseMC[1]->Fill(var4nSparseAcc, ptWeight);
1655  }
1656  }
1657  }
1658  if (fFillSparseDplus && TMath::Abs(mcPart->GetPdgCode()) == 411)
1659  {
1660  Int_t orig = AliVertexingHFUtils::CheckOrigin(arrayMC, mcPart, kTRUE); //Prompt = 4, FeedDown = 5
1661 
1662  Int_t deca = 0;
1663  Bool_t isGoodDecay = kFALSE;
1664  Int_t labDau[3] = {-1, -1, -1};
1665  Bool_t isFidAcc = kFALSE;
1666  Bool_t isDaugInAcc = kFALSE;
1667 
1668  deca = AliVertexingHFUtils::CheckDplusKKpiDecay(arrayMC, mcPart, labDau);
1669  if (deca == 1)
1670  isGoodDecay = kTRUE; // == 1 -> Phi pi -> kkpi
1671 
1672  if (labDau[0] == -1)
1673  continue; //protection against unfilled array of labels
1674 
1675  if (isGoodDecay)
1676  {
1677  Double_t pt = mcPart->Pt();
1678  Double_t rapid = mcPart->Y();
1679  isFidAcc = fAnalysisCuts->IsInFiducialAcceptance(pt, rapid);
1680  isDaugInAcc = CheckDaugAcc(arrayMC, nProng, labDau);
1681 
1682  if ((fFillAcceptanceLevel && isFidAcc && isDaugInAcc) || (!fFillAcceptanceLevel && TMath::Abs(rapid)<0.5))
1683  {
1684  Double_t var4nSparseAcc[knVarForSparseAcc] = {pt, rapid * 10, nTracklets};
1685  Double_t ptWeight = 1.;
1686  if (fUseWeight && fHistoPtWeight)
1687  {
1688  AliDebug(2, "Using Histogram as Pt weight function");
1689  ptWeight = GetPtWeightFromHistogram(pt);
1690  }
1691  if (orig == 4)
1692  fnSparseMCDplus[0]->Fill(var4nSparseAcc, ptWeight);
1693  if (orig == 5)
1694  fnSparseMCDplus[1]->Fill(var4nSparseAcc, ptWeight);
1695  }
1696  }
1697  }
1698  }
1699  }
1700 }
1701 
1702 //_________________________________________________________________
1703 Bool_t AliAnalysisTaskSEDs::CheckDaugAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
1704 {
1706 
1707  for (Int_t iProng = 0; iProng < nProng; iProng++)
1708  {
1709  AliAODMCParticle *mcPartDaughter = dynamic_cast<AliAODMCParticle *>(arrayMC->At(labDau[iProng]));
1710  if (!mcPartDaughter)
1711  {
1712  return kFALSE;
1713  }
1714  Double_t eta = mcPartDaughter->Eta();
1715  Double_t pt = mcPartDaughter->Pt();
1716  if (TMath::Abs(eta) > 0.9 || pt < 0.1)
1717  {
1718  return kFALSE;
1719  }
1720  }
1721  return kTRUE;
1722 }
1723 
1724 //_________________________________________________________________
1726 {
1727 
1728  const Int_t nprongs = 3;
1729  Double_t PxProng[nprongs], PyProng[nprongs], PzProng[nprongs], P2Prong[nprongs], mProng[nprongs];
1730  Double_t Px, Py, Pz, P2;
1731  UInt_t pdg[3] = {321, 321, 211};
1732  int idPion = 2;
1733  if (dec == 2)
1734  {
1735  pdg[0] = 211;
1736  pdg[2] = 321;
1737  idPion = 0;
1738  }
1739 
1740  for (Int_t ip = 0; ip < nprongs; ip++)
1741  {
1742  PxProng[ip] = d->PxProng(ip);
1743  PyProng[ip] = d->PxProng(ip);
1744  PzProng[ip] = d->PzProng(ip);
1745  P2Prong[ip] = d->P2Prong(ip);
1746  mProng[ip] = TDatabasePDG::Instance()->GetParticle(pdg[ip])->Mass();
1747  }
1748 
1749  for (Int_t i = 0; i < 9; i++)
1750  { //9 rotations implemented for the pion track around Pi
1751  Px = 0.;
1752  Py = 0.;
1753  Pz = 0.;
1754 
1755  Double_t phirot = TMath::Pi() * (5 / 6. + 1 / 27. * i);
1756 
1757  PxProng[idPion] = PxProng[idPion] * TMath::Cos(phirot) - PyProng[idPion] * TMath::Sin(phirot);
1758  PyProng[idPion] = PxProng[idPion] * TMath::Sin(phirot) + PyProng[idPion] * TMath::Cos(phirot);
1759 
1760  for (Int_t j = 0; j < nprongs; j++)
1761  {
1762  Px += PxProng[j];
1763  Py += PyProng[j];
1764  Pz += PzProng[j];
1765  }
1766  P2 = Px * Px + Py * Py + Pz * Pz;
1767 
1768  Double_t energysum = 0.;
1769  for (Int_t j = 0; j < nprongs; j++)
1770  {
1771  energysum += TMath::Sqrt(mProng[j] * mProng[j] + P2Prong[j]);
1772  }
1773  Double_t mass = TMath::Sqrt(energysum * energysum - P2);
1774  if ((fminMass <= mass) && (mass < fmaxMass))
1775  fMassRotBkgHistPhi[iPtBin]->Fill(mass);
1776  }
1777 }
1778 
1779 //_________________________________________________________________________
1781 {
1782 
1783  Double_t massDs = TDatabasePDG::Instance()->GetParticle(431)->Mass();
1784  Int_t nInvMassBins = (Int_t)(0.7 / fMassBinSize + 0.5);
1785  Double_t minMass = massDs - 0.5 * nInvMassBins * fMassBinSize;
1786  Double_t maxMass = massDs + 0.5 * nInvMassBins * fMassBinSize;
1787 
1788  Int_t nSparseAxes = knVarForSparse;
1789  Int_t nTrklBins = 300;
1790  if (!fUseTrkl) {
1791  nTrklBins = 1;
1792  nSparseAxes--;
1793  }
1794  Int_t nCentrBins = 101;
1795  if (!fUseCentrAxis) {
1796  nCentrBins = 1;
1797  nSparseAxes--;
1798  }
1799 
1800  Int_t nBinsReco[knVarForSparse] = {nInvMassBins, (Int_t)fPtLimits[fNPtBins], 30, 20, 20, 20, 20, 20, 14, 6, 6, 12, 30, nTrklBins, nCentrBins};
1801  Double_t xminReco[knVarForSparse] = {minMass, 0., 0., 0., 0., 0., 90., 90., 0., 7., 0., 0., 0., 1., 0.};
1802  Double_t xmaxReco[knVarForSparse] = {maxMass, fPtLimits[fNPtBins], 15., 100., 100., 10., 100., 100., 70., 10., 3., 6., 300., 301., 101.};
1803  TString axis[knVarForSparse] = {"invMassDsAllPhi", "p_{T}", "#Delta Mass(KK)", "dlen", "dlen_{xy}", "normdl_{xy}", "cosP", "cosP_{xy}", "sigVert", "cosPiDs", "|cosPiKPhi^{3}|", "normIP", "ImpPar_{xy}", "N tracklets", Form("Percentile (%s)", fCentEstName.Data())};
1804 
1805  if (fSystem == 1)
1806  { //pPb,PbPb
1807  nInvMassBins = (Int_t)(0.45 / fMassBinSize + 0.5);
1808  minMass = massDs - 0.5 * nInvMassBins * fMassBinSize;
1809  maxMass = massDs + 0.5 * nInvMassBins * fMassBinSize;
1810  nBinsReco[0] = nInvMassBins; //Ds mass
1811  xminReco[0] = minMass;
1812  xmaxReco[0] = maxMass;
1813 
1814  nBinsReco[2] = 15; //#Delta Mass(KK)
1815  xmaxReco[2] = 15.;
1816 
1817  nBinsReco[3] = 10; //dlen
1818  nBinsReco[4] = 10; //dlenxy
1819  nBinsReco[5] = 10; //ndlenxy
1820 
1821  nBinsReco[6] = 10; //cosP
1822  xminReco[6] = 95.;
1823  xmaxReco[6] = 100.;
1824 
1825  nBinsReco[7] = 20; //cosPxy
1826  xminReco[7] = 90.;
1827  xmaxReco[7] = 100.;
1828  }
1829 
1830  Int_t nBinsAcc[knVarForSparseAcc] = {(Int_t)fPtLimits[fNPtBins], 20, nTrklBins};
1831  Double_t xminAcc[knVarForSparseAcc] = {0., -10., 1.};
1832  Double_t xmaxAcc[knVarForSparseAcc] = {fPtLimits[fNPtBins], 10., 301.};
1833 
1834  if (fReadMC)
1835  {
1836  TString label[2] = {"fromC", "fromB"};
1837  for (Int_t i = 0; i < 2; i++)
1838  {
1839  TString titleSparse = Form("MC nSparse (%s)- %s", fFillAcceptanceLevel ? "Acc.Step" : "Gen.Acc.Step", label[i].Data());
1840  fnSparseMC[i] = new THnSparseF(Form("fnSparseAcc_%s", label[i].Data()), titleSparse.Data(), knVarForSparseAcc, nBinsAcc, xminAcc, xmaxAcc);
1841  fnSparseMC[i]->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
1842  fnSparseMC[i]->GetAxis(1)->SetTitle("y");
1843  fnSparseMC[i]->GetAxis(2)->SetTitle("N tracklets");
1844  fOutput->Add(fnSparseMC[i]);
1845 
1846  //Dplus
1847  if (fFillSparseDplus)
1848  {
1849  titleSparse = Form("MC nSparse D^{+} (%s)- %s", fFillAcceptanceLevel ? "Acc.Step" : "Gen.Acc.Step", label[i].Data());
1850  fnSparseMCDplus[i] = new THnSparseF(Form("fnSparseAccDplus_%s", label[i].Data()), titleSparse.Data(), knVarForSparseAcc, nBinsAcc, xminAcc, xmaxAcc);
1851  fnSparseMCDplus[i]->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
1852  fnSparseMCDplus[i]->GetAxis(1)->SetTitle("y");
1853  fnSparseMCDplus[i]->GetAxis(2)->SetTitle("N tracklets");
1854  fOutput->Add(fnSparseMCDplus[i]);
1855  }
1856  }
1857  for (Int_t i = 2; i < 4; i++)
1858  {
1859  fnSparseMC[i] = new THnSparseF(Form("fnSparseReco_%s", label[i - 2].Data()), Form("MC nSparse (Reco Step)- %s", label[i - 2].Data()), nSparseAxes, nBinsReco, xminReco, xmaxReco);
1860  for (Int_t j = 0; j < nSparseAxes; j++)
1861  {
1862  fnSparseMC[i]->GetAxis(j)->SetTitle(Form("%s", axis[j].Data()));
1863  }
1864  fOutput->Add(fnSparseMC[i]);
1865 
1866  //Dplus
1867  if (fFillSparseDplus)
1868  {
1869  fnSparseMCDplus[i] = new THnSparseF(Form("fnSparseRecoDplus_%s", label[i - 2].Data()), Form("MC nSparse D^{+} (Reco Step)- %s", label[i - 2].Data()), nSparseAxes, nBinsReco, xminReco, xmaxReco);
1870  for (Int_t j = 0; j < nSparseAxes; j++)
1871  {
1872  fnSparseMCDplus[i]->GetAxis(j)->SetTitle(Form("%s", axis[j].Data()));
1873  }
1874  fOutput->Add(fnSparseMCDplus[i]);
1875  }
1876  }
1877  } //end MC
1878  else
1879  {
1880  fnSparse = new THnSparseF("fnSparse", "nSparse", nSparseAxes, nBinsReco, xminReco, xmaxReco);
1881  for (Int_t j = 0; j < nSparseAxes; j++)
1882  {
1883  fnSparse->GetAxis(j)->SetTitle(Form("%s", axis[j].Data()));
1884  }
1885  fOutput->Add(fnSparse);
1886  }
1887 }
1888 
1889 //_________________________________________________________________________
1891 {
1892 
1894  Double_t massDs = TDatabasePDG::Instance()->GetParticle(431)->Mass();
1895  Int_t nInvMassBins = (Int_t)(0.7 / fMassBinSize + 0.5);
1896  Double_t minMass = massDs - 0.5 * nInvMassBins * fMassBinSize;
1897  Double_t maxMass = massDs + 0.5 * nInvMassBins * fMassBinSize;
1898 
1899  //dimensions for THnSparse
1900  TString axTit[kVarForImpPar] = {"M_{K#pi#pi} (GeV/c^{2})", "p_{T} (GeV/c)", "Imp Par (#mum)"};
1901 
1902  Int_t nbins[kVarForImpPar] = {nInvMassBins, (Int_t)fPtLimits[fNPtBins] * 2, 1000};
1903  Double_t xmin[kVarForImpPar] = {minMass, 0., -1000};
1904  Double_t xmax[kVarForImpPar] = {maxMass, fPtLimits[fNPtBins], 1000};
1905 
1906  //mass, pt, imppar
1907  fImpParSparse = new THnSparseF("hMassPtImpParAll", "Mass vs. pt vs. imppar - All", kVarForImpPar, nbins, xmin, xmax);
1908  fImpParSparseMC[0] = new THnSparseF("hMassPtImpParPrompt", "Mass vs. pt vs. imppar - promptD", kVarForImpPar, nbins, xmin, xmax);
1909  fImpParSparseMC[1] = new THnSparseF("hMassPtImpParBfeed", "Mass vs. pt vs. imppar - DfromB", kVarForImpPar, nbins, xmin, xmax);
1910  fImpParSparseMC[2] = new THnSparseF("hMassPtImpParTrueBfeed", "Mass vs. pt vs. true imppar -DfromB", kVarForImpPar, nbins, xmin, xmax);
1911  fImpParSparseMC[3] = new THnSparseF("hMassPtImpParBkg", "Mass vs. pt vs. imppar - backgr.", kVarForImpPar, nbins, xmin, xmax);
1912 
1913  for(Int_t iax=0; iax<kVarForImpPar; iax++){
1914  fImpParSparse->GetAxis(iax)->SetTitle(axTit[iax].Data());
1915  for(Int_t ih=0; ih<4; ih++) fImpParSparseMC[ih]->GetAxis(iax)->SetTitle(axTit[iax].Data());
1916  }
1917 
1918 
1919  if (!fReadMC)
1920  fOutput->Add(fImpParSparse);
1921  else
1922  {
1923  for (Int_t iSparse = 0; iSparse < 4; iSparse++)
1924  {
1925  fOutput->Add(fImpParSparseMC[iSparse]);
1926  }
1927  }
1928 }
1929 
1930 //_________________________________________________________________________________________________
1931 Float_t AliAnalysisTaskSEDs::GetTrueImpactParameterDstoPhiPi(const AliAODMCHeader *mcHeader, TClonesArray *arrayMC, const AliAODMCParticle *partDs) const
1932 {
1934 
1935  Double_t vtxTrue[3];
1936  mcHeader->GetVertex(vtxTrue);
1937  Double_t origD[3];
1938  partDs->XvYvZv(origD);
1939  Short_t charge = partDs->Charge();
1940  Double_t pXdauTrue[3], pYdauTrue[3], pZdauTrue[3];
1941  for (Int_t iDau = 0; iDau < 3; iDau++)
1942  {
1943  pXdauTrue[iDau] = 0.;
1944  pYdauTrue[iDau] = 0.;
1945  pZdauTrue[iDau] = 0.;
1946  }
1947 
1948  Int_t nDau = partDs->GetNDaughters();
1949  Int_t labelFirstDau = partDs->GetDaughter(0);
1950  if (nDau == 2)
1951  {
1952  Int_t theDau = 0;
1953  for (Int_t iDau = 0; iDau < 2; iDau++)
1954  {
1955  Int_t ind = labelFirstDau + iDau;
1956  AliAODMCParticle *part = dynamic_cast<AliAODMCParticle *>(arrayMC->At(ind));
1957  if (!part)
1958  {
1959  AliError("Daughter particle not found in MC array");
1960  return 99999.;
1961  }
1962  Int_t pdgCode = TMath::Abs(part->GetPdgCode());
1963  if (pdgCode == 211)
1964  {
1965  pXdauTrue[theDau] = part->Px();
1966  pYdauTrue[theDau] = part->Py();
1967  pZdauTrue[theDau] = part->Pz();
1968  ++theDau;
1969  }
1970  else
1971  {
1972  Int_t nDauRes = part->GetNDaughters();
1973  if (nDauRes == 2)
1974  {
1975  Int_t labelFirstDauRes = part->GetDaughter(0);
1976  for (Int_t iDauRes = 0; iDauRes < 2; iDauRes++)
1977  {
1978  Int_t indDR = labelFirstDauRes + iDauRes;
1979  AliAODMCParticle *partDR = dynamic_cast<AliAODMCParticle *>(arrayMC->At(indDR));
1980  if (!partDR)
1981  {
1982  AliError("Daughter particle not found in MC array");
1983  return 99999.;
1984  }
1985 
1986  Int_t pdgCodeDR = TMath::Abs(partDR->GetPdgCode());
1987  if (pdgCodeDR == 321)
1988  {
1989  pXdauTrue[theDau] = partDR->Px();
1990  pYdauTrue[theDau] = partDR->Py();
1991  pZdauTrue[theDau] = partDR->Pz();
1992  ++theDau;
1993  }
1994  }
1995  }
1996  }
1997  }
1998  }
1999  else
2000  {
2001  AliError("Wrong number of decay prongs");
2002  return 99999.;
2003  }
2004 
2005  Double_t d0dummy[3] = {0., 0., 0.};
2006  AliAODRecoDecayHF aodDsMC(vtxTrue, origD, 3, charge, pXdauTrue, pYdauTrue, pZdauTrue, d0dummy);
2007  return aodDsMC.ImpParXY();
2008 }
2009 
2010 //_________________________________________________________________________
2012 {
2013  // weight function from the ratio of the LHC16i2a MC
2014  // 1.5-14 GeV/c using data and 1-1.5, 14-50 GeV/c using FONLL calculations
2015 
2016  if (fHistoPtWeight)
2017  delete fHistoPtWeight;
2018  fHistoPtWeight = new TH1F("histoWeight", "histoWeight", 500, 0., 50.);
2019  fHistoPtWeight->Sumw2();
2020  Float_t binc[500] = {1.695705, 1.743693, 1.790289, 1.835410, 1.878981, 1.920938, 1.961223, 1.999787, 2.036589, 2.071597, 2.104784, 2.136132, 2.165629, 2.193270, 2.219057, 2.174545, 2.064698, 1.959489, 1.858770, 1.762396, 1.670224, 1.582115, 1.497931, 1.417541, 1.340814, 1.267622, 1.197842, 1.131352, 1.068033, 1.007770, 0.950450, 0.895963, 0.844202, 0.795062, 0.748441, 0.704241, 0.662363, 0.622715, 0.585204, 0.549742, 0.516242, 0.484620, 0.454795, 0.426686, 0.400217, 0.375314, 0.351903, 0.329915, 0.309281, 0.289936, 0.271816, 0.254860, 0.239007, 0.224201, 0.210386, 0.197508, 0.185516, 0.174360, 0.163992, 0.154366, 0.145438, 0.137166, 0.129508, 0.122426, 0.115882, 0.109840, 0.104266, 0.099128, 0.094395, 0.090036, 0.086023, 0.082331, 0.078933, 0.075805, 0.072925, 0.070271, 0.067823, 0.065562, 0.063471, 0.061532, 0.059730, 0.058051, 0.056481, 0.055007, 0.053619, 0.052306, 0.051059, 0.049867, 0.048725, 0.047624, 0.046558, 0.045522, 0.044511, 0.043521, 0.042548, 0.041590, 0.040643, 0.039706, 0.038778, 0.037857, 0.036944, 0.036039, 0.035141, 0.034251, 0.033370, 0.032500, 0.031641, 0.030796, 0.029966, 0.029153, 0.028359, 0.027587, 0.026837, 0.026113, 0.025416, 0.024748, 0.024111, 0.023507, 0.022937, 0.022402, 0.021904, 0.021443, 0.021020, 0.020634, 0.020286, 0.019974, 0.019698, 0.019455, 0.019244, 0.019062, 0.018905, 0.018770, 0.018652, 0.018545, 0.018444, 0.018342, 0.018231, 0.018102, 0.017947, 0.017755, 0.017536, 0.017327, 0.017120, 0.016915, 0.016713, 0.016514, 0.016317, 0.016122, 0.015929, 0.015739, 0.015551, 0.015366, 0.015182, 0.015001, 0.014822, 0.014645, 0.014470, 0.014297, 0.014127, 0.013958, 0.013791, 0.013627, 0.013464, 0.013303, 0.013145, 0.012988, 0.012833, 0.012679, 0.012528, 0.012378, 0.012231, 0.012085, 0.011940, 0.011798, 0.011657, 0.011518, 0.011380, 0.011244, 0.011110, 0.010978, 0.010846, 0.010717, 0.010589, 0.010463, 0.010338, 0.010214, 0.010092, 0.009972, 0.009853, 0.009735, 0.009619, 0.009504, 0.009391, 0.009279, 0.009168, 0.009058, 0.008950, 0.008843, 0.008738, 0.008633, 0.008530, 0.008429, 0.008328, 0.008229, 0.008130, 0.008033, 0.007937, 0.007843, 0.007749, 0.007656, 0.007565, 0.007475, 0.007385, 0.007297, 0.007210, 0.007124, 0.007039, 0.006955, 0.006872, 0.006790, 0.006709, 0.006629, 0.006550, 0.006471, 0.006394, 0.006318, 0.006242, 0.006168, 0.006094, 0.006022, 0.005950, 0.005879, 0.005808, 0.005739, 0.005671, 0.005603, 0.005536, 0.005470, 0.005405, 0.005340, 0.005276, 0.005213, 0.005151, 0.005090, 0.005029, 0.004969, 0.004909, 0.004851, 0.004793, 0.004736, 0.004679, 0.004623, 0.004568, 0.004514, 0.004460, 0.004406, 0.004354, 0.004302, 0.004251, 0.004200, 0.004150, 0.004100, 0.004051, 0.004003, 0.003955, 0.003908, 0.003861, 0.003815, 0.003770, 0.003725, 0.003680, 0.003636, 0.003593, 0.003550, 0.003507, 0.003466, 0.003424, 0.003383, 0.003343, 0.003303, 0.003264, 0.003225, 0.003186, 0.003148, 0.003110, 0.003073, 0.003037, 0.003000, 0.002965, 0.002929, 0.002894, 0.002860, 0.002826, 0.002792, 0.002758, 0.002726, 0.002693, 0.002661, 0.002629, 0.002598, 0.002567, 0.002536, 0.002506, 0.002476, 0.002446, 0.002417, 0.002388, 0.002360, 0.002332, 0.002304, 0.002276, 0.002249, 0.002222, 0.002196, 0.002169, 0.002144, 0.002118, 0.002093, 0.002068, 0.002043, 0.002019, 0.001995, 0.001971, 0.001947, 0.001924, 0.001901, 0.001878, 0.001856, 0.001834, 0.001812, 0.001790, 0.001769, 0.001748, 0.001727, 0.001706, 0.001686, 0.001666, 0.001646, 0.001626, 0.001607, 0.001588, 0.001569, 0.001550, 0.001531, 0.001513, 0.001495, 0.001477, 0.001460, 0.001442, 0.001425, 0.001408, 0.001391, 0.001374, 0.001358, 0.001342, 0.001326, 0.001310, 0.001294, 0.001279, 0.001264, 0.001249, 0.001234, 0.001219, 0.001204, 0.001190, 0.001176, 0.001162, 0.001148, 0.001134, 0.001121, 0.001107, 0.001094, 0.001081, 0.001068, 0.001055, 0.001043, 0.001030, 0.001018, 0.001006, 0.000994, 0.000982, 0.000970, 0.000959, 0.000947, 0.000936, 0.000925, 0.000914, 0.000903, 0.000892, 0.000881, 0.000871, 0.000860, 0.000850, 0.000840, 0.000830, 0.000820, 0.000810, 0.000801, 0.000791, 0.000782, 0.000772, 0.000763, 0.000754, 0.000745, 0.000736, 0.000727, 0.000719, 0.000710, 0.000702, 0.000693, 0.000685, 0.000677, 0.000669, 0.000661, 0.000653, 0.000645, 0.000637, 0.000630, 0.000622, 0.000615, 0.000607, 0.000600, 0.000593, 0.000586, 0.000579, 0.000572, 0.000565, 0.000558, 0.000552, 0.000545, 0.000539, 0.000532, 0.000526, 0.000520, 0.000513, 0.000507, 0.000501, 0.000495, 0.000489, 0.000483, 0.000478, 0.000472, 0.000466, 0.000461, 0.000455, 0.000450, 0.000444, 0.000439, 0.000434, 0.000429, 0.000424, 0.000419, 0.000414, 0.000409, 0.000404, 0.000399, 0.000394, 0.000389, 0.000385, 0.000380, 0.000376, 0.000371, 0.000367, 0.000362, 0.000358, 0.000354, 0.000350, 0.000345, 0.000341, 0.000337, 0.000333, 0.000329, 0.000325, 0.000321, 0.000318, 0.000314, 0.000310, 0.000306, 0.000303, 0.000299, 0.000295, 0.000292, 0.000288, 0.000285, 0.000282, 0.000278, 0.000275, 0.000272, 0.000268, 0.000265, 0.000262, 0.000259, 0.000256, 0.000253, 0.000250, 0.000247, 0.000244, 0.000241, 0.000238, 0.000235};
2021  for (Int_t i = 0; i < 500; i++)
2022  {
2023  fHistoPtWeight->SetBinContent(i + 1, binc[i]);
2024  }
2025  //SetWeightHistogram();
2026  fUseWeight = kTRUE;
2027 }
2028 
2029 //_________________________________________________________________________
2031 {
2032  // weight function from the ratio of the LHC16i2a+b+c MC
2033  // and FONLL calculations for pp data
2034 
2035  if (fHistoPtWeight)
2036  delete fHistoPtWeight;
2037  fHistoPtWeight = new TH1F("histoWeight", "histoWeight", 400, 0., 40.);
2038  fHistoPtWeight->Sumw2();
2039  Float_t binc[400] = {1.118416, 1.003458, 0.935514, 0.907222, 0.904359, 0.913668, 0.933906, 0.963898, 0.996388, 1.031708, 1.066404, 1.099683, 1.125805, 1.145181, 1.165910, 1.181905, 1.193425, 1.203891, 1.204726, 1.209411, 1.209943, 1.204763, 1.205291, 1.198912, 1.197390, 1.182005, 1.184194, 1.175994, 1.167881, 1.158348, 1.147190, 1.139833, 1.126940, 1.123322, 1.108389, 1.102199, 1.089464, 1.075874, 1.061964, 1.051429, 1.038113, 1.026668, 1.011441, 0.998567, 0.987658, 0.972434, 0.950068, 0.940758, 0.916880, 0.911931, 0.894512, 0.878691, 0.860589, 0.848025, 0.830774, 0.819399, 0.801134, 0.775276, 0.766382, 0.750495, 0.736935, 0.717529, 0.702637, 0.689152, 0.671334, 0.652030, 0.635696, 0.621365, 0.608362, 0.599019, 0.576024, 0.562136, 0.550938, 0.533587, 0.516410, 0.509744, 0.501655, 0.487402, 0.476469, 0.463762, 0.445979, 0.438088, 0.422214, 0.417467, 0.404357, 0.391450, 0.379996, 0.371201, 0.361497, 0.352912, 0.343189, 0.329183, 0.327662, 0.310783, 0.304525, 0.301007, 0.293306, 0.278332, 0.274419, 0.267361, 0.261459, 0.255514, 0.249293, 0.241129, 0.237600, 0.231343, 0.221982, 0.216872, 0.211094, 0.206954, 0.202333, 0.196572, 0.193274, 0.188240, 0.181817, 0.178364, 0.173614, 0.167135, 0.166055, 0.163423, 0.156557, 0.155821, 0.151985, 0.144909, 0.145062, 0.139720, 0.138873, 0.131892, 0.129969, 0.126509, 0.126978, 0.120451, 0.117661, 0.116300, 0.115604, 0.112215, 0.109237, 0.107720, 0.106419, 0.102050, 0.102777, 0.097406, 0.098447, 0.095964, 0.093868, 0.092430, 0.089329, 0.088249, 0.085881, 0.084417, 0.085498, 0.082444, 0.079151, 0.079565, 0.077811, 0.077293, 0.075218, 0.072445, 0.073054, 0.071545, 0.070279, 0.068046, 0.067854, 0.068092, 0.065378, 0.064405, 0.062060, 0.063391, 0.061718, 0.059616, 0.058913, 0.058895, 0.058311, 0.056320, 0.056527, 0.055349, 0.053701, 0.054735, 0.052264, 0.051277, 0.051554, 0.050545, 0.048995, 0.049507, 0.048466, 0.048156, 0.046809, 0.047600, 0.046078, 0.044801, 0.044113, 0.043700, 0.043530, 0.043396, 0.042556, 0.041048, 0.041657, 0.040394, 0.041314, 0.040720, 0.039656, 0.038478, 0.039276, 0.038777, 0.037730, 0.036918, 0.036466, 0.035827, 0.035285, 0.035963, 0.034371, 0.034757, 0.033205, 0.033666, 0.033266, 0.032583, 0.033570, 0.032102, 0.032107, 0.031464, 0.032160, 0.030091, 0.030564, 0.029464, 0.029613, 0.029626, 0.029512, 0.029324, 0.028607, 0.027628, 0.027251, 0.027072, 0.027077, 0.026724, 0.026961, 0.026303, 0.026237, 0.025454, 0.025133, 0.025365, 0.026014, 0.024807, 0.023901, 0.023459, 0.023405, 0.023654, 0.023981, 0.023675, 0.022493, 0.022781, 0.021801, 0.021704, 0.022372, 0.021189, 0.020681, 0.020779, 0.021324, 0.020558, 0.020901, 0.020586, 0.020808, 0.019276, 0.019516, 0.019706, 0.018935, 0.018632, 0.018516, 0.019187, 0.018916, 0.018039, 0.018208, 0.018045, 0.017628, 0.017916, 0.017711, 0.017838, 0.017222, 0.016565, 0.015733, 0.016264, 0.015826, 0.016090, 0.016622, 0.015802, 0.016621, 0.015441, 0.015309, 0.014860, 0.014935, 0.014968, 0.014443, 0.014485, 0.015136, 0.014078, 0.014414, 0.013908, 0.014071, 0.014078, 0.013766, 0.013436, 0.013507, 0.013480, 0.013224, 0.013041, 0.013935, 0.012885, 0.012453, 0.012528, 0.012492, 0.012225, 0.012542, 0.012706, 0.012136, 0.011902, 0.011560, 0.011448, 0.011861, 0.011271, 0.011831, 0.011159, 0.011171, 0.010966, 0.011311, 0.011002, 0.011130, 0.010995, 0.010450, 0.010663, 0.010678, 0.010492, 0.009861, 0.010507, 0.009916, 0.010121, 0.010029, 0.010046, 0.009370, 0.009647, 0.010104, 0.009282, 0.009830, 0.009403, 0.009148, 0.009172, 0.008893, 0.009158, 0.009019, 0.008780, 0.008579, 0.009063, 0.008634, 0.008988, 0.008265, 0.008581, 0.008575, 0.008690, 0.008181, 0.008352, 0.008150, 0.008430, 0.008256, 0.008119, 0.008453, 0.008447, 0.008021, 0.007938, 0.008025, 0.007718, 0.008127, 0.007651, 0.007590, 0.007316, 0.007839, 0.007504, 0.007341, 0.007527, 0.007263, 0.007668, 0.007306, 0.007271, 0.006910, 0.007257, 0.007260, 0.006810, 0.006967, 0.006887, 0.006867, 0.007202, 0.006829, 0.006370, 0.006710, 0.006417, 0.006361, 0.006800, 0.006410, 0.006323, 0.006790, 0.006322, 0.006673, 0.006547};
2040  for (Int_t i = 0; i < 400; i++)
2041  {
2042  fHistoPtWeight->SetBinContent(i + 1, binc[i]);
2043  }
2044  //SetWeightHistogram();
2045  fUseWeight = kTRUE;
2046 }
2047 
2048 //_________________________________________________________________________
2050 {
2051  // weight function from the ratio of the LHC16i2a+b+c MC
2052  // and FONLL calculations for pp data
2053  // corrected by the BAMPS Raa calculation for 30-50% CC
2054  if (fHistoPtWeight)
2055  delete fHistoPtWeight;
2056  fHistoPtWeight = new TH1F("histoWeight", "histoWeight", 400, 0., 40.);
2057  fHistoPtWeight->Sumw2();
2058  Float_t binc[400] = {2.166180, 1.866117, 1.667595, 1.547176, 1.486661, 1.457891, 1.426949, 1.399055, 1.383278, 1.349383, 1.317009, 1.282321, 1.234257, 1.181136, 1.136655, 1.087523, 1.037912, 0.993256, 0.944746, 0.900948, 0.865869, 0.827193, 0.794424, 0.757723, 0.733020, 0.700164, 0.682189, 0.659872, 0.637918, 0.615749, 0.593020, 0.574402, 0.556158, 0.542663, 0.525494, 0.516038, 0.503629, 0.490980, 0.479143, 0.469005, 0.457749, 0.447668, 0.436803, 0.427073, 0.418282, 0.407867, 0.395093, 0.387861, 0.374742, 0.369462, 0.360146, 0.351991, 0.342990, 0.336259, 0.327730, 0.322382, 0.314602, 0.303874, 0.299820, 0.293049, 0.287539, 0.280329, 0.274866, 0.269939, 0.263299, 0.256057, 0.249215, 0.242170, 0.235704, 0.230709, 0.220529, 0.213921, 0.208394, 0.202424, 0.196700, 0.194943, 0.192620, 0.187894, 0.184411, 0.180204, 0.172915, 0.169077, 0.162201, 0.159636, 0.153904, 0.148296, 0.143282, 0.139306, 0.135561, 0.132342, 0.128696, 0.123444, 0.122873, 0.116544, 0.114197, 0.112878, 0.110018, 0.104547, 0.103222, 0.100707, 0.098622, 0.096513, 0.094295, 0.091334, 0.090122, 0.087870, 0.084894, 0.083729, 0.082265, 0.081404, 0.080323, 0.078750, 0.078132, 0.076781, 0.074823, 0.074050, 0.072614, 0.070093, 0.069828, 0.068907, 0.066189, 0.066054, 0.064600, 0.061757, 0.061986, 0.059862, 0.059656, 0.056807, 0.055956, 0.054386, 0.054507, 0.051629, 0.050358, 0.049702, 0.049331, 0.047814, 0.046476, 0.045762, 0.045142, 0.043224, 0.043484, 0.041282, 0.041794, 0.040809, 0.039985, 0.039439, 0.038181, 0.037782, 0.036831, 0.036264, 0.036790, 0.035535, 0.034173, 0.034409, 0.033659, 0.033308, 0.032290, 0.030981, 0.031121, 0.030361, 0.029708, 0.028653, 0.028461, 0.028449, 0.027208, 0.026697, 0.025623, 0.026069, 0.025279, 0.024332, 0.024341, 0.024629, 0.024677, 0.024117, 0.024490, 0.024257, 0.023804, 0.024537, 0.023692, 0.023502, 0.023888, 0.023673, 0.023193, 0.023684, 0.023429, 0.023521, 0.023014, 0.023346, 0.022544, 0.021866, 0.021477, 0.021224, 0.021089, 0.020972, 0.020515, 0.019739, 0.019982, 0.019328, 0.019719, 0.019387, 0.018833, 0.018227, 0.018558, 0.018276, 0.017738, 0.017460, 0.017365, 0.017178, 0.017033, 0.017478, 0.016817, 0.017119, 0.016463, 0.016802, 0.016711, 0.016475, 0.017083, 0.016441, 0.016548, 0.016320, 0.016786, 0.015804, 0.016153, 0.015668, 0.015843, 0.015810, 0.015651, 0.015454, 0.014981, 0.014376, 0.014089, 0.013906, 0.013818, 0.013549, 0.013580, 0.013160, 0.013040, 0.012566, 0.012324, 0.012353, 0.012582, 0.011915, 0.011401, 0.011112, 0.011008, 0.011046, 0.011119, 0.010954, 0.010439, 0.010604, 0.010179, 0.010163, 0.010507, 0.009981, 0.009771, 0.009846, 0.010134, 0.009798, 0.009991, 0.009869, 0.010005, 0.009295, 0.009438, 0.009557, 0.009210, 0.009088, 0.009057, 0.009412, 0.009306, 0.008899, 0.009009, 0.008952, 0.008764, 0.008926, 0.008842, 0.008924, 0.008634, 0.008322, 0.007920, 0.008205, 0.008000, 0.008151, 0.008438, 0.008037, 0.008472, 0.007886, 0.007835, 0.007621, 0.007675, 0.007707, 0.007452, 0.007489, 0.007841, 0.007308, 0.007497, 0.007248, 0.007348, 0.007367, 0.007227, 0.007097, 0.007179, 0.007209, 0.007115, 0.007059, 0.007588, 0.007058, 0.006862, 0.006945, 0.006965, 0.006856, 0.007075, 0.007209, 0.006925, 0.006830, 0.006672, 0.006645, 0.006923, 0.006615, 0.006982, 0.006622, 0.006666, 0.006579, 0.006823, 0.006673, 0.006786, 0.006740, 0.006440, 0.006606, 0.006650, 0.006568, 0.006206, 0.006646, 0.006305, 0.006468, 0.006442, 0.006486, 0.006080, 0.006291, 0.006622, 0.006113, 0.006506, 0.006254, 0.006114, 0.006161, 0.006002, 0.006211, 0.006146, 0.006012, 0.005902, 0.006264, 0.005996, 0.006271, 0.005793, 0.006043, 0.006067, 0.006177, 0.005842, 0.005991, 0.005872, 0.006102, 0.006003, 0.005930, 0.006201, 0.006224, 0.005937, 0.005901, 0.005992, 0.005788, 0.006121, 0.005787, 0.005766, 0.005582, 0.006006, 0.005774, 0.005672, 0.005841, 0.005660, 0.006000, 0.005741, 0.005737, 0.005475, 0.005773, 0.005799, 0.005462, 0.005610, 0.005569, 0.005574, 0.005871, 0.005589, 0.005234, 0.005535, 0.005314, 0.005288, 0.005676, 0.005371, 0.005319, 0.005734, 0.005360, 0.005679, 0.005593};
2059  for (Int_t i = 0; i < 400; i++)
2060  {
2061  fHistoPtWeight->SetBinContent(i + 1, binc[i]);
2062  }
2063  fUseWeight = kTRUE;
2064 }
2065 
2066 //_________________________________________________________________________
2068 {
2069  // weight function from the ratio of the LHC16i2a+b+c MC
2070  // and FONLL calculations for pp data
2071  // corrected by the TAMU Raa calculation for 0-10% CC (not available in 30-50% CC)
2072  if (fHistoPtWeight)
2073  delete fHistoPtWeight;
2074  fHistoPtWeight = new TH1F("histoWeight", "histoWeight", 400, 0., 40.);
2075  fHistoPtWeight->Sumw2();
2076  Float_t binc[400] = {1.179906, 1.091249, 1.047774, 1.045579, 1.071679, 1.112413, 1.167414, 1.236240, 1.310301, 1.390289, 1.471711, 1.553389, 1.626886, 1.692115, 1.760647, 1.813658, 1.850817, 1.886699, 1.907671, 1.934832, 1.955433, 1.966727, 1.987262, 1.996316, 2.013326, 1.973926, 1.931144, 1.871654, 1.812942, 1.752718, 1.690846, 1.635303, 1.572611, 1.523510, 1.459790, 1.402510, 1.331908, 1.261575, 1.192241, 1.127915, 1.061798, 0.998830, 0.933514, 0.871774, 0.812936, 0.762844, 0.719340, 0.686587, 0.644108, 0.615714, 0.579512, 0.545254, 0.510508, 0.479884, 0.447423, 0.426154, 0.408934, 0.388264, 0.376424, 0.361389, 0.347757, 0.331685, 0.318029, 0.305285, 0.290922, 0.278523, 0.269807, 0.262025, 0.254878, 0.249325, 0.238179, 0.230899, 0.224792, 0.216253, 0.207879, 0.204465, 0.201153, 0.195373, 0.190926, 0.185773, 0.178589, 0.175371, 0.168959, 0.167004, 0.161705, 0.156809, 0.152788, 0.149806, 0.146429, 0.143478, 0.140037, 0.134813, 0.134679, 0.128205, 0.126078, 0.125038, 0.122214, 0.116329, 0.115044, 0.112427, 0.110279, 0.108098, 0.105784, 0.102628, 0.101429, 0.099101, 0.095464, 0.093631, 0.091491, 0.090045, 0.088374, 0.086188, 0.085067, 0.083168, 0.080636, 0.079414, 0.077610, 0.075013, 0.074825, 0.073932, 0.071106, 0.071050, 0.069574, 0.066593, 0.066924, 0.064876, 0.065064, 0.062345, 0.061980, 0.060859, 0.061616, 0.058952, 0.058079, 0.057894, 0.058031, 0.056604, 0.055180, 0.054490, 0.053909, 0.051768, 0.052210, 0.049552, 0.050152, 0.048955, 0.047953, 0.047224, 0.045588, 0.044985, 0.043728, 0.042934, 0.043434, 0.041834, 0.040118, 0.040281, 0.039348, 0.038987, 0.037793, 0.036258, 0.036420, 0.035528, 0.034761, 0.033524, 0.033296, 0.033280, 0.031825, 0.031351, 0.030329, 0.031103, 0.030401, 0.029481, 0.029247, 0.029352, 0.029174, 0.028286, 0.028500, 0.028017, 0.027293, 0.027932, 0.026779, 0.026379, 0.026628, 0.026211, 0.025508, 0.025877, 0.025433, 0.025328, 0.024636, 0.025069, 0.024282, 0.023625, 0.023278, 0.023074, 0.023000, 0.022943, 0.022514, 0.021767, 0.022180, 0.021594, 0.022175, 0.021944, 0.021456, 0.020901, 0.021419, 0.021230, 0.020738, 0.020322, 0.020055, 0.019686, 0.019371, 0.019725, 0.018835, 0.019029, 0.018163, 0.018398, 0.018163, 0.017719, 0.018126, 0.017208, 0.017086, 0.016622, 0.016865, 0.015663, 0.015791, 0.015108, 0.015069, 0.015033, 0.015006, 0.014940, 0.014604, 0.014133, 0.013968, 0.013904, 0.013934, 0.013780, 0.013930, 0.013727, 0.013940, 0.013763, 0.013826, 0.014192, 0.014801, 0.014347, 0.014048, 0.014009, 0.014197, 0.014571, 0.014999, 0.015030, 0.014491, 0.014891, 0.014456, 0.014596, 0.015256, 0.014648, 0.014492, 0.014756, 0.015344, 0.014986, 0.015433, 0.015394, 0.015756, 0.014778, 0.015145, 0.015478, 0.015051, 0.014986, 0.015067, 0.015793, 0.015748, 0.015188, 0.015502, 0.015533, 0.015340, 0.015759, 0.015745, 0.016026, 0.015635, 0.015194, 0.014579, 0.015225, 0.014963, 0.015365, 0.016030, 0.015387, 0.016341, 0.015327, 0.015340, 0.015030, 0.015246, 0.015420, 0.015015, 0.015195, 0.016021, 0.015034, 0.015528, 0.015114, 0.015423, 0.015564, 0.015348, 0.015107, 0.015314, 0.015411, 0.015243, 0.015154, 0.016324, 0.015215, 0.014823, 0.015030, 0.015104, 0.014896, 0.015400, 0.015721, 0.015131, 0.014951, 0.014630, 0.014597, 0.015235, 0.014583, 0.015418, 0.014648, 0.014769, 0.014601, 0.015167, 0.014857, 0.015134, 0.015053, 0.014405, 0.014800, 0.014921, 0.014760, 0.013966, 0.014979, 0.014230, 0.014620, 0.014581, 0.014701, 0.013799, 0.014299, 0.015071, 0.013931, 0.014846, 0.014290, 0.013988, 0.014113, 0.013767, 0.014263, 0.014131, 0.013840, 0.013604, 0.014456, 0.013853, 0.014505, 0.013416, 0.014010, 0.014081, 0.014352, 0.013589, 0.013952, 0.013690, 0.014241, 0.014024, 0.013868, 0.014517, 0.014587, 0.013927, 0.013857, 0.014084, 0.013619, 0.014417, 0.013644, 0.013607, 0.013185, 0.014200, 0.013665, 0.013437, 0.013849, 0.013431, 0.014252, 0.013648, 0.013652, 0.013039, 0.013761, 0.013836, 0.013043, 0.013408, 0.013319, 0.013344, 0.014065, 0.013400, 0.012560, 0.013294, 0.012773, 0.012721, 0.013663, 0.012939, 0.012823, 0.013835, 0.012942, 0.013723, 0.013525};
2077  for (Int_t i = 0; i < 400; i++)
2078  {
2079  fHistoPtWeight->SetBinContent(i + 1, binc[i]);
2080  }
2081  fUseWeight = kTRUE;
2082 }
2083 
2084 //_________________________________________________________________________
2086 {
2087  // Weight function from the ratio of the LHC17c3a1+2 MC
2088  // and FONLL calculations for pp data at 13 TeV
2089  // (From D0, Susanna Costanza)
2090  if (fHistoPtWeight)
2091  delete fHistoPtWeight;
2092  fHistoPtWeight = new TH1F("histoWeight", "histoWeight", 400, 0., 40.);
2093  fHistoPtWeight->Sumw2();
2094  Float_t binc[400] = {1.489198, 1.386131, 1.328213, 1.309866, 1.324383, 1.364766, 1.424282, 1.496803, 1.576996, 1.660407, 1.743464, 1.823431, 1.898334, 1.966862, 2.028262, 2.082235, 2.128839, 2.168395, 2.201406, 2.228492, 2.250331, 2.267616, 2.281022, 2.291181, 2.298668, 2.303992, 2.307592, 2.309839, 2.311043, 2.311454, 2.311272, 2.310653, 2.309719, 2.308559, 2.307242, 2.305816, 2.304318, 2.302771, 2.301193, 2.299596, 2.297986, 2.296369, 2.294749, 2.293127, 2.291504, 2.289881, 2.288259, 2.286638, 2.285018, 2.283398, 2.281780, 2.280163, 2.278547, 2.276933, 2.275319, 2.273707, 2.272095, 2.270485, 2.268876, 2.267268, 2.265661, 2.264056, 2.262451, 2.260848, 2.259246, 2.257645, 2.256045, 2.254446, 2.252848, 2.251252, 2.249656, 2.248062, 2.246469, 2.244877, 2.243286, 2.241696, 2.240108, 2.238520, 2.236934, 2.235348, 2.233764, 2.232181, 2.230599, 2.229019, 2.227439, 2.225860, 2.224283, 2.222707, 2.221132, 2.219557, 2.217985, 2.216413, 2.214842, 2.213272, 2.211704, 2.210136, 2.208570, 2.207005, 2.205441, 2.203878, 2.202316, 2.200755, 2.199196, 2.197637, 2.196080, 2.194524, 2.192968, 2.192011, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000, 2.192000};
2095  for (Int_t i = 0; i < 400; i++)
2096  {
2097  fHistoPtWeight->SetBinContent(i + 1, binc[i]);
2098  }
2099  fUseWeight = kTRUE;
2100 }
2101 
2102 //_________________________________________________________________________
2104 {
2105  // Weight function from the ratio of the LHC18a4a2 (fast+cent) MC
2106  // and FONLL calculations for pp data at 5 TeV (from D0)
2107  if (fHistoPtWeight)
2108  delete fHistoPtWeight;
2109  fHistoPtWeight = new TH1F("histoWeight", "histoWeight", 500, 0., 50.);
2110  fHistoPtWeight->Sumw2();
2111  Float_t binc[500] = {0.7836, 0.7203, 0.6840, 0.6749, 0.6840, 0.7038, 0.7337, 0.7691, 0.8098, 0.8520, 0.8917, 0.9331, 0.9673, 0.9985, 1.0297, 1.0569, 1.0781, 1.0993, 1.1166, 1.1285, 1.1425, 1.1520, 1.1598, 1.1685, 1.1762, 1.1791, 1.1858, 1.1899, 1.1944, 1.1986, 1.1968, 1.2041, 1.2072, 1.2031, 1.2068, 1.2090, 1.2079, 1.2089, 1.2081, 1.2047, 1.2088, 1.2093, 1.2085, 1.2105, 1.2099, 1.2125, 1.2108, 1.2090, 1.2071, 1.2066, 1.2122, 1.2126, 1.2131, 1.2136, 1.2141, 1.2145, 1.2150, 1.2155, 1.2160, 1.2165, 1.2169, 1.2174, 1.2179, 1.2184, 1.2188, 1.2193, 1.2198, 1.2203, 1.2207, 1.2212, 1.2217, 1.2222, 1.2227, 1.2231, 1.2236, 1.2241, 1.2246, 1.2250, 1.2255, 1.2260, 1.2265, 1.2269, 1.2274, 1.2279, 1.2284, 1.2289, 1.2293, 1.2298, 1.2303, 1.2308, 1.2312, 1.2317, 1.2322, 1.2327, 1.2331, 1.2336, 1.2341, 1.2346, 1.2351, 1.2355, 1.2360, 1.2365, 1.2370, 1.2374, 1.2379, 1.2384, 1.2389, 1.2393, 1.2398, 1.2403, 1.2408, 1.2413, 1.2417, 1.2422, 1.2427, 1.2432, 1.2436, 1.2441, 1.2446, 1.2451, 1.2455, 1.2460, 1.2465, 1.2470, 1.2475, 1.2479, 1.2484, 1.2489, 1.2494, 1.2498, 1.2503, 1.2508, 1.2513, 1.2517, 1.2522, 1.2527, 1.2532, 1.2537, 1.2541, 1.2546, 1.2551, 1.2556, 1.2560, 1.2565, 1.2570, 1.2575, 1.2579, 1.2584, 1.2589, 1.2594, 1.2599, 1.2603, 1.2608, 1.2613, 1.2618, 1.2622, 1.2627, 1.2632, 1.2637, 1.2641, 1.2646, 1.2651, 1.2656, 1.2661, 1.2665, 1.2670, 1.2675, 1.2680, 1.2684, 1.2689, 1.2694, 1.2699, 1.2703, 1.2708, 1.2713, 1.2718, 1.2723, 1.2727, 1.2732, 1.2737, 1.2742, 1.2746, 1.2751, 1.2756, 1.2761, 1.2765, 1.2770, 1.2775, 1.2780, 1.2785, 1.2789, 1.2794, 1.2799, 1.2804, 1.2808, 1.2813, 1.2818, 1.2823, 1.2827, 1.2832, 1.2837, 1.2842, 1.2847, 1.2851, 1.2856, 1.2861, 1.2866, 1.2870, 1.2875, 1.2880, 1.2885, 1.2889, 1.2894, 1.2899, 1.2904, 1.2909, 1.2913, 1.2918, 1.2923, 1.2928, 1.2932, 1.2937, 1.2942, 1.2947, 1.2951, 1.2956, 1.2961, 1.2966, 1.2971, 1.2975, 1.2980, 1.2985, 1.2990, 1.2994, 1.2999, 1.3004, 1.3009, 1.3013, 1.3018, 1.3023, 1.3028, 1.3033, 1.3037, 1.3042, 1.3047, 1.3052, 1.3056, 1.3061, 1.3066, 1.3071, 1.3075, 1.3080, 1.3085, 1.3090, 1.3095, 1.3099, 1.3104, 1.3109, 1.3114, 1.3118, 1.3123, 1.3128, 1.3133, 1.3137, 1.3142, 1.3147, 1.3152, 1.3157, 1.3161, 1.3166, 1.3171, 1.3176, 1.3180, 1.3185, 1.3190, 1.3195, 1.3199, 1.3204, 1.3209, 1.3214, 1.3219, 1.3223, 1.3228, 1.3233, 1.3238, 1.3242, 1.3247, 1.3252, 1.3257, 1.3262, 1.3266, 1.3271, 1.3276, 1.3281, 1.3285, 1.3290, 1.3295, 1.3300, 1.3304, 1.3309, 1.3314, 1.3319, 1.3324, 1.3328, 1.3333, 1.3338, 1.3343, 1.3347, 1.3352, 1.3357, 1.3362, 1.3366, 1.3371, 1.3376, 1.3381, 1.3386, 1.3390, 1.3395, 1.3400, 1.3405, 1.3409, 1.3414, 1.3419, 1.3424, 1.3428, 1.3433, 1.3438, 1.3443, 1.3448, 1.3452, 1.3457, 1.3462, 1.3467, 1.3471, 1.3476, 1.3481, 1.3486, 1.3490, 1.3495, 1.3500, 1.3505, 1.3510, 1.3514, 1.3519, 1.3524, 1.3529, 1.3533, 1.3538, 1.3543, 1.3548, 1.3552, 1.3557, 1.3562, 1.3567, 1.3572, 1.3576, 1.3581, 1.3586, 1.3591, 1.3595, 1.3600, 1.3605, 1.3610, 1.3614, 1.3619, 1.3624, 1.3629, 1.3634, 1.3638, 1.3643, 1.3648, 1.3653, 1.3657, 1.3662, 1.3667, 1.3672, 1.3676, 1.3681, 1.3686, 1.3691, 1.3696, 1.3700, 1.3705, 1.3710, 1.3715, 1.3719, 1.3724, 1.3729, 1.3734, 1.3738, 1.3743, 1.3748, 1.3753, 1.3758, 1.3762, 1.3767, 1.3772, 1.3777, 1.3781, 1.3786, 1.3791, 1.3796, 1.3800, 1.3805, 1.3810, 1.3815, 1.3820, 1.3824, 1.3829, 1.3834, 1.3839, 1.3843, 1.3848, 1.3853, 1.3858, 1.3862, 1.3867, 1.3872, 1.3877, 1.3882, 1.3886, 1.3891, 1.3896, 1.3901, 1.3905, 1.3910, 1.3915, 1.3920, 1.3924, 1.3929, 1.3934, 1.3939, 1.3944, 1.3948, 1.3953, 1.3958, 1.3963, 1.3967, 1.3972, 1.3977, 1.3982, 1.3986, 1.3991, 1.3996, 1.4001, 1.4006, 1.4010, 1.4015, 1.4020, 1.4025, 1.4029, 1.4034, 1.4039, 1.4044, 1.4048, 1.4053, 1.4058, 1.4063, 1.4068, 1.4072, 1.4077, 1.4082, 1.4087, 1.4091, 1.4096, 1.4101, 1.4106, 1.4110, 1.4115, 1.4120, 1.4125, 1.4130, 1.4134, 1.4139, 1.4144, 1.4149, 1.4153, 1.4158, 1.4163, 1.4168, 1.4172, 1.4177, 1.4182, 1.4187, 1.4192, 1.4196, 1.4201, 1.4206, 1.4211, 1.4215, 1.4220, 1.4225, 1.4230, 1.4234, 1.4239, 1.4244, 1.4249, 1.4254, 1.4258, 1.4263};
2112  for (Int_t i = 0; i < 500; i++)
2113  {
2114  fHistoPtWeight->SetBinContent(i + 1, binc[i]);
2115  }
2116  fUseWeight = kTRUE;
2117 }
2118 
2119 //_________________________________________________________________________
2121 {
2122  //
2123  // Using an histogram as weight function
2124  // weight = 0 in the range outside the function
2125  //
2126  Double_t weight = 0.0;
2127  Int_t histoNbins = fHistoPtWeight->GetNbinsX();
2128  Int_t bin2 = fHistoPtWeight->FindBin(pt);
2129  if ((bin2 > 0) && (bin2 <= histoNbins))
2130  {
2131  Int_t bin1 = bin2 - 1;
2132  Int_t bin3 = bin2 + 1;
2133  if (bin2 == 1)
2134  bin1 = bin2 + 2;
2135  if (bin2 == histoNbins)
2136  bin3 = bin2 - 2;
2137  Float_t x_1 = fHistoPtWeight->GetXaxis()->GetBinCenter(bin1);
2138  Float_t x_2 = fHistoPtWeight->GetXaxis()->GetBinCenter(bin2);
2139  Float_t x_3 = fHistoPtWeight->GetXaxis()->GetBinCenter(bin3);
2140  Float_t y_1 = fHistoPtWeight->GetBinContent(bin1);
2141  Float_t y_2 = fHistoPtWeight->GetBinContent(bin2);
2142  Float_t y_3 = fHistoPtWeight->GetBinContent(bin3);
2143  Double_t a = ((y_3 - y_2) * (x_1 - x_2) - (y_1 - y_2) * (x_3 - x_2)) / ((x_3 * x_3 - x_2 * x_2) * (x_1 - x_2) - (x_1 * x_1 - x_2 * x_2) * (x_3 - x_2));
2144  Double_t b = ((y_1 - y_2) - a * (x_1 * x_1 - x_2 * x_2)) / (x_1 - x_2);
2145  Double_t c = y_3 - a * (x_3 * x_3) - b * x_3;
2146  weight = a * pt * pt + b * pt + c;
2147  }
2148  return weight;
2149 }
Int_t charge
Double_t NormalizedDecayLengthXY() const
Bool_t IsEventRejectedDueToCentrality() const
Definition: AliRDHFCuts.h:337
Int_t pdg
AliAODTrack * GetProng(AliVEvent *event, AliAODRecoDecayHF *rd, Int_t iprong)
THnSparseF * fnSparseMCDplus[4]
TH1F * fPtMaxHist[4 *kMaxPtBins]
! hist. for Pt Max (Prod Cuts)
Bool_t IsEventRejectedDueToZVertexOutsideFiducialRegion() const
Definition: AliRDHFCuts.h:331
Double_t NormalizedDecayLength() const
THnSparseF * fnSparseMC[4]
!<!THnSparse for candidates on data
Bool_t IsEventRejectedDueToNotRecoVertex() const
Definition: AliRDHFCuts.h:322
double Double_t
Definition: External.C:58
Definition: External.C:260
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
Definition: External.C:236
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
TH1F * fPtProng1Hist[4 *kMaxPtBins]
! hist. for DCA (Prod Cuts)
TH3F * fCosPxyHist3D
! cosPxy vs Ds mass vs pt
TH1F * fDLenxyHist[4 *kMaxPtBins]
! hist. of norm decay length XY (sig,bkg,tot)
TH1F * fNormIPHist[4 *kMaxPtBins]
! hist. for topomatic variable
TH3F * fPtProng1Hist3D
! Pt prong1 vs Ds mass vs pt
void SetPtBins(Int_t n, Float_t *lim)
Int_t IsEventSelectedInCentrality(AliVEvent *event)
Bool_t HasSelectionBit(Int_t i) const
TH1F * fNDLenxyHist[4 *kMaxPtBins]
! hist. of decay length XY (sig,bkg,tot)
TH2F * fDalitzK0st[4 *kMaxPtBins]
! dalitz plot via K0* (sig,bkg,tot)
static Int_t CheckDsDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
Bool_t fFillSparseDplus
flag for usage of THnSparse
Double_t mass
Double_t CosPiDsLabFrameKKpi() const
Double_t ImpParXY() const
Int_t GetHistoIndex(Int_t iPtBin) const
static Int_t CheckMatchingAODdeltaAODevents()
THnSparseF * fImpParSparse
!<!THnSparse for MC for D+->kkpi
TH3F * fSigVertHist3D
! SigVert vs Ds mass vs pt
Double_t fMassRange
limits for pt bins
Bool_t IsEventRejectedDueToVertexContributors() const
Definition: AliRDHFCuts.h:325
TH2F * fPtVsMass
! hist. of pt vs. mass (prod. cuts)
TCanvas * c
Definition: TestFitELoss.C:172
Double_t CosPointingAngleXY() const
TH1F * fPtProng0Hist[4 *kMaxPtBins]
! hist. for Pt Max (Prod Cuts)
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
TH2F * fYVsPtSig
! hist. of Y vs. Pt (MC, only sig, prod. cuts)
TAxis * GetAxis(TDirectory *dir, const char *name, Bool_t verbose=true)
Int_t GetPidOption() const
THnSparseF * fImpParSparseMC[4]
!<!THnSparse for imp. par. on data
Float_t GetTrueImpactParameterDstoPhiPi(const AliAODMCHeader *mcHeader, TClonesArray *arrayMC, const AliAODMCParticle *partDs) const
virtual void UserCreateOutputObjects()
Implementation of interface methods.
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Functions to check the decay tree.
Bool_t fFillSparse
flag for usage of HasSelectionBit
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:258
TH1F * fSumd02Hist[4 *kMaxPtBins]
! hist. for sum d02 (Prod Cuts)
TH3F * fCosPiKPhiHist3D
! cosPiKPhi vs Ds mass vs pt
UInt_t GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const
TH1F * fMassHistPhi[4 *kMaxPtBins]
! hist. of mass spectra via phi (sig,bkg,tot)
TH1F * fCosPiKPhiHist[4 *kMaxPtBins]
! hist. for CosPiKPhi
Bool_t fDoBkgPhiSB
flag to create rotational bkg (rotating pi track)
THnSparseF * fnSparse
Cuts for Analysis.
TNtuple * fNtupleDs
! output ntuple
void GetCentralityAxisName(Int_t flag)
TH1F * fMassRotBkgHistPhi[kMaxPtBins]
! hist. of bkg generated from rot. of the pion
void GenerateRotBkg(AliAODRecoDecayHF3Prong *d, Int_t dec, Int_t iPtBin)
Bool_t fDoRotBkg
flag for filling true reconstructed Ds at acceptance level (see FillMCGenAccHistos) ...
TH3F * fPtProng0Hist3D
! Pt prong0 vs Ds mass vs pt
TH1F * fHistCentrality[3]
!hist. for cent distr (all,sel ev, )
void SetPtWeightsFromFONLL5anddataoverLHC16i2a()
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
TH3F * fDCAHist3D
! DCA vs Ds mass vs pt
int Int_t
Definition: External.C:63
TH3F * fCosPHist3D
! cosP vs Ds mass vs pt
AliNormalizationCounter * fCounter
flag to set mass window of phi meson (when using pion rotation to create bkg)
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
TH2F * fHistCentralityMult[3]
!hist. for cent distr vs mult (all,sel ev, )
const Double_t ptmax
TH1F * fHistNEvents
! hist. for No. of events
static Int_t CheckDplusKKpiDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
Double_t GetPtWeightFromHistogram(Double_t pt)
AliRDHFCutsDstoKKpi * fAnalysisCuts
TList * fOutput
! list send on output slot 0
TH2F * fHistAllV0multNTPCout
! histo for V0mult vs #tracks TPCout (all)
Double_t CosPiKPhiRFrameKKpi() const
Bool_t fUseTrkl
flag to decide whether to use pt-weights != 1 when filling the container or not
TH1F * fCosPxyHist[4 *kMaxPtBins]
! hist. of cosXY pointing angle (sig,bkg,tot)
void SetPtWeightsFromFONLL5andTAMUoverLHC16i2abc()
AliAODVertex * GetOwnPrimaryVtx() const
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
TH3F * fPtProng2Hist3D
! Pt prong2 vs Ds mass vs pt
Bool_t CheckDaugAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
TH2F * fDalitzPhi[4 *kMaxPtBins]
! dalitz plot via phi (sig,bkg,tot)
TH2F * fHistSelV0multNTPCout
! histo for V0mult vs #tracks TPCout (sel)
Float_t GetCentrality(AliAODEvent *aodEvent)
Definition: AliRDHFCuts.h:259
Bool_t IsEventRejectedDueToPileup() const
Definition: AliRDHFCuts.h:334
TH3F * fDLenHist3D
! Dlen vs Ds mass vs pt
TH1F * fMassHistKpi[kMaxPtBins]
! hist. of mass spectra of Kpi
TH1F * fMassRSBkgHistPhi[kMaxPtBins]
! hist. of bkg generated from right phi sideband + pion
Int_t fSystem
off = kFALSE (default)
TH3F * fNormIPHist3D
! nIP vs Ds mass vs pt
Bool_t IsCutOnResonancesApplied() const
TH1F * fPtCandHist[4 *kMaxPtBins]
! hist. for Pt Max (Prod Cuts)
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)
short Short_t
Definition: External.C:23
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
Double_t CosPiDsLabFramepiKK() const
Bool_t fReadMC
0 = pp, 1 = pPb,PbPb
Double_t DecayLengthXY() const
Int_t fAODProtection
flag to fill sparse with Ntracklets
Bool_t GetIsPrimaryWithoutDaughters() const
Definition: AliRDHFCuts.h:279
TH1F * fCosPiDsHist[4 *kMaxPtBins]
! hist. for CosPiDs
Int_t GetSignalHistoIndex(Int_t iPtBin) const
Bool_t IsEventSelected(AliVEvent *event)
virtual Int_t PreSelect(TObjArray aodTracks)
TH1F * fMassLSBkgHistPhi[kMaxPtBins]
! hist. of bkg generated from left phi sideband + pion
virtual void UserExec(Option_t *option)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
Int_t GetReflSignalHistoIndex(Int_t iPtBin) const
virtual void Terminate(Option_t *option)
TH1F * fCosPHist[4 *kMaxPtBins]
! hist. of cos pointing angle (sig,bkg,tot)
TString fCentEstName
name of the AliMultSelection object to be considered
TH3F * fDLenxyHist3D
! Dlenxy vs Ds mass vs pt
Bool_t fFillImpParSparse
flag for usage of THnSparse
Double_t minMass
Bool_t fDoCutV0multTPCout
flag to create bkg from phi sidebands
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
Float_t * GetPtBinLimits() const
Definition: AliRDHFCuts.h:249
Bool_t fUseWeight
flag to activate cut on V0mult vs #tracks TPCout
TH1F * fDLenHist[4 *kMaxPtBins]
! hist. of decay length (sig,bkg,tot)
Bool_t fUseSelectionBit
flag to create and fill histos with distributions of cut variables
Double_t GetWeightForpiKK() const
Double_t GetWeightForKKpi() const
const char Option_t
Definition: External.C:48
TH1F * fChanHist[4]
! hist. with KKpi and piKK candidates (sig,bkg,tot)
TH1F * fMassHist[4 *kMaxPtBins]
! hist. of mass spectra (sig,bkg,tot)
Int_t GetNPtBins() const
Definition: AliRDHFCuts.h:250
TH1F * fDCAHist[4 *kMaxPtBins]
! hist. for DCA (Prod Cuts)
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:319
Bool_t fDoCutVarHistos
flag to control ntuple writing in MC
const Int_t nbins
Double_t maxMass
TH1F * fPtProng2Hist[4 *kMaxPtBins]
! hist. for DCA (Prod Cuts)
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
void SetPtWeightsFromFONLL5andBAMPSoverLHC16i2abc()
void FillMCGenAccHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t nTracklets)
TH2F * fDalitz[4 *kMaxPtBins]
! dalitz plot (sig,bkg,tot)
Int_t GetUseCentrality() const
Definition: AliRDHFCuts.h:281
TH1F * fSigVertHist[4 *kMaxPtBins]
! hist. for sigVert (Prod Cuts)
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Double_t DecayLength() const
TH3F * fNDLenxyHist3D
! NDlenxy vs Ds mass vs pt
TH2F * fPtVsMassPhi
! hist. of pt vs. mass (phi selection)
TH1F * fMassHistKK[kMaxPtBins]
! hist. of mass spectra of KK
Double_t CosPiKPhiRFramepiKK() const
Int_t nptbins
TH1F * fMassHistK0st[4 *kMaxPtBins]
! hist. of mass spectra via K0* (sig,bkg,tot)
TH2F * fYVsPt
! hist. of Y vs. Pt (prod. cuts)
Bool_t fFillAcceptanceLevel
flag for usage of sparse for imp. parameter
TString fMultSelectionObjectName
!<!THnSparse for imp. par. on MC
TH2F * fPtVsMassK0st
! hist. of pt vs. mass (K0* selection)
TList * fListCuts
number of Pt bins
void ApplyCutOnResonances(Bool_t opt=kTRUE)
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
UChar_t fNPtBins
-1: no protection, 0: check AOD/dAOD nEvents only, 1: check AOD/dAOD nEvents + TProcessID names ...
Bool_t fWriteOnlySignal
flag for access to MC
TH3F * fCosPiDsHist3D
! cosPiDs vs Ds mass vs pt
Double_t fMassBinSize
range for mass histogram
Double_t fminMass
bin size for inv. mass histo
Int_t GetBackgroundHistoIndex(Int_t iPtBin) const
Float_t fPtLimits[kMaxPtBins+1]