AliPhysics  4e47bdd (4e47bdd)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskSEDplus.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
18 //*************************************************************************
19 // Class AliAnalysisTaskSEDplus
20 // AliAnalysisTaskSE for the D+ candidates Invariant Mass Histogram and
21 // comparison of heavy-flavour decay candidates
22 // to MC truth (kinematics stored in the AOD)
23 // Authors: Renu Bala, bala@to.infn.it
24 // F. Prino, prino@to.infn.it
25 // G. Ortona, ortona@to.infn.it
27 
28 #include <TClonesArray.h>
29 #include <TNtuple.h>
30 #include <TCanvas.h>
31 #include <TList.h>
32 #include <TString.h>
33 #include <TDatabasePDG.h>
34 #include "AliAnalysisManager.h"
36 #include "AliAODHandler.h"
37 #include "AliAODEvent.h"
38 #include "AliAODVertex.h"
39 #include "AliAODTrack.h"
41 #include "AliAnalysisVertexingHF.h"
42 #include "AliAnalysisTaskSE.h"
43 #include "AliAnalysisTaskSEDplus.h"
45 #include "AliVertexingHFUtils.h"
46 
50 
51 //________________________________________________________________________
54  fOutput(0),
55  fHistNEvents(0),
56  fHistNCandidates(0),
57  fMassHist(0x0),
58  fMassHistPlus(0x0),
59  fMassHistMinus(0x0),
60  fMassHistNoPid(0x0),
61  fCosPHist(0x0),
62  fDLenHist(0x0),
63  fSumd02Hist(0x0),
64  fSigVertHist(0x0),
65  fPtMaxHist(0x0),
66  fPtKHist(0x0),
67  fPtpi1Hist(0x0),
68  fPtpi2Hist(0x0),
69  fDCAHist(0x0),
70  fDLxy(0x0),
71  fCosxy(0x0),
72  fHistTrackVar(0),
73  fMCAccPrompt(0),
74  fMCAccBFeed(0),
75  fPtVsMassNoPid(0),
76  fPtVsMass(0),
77  fPtVsMassPlus(0),
78  fPtVsMassMinus(0),
79  fPtVsMassBadDaus(0),
80  fPtVsMassGoodDaus(0),
81  fYVsPtNoPid(0),
82  fYVsPt(0),
83  fYVsPtSigNoPid(0),
84  fYVsPtSig(0),
85  fPhiEtaCand(0),
86  fPhiEtaCandSigReg(0),
87  fSPDMult(0),
88  fDaughterClass(0),
89  fDeltaID(0),
90  fIDDauVsIDTra(0),
91  fMassHistLS(0x0),
92  fCosPHistLS(0x0),
93  fDLenHistLS(0x0),
94  fSumd02HistLS(0x0),
95  fSigVertHistLS(0x0),
96  fPtMaxHistLS(0x0),
97  fDCAHistLS(0x0),
98  fNtupleDplus(0),
99  fUpmasslimit(1.965),
100  fLowmasslimit(1.765),
101  fNPtBins(1),
102  fBinWidth(0.002),
103  fListCuts(0),
104  fRDCutsAnalysis(0),
105  fCounter(0),
106  fFillNtuple(0),
107  fAODProtection(1),
108  fReadMC(kFALSE),
109  fUseStrangeness(kFALSE),
110  fUseBit(kTRUE),
111  fCutsDistr(kFALSE),
112  fDoImpPar(kFALSE),
113  fDoSparse(kFALSE),
114  fDoTrackVarHist(kFALSE),
115  fStepMCAcc(kFALSE),
116  fUseQuarkTagInKine(kTRUE),
117  fNImpParBins(400),
118  fLowerImpPar(-1000.),
119  fHigherImpPar(1000.),
120  fDoLS(0),
121  fEtaSelection(0),
122  fSystem(0),
123  fNtrcklMin(0),
124  fNtrcklMax(10000),
125  fCutOnTrckl(kFALSE)
126 {
128 
129  for(Int_t i=0;i<3;i++){
130  fHistCentrality[i]=0;
131  fCorreld0Kd0pi[i]=0;
132  }
133 
134  for(Int_t i=0; i<5; i++)fHistMassPtImpPar[i]=0;
135  for(Int_t i=0; i<3; i++)fSparseCutVars[i]=0;
136 }
137 
138 //________________________________________________________________________
140  AliAnalysisTaskSE(name),
141  fOutput(0),
142  fHistNEvents(0),
143  fHistNCandidates(0),
144  fMassHist(0x0),
145  fMassHistPlus(0x0),
146  fMassHistMinus(0x0),
147  fMassHistNoPid(0x0),
148  fCosPHist(0x0),
149  fDLenHist(0x0),
150  fSumd02Hist(0x0),
151  fSigVertHist(0x0),
152  fPtMaxHist(0x0),
153  fPtKHist(0x0),
154  fPtpi1Hist(0x0),
155  fPtpi2Hist(0x0),
156  fDCAHist(0x0),
157  fDLxy(0x0),
158  fCosxy(0x0),
159  fHistTrackVar(0),
160  fMCAccPrompt(0),
161  fMCAccBFeed(0),
162  fPtVsMassNoPid(0),
163  fPtVsMass(0),
164  fPtVsMassPlus(0),
165  fPtVsMassMinus(0),
166  fPtVsMassBadDaus(0),
167  fPtVsMassGoodDaus(0),
168  fYVsPtNoPid(0),
169  fYVsPt(0),
170  fYVsPtSigNoPid(0),
171  fYVsPtSig(0),
172  fPhiEtaCand(0),
173  fPhiEtaCandSigReg(0),
174  fSPDMult(0),
175  fDaughterClass(0),
176  fDeltaID(0),
177  fIDDauVsIDTra(0),
178  fMassHistLS(0x0),
179  fCosPHistLS(0x0),
180  fDLenHistLS(0x0),
181  fSumd02HistLS(0x0),
182  fSigVertHistLS(0x0),
183  fPtMaxHistLS(0x0),
184  fDCAHistLS(0x0),
185  fNtupleDplus(0),
186  fUpmasslimit(1.965),
187  fLowmasslimit(1.765),
188  fNPtBins(1),
189  fBinWidth(0.002),
190  fListCuts(0),
191  fRDCutsAnalysis(dpluscutsana),
192  fCounter(0),
193  fFillNtuple(fillNtuple),
194  fAODProtection(1),
195  fReadMC(kFALSE),
196  fUseStrangeness(kFALSE),
197  fUseBit(kTRUE),
198  fCutsDistr(kFALSE),
199  fDoImpPar(kFALSE),
200  fDoSparse(kFALSE),
201  fDoTrackVarHist(kFALSE),
202  fStepMCAcc(kFALSE),
203  fUseQuarkTagInKine(kTRUE),
204  fNImpParBins(400),
205  fLowerImpPar(-1000.),
206  fHigherImpPar(1000.),
207  fDoLS(0),
208  fEtaSelection(0),
209  fSystem(0),
210  fNtrcklMin(0),
211  fNtrcklMax(10000),
212  fCutOnTrckl(kFALSE)
213 {
214  //
216  //
218 
219  for(Int_t i=0;i<3;i++){
220  fHistCentrality[i]=0;
221  fCorreld0Kd0pi[i]=0;
222  }
223 
224  for(Int_t i=0; i<5; i++)fHistMassPtImpPar[i]=0;
225  for(Int_t i=0; i<3; i++)fSparseCutVars[i]=0;
226 
227  // Default constructor
228  // Output slot #1 writes into a TList container
229  DefineOutput(1,TList::Class()); //My private output
230  // Output slot #2 writes cut to private output
231  // DefineOutput(2,AliRDHFCutsDplustoKpipi::Class());
232  DefineOutput(2,TList::Class());
233  // Output slot #3 writes cut to private output
234  DefineOutput(3,AliNormalizationCounter::Class());
235 
236  if(fFillNtuple){
237  // Output slot #4 writes into a TNtuple container
238  DefineOutput(4,TNtuple::Class()); //My private output
239  }
240 }
241 
242 //________________________________________________________________________
244 {
245  //
247  //
248  if(fOutput && !fOutput->IsOwner()){
249  delete fHistNEvents;
250  delete fHistNCandidates;
251  for(Int_t i=0;i<3*fNPtBins;i++){
252  delete fMassHist[i];
253  delete fMassHistPlus[i];
254  delete fMassHistMinus[i];
255  delete fMassHistNoPid[i];
256  delete fCosPHist[i];
257  delete fDLenHist[i];
258  delete fSumd02Hist[i];
259  delete fSigVertHist[i];
260  delete fPtMaxHist[i];
261  delete fPtKHist[i];
262  delete fPtpi1Hist[i];
263  delete fPtpi2Hist[i];
264  delete fDCAHist[i];
265  delete fDLxy[i];
266  delete fCosxy[i];
267  delete fCosPHistLS[i];
268  delete fDLenHistLS[i];
269  delete fSumd02HistLS[i];
270  delete fSigVertHistLS[i];
271  delete fPtMaxHistLS[i];
272  delete fDCAHistLS[i];
273  }
274  delete [] fMassHist;
275  delete [] fMassHistPlus;
276  delete [] fMassHistMinus;
277  delete [] fMassHistNoPid;
278  delete [] fCosPHist;
279  delete [] fDLenHist;
280  delete [] fSumd02Hist;
281  delete [] fSigVertHist;
282  delete [] fPtMaxHist;
283  delete [] fPtKHist;
284  delete [] fPtpi1Hist;
285  delete [] fPtpi2Hist;
286  delete [] fDCAHist;
287  delete [] fDLxy;
288  delete [] fCosxy;
289 
290  for(Int_t i=0;i<5*fNPtBins;i++){
291  delete fMassHistLS[i];
292  }
293 
294  delete [] fMassHistLS;
295  delete [] fCosPHistLS;
296  delete [] fDLenHistLS;
297  delete [] fSumd02HistLS;
298  delete [] fSigVertHistLS;
299  delete [] fPtMaxHistLS;
300  delete [] fDCAHistLS;
301 
302  for(Int_t i=0;i<3;i++){
303  delete fCorreld0Kd0pi[i];
304  delete fHistCentrality[i];
305  }
306  for(Int_t i=0;i<5;i++){
307  delete fHistMassPtImpPar[i];
308  }
309  for(Int_t i=0;i<3;i++){
310  delete fSparseCutVars[i];
311  }
312  delete fPtVsMassNoPid;
313  delete fPtVsMass;
314  delete fPtVsMassPlus;
315  delete fPtVsMassMinus;
316  delete fPtVsMassBadDaus;
317  delete fPtVsMassGoodDaus;
318  delete fYVsPtNoPid;
319  delete fYVsPt;
320  delete fYVsPtSigNoPid;
321  delete fYVsPtSig;
322  delete fPhiEtaCand;
323  delete fPhiEtaCandSigReg;
324  delete fSPDMult;
325  delete fDaughterClass;
326  delete fDeltaID;
327  delete fIDDauVsIDTra;
328  delete fHistTrackVar;
329  delete fMCAccPrompt;
330  delete fMCAccBFeed;
331  }
332 
333  delete fOutput;
334  delete fNtupleDplus;
335  delete fListCuts;
336  delete fRDCutsAnalysis;
337  delete fCounter;
338 
339 }
340 //_________________________________________________________________
343  Float_t bw=GetBinWidth();
344  fUpmasslimit = 1.865+range;
345  fLowmasslimit = 1.865-range;
346  SetBinWidth(bw);
347 }
348 //_________________________________________________________________
351  if(uplimit>lowlimit)
352  {
353  Float_t bw=GetBinWidth();
354  fUpmasslimit = lowlimit;
355  fLowmasslimit = uplimit;
356  SetBinWidth(bw);
357  }
358 }
359 //________________________________________________________________
361  Float_t width=w;
362  Int_t nbins=(Int_t)((fUpmasslimit-fLowmasslimit)/width+0.5);
363  Int_t missingbins=4-nbins%4;
364  nbins=nbins+missingbins;
365  width=(fUpmasslimit-fLowmasslimit)/nbins;
366  if(missingbins!=0){
367  printf("AliAnalysisTaskSEDplus::SetBinWidth: W-bin width of %f will produce histograms not rebinnable by 4. New width set to %f\n",w,width);
368  }
369  else{
370  if(fDebug>1) printf("AliAnalysisTaskSEDplus::SetBinWidth: width set to %f\n",width);
371  }
372  fBinWidth=width;
373 }
374 //_________________________________________________________________
376  return (Int_t)((fUpmasslimit-fLowmasslimit)/fBinWidth+0.5);
377 }
378 //_________________________________________________________________
379 void AliAnalysisTaskSEDplus::LSAnalysis(TClonesArray *arrayOppositeSign,TClonesArray *arrayLikeSign,AliAODEvent *aod,AliAODVertex *vtx1, Int_t nDplusOS){
380  //
381  //
383  //
384  if(fDebug>1)printf("started LS\n");
385 
386  //histograms for like sign
388  TH1F *histLSPlus = new TH1F("LSPlus","LSPlus",nbins,fLowmasslimit,fUpmasslimit);
389  TH1F *histLSMinus = new TH1F("LSMinus","LSMinus",nbins,fLowmasslimit,fUpmasslimit);
390 
391  Int_t nPosTrks=0,nNegTrks=0;
392  Int_t nOStriplets = arrayOppositeSign->GetEntriesFast();
393  Int_t nDplusLS=0;
394  Int_t nDminusLS=0;
395  Int_t nLikeSign = arrayLikeSign->GetEntriesFast();
396  Int_t index=0;
397 
398  // loop over like sign candidates
399  for(Int_t iLikeSign = 0; iLikeSign < nLikeSign; iLikeSign++) {
400  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)arrayLikeSign->UncheckedAt(iLikeSign);
401  if(fUseBit && !d->HasSelectionBit(AliRDHFCuts::kDplusCuts))continue;
402  Bool_t unsetvtx=kFALSE;
403  if(!d->GetOwnPrimaryVtx()) {
404  d->SetOwnPrimaryVtx(vtx1); // needed to compute all variables
405  unsetvtx=kTRUE;
406  }
407  Double_t ptCand = d->Pt();
408  Int_t iPtBin = fRDCutsAnalysis->PtBin(ptCand);
409  if(iPtBin<0)continue;
410  Int_t sign= d->GetCharge();
411  if(sign>0){
412  nPosTrks++;
413  }else{
414  nNegTrks++;
415  }
417  Int_t passTightCuts=fRDCutsAnalysis->GetIsSelectedCuts();
418  if(passTightCuts>0){
419  Float_t invMass = d->InvMassDplus();
420  index=GetLSHistoIndex(iPtBin);
421  fMassHistLS[index+1]->Fill(invMass);
422  if(sign>0){
423  histLSPlus->Fill(invMass);
424  nDplusLS++;
425  }else{
426  histLSMinus->Fill(invMass);
427  nDminusLS++;
428  }
429  if(fCutsDistr){
430  Double_t dlen=d->DecayLength();
431  Double_t cosp=d->CosPointingAngle();
432  Double_t sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
433  Double_t dca=d->GetDCA();
434  Double_t sigvert=d->GetSigmaVert();
435  Double_t ptmax=0;
436  for(Int_t i=0;i<3;i++){
437  if(d->PtProng(i)>ptmax)ptmax=d->PtProng(i);
438  }
439  fCosPHistLS[iPtBin]->Fill(cosp);
440  fDLenHistLS[iPtBin]->Fill(dlen);
441  fSumd02HistLS[iPtBin]->Fill(sumD02);
442  fSigVertHistLS[iPtBin]->Fill(sigvert);
443  fPtMaxHistLS[iPtBin]->Fill(ptmax);
444  fDCAHistLS[iPtBin]->Fill(dca);
445  }
446  }
447  if(unsetvtx) d->UnsetOwnPrimaryVtx();
448  }
449  //wei:normalized to the number of combinations (production)
450  //wei2:normalized to the number of LS/OS (production)
451  //wei3:normalized to the number of LS/OS (analysis)
452  //wei4:normalized to the number of combinations (analysis)
453  Float_t wei2=0;
454  if(nLikeSign!=0)wei2 = (Float_t)nOStriplets/(Float_t)nLikeSign;
455  Float_t wei3=0;
456  if(nDplusLS!=0)wei3 = (Float_t)nDplusOS/(Float_t)(nDplusLS+nDminusLS);
457  Float_t weiplus=1.,weiminus=1.;
458  Float_t wei4plus=1.,wei4minus=1.;
459  //wei* should be automatically protected, since to get a triplet there must be at least 3 good tracks in the event
460  if(nPosTrks>2)weiplus=3.*(Float_t)nNegTrks/((Float_t)nPosTrks-2.);
461  if(nDplusLS>2)wei4plus=3.*(Float_t)nDminusLS/((Float_t)nDplusLS-2.);
462  if(nNegTrks>2)weiminus=3.*(Float_t)nPosTrks/((Float_t)nNegTrks-2.);
463  if(nDminusLS>2)wei4minus=3.*(Float_t)nDplusLS/((Float_t)nDminusLS-2.);
464 
465  fMassHistLS[index]->Add(histLSPlus,weiplus);
466  fMassHistLS[index]->Add(histLSMinus,weiminus);
467  fMassHistLS[index+2]->Add(histLSPlus,wei2);
468  fMassHistLS[index+2]->Add(histLSMinus,wei2);
469  fMassHistLS[index+3]->Add(histLSPlus,wei3);
470  fMassHistLS[index+3]->Add(histLSMinus,wei3);
471  fMassHistLS[index+4]->Add(histLSPlus,wei4plus);
472  fMassHistLS[index+4]->Add(histLSMinus,wei4minus);
473 
474  delete histLSPlus;histLSPlus=0;
475  delete histLSMinus;histLSMinus=0;
476 
477  if(fDebug>1) printf("LS analysis terminated\n");
478 }
479 
480 //__________________________________________
482  //
484  //
485  if(fDebug > 1) printf("AnalysisTaskSEDplus::Init() \n");
486 
487  //PostData(2,fRDCutsloose);//we should then put those cuts in a tlist if we have more than 1
488  fListCuts=new TList();
489  fListCuts->SetOwner();
491  analysis->SetName("AnalysisCuts");
492 
493  fListCuts->Add(analysis);
494  PostData(2,fListCuts);
495 
496  return;
497 }
498 
499 //________________________________________________________________________
501 {
503  //
504  if(fDebug > 1) printf("AnalysisTaskSEDplus::UserCreateOutputObjects() \n");
505 
506  // Several histograms are more conveniently managed in a TList
507  fOutput = new TList();
508  fOutput->SetOwner();
509  fOutput->SetName("OutputHistos");
510 
511  fHistNEvents = new TH1F("fHistNEvents", "number of events ",10,-0.5,9.5);
512  fHistNEvents->GetXaxis()->SetBinLabel(1,"nEvents read");
513  fHistNEvents->GetXaxis()->SetBinLabel(2,"Rejected due to mismatch in trees");
514  fHistNEvents->GetXaxis()->SetBinLabel(3,"nEvents with good AOD");
515  fHistNEvents->GetXaxis()->SetBinLabel(4,"Rejected due to trigger");
516  fHistNEvents->GetXaxis()->SetBinLabel(5,"Rejected due to vertex reco");
517  fHistNEvents->GetXaxis()->SetBinLabel(6,"Rejected due to pileup");
518  fHistNEvents->GetXaxis()->SetBinLabel(7,"Rejected due to centrality");
519  fHistNEvents->GetXaxis()->SetBinLabel(8,"Rejected due to vtxz");
520  fHistNEvents->GetXaxis()->SetBinLabel(9,"Rejected due to Physics Sel");
521  fHistNEvents->GetXaxis()->SetBinLabel(10,"nEvents accepted");
522  fHistNEvents->GetXaxis()->SetNdivisions(1,kFALSE);
523  fHistNEvents->SetMinimum(0);
524  fOutput->Add(fHistNEvents);
525 
526  fHistNCandidates = new TH1F("hNCandidates","number of candidates",6,-0.5,5.5);
527  fHistNCandidates->GetXaxis()->SetBinLabel(1,"no. of 3prong candidates");
528  fHistNCandidates->GetXaxis()->SetBinLabel(2,"no. of cand with D+ bitmask");
529  fHistNCandidates->GetXaxis()->SetBinLabel(3,"D+ not on-the-fly reco");
530  fHistNCandidates->GetXaxis()->SetBinLabel(4,"D+ after topological cuts");
531  fHistNCandidates->GetXaxis()->SetBinLabel(5,"D+ after Topological+SingleTrack cuts");
532  fHistNCandidates->GetXaxis()->SetBinLabel(6,"D+ after Topological+SingleTrack+PID cuts");
533  fHistNCandidates->GetXaxis()->SetNdivisions(1,kFALSE);
534  fHistNCandidates->SetMinimum(0);
536 
537  fMassHist = new TH1F*[3*fNPtBins];
538  fMassHistPlus = new TH1F*[3*fNPtBins];
539  fMassHistMinus = new TH1F*[3*fNPtBins];
540  fMassHistNoPid = new TH1F*[3*fNPtBins];
541  fCosPHist = new TH1F*[3*fNPtBins];
542  fDLenHist = new TH1F*[3*fNPtBins];
543  fSumd02Hist = new TH1F*[3*fNPtBins];
544  fSigVertHist = new TH1F*[3*fNPtBins];
545  fPtMaxHist = new TH1F*[3*fNPtBins];
546  fPtKHist = new TH1F*[3*fNPtBins];
547  fPtpi1Hist = new TH1F*[3*fNPtBins];
548  fPtpi2Hist = new TH1F*[3*fNPtBins];
549  fDCAHist = new TH1F*[3*fNPtBins];
550  fDLxy = new TH1F*[3*fNPtBins];
551  fCosxy = new TH1F*[3*fNPtBins];
552 
553  TString hisname;
554  Int_t index=0;
556  fHistCentrality[0]=new TH2F("hCentrMult","centrality",100,0.5,30000.5,40,0.,100.);
557  fHistCentrality[1]=new TH2F("hCentrMult(selectedCent)","centrality(selectedCent)",100,0.5,30000.5,40,0.,100.);
558  fHistCentrality[2]=new TH2F("hCentrMult(OutofCent)","centrality(OutofCent)",100,0.5,30000.5,40,0.,100.);
559  for(Int_t i=0;i<3;i++){
560  fHistCentrality[i]->Sumw2();
561  fOutput->Add(fHistCentrality[i]);
562  }
563  for(Int_t i=0;i<fNPtBins;i++){
564 
565  index=GetHistoIndex(i);
566 
567  hisname.Form("hMassNoPidPt%d",i);
568  fMassHistNoPid[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
569  fMassHistNoPid[index]->Sumw2();
570  hisname.Form("hCosPAllPt%d",i);
571  fCosPHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
572  fCosPHist[index]->Sumw2();
573  hisname.Form("hDLenAllPt%d",i);
574  fDLenHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
575  fDLenHist[index]->Sumw2();
576  hisname.Form("hSumd02AllPt%d",i);
577  fSumd02Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
578  fSumd02Hist[index]->Sumw2();
579  hisname.Form("hSigVertAllPt%d",i);
580  fSigVertHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
581  fSigVertHist[index]->Sumw2();
582  hisname.Form("hPtMaxAllPt%d",i);
583  fPtMaxHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
584  fPtMaxHist[index]->Sumw2();
585  hisname.Form("hPtKPt%d",i);
586  fPtKHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
587  fPtKHist[index]->Sumw2();
588  hisname.Form("hPtpi1Pt%d",i);
589  fPtpi1Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
590  fPtpi1Hist[index]->Sumw2();
591  hisname.Form("hPtpi2Pt%d",i);
592  fPtpi2Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
593  fPtpi2Hist[index]->Sumw2();
594  hisname.Form("hDCAAllPt%d",i);
595  fDCAHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
596  fDCAHist[index]->Sumw2();
597 
598  hisname.Form("hDLxyPt%d",i);
599  fDLxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
600  fDLxy[index]->Sumw2();
601  hisname.Form("hCosxyPt%d",i);
602  fCosxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
603  fCosxy[index]->Sumw2();
604 
605  hisname.Form("hMassPt%dTC",i);
606  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
607  fMassHist[index]->Sumw2();
608  hisname.Form("hMassPt%dTCPlus",i);
609  fMassHistPlus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
610  fMassHistPlus[index]->Sumw2();
611  hisname.Form("hMassPt%dTCMinus",i);
612  fMassHistMinus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
613  fMassHistMinus[index]->Sumw2();
614 
615  index=GetSignalHistoIndex(i);
616  hisname.Form("hSigNoPidPt%d",i);
617  fMassHistNoPid[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
618  fMassHistNoPid[index]->Sumw2();
619  hisname.Form("hCosPSigPt%d",i);
620  fCosPHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
621  fCosPHist[index]->Sumw2();
622  hisname.Form("hDLenSigPt%d",i);
623  fDLenHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
624  fDLenHist[index]->Sumw2();
625  hisname.Form("hSumd02SigPt%d",i);
626  fSumd02Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
627  fSumd02Hist[index]->Sumw2();
628  hisname.Form("hSigVertSigPt%d",i);
629  fSigVertHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
630  fSigVertHist[index]->Sumw2();
631  hisname.Form("hPtMaxSigPt%d",i);
632  fPtMaxHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
633  fPtMaxHist[index]->Sumw2();
634  hisname.Form("hPtKSigPt%d",i);
635  fPtKHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
636  fPtKHist[index]->Sumw2();
637  hisname.Form("hPtpi1SigPt%d",i);
638  fPtpi1Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
639  fPtpi1Hist[index]->Sumw2();
640  hisname.Form("hPtpi2SigPt%d",i);
641  fPtpi2Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
642  fPtpi2Hist[index]->Sumw2();
643 
644  hisname.Form("hDCASigPt%d",i);
645  fDCAHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
646  fDCAHist[index]->Sumw2();
647 
648  hisname.Form("hDLxySigPt%d",i);
649  fDLxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
650  fDLxy[index]->Sumw2();
651  hisname.Form("hCosxySigPt%d",i);
652  fCosxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
653  fCosxy[index]->Sumw2();
654  hisname.Form("hSigPt%dTC",i);
655  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
656  fMassHist[index]->Sumw2();
657  hisname.Form("hSigPt%dTCPlus",i);
658  fMassHistPlus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
659  fMassHistPlus[index]->Sumw2();
660  hisname.Form("hSigPt%dTCMinus",i);
661  fMassHistMinus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
662  fMassHistMinus[index]->Sumw2();
663 
664 
665  index=GetBackgroundHistoIndex(i);
666  hisname.Form("hBkgNoPidPt%d",i);
667  fMassHistNoPid[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
668  fMassHistNoPid[index]->Sumw2();
669  hisname.Form("hCosPBkgPt%d",i);
670  fCosPHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
671  fCosPHist[index]->Sumw2();
672  hisname.Form("hDLenBkgPt%d",i);
673  fDLenHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
674  fDLenHist[index]->Sumw2();
675  hisname.Form("hSumd02BkgPt%d",i);
676  fSumd02Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
677  fSumd02Hist[index]->Sumw2();
678  hisname.Form("hSigVertBkgPt%d",i);
679  fSigVertHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
680  fSigVertHist[index]->Sumw2();
681  hisname.Form("hPtMaxBkgPt%d",i);
682  fPtMaxHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
683  fPtMaxHist[index]->Sumw2();
684  hisname.Form("hPtKBkgPt%d",i);
685  fPtKHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
686  fPtKHist[index]->Sumw2();
687  hisname.Form("hPtpi1BkgPt%d",i);
688  fPtpi1Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
689  fPtpi1Hist[index]->Sumw2();
690  hisname.Form("hPtpi2BkgPt%d",i);
691  fPtpi2Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
692  fPtpi2Hist[index]->Sumw2();
693  hisname.Form("hDCABkgPt%d",i);
694  fDCAHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
695  fDCAHist[index]->Sumw2();
696 
697  hisname.Form("hDLxyBkgPt%d",i);
698  fDLxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
699  fDLxy[index]->Sumw2();
700  hisname.Form("hCosxyBkgPt%d",i);
701  fCosxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
702  fCosxy[index]->Sumw2();
703 
704 
705  hisname.Form("hBkgPt%dTC",i);
706  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
707  fMassHist[index]->Sumw2();
708  hisname.Form("hBkgPt%dTCPlus",i);
709  fMassHistPlus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
710  fMassHistPlus[index]->Sumw2();
711  hisname.Form("hBkgPt%dTCMinus",i);
712  fMassHistMinus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
713  fMassHistMinus[index]->Sumw2();
714  }
715 
716 
717  for(Int_t i=0; i<3*fNPtBins; i++){
718  fOutput->Add(fMassHistNoPid[i]);
719  if(fCutsDistr){
720  fOutput->Add(fCosPHist[i]);
721  fOutput->Add(fDLenHist[i]);
722  fOutput->Add(fSumd02Hist[i]);
723  fOutput->Add(fSigVertHist[i]);
724  fOutput->Add(fPtMaxHist[i]);
725  fOutput->Add(fPtKHist[i]);
726  fOutput->Add(fPtpi1Hist[i]);
727  fOutput->Add(fPtpi2Hist[i]);
728  fOutput->Add(fDCAHist[i]);
729  fOutput->Add(fDLxy[i]);
730  fOutput->Add(fCosxy[i]);
731  }
732  fOutput->Add(fMassHist[i]);
733  fOutput->Add(fMassHistPlus[i]);
734  fOutput->Add(fMassHistMinus[i]);
735 
736  }
737 
738  fCorreld0Kd0pi[0]=new TH2F("hCorreld0Kd0piAll","",100,-0.02,0.02,100,-0.02,0.02);
739  fCorreld0Kd0pi[1]=new TH2F("hCorreld0Kd0piSig","",100,-0.02,0.02,100,-0.02,0.02);
740  fCorreld0Kd0pi[2]=new TH2F("hCorreld0Kd0piBkg","",100,-0.02,0.02,100,-0.02,0.02);
741  if(fCutsDistr){
742  for(Int_t i=0; i<3; i++){
743  fCorreld0Kd0pi[i]->Sumw2();
744  fOutput->Add(fCorreld0Kd0pi[i]);
745  }
746  }
747 
748 
749  const Int_t nPtBins=440;
750  Double_t ptBinLims[nPtBins+1];
751  for(Int_t jb=0; jb<=300; jb++) ptBinLims[jb]=0.1*(Double_t)jb; // 100 MeV bins in 0<pt<30
752  for(Int_t jb=301; jb<=440; jb++) ptBinLims[jb]=ptBinLims[300]+0.5*(Double_t)(jb-300); // 500 MeV bins in 30<pt<100
753 
754  fPtVsMassNoPid=new TH2F("hPtVsMassNoPid","PtVsMass (no PID)",nbins,fLowmasslimit,fUpmasslimit,nPtBins,ptBinLims);
755  fPtVsMass=new TH2F("hPtVsMass","PtVsMass",nbins,fLowmasslimit,fUpmasslimit,nPtBins,ptBinLims);
756  fPtVsMassPlus=new TH2F("hPtVsMassPlus","PtVsMass",nbins,fLowmasslimit,fUpmasslimit,nPtBins,ptBinLims);
757  fPtVsMassMinus=new TH2F("hPtVsMassMinus","PtVsMass",nbins,fLowmasslimit,fUpmasslimit,nPtBins,ptBinLims);
758  fPtVsMassGoodDaus=new TH2F("hPtVsMassGoodDaus","PtVsMassGoodDaus",nbins,fLowmasslimit,fUpmasslimit,nPtBins,ptBinLims);
759  fPtVsMassBadDaus=new TH2F("hPtVsMassBadDaus","PtVsMassBadDaus",nbins,fLowmasslimit,fUpmasslimit,nPtBins,ptBinLims);
760 
761  fYVsPtNoPid=new TH3F("hYVsPtNoPid","YvsPt (no PID)",40,0.,20.,80,-2.,2.,nbins,fLowmasslimit,fUpmasslimit);
762  fYVsPt=new TH3F("hYVsPt","YvsPt",40,0.,20.,80,-2.,2.,nbins,fLowmasslimit,fUpmasslimit);
763  fYVsPtSigNoPid=new TH2F("hYVsPtSigNoPid","YvsPt (MC, only sig., no PID)",40,0.,20.,80,-2.,2.);
764  fYVsPtSig=new TH2F("hYVsPtSig","YvsPt (MC, only Sig)",40,0.,20.,80,-2.,2.);
765  fPhiEtaCand=new TH2F("hPhiEtaCand","phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
766  fPhiEtaCandSigReg=new TH2F("hPhiEtaCandSigReg","phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
767 
768  Double_t maxmult;
769  if(fSystem==1) maxmult=5000;
770  else maxmult=200;
771  fSPDMult = new TH1F("hSPDMult", "Tracklets multiplicity; Tracklets ; Entries",200,0.,maxmult);
772  fOutput->Add(fPtVsMassNoPid);
773  fOutput->Add(fPtVsMass);
774  fOutput->Add(fPtVsMassPlus);
775  fOutput->Add(fPtVsMassMinus);
778  fOutput->Add(fYVsPtNoPid);
779  fOutput->Add(fYVsPt);
780  fOutput->Add(fYVsPtSigNoPid);
781  fOutput->Add(fYVsPtSig);
782  fOutput->Add(fPhiEtaCand);
784  fOutput->Add(fSPDMult);
785 
786  fDaughterClass = new TH1F("hDaughterClass","",10,-0.5,9.5);
787  fDaughterClass->GetXaxis()->SetBinLabel(1,"AliAODTrack - good ID");
788  fDaughterClass->GetXaxis()->SetBinLabel(2,"AliAODTrack - charge0");
789  fDaughterClass->GetXaxis()->SetBinLabel(3,"AliAODTrack - ID=0");
790  fDaughterClass->GetXaxis()->SetBinLabel(4,"AliAODTrack - neg ID");
791  fDaughterClass->GetXaxis()->SetBinLabel(5,"AliAODTrack - different ID");
792  fDaughterClass->GetXaxis()->SetBinLabel(6,"AliAODRecoDecayHF2Prong");
793  fDaughterClass->GetXaxis()->SetBinLabel(7,"AliAODRecoDecayHF3Prong");
794  fDaughterClass->GetXaxis()->SetBinLabel(8,"AliAODRecoCascadeHF");
795  fDaughterClass->GetXaxis()->SetBinLabel(9,"Other");
796  fDeltaID = new TH1F("hDeltaID"," ; GetDaughter->GetID() - GetProngID()",20001,-10000.5,10000.5);
797  if(fSystem==0){
798  fIDDauVsIDTra = new TH2F("hIDDauVsIDTra"," ; GetProngID() ; GetDaughter->GetID()",1001,-500.5,500.5,1001,-500.5,500.5);
799  }else{
800  fIDDauVsIDTra = new TH2F("hIDDauVsIDTra"," ; GetProngID() ; GetDaughter->GetID()",1000,-30000,30000,1000,-30000,30000);
801  }
802  fOutput->Add(fDaughterClass);
803  fOutput->Add(fDeltaID);
804  fOutput->Add(fIDDauVsIDTra);
805 
806  //Counter for Normalization
807  TString normName="NormalizationCounter";
808  AliAnalysisDataContainer *cont = GetOutputSlot(3)->GetContainer();
809  if(cont)normName=(TString)cont->GetName();
810  fCounter = new AliNormalizationCounter(normName.Data());
811  fCounter->Init();
812 
818 
819  PostData(1,fOutput);
820 
821  if(fFillNtuple==1){
822  OpenFile(4); // 4 is the slot number of the ntuple
823 
824 
825  fNtupleDplus = new TNtuple("fNtupleDplus","D +","pdg:Px:Py:Pz:Pt:charge:piddau0:piddau1:piddau2:Ptpi:PtK:Ptpi2:mompi:momK:mompi2:cosp:cospxy:DecLen:NormDecLen:DecLenXY:NormDecLenXY:InvMass:sigvert:d0Pi:d0K:d0Pi2:maxdca:ntracks:centr:RunNumber:BadDau");
826 
827  }
828 
829  if(fFillNtuple==2){
830  OpenFile(4); // 4 is the slot number of the ntuple
831 
832 
833  fNtupleDplus = new TNtuple("fNtupleDplus","D +","pdg:Pt:InvMass:d0:origin");
834 
835  }
836 
837  return;
838 }
839 
840 //________________________________________________________________________
842 {
845 
846  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
847 
848  fHistNEvents->Fill(0); // count event
849 
850  if(fAODProtection>=0){
851  // Protection against different number of events in the AOD and deltaAOD
852  // In case of discrepancy the event is rejected.
853  Int_t matchingAODdeltaAODlevel = AliRDHFCuts::CheckMatchingAODdeltaAODevents();
854  if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 && fAODProtection==1)) {
855  // AOD/deltaAOD trees have different number of entries || TProcessID do not match while it was required
856  fHistNEvents->Fill(1);
857  return;
858  }
859  }
860 
861  TClonesArray *array3Prong = 0;
862  TClonesArray *arrayLikeSign =0;
863  if(!aod && AODEvent() && IsStandardAOD()) {
864  // In case there is an AOD handler writing a standard AOD, use the AOD
865  // event in memory rather than the input (ESD) event.
866  aod = dynamic_cast<AliAODEvent*> (AODEvent());
867  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
868  // have to taken from the AOD event hold by the AliAODExtension
869  AliAODHandler* aodHandler = (AliAODHandler*)
870  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
871  if(aodHandler->GetExtensions()) {
872  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
873  AliAODEvent *aodFromExt = ext->GetAOD();
874  array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
875  arrayLikeSign=(TClonesArray*)aodFromExt->GetList()->FindObject("LikeSign3Prong");
876  }
877  } else if(aod) {
878  array3Prong=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
879  arrayLikeSign=(TClonesArray*)aod->GetList()->FindObject("LikeSign3Prong");
880  }
881 
882  if(!aod || !array3Prong) {
883  printf("AliAnalysisTaskSEDplus::UserExec: Charm3Prong branch not found!\n");
884  return;
885  }
886  if(!arrayLikeSign && fDoLS) {
887  printf("AliAnalysisTaskSEDplus::UserExec: LikeSign3Prong branch not found!\n");
888  return;
889  }
890 
891  // fix for temporary bug in ESDfilter
892  // the AODs with null vertex pointer didn't pass the PhysSel
893  if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001) return;
894 
895  //Store the event in AliNormalizationCounter->To disable for Pb-Pb? Add a flag to disable it?
897 
898  fHistNEvents->Fill(2);
899 
900  Int_t runNumber=aod->GetRunNumber();
901 
902  //Event selection
903  Bool_t isEvSel=fRDCutsAnalysis->IsEventSelected(aod);
904  Float_t ntracks=aod->GetNumberOfTracks();
905  Float_t evCentr=0;
907  fHistCentrality[0]->Fill(ntracks,evCentr);
908  if(fRDCutsAnalysis->GetWhyRejection()==5) fHistNEvents->Fill(3);
909  if(!isEvSel && fRDCutsAnalysis->GetWhyRejection()==0) fHistNEvents->Fill(4);
910  if(fRDCutsAnalysis->GetWhyRejection()==1) fHistNEvents->Fill(5);
911  if(fRDCutsAnalysis->GetWhyRejection()==2){fHistNEvents->Fill(6);fHistCentrality[2]->Fill(ntracks,evCentr);}
912  if(fRDCutsAnalysis->GetWhyRejection()==6)fHistNEvents->Fill(7);
913  if(fRDCutsAnalysis->GetWhyRejection()==7)fHistNEvents->Fill(8);
914 
915  TClonesArray *arrayMC=0;
916  AliAODMCHeader *mcHeader=0;
917  // load MC particles
918  if(fReadMC){
919  arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
920  if(!arrayMC) {
921  printf("AliAnalysisTaskSEDplus::UserExec: MC particles branch not found!\n");
922  return;
923  }
924 
925  // load MC header
926  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
927  if(!mcHeader) {
928  printf("AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
929  return;
930  }
931  }
932  if(fReadMC && fStepMCAcc){
933  if(aod->GetTriggerMask()==0 &&
934  (runNumber>=195344 && runNumber<=195677)){
935  // protection for events with empty trigger mask in p-Pb
936  return;
937  }
939  // events not passing the centrality selection can be removed immediately.
940 
941  FillMCAcceptanceHistos(arrayMC, mcHeader);
942  }
943  // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD
944  //TString trigclass=aod->GetFiredTriggerClasses();
945  // Post the data already here
946  PostData(1,fOutput);
947  if(!isEvSel)return;
949  // printf("ntracklet===%d\n",tracklets);
950  if(fCutOnTrckl && (tracklets<fNtrcklMin || tracklets>fNtrcklMax)) {return;}
951  fSPDMult->Fill(tracklets);
952 
953  fHistCentrality[1]->Fill(ntracks,evCentr);
954  fHistNEvents->Fill(9);
955 
956  // AOD primary vertex
957  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
958  // vtx1->Print();
959  // TString primTitle = vtx1->GetTitle();
960  //if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0)fHistNEvents->Fill(2);
961 
962 
963  Int_t n3Prong = array3Prong->GetEntriesFast();
964  // printf("Number of D+->Kpipi: %d and of tracks: %d\n",n3Prong,aod->GetNumberOfTracks());
965 
966  Int_t nOS=0;
967  Int_t index;
968  Int_t pdgDgDplustoKpipi[3]={321,211,211};
969 
970  // vHF object is needed to call the method that refills the missing info of the candidates
971  // if they have been deleted in dAOD reconstruction phase
972  // in order to reduce the size of the file
974  if(fDoLS>1){//Normalizations for LS
975  for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
976  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)array3Prong->UncheckedAt(i3Prong);
979  }
980  }
981  }else{//Standard analysis
982  // Double_t cutsDplus[12]={0.2,0.4,0.4,0.,0.,0.01,0.06,0.02,0.,0.85,0.,10000000000.};//TO REMOVE
983  //Double_t *cutsDplus = new (Double_t*)fRDCuts->GetCuts();
984  Int_t nSelectednopid=0,nSelected=0;
985  for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
986  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)array3Prong->UncheckedAt(i3Prong);
987  fHistNCandidates->Fill(0);
989  continue;
990  }
991  fHistNCandidates->Fill(1);
992 
993  if(!(vHF->FillRecoCand(aod,d))) { //Fill the data members of the candidate only if they are empty.
994  fHistNCandidates->Fill(2); //monitor how often this fails
995  continue;
996  }
997 
998  Bool_t goodDaus=kTRUE;
999  for(Int_t jdau=0; jdau<3; jdau++){
1000  Int_t idStored=d->GetProngID(jdau);
1001  TObject* odau=(TObject*)d->GetDaughter(jdau);
1002  TString cname=odau->ClassName();
1003  if(cname.Contains("AliAODTrack")){
1004  AliAODTrack* tr=(AliAODTrack*)d->GetDaughter(jdau);
1005  if(tr->Charge()==0){
1006  fDaughterClass->Fill(1);
1007  goodDaus=kFALSE;
1008  }
1009  Int_t idRecov=tr->GetID();
1010  Int_t dId=idRecov-idStored;
1011  fIDDauVsIDTra->Fill(idStored,idRecov);
1012  fDeltaID->Fill(dId);
1013  if(dId!=0){
1014  goodDaus=kFALSE;
1015  fDaughterClass->Fill(4);
1016  }else{
1017  if(idStored>0) fDaughterClass->Fill(0);
1018  else if(idStored==0) fDaughterClass->Fill(2);
1019  else{
1020  goodDaus=kFALSE;
1021  fDaughterClass->Fill(3);
1022  }
1023  }
1024  }else if(cname.Contains("AliAODRecoDecayHF2")){
1025  fDaughterClass->Fill(5);
1026  goodDaus=kFALSE;
1027  }else if(cname.Contains("AliAODRecoDecayHF3")){
1028  fDaughterClass->Fill(6);
1029  goodDaus=kFALSE;
1030  }else if(cname.Contains("AliAODRecoCascadeHF")){
1031  fDaughterClass->Fill(7);
1032  goodDaus=kFALSE;
1033  }else{
1034  fDaughterClass->Fill(8);
1035  goodDaus=kFALSE;
1036  }
1037  }
1038  Double_t ptCand = d->Pt();
1039  Double_t invMass=d->InvMassDplus();
1040  if(goodDaus) fPtVsMassGoodDaus->Fill(invMass,ptCand);
1041  else fPtVsMassBadDaus->Fill(invMass,ptCand);
1042 
1043  Int_t passTopolAndPIDCuts=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kAll,aod);
1044  Bool_t passSingleTrackCuts=kTRUE;
1045  if(fRDCutsAnalysis->GetIsSelectedCuts() && fRDCutsAnalysis->GetIsSelectedPID() && !passTopolAndPIDCuts) passSingleTrackCuts=kFALSE;
1046 
1047  if(!fRDCutsAnalysis->GetIsSelectedCuts()) continue;
1048  fHistNCandidates->Fill(3);
1049  if(!passSingleTrackCuts) continue;
1050  fHistNCandidates->Fill(4);
1051  if(passTopolAndPIDCuts) fHistNCandidates->Fill(5);
1052 
1053  Double_t etaD=d->Eta();
1054  Double_t phiD=d->Phi();
1055  if(fEtaSelection!=0){
1056  if(fEtaSelection==1 && etaD<0) continue;
1057  if(fEtaSelection==-1 && etaD>0) continue;
1058  }
1059 
1060  Bool_t unsetvtx=kFALSE;
1061  if(!d->GetOwnPrimaryVtx()){
1062  d->SetOwnPrimaryVtx(vtx1);
1063  unsetvtx=kTRUE;
1064  }
1065 
1066  Int_t iPtBin = fRDCutsAnalysis->PtBin(ptCand);
1067 
1068  Bool_t recVtx=kFALSE;
1069  AliAODVertex *origownvtx=0x0;
1071  if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
1072  if(fRDCutsAnalysis->RecalcOwnPrimaryVtx(d,aod))recVtx=kTRUE;
1073  else fRDCutsAnalysis->CleanOwnPrimaryVtx(d,aod,origownvtx);
1074  }
1075 
1076  Int_t labDp=-1;
1077  Bool_t isPrimary=kFALSE;
1078  Bool_t isFeeddown=kFALSE;
1079  Float_t pdgCode=-2;
1080  Float_t trueImpParXY=0.;
1081  Double_t ptB=-1.5;
1082  if(fReadMC){
1083  labDp = d->MatchToMC(411,arrayMC,3,pdgDgDplustoKpipi);
1084  if(labDp>=0){
1085  AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
1086  Int_t orig=AliVertexingHFUtils::CheckOrigin(arrayMC,partDp,fUseQuarkTagInKine);//Prompt = 4, FeedDown = 5
1087  pdgCode=TMath::Abs(partDp->GetPdgCode());
1088  if(orig==4){
1089  isPrimary=kTRUE;
1090  isFeeddown=kFALSE;
1091  }else if(orig==5){
1092  isPrimary=kFALSE;
1093  isFeeddown=kTRUE;
1094  trueImpParXY=GetTrueImpactParameter(mcHeader,arrayMC,partDp)*10000.;
1095  ptB=AliVertexingHFUtils::GetBeautyMotherPt(arrayMC,partDp);
1096  }else{
1097  pdgCode=-3;
1098  }
1099  }else{
1100  pdgCode=-1;
1101  }
1102  }
1103 
1104  Double_t rapid=d->YDplus();
1105  fYVsPtNoPid->Fill(ptCand,rapid,invMass);
1106  if(passTopolAndPIDCuts) {
1107  fYVsPt->Fill(ptCand,rapid,invMass);
1108  nOS++;
1109  }
1110  if(fReadMC && labDp>=0){
1111  fYVsPtSigNoPid->Fill(ptCand,rapid, invMass);
1112  if(passTopolAndPIDCuts)fYVsPtSig->Fill(ptCand,rapid, invMass);
1113  }
1114 
1115  Bool_t isFidAcc=fRDCutsAnalysis->IsInFiducialAcceptance(ptCand,rapid);
1116  if(isFidAcc){
1117 
1118  Double_t minPtDau=999.,ptmax=0,maxdca=0,sigvert=0,sumD02=0;
1119  Double_t dlen=0,cosp=0,dlenxy=0,cospxy=0, ndlenxy=0, dd0max=0;
1121  dlen=d->DecayLength();
1122  cosp=d->CosPointingAngle();
1123  sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
1124  maxdca=-9999.;
1125  for(Int_t idau=0;idau<3;idau++) if(d->GetDCA(idau)>maxdca) maxdca=d->GetDCA(idau);
1126  sigvert=d->GetSigmaVert();
1127  ptmax=0;
1128  dlenxy = d->DecayLengthXY();
1129  ndlenxy=d->NormalizedDecayLengthXY();
1130  cospxy=d->CosPointingAngleXY();
1131  for(Int_t i=0; i<3; i++) {
1132  if(d->PtProng(i)>ptmax)ptmax=d->PtProng(i);
1133  if(d->PtProng(i)<minPtDau) minPtDau=d->PtProng(i);
1134  Double_t diffIP, errdiffIP;
1135  d->Getd0MeasMinusExpProng(i,aod->GetMagneticField(),diffIP,errdiffIP);
1136  Double_t normdd0= diffIP/errdiffIP;
1137  if(i==0) dd0max=normdd0;
1138  else if(TMath::Abs(normdd0)>TMath::Abs(dd0max)) dd0max=normdd0;
1139  }
1140  }
1141  Double_t impparXY=d->ImpParXY()*10000.;
1142  Double_t resSel=0;
1143  if(fRDCutsAnalysis->GetIsSelectedCuts()) resSel=1;
1144  if(passTopolAndPIDCuts) resSel=2;
1145  if(fSystem==1) dd0max = TMath::Abs(dd0max);
1146 
1147  //for all THnSparses except for FD
1148  Double_t arrayForSparse[kVarForSparse]={invMass,ptCand,TMath::Abs(impparXY),resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max};
1149  //for THnSparses for FD
1150  Double_t arrayForSparseFD[kVarForSparseFD]={invMass,ptCand,TMath::Abs(impparXY),resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max,ptB};
1151 
1152  //for imppar THnSparses
1153  Double_t arrayForImpPar[kVarForImpPar]={invMass,ptCand,impparXY};
1154  //for imppar THnSparse with true FD imppar
1155  Double_t arrayForImpParFDTrue[kVarForImpPar]={invMass,ptCand,trueImpParXY};
1156 
1157  Double_t flagOrigin = 0;
1158 
1159  AliAODTrack *track;
1160  if(fDoTrackVarHist) {
1161  for(int i = 0; i < 3; i++) {
1162  Double_t ptTrack = 0, nCrossedRowsTPC = 0, nClustersTPC = 0, ratioCRowsFClu = 0, isSig = 0;
1163  track = (AliAODTrack*)d->GetDaughter(i);
1164  AliESDtrack esdTrack(track);
1165  esdTrack.SetTPCClusterMap(track->GetTPCClusterMap());
1166  esdTrack.SetTPCSharedMap(track->GetTPCSharedMap());
1167  esdTrack.SetTPCPointsF(track->GetTPCNclsF());
1168  ptTrack = track->Pt();
1169  nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
1170  nClustersTPC = esdTrack.GetTPCNcls();
1171  if(esdTrack.GetTPCNclsF()>0) {
1172  ratioCRowsFClu = nCrossedRowsTPC / esdTrack.GetTPCNclsF();
1173  if(labDp>=0){
1174  if(isPrimary) isSig = 1.;
1175  else if(isFeeddown) isSig = 2.;
1176  }
1177  }
1178  Double_t arrayForTrackSparse[kVarForTrackSparse]={ptCand,invMass,ptTrack,nClustersTPC,nCrossedRowsTPC,ratioCRowsFClu,isSig};
1179  if(passTopolAndPIDCuts){
1180  if(fDoTrackVarHist) fHistTrackVar->Fill(arrayForTrackSparse);
1181  }
1182  }
1183  }
1184 
1185  //Fill histos
1186  index=GetHistoIndex(iPtBin);
1187  nSelectednopid++;
1188  fPtVsMassNoPid->Fill(invMass,ptCand);
1189  fMassHistNoPid[index]->Fill(invMass);
1190  if(fDoImpPar && passTopolAndPIDCuts){
1191  fHistMassPtImpPar[0]->Fill(arrayForImpPar);
1192  }
1193  if(fDoSparse){
1194  fSparseCutVars[0]->Fill(arrayForSparse);
1195  }
1196  if(passTopolAndPIDCuts){
1197  nSelected++;
1198  fPtVsMass->Fill(invMass,ptCand);
1199  fMassHist[index]->Fill(invMass);
1200  if(d->GetCharge()>0){
1201  fPtVsMassPlus->Fill(invMass,ptCand);
1202  fMassHistPlus[index]->Fill(invMass);
1203  }
1204  else if(d->GetCharge()<0){
1205  fPtVsMassMinus->Fill(invMass,ptCand);
1206  fMassHistMinus[index]->Fill(invMass);
1207  }
1208  fPhiEtaCand->Fill(etaD,phiD);
1209  if(TMath::Abs(invMass-1.8696)<0.05) fPhiEtaCandSigReg->Fill(etaD,phiD);
1210  if(fCutsDistr){
1211  fCosPHist[index]->Fill(cosp);
1212  fDLenHist[index]->Fill(dlen);
1213  fSumd02Hist[index]->Fill(sumD02);
1214  fSigVertHist[index]->Fill(sigvert);
1215  fPtMaxHist[index]->Fill(ptmax);
1216  fPtKHist[index]->Fill(d->PtProng(1));
1217  fPtpi1Hist[index]->Fill(d->PtProng(0));
1218  fPtpi2Hist[index]->Fill(d->PtProng(2));
1219  fDCAHist[index]->Fill(maxdca);
1220  fDLxy[index]->Fill(ndlenxy);
1221  fCosxy[index]->Fill(cospxy);
1222  fCorreld0Kd0pi[0]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1223  }
1224  }
1225 
1226  // fill ntuple
1227  if(fFillNtuple==1){
1228 
1229  Float_t tmp[31];
1230 
1231  tmp[0]=pdgCode;
1232  if(isFeeddown) tmp[0]+=5000.;
1233  tmp[1]=d->Px();
1234  tmp[2]=d->Py();
1235  tmp[3]=d->Pz();
1236  tmp[4]=d->Pt();
1237  tmp[5]=d->GetCharge();
1238  // tmp[5]=fRDCutsAnalysis->GetPIDBitMask(d);
1239  tmp[6]=fRDCutsAnalysis->GetPIDTrackTPCTOFBitMap((AliAODTrack*)d->GetDaughter(0));
1240  tmp[7]=fRDCutsAnalysis->GetPIDTrackTPCTOFBitMap((AliAODTrack*)d->GetDaughter(1));
1241  tmp[8]=fRDCutsAnalysis->GetPIDTrackTPCTOFBitMap((AliAODTrack*)d->GetDaughter(2));
1242  tmp[9]=d->PtProng(0);
1243  tmp[10]=d->PtProng(1);
1244  tmp[11]=d->PtProng(2);
1245  tmp[12]=d->PProng(0);
1246  tmp[13]=d->PProng(1);
1247  tmp[14]=d->PProng(2);
1248  tmp[15]=cosp;
1249  tmp[16]=cospxy;
1250  tmp[17]=dlen;
1251  tmp[18]=d->NormalizedDecayLength();
1252  tmp[19]=dlenxy;
1253  tmp[20]=ndlenxy;
1254  tmp[21]=d->InvMassDplus();
1255  tmp[22]=sigvert;
1256  tmp[23]=d->Getd0Prong(0);
1257  tmp[24]=d->Getd0Prong(1);
1258  tmp[25]=d->Getd0Prong(2);
1259  tmp[26]=maxdca;
1260  tmp[27]=ntracks;
1261  tmp[28]=fRDCutsAnalysis->GetCentrality(aod);
1262  tmp[29]=runNumber;
1263  tmp[30]=d->HasBadDaughters();
1264  fNtupleDplus->Fill(tmp);
1265  PostData(4,fNtupleDplus);
1266  }
1267 
1268  if(fFillNtuple==2 && passTopolAndPIDCuts){
1269  Float_t tmp[5];
1270  tmp[0]=pdgCode;
1271  if(isFeeddown) tmp[0]+=5000.;
1272  tmp[1]=d->Pt();
1273  tmp[2]=d->InvMassDplus();
1274  tmp[3]=impparXY;
1275  if(!fReadMC){flagOrigin=0;};
1276  if(fReadMC){
1277  if(isPrimary&&labDp>=0)flagOrigin=1;
1278  if(isFeeddown&&labDp>=0)flagOrigin=2;
1279  if(!(labDp>=0))flagOrigin=3;
1280 
1281  }
1282 
1283  tmp[4]=flagOrigin;
1284  fNtupleDplus->Fill(tmp);
1285  PostData(4,fNtupleDplus);
1286  }
1287 
1288  if(fReadMC){
1289  if(labDp>=0) {
1290  index=GetSignalHistoIndex(iPtBin);
1291  if(fDoImpPar && passTopolAndPIDCuts){
1292  if(isPrimary) fHistMassPtImpPar[1]->Fill(arrayForImpPar);
1293  else if(isFeeddown){
1294  fHistMassPtImpPar[2]->Fill(arrayForImpPar);
1295  fHistMassPtImpPar[3]->Fill(arrayForImpParFDTrue);
1296  }
1297  }
1298  if(fDoSparse){
1299  if(isPrimary) fSparseCutVars[1]->Fill(arrayForSparse);
1300  else if(isFeeddown){
1301  fSparseCutVars[2]->Fill(arrayForSparseFD);
1302  }
1303  }
1304  }else{
1305  index=GetBackgroundHistoIndex(iPtBin);
1306  if(fDoImpPar && passTopolAndPIDCuts)fHistMassPtImpPar[4]->Fill(arrayForImpPar);
1307  }
1308  fMassHistNoPid[index]->Fill(invMass);
1309  if(passTopolAndPIDCuts){
1310  if(fCutsDistr){
1311  Float_t fact=1.;
1312  Float_t factor[3]={1.,1.,1.};
1313  if(fUseStrangeness) fact=GetStrangenessWeights(d,arrayMC,factor);
1314  fCosPHist[index]->Fill(cosp,fact);
1315  fDLenHist[index]->Fill(dlen,fact);
1316  fDLxy[index]->Fill(ndlenxy);
1317  fCosxy[index]->Fill(cospxy);
1318  Float_t sumd02s=d->Getd0Prong(0)*d->Getd0Prong(0)*factor[0]*factor[0]+d->Getd0Prong(1)*d->Getd0Prong(1)*factor[1]*factor[1]+d->Getd0Prong(2)*d->Getd0Prong(2)*factor[2]*factor[2];
1319  fSumd02Hist[index]->Fill(sumd02s);
1320  fSigVertHist[index]->Fill(sigvert,fact);
1321  fPtMaxHist[index]->Fill(ptmax,fact);
1322  fPtKHist[index]->Fill(d->PtProng(1),fact);
1323  fPtpi1Hist[index]->Fill(d->PtProng(0),fact);
1324  fPtpi2Hist[index]->Fill(d->PtProng(2),fact);
1325  fDCAHist[index]->Fill(maxdca,fact);
1326  fCorreld0Kd0pi[1]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1327  }
1328  fMassHist[index]->Fill(invMass);
1329  if(d->GetCharge()>0) fMassHistPlus[index]->Fill(invMass);
1330  else if(d->GetCharge()<0) fMassHistMinus[index]->Fill(invMass);
1331  }
1332  }
1333  }
1334 
1335  if(recVtx)fRDCutsAnalysis->CleanOwnPrimaryVtx(d,aod,origownvtx);
1336 
1337  if(unsetvtx) d->UnsetOwnPrimaryVtx();
1338  }
1339  fCounter->StoreCandidates(aod,nSelectednopid,kTRUE);
1340  fCounter->StoreCandidates(aod,nSelected,kFALSE);
1341  }
1342  delete vHF;
1343  //start LS analysis
1344  if(fDoLS && arrayLikeSign) LSAnalysis(array3Prong,arrayLikeSign,aod,vtx1,nOS);
1345 
1346  PostData(1,fOutput);
1347  PostData(2,fListCuts);
1348  PostData(3,fCounter);
1349  return;
1350 }
1351 
1352 //________________________________________________________________________
1355 
1356  TString hisname;
1357  Int_t indexLS=0;
1358  Int_t index=0;
1360 
1361  fMassHistLS = new TH1F*[5*fNPtBins];
1362  fCosPHistLS = new TH1F*[3*fNPtBins];
1363  fDLenHistLS = new TH1F*[3*fNPtBins];
1364  fSumd02HistLS = new TH1F*[3*fNPtBins];
1365  fSigVertHistLS = new TH1F*[3*fNPtBins];
1366  fPtMaxHistLS = new TH1F*[3*fNPtBins];
1367  fDCAHistLS = new TH1F*[3*fNPtBins];
1368 
1369  for(Int_t i=0;i<fNPtBins;i++){
1370 
1371  index=GetHistoIndex(i);
1372  indexLS=GetLSHistoIndex(i);
1373 
1374  hisname.Form("hLSPt%d",i);
1375  fMassHistLS[indexLS] = new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1376  fMassHistLS[indexLS]->Sumw2();
1377 
1378  hisname.Form("hCosPAllPt%dLS",i);
1379  fCosPHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,1.);
1380  fCosPHistLS[index]->Sumw2();
1381  hisname.Form("hDLenAllPt%dLS",i);
1382  fDLenHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.5);
1383  fDLenHistLS[index]->Sumw2();
1384  hisname.Form("hSumd02AllPt%dLS",i);
1385  fSumd02HistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,1.);
1386  fSumd02HistLS[index]->Sumw2();
1387  hisname.Form("hSigVertAllPt%dLS",i);
1388  fSigVertHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1389  fSigVertHistLS[index]->Sumw2();
1390  hisname.Form("hPtMaxAllPt%dLS",i);
1391  fPtMaxHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,5.);
1392  fPtMaxHistLS[index]->Sumw2();
1393  hisname.Form("hDCAAllPt%dLS",i);
1394  fDCAHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1395  fDCAHistLS[index]->Sumw2();
1396 
1397  index=GetSignalHistoIndex(i);
1398  indexLS++;
1399 
1400  hisname.Form("hLSPt%dnw",i);
1401  fMassHistLS[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1402  fMassHistLS[indexLS]->Sumw2();
1403 
1404  hisname.Form("hCosPSigPt%dLS",i);
1405  fCosPHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,1.);
1406  fCosPHistLS[index]->Sumw2();
1407  hisname.Form("hDLenSigPt%dLS",i);
1408  fDLenHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.5);
1409  fDLenHistLS[index]->Sumw2();
1410  hisname.Form("hSumd02SigPt%dLS",i);
1411  fSumd02HistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,1.);
1412  fSumd02HistLS[index]->Sumw2();
1413  hisname.Form("hSigVertSigPt%dLS",i);
1414  fSigVertHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1415  fSigVertHistLS[index]->Sumw2();
1416  hisname.Form("hPtMaxSigPt%dLS",i);
1417  fPtMaxHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,5.);
1418  fPtMaxHistLS[index]->Sumw2();
1419  hisname.Form("hDCASigPt%dLS",i);
1420  fDCAHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1421  fDCAHistLS[index]->Sumw2();
1422 
1423  index=GetBackgroundHistoIndex(i);
1424  indexLS++;
1425 
1426  hisname.Form("hLSPt%dLCntrip",i);
1427  fMassHistLS[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1428  fMassHistLS[indexLS]->Sumw2();
1429 
1430  hisname.Form("hCosPBkgPt%dLS",i);
1431  fCosPHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,1.);
1432  fCosPHistLS[index]->Sumw2();
1433  hisname.Form("hDLenBkgPt%dLS",i);
1434  fDLenHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.5);
1435  fDLenHistLS[index]->Sumw2();
1436  hisname.Form("hSumd02BkgPt%dLS",i);
1437  fSumd02HistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,1.);
1438  fSumd02HistLS[index]->Sumw2();
1439  hisname.Form("hSigVertBkgPt%dLS",i);
1440  fSigVertHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1441  fSigVertHistLS[index]->Sumw2();
1442  hisname.Form("hPtMaxBkgPt%dLS",i);
1443  fPtMaxHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,5.);
1444  fPtMaxHistLS[index]->Sumw2();
1445  hisname.Form("hDCABkgPt%dLS",i);
1446  fDCAHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1447  fDCAHistLS[index]->Sumw2();
1448 
1449  indexLS++;
1450  hisname.Form("hLSPt%dLCntripsinglecut",i);
1451  fMassHistLS[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1452  fMassHistLS[indexLS]->Sumw2();
1453 
1454  indexLS++;
1455  hisname.Form("hLSPt%dspc",i);
1456  fMassHistLS[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1457  fMassHistLS[indexLS]->Sumw2();
1458  }
1459 
1460  for(Int_t i=0; i<3*fNPtBins; i++){
1461  fOutput->Add(fCosPHistLS[i]);
1462  fOutput->Add(fDLenHistLS[i]);
1463  fOutput->Add(fSumd02HistLS[i]);
1464  fOutput->Add(fSigVertHistLS[i]);
1465  fOutput->Add(fPtMaxHistLS[i]);
1466  fOutput->Add(fDCAHistLS[i]);
1467  }
1468  for(Int_t i=0; i<5*fNPtBins; i++){
1469  fOutput->Add(fMassHistLS[i]);
1470  }
1471 }
1472 
1473 //________________________________________________________________________
1476 
1477  Int_t nmassbins=GetNBinsHistos();
1478 
1479  Int_t nptbins=80;
1480  Double_t ptmin=0.;
1481  Double_t ptmax=40.;
1482 
1483  //dimensions for THnSparse
1484  TString axTit[kVarForImpPar]={"M_{K#pi#pi} (GeV/c^{2})","p_{T} (GeV/c)","Imp Par (#mum)"};
1485 
1489 
1490  //mass, pt, imppar, PIDsel
1491  //mass, pt, imppar, PIDsel
1492  fHistMassPtImpPar[0]=new THnSparseF("hMassPtImpParAll",
1493  "Mass vs. pt vs.imppar - All",
1494  kVarForImpPar,nbins,xmin,xmax);
1495  fHistMassPtImpPar[1]=new THnSparseF("hMassPtImpParPrompt",
1496  "Mass vs. pt vs.imppar - promptD",
1497  kVarForImpPar,nbins,xmin,xmax);
1498  fHistMassPtImpPar[2]=new THnSparseF("hMassPtImpParBfeed",
1499  "Mass vs. pt vs.imppar - DfromB",
1500  kVarForImpPar,nbins,xmin,xmax);
1501  fHistMassPtImpPar[3]=new THnSparseF("hMassPtImpParTrueBfeed",
1502  "Mass vs. pt vs.true imppar -DfromB",
1503  kVarForImpPar,nbins,xmin,xmax);
1504  fHistMassPtImpPar[4]=new THnSparseF("hMassPtImpParBkg",
1505  "Mass vs. pt vs.imppar - backgr.",
1506  kVarForImpPar,nbins,xmin,xmax);
1507 
1508  for(Int_t i=0; i<5; i++){
1509  for(Int_t iax=0; iax<kVarForImpPar; iax++) fHistMassPtImpPar[i]->GetAxis(iax)->SetTitle(axTit[iax].Data());
1510  fOutput->Add(fHistMassPtImpPar[i]);
1511  }
1512 }
1513 
1514 //________________________________________________________________________
1517 
1518  Int_t nmassbins=GetNBinsHistos();
1519 
1520  Int_t nptbins=80;
1521  Double_t ptmin=0.;
1522  Double_t ptmax=40.;
1523 
1524  Int_t nselbins=2;
1525  Double_t minsel=0.5;
1526  Double_t maxsel=2.5;
1527 
1528  Int_t nnormdlbins=30;
1529  Double_t minnormdl=0.;
1530  Double_t maxnormdl=30.;
1531 
1532  Double_t maxmult;
1533 
1534  Int_t nd0bins;
1535  Double_t d0min;
1536  Double_t d0max;
1537 
1538  Int_t nptmindaubins;
1539  Double_t minptmindau;
1540  Double_t maxptmindau;
1541 
1542  Int_t nsigvertbins;
1543  Double_t minsigvert;
1544  Double_t maxsigvert;
1545 
1546  Int_t ndeclbins;
1547  Double_t mindecl;
1548  Double_t maxdecl;
1549 
1550  Int_t ndeclxybins;
1551  Double_t mindeclxy;
1552  Double_t maxdeclxy;
1553 
1554  Int_t ncospbins;
1555  Double_t mincosp;
1556  Double_t maxcosp;
1557 
1558  Int_t ncospxybins;
1559  Double_t mincospxy;
1560  Double_t maxcospxy;
1561 
1562  Int_t nd0d0expbins;
1563  Double_t mind0d0;
1564  Double_t maxd0d0;
1565 
1566  if(fSystem==1) {
1567  maxmult=5000;
1568 
1569  nd0bins=18;
1570  d0min=0.;
1571  d0max=180;
1572 
1573  nptmindaubins=1;
1574  minptmindau=0.2;
1575  maxptmindau=1.2;
1576 
1577  nsigvertbins=10;
1578  minsigvert=0.012;
1579  maxsigvert=0.032;
1580 
1581  ndeclbins=35;
1582  mindecl=0.;
1583  maxdecl=0.35;
1584 
1585  ndeclxybins=35;
1586  mindeclxy=0.;
1587  maxdeclxy=0.35;
1588 
1589  ncospbins=30;
1590  mincosp=0.97;
1591  maxcosp=1.;
1592 
1593  ncospxybins=30;
1594  mincospxy=0.97;
1595  maxcospxy=1.;
1596 
1597  nd0d0expbins=12;
1598  mind0d0=0.;
1599  maxd0d0=6.;
1600  }
1601  else {
1602  maxmult=200;
1603 
1604  nd0bins=60;
1605  d0min=0.;
1606  d0max=300;
1607 
1608  nptmindaubins=10;
1609  minptmindau=0.2;
1610  maxptmindau=1.2;
1611 
1612  nsigvertbins=25;
1613  minsigvert=0.010;
1614  maxsigvert=0.035;
1615 
1616  ndeclbins=70;
1617  mindecl=0.;
1618  maxdecl=0.70;
1619 
1620  ndeclxybins=70;
1621  mindeclxy=0.;
1622  maxdeclxy=0.70;
1623 
1624  ncospbins=100;
1625  mincosp=0.90;
1626  maxcosp=1.;
1627 
1628  ncospxybins=30;
1629  mincospxy=0.97;
1630  maxcospxy=1.;
1631 
1632  nd0d0expbins=40;
1633  mind0d0=-10.;
1634  maxd0d0=10.;
1635  }
1636  //dimensions for THnSparse which are NOT for BFeed
1637  TString axTit[kVarForSparse]={"M_{K#pi#pi} (GeV/c^{2})","p_{T} (GeV/c)","Imp Par (#mum)","passTopolPID","min. daughter p_{T} (GeV/c)","sigmaVertex","cos(#theta_{P})","cos(#theta_{P}^{xy})","decL (cm)","decL XY (cm)","Norm decL XY","Norm max d0-d0exp"};
1638 
1639  Int_t nbins[kVarForSparse]={nmassbins,nptbins,nd0bins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclxybins,nnormdlbins,nd0d0expbins};
1640  Double_t xmin[kVarForSparse]={fLowmasslimit,ptmin,d0min,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0};
1641  Double_t xmax[kVarForSparse]={fUpmasslimit,ptmax,d0max,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0};
1642 
1643  //dimensions for THnSparse for BFeed
1644  Int_t nbinsFD[kVarForSparseFD]={nmassbins,nptbins,nd0bins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclbins,nnormdlbins,nd0d0expbins,84};
1645  Double_t xminFD[kVarForSparseFD]={fLowmasslimit,ptmin,d0min,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0,-2};
1646  Double_t xmaxFD[kVarForSparseFD]={fUpmasslimit,ptmax,d0max,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0,40};
1647 
1648  //mass, pt, imppar, cosPoinXY, decLXY, norm decLXY (for BFeed also ptB)
1649  //mass, pt, imppar, cosPoinXY, decLXY, norm decLXY (for BFeed also ptB)
1650  fSparseCutVars[0]=new THnSparseF("hMassPtCutVarsAll",
1651  "Mass vs. pt vs. cut vars - All",
1652  kVarForSparse,nbins,xmin,xmax);
1653  fSparseCutVars[1]=new THnSparseF("hMassPtCutVarsPrompt",
1654  "Mass vs. pt vs. cut vars - promptD",
1655  kVarForSparse,nbins,xmin,xmax);
1656  fSparseCutVars[2]=new THnSparseF("hMassPtCutVarsBfeed",
1657  "Mass vs. pt vs. cut vars - DfromB",
1658  kVarForSparseFD,nbinsFD,xminFD,xmaxFD);
1659 
1660  for(Int_t i=0; i<3; i++){
1661  for(Int_t iax=0; iax<kVarForSparse; iax++) fSparseCutVars[i]->GetAxis(iax)->SetTitle(axTit[iax].Data());
1662  if(i == 2 || i == 3) fSparseCutVars[i]->GetAxis(kVarForSparseFD-1)->SetTitle("p_{T}^{B} (GeV/c)");
1663  fOutput->Add(fSparseCutVars[i]);
1664  }
1665 }
1666 
1667 //________________________________________________________________________
1670 
1671  Int_t nmassbins = GetNBinsHistos();
1672 
1673  Int_t nbins[kVarForTrackSparse] = {40,nmassbins,50,170,170,100,3};
1674  Double_t xmin[kVarForTrackSparse] = {0.,fLowmasslimit,0.,0.5,0.5,0.,-0.5};
1675  Double_t xmax[kVarForTrackSparse] = {40.,fUpmasslimit,5.,170.5,170.5,1.,2.5};
1676 
1677  //pt, y
1678  fHistTrackVar = new THnSparseF("hHistTrackVar","hHistTrackVar",kVarForTrackSparse,nbins,xmin,xmax);
1679  fHistTrackVar->GetAxis(0)->SetTitle("D^{+} p_{T} (GeV/c)");
1680  fHistTrackVar->GetAxis(1)->SetTitle("k#pi#pi inv. mass (GeV/c^{2})");
1681  fHistTrackVar->GetAxis(2)->SetTitle("track p_{T} (GeV/c)");
1682  fHistTrackVar->GetAxis(3)->SetTitle("N TPC clusters");
1683  fHistTrackVar->GetAxis(4)->SetTitle("N TPC cross. rows");
1684  fHistTrackVar->GetAxis(5)->SetTitle("TPC clust./cross.rows");
1685  fHistTrackVar->GetAxis(6)->SetTitle("Bkg = 0, Signal = 1");
1686 
1687  fOutput->Add(fHistTrackVar);
1688 }
1689 
1690 
1691 //________________________________________________________________________
1694 
1695  const Int_t nVarPrompt = 2;
1696  const Int_t nVarFD = 3;
1697 
1698  Int_t nbinsPrompt[nVarPrompt]={200,100};
1699  Int_t nbinsFD[nVarFD]={200,100,200};
1700 
1701  Double_t xminPrompt[nVarPrompt] = {0.,-1.};
1702  Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
1703 
1704  Double_t xminFD[nVarFD] = {0.,-1.,0.};
1705  Double_t xmaxFD[nVarFD] = {40.,1.,40.};
1706 
1707  //pt, y
1708  fMCAccPrompt = new THnSparseF("hMCAccPrompt","kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
1709  fMCAccPrompt->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
1710  fMCAccPrompt->GetAxis(1)->SetTitle("y");
1711 
1712  //pt,y,ptB
1713  fMCAccBFeed = new THnSparseF("hMCAccBFeed","kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
1714  fMCAccBFeed->GetAxis(0)->SetTitle("p_{T} (GeV/c)");
1715  fMCAccBFeed->GetAxis(1)->SetTitle("y");
1716  fMCAccBFeed->GetAxis(2)->SetTitle("p_{T}^{B} (GeV/c)");
1717 
1718  fOutput->Add(fMCAccPrompt);
1719  fOutput->Add(fMCAccBFeed);
1720 }
1721 
1722 //________________________________________________________________________
1723 void AliAnalysisTaskSEDplus::FillMCAcceptanceHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader){
1725 
1726  const Int_t nProng = 3;
1727 
1728  Double_t zMCVertex = mcHeader->GetVtxZ(); //vertex MC
1729 
1730  for(Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
1731  AliAODMCParticle* mcPart = dynamic_cast<AliAODMCParticle*>(arrayMC->At(iPart));
1732  if (TMath::Abs(mcPart->GetPdgCode()) == 411){
1733 
1734  Int_t orig=AliVertexingHFUtils::CheckOrigin(arrayMC,mcPart,fUseQuarkTagInKine);//Prompt = 4, FeedDown = 5
1735 
1736  Int_t deca = 0;
1737  Bool_t isGoodDecay=kFALSE;
1738  Int_t labDau[4]={-1,-1,-1,-1};
1739  Bool_t isInAcc = kFALSE;
1740  Bool_t isFidAcc = kFALSE;
1741 
1742  deca=AliVertexingHFUtils::CheckDplusDecay(arrayMC,mcPart,labDau);
1743  if(deca > 0) isGoodDecay=kTRUE;
1744 
1745  if(labDau[0]==-1){
1746  continue; //protection against unfilled array of labels
1747  }
1748 
1749  isFidAcc=fRDCutsAnalysis->IsInFiducialAcceptance(mcPart->Pt(),mcPart->Y());
1750  isInAcc=CheckAcc(arrayMC,nProng,labDau);
1751 
1752  if(isGoodDecay && TMath::Abs(zMCVertex) < fRDCutsAnalysis->GetMaxVtxZ() && isFidAcc && isInAcc) {
1753  //for prompt
1754  if(orig == 4){
1755  //fill histo for prompt
1756  Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
1757  fMCAccPrompt->Fill(arrayMCprompt);
1758  }
1759  //for FD
1760  else if(orig == 5){
1761  Double_t ptB = AliVertexingHFUtils::GetBeautyMotherPt(arrayMC,mcPart);
1762  //fill histo for FD
1763  Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
1764  fMCAccBFeed->Fill(arrayMCFD);
1765  }
1766  else
1767  continue;
1768  }
1769  }
1770  }
1771 }
1772 
1773 //________________________________________________________________________
1775 {
1777  //
1778  if(fDebug > 1) printf("AnalysisTaskSEDplus: Terminate() \n");
1779 
1780  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1781  if (!fOutput) {
1782  printf("ERROR: fOutput not available\n");
1783  return;
1784  }
1785 
1786  fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
1787  if(fHistNEvents){
1788  printf("Number of analyzed events = %d\n",(Int_t)fHistNEvents->GetBinContent(10));
1789  }else{
1790  printf("ERROR: fHistNEvents not available\n");
1791  return;
1792  }
1793 
1794  return;
1795 }
1796 //_________________________________________________________________________________________________
1797 Float_t AliAnalysisTaskSEDplus::GetTrueImpactParameter(const AliAODMCHeader *mcHeader, TClonesArray* arrayMC, const AliAODMCParticle *partDp) const {
1799 
1800  Double_t vtxTrue[3];
1801  mcHeader->GetVertex(vtxTrue);
1802  Double_t origD[3];
1803  partDp->XvYvZv(origD);
1804  Short_t charge=partDp->Charge();
1805  Double_t pXdauTrue[3],pYdauTrue[3],pZdauTrue[3];
1806  for(Int_t iDau=0; iDau<3; iDau++){
1807  pXdauTrue[iDau]=0.;
1808  pYdauTrue[iDau]=0.;
1809  pZdauTrue[iDau]=0.;
1810  }
1811 
1812  Int_t nDau=partDp->GetNDaughters();
1813  Int_t labelFirstDau = partDp->GetDaughter(0);
1814  if(nDau==3){
1815  for(Int_t iDau=0; iDau<3; iDau++){
1816  Int_t ind = labelFirstDau+iDau;
1817  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(arrayMC->At(ind));
1818  if(!part){
1819  AliError("Daughter particle not found in MC array");
1820  return 99999.;
1821  }
1822  pXdauTrue[iDau]=part->Px();
1823  pYdauTrue[iDau]=part->Py();
1824  pZdauTrue[iDau]=part->Pz();
1825  }
1826  }else if(nDau==2){
1827  Int_t theDau=0;
1828  for(Int_t iDau=0; iDau<2; iDau++){
1829  Int_t ind = labelFirstDau+iDau;
1830  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(arrayMC->At(ind));
1831  if(!part){
1832  AliError("Daughter particle not found in MC array");
1833  return 99999.;
1834  }
1835  Int_t pdgCode=TMath::Abs(part->GetPdgCode());
1836  if(pdgCode==211 || pdgCode==321){
1837  pXdauTrue[theDau]=part->Px();
1838  pYdauTrue[theDau]=part->Py();
1839  pZdauTrue[theDau]=part->Pz();
1840  ++theDau;
1841  }else{
1842  Int_t nDauRes=part->GetNDaughters();
1843  if(nDauRes==2){
1844  Int_t labelFirstDauRes = part->GetDaughter(0);
1845  for(Int_t iDauRes=0; iDauRes<2; iDauRes++){
1846  Int_t indDR = labelFirstDauRes+iDauRes;
1847  AliAODMCParticle* partDR = dynamic_cast<AliAODMCParticle*>(arrayMC->At(indDR));
1848  if(!partDR){
1849  AliError("Daughter particle not found in MC array");
1850  return 99999.;
1851  }
1852 
1853  Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
1854  if(pdgCodeDR==211 || pdgCodeDR==321){
1855  pXdauTrue[theDau]=partDR->Px();
1856  pYdauTrue[theDau]=partDR->Py();
1857  pZdauTrue[theDau]=partDR->Pz();
1858  ++theDau;
1859  }
1860  }
1861  }
1862  }
1863  }
1864  if(theDau!=3){
1865  AliError("Wrong number of decay prongs");
1866  return 99999.;
1867  }
1868  }
1869 
1870  Double_t d0dummy[3]={0.,0.,0.};
1871  AliAODRecoDecayHF aodDplusMC(vtxTrue,origD,3,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
1872  return aodDplusMC.ImpParXY();
1873 
1874 }
1875 //_________________________________________________________________________________________________
1878 
1879  for(Int_t iprong=0;iprong<3;iprong++){
1880  factor[iprong]=1;
1881  AliAODTrack *trad = (AliAODTrack*)d->GetDaughter(iprong);
1882  Int_t labd= trad->GetLabel();
1883  if(labd>=0){
1884  AliAODMCParticle *dau = (AliAODMCParticle*)arrayMC->At(labd);
1885  if(dau){
1886  Int_t labm = dau->GetMother();
1887  if(labm>=0){
1888  AliAODMCParticle *mot = (AliAODMCParticle*)arrayMC->At(labm);
1889  if(mot){
1890  if(TMath::Abs(mot->GetPdgCode())==310 || TMath::Abs(mot->GetPdgCode())==130 || TMath::Abs(mot->GetPdgCode())==321){ //K0_S, K0_L, K^+-
1891  if(d->PtProng(iprong)<=1)factor[iprong]=1./.7;
1892  else factor[iprong]=1./.6;
1893  // fNentries->Fill(12);
1894  }
1895  if(TMath::Abs(mot->GetPdgCode())==3122) { //Lambda
1896  factor[iprong]=1./0.25;
1897  // fNentries->Fill(13);
1898  }//if 3122
1899  }//if(mot)
1900  }//if labm>0
1901  }//if(dau)
1902  }//if labd>=0
1903  }//prong loop
1904 
1905  Float_t fact=1.;
1906  for(Int_t k=0;k<3;k++)fact=fact*factor[k];
1907  return fact;
1908 
1909 }
1910 
1911 //_________________________________________________________________
1912 Bool_t AliAnalysisTaskSEDplus::CheckAcc(TClonesArray* arrayMC,Int_t nProng, Int_t *labDau){
1914  for (Int_t iProng = 0; iProng<nProng; iProng++){
1915  AliAODMCParticle* mcPartDaughter=dynamic_cast<AliAODMCParticle*>(arrayMC->At(labDau[iProng]));
1916  if(!mcPartDaughter) return kFALSE;
1917  Double_t eta = mcPartDaughter->Eta();
1918  Double_t pt = mcPartDaughter->Pt();
1919  if (TMath::Abs(eta) > 0.9 || pt < 0.1) return kFALSE;
1920  }
1921  return kTRUE;
1922 }
Int_t charge
THnSparseF * fMCAccPrompt
!histo for StepMCAcc for Dplus prompt (pt,y,ptB)
Bool_t fCutOnTrckl
maximum number of tracklets
TH2F * fPhiEtaCand
! hist. with eta/phi distribution of candidates
Double_t NormalizedDecayLengthXY() const
TH1F ** fSigVertHist
!hist. for sigVert (topol+PID)
TH1F ** fSumd02HistLS
!hist. for LS cuts variable 3 (topol+PID)
Double_t NormalizedDecayLength() const
Bool_t fUseStrangeness
flag for access to MC
AliRDHFCutsDplustoKpipi * fRDCutsAnalysis
list of cuts
virtual void UserCreateOutputObjects()
Implementation of interface methods.
Int_t GetIsSelectedPID() const
Definition: AliRDHFCuts.h:348
double Double_t
Definition: External.C:58
Definition: External.C:260
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
THnSparseF * fHistMassPtImpPar[5]
! histograms for impact parameter
Definition: External.C:236
TH2F * fYVsPtSigNoPid
! hist. of Y vs. Pt (MC, only sig, w/o PID)
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
static Int_t CheckDplusDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
TH1F ** fMassHistLS
!hist. for LS inv mass (topol+PID)
Int_t fAODProtection
flag for filling ntuple 0 no NTuple 1 big Ntuple 2 small NTuple
Int_t GetIsSelectedCuts() const
Definition: AliRDHFCuts.h:347
TH2F * fPtVsMassPlus
! hist. of pt vs. mass, D+ candidates (topol+PID cuts)
Bool_t fDoSparse
flag to activate impact paramter histos
Int_t IsEventSelectedInCentrality(AliVEvent *event)
Bool_t HasSelectionBit(Int_t i) const
TH3F * fYVsPt
! hist. of Y vs. Pt vs. Mass (topol+PID cuts)
virtual void Terminate(Option_t *option)
const Double_t d0min
TH1F ** fMassHistMinus
! hist. for D- inv mass (topol+PID cuts)
TH1F ** fSumd02Hist
!hist. for sum d02 (topol+PID)
Int_t fEtaSelection
flag to do LS analysis
Bool_t fDoTrackVarHist
flag to activate sparses for cut variation study
Float_t fLowerImpPar
nunber of bins in impact parameter histos
TH2F * fHistCentrality[3]
!hist. for cent distr (all,sel ev, )
Double_t ImpParXY() const
TH1F * fSPDMult
! hist. of spd mult
static Int_t CheckMatchingAODdeltaAODevents()
Int_t GetLSHistoIndex(Int_t iPtBin) const
TH1F ** fCosxy
!hist. for Cosxy (topol+PID)
Int_t GetSignalHistoIndex(Int_t iPtBin) const
THnSparseF * fHistTrackVar
! histograms for track cuts study
UInt_t GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const
Int_t GetWhyRejection() const
Definition: AliRDHFCuts.h:304
TH1F ** fPtpi1Hist
!hist. for PtPi1 (topol+PID)
Double_t CosPointingAngleXY() const
TH1F ** fDLenHistLS
!hist. for LS cuts variable 2 (topol+PID)
TList * fListCuts
width of one bin in output histos
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
TAxis * GetAxis(TDirectory *dir, const char *name, Bool_t verbose=true)
TH2F * fPtVsMassGoodDaus
! hist. of pt vs. mass (topol+PID cuts)
TList * fOutput
! list send on output slot 0
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
Bool_t fCutsDistr
flag to use bitmask
TH1F ** fPtMaxHist
!hist. for Pt Max (topol+PID)
const Double_t d0max
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
TH1F ** fDCAHistLS
!hist. for LS cuts variable 6 (topol+PID)
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:247
void LSAnalysis(TClonesArray *arrayOppositeSign, TClonesArray *arrayLikeSign, AliAODEvent *aod, AliAODVertex *vtx1, Int_t nDplusOS)
Int_t GetBackgroundHistoIndex(Int_t iPtBin) const
Bool_t HasBadDaughters() const
TH2F * fYVsPtSig
! hist. of Y vs. Pt (MC, only sig, topol+PID cuts)
TH1F ** fPtKHist
!hist. for PtK (topol+PID)
const Int_t nPtBins
Float_t fHigherImpPar
lower limit in impact parameter (um)
Class for cuts on AOD reconstructed D+->Kpipi.
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
int Int_t
Definition: External.C:63
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
float Float_t
Definition: External.C:68
TH1F ** fMassHistPlus
! hist. for D+ inv mass (topol+PID cuts)
const Double_t ptmax
void FillMCAcceptanceHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader)
TH2F * fPtVsMassBadDaus
! hist. of pt vs. mass (topol+PID cuts)
TH2F * fPtVsMass
! hist. of pt vs. mass (topol+PID cuts)
AliAODVertex * GetOwnPrimaryVtx() const
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
TH1F ** fPtMaxHistLS
!hist. for LS cuts variable 5 (topol+PID)
Int_t fDoLS
higher limit in impact parameter (um)
TH2F * fPhiEtaCandSigReg
! hist. eta/phi of candidates in D+ mass region
const Double_t ptmin
Float_t GetCentrality(AliAODEvent *aodEvent)
Definition: AliRDHFCuts.h:248
UShort_t GetProngID(Int_t ip) const
Float_t GetTrueImpactParameter(const AliAODMCHeader *mcHeader, TClonesArray *arrayMC, const AliAODMCParticle *partDp) const
Int_t fNImpParBins
flag for quark/hadron level identification of prompt and feeddown
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)
TH3F * fYVsPtNoPid
! hist. of Y vs. Pt vs. Mass(w/o PID)
Int_t GetHistoIndex(Int_t iPtBin) const
THnSparseF * fMCAccBFeed
!histo for StepMCAcc for Dplus FD (pt,y,ptB)
short Short_t
Definition: External.C:23
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
TH1F ** fMassHistNoPid
! hist. for inv mass (w/o PID)
TH1F ** fMassHist
! hist. for inv mass (topol+PID cuts)
TH2F * fPtVsMassNoPid
! hist. of pt vs. mass (w/o PID)
Double_t DecayLengthXY() const
static Double_t GetBeautyMotherPt(TClonesArray *arrayMC, AliAODMCParticle *mcPart)
Bool_t CheckAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
Bool_t GetIsPrimaryWithoutDaughters() const
Definition: AliRDHFCuts.h:268
TH1F ** fDLenHist
!hist. for Dec Length (topol+PID)
Bool_t IsEventSelected(AliVEvent *event)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
TH1F * fHistNEvents
! hist. for No. of events
Float_t fBinWidth
Number of Pt Bins.
void SetMassLimits(Float_t range)
TH1F ** fCosPHistLS
!hist. for LS cuts variable 1 (topol+PID)
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
TH1F ** fCosPHist
!hist. for PointingAngle (topol+PID)
TH1F ** fDCAHist
!hist. for DCA (topol+PID)
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
Int_t fSystem
eta region to accept D+ 0=all, -1 = negative, 1 = positive
TH2F * fCorreld0Kd0pi[3]
!hist. for d0k*d0pi vs. d0k*d0pi (topol+PID)
virtual void UserExec(Option_t *option)
Bool_t fDoImpPar
flag to activate cuts distr histos
AliNormalizationCounter * fCounter
Cuts for Analysis.
Bool_t fUseBit
flag to enhance strangeness in MC to fit to data
const char Option_t
Definition: External.C:48
Int_t GetNPtBins() const
Definition: AliRDHFCuts.h:239
TH1F ** fDLxy
!hist. for DLxy (topol+PID)
TH2F * fPtVsMassMinus
! hist. of pt vs. mass, D- candidates (topol+PID cuts)
const Int_t nbins
TH1F ** fSigVertHistLS
!hist. for LS cuts variable 4 (topol+PID)
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
Float_t GetStrangenessWeights(const AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC, Float_t factor[3]) const
Float_t fLowmasslimit
upper inv mass limit for histos
Int_t GetUseCentrality() const
Definition: AliRDHFCuts.h:270
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
TH1F * fHistNCandidates
! hist. for No. of candidates
Int_t PtBin(Double_t pt) const
Double_t DecayLength() const
TNtuple * fNtupleDplus
! output ntuple
Bool_t fStepMCAcc
flag to activate track variable cut studies
Int_t fNPtBins
lower inv mass limit for histos
Bool_t fUseQuarkTagInKine
flag to activate histos for StepMCAcc
Int_t nptbins
THnSparseF * fSparseCutVars[3]
! histograms for cut variation study
Int_t fNtrcklMax
minimum number of tracklets
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
TH1F ** fPtpi2Hist
!hist. for PtPi2 (topol+PID)