29 #include <Riostream.h>
30 #include <TClonesArray.h>
37 #include <TDatabasePDG.h>
38 #include <THnSparse.h>
40 #include <AliAnalysisDataSlot.h>
41 #include <AliAnalysisDataContainer.h>
42 #include "AliAnalysisManager.h"
43 #include "AliESDtrack.h"
44 #include "AliVertexerTracks.h"
45 #include "AliAODHandler.h"
46 #include "AliAODEvent.h"
47 #include "AliAODVertex.h"
48 #include "AliAODTrack.h"
49 #include "AliAODMCHeader.h"
50 #include "AliAODMCParticle.h"
54 #include "AliAnalysisTaskSE.h"
86 fIsSelectedCandidate(0),
89 fIsRejectSDDClusters(0),
92 fFillImpParHist(kFALSE),
93 fUseSelectionBit(kTRUE),
94 fWriteVariableTree(kFALSE),
96 fCandidateVariables(),
98 fDrawDetSignal(kFALSE),
99 fUseQuarkTagInKine(kTRUE),
100 fhStudyImpParSingleTrackSign(0),
101 fhStudyImpParSingleTrackCand(0),
102 fhStudyImpParSingleTrackFd(0),
112 AliAnalysisTaskSE(name),
128 fLsNormalization(1.),
131 fIsSelectedCandidate(0),
132 fFillVarHists(kTRUE),
134 fIsRejectSDDClusters(0),
137 fFillImpParHist(kFALSE),
138 fUseSelectionBit(kTRUE),
139 fWriteVariableTree(kFALSE),
141 fCandidateVariables(),
143 fDrawDetSignal(kFALSE),
144 fUseQuarkTagInKine(kTRUE),
145 fhStudyImpParSingleTrackSign(0),
146 fhStudyImpParSingleTrackCand(0),
147 fhStudyImpParSingleTrackFd(0),
158 DefineOutput(1,TList::Class());
160 DefineOutput(2,TList::Class());
162 DefineOutput(3,TH1F::Class());
164 DefineOutput(4,AliRDHFCutsD0toKpi::Class());
166 DefineOutput(5,AliNormalizationCounter::Class());
168 DefineOutput(6,TList::Class());
170 DefineOutput(7,TTree::Class());
172 DefineOutput(8, TList::Class());
174 DefineOutput(9, TList::Class());
200 for(Int_t i=0; i<5; i++){
232 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::Init() \n");
236 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
237 copyfCuts->SetName(nameoutput);
239 PostData(4,copyfCuts);
251 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::UserCreateOutputObjects() \n");
268 fDistr->SetName(
"distributionslist");
274 TString nameMass=
" ",nameSgn27=
" ",nameSgn=
" ", nameBkg=
" ", nameRfl=
" ",nameMassNocutsS =
" ",nameMassNocutsB =
" ", namedistr=
" ";
275 TString nameMassPt=
"", nameSgnPt=
"", nameBkgPt=
"", nameRflPt=
"";
276 TString nameMassY=
"", nameSgnY=
"", nameBkgY=
"", nameRflY=
"";
277 Int_t nbins2dPt=60; Float_t binInPt=0., binFinPt=30.;
278 Int_t nbins2dY=60; Float_t binInY=-1.5, binFinY=1.5;
282 nameMass=
"histMass_";
284 nameSgn27=
"histSgn27_";
292 nameMassNocutsS=
"hMassS_";
294 nameMassNocutsB=
"hMassB_";
301 namedistr=
"hNclsD0vsptS_";
303 TH2F *hNclsD0vsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
304 namedistr=
"hNclsD0barvsptS_";
306 TH2F *hNclsD0barvsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
308 namedistr=
"hNITSpointsD0vsptS_";
310 TH2F *hNITSpointsD0vsptS =
new TH2F(namedistr.Data(),
"N ITS points distrubution [S];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
312 namedistr=
"hNSPDpointsD0S_";
314 TH1I *hNSPDpointsD0S =
new TH1I(namedistr.Data(),
"N SPD points distrubution [S]; ;N tracks",4,0,4);
315 hNSPDpointsD0S->GetXaxis()->SetBinLabel(1,
"no SPD");
316 hNSPDpointsD0S->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
317 hNSPDpointsD0S->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
318 hNSPDpointsD0S->GetXaxis()->SetBinLabel(4,
"kBoth");
322 TH1F *hptD0S =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
323 namedistr=
"hptD0barS_";
325 TH1F *hptD0barS =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
327 namedistr=
"hphiD0S_";
329 TH1F *hphiD0S =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
330 namedistr=
"hphiD0barS_";
332 TH1F *hphiD0barS =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
335 namedistr=
"hetaphiD0candidateS_";
337 TH2F *hetaphiD0candidateS =
new TH2F(namedistr.Data(),
"D^{0} candidates #eta #phi distribution [S];#eta;#phi [rad]",100, -1.5, 1.5, 100, 0.,2*TMath::Pi());
338 namedistr=
"hetaphiD0barcandidateS_";
340 TH2F *hetaphiD0barcandidateS =
new TH2F(namedistr.Data(),
"anti-D^{0} candidates #eta #phi distribution [S];#eta;#phi [rad]",100, -1.5, 1.5, 100, 0.,2*TMath::Pi());
342 namedistr=
"hetaphiD0candidatesignalregionS_";
344 TH2F *hetaphiD0candidatesignalregionS =
new TH2F(namedistr.Data(),
"D^{0} candidates #eta #phi distribution [S] [mass cut];#eta;#phi [rad]",100, -1.5, 1.5, 100, 0.,2*TMath::Pi());
345 namedistr=
"hetaphiD0barcandidatesignalregionS_";
347 TH2F *hetaphiD0barcandidatesignalregionS =
new TH2F(namedistr.Data(),
"anti-D^{0} candidates #eta #phi distribution [S] [mass cut];#eta;#phi [rad]",100, -1.5, 1.5, 100, 0.,2*TMath::Pi());
352 TH1F *hdcaS =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
356 TH1F *hd0piS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions);d0(#pi) [cm]",200,-0.1,0.1);
360 TH1F *hd0KS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons);d0(K) [cm]",200,-0.1,0.1);
363 TH1F *hd0d0S =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
368 TH1F *hdeclengthS =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm]",200,0,0.015);
370 namedistr=
"hnormdeclS_";
372 TH1F *hnormdeclengthS =
new TH1F(namedistr.Data(),
"Normalized Decay Length^{2} distribution;(Decay Length/Err)^{2} ",200,0,12.);
374 namedistr=
"hdeclxyS_";
376 TH1F* hdeclxyS=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
377 namedistr=
"hnormdeclxyS_";
379 TH1F* hnormdeclxyS=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
381 namedistr=
"hdeclxyd0d0S_";
383 TH2F* hdeclxyd0d0S=
new TH2F(namedistr.Data(),
"Correlation decay Length XY - d_{0}#times d_{0};Decay Length XY [cm];d_{0}#times d_{0}[cm^{2}]",200,0,0.15,200,-0.001,0.001);
385 namedistr=
"hnormdeclxyd0d0S_";
387 TH2F* hnormdeclxyd0d0S=
new TH2F(namedistr.Data(),
"Correlation normalized decay Length XY - d_{0}#times d_{0};Decay Length XY/Err;d_{0}#times d_{0}[cm^{2}]",200,0,6,200,-0.001,0.001);
390 namedistr=
"hcosthetapointS_";
392 TH1F *hcosthetapointS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
394 namedistr=
"hcosthetapointxyS_";
396 TH1F *hcosthetapointxyS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XYdistribution;cos#theta_{Point}",300,0.,1.);
398 TH1F* tmpMS =
new TH1F(nameMassNocutsS.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
401 fDistr->Add(hNclsD0vsptS);
402 fDistr->Add(hNclsD0barvsptS);
403 fDistr->Add(hNITSpointsD0vsptS);
404 fDistr->Add(hNSPDpointsD0S);
409 fDistr->Add(hetaphiD0candidateS);
410 fDistr->Add(hetaphiD0candidatesignalregionS);
411 fDistr->Add(hetaphiD0barcandidateS);
412 fDistr->Add(hetaphiD0barcandidatesignalregionS);
421 fDistr->Add(hcosthetapointS);
423 fDistr->Add(hcosthetapointxyS);
427 fDistr->Add(hnormdeclengthS);
431 fDistr->Add(hnormdeclxyS);
433 fDistr->Add(hdeclxyd0d0S);
434 fDistr->Add(hnormdeclxyd0d0S);
442 namedistr=
"hNclsD0vsptB_";
444 TH2F *hNclsD0vsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
445 namedistr=
"hNclsD0barvsptB_";
447 TH2F *hNclsD0barvsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
449 namedistr=
"hNITSpointsD0vsptB_";
451 TH2F *hNITSpointsD0vsptB =
new TH2F(namedistr.Data(),
"N ITS points distrubution [B];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
453 namedistr=
"hNSPDpointsD0B_";
455 TH1I *hNSPDpointsD0B =
new TH1I(namedistr.Data(),
"N SPD points distrubution [B]; ;N tracks",4,0,4);
456 hNSPDpointsD0B->GetXaxis()->SetBinLabel(1,
"no SPD");
457 hNSPDpointsD0B->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
458 hNSPDpointsD0B->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
459 hNSPDpointsD0B->GetXaxis()->SetBinLabel(4,
"kBoth");
463 TH1F *hptD0B =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
464 namedistr=
"hptD0barB_";
466 TH1F *hptD0barB =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
468 namedistr=
"hphiD0B_";
470 TH1F *hphiD0B =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
471 namedistr=
"hphiD0barB_";
473 TH1F *hphiD0barB =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
475 namedistr=
"hetaphiD0candidateB_";
477 TH2F *hetaphiD0candidateB =
new TH2F(namedistr.Data(),
"D^{0} candidates #eta #phi distribution [B];#eta;#phi [rad]",100, -1.5, 1.5, 100, 0.,2*TMath::Pi());
478 namedistr=
"hetaphiD0barcandidateB_";
480 TH2F *hetaphiD0barcandidateB =
new TH2F(namedistr.Data(),
"anti-D^{0} candidates #eta #phi distribution [B];#eta;#phi [rad]",100, -1.5, 1.5, 100, 0.,2*TMath::Pi());
482 namedistr=
"hetaphiD0candidatesignalregionB_";
484 TH2F *hetaphiD0candidatesignalregionB =
new TH2F(namedistr.Data(),
"D^{0} candidates #eta #phi distribution [B] [mass cut];#eta;#phi [rad]",100, -1.5, 1.5, 100, 0.,2*TMath::Pi());
485 namedistr=
"hetaphiD0barcandidatesignalregionB_";
487 TH2F *hetaphiD0barcandidatesignalregionB =
new TH2F(namedistr.Data(),
"anti-D^{0} candidates #eta #phi distribution [B] [mass cut];#eta;#phi [rad]",100, -1.5, 1.5, 100, 0.,2*TMath::Pi());
492 TH1F *hdcaB =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
497 TH1F *hd0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
501 TH1F *hd0d0B =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
506 TH1F *hdeclengthB =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm^{2}]",200,0,0.015);
508 namedistr=
"hnormdeclB_";
510 TH1F *hnormdeclengthB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution;(Decay Length/Err)^{2} ",200,0,12.);
512 namedistr=
"hdeclxyB_";
514 TH1F* hdeclxyB=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
515 namedistr=
"hnormdeclxyB_";
517 TH1F* hnormdeclxyB=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
519 namedistr=
"hdeclxyd0d0B_";
521 TH2F* hdeclxyd0d0B=
new TH2F(namedistr.Data(),
"Correlation decay Length XY - d_{0}#times d_{0};Decay Length XY [cm];d_{0}#times d_{0}[cm^{2}]",200,0,0.15,200,-0.001,0.001);
523 namedistr=
"hnormdeclxyd0d0B_";
525 TH2F* hnormdeclxyd0d0B=
new TH2F(namedistr.Data(),
"Correlation normalized decay Length XY - d_{0}#times d_{0};Decay Length XY/Err;d_{0}#times d_{0}[cm^{2}]",200,0,6,200,-0.001,0.001);
528 namedistr=
"hcosthetapointB_";
530 TH1F *hcosthetapointB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
532 namedistr=
"hcosthetapointxyB_";
534 TH1F *hcosthetapointxyB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XY distribution;cos#theta_{Point} XY",300,0.,1.);
536 TH1F* tmpMB =
new TH1F(nameMassNocutsB.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
540 fDistr->Add(hNclsD0vsptB);
541 fDistr->Add(hNclsD0barvsptB);
542 fDistr->Add(hNITSpointsD0vsptB);
543 fDistr->Add(hNSPDpointsD0B);
548 fDistr->Add(hetaphiD0candidateB);
549 fDistr->Add(hetaphiD0candidatesignalregionB);
550 fDistr->Add(hetaphiD0barcandidateB);
551 fDistr->Add(hetaphiD0barcandidatesignalregionB);
559 fDistr->Add(hcosthetapointB);
561 fDistr->Add(hcosthetapointxyB);
565 fDistr->Add(hnormdeclengthB);
569 fDistr->Add(hnormdeclxyB);
571 fDistr->Add(hdeclxyd0d0B);
572 fDistr->Add(hnormdeclxyd0d0B);
580 namedistr=
"hd0vpiS_";
582 TH1F *hd0vpiS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions)(vtx w/o these tracks);d0(#pi) [cm]",200,-0.1,0.1);
586 TH1F *hd0vKS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons) (vtx w/o these tracks);d0(K) [cm]",200,-0.1,0.1);
588 namedistr=
"hd0d0vS_";
590 TH1F *hd0d0vS =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution (vtx w/o these tracks);d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
592 namedistr=
"hdeclvS_";
594 TH1F *hdeclengthvS =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
596 namedistr=
"hnormdeclvS_";
598 TH1F *hnormdeclengthvS =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
603 fDistr->Add(hdeclengthvS);
604 fDistr->Add(hnormdeclengthvS);
608 namedistr=
"hd0vmoresB_";
610 TH1F *hd0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
612 namedistr=
"hd0d0vmoresB_";
614 TH1F *hd0d0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
619 TH1F *hd0vB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
621 namedistr=
"hd0vp0B_";
623 TH1F *hd0vp0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong + ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
625 namedistr=
"hd0vp1B_";
627 TH1F *hd0vp1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong - ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
629 namedistr=
"hd0d0vB_";
631 TH1F *hd0d0vB =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution (vtx w/o these tracks);d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
633 namedistr=
"hdeclvB_";
635 TH1F *hdeclengthvB =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
637 namedistr=
"hnormdeclvB_";
639 TH1F *hnormdeclengthvB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
647 fDistr->Add(hd0d0vmoresB);
649 fDistr->Add(hdeclengthvB);
651 fDistr->Add(hnormdeclengthvB);
661 TH1F* tmpSt =
new TH1F(nameSgn.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
663 TH1F *tmpSl=(TH1F*)tmpSt->Clone();
668 TH1F* tmpRt =
new TH1F(nameRfl.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
670 TH1F* tmpBt =
new TH1F(nameBkg.Data(),
"Background invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
684 TH1F* tmpMt =
new TH1F(nameMass.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
700 TH1F *hptpiS =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
704 TH1F *hptKS =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
707 namedistr=
"hcosthetastarS_";
709 TH1F *hcosthetastarS =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
713 namedistr=
"hptpiSnoMcut_";
715 TH1F *hptpiSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
717 namedistr=
"hptKSnoMcut_";
719 TH1F *hptKSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
723 fDistr->Add(hcosthetastarS);
725 fDistr->Add(hptpiSnoMcut);
729 namedistr=
"hcosthpointd0S_";
731 TH2F *hcosthpointd0S=
new TH2F(namedistr.Data(),
"Correlation cos#theta_{Point}-d_{0};cos#theta_{Point};d_{0} [cm^{2}]",200,0,1.,200,-0.001,0.001);
732 namedistr=
"hcosthpointd0d0S_";
734 TH2F *hcosthpointd0d0S=
new TH2F(namedistr.Data(),
"Correlation cos#theta_{Point}-d_{0}#timesd_{0};cos#theta_{Point};d_{0}#timesd_{0} [cm^{2}]",200,0,1.,200,-0.001,0.001);
736 fDistr->Add(hcosthpointd0S);
737 fDistr->Add(hcosthpointd0d0S);
740 TH1F* tmpS27t =
new TH1F(nameSgn27.Data(),
"D^{0} invariant mass in M(D^{0}) +/- 27 MeV - MC; M [GeV]; Entries",600,1.6248,2.2248);
741 TH1F *tmpS27l=(TH1F*)tmpS27t->Clone();
753 TH1F *hptB =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
756 namedistr=
"hcosthetastarB_";
758 TH1F *hcosthetastarB =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
761 namedistr=
"hptB1prongnoMcut_";
763 TH1F *hptB1pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
765 namedistr=
"hptB2prongsnoMcut_";
767 TH1F *hptB2pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
770 fDistr->Add(hcosthetastarB);
772 fDistr->Add(hptB1pnoMcut);
773 fDistr->Add(hptB2pnoMcut);
778 TH1F *hd0p0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.1,0.1);
782 TH1F *hd0p1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong -);d0 [cm]",200,-0.1,0.1);
785 namedistr=
"hd0moresB_";
787 TH1F *hd0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
789 namedistr=
"hd0d0moresB_";
791 TH1F *hd0d0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
794 namedistr=
"hcosthetapointmoresB_";
796 TH1F *hcosthetapointmoresB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
799 namedistr=
"hcosthpointd0B_";
801 TH2F *hcosthpointd0B=
new TH2F(namedistr.Data(),
"Correlation cos#theta_{Point}-d_{0};cos#theta_{Point};d_{0} [cm^{2}]",200,0,1.,200,-0.001,0.001);
803 namedistr=
"hcosthpointd0d0B_";
805 TH2F *hcosthpointd0d0B=
new TH2F(namedistr.Data(),
"Correlation cos#theta_{Point}-d_{0}#timesd_{0};cos#theta_{Point};d_{0}#timesd_{0} [cm^{2}]",200,0,1.,200,-0.001,0.001);
812 fDistr->Add(hcosthetapointmoresB);
815 fDistr->Add(hcosthpointd0B);
818 fDistr->Add(hcosthpointd0d0B);
825 Int_t nbinsImpParStudy[9]= {50, 40, 40, 20, 15, 600, 3,4,2};
826 Double_t limitLowImpParStudy[9]={0, -5, -5, 0, 0,1.6248,1,0,0};
827 Double_t limitUpImpParStudy[9]= {50., 5, 5, 0.2,15,2.2248,4,4,2};
828 TString axTit[9]={
"#it{p}_{T} (GeV/c)",
"normalized imp par residual, trk1",
"normalized imp par residual, trk2",
"#it{L}_{xy} (cm)",
"norm #it{L}_{xy}",
"MassD0_{k#pi} (GeV/#it{c}^{2})",
"cutSel",
"PIDinfo",
"D0D0bar"};
829 fhStudyImpParSingleTrackCand=
new THnSparseF(
"fhStudyImpParSingleTrackCand",
"fhStudyImpParSingleTrackCand",9,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
834 Int_t nbinsImpParStudy[8]= {50,50,40, 40, 20, 15, 3, 4};
835 Double_t limitLowImpParStudy[8]={0, 0, -5,-5., 0., 0., 1.,0.};
836 Double_t limitUpImpParStudy[8]= {50.,50., 5, 5, 0.2, 15, 3.,4.};
838 fhStudyImpParSingleTrackSign=
new THnSparseF(
"fhStudyImpParSingleTrackSign",
"fhStudyImpParSingleTrackSign",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
839 TString axTitMC[8]={
"#it{p}_{T} (GeV/c)",
"#it{p}_{T} (GeV/c)",
"normalized imp par residual, trk1",
"normalized imp par residual, trk2",
"#it{L}_{xy} (cm)",
"norm #it{L}_{xy}",
"cutSel",
"PIDinfo"};
844 fhStudyImpParSingleTrackFd=
new THnSparseF(
"fhStudyImpParSingleTrackFd",
"fhStudyImpParSingleTrackFd",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
855 namedistr=
"hpospair";
857 namedistr=
"hnegpair";
867 nameMassPt=
"histMassPt";
868 nameSgnPt=
"histSgnPt";
869 nameBkgPt=
"histBkgPt";
870 nameRflPt=
"histRflPt";
874 TH2F* tmpStPt =
new TH2F(nameSgnPt.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
875 TH2F *tmpSlPt=(TH2F*)tmpStPt->Clone();
880 TH2F* tmpRtPt =
new TH2F(nameRflPt.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
881 TH2F* tmpBtPt =
new TH2F(nameBkgPt.Data(),
"Background invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
895 TH2F* tmpMtPt =
new TH2F(nameMassPt.Data(),
"D^{0} invariant mass; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
907 nameMassY=
"histMassY_";
909 nameSgnY=
"histSgnY_";
911 nameBkgY=
"histBkgY_";
913 nameRflY=
"histRflY_";
917 TH2F* tmpStY =
new TH2F(nameSgnY.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
920 TH2F* tmpRtY =
new TH2F(nameRflY.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
921 TH2F* tmpBtY =
new TH2F(nameBkgY.Data(),
"Background invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
929 TH2F* tmpMtY =
new TH2F(nameMassY.Data(),
"D^{0} invariant mass; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
936 const char* nameoutput=GetOutputSlot(3)->GetContainer()->GetName();
938 fNentries=
new TH1F(nameoutput,
"Integral(1,2) = number of AODs *** Integral(2,3) = number of candidates selected with cuts *** Integral(3,4) = number of D0 selected with cuts *** Integral(4,5) = events with good vertex *** Integral(5,6) = pt out of bounds", 21,-0.5,20.5);
940 fNentries->GetXaxis()->SetBinLabel(1,
"nEventsAnal");
941 fNentries->GetXaxis()->SetBinLabel(2,
"nCandSel(Cuts)");
943 else fNentries->GetXaxis()->SetBinLabel(3,
"Dstar<-D0");
944 fNentries->GetXaxis()->SetBinLabel(4,
"nEventsGoodVtxS");
945 fNentries->GetXaxis()->SetBinLabel(5,
"ptbin = -1");
946 fNentries->GetXaxis()->SetBinLabel(6,
"no daughter");
947 if(
fSys==0)
fNentries->GetXaxis()->SetBinLabel(7,
"nCandSel(Tr)");
949 fNentries->GetXaxis()->SetBinLabel(8,
"PID=0");
950 fNentries->GetXaxis()->SetBinLabel(9,
"PID=1");
951 fNentries->GetXaxis()->SetBinLabel(10,
"PID=2");
952 fNentries->GetXaxis()->SetBinLabel(11,
"PID=3");
955 fNentries->GetXaxis()->SetBinLabel(12,
"K");
956 fNentries->GetXaxis()->SetBinLabel(13,
"Lambda");
958 fNentries->GetXaxis()->SetBinLabel(14,
"Pile-up Rej");
959 fNentries->GetXaxis()->SetBinLabel(15,
"N. of 0SMH");
960 if(
fSys==1)
fNentries->GetXaxis()->SetBinLabel(16,
"Nev in centr");
962 fNentries->GetXaxis()->SetBinLabel(18,
"Phys.Sel.Rej");
963 fNentries->GetXaxis()->SetBinLabel(19,
"D0 failed to be filled");
964 fNentries->GetXaxis()->SetBinLabel(20,
"fisFilled is 0");
965 fNentries->GetXaxis()->SetBinLabel(21,
"fisFilled is 1");
966 fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
974 nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
975 fVariablesTree =
new TTree(nameoutput,
"Candidates variables tree");
978 TString * fCandidateVariableNames =
new TString[
nVar];
979 fCandidateVariableNames[0] =
"massD0";
980 fCandidateVariableNames[1] =
"massD0bar";
981 fCandidateVariableNames[2] =
"pt";
982 fCandidateVariableNames[3] =
"dca";
983 fCandidateVariableNames[4] =
"costhsD0";
984 fCandidateVariableNames[5] =
"costhsD0bar";
985 fCandidateVariableNames[6] =
"ptk";
986 fCandidateVariableNames[7] =
"ptpi";
987 fCandidateVariableNames[8] =
"d0k";
988 fCandidateVariableNames[9] =
"d0pi";
989 fCandidateVariableNames[10] =
"d0xd0";
990 fCandidateVariableNames[11] =
"costhp";
991 fCandidateVariableNames[12] =
"costhpxy";
992 fCandidateVariableNames[13] =
"lxy";
993 fCandidateVariableNames[14] =
"specialcuts";
994 for(Int_t ivar=0; ivar<
nVar; ivar++){
1003 TH2F *TOFSigBefPID =
new TH2F(
"TOFSigBefPID",
"TOF signal of daughters before PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1004 TH2F *TOFSigAftPID =
new TH2F(
"TOFSigAftPID",
"TOF signal after PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1006 TH2F *TPCSigBefPID =
new TH2F(
"TPCSigBefPID",
"TPC dE/dx before PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1007 TH2F *TPCSigAftPID =
new TH2F(
"TPCSigAftPID",
"TPC dE/dx after PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1046 AliAODEvent *aod =
dynamic_cast<AliAODEvent*
> (InputEvent());
1055 bname=
"LikeSign2Prong";
1057 TClonesArray *inputArray=0;
1058 if(!aod && AODEvent() && IsStandardAOD()) {
1061 aod =
dynamic_cast<AliAODEvent*
> (AODEvent());
1064 AliAODHandler* aodHandler = (AliAODHandler*)
1065 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1067 if(aodHandler->GetExtensions()) {
1068 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
1069 AliAODEvent* aodFromExt = ext->GetAOD();
1070 inputArray=(TClonesArray*)aodFromExt->GetList()->FindObject(bname.Data());
1073 inputArray=(TClonesArray*)aod->GetList()->FindObject(bname.Data());
1076 if(!inputArray || !aod) {
1077 printf(
"AliAnalysisTaskSED0Mass::UserExec: input branch not found!\n");
1082 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001)
return;
1084 TClonesArray *mcArray = 0;
1085 AliAODMCHeader *mcHeader = 0;
1089 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1091 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC particles branch not found!\n");
1096 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1098 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC header branch not found!\n");
1109 TString trigclass=aod->GetFiredTriggerClasses();
1110 if(trigclass.Contains(
"C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains(
"C0SMH-B-NOPF-ALL"))
fNentries->Fill(14);
1124 Bool_t skipEvent = kFALSE;
1126 if (aod) ntracks = aod->GetNumberOfTracks();
1127 for(Int_t itrack=0; itrack<ntracks; itrack++) {
1129 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1130 if(!track) AliFatal(
"Not a standard AOD");
1131 if(TESTBIT(track->GetITSClusterMap(),2) || TESTBIT(track->GetITSClusterMap(),3) ){
1137 if (skipEvent)
return;
1141 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1143 Bool_t isGoodVtx=kFALSE;
1146 TString primTitle = vtx1->GetTitle();
1147 if(primTitle.Contains(
"VertexerTracks") && vtx1->GetNContributors()>0) {
1153 Int_t nInD0toKpi = inputArray->GetEntriesFast();
1154 if(fDebug>2) printf(
"Number of D0->Kpi: %d\n",nInD0toKpi);
1158 Int_t nSelectedloose=0,nSelectedtight=0;
1165 for (Int_t iD0toKpi = 0; iD0toKpi < nInD0toKpi; iD0toKpi++) {
1186 if(ptbin==-1) {
fNentries->Fill(4);
continue;}
1194 AliDebug(1,
"at least one daughter not found!");
1209 Int_t isSelectedPIDfill = 3;
1212 if (isSelectedPIDfill == 0)
fNentries->Fill(7);
1213 if (isSelectedPIDfill == 1)
fNentries->Fill(8);
1214 if (isSelectedPIDfill == 2)
fNentries->Fill(9);
1215 if (isSelectedPIDfill == 3)
fNentries->Fill(10);
1247 AliESDtrack *esdtrack1 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1248 AliESDtrack *esdtrack2 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1252 Int_t isSelectedPIDfill = 3;
1257 ((TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1258 ((TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1259 ((TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1260 ((TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1262 if (isSelectedPIDfill != 0) {
1263 ((TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1264 ((TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1265 ((TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1266 ((TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1283 Int_t pdgDgD0toKpi[2]={321,211};
1285 if(
fReadMC) lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
1287 Int_t isSelectedPID=3;
1290 if (isSelectedPID==0)
fNentries->Fill(7);
1291 if (isSelectedPID==1)
fNentries->Fill(8);
1292 if (isSelectedPID==2)
fNentries->Fill(9);
1293 if (isSelectedPID==3)
fNentries->Fill(10);
1304 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1313 Double_t invmasscut=0.03;
1315 TString fillthispi=
"",fillthisK=
"",fillthis=
"", fillthispt=
"", fillthisetaphi=
"";
1317 Int_t ptbin=cuts->
PtBin(part->Pt());
1318 Double_t pt = part->Pt();
1320 Double_t dz1[2],dz2[2],covar1[3],covar2[3];
1321 dz1[0]=-99; dz2[0]=-99;
1323 Double_t decl[2]={-99,-99};
1324 Bool_t recalcvtx=kFALSE;
1331 AliAODVertex *vtxProp=0x0;
1337 AliESDtrack *esdtrack1=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1338 AliESDtrack *esdtrack2=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1339 esdtrack1->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz1,covar1);
1340 esdtrack2->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz2,covar2);
1341 delete vtxProp; vtxProp=NULL;
1355 Double_t cosThetaStarD0 = 99;
1356 Double_t cosThetaStarD0bar = 99;
1357 Double_t cosPointingAngle = 99;
1358 Double_t normalizedDecayLength2 = -1, normalizedDecayLengthxy=-1;
1359 Double_t decayLength2 = -1, decayLengthxy=-1;
1360 Double_t ptProng[2]={-99,-99};
1361 Double_t d0Prong[2]={-99,-99};
1362 Double_t etaD = 99.;
1363 Double_t phiD = 99.;
1374 if(!prong0 || !prong1) {
1379 labprong[0]=prong0->GetLabel();
1380 labprong[1]=prong1->GetLabel();
1382 AliAODMCParticle *mcprong=0;
1383 Int_t pdgProng[2]={0,0};
1385 for (Int_t iprong=0;iprong<2;iprong++){
1386 if(
fReadMC && labprong[iprong]>=0) {
1387 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1388 pdgProng[iprong]=mcprong->GetPdgCode();
1395 fillthispi=
"hptpiSnoMcut_";
1398 fillthisK=
"hptKSnoMcut_";
1401 if ((TMath::Abs(pdgProng[0]) == 211 && TMath::Abs(pdgProng[1]) == 321)
1402 || (isSelectedPID==1 || isSelectedPID==3)){
1403 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong0->Pt());
1404 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong1->Pt());
1407 if ((TMath::Abs(pdgProng[0]) == 321 && TMath::Abs(pdgProng[1]) == 211)
1408 || (isSelectedPID==2 || isSelectedPID==3)){
1409 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong0->Pt());
1410 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong1->Pt());
1422 fillthispt=
"histSgnPt";
1424 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)
1425 || (!
fReadMC && (isSelectedPID==1 || isSelectedPID==3))){
1426 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1429 fillthisetaphi=
"hetaphiD0candidateS_";
1430 fillthisetaphi+=ptbin;
1431 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1433 if(TMath::Abs(minvD0-mPDG)<0.05){
1434 fillthisetaphi=
"hetaphiD0candidatesignalregionS_";
1435 fillthisetaphi+=ptbin;
1436 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1442 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1445 fillthisetaphi=
"hetaphiD0barcandidateS_";
1446 fillthisetaphi+=ptbin;
1447 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1449 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1450 fillthisetaphi=
"hetaphiD0barcandidatesignalregionS_";
1451 fillthisetaphi+=ptbin;
1452 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1459 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1469 ptProng[0]=prong0->Pt(); ptProng[1]=prong1->Pt();
1470 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1472 if(
fArray==1) cout<<
"LS signal: ERROR"<<endl;
1473 for (Int_t iprong=0; iprong<2; iprong++){
1475 if (
fReadMC) labprong[iprong]=prong->GetLabel();
1479 if(
fReadMC && labprong[iprong]>=0) {
1480 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1481 pdgprong=mcprong->GetPdgCode();
1484 Bool_t isPionHere[2]={(isSelectedPID==1 || isSelectedPID==3) ? kTRUE : kFALSE,(isSelectedPID==2 || isSelectedPID==3) ? kTRUE : kFALSE};
1486 if(TMath::Abs(pdgprong)==211 || isPionHere[iprong]) {
1490 fillthispi=
"hptpiS_";
1492 ((TH1F*)listout->FindObject(fillthispi))->Fill(ptProng[iprong]);
1495 fillthispi=
"hd0piS_";
1497 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0Prong[iprong]);
1500 fillthispi=
"hd0vpiS_";
1502 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0[iprong]);
1507 if(TMath::Abs(pdgprong)==321 || !isPionHere[iprong]) {
1512 ((TH1F*)listout->FindObject(fillthisK))->Fill(ptProng[iprong]);
1518 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0Prong[iprong]);
1520 fillthisK=
"hd0vKS_";
1522 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0[iprong]);
1527 fillthis=
"hcosthpointd0S_";
1529 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[iprong]);
1535 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1537 fillthis=
"hcosthetapointS_";
1539 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1541 fillthis=
"hcosthetapointxyS_";
1548 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0());
1552 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1554 fillthis=
"hnormdeclS_";
1556 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1558 fillthis=
"hdeclxyS_";
1560 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1562 fillthis=
"hnormdeclxyS_";
1564 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1566 fillthis=
"hdeclxyd0d0S_";
1568 ((TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1570 fillthis=
"hnormdeclxyd0d0S_";
1572 ((TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1575 fillthis=
"hdeclvS_";
1577 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1579 fillthis=
"hnormdeclvS_";
1581 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1583 fillthis=
"hd0d0vS_";
1585 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1589 fillthis=
"hcosthetastarS_";
1591 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)) ((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1593 if (
fReadMC || isSelectedPID>1)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar);
1594 if(isSelectedPID==1 || isSelectedPID==3)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1597 fillthis=
"hcosthpointd0d0S_";
1599 ((TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1602 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)){
1603 for(Int_t it=0; it<2; it++){
1606 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1607 fillthis=
"hphiD0S_";
1609 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1610 Int_t nPointsITS = 0;
1611 for (Int_t il=0; il<6; il++){
1612 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1614 fillthis=
"hNITSpointsD0vsptS_";
1616 ((TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(),nPointsITS);
1617 fillthis=
"hNSPDpointsD0S_";
1619 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1620 ((TH1I*)listout->FindObject(fillthis))->Fill(0);
1622 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1623 ((TH1I*)listout->FindObject(fillthis))->Fill(1);
1625 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1626 ((TH1I*)listout->FindObject(fillthis))->Fill(2);
1628 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1629 ((TH1I*)listout->FindObject(fillthis))->Fill(3);
1631 fillthis=
"hNclsD0vsptS_";
1634 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->GetTPCNcls();
1635 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1639 if (
fReadMC || isSelectedPID>1){
1640 for(Int_t it=0; it<2; it++){
1641 fillthis=
"hptD0barS_";
1643 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1644 fillthis=
"hphiD0barS_";
1646 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1647 fillthis=
"hNclsD0barvsptS_";
1650 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->GetTPCNcls();
1651 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1654 if(isSelectedPID==1 || isSelectedPID==3){
1655 for(Int_t it=0; it<2; it++){
1658 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1659 fillthis=
"hphiD0S_";
1661 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1662 Int_t nPointsITS = 0;
1663 for (Int_t il=0; il<6; il++){
1664 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1666 fillthis=
"hNITSpointsD0vsptS_";
1668 ((TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1669 fillthis=
"hNSPDpointsD0S_";
1671 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1672 ((TH1I*)listout->FindObject(fillthis))->Fill(0);
1674 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1675 ((TH1I*)listout->FindObject(fillthis))->Fill(1);
1677 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1678 ((TH1I*)listout->FindObject(fillthis))->Fill(2);
1680 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1681 ((TH1I*)listout->FindObject(fillthis))->Fill(3);
1683 fillthis=
"hNclsD0vsptS_";
1686 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->GetTPCNcls();
1687 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1705 fillthispt=
"histBkgPt";
1708 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1711 fillthisetaphi=
"hetaphiD0candidateB_";
1712 fillthisetaphi+=ptbin;
1713 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1715 if(TMath::Abs(minvD0-mPDG)<0.05){
1716 fillthisetaphi=
"hetaphiD0candidatesignalregionB_";
1717 fillthisetaphi+=ptbin;
1718 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1722 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1725 fillthisetaphi=
"hetaphiD0barcandidateB_";
1726 fillthisetaphi+=ptbin;
1727 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1729 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1730 fillthisetaphi=
"hetaphiD0barcandidatesignalregionB_";
1731 fillthisetaphi+=ptbin;
1732 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1737 fillthis=
"hptB1prongnoMcut_";
1740 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1742 fillthis=
"hptB2prongsnoMcut_";
1744 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1745 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1750 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1762 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1767 if(fDebug>2) cout<<
"No daughter found";
1772 if(prongg->Charge()==1) {
1774 ((TH1F*)
fOutputMass->FindObject(
"hpospair"))->Fill(ptbin);
1777 ((TH1F*)
fOutputMass->FindObject(
"hnegpair"))->Fill(ptbin);
1785 for(Int_t it=0; it<2; it++){
1788 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1789 fillthis=
"hphiD0B_";
1791 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1793 Int_t nPointsITS = 0;
1794 for (Int_t il=0; il<6; il++){
1795 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1797 fillthis=
"hNITSpointsD0vsptB_";
1799 ((TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1800 fillthis=
"hNSPDpointsD0B_";
1802 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1803 ((TH1I*)listout->FindObject(fillthis))->Fill(0);
1805 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1806 ((TH1I*)listout->FindObject(fillthis))->Fill(1);
1808 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1809 ((TH1I*)listout->FindObject(fillthis))->Fill(2);
1811 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1812 ((TH1I*)listout->FindObject(fillthis))->Fill(3);
1814 fillthis=
"hNclsD0vsptB_";
1817 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->GetTPCNcls();
1818 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1825 for(Int_t it=0; it<2; it++){
1826 fillthis=
"hptD0barB_";
1828 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1829 fillthis=
"hphiD0barB_";
1831 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1832 fillthis=
"hNclsD0barvsptB_";
1835 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->GetTPCNcls();
1836 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1842 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1843 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1846 Int_t pdgMother[2]={0,0};
1847 Double_t factor[2]={1,1};
1849 for(Int_t iprong=0;iprong<2;iprong++){
1851 lab=prong->GetLabel();
1853 AliAODMCParticle* mcprong=(AliAODMCParticle*)arrMC->At(lab);
1855 Int_t labmom=mcprong->GetMother();
1857 AliAODMCParticle* mcmother=(AliAODMCParticle*)arrMC->At(labmom);
1858 if(mcmother) pdgMother[iprong]=mcmother->GetPdgCode();
1865 fillthis=
"hd0moresB_";
1868 if(TMath::Abs(pdgMother[iprong])==310 || TMath::Abs(pdgMother[iprong])==130 || TMath::Abs(pdgMother[iprong])==321){
1869 if(ptProng[iprong]<=1)factor[iprong]=1./.7;
1870 else factor[iprong]=1./.6;
1874 if(TMath::Abs(pdgMother[iprong])==3122) {
1875 factor[iprong]=1./0.25;
1878 fillthis=
"hd0moresB_";
1881 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[iprong],factor[iprong]);
1884 fillthis=
"hd0vmoresB_";
1886 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[iprong],factor[iprong]);
1892 fillthis=
"hd0d0moresB_";
1894 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0(),factor[0]*factor[1]);
1896 fillthis=
"hcosthetapointmoresB_";
1898 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,factor[0]*factor[1]);
1901 fillthis=
"hd0d0vmoresB_";
1903 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1],factor[0]*factor[1]);
1912 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[0]);
1913 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[1]);
1915 fillthis=
"hcosthetastarB_";
1923 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1926 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1928 fillthis=
"hcosthpointd0d0B_";
1930 ((TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1932 fillthis=
"hcosthpointd0B_";
1934 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[0]);
1935 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[1]);
1940 fillthis=
"hd0vp0B_";
1942 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
1943 fillthis=
"hd0vp1B_";
1945 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
1949 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
1950 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
1958 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1962 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]*d0Prong[1]);
1965 fillthis=
"hd0d0vB_";
1967 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1970 fillthis=
"hcosthetapointB_";
1972 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1974 fillthis=
"hcosthetapointxyB_";
1980 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1982 fillthis=
"hnormdeclB_";
1984 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1986 fillthis=
"hdeclxyB_";
1988 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1990 fillthis=
"hnormdeclxyB_";
1992 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1994 fillthis=
"hdeclxyd0d0B_";
1996 ((TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1998 fillthis=
"hnormdeclxyd0d0B_";
2000 ((TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
2005 fillthis=
"hdeclvB_";
2007 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
2009 fillthis=
"hnormdeclvB_";
2011 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
2028 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
2039 Double_t ctsD0=0. ,ctsD0bar=0.; part->
CosThetaStarD0(ctsD0,ctsD0bar);
2062 if(fDebug>2) cout<<
"Candidate selected"<<endl;
2066 Int_t ptbin=cuts->
PtBin(part->Pt());
2067 Double_t pt = part->Pt();
2068 Double_t y = part->
YD0();
2070 Double_t impparXY=part->
ImpParXY()*10000.;
2071 Double_t trueImpParXY=0.;
2072 Double_t arrayForSparse[3]={invmassD0,pt,impparXY};
2073 Double_t arrayForSparseTrue[3]={invmassD0,pt,trueImpParXY};
2102 TString fillthis=
"", fillthispt=
"", fillthismasspt=
"", fillthismassy=
"";
2103 Int_t pdgDgD0toKpi[2]={321,211};
2105 Bool_t isPrimary=kTRUE;
2106 if (
fReadMC) labD0 = part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2111 Double_t weigD0bar=1.;
2115 if (weigD0 > 1.0 || weigD0 < 0.) {weigD0 = 0.;}
2116 if (weigD0bar > 1.0 || weigD0bar < 0.) {weigD0bar = 0.;}
2126 arrayForSparse[0]=invmassD0; arrayForSparse[2]=impparXY;
2130 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2132 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2133 Int_t pdgD0 = partD0->GetPdgCode();
2140 arrayForSparseTrue[0]=invmassD0; arrayForSparseTrue[2]=trueImpParXY;
2144 fillthis=
"histSgn_";
2146 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2149 fillthismasspt=
"histSgnPt";
2150 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2161 fillthismassy=
"histSgnY_";
2162 fillthismassy+=ptbin;
2163 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2168 fillthis=
"histSgn27_";
2170 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2174 fillthis=
"histRfl_";
2176 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2179 fillthismasspt=
"histRflPt";
2181 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2185 fillthismassy=
"histRflY_";
2186 fillthismassy+=ptbin;
2188 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2193 fillthis=
"histBkg_";
2195 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2198 fillthismasspt=
"histBkgPt";
2200 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2205 fillthismassy=
"histBkgY_";
2206 fillthismassy+=ptbin;
2208 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2214 fillthis=
"histMass_";
2219 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2223 fillthismasspt=
"histMassPt";
2225 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2233 fillthismassy=
"histMassY_";
2234 fillthismassy+=ptbin;
2236 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2244 arrayForSparse[0]=invmassD0bar; arrayForSparse[2]=impparXY;
2248 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2249 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2250 Int_t pdgD0 = partD0->GetPdgCode();
2257 arrayForSparseTrue[0]=invmassD0bar; arrayForSparseTrue[2]=trueImpParXY;
2260 fillthis=
"histSgn_";
2262 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2270 fillthismasspt=
"histSgnPt";
2272 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2284 fillthismassy=
"histSgnY_";
2285 fillthismassy+=ptbin;
2287 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2291 fillthis=
"histRfl_";
2293 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2295 fillthismasspt=
"histRflPt";
2297 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2300 fillthismassy=
"histRflY_";
2301 fillthismassy+=ptbin;
2303 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2307 fillthis=
"histBkg_";
2309 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2312 fillthismasspt=
"histBkgPt";
2314 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2318 fillthismassy=
"histBkgY_";
2319 fillthismassy+=ptbin;
2321 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2325 fillthis=
"histMass_";
2329 ((TH1F*)listout->FindObject(fillthis))->Fill(invmassD0bar,weigD0bar);
2333 fillthismasspt=
"histMassPt";
2335 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2339 fillthismassy=
"histMassY_";
2340 fillthismassy+=ptbin;
2342 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2355 Int_t nTrksToSkip=2;
2358 AliDebug(2,
"no daughter found!");
2361 skipped[0]=dgTrack->GetID();
2364 AliDebug(2,
"no daughter found!");
2367 skipped[1]=dgTrack->GetID();
2369 AliESDVertex *vertexESD=0x0;
2370 AliAODVertex *vertexAOD=0x0;
2371 AliVertexerTracks *vertexer =
new AliVertexerTracks(aodev->GetMagneticField());
2374 vertexer->SetSkipTracks(nTrksToSkip,skipped);
2375 vertexer->SetMinClusters(4);
2376 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
2377 if(!vertexESD)
return vertexAOD;
2378 if(vertexESD->GetNContributors()<=0) {
2379 AliDebug(2,
"vertexing failed");
2380 delete vertexESD; vertexESD=NULL;
2384 delete vertexer; vertexer=NULL;
2388 Double_t pos[3],cov[6],chi2perNDF;
2389 vertexESD->GetXYZ(pos);
2390 vertexESD->GetCovMatrix(cov);
2391 chi2perNDF = vertexESD->GetChi2toNDF();
2392 delete vertexESD; vertexESD=NULL;
2394 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF);
2405 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass: Terminate() \n");
2408 fOutputMass =
dynamic_cast<TList*
> (GetOutputData(1));
2410 printf(
"ERROR: fOutputMass not available\n");
2415 printf(
"ERROR: fOutputMass not available\n");
2420 fDistr =
dynamic_cast<TList*
> (GetOutputData(2));
2422 printf(
"ERROR: fDistr not available\n");
2427 fNentries =
dynamic_cast<TH1F*
>(GetOutputData(3));
2430 printf(
"ERROR: fNEntries not available\n");
2435 printf(
"ERROR: fCuts not available\n");
2440 printf(
"ERROR: fCounter not available\n");
2444 fDetSignal =
dynamic_cast<TList*
>(GetOutputData(8));
2446 printf(
"ERROR: fDetSignal not available\n");
2451 fOutputMassY =
dynamic_cast<TList*
> (GetOutputData(9));
2453 printf(
"ERROR: fOutputMassY not available\n");
2459 for(Int_t ipt=0;ipt<
nptbins;ipt++){
2462 fLsNormalization = 2.*TMath::Sqrt(((TH1F*)
fOutputMass->FindObject(
"hpospair"))->Integral(nptbins+ipt+1,nptbins+ipt+2)*((TH1F*)
fOutputMass->FindObject(
"hnegpair"))->Integral(nptbins+ipt+1,nptbins+ipt+2));
2467 TString massName=
"histMass_";
2479 TString nameDistr=
"hdcaB_";
2485 nameDistr=
"hd0d0B_";
2488 nameDistr=
"hcosthetapointB_";
2495 nameDistr=
"hcosthetastarB_";
2498 nameDistr=
"hcosthpointd0d0B_";
2505 TString cvname,cstname;
2515 TCanvas *cMass=
new TCanvas(cvname,cvname);
2519 TCanvas* cStat=
new TCanvas(cstname,Form(
"Stat%s",
fArray ?
"LS" :
"D0"));
2535 Int_t nmassbins=200;
2536 Double_t fLowmasslimit=1.5648, fUpmasslimit=2.1648;
2537 Int_t fNImpParBins=400;
2538 Double_t fLowerImpPar=-2000., fHigherImpPar=2000.;
2539 Int_t
nbins[3]={nmassbins,200,fNImpParBins};
2540 Double_t xmin[3]={fLowmasslimit,0.,fLowerImpPar};
2541 Double_t xmax[3]={fUpmasslimit,20.,fHigherImpPar};
2545 "Mass vs. pt vs.imppar - All",
2548 "Mass vs. pt vs.imppar - promptD",
2551 "Mass vs. pt vs.imppar - DfromB",
2554 "Mass vs. pt vs.true imppar -DfromB",
2557 "Mass vs. pt vs.imppar - backgr.",
2560 for(Int_t i=0; i<5;i++){
2569 printf(
" AliAnalysisTaskSED0MassV1::GetTrueImpactParameter() \n");
2571 Double_t vtxTrue[3];
2572 mcHeader->GetVertex(vtxTrue);
2574 partD0->XvYvZv(origD);
2575 Short_t
charge=partD0->Charge();
2576 Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2];
2577 for(Int_t iDau=0; iDau<2; iDau++){
2584 Int_t labelFirstDau = partD0->GetDaughter(0);
2586 for(Int_t iDau=0; iDau<2; iDau++){
2587 Int_t ind = labelFirstDau+iDau;
2588 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
2590 Int_t pdgCode = TMath::Abs( part->GetPdgCode() );
2592 AliError(
"Daughter particle not found in MC array");
2595 if(pdgCode==211 || pdgCode==321){
2596 pXdauTrue[iDau]=part->Px();
2597 pYdauTrue[iDau]=part->Py();
2598 pZdauTrue[iDau]=part->Pz();
2602 Double_t d0dummy[2]={0.,0.};
2603 AliAODRecoDecayHF aodDzeroMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
2613 printf(
" AliAnalysisTaskSED0Mass V1::CheckOrigin() \n");
2615 Int_t pdgGranma = 0;
2617 mother = mcPartCandidate->GetMother();
2619 Int_t abspdgGranma =0;
2620 Bool_t isFromB=kFALSE;
2621 Bool_t isQuarkFound=kFALSE;
2624 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
2626 pdgGranma = mcGranma->GetPdgCode();
2627 abspdgGranma = TMath::Abs(pdgGranma);
2628 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
2631 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
2632 mother = mcGranma->GetMother();
2634 AliError(
"Failed casting the mother particle!");
2639 if(isFromB)
return 5;
2646 const Int_t nVarPrompt = 2;
2647 const Int_t nVarFD = 3;
2649 Int_t nbinsPrompt[nVarPrompt]={200,100};
2650 Int_t nbinsFD[nVarFD]={200,100,200};
2652 Double_t xminPrompt[nVarPrompt] = {0.,-1.};
2653 Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
2655 Double_t xminFD[nVarFD] = {0.,-1.,0.};
2656 Double_t xmaxFD[nVarFD] = {40.,1.,40.};
2659 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
2664 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
2665 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
2667 fMCAccBFeed->GetAxis(2)->SetTitle(
"p_{T}^{B} (GeV/c)");
2675 const Int_t nProng = 2;
2676 Double_t zMCVertex = mcHeader->GetVtxZ();
2678 for(Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
2679 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
2680 if (TMath::Abs(mcPart->GetPdgCode()) == 421){
2685 Bool_t isGoodDecay=kFALSE;
2686 Int_t labDau[4]={-1,-1,-1,-1};
2687 Bool_t isInAcc = kFALSE;
2688 Bool_t isFidAcc = kFALSE;
2691 if(deca > 0) isGoodDecay=kTRUE;
2698 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
2700 if(isGoodDecay && TMath::Abs(zMCVertex) <
fCuts->
GetMaxVtxZ() && isFidAcc && isInAcc) {
2704 Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
2711 Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
2723 for (Int_t iProng = 0; iProng<nProng; iProng++){
2724 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
2725 if(!mcPartDaughter)
return kFALSE;
2726 Double_t eta = mcPartDaughter->Eta();
2727 Double_t pt = mcPartDaughter->Pt();
2728 if (TMath::Abs(eta) > 0.9 || pt < 0.1)
return kFALSE;
2735 Double_t pointD0[9];
2736 Double_t pointD0bar[9];
2737 Double_t pointD0MC[9];
2742 Double_t diffIP[2], errdiffIP[2];
2745 normIP[0]=diffIP[0]/errdiffIP[0];
2746 normIP[1]=diffIP[1]/errdiffIP[1];
2748 AliAODVertex* secvtx=part->GetSecondaryVtx();
2750 Double_t err2decaylength=secvtx->Error2DistanceXYToVertex(primvtx);
2751 Double_t lxy=part->AliAODRecoDecay::DecayLengthXY(primvtx);
2756 Int_t pdgDgD0toKpi[2]={321,211};
2758 lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2761 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(lab);
2763 if(orig==4)signalType=1;
2764 else if(orig==5)signalType=2;
2772 Double_t arrayMC[8]={part->Pt(), ptB,normIP[0], normIP[1], lxy, lxy/TMath::Sqrt(err2decaylength),(Double_t)isCuts, (Double_t)isPid};
2775 for(Int_t i=0; i<8; i++){
2776 pointD0MC[i]=arrayMC[i];
2788 if(!IsSelectedPIDoff)
return;
2791 Double_t array[9]={part->Pt(),normIP[0],normIP[1],lxy,lxy/TMath::Sqrt(err2decaylength),part->
InvMassD0(),(Double_t)IsSelectedPIDoff,(Double_t)pid,0.};
2792 for(Int_t i=0;i<9;i++){
2793 pointD0[i]=array[i];
2798 Double_t arrayD0bar[9]={part->Pt(),normIP[0],normIP[1],lxy,lxy/TMath::Sqrt(err2decaylength),part->
InvMassD0bar(),(Double_t)IsSelectedPIDoff,(Double_t)pid,1.};
2799 for(Int_t i=0;i<9;i++){
2800 pointD0bar[i]=arrayD0bar[i];
THnSparseF * fMCAccBFeed
!histo for StepMCAcc for D0 FD (pt,y,ptB)
Double_t NormalizedDecayLengthXY() const
TList * fOutputMassPt
! list send on output slot 6
Bool_t fDrawDetSignal
flag to decide whether to fill "PID = x" bins in fNentrie
Bool_t fFillYHist
flag to fill Pt and Impact Parameter Histograms
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
void FillVarHists(AliAODEvent *aodev, AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliRDHFCutsD0toKpi *cuts, TList *listout)
Bool_t GetCombPID() const
Double_t * fCandidateVariables
! variables to be written to the tree
void Draw(Int_t cell[], Int_t iBC, Int_t nBC, TString datapath="/scratch/alicehp2/germain/QANew2/", TString period="LHC15f", TString pass="pass2", Int_t trial=0, const Int_t cellref=2377)
Bool_t HasSelectionBit(Int_t i) const
void UnsetOwnPrimaryVtx()
AliAnalysisTaskSED0Mass()
Double_t NormalizedDecayLength2() const
Double_t ImpParXY() const
Bool_t fWriteVariableTree
flag to check or not the selection bit
void CreateImpactParameterHistos()
TList * fDistr
! list send on output slot 2
void NormIPvar(AliAODEvent *aod, AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC)
Int_t GetWhyRejection() const
TList * fDetSignal
!Detector signal histograms (on output slot 8)
Double_t CosPointingAngleXY() const
Bool_t fUseSelectionBit
flag to fill Pt and Impact Parameter Histograms
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
Double_t InvMassD0() const
void FillMCAcceptanceHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader)
Int_t fSys
flag to enable filling variable histos
ULong_t GetSelectionMap() const
Double_t Prodd0d0() const
TList * fOutputMass
! list send on output slot 1
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
Bool_t CheckAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
Bool_t fReadMC
can be D0 or Like Sign candidates
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Double_t GetMaxVtxZ() const
AliRDHFCutsD0toKpi * fCuts
virtual ~AliAnalysisTaskSED0Mass()
Int_t GetBayesianStrategy() const
Bool_t HasBadDaughters() const
THnSparseF * fHistMassPtImpParTC[5]
! histograms for impact paramter studies
TH1F * fNentries
! histogram with number of events on output slot 3
virtual void UserCreateOutputObjects()
Implementation of interface methods.
Bool_t fFillPtHist
flag to reject events with SDD clusters
Bool_t fFillImpParHist
flag to fill Y Histograms
Int_t GetIsFilled() const
Double_t CosThetaStarD0bar() const
angle of K
Bool_t fUseQuarkTagInKine
flag to decide whether to draw the TPC dE/dx and TOF signal before/after PID
Bool_t fIsRejectSDDClusters
fSys=0 -> p-p; fSys=1 ->PbPb (in this case fFillVarHists=kFALSE by default: set it to kTRUE after if ...
static Int_t CheckD0Decay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
Bool_t AreDaughtersSelected(AliAODRecoDecayHF *rd) const
Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPartCandidate) const
void CreateMCAcceptanceHistos()
virtual void Terminate(Option_t *option)
Float_t GetTrueImpactParameter(AliAODMCHeader *mcHeader, TClonesArray *arrayMC, AliAODMCParticle *partD0) const
Double_t InvMassD0bar() const
void DrawDetSignal(AliAODRecoDecayHF2Prong *part, TList *ListDetSignal)
Double_t fLsNormalization
number of pt bins
Bool_t fUsePid4Distr
flag to decide if apply cut also on distributions: 0 no cuts, 1 looser cuts, 2 tighter/ cuts ...
Double_t DecayLength2() const
kinematics & topology
THnSparseF * fhStudyImpParSingleTrackFd
! sparse with imp par residual cuts for MC
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)
Bool_t fCutOnDistr
flag for MC array: kTRUE = read it, kFALSE = do not read it
AliAODVertex * GetPrimaryVtxSkipped(AliAODEvent *aodev)
Int_t IsSelectedSpecialCuts(AliAODRecoDecayHF *d) const
THnSparseF * fhStudyImpParSingleTrackSign
! sparse with imp par residual cuts for MC
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
Double_t DecayLengthXY() const
static Double_t GetBeautyMotherPt(TClonesArray *arrayMC, AliAODMCParticle *mcPart)
void FillMassHists(AliAODRecoDecayHF2Prong *part, TClonesArray *arrMC, AliAODMCHeader *mcHeader, AliRDHFCutsD0toKpi *cuts, TList *listout)
Int_t fIsSelectedCandidate
keeps the daughter tracks
Bool_t GetIsPrimaryWithoutDaughters() const
Double_t * GetWeightsPositive() const
Bool_t IsEventSelected(AliVEvent *event)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
void SetUsePID(Bool_t flag=kTRUE)
THnSparseF * fhStudyImpParSingleTrackCand
! sparse with imp par residual cuts for Data
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
virtual Int_t IsSelectedPID(AliAODRecoDecayHF *rd)
TList * fOutputMassY
! list send on output slot 9
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Bool_t GetIsUsePID() const
AliAODVertex * GetPrimaryVtx() const
virtual void UserExec(Option_t *option)
TObjArray fDaughterTracks
flag to fill mass histogram with D0/D0bar only (0 = fill with both, 1 = fill with D0 only...
Double_t CosPointingAngle() const
Double_t DecayLengthXYError() const
Double_t CosThetaStarD0() const
Int_t fFillOnlyD0D0bar
normalization
THnSparseF * fMCAccPrompt
!histo for StepMCAcc for D0 prompt (pt,y,ptB)
Int_t PtBin(Double_t pt) const
Bool_t fFillVarHists
selection outcome
AliNormalizationCounter * fCounter
! AliNormalizationCounter on output slot 5
Double_t * GetWeightsNegative() const