AliPhysics  95775ff (95775ff)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
54 
55 //________________________________________________________________________
58  fOutput(0),
59  fHistNEvents(0),
60  fPtVsMass(0),
61  fPtVsMassPhi(0),
62  fPtVsMassK0st(0),
63  fYVsPt(0),
64  fYVsPtSig(0),
65  fNtupleDs(0),
66  fFillNtuple(0),
67  fReadMC(kFALSE),
68  fWriteOnlySignal(kFALSE),
69  fDoCutVarHistos(kTRUE),
70  fUseSelectionBit(kFALSE),
71  fFillSparse(kTRUE),
72  fFillSparseDplus(kFALSE),
73  fDoRotBkg(kFALSE),
74  fDoBkgPhiSB(kFALSE),
75  fAODProtection(1),
76  fNPtBins(0),
77  fListCuts(0),
78  fMassRange(0.8),
79  fMassBinSize(0.002),
80  fminMass(1.6),
81  fmaxMass(2.5),
82  fMaxDeltaPhiMass4Rot(0.010),
83  fCounter(0),
84  fAnalysisCuts(0),
85  fnSparse(0),
86  fnSparseIP(0),
87  fSystem(0)
88 {
90 
91  for(Int_t i=0;i<3;i++){
92  fHistCentrality[i]=0;
94  }
95  for(Int_t i=0;i<4;i++) {
96  fChanHist[i]=0;
97  }
98  for(Int_t i=0;i<4*kMaxPtBins;i++){
99  fPtCandHist[i]=0;
100  fMassHist[i]=0;
101  fMassHistPhi[i]=0;
102  fMassHistK0st[i]=0;
103  fCosPHist[i]=0;
104  fDLenHist[i]=0;
105  fSumd02Hist[i]=0;
106  fSigVertHist[i]=0;
107  fPtMaxHist[i]=0;
108  fDCAHist[i]=0;
109  fPtProng0Hist[i]=0;
110  fPtProng1Hist[i]=0;
111  fPtProng2Hist[i]=0;
112  fDalitz[i]=0;
113  fDalitzPhi[i]=0;
114  fDalitzK0st[i]=0;
115  }
116  for(Int_t i=0;i<kMaxPtBins;i++){
117  fMassHistKK[i]=0;
118  fMassHistKpi[i]=0;
119  fMassRotBkgHistPhi[i]=0;
120  fMassLSBkgHistPhi[i]=0;
121  fMassRSBkgHistPhi[i]=0;
122  }
123  for(Int_t i=0;i<kMaxPtBins+1;i++){
124  fPtLimits[i]=0;
125  }
126  for (Int_t i=0; i<4; i++) {
127  fnSparseMC[i]=0;
128  fnSparseMCDplus[i]=0;
129  }
130 }
131 
132 //________________________________________________________________________
133 AliAnalysisTaskSEDs::AliAnalysisTaskSEDs(const char *name,AliRDHFCutsDstoKKpi* analysiscuts,Int_t fillNtuple):
134  AliAnalysisTaskSE(name),
135  fOutput(0),
136  fHistNEvents(0),
137  fPtVsMass(0),
138  fPtVsMassPhi(0),
139  fPtVsMassK0st(0),
140  fYVsPt(0),
141  fYVsPtSig(0),
142  fNtupleDs(0),
143  fFillNtuple(fillNtuple),
144  fReadMC(kFALSE),
145  fWriteOnlySignal(kFALSE),
146  fDoCutVarHistos(kTRUE),
147  fUseSelectionBit(kFALSE),
148  fFillSparse(kTRUE),
149  fFillSparseDplus(kFALSE),
150  fDoRotBkg(kTRUE),
151  fDoBkgPhiSB(kTRUE),
152  fAODProtection(1),
153  fNPtBins(0),
154  fListCuts(0),
155  fMassRange(0.8),
156  fMassBinSize(0.002),
157  fminMass(1.6),
158  fmaxMass(2.5),
159  fMaxDeltaPhiMass4Rot(0.010),
160  fCounter(0),
161  fAnalysisCuts(analysiscuts),
162  fnSparse(0),
163  fnSparseIP(0),
164  fSystem(0)
165 {
168 
169  for(Int_t i=0;i<3;i++){
170  fHistCentrality[i]=0;
171  fHistCentralityMult[i]=0;
172  }
173  for(Int_t i=0;i<4;i++) {
174  fChanHist[i]=0;
175  }
176  for(Int_t i=0;i<4*kMaxPtBins;i++){
177  fPtCandHist[i]=0;
178  fMassHist[i]=0;
179  fMassHistPhi[i]=0;
180  fMassHistK0st[i]=0;
181  fCosPHist[i]=0;
182  fDLenHist[i]=0;
183  fSumd02Hist[i]=0;
184  fSigVertHist[i]=0;
185  fPtMaxHist[i]=0;
186  fDCAHist[i]=0;
187  fPtProng0Hist[i]=0;
188  fPtProng1Hist[i]=0;
189  fPtProng2Hist[i]=0;
190  fDalitz[i]=0;
191  fDalitzPhi[i]=0;
192  fDalitzK0st[i]=0;
193  }
194  for(Int_t i=0;i<kMaxPtBins;i++){
195  fMassHistKK[i]=0;
196  fMassHistKpi[i]=0;
197  fMassRotBkgHistPhi[i]=0;
198  fMassLSBkgHistPhi[i]=0;
199  fMassRSBkgHistPhi[i]=0;
200  }
201  for(Int_t i=0;i<kMaxPtBins+1;i++){
202  fPtLimits[i]=0;
203  }
204 
205  for (Int_t i=0; i<4; i++) {
206  fnSparseMC[i]=0;
207  fnSparseMCDplus[i]=0;
208  }
209 
212  SetPtBins(nptbins,ptlim);
213 
214  DefineOutput(1,TList::Class()); //My private output
215 
216  DefineOutput(2,TList::Class());
217 
218  DefineOutput(3,AliNormalizationCounter::Class());
219 
220  if(fFillNtuple>0){
221  // Output slot #4 writes into a TNtuple container
222  DefineOutput(4,TNtuple::Class()); //My private output
223  }
224 
225 }
226 
227 //________________________________________________________________________
230  if(n>kMaxPtBins){
231  printf("Max. number of Pt bins = %d\n",kMaxPtBins);
233  fPtLimits[0]=0.;
234  fPtLimits[1]=1.;
235  fPtLimits[2]=3.;
236  fPtLimits[3]=5.;
237  fPtLimits[4]=10.;
238  for(Int_t i=5; i<kMaxPtBins+1; i++) fPtLimits[i]=99999999.;
239  }else{
240  fNPtBins=n;
241  for(Int_t i=0; i<fNPtBins+1; i++) fPtLimits[i]=lim[i];
242  for(Int_t i=fNPtBins+1; i<kMaxPtBins+1; i++) fPtLimits[i]=99999999.;
243  }
244  if(fDebug > 1){
245  printf("Number of Pt bins = %d\n",fNPtBins);
246  for(Int_t i=0; i<fNPtBins; i++) printf(" Bin%d = %8.2f-%8.2f\n",i,fPtLimits[i],fPtLimits[i+1]);
247  }
248 }
249 //________________________________________________________________________
251 {
252  // Destructor
253  if(fOutput && !fOutput->IsOwner()){
254  delete fHistNEvents;
255  for(Int_t i=0;i<4;i++){
256  delete fChanHist[i];
257  }
258  for(Int_t i=0;i<4*fNPtBins;i++){
259  delete fMassHist[i];
260  delete fMassHistPhi[i];
261  delete fMassHistK0st[i];
262  delete fCosPHist[i];
263  delete fDLenHist[i];
264  delete fSumd02Hist[i];
265  delete fSigVertHist[i];
266  delete fPtMaxHist[i];
267  delete fPtCandHist[i];
268  delete fDCAHist[i];
269  delete fPtProng0Hist[i];
270  delete fPtProng1Hist[i];
271  delete fPtProng2Hist[i];
272  delete fDalitz[i];
273  delete fDalitzPhi[i];
274  delete fDalitzK0st[i];
275  }
276  for(Int_t i=0;i<fNPtBins;i++){
277  delete fMassHistKK[i];
278  delete fMassHistKpi[i];
279  delete fMassRotBkgHistPhi[i];
280  delete fMassLSBkgHistPhi[i];
281  delete fMassRSBkgHistPhi[i];
282  }
283  delete fPtVsMass;
284  delete fPtVsMassPhi;
285  delete fPtVsMassK0st;
286  delete fYVsPt;
287  delete fYVsPtSig;
288  for(Int_t i=0;i<3;i++){
289  delete fHistCentrality[i];
290  delete fHistCentralityMult[i];
291  }
292 
293  delete fnSparse;
294  delete fnSparseIP;
295  for (Int_t i=0; i<4; i++) {
296  delete fnSparseMC[i];
297  if(fFillSparseDplus)delete fnSparseMCDplus[i];
298  }
299  }
300  delete fOutput;
301  delete fListCuts;
302  delete fNtupleDs;
303  delete fCounter;
304  delete fAnalysisCuts;
305 
306 }
307 
308 //________________________________________________________________________
310 {
312 
313  if(fDebug > 1) printf("AnalysisTaskSEDs::Init() \n");
314 
315  fListCuts=new TList();
316  fListCuts->SetOwner();
317  fListCuts->SetName("CutObjects");
318 
320  analysis->SetName("AnalysisCuts");
321 
322  fListCuts->Add(analysis);
323  PostData(2,fListCuts);
324  return;
325 }
326 
327 //________________________________________________________________________
329 {
331  //
332  if(fDebug > 1) printf("AnalysisTaskSEDs::UserCreateOutputObjects() \n");
333 
334  // Several histograms are more conveniently managed in a TList
335  fOutput = new TList();
336  fOutput->SetOwner();
337  fOutput->SetName("OutputHistos");
338 
339  fHistNEvents = new TH1F("hNEvents", "number of events ",15,-0.5,14.5);
340  fHistNEvents->GetXaxis()->SetBinLabel(1,"nEventsRead");
341  fHistNEvents->GetXaxis()->SetBinLabel(2,"nEvents Matched dAOD");
342  fHistNEvents->GetXaxis()->SetBinLabel(3,"nEvents Mismatched dAOD");
343  fHistNEvents->GetXaxis()->SetBinLabel(4,"nEventsAnal");
344  fHistNEvents->GetXaxis()->SetBinLabel(5,"n. passing IsEvSelected");
345  fHistNEvents->GetXaxis()->SetBinLabel(6,"n. rejected due to trigger");
346  fHistNEvents->GetXaxis()->SetBinLabel(7,"n. rejected due to not reco vertex");
347  fHistNEvents->GetXaxis()->SetBinLabel(8,"n. rejected for contr vertex");
348  fHistNEvents->GetXaxis()->SetBinLabel(9,"n. rejected for vertex out of accept");
349  fHistNEvents->GetXaxis()->SetBinLabel(10,"n. rejected for pileup events");
350  fHistNEvents->GetXaxis()->SetBinLabel(11,"no. of out centrality events");
351  fHistNEvents->GetXaxis()->SetBinLabel(12,"no. of 3 prong candidates");
352  fHistNEvents->GetXaxis()->SetBinLabel(13,"no. of Ds after filtering cuts");
353  fHistNEvents->GetXaxis()->SetBinLabel(14,"no. of Ds after selection cuts");
354  fHistNEvents->GetXaxis()->SetBinLabel(15,"no. of not on-the-fly rec Ds");
355 
356  fHistNEvents->GetXaxis()->SetNdivisions(1,kFALSE);
357 
358  fHistNEvents->Sumw2();
359  fHistNEvents->SetMinimum(0);
360  fOutput->Add(fHistNEvents);
361 
362  fHistCentrality[0]=new TH1F("hCentr","centrality",10000,0.,100.);
363  fHistCentrality[1]=new TH1F("hCentr(selectedCent)","centrality(selectedCent)",10000,0.,100.);
364  fHistCentrality[2]=new TH1F("hCentr(OutofCent)","centrality(OutofCent)",10000,0.,100.);
365  fHistCentralityMult[0]=new TH2F("hCentrMult","centrality vs mult",100,0.5,30000.5,40,0.,100.);
366  fHistCentralityMult[1]=new TH2F("hCentrMult(selectedCent)","centrality vs mult(selectedCent)",100,0.5,30000.5,40,0.,100.);
367  fHistCentralityMult[2]=new TH2F("hCentrMult(OutofCent)","centrality vs mult(OutofCent)",100,0.5,30000.5,40,0.,100.);
368  for(Int_t i=0;i<3;i++){
369  fHistCentrality[i]->Sumw2();
370  fOutput->Add(fHistCentrality[i]);
371  fHistCentralityMult[i]->Sumw2();
372  fOutput->Add(fHistCentralityMult[i]);
373  }
374 
375  Double_t massDs=TDatabasePDG::Instance()->GetParticle(431)->Mass();
376 
377  Int_t nInvMassBins=(Int_t)(fMassRange/fMassBinSize+0.5);
378  if(nInvMassBins%2==1) nInvMassBins++;
379  // Double_t minMass=massDs-1.0*nInvMassBins*fMassBinSize;
380  Double_t minMass=massDs-0.5*nInvMassBins*fMassBinSize;
381  // Double_t maxMass=massDs+1.0*nInvMassBins*fMassBinSize;
382  Double_t maxMass=massDs+0.5*nInvMassBins*fMassBinSize;
383  fminMass = minMass;
384  fmaxMass = maxMass;
385 
386  TString hisname;
387  TString htype;
388  Int_t index;
389  for(Int_t iType=0; iType<4; iType++){
390  for(Int_t i=0;i<fNPtBins;i++){
391  if(iType==0){
392  htype="All";
393  index=GetHistoIndex(i);
394  }else if(iType==1){
395  htype="Sig";
396  index=GetSignalHistoIndex(i);
397  }else if(iType==2){
398  htype="Bkg";
399  index=GetBackgroundHistoIndex(i);
400  }else{
401  htype="ReflSig";
402  index=GetReflSignalHistoIndex(i);
403  }
404  hisname.Form("hMass%sPt%d",htype.Data(),i);
405  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),nInvMassBins,minMass,maxMass);
406  fMassHist[index]->Sumw2();
407  hisname.Form("hMass%sPt%dphi",htype.Data(),i);
408  fMassHistPhi[index]=new TH1F(hisname.Data(),hisname.Data(),nInvMassBins,minMass,maxMass);
409  fMassHistPhi[index]->Sumw2();
410  hisname.Form("hMass%sPt%dk0st",htype.Data(),i);
411  fMassHistK0st[index]=new TH1F(hisname.Data(),hisname.Data(),nInvMassBins,minMass,maxMass);
412  fMassHistK0st[index]->Sumw2();
413  hisname.Form("hCosP%sPt%d",htype.Data(),i);
414  fCosPHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
415  fCosPHist[index]->Sumw2();
416  hisname.Form("hDLen%sPt%d",htype.Data(),i);
417  fDLenHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
418  fDLenHist[index]->Sumw2();
419  hisname.Form("hSumd02%sPt%d",htype.Data(),i);
420  fSumd02Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
421  fSumd02Hist[index]->Sumw2();
422  hisname.Form("hSigVert%sPt%d",htype.Data(),i);
423  fSigVertHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
424  fSigVertHist[index]->Sumw2();
425  hisname.Form("hPtMax%sPt%d",htype.Data(),i);
426  fPtMaxHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,20.);
427  fPtMaxHist[index]->Sumw2();
428  hisname.Form("hPtCand%sPt%d",htype.Data(),i);
429  fPtCandHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,20.);
430  fPtCandHist[index]->Sumw2();
431  hisname.Form("hDCA%sPt%d",htype.Data(),i);
432  fDCAHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
433  fDCAHist[index]->Sumw2();
434  hisname.Form("hPtProng0%sPt%d",htype.Data(),i);
435  fPtProng0Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.0,20.);
436  fPtProng0Hist[index]->Sumw2();
437  hisname.Form("hPtProng1%sPt%d",htype.Data(),i);
438  fPtProng1Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.0,20.);
439  fPtProng1Hist[index]->Sumw2();
440  hisname.Form("hPtProng2%sPt%d",htype.Data(),i);
441  fPtProng2Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.0,20.);
442  fPtProng2Hist[index]->Sumw2();
443  hisname.Form("hDalitz%sPt%d",htype.Data(),i);
444  fDalitz[index]=new TH2F(hisname.Data(),hisname.Data(),100,0.,2.,100,0.,2.);
445  fDalitz[index]->Sumw2();
446  hisname.Form("hDalitz%sPt%dphi",htype.Data(),i);
447  fDalitzPhi[index]=new TH2F(hisname.Data(),hisname.Data(),100,0.,2.,100,0.,2.);
448  fDalitzPhi[index]->Sumw2();
449  hisname.Form("hDalitz%sPt%dk0st",htype.Data(),i);
450  fDalitzK0st[index]=new TH2F(hisname.Data(),hisname.Data(),100,0.,2.,100,0.,2.);
451  fDalitzK0st[index]->Sumw2();
452  }
453  }
454 
455  for(Int_t i=0; i<4*fNPtBins; i++){
456  fOutput->Add(fMassHist[i]);
457  fOutput->Add(fMassHistPhi[i]);
458  fOutput->Add(fMassHistK0st[i]);
459  fOutput->Add(fPtCandHist[i]);
460  if(fDoCutVarHistos){
461  fOutput->Add(fCosPHist[i]);
462  fOutput->Add(fDLenHist[i]);
463  fOutput->Add(fSumd02Hist[i]);
464  fOutput->Add(fSigVertHist[i]);
465  fOutput->Add(fPtMaxHist[i]);
466  fOutput->Add(fDCAHist[i]);
467  fOutput->Add(fPtProng0Hist[i]);
468  fOutput->Add(fPtProng1Hist[i]);
469  fOutput->Add(fPtProng2Hist[i]);
470  fOutput->Add(fDalitz[i]);
471  fOutput->Add(fDalitzPhi[i]);
472  fOutput->Add(fDalitzK0st[i]);
473  }
474  }
475 
476  fChanHist[0] = new TH1F("hChanAll", "KKpi and piKK candidates",64,-0.5,63.5);
477  fChanHist[1] = new TH1F("hChanSig", "KKpi and piKK candidates",64,-0.5,63.5);
478  fChanHist[2] = new TH1F("hChanBkg", "KKpi and piKK candidates",64,-0.5,63.5);
479  fChanHist[3] = new TH1F("hChanReflSig", "KKpi and piKK candidates",64,-0.5,63.5);
480  for(Int_t i=0;i<4;i++){
481  fChanHist[i]->Sumw2();
482  fChanHist[i]->SetMinimum(0);
483  fOutput->Add(fChanHist[i]);
484  }
485 
486 
487  fPtVsMass=new TH2F("hPtVsMass","PtVsMass (prod. cuts)",nInvMassBins,minMass,maxMass,40,0.,20.);
488  fPtVsMassPhi=new TH2F("hPtVsMassPhi","PtVsMass (phi selection)",nInvMassBins,minMass,maxMass,200,0.,20.);
489  fPtVsMassK0st=new TH2F("hPtVsMassK0st","PtVsMass (K0* selection)",nInvMassBins,minMass,maxMass,200,0.,20.);
490  fYVsPt=new TH2F("hYVsPt","YvsPt (prod. cuts)",40,0.,20.,80,-2.,2.);
491  fYVsPtSig=new TH2F("hYVsPtSig","YvsPt (MC, only sig., prod. cuts)",40,0.,20.,80,-2.,2.);
492 
493  for(Int_t i=0;i<fNPtBins;i++){
494  hisname.Form("hMassKKPt%d",i);
495  fMassHistKK[i]=new TH1F(hisname.Data(),hisname.Data(),200,0.95,1.35);
496  fMassHistKK[i]->Sumw2();
497  fOutput->Add(fMassHistKK[i]);
498  hisname.Form("hMassKpiPt%d",i);
499  fMassHistKpi[i]=new TH1F(hisname.Data(),hisname.Data(),200,0.7,1.1);
500  fMassHistKpi[i]->Sumw2();
501  fOutput->Add(fMassHistKpi[i]);
502  if(fDoRotBkg) {
503  hisname.Form("hMassAllPt%dphi_RotBkg",i);
504  fMassRotBkgHistPhi[i]=new TH1F(hisname.Data(),hisname.Data(),nInvMassBins,minMass,maxMass);
505  fMassRotBkgHistPhi[i]->Sumw2();
506  fOutput->Add(fMassRotBkgHistPhi[i]);
507  }
508  if(fDoBkgPhiSB) {
509  hisname.Form("fMassLSBkgHistPhiPt%d",i);
510  fMassLSBkgHistPhi[i]=new TH1F(hisname.Data(),hisname.Data(),nInvMassBins,minMass,maxMass);
511  fMassLSBkgHistPhi[i]->Sumw2();
512  fOutput->Add(fMassLSBkgHistPhi[i]);
513  hisname.Form("fMassRSBkgHistPhiPt%d",i);
514  fMassRSBkgHistPhi[i]=new TH1F(hisname.Data(),hisname.Data(),nInvMassBins,minMass,maxMass);
515  fMassRSBkgHistPhi[i]->Sumw2();
516  fOutput->Add(fMassRSBkgHistPhi[i]);
517  }
518  }
519 
520  fOutput->Add(fPtVsMass);
521  fOutput->Add(fPtVsMassPhi);
522  fOutput->Add(fPtVsMassK0st);
523  fOutput->Add(fYVsPt);
524  fOutput->Add(fYVsPtSig);
525 
526  Int_t nBinsReco[knVarForSparse] = {350, 20, 30, 14, 14, 20, 10, 10, 14, 6, 6, 12};
527  Double_t xminReco[knVarForSparse] = {1.6, 0., 0.00, 0.0, 0.0, 0., 0.9, 0.9, 0.00, 0.7, 0.0, 0.};
528  Double_t xmaxReco[knVarForSparse] = {2.3, 20., 0.015, 0.07, 0.07, 10., 1.0, 1.0, 0.07, 1.0, 0.3, 6.};
529  TString axis[knVarForSparse] = {"invMassDsAllPhi","p_{T}","#Delta Mass(KK)","dlen","dlen_{xy}","normdl_{xy}","cosP","cosP_{xy}","sigVert","cosPiDs","|cosPiKPhi^{3}|","normIP"};
530  if(fSystem == 1) { //pPb,PbPb
531  nBinsReco[0] = 200; //Ds mass
532  xminReco[0] = 1.75;
533  xmaxReco[0] = 2.15;
534 
535  nBinsReco[1] = 16; //pt
536  xminReco[1] = 0.;
537  xmaxReco[1] = 16.;
538 
539  nBinsReco[2] = 12; //#Delta Mass(KK)
540  xmaxReco[2] = 0.012;
541 
542  nBinsReco[3] = 7; //dlen
543  nBinsReco[4] = 7; //dlenxy
544  nBinsReco[5] = 10; //ndlenxy
545 
546  nBinsReco[6] = 6; //cosP
547  xminReco[6] = 0.97;
548  xmaxReco[6] = 1.0;
549 
550  nBinsReco[7] = 6; //cosPxy
551  xminReco[7] = 0.97;
552  xmaxReco[7] = 1.0;
553  }
554 
555  Int_t nBinsAcc[knVarForSparseAcc] = {20, 20};
556  Double_t xminAcc[knVarForSparseAcc] = {0., -1.};
557  Double_t xmaxAcc[knVarForSparseAcc] = {20, 1.};
558 
559  Int_t nBinsIP[knVarForSparseIP] = { 20, 400, 400, 400, 400, 3};
560  Double_t xminIP[knVarForSparseIP] = { 0., -10., -10., -10., -10., 0.};
561  Double_t xmaxIP[knVarForSparseIP] = {20., 10., 10., 10., 10., 3.};
562  TString axisIP[knVarForSparseIP] = {"motherPt","maxNormImp","IP0","IP1","IP2","candType"};
563 
564  if(fFillSparse) {
565 
566  if(fReadMC) {
567  TString label[knVarForSparseAcc] = {"fromC","fromB"};
568  for (Int_t i=0; i<2; i++) {
569  fnSparseMC[i] = new THnSparseF(Form("fnSparseAcc_%s",label[i].Data()),Form("MC nSparse (Acc.Step)- %s",label[i].Data()),
570  knVarForSparseAcc, nBinsAcc, xminAcc, xmaxAcc);
571  fnSparseMC[i]->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
572  fnSparseMC[i]->GetAxis(1)->SetTitle("y");
573  fOutput->Add(fnSparseMC[i]);
574 
575  //Dplus
576  if(fFillSparseDplus) {
577  fnSparseMCDplus[i] = new THnSparseF(Form("fnSparseAccDplus_%s",label[i].Data()),Form("MC nSparse D^{+} (Acc.Step)- %s",label[i].Data()),
578  knVarForSparseAcc, nBinsAcc, xminAcc, xmaxAcc);
579  fnSparseMCDplus[i]->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
580  fnSparseMCDplus[i]->GetAxis(1)->SetTitle("y");
581  fOutput->Add(fnSparseMCDplus[i]);
582  }
583  }
584  for (Int_t i=2; i<4; i++) {
585  fnSparseMC[i] = new THnSparseF(Form("fnSparseReco_%s",label[i-2].Data()),Form("MC nSparse (Reco Step)- %s",label[i-2].Data()),
586  knVarForSparse, nBinsReco, xminReco, xmaxReco);
587  for (Int_t j=0; j<knVarForSparse; j++) {
588  fnSparseMC[i]->GetAxis(j)->SetTitle(Form("%s",axis[j].Data()));
589  }
590  fOutput->Add(fnSparseMC[i]);
591 
592  //Dplus
593  if(fFillSparseDplus) {
594  fnSparseMCDplus[i] = new THnSparseF(Form("fnSparseRecoDplus_%s",label[i-2].Data()),Form("MC nSparse D^{+} (Reco Step)- %s",label[i-2].Data()),
595  knVarForSparse, nBinsReco, xminReco, xmaxReco);
596  for (Int_t j=0; j<knVarForSparse; j++) {
597  fnSparseMCDplus[i]->GetAxis(j)->SetTitle(Form("%s",axis[j].Data()));
598  }
599  fOutput->Add(fnSparseMCDplus[i]);
600  }
601  }
602 
603  fnSparseIP = new THnSparseF("fnSparseIP","nSparseIP", knVarForSparseIP, nBinsIP, xminIP, xmaxIP);
604  for (Int_t j=0; j<knVarForSparseIP; j++) {
605  fnSparseIP->GetAxis(j)->SetTitle(Form("%s",axisIP[j].Data()));
606  }
607  fnSparseIP->GetAxis(5)->SetTitle("candType (0.5=bkg; 1.5=prompt; 2.5=FD)");
608  fOutput->Add(fnSparseIP);
609  }
610  else {
611  fnSparse = new THnSparseF("fnSparse","nSparse", knVarForSparse, nBinsReco, xminReco, xmaxReco);
612  for (Int_t j=0; j<knVarForSparse; j++) {
613  fnSparse->GetAxis(j)->SetTitle(Form("%s",axis[j].Data()));
614  }
615  fOutput->Add(fnSparse);
616  }
617  }
618 
619  //Counter for Normalization
620  fCounter = new AliNormalizationCounter("NormalizationCounter");
621  fCounter->Init();
622 
623  PostData(1,fOutput);
624  PostData(3,fCounter);
625 
626  if(fFillNtuple>0){
627  OpenFile(4); // 4 is the slot number of the ntuple
628 
629  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");
630 
631  }
632 
633 
634  return;
635 }
636 
637 //________________________________________________________________________
639 {
642 
643  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
644 
645  fHistNEvents->Fill(0); // all events
646  if(fAODProtection>=0){
647  // Protection against different number of events in the AOD and deltaAOD
648  // In case of discrepancy the event is rejected.
649  Int_t matchingAODdeltaAODlevel = AliRDHFCuts::CheckMatchingAODdeltaAODevents();
650  if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 && fAODProtection==1)) {
651  // AOD/deltaAOD trees have different number of entries || TProcessID do not match while it was required
652  fHistNEvents->Fill(2);
653  return;
654  }
655  fHistNEvents->Fill(1);
656  }
657 
658  TClonesArray *array3Prong = 0;
659  if(!aod && AODEvent() && IsStandardAOD()) {
660  // In case there is an AOD handler writing a standard AOD, use the AOD
661  // event in memory rather than the input (ESD) event.
662  aod = dynamic_cast<AliAODEvent*> (AODEvent());
663  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
664  // have to taken from the AOD event hold by the AliAODExtension
665  AliAODHandler* aodHandler = (AliAODHandler*)
666  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
667  if(aodHandler->GetExtensions()) {
668  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
669  AliAODEvent *aodFromExt = ext->GetAOD();
670  array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
671  }
672  } else if(aod) {
673  array3Prong=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
674  }
675 
676  if(!aod || !array3Prong) {
677  printf("AliAnalysisTaskSEDs::UserExec: Charm3Prong branch not found!\n");
678  return;
679  }
680 
681 
682  // fix for temporary bug in ESDfilter
683  // the AODs with null vertex pointer didn't pass the PhysSel
684  if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) return;
685 
686 
687  fHistNEvents->Fill(3); // count event
688  // Post the data already here
689  PostData(1,fOutput);
690 
692 
693 
694  Bool_t isEvSel=fAnalysisCuts->IsEventSelected(aod);
695  Float_t ntracks=aod->GetNumberOfTracks();
696  Float_t evCentr=fAnalysisCuts->GetCentrality(aod);
697 
698  fHistCentrality[0]->Fill(evCentr);
699  fHistCentralityMult[0]->Fill(ntracks,evCentr);
706  fHistNEvents->Fill(10);
707  fHistCentrality[2]->Fill(evCentr);
708  fHistCentralityMult[2]->Fill(ntracks,evCentr);
709  }
710 
712  Int_t runNumber=aod->GetRunNumber();
713 
714 
715 
716  TClonesArray *arrayMC=0;
717  AliAODMCHeader *mcHeader=0;
718 
719  // AOD primary vertex
720  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
721  // vtx1->Print();
722 
723  // load MC particles
724  if(fReadMC){
725 
726  arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
727  if(!arrayMC) {
728  printf("AliAnalysisTaskSEDs::UserExec: MC particles branch not found!\n");
729  return;
730  }
731 
732  // load MC header
733  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
734  if(!mcHeader) {
735  printf("AliAnalysisTaskSEDs::UserExec: MC header branch not found!\n");
736  return;
737  }
738  }
739 
740 
741  if(fReadMC && fFillSparse){
742  if(aod->GetTriggerMask()==0 && (runNumber>=195344 && runNumber<=195677))
743  // protection for events with empty trigger mask in p-Pb
744  return;
746  // events not passing the centrality selection can be removed immediately.
747  return;
748  Double_t zMCVertex = mcHeader->GetVtxZ();
749  if (TMath::Abs(zMCVertex) > fAnalysisCuts->GetMaxVtxZ())
750  return;
751  FillMCGenAccHistos(arrayMC, mcHeader);
752  }
753 
754  if(!isEvSel)return;
755  fHistNEvents->Fill(4);
756  fHistCentrality[1]->Fill(evCentr);
757  fHistCentralityMult[1]->Fill(ntracks,evCentr);
758 
759  Int_t n3Prong = array3Prong->GetEntriesFast();
760  if(fDebug>1) printf("Number of Ds->KKpi: %d\n",n3Prong);
761 
762 
763  Int_t pdgDstoKKpi[3]={321,321,211};
764  Int_t nSelected=0;
765  Int_t nFiltered=0;
766  Double_t massPhi=TDatabasePDG::Instance()->GetParticle(333)->Mass();
767 
768  // vHF object is needed to call the method that refills the missing info of the candidates
769  // if they have been deleted in dAOD reconstruction phase
770  // in order to reduce the size of the file
772 
773  for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
774 
775 
776  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)array3Prong->UncheckedAt(i3Prong);
777  fHistNEvents->Fill(11);
778 
780  continue;
781  }
782  nFiltered++;
783  fHistNEvents->Fill(12);
784 
785  if(!(vHF->FillRecoCand(aod,d))) {
786  fHistNEvents->Fill(14); //monitor how often this fails
787  continue;
788  }
789 
790  Bool_t unsetvtx=kFALSE;
791  if(!d->GetOwnPrimaryVtx()){
792  d->SetOwnPrimaryVtx(vtx1);
793  unsetvtx=kTRUE;
794  // NOTE: the ow primary vertex should be unset, otherwise there is a memory leak
795  // Pay attention if you use continue inside this loop!!!
796  }
797 
798  Bool_t recVtx=kFALSE;
799  AliAODVertex *origownvtx=0x0;
800 
801  Double_t ptCand = d->Pt();
802  Int_t iPtBin=TMath::BinarySearch(fNPtBins,fPtLimits,(Float_t)ptCand);
803  Double_t rapid=d->YDs();
804  fYVsPt->Fill(ptCand,rapid);
805  Bool_t isFidAcc=fAnalysisCuts->IsInFiducialAcceptance(ptCand,rapid);
806 
807  if(isFidAcc){
808 
809  Int_t retCodeAnalysisCuts=fAnalysisCuts->IsSelected(d,AliRDHFCuts::kAll,aod);
810  Int_t retCodeNoRes=retCodeAnalysisCuts;
812  if(origRes){
814  retCodeNoRes=fAnalysisCuts->IsSelected(d,AliRDHFCuts::kAll,aod);
816  }
817  Double_t massKK = 0.;
818 
819  if(retCodeNoRes&1){ //KKpi
820  massKK=d->InvMass2Prongs(0,1,321,321);
821  Double_t massKp=d->InvMass2Prongs(1,2,321,211);
822  fMassHistKK[iPtBin]->Fill(massKK);
823  fMassHistKpi[iPtBin]->Fill(massKp);
824  }
825  if(retCodeNoRes&2){ //piKK
826  massKK=d->InvMass2Prongs(1,2,321,321);
827  Double_t massKp=d->InvMass2Prongs(0,1,211,321);
828  fMassHistKK[iPtBin]->Fill(massKK);
829  fMassHistKpi[iPtBin]->Fill(massKp);
830  }
831 
832  Int_t isKKpi=retCodeAnalysisCuts&1;
833  Int_t ispiKK=retCodeAnalysisCuts&2;
834  Int_t isPhiKKpi=retCodeAnalysisCuts&4;
835  Int_t isPhipiKK=retCodeAnalysisCuts&8;
836  Int_t isK0starKKpi=retCodeAnalysisCuts&16;
837  Int_t isK0starpiKK=retCodeAnalysisCuts&32;
838 
839  if(retCodeAnalysisCuts>0){
841  if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
842  if(fAnalysisCuts->RecalcOwnPrimaryVtx(d,aod))recVtx=kTRUE;
843  else fAnalysisCuts->CleanOwnPrimaryVtx(d,aod,origownvtx);
844  }
845 
846 
847  fHistNEvents->Fill(13);
848  nSelected++;
849 
850  Int_t index=GetHistoIndex(iPtBin);
851  fPtCandHist[index]->Fill(ptCand);
852 
853 
854  Double_t weightKKpi=1.;
855  Double_t weightpiKK=1.;
857  weightKKpi=fAnalysisCuts->GetWeightForKKpi();
858  weightpiKK=fAnalysisCuts->GetWeightForpiKK();
859  if(weightKKpi>1. || weightKKpi<0.) weightKKpi=0.;
860  if(weightpiKK>1. || weightpiKK<0.) weightpiKK=0.;
861  }
862 
863  fChanHist[0]->Fill(retCodeAnalysisCuts);
864 
865 
866  Double_t invMass = 0.;
867  Int_t indexMCKKpi=-1;
868  Int_t indexMCpiKK=-1;
869  Int_t labDs=-1;
870  Int_t labDplus=-1;
871  Int_t pdgCode0=-999;
872  Int_t isMCSignal=-1;
873 
874 
875  if(fReadMC){
876 
877  labDs = d->MatchToMC(431,arrayMC,3,pdgDstoKKpi);
878  labDplus = d->MatchToMC(411,arrayMC,3,pdgDstoKKpi);
879  if(labDs>=0){
880  Int_t labDau0=((AliAODTrack*)d->GetDaughter(0))->GetLabel();
881  AliAODMCParticle* p=(AliAODMCParticle*)arrayMC->UncheckedAt(TMath::Abs(labDau0));
882  pdgCode0=TMath::Abs(p->GetPdgCode());
883 
884  if(isKKpi){
885  if(pdgCode0==321) {
886  indexMCKKpi=GetSignalHistoIndex(iPtBin);
887  fYVsPtSig->Fill(ptCand,rapid);
888  fChanHist[1]->Fill(retCodeAnalysisCuts);
889  isMCSignal=1;
890  }else{
891  indexMCKKpi=GetReflSignalHistoIndex(iPtBin);
892  fChanHist[3]->Fill(retCodeAnalysisCuts);
893  isMCSignal=0;
894  }
895  }
896  if(ispiKK){
897  if(pdgCode0==211) {
898  indexMCpiKK=GetSignalHistoIndex(iPtBin);
899  fYVsPtSig->Fill(ptCand,rapid);
900  fChanHist[1]->Fill(retCodeAnalysisCuts);
901  isMCSignal=1;
902  }else{
903  indexMCpiKK=GetReflSignalHistoIndex(iPtBin);
904  fChanHist[3]->Fill(retCodeAnalysisCuts);
905  isMCSignal=0;
906  }
907  }
908  }else{
909  indexMCpiKK=GetBackgroundHistoIndex(iPtBin);
910  indexMCKKpi=GetBackgroundHistoIndex(iPtBin);
911  fChanHist[2]->Fill(retCodeAnalysisCuts);
912  }
913  }
914 
915  Double_t candType = 0.5; //for bkg
916  Double_t massPhi=TDatabasePDG::Instance()->GetParticle(333)->Mass();
917 
918  if(isKKpi){
919  if(fDoRotBkg && TMath::Abs(massKK-massPhi)<=fMaxDeltaPhiMass4Rot)GenerateRotBkg(d,1,iPtBin);
920  if(fDoBkgPhiSB && 0.010<TMath::Abs(massKK-massPhi)<0.030)GenerateBkgFromPhiSB(d,1,iPtBin,massKK);
921 
922  invMass=d->InvMassDsKKpi();
923  fMassHist[index]->Fill(invMass,weightKKpi);
924  fPtVsMass->Fill(invMass,ptCand,weightKKpi);
925  if(isPhiKKpi){
926  fMassHistPhi[index]->Fill(invMass,weightKKpi);
927  fPtVsMassPhi->Fill(invMass,ptCand,weightKKpi);
928  }
929  if(isK0starKKpi){
930  fMassHistK0st[index]->Fill(invMass,weightKKpi);
931  fPtVsMassK0st->Fill(invMass,ptCand,weightKKpi);
932  }
933  if(fReadMC && indexMCKKpi!=-1){
934  fMassHist[indexMCKKpi]->Fill(invMass,weightKKpi);
935  if(isPhiKKpi) {
936  fMassHistPhi[indexMCKKpi]->Fill(invMass,weightKKpi);
937  if(fFillSparse) {
938  if(indexMCKKpi==GetSignalHistoIndex(iPtBin) || labDplus >= 0) {
939  AliAODMCParticle *partDs = (AliAODMCParticle*)arrayMC->At(labDs);
940  Int_t orig = AliVertexingHFUtils::CheckOrigin(arrayMC,partDs,kTRUE);
941  if(orig==4) {
942  candType = 1.5;
943  }
944  if(orig==5) {
945  candType = 2.5;
946  }
947  }
948  }
949  }
950  if(isK0starKKpi) fMassHistK0st[indexMCKKpi]->Fill(invMass,weightKKpi);
951  }
952  }
953  if(ispiKK){
954  if(fDoRotBkg && TMath::Abs(massKK-massPhi)<=fMaxDeltaPhiMass4Rot)GenerateRotBkg(d,2,iPtBin);
955  if(fDoBkgPhiSB && 0.010<TMath::Abs(massKK-massPhi)<0.030)GenerateBkgFromPhiSB(d,2,iPtBin,massKK);
956 
957  invMass=d->InvMassDspiKK();
958  fMassHist[index]->Fill(invMass,weightpiKK);
959  fPtVsMass->Fill(invMass,ptCand,weightpiKK);
960  if(isPhipiKK){
961  fMassHistPhi[index]->Fill(invMass,weightpiKK);
962  fPtVsMassPhi->Fill(invMass,ptCand,weightpiKK);
963  }
964  if(isK0starpiKK){
965  fMassHistK0st[index]->Fill(invMass,weightpiKK);
966  fPtVsMassK0st->Fill(invMass,ptCand,weightpiKK);
967  }
968  if(fReadMC && indexMCpiKK!=-1){
969  fMassHist[indexMCpiKK]->Fill(invMass,weightpiKK);
970  if(isPhipiKK) {
971  fMassHistPhi[indexMCpiKK]->Fill(invMass,weightpiKK);
972  if(fFillSparse) {
973  if(indexMCpiKK==GetSignalHistoIndex(iPtBin) || labDplus >= 0) {
974  AliAODMCParticle *partDs = (AliAODMCParticle*)arrayMC->At(labDs);
975  Int_t orig = AliVertexingHFUtils::CheckOrigin(arrayMC,partDs,kTRUE);
976  if(orig==4) {
977  candType = 1.5;
978  }
979  if(orig==5) {
980  candType = 2.5;
981  }
982  }
983  }
984  }
985  if(isK0starpiKK) fMassHistK0st[indexMCpiKK]->Fill(invMass,weightpiKK);
986  }
987  }
988 
989 
991 
992  if(fFillSparse) {
993 
994  const Int_t nProng = 3;
995  Double_t deltaMassKK=999.;
996  Double_t dlen=d->DecayLength();
997  Double_t dlenxy=d->DecayLengthXY();
998  Double_t normdl=d->NormalizedDecayLength();
999  Double_t normdlxy=d->NormalizedDecayLengthXY();
1000  Double_t cosp=d->CosPointingAngle();
1001  Double_t cospxy=d->CosPointingAngleXY();
1002  Double_t pt0=d->PtProng(0);
1003  Double_t pt1=d->PtProng(1);
1004  Double_t pt2=d->PtProng(2);
1005  Double_t sigvert=d->GetSigmaVert();
1006  Double_t cosPiDs=-99.;
1007  Double_t cosPiKPhi=-99.;
1008  Double_t normIP; //to store the maximum topomatic var. among the 3 prongs
1009  Double_t normIPprong[nProng]; //to store IP of k,k,pi
1010  if(isPhiKKpi) {
1011  Double_t tmpNormIP[nProng];
1012 
1013  invMass = d->InvMassDsKKpi();
1014  massKK = d->InvMass2Prongs(0,1,321,321);
1015  deltaMassKK = TMath::Abs(massKK-massPhi);
1016  cosPiDs = d->CosPiDsLabFrameKKpi();
1017  cosPiKPhi = d->CosPiKPhiRFrameKKpi();
1018  cosPiKPhi = TMath::Abs(cosPiKPhi*cosPiKPhi*cosPiKPhi);
1019 
1020  for(Int_t ip=0; ip<nProng; ip++) {
1021  Double_t diffIP, errdiffIP;
1022  d->Getd0MeasMinusExpProng(ip,aod->GetMagneticField(),diffIP,errdiffIP);
1023  tmpNormIP[ip] = diffIP/errdiffIP;
1024  if(ip==0) normIP = tmpNormIP[ip];
1025  else if(TMath::Abs(tmpNormIP[ip])>TMath::Abs(normIP)) normIP = tmpNormIP[ip];
1026  }
1027  normIPprong[0] = tmpNormIP[0];
1028  normIPprong[1] = tmpNormIP[1];
1029  normIPprong[2] = tmpNormIP[2];
1030 
1031  Double_t var4nSparse[knVarForSparse] = {invMass,ptCand,deltaMassKK,dlen,dlenxy,normdlxy,cosp,cospxy,
1032  sigvert,cosPiDs,cosPiKPhi,TMath::Abs(normIP)};
1033 
1034  if(!fReadMC) {
1035  fnSparse->Fill(var4nSparse);
1036  }
1037  else {
1038  if(indexMCKKpi==GetSignalHistoIndex(iPtBin)) {
1039  if(candType==1.5) {Printf("CANDITATA Ds, prompt!");fnSparseMC[2]->Fill(var4nSparse);}
1040  if(candType==2.5) {Printf("CANDITATA Ds, fd!");fnSparseMC[3]->Fill(var4nSparse);}
1041  }
1042  else if(labDplus>=0 && pdgCode0==321) {
1043  if(candType==1.5) {Printf("CANDITATA D+, prompt origin!");fnSparseMCDplus[2]->Fill(var4nSparse);}
1044  if(candType==2.5) {Printf("CANDITATA D+, fd origin!");fnSparseMCDplus[3]->Fill(var4nSparse);}
1045  }
1046  }
1047  }
1048  if(isPhipiKK) {
1049  Double_t tmpNormIP[nProng];
1050 
1051  invMass = d->InvMassDspiKK();
1052  massKK = d->InvMass2Prongs(1,2,321,321);
1053  deltaMassKK = TMath::Abs(massKK-massPhi);
1054  cosPiDs = d->CosPiDsLabFramepiKK();
1055  cosPiKPhi = d->CosPiKPhiRFramepiKK();
1056  cosPiKPhi = TMath::Abs(cosPiKPhi*cosPiKPhi*cosPiKPhi);
1057 
1058  for(Int_t ip=0; ip<nProng; ip++) {
1059  Double_t diffIP, errdiffIP;
1060  d->Getd0MeasMinusExpProng(ip,aod->GetMagneticField(),diffIP,errdiffIP);
1061  tmpNormIP[ip] = diffIP/errdiffIP;
1062  if(ip==0) normIP = tmpNormIP[ip];
1063  else if(TMath::Abs(tmpNormIP[ip])>TMath::Abs(normIP)) normIP = tmpNormIP[ip];
1064  }
1065 
1066  normIPprong[0] = tmpNormIP[2];
1067  normIPprong[1] = tmpNormIP[1];
1068  normIPprong[2] = tmpNormIP[0];
1069 
1070  Double_t var4nSparse[knVarForSparse] = {invMass,ptCand,deltaMassKK,dlen,dlenxy,normdlxy,cosp,cospxy,
1071  sigvert,cosPiDs,cosPiKPhi,TMath::Abs(normIP)};
1072 
1073  if(!fReadMC) {
1074  fnSparse->Fill(var4nSparse);
1075  }
1076  else {
1077  if(indexMCpiKK==GetSignalHistoIndex(iPtBin)) {
1078  if(candType==1.5) fnSparseMC[2]->Fill(var4nSparse);
1079  if(candType==2.5) fnSparseMC[3]->Fill(var4nSparse);
1080  }
1081  else if(labDplus>=0 && pdgCode0==211) {
1082  if(candType==1.5) {Printf("CANDITATA D+, prompt origin!");fnSparseMCDplus[2]->Fill(var4nSparse);}
1083  if(candType==2.5) {Printf("CANDITATA D+, fd origin!");fnSparseMCDplus[3]->Fill(var4nSparse);}
1084  }
1085  }
1086  }
1087 
1088  if(fReadMC && (isPhiKKpi || isPhiKKpi)) {
1089  Double_t var[6] = {ptCand,normIP,normIPprong[0],normIPprong[1],normIPprong[2],candType};
1090  fnSparseIP->Fill(var);
1091  }
1092  }
1094 
1095  if(fDoCutVarHistos){
1096  Double_t dlen=d->DecayLength();
1097  Double_t cosp=d->CosPointingAngle();
1098  Double_t pt0=d->PtProng(0);
1099  Double_t pt1=d->PtProng(1);
1100  Double_t pt2=d->PtProng(2);
1101  Double_t sigvert=d->GetSigmaVert();
1102  Double_t sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
1103  Double_t dca=d->GetDCA();
1104  Double_t ptmax=0;
1105  for(Int_t i=0;i<3;i++){
1106  if(d->PtProng(i)>ptmax)ptmax=d->PtProng(i);
1107  }
1108  fCosPHist[index]->Fill(cosp);
1109  fDLenHist[index]->Fill(dlen);
1110  fSigVertHist[index]->Fill(sigvert);
1111  fSumd02Hist[index]->Fill(sumD02);
1112  fPtMaxHist[index]->Fill(ptmax);
1113  fDCAHist[index]->Fill(dca);
1114  fPtProng0Hist[index]->Fill(pt0);
1115  fPtProng1Hist[index]->Fill(pt1);
1116  fPtProng2Hist[index]->Fill(pt2);
1117  if(isKKpi){
1118  Double_t massKK=d->InvMass2Prongs(0,1,321,321);
1119  Double_t massKp=d->InvMass2Prongs(1,2,321,211);
1120  fDalitz[index]->Fill(massKK,massKp);
1121  if(isPhiKKpi) fDalitzPhi[index]->Fill(massKK,massKp);
1122  if(isK0starKKpi) fDalitzK0st[index]->Fill(massKK,massKp);
1123  if(fReadMC && indexMCKKpi!=-1){
1124  fDalitz[indexMCKKpi]->Fill(massKK,massKp);
1125  if(isPhiKKpi) fDalitzPhi[indexMCKKpi]->Fill(massKK,massKp);
1126  if(isK0starKKpi) fDalitzK0st[indexMCKKpi]->Fill(massKK,massKp);
1127  fCosPHist[indexMCKKpi]->Fill(cosp);
1128  fDLenHist[indexMCKKpi]->Fill(dlen);
1129  fSigVertHist[indexMCKKpi]->Fill(sigvert);
1130  fSumd02Hist[indexMCKKpi]->Fill(sumD02);
1131  fPtMaxHist[indexMCKKpi]->Fill(ptmax);
1132  fPtCandHist[indexMCKKpi]->Fill(ptCand);
1133  fDCAHist[indexMCKKpi]->Fill(dca);
1134  fPtProng0Hist[indexMCKKpi]->Fill(pt0);
1135  fPtProng1Hist[indexMCKKpi]->Fill(pt1);
1136  fPtProng2Hist[indexMCKKpi]->Fill(pt2);
1137  }
1138  }
1139  if(ispiKK){
1140  Double_t massKK=d->InvMass2Prongs(1,2,321,321);
1141  Double_t massKp=d->InvMass2Prongs(0,1,211,321);
1142  fDalitz[index]->Fill(massKK,massKp);
1143  if(isPhipiKK) fDalitzPhi[index]->Fill(massKK,massKp);
1144  if(isK0starpiKK) fDalitzK0st[index]->Fill(massKK,massKp);
1145 
1146 
1147  if(fReadMC && indexMCpiKK!=-1){
1148  fDalitz[indexMCpiKK]->Fill(massKK,massKp);
1149  if(isPhipiKK) fDalitzPhi[indexMCpiKK]->Fill(massKK,massKp);
1150  if(isK0starpiKK) fDalitzK0st[indexMCpiKK]->Fill(massKK,massKp);
1151  fCosPHist[indexMCpiKK]->Fill(cosp);
1152  fDLenHist[indexMCpiKK]->Fill(dlen);
1153  fSigVertHist[indexMCpiKK]->Fill(sigvert);
1154  fSumd02Hist[indexMCpiKK]->Fill(sumD02);
1155  fPtMaxHist[indexMCpiKK]->Fill(ptmax);
1156  fPtCandHist[indexMCpiKK]->Fill(ptCand);
1157  fDCAHist[indexMCpiKK]->Fill(dca);
1158  fPtProng0Hist[indexMCpiKK]->Fill(pt0);
1159  fPtProng1Hist[indexMCpiKK]->Fill(pt1);
1160  fPtProng2Hist[indexMCpiKK]->Fill(pt2);
1161  }
1162  }
1163 
1164 
1165  }
1166 
1167  Float_t tmp[37];
1168  if(fFillNtuple>0){
1169 
1170  if ((fFillNtuple==1 && (isPhiKKpi || isPhipiKK)) || (fFillNtuple==2 && (isK0starKKpi || isK0starpiKK)) || (fFillNtuple==3 && (isKKpi || ispiKK))){
1171 
1172  AliAODTrack *track0=(AliAODTrack*)d->GetDaughter(0);
1173  AliAODTrack *track1=(AliAODTrack*)d->GetDaughter(1);
1174  AliAODTrack *track2=(AliAODTrack*)d->GetDaughter(2);
1175 
1176  UInt_t bitMapPIDTrack0=fAnalysisCuts->GetPIDTrackTPCTOFBitMap(track0);
1177  UInt_t bitMapPIDTrack1=fAnalysisCuts->GetPIDTrackTPCTOFBitMap(track1);
1178  UInt_t bitMapPIDTrack2=fAnalysisCuts->GetPIDTrackTPCTOFBitMap(track2);
1179 
1180  tmp[0]=Float_t(labDs);
1181  if(fReadMC && fWriteOnlySignal) tmp[0]=Float_t(isMCSignal);
1182  tmp[1]=Float_t(retCodeAnalysisCuts);
1183  tmp[2]=Float_t(pdgCode0);
1184  tmp[3]=d->PtProng(0);
1185  tmp[4]=d->PtProng(1);
1186  tmp[5]=d->PtProng(2);
1187  tmp[6]=d->Pt();
1188  tmp[7]=d->PProng(0);
1189  tmp[8]=d->PProng(1);
1190  tmp[9]=d->PProng(2);
1191  tmp[10]=Int_t(bitMapPIDTrack0);
1192  tmp[11]=Int_t(bitMapPIDTrack1);
1193  tmp[12]=Int_t(bitMapPIDTrack2);
1194  tmp[13]=d->CosPointingAngle();
1195  tmp[14]=d->CosPointingAngleXY();
1196  tmp[15]=d->DecayLength();
1197  tmp[16]=d->DecayLengthXY();
1198  tmp[17]=d->NormalizedDecayLength();
1199  tmp[18]=d->NormalizedDecayLengthXY();
1200  tmp[19]=d->InvMassDsKKpi();
1201  tmp[20]=d->InvMassDspiKK();
1202  tmp[21]=d->GetSigmaVert();
1203  tmp[22]=d->Getd0Prong(0);
1204  tmp[23]=d->Getd0Prong(1);
1205  tmp[24]=d->Getd0Prong(2);
1206  tmp[25]=d->GetDCA();
1207  tmp[26]=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
1208  tmp[27]=d->InvMass2Prongs(0,1,321,321);
1209  tmp[28]=d->InvMass2Prongs(1,2,321,321);
1210  tmp[29]=d->InvMass2Prongs(1,2,321,211);
1211  tmp[30]=d->InvMass2Prongs(0,1,211,321);
1212  tmp[31]=d->CosPiDsLabFrameKKpi();
1213  tmp[32]=d->CosPiDsLabFramepiKK();
1214  tmp[33]=d->CosPiKPhiRFrameKKpi();
1215  tmp[34]=d->CosPiKPhiRFramepiKK();
1216  tmp[35]=(Float_t)(centrality);
1217  tmp[36]=(Float_t)(runNumber);
1218 
1219  if(fReadMC && fWriteOnlySignal){
1220  if(isMCSignal>=0) fNtupleDs->Fill(tmp);
1221  }else{
1222  fNtupleDs->Fill(tmp);
1223  }
1224  PostData(4,fNtupleDs);
1225  }
1226  }
1227  } //if(retCodeAnalysisCuts
1228  } // if(isFidAcc)
1229 
1230  if(unsetvtx) d->UnsetOwnPrimaryVtx();
1231  if(recVtx)fAnalysisCuts->CleanOwnPrimaryVtx(d,aod,origownvtx);
1232  }
1233 
1234  fCounter->StoreCandidates(aod,nFiltered,kTRUE);
1235  fCounter->StoreCandidates(aod,nSelected,kFALSE);
1236 
1237  delete vHF;
1238 
1239  PostData(1,fOutput);
1240  PostData(3,fCounter);
1241 
1242  return;
1243 }
1244 
1245 //_________________________________________________________________
1246 
1248 {
1250  //
1251  if(fDebug > 1) printf("AnalysisTaskSEDs: Terminate() \n");
1252  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1253  if (!fOutput) {
1254  printf("ERROR: fOutput not available\n");
1255  return;
1256  }
1257  fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("hNEvents"));
1258  if(fHistNEvents){
1259  printf("Number of analyzed events = %d\n",(Int_t)fHistNEvents->GetBinContent(2));
1260  }else{
1261  printf("ERROR: fHistNEvents not available\n");
1262  return;
1263  }
1264  return;
1265 }
1266 
1267 //_________________________________________________________________
1268 void AliAnalysisTaskSEDs::FillMCGenAccHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader){
1270 
1271  Int_t nProng = 3;
1272  Double_t zMCVertex = mcHeader->GetVtxZ(); //vertex MC
1273  if(TMath::Abs(zMCVertex) <= fAnalysisCuts->GetMaxVtxZ()) {
1274  for(Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
1275 
1276  AliAODMCParticle* mcPart = dynamic_cast<AliAODMCParticle*>(arrayMC->At(iPart));
1277 
1278  if(TMath::Abs(mcPart->GetPdgCode()) == 431) {
1279  Int_t orig = AliVertexingHFUtils::CheckOrigin(arrayMC,mcPart,kTRUE);//Prompt = 4, FeedDown = 5
1280 
1281  Int_t deca = 0;
1282  Bool_t isGoodDecay = kFALSE;
1283  Int_t labDau[3] = {-1,-1,-1};
1284  Bool_t isFidAcc = kFALSE;
1285  Bool_t isDaugInAcc = kFALSE;
1286 
1287  deca = AliVertexingHFUtils::CheckDsDecay(arrayMC,mcPart,labDau);
1288  if(deca == 1) isGoodDecay=kTRUE; // == 1 -> Phi pi -> kkpi
1289 
1290  if(labDau[0]==-1) continue; //protection against unfilled array of labels
1291 
1292  if(isGoodDecay) {
1293  Double_t pt = mcPart->Pt();
1294  Double_t rapid = mcPart->Y();
1295  isFidAcc = fAnalysisCuts->IsInFiducialAcceptance(pt,rapid);
1296  isDaugInAcc = CheckDaugAcc(arrayMC,nProng,labDau);
1297 
1298  if(isFidAcc) {
1299  Double_t var4nSparseAcc[2] = {pt,rapid};
1300  if(isDaugInAcc) {
1301  if(orig==4) fnSparseMC[0]->Fill(var4nSparseAcc);
1302  if(orig==5) fnSparseMC[1]->Fill(var4nSparseAcc);
1303  }
1304  }
1305  }
1306  }
1307 
1308  if(fFillSparseDplus && TMath::Abs(mcPart->GetPdgCode()) == 411) {
1309  Int_t orig = AliVertexingHFUtils::CheckOrigin(arrayMC,mcPart,kTRUE);//Prompt = 4, FeedDown = 5
1310 
1311  Int_t deca = 0;
1312  Bool_t isGoodDecay = kFALSE;
1313  Int_t labDau[3] = {-1,-1,-1};
1314  Bool_t isFidAcc = kFALSE;
1315  Bool_t isDaugInAcc = kFALSE;
1316 
1317  deca = AliVertexingHFUtils::CheckDplusKKpiDecay(arrayMC,mcPart,labDau);
1318  if(deca == 1) isGoodDecay=kTRUE; // == 1 -> Phi pi -> kkpi
1319 
1320  if(labDau[0]==-1) continue; //protection against unfilled array of labels
1321 
1322  if(isGoodDecay) {
1323  Double_t pt = mcPart->Pt();
1324  Double_t rapid = mcPart->Y();
1325  isFidAcc = fAnalysisCuts->IsInFiducialAcceptance(pt,rapid);
1326  isDaugInAcc = CheckDaugAcc(arrayMC,nProng,labDau);
1327 
1328  if(isFidAcc) {
1329  Double_t var4nSparseAcc[2] = {pt,rapid};
1330  if(isDaugInAcc) {
1331  if(orig==4) fnSparseMCDplus[0]->Fill(var4nSparseAcc);
1332  if(orig==5) fnSparseMCDplus[1]->Fill(var4nSparseAcc);
1333  }
1334  }
1335  }
1336  }
1337  }
1338  }
1339 }
1340 //_________________________________________________________________
1341 Bool_t AliAnalysisTaskSEDs::CheckDaugAcc(TClonesArray* arrayMC,Int_t nProng, Int_t *labDau){
1343 
1344  for (Int_t iProng = 0; iProng<nProng; iProng++){
1345  AliAODMCParticle* mcPartDaughter=dynamic_cast<AliAODMCParticle*>(arrayMC->At(labDau[iProng]));
1346  if(!mcPartDaughter) {
1347  return kFALSE;
1348  }
1349  Double_t eta = mcPartDaughter->Eta();
1350  Double_t pt = mcPartDaughter->Pt();
1351  if (TMath::Abs(eta) > 0.9 || pt < 0.1) {
1352  return kFALSE;
1353  }
1354  }
1355  return kTRUE;
1356 }
1357 
1358 //_________________________________________________________________
1359 
1361 
1362  const Int_t nprongs = 3;
1363  Double_t PxProng[nprongs], PyProng[nprongs], PtProng[nprongs], PzProng[nprongs], P2Prong[nprongs], mProng[nprongs];
1364  Double_t Px, Py, Pz, P2;
1365  UInt_t pdg[3]={321,321,211};
1366  int idPion = 2;
1367  if(dec==2) {
1368  pdg[0]=211;
1369  pdg[2]=321;
1370  idPion = 0;
1371  }
1372 
1373  for (Int_t ip=0; ip<nprongs; ip++) {
1374  PxProng[ip] = d->PxProng(ip);
1375  PyProng[ip] = d->PxProng(ip);
1376  PtProng[ip] = d->PtProng(ip);
1377  PzProng[ip] = d->PzProng(ip);
1378  P2Prong[ip] = d->P2Prong(ip);
1379  mProng[ip] = TDatabasePDG::Instance()->GetParticle(pdg[ip])->Mass();
1380  }
1381 
1382  for(Int_t i=0; i<9; i++) { //9 rotations implemented for the pion track around Pi
1383  Px = 0.;
1384  Py = 0.;
1385  Pz = 0.;
1386  Double_t theta = 0.;
1387  theta = TMath::ATan(PyProng[idPion]/PxProng[idPion]);
1388  if (PxProng[idPion]<0.) theta += TMath::Pi();
1389  theta += TMath::Pi()*(5/6 + 1/27*i);
1390 
1391  PxProng[idPion] = PtProng[idPion]*TMath::Cos(theta);
1392  PyProng[idPion] = PtProng[idPion]*TMath::Sin(theta);
1393  P2Prong[idPion] = PtProng[idPion]*PtProng[idPion] + PzProng[idPion]*PzProng[idPion];
1394 
1395  for (Int_t j=0; j<nprongs; j++) {
1396  Px += PxProng[j];
1397  Py += PyProng[j];
1398  Pz += PzProng[j];
1399  }
1400  P2 = Px*Px + Py*Py + Pz*Pz;
1401 
1402  Double_t energysum = 0.;
1403  for(Int_t j=0; j<nprongs; j++) {
1404  energysum += TMath::Sqrt(mProng[j]*mProng[j]+P2Prong[j]);
1405  }
1406  Double_t mass = TMath::Sqrt(energysum*energysum-P2);
1407  if(fminMass<=mass<fmaxMass) fMassRotBkgHistPhi[iPtBin]->Fill(mass);
1408  }
1409 }
1410 
1411 
1412 //_________________________________________________________________
1413 
1415 
1416  Double_t massDs;
1417  Double_t massPhi=TDatabasePDG::Instance()->GetParticle(333)->Mass();
1418  if(dec==1) massDs = d->InvMassDsKKpi();
1419  else if(dec==2) d->InvMassDspiKK();
1420  if(massKK<massPhi)fMassLSBkgHistPhi[iPtBin]->Fill(massDs);
1421  else fMassRSBkgHistPhi[iPtBin]->Fill(massDs);
1422 }
1423 
1424 
1425 
1426 
1427 
1428 
1429 
1430 
Double_t NormalizedDecayLengthXY() const
Bool_t IsEventRejectedDueToCentrality() const
Definition: AliRDHFCuts.h:317
Int_t pdg
THnSparseF * fnSparseMCDplus[4]
TH1F * fPtMaxHist[4 *kMaxPtBins]
! hist. for Pt Max (Prod Cuts)
Bool_t IsEventRejectedDueToZVertexOutsideFiducialRegion() const
Definition: AliRDHFCuts.h:311
Double_t NormalizedDecayLength() const
THnSparseF * fnSparseMC[4]
!<!THnSparse for topomatic variable
Bool_t IsEventRejectedDueToNotRecoVertex() const
Definition: AliRDHFCuts.h:305
double Double_t
Definition: External.C:58
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)
void SetPtBins(Int_t n, Float_t *lim)
Int_t IsEventSelectedInCentrality(AliVEvent *event)
Bool_t HasSelectionBit(Int_t i) const
TH2F * fDalitzK0st[4 *kMaxPtBins]
! dalitz plot via K0* (sig,bkg,tot)
Bool_t fFillSparseDplus
flag for usage of THnSparse
Double_t mass
Double_t CosPiDsLabFrameKKpi() const
centrality
Int_t GetHistoIndex(Int_t iPtBin) const
static Int_t CheckMatchingAODdeltaAODevents()
Double_t fMassRange
limits for pt bins
Bool_t IsEventRejectedDueToVertexContributors() const
Definition: AliRDHFCuts.h:308
TH2F * fPtVsMass
! hist. of pt vs. mass (prod. cuts)
static Int_t CheckDsDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
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)
Int_t GetPidOption() 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)
Bool_t fFillSparse
flag for usage of HasSelectionBit
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:243
TH1F * fSumd02Hist[4 *kMaxPtBins]
! hist. for sum d02 (Prod Cuts)
UInt_t GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const
TH1F * fMassHistPhi[4 *kMaxPtBins]
! hist. of mass spectra via phi (sig,bkg,tot)
Bool_t fDoBkgPhiSB
flag to create rotational bkg (rotating pi track)
THnSparseF * fnSparse
Cuts for Analysis.
TNtuple * fNtupleDs
! output ntuple
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 usage of THnSparse
TH1F * fHistCentrality[3]
!hist. for cent distr (all,sel ev, )
int Int_t
Definition: External.C:63
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
AliRDHFCutsDstoKKpi * fAnalysisCuts
TList * fOutput
! list send on output slot 0
Double_t CosPiKPhiRFrameKKpi() const
AliAODVertex * GetOwnPrimaryVtx() const
void GenerateBkgFromPhiSB(AliAODRecoDecayHF3Prong *d, Int_t dec, Int_t iPtBin, Double_t massKK)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
THnSparseF * fnSparseIP
!<!THnSparse for candidates on data
Bool_t CheckDaugAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
TH2F * fDalitzPhi[4 *kMaxPtBins]
! dalitz plot via phi (sig,bkg,tot)
Float_t GetCentrality(AliAODEvent *aodEvent)
Definition: AliRDHFCuts.h:244
Bool_t IsEventRejectedDueToPileup() const
Definition: AliRDHFCuts.h:314
static Int_t CheckDplusKKpiDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
TH1F * fMassHistKpi[kMaxPtBins]
! hist. of mass spectra of Kpi
TH1F * fMassRSBkgHistPhi[kMaxPtBins]
! hist. of bkg generated from right phi sideband + pion
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)
void FillMCGenAccHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader)
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 create bkg from phi sidebands
Bool_t GetIsPrimaryWithoutDaughters() const
Definition: AliRDHFCuts.h:264
Int_t GetSignalHistoIndex(Int_t iPtBin) const
Bool_t IsEventSelected(AliVEvent *event)
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)
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Double_t minMass
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
Float_t * GetPtBinLimits() const
Definition: AliRDHFCuts.h:234
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:235
TH1F * fDCAHist[4 *kMaxPtBins]
! hist. for DCA (Prod Cuts)
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:302
Bool_t fDoCutVarHistos
flag to control ntuple writing in MC
Double_t maxMass
TH1F * fPtProng2Hist[4 *kMaxPtBins]
! hist. for DCA (Prod Cuts)
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
TH2F * fDalitz[4 *kMaxPtBins]
! dalitz plot (sig,bkg,tot)
Int_t GetUseCentrality() const
Definition: AliRDHFCuts.h:266
TH1F * fSigVertHist[4 *kMaxPtBins]
! hist. for sigVert (Prod Cuts)
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Double_t DecayLength() const
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)
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
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]