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