AliPhysics  vAN-20150810 (e477c3b)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
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 
35 #include "AliAnalysisManager.h"
37 #include "AliAODHandler.h"
38 #include "AliAODEvent.h"
39 #include "AliAODVertex.h"
40 #include "AliAODTrack.h"
42 #include "AliAnalysisVertexingHF.h"
43 #include "AliAnalysisTaskSE.h"
44 #include "AliAnalysisTaskSEDplus.h"
46 #include "AliVertexingHFUtils.h"
47 
51 
52 //________________________________________________________________________
54 AliAnalysisTaskSE(),
55  fOutput(0),
56  fHistNEvents(0),
57  fPtVsMass(0),
58  fPtVsMassTC(0),
59  fYVsPt(0),
60  fYVsPtTC(0),
61  fYVsPtSig(0),
62  fYVsPtSigTC(0),
63  fPhiEtaCand(0),
64  fPhiEtaCandSigReg(0),
65  fSPDMult(0),
66  fNtupleDplus(0),
67  fUpmasslimit(1.965),
68  fLowmasslimit(1.765),
69  fNPtBins(0),
70  fBinWidth(0.002),
71  fListCuts(0),
72  fRDCutsAnalysis(0),
73  fCounter(0),
74  fFillNtuple(kFALSE),
75  fReadMC(kFALSE),
76  fUseStrangeness(kFALSE),
77  fUseBit(kTRUE),
78  fCutsDistr(kFALSE),
79  fDoImpPar(kFALSE),
80  fNImpParBins(400),
81  fLowerImpPar(-1000.),
82  fHigherImpPar(1000.),
83  fDoLS(0),
84  fEtaSelection(0),
85  fSystem(0)
86 {
88 
89  for(Int_t i=0;i<3;i++){
90  fHistCentrality[i]=0;
91  fCorreld0Kd0pi[i]=0;
92  }
93 
94  for(Int_t i=0; i<5; i++)fHistMassPtImpParTC[i]=0;
95 
96 
97  for(Int_t i=0;i<3*kMaxPtBins;i++){
98  fMassHist[i]=0;
99  fCosPHist[i]=0;
100  fDLenHist[i]=0;
101  fSumd02Hist[i]=0;
102  fSigVertHist[i]=0;
103  fPtMaxHist[i]=0;
104  fPtKHist[i]=0;
105  fPtpi1Hist[i]=0;
106  fPtpi2Hist[i]=0;
107  fDCAHist[i]=0;
108  fMassHistTC[i]=0;
109  fMassHistTCPlus[i]=0;
110  fMassHistTCMinus[i]=0;
111 
112  fDLxy[i]=0;
113  fDLxyTC[i]=0;
114  fCosxy[i]=0;
115  fCosxyTC[i]=0;
116  fCosPHistLS[i]=0;
117  fDLenHistLS[i]=0;
118  fSumd02HistLS[i]=0;
119  fSigVertHistLS[i]=0;
120  fPtMaxHistLS[i]=0;
121  fDCAHistLS[i]=0;
122  }
123  for(Int_t i=0;i<5*kMaxPtBins;i++){
124  fMassHistLS[i]=0;
125  fMassHistLSTC[i]=0;
126  }
127  for(Int_t i=0;i<kMaxPtBins+1;i++){
128  fArrayBinLimits[i]=0;
129  }
130 
131 }
132 
133 //________________________________________________________________________
134 AliAnalysisTaskSEDplus::AliAnalysisTaskSEDplus(const char *name,AliRDHFCutsDplustoKpipi *dpluscutsana,Bool_t fillNtuple):
135  AliAnalysisTaskSE(name),
136  fOutput(0),
137  fHistNEvents(0),
138  fPtVsMass(0),
139  fPtVsMassTC(0),
140  fYVsPt(0),
141  fYVsPtTC(0),
142  fYVsPtSig(0),
143  fYVsPtSigTC(0),
144  fPhiEtaCand(0),
145  fPhiEtaCandSigReg(0),
146  fSPDMult(0),
147  fNtupleDplus(0),
148  fUpmasslimit(1.965),
149  fLowmasslimit(1.765),
150  fNPtBins(0),
151  fBinWidth(0.002),
152  fListCuts(0),
153  fRDCutsAnalysis(dpluscutsana),
154  fCounter(0),
155  fFillNtuple(fillNtuple),
156  fReadMC(kFALSE),
157  fUseStrangeness(kFALSE),
158  fUseBit(kTRUE),
159  fCutsDistr(kFALSE),
160  fDoImpPar(kFALSE),
161  fNImpParBins(400),
162  fLowerImpPar(-1000.),
163  fHigherImpPar(1000.),
164  fDoLS(0),
165  fEtaSelection(0),
166  fSystem(0)
167 {
168  //
170  //
172 
173  for(Int_t i=0;i<3;i++){
174  fHistCentrality[i]=0;
175  fCorreld0Kd0pi[i]=0;
176  }
177 
178  for(Int_t i=0; i<5; i++)fHistMassPtImpParTC[i]=0;
179 
180  for(Int_t i=0;i<3*kMaxPtBins;i++){
181  fMassHist[i]=0;
182  fCosPHist[i]=0;
183  fDLenHist[i]=0;
184  fSumd02Hist[i]=0;
185  fSigVertHist[i]=0;
186  fPtMaxHist[i]=0;
187  fPtKHist[i]=0;
188  fPtpi1Hist[i]=0;
189  fPtpi2Hist[i]=0;
190  fDCAHist[i]=0;
191  fMassHistTC[i]=0;
192  fMassHistTCPlus[i]=0;
193  fMassHistTCMinus[i]=0;
194 
195  fDLxy[i]=0;
196  fDLxyTC[i]=0;
197  fCosxy[i]=0;
198  fCosxyTC[i]=0;
199  fCosPHistLS[i]=0;
200  fDLenHistLS[i]=0;
201  fSumd02HistLS[i]=0;
202  fSigVertHistLS[i]=0;
203  fPtMaxHistLS[i]=0;
204  fDCAHistLS[i]=0;
205  }
206  for(Int_t i=0;i<5*kMaxPtBins;i++){
207  fMassHistLS[i]=0;
208  fMassHistLSTC[i]=0;
209  }
210  for(Int_t i=0;i<kMaxPtBins+1;i++){
211  fArrayBinLimits[i]=0;
212  }
213 
214 
215  // Default constructor
216  // Output slot #1 writes into a TList container
217  DefineOutput(1,TList::Class()); //My private output
218  // Output slot #2 writes cut to private output
219  // DefineOutput(2,AliRDHFCutsDplustoKpipi::Class());
220  DefineOutput(2,TList::Class());
221  // Output slot #3 writes cut to private output
222  DefineOutput(3,AliNormalizationCounter::Class());
223 
224  if(fFillNtuple){
225  // Output slot #4 writes into a TNtuple container
226  DefineOutput(4,TNtuple::Class()); //My private output
227  }
228 }
229 
230 //________________________________________________________________________
232 {
233  //
235  //
236  if(fOutput && !fOutput->IsOwner()){
237  delete fHistNEvents;
238  for(Int_t i=0;i<3*fNPtBins;i++){
239  delete fMassHist[i];
240  delete fCosPHist[i];
241  delete fDLenHist[i];
242  delete fSumd02Hist[i];
243  delete fSigVertHist[i];
244  delete fPtMaxHist[i];
245  delete fPtKHist[i];
246  delete fPtpi1Hist[i];
247  delete fPtpi2Hist[i];
248  delete fDCAHist[i];
249  delete fDLxy[i];
250  delete fDLxyTC[i];
251  delete fCosxy[i];
252  delete fCosxyTC[i];
253  delete fMassHistTC[i];
254  delete fMassHistTCPlus[i];
255  delete fMassHistTCMinus[i];
256  delete fCosPHistLS[i];
257  delete fDLenHistLS[i];
258  delete fSumd02HistLS[i];
259  delete fSigVertHistLS[i];
260  delete fPtMaxHistLS[i];
261  delete fDCAHistLS[i];
262  }
263  for(Int_t i=0;i<5*fNPtBins;i++){
264  delete fMassHistLS[i];
265  delete fMassHistLSTC[i];
266  }
267  for(Int_t i=0;i<3;i++){
268  delete fCorreld0Kd0pi[i];
269  delete fHistCentrality[i];
270  }
271  for(Int_t i=0;i<5;i++){
272  delete fHistMassPtImpParTC[i];
273  }
274  delete fPtVsMass;
275  delete fPtVsMassTC;
276  delete fYVsPt;
277  delete fYVsPtTC;
278  delete fYVsPtSig;
279  delete fYVsPtSigTC;
280  delete fPhiEtaCand;
281  delete fPhiEtaCandSigReg;
282  delete fSPDMult;
283  }
284 
285  delete fOutput;
286  delete fNtupleDplus;
287  delete fListCuts;
288  delete fRDCutsAnalysis;
289  delete fCounter;
290 
291 }
292 //_________________________________________________________________
295  Float_t bw=GetBinWidth();
296  fUpmasslimit = 1.865+range;
297  fLowmasslimit = 1.865-range;
298  SetBinWidth(bw);
299 }
300 //_________________________________________________________________
301 void AliAnalysisTaskSEDplus::SetMassLimits(Float_t lowlimit, Float_t uplimit){
303  if(uplimit>lowlimit)
304  {
305  Float_t bw=GetBinWidth();
306  fUpmasslimit = lowlimit;
307  fLowmasslimit = uplimit;
308  SetBinWidth(bw);
309  }
310 }
311 //________________________________________________________________
313  Float_t width=w;
314  Int_t nbins=(Int_t)((fUpmasslimit-fLowmasslimit)/width+0.5);
315  Int_t missingbins=4-nbins%4;
316  nbins=nbins+missingbins;
317  width=(fUpmasslimit-fLowmasslimit)/nbins;
318  if(missingbins!=0){
319  printf("AliAnalysisTaskSEDplus::SetBinWidth: W-bin width of %f will produce histograms not rebinnable by 4. New width set to %f\n",w,width);
320  }
321  else{
322  if(fDebug>1) printf("AliAnalysisTaskSEDplus::SetBinWidth: width set to %f\n",width);
323  }
324  fBinWidth=width;
325 }
326 //_________________________________________________________________
328  return (Int_t)((fUpmasslimit-fLowmasslimit)/fBinWidth+0.5);
329 }
330 //_________________________________________________________________
331 void AliAnalysisTaskSEDplus::LSAnalysis(TClonesArray *arrayOppositeSign,TClonesArray *arrayLikeSign,AliAODEvent *aod,AliAODVertex *vtx1, Int_t nDplusOS){
332  //
333  //
335  //
336  if(fDebug>1)printf("started LS\n");
337 
338  //histograms for like sign
339  Int_t nbins=GetNBinsHistos();;
340  TH1F *histLSPlus = new TH1F("LSPlus","LSPlus",nbins,fLowmasslimit,fUpmasslimit);
341  TH1F *histLSMinus = new TH1F("LSMinus","LSMinus",nbins,fLowmasslimit,fUpmasslimit);
342 
343  Int_t nPosTrks=0,nNegTrks=0;
344  Int_t nOStriplets = arrayOppositeSign->GetEntriesFast();
345  Int_t nDplusLS=0;
346  Int_t nDminusLS=0;
347  Int_t nLikeSign = arrayLikeSign->GetEntriesFast();
348  Int_t index=0;
349 
350  // loop over like sign candidates
351  for(Int_t iLikeSign = 0; iLikeSign < nLikeSign; iLikeSign++) {
352  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)arrayLikeSign->UncheckedAt(iLikeSign);
353  if(fUseBit && !d->HasSelectionBit(AliRDHFCuts::kDplusCuts))continue;
354  Bool_t unsetvtx=kFALSE;
355  if(!d->GetOwnPrimaryVtx()) {
356  d->SetOwnPrimaryVtx(vtx1); // needed to compute all variables
357  unsetvtx=kTRUE;
358  }
359  Double_t ptCand = d->Pt();
360  Int_t iPtBin = fRDCutsAnalysis->PtBin(ptCand);
361  if(iPtBin<0)continue;
362  Int_t sign= d->GetCharge();
363  if(sign>0){
364  nPosTrks++;
365  }else{
366  nNegTrks++;
367  }
369  Int_t passTightCuts=fRDCutsAnalysis->GetIsSelectedCuts();
370  if(passTightCuts>0){
371  Float_t invMass = d->InvMassDplus();
372  index=GetLSHistoIndex(iPtBin);
373  fMassHistLS[index+1]->Fill(invMass);
374  if(sign>0){
375  histLSPlus->Fill(invMass);
376  nDplusLS++;
377  }else{
378  histLSMinus->Fill(invMass);
379  nDminusLS++;
380  }
381  if(fCutsDistr){
382  Double_t dlen=d->DecayLength();
383  Double_t cosp=d->CosPointingAngle();
384  Double_t sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
385  Double_t dca=d->GetDCA();
386  Double_t sigvert=d->GetSigmaVert();
387  Double_t ptmax=0;
388  for(Int_t i=0;i<3;i++){
389  if(d->PtProng(i)>ptmax)ptmax=d->PtProng(i);
390  }
391  fCosPHistLS[iPtBin]->Fill(cosp);
392  fDLenHistLS[iPtBin]->Fill(dlen);
393  fSumd02HistLS[iPtBin]->Fill(sumD02);
394  fSigVertHistLS[iPtBin]->Fill(sigvert);
395  fPtMaxHistLS[iPtBin]->Fill(ptmax);
396  fDCAHistLS[iPtBin]->Fill(dca);
397  }
398  }
399  if(unsetvtx) d->UnsetOwnPrimaryVtx();
400  }
401  //wei:normalized to the number of combinations (production)
402  //wei2:normalized to the number of LS/OS (production)
403  //wei3:normalized to the number of LS/OS (analysis)
404  //wei4:normalized to the number of combinations (analysis)
405  Float_t wei2=0;
406  if(nLikeSign!=0)wei2 = (Float_t)nOStriplets/(Float_t)nLikeSign;
407  Float_t wei3=0;
408  if(nDplusLS!=0)wei3 = (Float_t)nDplusOS/(Float_t)(nDplusLS+nDminusLS);
409  Float_t weiplus=1.,weiminus=1.;
410  Float_t wei4plus=1.,wei4minus=1.;
411  //wei* should be automatically protected, since to get a triplet there must be at least 3 good tracks in the event
412  if(nPosTrks>2)weiplus=3.*(Float_t)nNegTrks/((Float_t)nPosTrks-2.);
413  if(nDplusLS>2)wei4plus=3.*(Float_t)nDminusLS/((Float_t)nDplusLS-2.);
414  if(nNegTrks>2)weiminus=3.*(Float_t)nPosTrks/((Float_t)nNegTrks-2.);
415  if(nDminusLS>2)wei4minus=3.*(Float_t)nDplusLS/((Float_t)nDminusLS-2.);
416 
417  fMassHistLS[index]->Add(histLSPlus,weiplus);
418  fMassHistLS[index]->Add(histLSMinus,weiminus);
419  fMassHistLS[index+2]->Add(histLSPlus,wei2);
420  fMassHistLS[index+2]->Add(histLSMinus,wei2);
421  fMassHistLS[index+3]->Add(histLSPlus,wei3);
422  fMassHistLS[index+3]->Add(histLSMinus,wei3);
423  fMassHistLS[index+4]->Add(histLSPlus,wei4plus);
424  fMassHistLS[index+4]->Add(histLSMinus,wei4minus);
425 
426  delete histLSPlus;histLSPlus=0;
427  delete histLSMinus;histLSMinus=0;
428 
429  if(fDebug>1) printf("LS analysis terminated\n");
430 }
431 
432 //__________________________________________
434  //
436  //
437  if(fDebug > 1) printf("AnalysisTaskSEDplus::Init() \n");
438 
439  //PostData(2,fRDCutsloose);//we should then put those cuts in a tlist if we have more than 1
440  fListCuts=new TList();
441  fListCuts->SetOwner();
443  analysis->SetName("AnalysisCuts");
444 
445  fListCuts->Add(analysis);
446  PostData(2,fListCuts);
447 
448  return;
449 }
450 
451 //________________________________________________________________________
453 {
455  //
456  if(fDebug > 1) printf("AnalysisTaskSEDplus::UserCreateOutputObjects() \n");
457 
458  // Several histograms are more conveniently managed in a TList
459  fOutput = new TList();
460  fOutput->SetOwner();
461  fOutput->SetName("OutputHistos");
462 
463  fHistNEvents = new TH1F("fHistNEvents", "number of events ",11,-0.5,10.5);
464  fHistNEvents->GetXaxis()->SetBinLabel(1,"nEventsAnal");
465  fHistNEvents->GetXaxis()->SetBinLabel(2,"nEvents accepted");
466  fHistNEvents->GetXaxis()->SetBinLabel(3,"Rejected due to trigger");
467  fHistNEvents->GetXaxis()->SetBinLabel(4,"Rejected pileup events");
468  fHistNEvents->GetXaxis()->SetBinLabel(5,"Rejected due to centrality");
469  fHistNEvents->GetXaxis()->SetBinLabel(6,"Rejected due to vtxz");
470  fHistNEvents->GetXaxis()->SetBinLabel(7,"Rejected due to Physics Sel");
471  fHistNEvents->GetXaxis()->SetBinLabel(8,"Total no. of candidate");
472  fHistNEvents->GetXaxis()->SetBinLabel(9,"no. of cand wo bitmask");
473  fHistNEvents->GetXaxis()->SetBinLabel(10,"D+ after loose cuts");
474  fHistNEvents->GetXaxis()->SetBinLabel(11,"D+ after tight cuts");
475 
476  fHistNEvents->GetXaxis()->SetNdivisions(1,kFALSE);
477  fHistNEvents->Sumw2();
478  fHistNEvents->SetMinimum(0);
479  fOutput->Add(fHistNEvents);
480 
481  TString hisname;
482  Int_t index=0;
483  Int_t nbins=GetNBinsHistos();
484  fHistCentrality[0]=new TH2F("hCentrMult","centrality",100,0.5,30000.5,40,0.,100.);
485  fHistCentrality[1]=new TH2F("hCentrMult(selectedCent)","centrality(selectedCent)",100,0.5,30000.5,40,0.,100.);
486  fHistCentrality[2]=new TH2F("hCentrMult(OutofCent)","centrality(OutofCent)",100,0.5,30000.5,40,0.,100.);
487  for(Int_t i=0;i<3;i++){
488  fHistCentrality[i]->Sumw2();
489  fOutput->Add(fHistCentrality[i]);
490  }
491  for(Int_t i=0;i<fNPtBins;i++){
492 
493  index=GetHistoIndex(i);
494 
495  hisname.Form("hMassPt%d",i);
496  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
497  fMassHist[index]->Sumw2();
498  hisname.Form("hCosPAllPt%d",i);
499  fCosPHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
500  fCosPHist[index]->Sumw2();
501  hisname.Form("hDLenAllPt%d",i);
502  fDLenHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
503  fDLenHist[index]->Sumw2();
504  hisname.Form("hSumd02AllPt%d",i);
505  fSumd02Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
506  fSumd02Hist[index]->Sumw2();
507  hisname.Form("hSigVertAllPt%d",i);
508  fSigVertHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
509  fSigVertHist[index]->Sumw2();
510  hisname.Form("hPtMaxAllPt%d",i);
511  fPtMaxHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
512  fPtMaxHist[index]->Sumw2();
513  hisname.Form("hPtKPt%d",i);
514  fPtKHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
515  fPtKHist[index]->Sumw2();
516  hisname.Form("hPtpi1Pt%d",i);
517  fPtpi1Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
518  fPtpi1Hist[index]->Sumw2();
519  hisname.Form("hPtpi2Pt%d",i);
520  fPtpi2Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
521  fPtpi2Hist[index]->Sumw2();
522  hisname.Form("hDCAAllPt%d",i);
523  fDCAHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
524  fDCAHist[index]->Sumw2();
525 
526  hisname.Form("hDLxyPt%d",i);
527  fDLxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
528  fDLxy[index]->Sumw2();
529  hisname.Form("hCosxyPt%d",i);
530  fCosxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
531  fCosxy[index]->Sumw2();
532  hisname.Form("hDLxyPt%dTC",i);
533  fDLxyTC[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
534  fDLxyTC[index]->Sumw2();
535  hisname.Form("hCosxyPt%dTC",i);
536  fCosxyTC[index]=new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
537  fCosxyTC[index]->Sumw2();
538 
539  hisname.Form("hMassPt%dTC",i);
540  fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
541  fMassHistTC[index]->Sumw2();
542  hisname.Form("hMassPt%dTCPlus",i);
543  fMassHistTCPlus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
544  fMassHistTCPlus[index]->Sumw2();
545  hisname.Form("hMassPt%dTCMinus",i);
546  fMassHistTCMinus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
547  fMassHistTCMinus[index]->Sumw2();
548 
549 
550 
551  index=GetSignalHistoIndex(i);
552  hisname.Form("hSigPt%d",i);
553  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
554  fMassHist[index]->Sumw2();
555  hisname.Form("hCosPSigPt%d",i);
556  fCosPHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
557  fCosPHist[index]->Sumw2();
558  hisname.Form("hDLenSigPt%d",i);
559  fDLenHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
560  fDLenHist[index]->Sumw2();
561  hisname.Form("hSumd02SigPt%d",i);
562  fSumd02Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
563  fSumd02Hist[index]->Sumw2();
564  hisname.Form("hSigVertSigPt%d",i);
565  fSigVertHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
566  fSigVertHist[index]->Sumw2();
567  hisname.Form("hPtMaxSigPt%d",i);
568  fPtMaxHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
569  fPtMaxHist[index]->Sumw2();
570  hisname.Form("hPtKSigPt%d",i);
571  fPtKHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
572  fPtKHist[index]->Sumw2();
573  hisname.Form("hPtpi1SigPt%d",i);
574  fPtpi1Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
575  fPtpi1Hist[index]->Sumw2();
576  hisname.Form("hPtpi2SigPt%d",i);
577  fPtpi2Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
578  fPtpi2Hist[index]->Sumw2();
579 
580  hisname.Form("hDCASigPt%d",i);
581  fDCAHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
582  fDCAHist[index]->Sumw2();
583 
584  hisname.Form("hDLxySigPt%d",i);
585  fDLxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
586  fDLxy[index]->Sumw2();
587  hisname.Form("hCosxySigPt%d",i);
588  fCosxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
589  fCosxy[index]->Sumw2();
590  hisname.Form("hDLxySigPt%dTC",i);
591  fDLxyTC[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
592  fDLxyTC[index]->Sumw2();
593  hisname.Form("hCosxySigPt%dTC",i);
594  fCosxyTC[index]=new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
595  fCosxyTC[index]->Sumw2();
596  hisname.Form("hSigPt%dTC",i);
597  fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
598  fMassHistTC[index]->Sumw2();
599  hisname.Form("hSigPt%dTCPlus",i);
600  fMassHistTCPlus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
601  fMassHistTCPlus[index]->Sumw2();
602  hisname.Form("hSigPt%dTCMinus",i);
603  fMassHistTCMinus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
604  fMassHistTCMinus[index]->Sumw2();
605 
606 
607  index=GetBackgroundHistoIndex(i);
608  hisname.Form("hBkgPt%d",i);
609  fMassHist[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
610  fMassHist[index]->Sumw2();
611  hisname.Form("hCosPBkgPt%d",i);
612  fCosPHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
613  fCosPHist[index]->Sumw2();
614  hisname.Form("hDLenBkgPt%d",i);
615  fDLenHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
616  fDLenHist[index]->Sumw2();
617  hisname.Form("hSumd02BkgPt%d",i);
618  fSumd02Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
619  fSumd02Hist[index]->Sumw2();
620  hisname.Form("hSigVertBkgPt%d",i);
621  fSigVertHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
622  fSigVertHist[index]->Sumw2();
623  hisname.Form("hPtMaxBkgPt%d",i);
624  fPtMaxHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
625  fPtMaxHist[index]->Sumw2();
626  hisname.Form("hPtKBkgPt%d",i);
627  fPtKHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
628  fPtKHist[index]->Sumw2();
629  hisname.Form("hPtpi1BkgPt%d",i);
630  fPtpi1Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
631  fPtpi1Hist[index]->Sumw2();
632  hisname.Form("hPtpi2BkgPt%d",i);
633  fPtpi2Hist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
634  fPtpi2Hist[index]->Sumw2();
635  hisname.Form("hDCABkgPt%d",i);
636  fDCAHist[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
637  fDCAHist[index]->Sumw2();
638 
639  hisname.Form("hDLxyBkgPt%d",i);
640  fDLxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
641  fDLxy[index]->Sumw2();
642  hisname.Form("hCosxyBkgPt%d",i);
643  fCosxy[index]=new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
644  fCosxy[index]->Sumw2();
645  hisname.Form("hDLxyBkgPt%dTC",i);
646  fDLxyTC[index]=new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
647  fDLxyTC[index]->Sumw2();
648  hisname.Form("hCosxyBkgPt%dTC",i);
649  fCosxyTC[index]=new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
650  fCosxyTC[index]->Sumw2();
651 
652 
653  hisname.Form("hBkgPt%dTC",i);
654  fMassHistTC[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
655  fMassHistTC[index]->Sumw2();
656  hisname.Form("hBkgPt%dTCPlus",i);
657  fMassHistTCPlus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
658  fMassHistTCPlus[index]->Sumw2();
659  hisname.Form("hBkgPt%dTCMinus",i);
660  fMassHistTCMinus[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
661  fMassHistTCMinus[index]->Sumw2();
662  }
663 
664 
665  for(Int_t i=0; i<3*fNPtBins; i++){
666  fOutput->Add(fMassHist[i]);
667  if(fCutsDistr){
668  fOutput->Add(fCosPHist[i]);
669  fOutput->Add(fDLenHist[i]);
670  fOutput->Add(fSumd02Hist[i]);
671  fOutput->Add(fSigVertHist[i]);
672  fOutput->Add(fPtMaxHist[i]);
673  fOutput->Add(fPtKHist[i]);
674  fOutput->Add(fPtpi1Hist[i]);
675  fOutput->Add(fPtpi2Hist[i]);
676  fOutput->Add(fDCAHist[i]);
677  fOutput->Add(fDLxy[i]);
678  fOutput->Add(fDLxyTC[i]);
679  fOutput->Add(fCosxy[i]);
680  fOutput->Add(fCosxyTC[i]);
681  }
682  fOutput->Add(fMassHistTC[i]);
683  fOutput->Add(fMassHistTCPlus[i]);
684  fOutput->Add(fMassHistTCMinus[i]);
685 
686  }
687 
688  fCorreld0Kd0pi[0]=new TH2F("hCorreld0Kd0piAll","",100,-0.02,0.02,100,-0.02,0.02);
689  fCorreld0Kd0pi[1]=new TH2F("hCorreld0Kd0piSig","",100,-0.02,0.02,100,-0.02,0.02);
690  fCorreld0Kd0pi[2]=new TH2F("hCorreld0Kd0piBkg","",100,-0.02,0.02,100,-0.02,0.02);
691  if(fCutsDistr){
692  for(Int_t i=0; i<3; i++){
693  fCorreld0Kd0pi[i]->Sumw2();
694  fOutput->Add(fCorreld0Kd0pi[i]);
695  }
696  }
697 
698 
699  fPtVsMass=new TH2F("hPtVsMass","PtVsMass (prod. cuts)",nbins,fLowmasslimit,fUpmasslimit,200,0.,20.);
700  fPtVsMassTC=new TH2F("hPtVsMassTC","PtVsMass (analysis cuts)",nbins,fLowmasslimit,fUpmasslimit,200,0.,20.);
701  fYVsPt=new TH3F("hYVsPt","YvsPt (prod. cuts)",40,0.,20.,80,-2.,2.,nbins,fLowmasslimit,fUpmasslimit);
702  fYVsPtTC=new TH3F("hYVsPtTC","YvsPt (analysis cuts)",40,0.,20.,80,-2.,2.,nbins,fLowmasslimit,fUpmasslimit);
703  fYVsPtSig=new TH2F("hYVsPtSig","YvsPt (MC, only sig., prod. cuts)",40,0.,20.,80,-2.,2.);
704  fYVsPtSigTC=new TH2F("hYVsPtSigTC","YvsPt (MC, only Sig, analysis cuts)",40,0.,20.,80,-2.,2.);
705  fPhiEtaCand=new TH2F("hPhiEtaCand","phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
706  fPhiEtaCandSigReg=new TH2F("hPhiEtaCandSigReg","phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
707  fSPDMult = new TH1F("hSPDMult", "Tracklets multiplicity; Tracklets ; Entries",200,0.,200.);
708  fOutput->Add(fPtVsMass);
709  fOutput->Add(fPtVsMassTC);
710  fOutput->Add(fYVsPt);
711  fOutput->Add(fYVsPtTC);
712  fOutput->Add(fYVsPtSig);
713  fOutput->Add(fYVsPtSigTC);
714  fOutput->Add(fPhiEtaCand);
716  fOutput->Add(fSPDMult);
717 
718 
719  //Counter for Normalization
720  TString normName="NormalizationCounter";
721  AliAnalysisDataContainer *cont = GetOutputSlot(3)->GetContainer();
722  if(cont)normName=(TString)cont->GetName();
723  fCounter = new AliNormalizationCounter(normName.Data());
724  fCounter->Init();
725 
728 
729  if(fFillNtuple){
730  OpenFile(4); // 4 is the slot number of the ntuple
731 
732 
733  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");
734 
735  }
736 
737  return;
738 }
739 
740 //________________________________________________________________________
741 void AliAnalysisTaskSEDplus::UserExec(Option_t */*option*/)
742 {
745 
746  AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
747 
748  TClonesArray *array3Prong = 0;
749  TClonesArray *arrayLikeSign =0;
750  if(!aod && AODEvent() && IsStandardAOD()) {
751  // In case there is an AOD handler writing a standard AOD, use the AOD
752  // event in memory rather than the input (ESD) event.
753  aod = dynamic_cast<AliAODEvent*> (AODEvent());
754  // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
755  // have to taken from the AOD event hold by the AliAODExtension
756  AliAODHandler* aodHandler = (AliAODHandler*)
757  ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
758  if(aodHandler->GetExtensions()) {
759  AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
760  AliAODEvent *aodFromExt = ext->GetAOD();
761  array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
762  arrayLikeSign=(TClonesArray*)aodFromExt->GetList()->FindObject("LikeSign3Prong");
763  }
764  } else if(aod) {
765  array3Prong=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
766  arrayLikeSign=(TClonesArray*)aod->GetList()->FindObject("LikeSign3Prong");
767  }
768 
769  if(!aod || !array3Prong) {
770  printf("AliAnalysisTaskSEDplus::UserExec: Charm3Prong branch not found!\n");
771  return;
772  }
773  if(!arrayLikeSign && fDoLS) {
774  printf("AliAnalysisTaskSEDplus::UserExec: LikeSign3Prong branch not found!\n");
775  return;
776  }
777 
778  // fix for temporary bug in ESDfilter
779  // the AODs with null vertex pointer didn't pass the PhysSel
780  if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001) return;
781 
782  //Store the event in AliNormalizationCounter->To disable for Pb-Pb? Add a flag to disable it?
784 
785  fHistNEvents->Fill(0); // count event
786  Int_t runNumber=aod->GetRunNumber();
787 
788  //Event selection
789  Bool_t isEvSel=fRDCutsAnalysis->IsEventSelected(aod);
790  Float_t ntracks=aod->GetNumberOfTracks();
791  Float_t evCentr=0;
793  fHistCentrality[0]->Fill(ntracks,evCentr);
794  if(fRDCutsAnalysis->GetWhyRejection()==5) fHistNEvents->Fill(2);
795  if(fRDCutsAnalysis->GetWhyRejection()==1) fHistNEvents->Fill(3);
796  if(fRDCutsAnalysis->GetWhyRejection()==2){fHistNEvents->Fill(4);fHistCentrality[2]->Fill(ntracks,evCentr);}
797  if(fRDCutsAnalysis->GetWhyRejection()==6)fHistNEvents->Fill(5);
798  if(fRDCutsAnalysis->GetWhyRejection()==7)fHistNEvents->Fill(6);
799 
800  // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD
801  //TString trigclass=aod->GetFiredTriggerClasses();
802  // Post the data already here
803  PostData(1,fOutput);
804  if(!isEvSel)return;
805  Int_t tracklets=AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.);
806  // printf("ntracklet===%d\n",tracklets);
807  fSPDMult->Fill(tracklets);
808 
809  fHistCentrality[1]->Fill(ntracks,evCentr);
810  fHistNEvents->Fill(1);
811 
812  TClonesArray *arrayMC=0;
813  AliAODMCHeader *mcHeader=0;
814 
815  // AOD primary vertex
816  AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
817  // vtx1->Print();
818  // TString primTitle = vtx1->GetTitle();
819  //if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0)fHistNEvents->Fill(2);
820 
821  // load MC particles
822  if(fReadMC){
823  arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
824  if(!arrayMC) {
825  printf("AliAnalysisTaskSEDplus::UserExec: MC particles branch not found!\n");
826  return;
827  }
828 
829  // load MC header
830  mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
831  if(!mcHeader) {
832  printf("AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
833  return;
834  }
835  }
836 
837  Int_t n3Prong = array3Prong->GetEntriesFast();
838  // printf("Number of D+->Kpipi: %d and of tracks: %d\n",n3Prong,aod->GetNumberOfTracks());
839 
840  Int_t nOS=0;
841  Int_t index;
842  Int_t pdgDgDplustoKpipi[3]={321,211,211};
843 
844  if(fDoLS>1){//Normalizations for LS
845  for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
846  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)array3Prong->UncheckedAt(i3Prong);
849  }
850  }
851  }else{//Standard analysis
852  // 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
853  //Double_t *cutsDplus = new (Double_t*)fRDCuts->GetCuts();
854  Int_t nSelectedloose=0,nSelectedtight=0;
855  for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
856  AliAODRecoDecayHF3Prong *d = (AliAODRecoDecayHF3Prong*)array3Prong->UncheckedAt(i3Prong);
857  fHistNEvents->Fill(7);
859  fHistNEvents->Fill(8);
860  continue;
861  }
862 
863  Int_t passTightCuts=fRDCutsAnalysis->IsSelected(d,AliRDHFCuts::kAll,aod);
864 
865  if(!fRDCutsAnalysis->GetIsSelectedCuts()) continue;
866 
867  Double_t etaD=d->Eta();
868  Double_t phiD=d->Phi();
869  if(fEtaSelection!=0){
870  if(fEtaSelection==1 && etaD<0) continue;
871  if(fEtaSelection==-1 && etaD>0) continue;
872  }
873 
874  Bool_t unsetvtx=kFALSE;
875  if(!d->GetOwnPrimaryVtx()){
876  d->SetOwnPrimaryVtx(vtx1);
877  unsetvtx=kTRUE;
878  }
879 
880  Double_t ptCand = d->Pt();
881  Int_t iPtBin = fRDCutsAnalysis->PtBin(ptCand);
882 
883  Bool_t recVtx=kFALSE;
884  AliAODVertex *origownvtx=0x0;
886  if(d->GetOwnPrimaryVtx()) origownvtx=new AliAODVertex(*d->GetOwnPrimaryVtx());
887  if(fRDCutsAnalysis->RecalcOwnPrimaryVtx(d,aod))recVtx=kTRUE;
888  else fRDCutsAnalysis->CleanOwnPrimaryVtx(d,aod,origownvtx);
889  }
890 
891  Int_t labDp=-1;
892  Bool_t isPrimary=kTRUE;
893  Float_t pdgCode=-2;
894  Float_t trueImpParXY=0.;
895  if(fReadMC){
896  labDp = d->MatchToMC(411,arrayMC,3,pdgDgDplustoKpipi);
897  if(labDp>=0){
898  AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
899  if(AliVertexingHFUtils::CheckOrigin(arrayMC,partDp,kFALSE)==5) isPrimary=kFALSE;
900  pdgCode=TMath::Abs(partDp->GetPdgCode());
901  if(!isPrimary){
902  trueImpParXY=GetTrueImpactParameter(mcHeader,arrayMC,partDp)*10000.;
903  }
904  }else{
905  pdgCode=-1;
906  }
907  }
908 
909  Double_t invMass=d->InvMassDplus();
910  Double_t rapid=d->YDplus();
911  fYVsPt->Fill(ptCand,rapid,invMass);
912  if(passTightCuts) {fYVsPtTC->Fill(ptCand,rapid,invMass);nOS++;}
913  Bool_t isFidAcc=fRDCutsAnalysis->IsInFiducialAcceptance(ptCand,rapid);
914  if(isFidAcc){
915  fPtVsMass->Fill(invMass,ptCand);
916  if(passTightCuts){
917  fPtVsMassTC->Fill(invMass,ptCand);
918  fPhiEtaCand->Fill(etaD,phiD);
919  if(TMath::Abs(invMass-1.8696)<0.05) fPhiEtaCandSigReg->Fill(etaD,phiD);
920  }
921  }
922 
923 
924  Double_t dlen=0,cosp=0,maxdca=0,sigvert=0,sumD02=0,ptmax=0,dlxy=0,cxy=0;
926  dlen=d->DecayLength();
927  cosp=d->CosPointingAngle();
928  sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
929  maxdca=-9999.;
930  for(Int_t idau=0;idau<3;idau++) if(d->GetDCA(idau)>maxdca) maxdca=d->GetDCA(idau);
931  sigvert=d->GetSigmaVert();
932  ptmax=0;
933  for(Int_t i=0;i<3;i++){
934  if(d->PtProng(i)>ptmax)ptmax=d->PtProng(i);
935  }
936  dlxy=d->NormalizedDecayLengthXY();
937  cxy=d->CosPointingAngleXY();
938  }
939  Double_t impparXY=d->ImpParXY()*10000.;
940  Double_t arrayForSparse[6]={invMass,ptCand,impparXY,cosp,dlen,static_cast<Double_t>(tracklets)};
941  Double_t arrayForSparseTrue[6]={invMass,ptCand,trueImpParXY,cosp,dlen,static_cast<Double_t>(tracklets)};
942 
943  //Ntuple
944  Float_t tmp[31];
945  if(fFillNtuple){
946  tmp[0]=pdgCode;
947  if(!isPrimary) tmp[0]+=5000.;
948  tmp[1]=d->Px();
949  tmp[2]=d->Py();
950  tmp[3]=d->Pz();
951  tmp[4]=d->Pt();
952  tmp[5]=d->GetCharge();
953  // tmp[5]=fRDCutsAnalysis->GetPIDBitMask(d);
954  tmp[6]=fRDCutsAnalysis->GetPIDTrackTPCTOFBitMap((AliAODTrack*)d->GetDaughter(0));
955  tmp[7]=fRDCutsAnalysis->GetPIDTrackTPCTOFBitMap((AliAODTrack*)d->GetDaughter(1));
956  tmp[8]=fRDCutsAnalysis->GetPIDTrackTPCTOFBitMap((AliAODTrack*)d->GetDaughter(2));
957  tmp[9]=d->PtProng(0);
958  tmp[10]=d->PtProng(1);
959  tmp[11]=d->PtProng(2);
960  tmp[12]=d->PProng(0);
961  tmp[13]=d->PProng(1);
962  tmp[14]=d->PProng(2);
963  tmp[15]=cosp;
964  tmp[16]=cxy;
965  tmp[17]=dlen;
966  tmp[18]=d->NormalizedDecayLength();
967  tmp[19]=d->DecayLengthXY();
968  tmp[20]=dlxy;
969  tmp[21]=d->InvMassDplus();
970  tmp[22]=sigvert;
971  tmp[23]=d->Getd0Prong(0);
972  tmp[24]=d->Getd0Prong(1);
973  tmp[25]=d->Getd0Prong(2);
974  tmp[26]=maxdca;
975  tmp[27]=ntracks;
976  tmp[28]=fRDCutsAnalysis->GetCentrality(aod);
977  tmp[29]=runNumber;
978  tmp[30]=d->HasBadDaughters();
979  fNtupleDplus->Fill(tmp);
980  PostData(4,fNtupleDplus);
981  }
982 
983  //Fill histos
984  index=GetHistoIndex(iPtBin);
985  if(isFidAcc){
986  fHistNEvents->Fill(9);
987  nSelectedloose++;
988  fMassHist[index]->Fill(invMass);
989  if(fCutsDistr){
990  fCosPHist[index]->Fill(cosp);
991  fDLenHist[index]->Fill(dlen);
992  fSumd02Hist[index]->Fill(sumD02);
993  fSigVertHist[index]->Fill(sigvert);
994  fPtMaxHist[index]->Fill(ptmax);
995  fPtKHist[index]->Fill(d->PtProng(1));
996  fPtpi1Hist[index]->Fill(d->PtProng(0));
997  fPtpi2Hist[index]->Fill(d->PtProng(2));
998  fDCAHist[index]->Fill(maxdca);
999  fDLxy[index]->Fill(dlxy);
1000  fCosxy[index]->Fill(cxy);
1001  fCorreld0Kd0pi[0]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),
1002  d->Getd0Prong(2)*d->Getd0Prong(1));
1003  }
1004  if(passTightCuts){
1005  fHistNEvents->Fill(10);
1006  nSelectedtight++;
1007  fMassHistTC[index]->Fill(invMass);
1008  if(fCutsDistr){
1009  fDLxyTC[index]->Fill(dlxy);
1010  fCosxyTC[index]->Fill(cxy);
1011  }
1012  if(d->GetCharge()>0) fMassHistTCPlus[index]->Fill(invMass);
1013  else if(d->GetCharge()<0) fMassHistTCMinus[index]->Fill(invMass);
1014  if(fDoImpPar){
1015  fHistMassPtImpParTC[0]->Fill(arrayForSparse);
1016  }
1017  }
1018  }
1019 
1020  if(fReadMC){
1021  if(isFidAcc){
1022  if(labDp>=0) {
1023  index=GetSignalHistoIndex(iPtBin);
1024  if(passTightCuts&&fDoImpPar){
1025  if(isPrimary) fHistMassPtImpParTC[1]->Fill(arrayForSparse);
1026  else{
1027  fHistMassPtImpParTC[2]->Fill(arrayForSparse);
1028  fHistMassPtImpParTC[3]->Fill(arrayForSparseTrue);
1029  }
1030  }
1031  }else{
1032  index=GetBackgroundHistoIndex(iPtBin);
1033  if(passTightCuts&&fDoImpPar)fHistMassPtImpParTC[4]->Fill(arrayForSparse);
1034  }
1035 
1036  fMassHist[index]->Fill(invMass);
1037  if(fCutsDistr){
1038  Float_t fact=1.;
1039  Float_t factor[3]={1.,1.,1.};
1040  if(fUseStrangeness) fact=GetStrangenessWeights(d,arrayMC,factor);
1041  fCosPHist[index]->Fill(cosp,fact);
1042  fDLenHist[index]->Fill(dlen,fact);
1043  fDLxy[index]->Fill(dlxy);
1044  fCosxy[index]->Fill(cxy);
1045 
1046  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];
1047  fSumd02Hist[index]->Fill(sumd02s);
1048  fSigVertHist[index]->Fill(sigvert,fact);
1049  fPtMaxHist[index]->Fill(ptmax,fact);
1050  fPtKHist[index]->Fill(d->PtProng(1),fact);
1051  fPtpi1Hist[index]->Fill(d->PtProng(0),fact);
1052  fPtpi2Hist[index]->Fill(d->PtProng(2),fact);
1053  fDCAHist[index]->Fill(maxdca,fact);
1054  fCorreld0Kd0pi[1]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),
1055  d->Getd0Prong(2)*d->Getd0Prong(1));
1056  }
1057  if(passTightCuts){
1058  fMassHistTC[index]->Fill(invMass);
1059  if(fCutsDistr){
1060  fDLxyTC[index]->Fill(dlxy);
1061  fCosxyTC[index]->Fill(cxy);
1062  }
1063  if(d->GetCharge()>0) fMassHistTCPlus[index]->Fill(invMass);
1064  else if(d->GetCharge()<0) fMassHistTCMinus[index]->Fill(invMass);
1065  }
1066  }else{//outside fidAcc
1067  if(labDp>=0){
1068  fYVsPtSig->Fill(ptCand,rapid, invMass);
1069  if(passTightCuts)fYVsPtSigTC->Fill(ptCand,rapid, invMass);
1070  }
1071  }
1072  }//readmc
1073 
1074  if(recVtx)fRDCutsAnalysis->CleanOwnPrimaryVtx(d,aod,origownvtx);
1075 
1076  if(unsetvtx) d->UnsetOwnPrimaryVtx();
1077  }
1078  fCounter->StoreCandidates(aod,nSelectedloose,kTRUE);
1079  fCounter->StoreCandidates(aod,nSelectedtight,kFALSE);
1080  }
1081  //start LS analysis
1082  if(fDoLS && arrayLikeSign) LSAnalysis(array3Prong,arrayLikeSign,aod,vtx1,nOS);
1083 
1084  PostData(1,fOutput);
1085  PostData(2,fListCuts);
1086  PostData(3,fCounter);
1087  return;
1088 }
1089 
1090 //________________________________________________________________________
1093 
1094  TString hisname;
1095  Int_t indexLS=0;
1096  Int_t index=0;
1097  Int_t nbins=GetNBinsHistos();
1098  for(Int_t i=0;i<fNPtBins;i++){
1099 
1100  index=GetHistoIndex(i);
1101  indexLS=GetLSHistoIndex(i);
1102 
1103  hisname.Form("hLSPt%dLC",i);
1104  fMassHistLS[indexLS] = new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1105  fMassHistLS[indexLS]->Sumw2();
1106  hisname.Form("hLSPt%dTC",i);
1107  fMassHistLSTC[indexLS] = new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1108  fMassHistLSTC[indexLS]->Sumw2();
1109 
1110  hisname.Form("hCosPAllPt%dLS",i);
1111  fCosPHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,1.);
1112  fCosPHistLS[index]->Sumw2();
1113  hisname.Form("hDLenAllPt%dLS",i);
1114  fDLenHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.5);
1115  fDLenHistLS[index]->Sumw2();
1116  hisname.Form("hSumd02AllPt%dLS",i);
1117  fSumd02HistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,1.);
1118  fSumd02HistLS[index]->Sumw2();
1119  hisname.Form("hSigVertAllPt%dLS",i);
1120  fSigVertHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1121  fSigVertHistLS[index]->Sumw2();
1122  hisname.Form("hPtMaxAllPt%dLS",i);
1123  fPtMaxHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,5.);
1124  fPtMaxHistLS[index]->Sumw2();
1125  hisname.Form("hDCAAllPt%dLS",i);
1126  fDCAHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1127  fDCAHistLS[index]->Sumw2();
1128 
1129  index=GetSignalHistoIndex(i);
1130  indexLS++;
1131 
1132  hisname.Form("hLSPt%dLCnw",i);
1133  fMassHistLS[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1134  fMassHistLS[indexLS]->Sumw2();
1135  hisname.Form("hLSPt%dTCnw",i);
1136  fMassHistLSTC[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1137  fMassHistLSTC[indexLS]->Sumw2();
1138 
1139  hisname.Form("hCosPSigPt%dLS",i);
1140  fCosPHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,1.);
1141  fCosPHistLS[index]->Sumw2();
1142  hisname.Form("hDLenSigPt%dLS",i);
1143  fDLenHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.5);
1144  fDLenHistLS[index]->Sumw2();
1145  hisname.Form("hSumd02SigPt%dLS",i);
1146  fSumd02HistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,1.);
1147  fSumd02HistLS[index]->Sumw2();
1148  hisname.Form("hSigVertSigPt%dLS",i);
1149  fSigVertHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1150  fSigVertHistLS[index]->Sumw2();
1151  hisname.Form("hPtMaxSigPt%dLS",i);
1152  fPtMaxHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,5.);
1153  fPtMaxHistLS[index]->Sumw2();
1154  hisname.Form("hDCASigPt%dLS",i);
1155  fDCAHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1156  fDCAHistLS[index]->Sumw2();
1157 
1158  index=GetBackgroundHistoIndex(i);
1159  indexLS++;
1160 
1161  hisname.Form("hLSPt%dLCntrip",i);
1162  fMassHistLS[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1163  fMassHistLS[indexLS]->Sumw2();
1164  hisname.Form("hLSPt%dTCntrip",i);
1165  fMassHistLSTC[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1166  fMassHistLSTC[indexLS]->Sumw2();
1167 
1168  hisname.Form("hCosPBkgPt%dLS",i);
1169  fCosPHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,1.);
1170  fCosPHistLS[index]->Sumw2();
1171  hisname.Form("hDLenBkgPt%dLS",i);
1172  fDLenHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.5);
1173  fDLenHistLS[index]->Sumw2();
1174  hisname.Form("hSumd02BkgPt%dLS",i);
1175  fSumd02HistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,1.);
1176  fSumd02HistLS[index]->Sumw2();
1177  hisname.Form("hSigVertBkgPt%dLS",i);
1178  fSigVertHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1179  fSigVertHistLS[index]->Sumw2();
1180  hisname.Form("hPtMaxBkgPt%dLS",i);
1181  fPtMaxHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.5,5.);
1182  fPtMaxHistLS[index]->Sumw2();
1183  hisname.Form("hDCABkgPt%dLS",i);
1184  fDCAHistLS[index]=new TH1F(hisname.Data(),hisname.Data(),nbins,0.,0.1);
1185  fDCAHistLS[index]->Sumw2();
1186 
1187  indexLS++;
1188  hisname.Form("hLSPt%dLCntripsinglecut",i);
1189  fMassHistLS[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1190  fMassHistLS[indexLS]->Sumw2();
1191  hisname.Form("hLSPt%dTCntripsinglecut",i);
1192  fMassHistLSTC[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1193  fMassHistLSTC[indexLS]->Sumw2();
1194 
1195  indexLS++;
1196  hisname.Form("hLSPt%dLCspc",i);
1197  fMassHistLS[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1198  fMassHistLS[indexLS]->Sumw2();
1199  hisname.Form("hLSPt%dTCspc",i);
1200  fMassHistLSTC[indexLS]=new TH1F(hisname.Data(),hisname.Data(),nbins,fLowmasslimit,fUpmasslimit);
1201  fMassHistLSTC[indexLS]->Sumw2();
1202  }
1203 
1204  for(Int_t i=0; i<3*fNPtBins; i++){
1205  fOutput->Add(fCosPHistLS[i]);
1206  fOutput->Add(fDLenHistLS[i]);
1207  fOutput->Add(fSumd02HistLS[i]);
1208  fOutput->Add(fSigVertHistLS[i]);
1209  fOutput->Add(fPtMaxHistLS[i]);
1210  fOutput->Add(fDCAHistLS[i]);
1211  }
1212  for(Int_t i=0; i<5*fNPtBins; i++){
1213  fOutput->Add(fMassHistLS[i]);
1214  fOutput->Add(fMassHistLSTC[i]);
1215  }
1216 }
1217 
1218 //________________________________________________________________________
1221 
1222  Int_t nmassbins=GetNBinsHistos();
1223  Double_t maxmult;
1224  if(fSystem==1) maxmult=5000;
1225  else maxmult=200;
1226  Int_t nbins[6]={nmassbins,200,fNImpParBins,5,50,100};
1227  Double_t xmin[6]={fLowmasslimit,0.,fLowerImpPar,0.95,0.,-0.5};
1228  Double_t xmax[6]={fUpmasslimit,40.,fHigherImpPar,1.,1.,maxmult};
1229 
1230  fHistMassPtImpParTC[0]=new THnSparseF("hMassPtImpParAll",
1231  "Mass vs. pt vs.imppar - All",
1232  6,nbins,xmin,xmax);
1233  fHistMassPtImpParTC[1]=new THnSparseF("hMassPtImpParPrompt",
1234  "Mass vs. pt vs.imppar - promptD",
1235  6,nbins,xmin,xmax);
1236  fHistMassPtImpParTC[2]=new THnSparseF("hMassPtImpParBfeed",
1237  "Mass vs. pt vs.imppar - DfromB",
1238  6,nbins,xmin,xmax);
1239  fHistMassPtImpParTC[3]=new THnSparseF("hMassPtImpParTrueBfeed",
1240  "Mass vs. pt vs.true imppar -DfromB",
1241  6,nbins,xmin,xmax);
1242  fHistMassPtImpParTC[4]=new THnSparseF("hMassPtImpParBkg",
1243  "Mass vs. pt vs.imppar - backgr.",
1244  6,nbins,xmin,xmax);
1245  for(Int_t i=0; i<5;i++){
1246  fOutput->Add(fHistMassPtImpParTC[i]);
1247  }
1248 }
1249 
1250 //________________________________________________________________________
1251 void AliAnalysisTaskSEDplus::Terminate(Option_t */*option*/)
1252 {
1254  //
1255  if(fDebug > 1) printf("AnalysisTaskSEDplus: Terminate() \n");
1256 
1257  fOutput = dynamic_cast<TList*> (GetOutputData(1));
1258  if (!fOutput) {
1259  printf("ERROR: fOutput not available\n");
1260  return;
1261  }
1262 
1263  fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
1264  if(fHistNEvents){
1265  printf("Number of analyzed events = %d\n",(Int_t)fHistNEvents->GetBinContent(2));
1266  }else{
1267  printf("ERROR: fHistNEvents not available\n");
1268  return;
1269  }
1270 
1271  return;
1272 }
1273 //_________________________________________________________________________________________________
1274 Float_t AliAnalysisTaskSEDplus::GetTrueImpactParameter(const AliAODMCHeader *mcHeader, TClonesArray* arrayMC, const AliAODMCParticle *partDp) const {
1276 
1277  Double_t vtxTrue[3];
1278  mcHeader->GetVertex(vtxTrue);
1279  Double_t origD[3];
1280  partDp->XvYvZv(origD);
1281  Short_t charge=partDp->Charge();
1282  Double_t pXdauTrue[3],pYdauTrue[3],pZdauTrue[3];
1283  for(Int_t iDau=0; iDau<3; iDau++){
1284  pXdauTrue[iDau]=0.;
1285  pYdauTrue[iDau]=0.;
1286  pZdauTrue[iDau]=0.;
1287  }
1288 
1289  Int_t nDau=partDp->GetNDaughters();
1290  Int_t labelFirstDau = partDp->GetDaughter(0);
1291  if(nDau==3){
1292  for(Int_t iDau=0; iDau<3; iDau++){
1293  Int_t ind = labelFirstDau+iDau;
1294  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(arrayMC->At(ind));
1295  if(!part){
1296  AliError("Daughter particle not found in MC array");
1297  return 99999.;
1298  }
1299  pXdauTrue[iDau]=part->Px();
1300  pYdauTrue[iDau]=part->Py();
1301  pZdauTrue[iDau]=part->Pz();
1302  }
1303  }else if(nDau==2){
1304  Int_t theDau=0;
1305  for(Int_t iDau=0; iDau<2; iDau++){
1306  Int_t ind = labelFirstDau+iDau;
1307  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(arrayMC->At(ind));
1308  if(!part){
1309  AliError("Daughter particle not found in MC array");
1310  return 99999.;
1311  }
1312  Int_t pdgCode=TMath::Abs(part->GetPdgCode());
1313  if(pdgCode==211 || pdgCode==321){
1314  pXdauTrue[theDau]=part->Px();
1315  pYdauTrue[theDau]=part->Py();
1316  pZdauTrue[theDau]=part->Pz();
1317  ++theDau;
1318  }else{
1319  Int_t nDauRes=part->GetNDaughters();
1320  if(nDauRes==2){
1321  Int_t labelFirstDauRes = part->GetDaughter(0);
1322  for(Int_t iDauRes=0; iDauRes<2; iDauRes++){
1323  Int_t indDR = labelFirstDauRes+iDauRes;
1324  AliAODMCParticle* partDR = dynamic_cast<AliAODMCParticle*>(arrayMC->At(indDR));
1325  if(!partDR){
1326  AliError("Daughter particle not found in MC array");
1327  return 99999.;
1328  }
1329 
1330  Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
1331  if(pdgCodeDR==211 || pdgCodeDR==321){
1332  pXdauTrue[theDau]=partDR->Px();
1333  pYdauTrue[theDau]=partDR->Py();
1334  pZdauTrue[theDau]=partDR->Pz();
1335  ++theDau;
1336  }
1337  }
1338  }
1339  }
1340  }
1341  if(theDau!=3){
1342  AliError("Wrong number of decay prongs");
1343  return 99999.;
1344  }
1345  }
1346 
1347  Double_t d0dummy[3]={0.,0.,0.};
1348  AliAODRecoDecayHF aodDplusMC(vtxTrue,origD,3,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
1349  return aodDplusMC.ImpParXY();
1350 
1351 }
1352 //_________________________________________________________________________________________________
1353 Float_t AliAnalysisTaskSEDplus::GetStrangenessWeights(const AliAODRecoDecayHF3Prong* d, TClonesArray* arrayMC, Float_t factor[3]) const {
1355 
1356  for(Int_t iprong=0;iprong<3;iprong++){
1357  factor[iprong]=1;
1358  AliAODTrack *trad = (AliAODTrack*)d->GetDaughter(iprong);
1359  Int_t labd= trad->GetLabel();
1360  if(labd>=0){
1361  AliAODMCParticle *dau = (AliAODMCParticle*)arrayMC->At(labd);
1362  if(dau){
1363  Int_t labm = dau->GetMother();
1364  if(labm>=0){
1365  AliAODMCParticle *mot = (AliAODMCParticle*)arrayMC->At(labm);
1366  if(mot){
1367  if(TMath::Abs(mot->GetPdgCode())==310 || TMath::Abs(mot->GetPdgCode())==130 || TMath::Abs(mot->GetPdgCode())==321){ //K0_S, K0_L, K^+-
1368  if(d->PtProng(iprong)<=1)factor[iprong]=1./.7;
1369  else factor[iprong]=1./.6;
1370  // fNentries->Fill(12);
1371  }
1372  if(TMath::Abs(mot->GetPdgCode())==3122) { //Lambda
1373  factor[iprong]=1./0.25;
1374  // fNentries->Fill(13);
1375  }//if 3122
1376  }//if(mot)
1377  }//if labm>0
1378  }//if(dau)
1379  }//if labd>=0
1380  }//prong loop
1381 
1382  Float_t fact=1.;
1383  for(Int_t k=0;k<3;k++)fact=fact*factor[k];
1384  return fact;
1385 
1386 }
TH1F * fCosxy[3 *kMaxPtBins]
!hist. for Cosxy (LC)
Int_t charge
TH2F * fPhiEtaCand
! hist. with eta/phi distribution of candidates
Double_t NormalizedDecayLengthXY() const
Double_t NormalizedDecayLength() const
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Bool_t fUseStrangeness
flag for access to MC
TH1F * fSigVertHist[3 *kMaxPtBins]
!hist. for sigVert (LC)
AliRDHFCutsDplustoKpipi * fRDCutsAnalysis
list of cuts
virtual void UserCreateOutputObjects()
Implementation of interface methods.
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
TH1F * fPtpi1Hist[3 *kMaxPtBins]
!hist. for PtPi1 (LC)
Int_t GetIsSelectedCuts() const
Definition: AliRDHFCuts.h:333
Bool_t HasSelectionBit(Int_t i) const
TH3F * fYVsPt
! hist. of Y vs. Pt vs. Mass(prod. cuts)
virtual void Terminate(Option_t *option)
TH1F * fMassHistTC[3 *kMaxPtBins]
!hist. for inv mass (TC)
TH1F * fDLxy[3 *kMaxPtBins]
!hist. for DLxy (LC)
Int_t fEtaSelection
flag to do LS analysis
Float_t fLowerImpPar
nunber of bins in impact parameter histos
TH2F * fHistCentrality[3]
!hist. for cent distr (all,sel ev, )
TH1F * fPtMaxHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 5 (LC)
Double_t ImpParXY() const
TH1F * fSPDMult
! hist. of spd mult
Bool_t fReadMC
flag for filling ntuple
Int_t GetLSHistoIndex(Int_t iPtBin) const
TH1F * fMassHistLSTC[5 *kMaxPtBins]
!hist. for LS inv mass (TC)
Int_t GetSignalHistoIndex(Int_t iPtBin) const
UInt_t GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const
Int_t GetWhyRejection() const
Definition: AliRDHFCuts.h:293
Double_t CosPointingAngleXY() const
TList * fListCuts
width of one bin in output histos
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
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
void LSAnalysis(TClonesArray *arrayOppositeSign, TClonesArray *arrayLikeSign, AliAODEvent *aod, AliAODVertex *vtx1, Int_t nDplusOS)
Int_t GetBackgroundHistoIndex(Int_t iPtBin) const
TH1F * fCosPHist[3 *kMaxPtBins]
!hist. for PointingAngle (LC)
Bool_t HasBadDaughters() const
TH2F * fPtVsMassTC
! hist. of pt vs. mass (analysis cuts)
TH2F * fYVsPtSig
! hist. of Y vs. Pt (MC, only sig, prod. cuts)
THnSparseF * fHistMassPtImpParTC[5]
! histograms for impact paramter studies
Float_t fHigherImpPar
lower limit in impact parameter (um)
Class for cuts on AOD reconstructed D+->Kpipi.
TH1F * fMassHistLS[5 *kMaxPtBins]
!hist. for LS inv mass (LC)
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
TH1F * fSumd02Hist[3 *kMaxPtBins]
!hist. for sum d02 (LC)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
const Double_t ptmax
TH3F * fYVsPtTC
! hist. of Y vs. Pt vs. Mass (analysis cuts)
TH1F * fMassHistTCPlus[3 *kMaxPtBins]
!hist. for D+ inv mass (TC)
TH2F * fPtVsMass
! hist. of pt vs. mass (prod. cuts)
AliAODVertex * GetOwnPrimaryVtx() const
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
Int_t fDoLS
higher limit in impact parameter (um)
TH1F * fPtpi2Hist[3 *kMaxPtBins]
!hist. for PtPi2 (LC)
TH2F * fPhiEtaCandSigReg
! hist. eta/phi of candidates in D+ mass region
Float_t GetCentrality(AliAODEvent *aodEvent)
Definition: AliRDHFCuts.h:242
Float_t GetTrueImpactParameter(const AliAODMCHeader *mcHeader, TClonesArray *arrayMC, const AliAODMCParticle *partDp) const
Int_t fNImpParBins
flag to activate impact paramter histos
TH1F * fDLenHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 2 (LC)
Int_t GetHistoIndex(Int_t iPtBin) const
TH1F * fMassHist[3 *kMaxPtBins]
!hist. for inv mass (LC)
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
Bool_t fFillNtuple
limits for the Pt bins
Double_t DecayLengthXY() const
Bool_t GetIsPrimaryWithoutDaughters() const
Definition: AliRDHFCuts.h:261
TH1F * fSumd02HistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 3 (LC)
Bool_t IsEventSelected(AliVEvent *event)
TH1F * fHistNEvents
!hist. for No. of events
TH1F * fCosPHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 1 (LC)
TH1F * fPtKHist[3 *kMaxPtBins]
!hist. for PtK (LC)
Float_t fBinWidth
Number of Pt Bins.
void SetMassLimits(Float_t range)
TH2F * fYVsPtSigTC
! hist. of Y vs. Pt (MC, only sig, analysis cuts)
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
TH1F * fDLxyTC[3 *kMaxPtBins]
!hist. for DLxy (TC)
Int_t fSystem
eta region to accept D+ 0=all, -1 = negative, 1 = positive
TH2F * fCorreld0Kd0pi[3]
!hist. for d0k*d0pi vs. d0k*d0pi (LC)
virtual void UserExec(Option_t *option)
TH1F * fDLenHist[3 *kMaxPtBins]
!hist. for Dec Length (LC)
Bool_t fDoImpPar
flag to activate cuts distr histos
AliNormalizationCounter * fCounter
Cuts for Analysis.
TH1F * fSigVertHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 4 (LC)
Bool_t fUseBit
flag to enhance strangeness in MC to fit to data
Int_t GetNPtBins() const
Definition: AliRDHFCuts.h:233
Double_t fArrayBinLimits[kMaxPtBins+1]
const Int_t nbins
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999)
Double_t CosPointingAngle() const
Float_t GetStrangenessWeights(const AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC, Float_t factor[3]) const
TH1F * fDCAHist[3 *kMaxPtBins]
!hist. for DCA (LC)
Float_t fLowmasslimit
upper inv mass limit for histos
Int_t GetUseCentrality() const
Definition: AliRDHFCuts.h:263
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Int_t PtBin(Double_t pt) const
Double_t DecayLength() const
TH1F * fCosxyTC[3 *kMaxPtBins]
!hist. for Cosxy (TC)
TNtuple * fNtupleDplus
! output ntuple
Int_t fNPtBins
lower inv mass limit for histos
TH1F * fMassHistTCMinus[3 *kMaxPtBins]
!hist. for D- inv mass (TC)
TH1F * fDCAHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 6 (LC)
TH1F * fPtMaxHist[3 *kMaxPtBins]
!hist. for Pt Max (LC)