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 fFillSubSampleHist(kFALSE),
95 fUseSelectionBit(kTRUE),
97 fWriteVariableTree(kFALSE),
99 fCandidateVariables(),
101 fDrawDetSignal(kFALSE),
102 fUseQuarkTagInKine(kTRUE),
104 fhStudyImpParSingleTrackSign(0),
105 fhStudyImpParSingleTrackCand(0),
106 fhStudyImpParSingleTrackFd(0),
108 fhMultVZEROTPCoutTrackCorrNoCut(0x0),
109 fhMultVZEROTPCoutTrackCorr(0x0),
110 fEnablePileupRejVZEROTPCout(kFALSE)
172 DefineOutput(1,TList::Class());
174 DefineOutput(2,TList::Class());
176 DefineOutput(3,TH1F::Class());
178 DefineOutput(4,AliRDHFCutsD0toKpi::Class());
180 DefineOutput(5,AliNormalizationCounter::Class());
182 DefineOutput(6,TList::Class());
184 DefineOutput(7,TTree::Class());
186 DefineOutput(8, TList::Class());
188 DefineOutput(9, TList::Class());
214 for(
Int_t i=0; i<5; i++){
255 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::Init() \n");
259 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
260 copyfCuts->SetName(nameoutput);
262 PostData(4,copyfCuts);
274 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::UserCreateOutputObjects() \n");
291 fDistr->SetName(
"distributionslist");
297 TString nameMass=
" ",nameSgn27=
" ",nameSgn=
" ", nameBkg=
" ", nameRfl=
" ",nameMassNocutsS =
" ",nameMassNocutsB =
" ", namedistr=
" ";
298 TString nameMassPt=
"", nameSgnPt=
"", nameBkgPt=
"", nameRflPt=
"";
299 TString nameMassY=
"", nameSgnY=
"", nameBkgY=
"", nameRflY=
"";
306 nameMass=
"histMass_";
308 nameSgn27=
"histSgn27_";
316 nameMassNocutsS=
"hMassS_";
318 nameMassNocutsB=
"hMassB_";
325 namedistr=
"hNclsD0vsptS_";
327 TH2F *hNclsD0vsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
328 namedistr=
"hNclsD0barvsptS_";
330 TH2F *hNclsD0barvsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
332 namedistr=
"hNITSpointsD0vsptS_";
334 TH2F *hNITSpointsD0vsptS =
new TH2F(namedistr.Data(),
"N ITS points distrubution [S];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
336 namedistr=
"hNSPDpointsD0S_";
338 TH1I *hNSPDpointsD0S =
new TH1I(namedistr.Data(),
"N SPD points distrubution [S]; ;N tracks",4,0,4);
339 hNSPDpointsD0S->GetXaxis()->SetBinLabel(1,
"no SPD");
340 hNSPDpointsD0S->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
341 hNSPDpointsD0S->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
342 hNSPDpointsD0S->GetXaxis()->SetBinLabel(4,
"kBoth");
346 TH1F *hptD0S =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
347 namedistr=
"hptD0barS_";
349 TH1F *hptD0barS =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
351 namedistr=
"hphiD0S_";
353 TH1F *hphiD0S =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
354 namedistr=
"hphiD0barS_";
356 TH1F *hphiD0barS =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
359 namedistr=
"hetaphiD0candidateS_";
361 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());
362 namedistr=
"hetaphiD0barcandidateS_";
364 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());
366 namedistr=
"hetaphiD0candidatesignalregionS_";
368 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());
369 namedistr=
"hetaphiD0barcandidatesignalregionS_";
371 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());
376 TH1F *hdcaS =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
380 TH1F *hd0piS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions);d0(#pi) [cm]",200,-0.1,0.1);
384 TH1F *hd0KS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons);d0(K) [cm]",200,-0.1,0.1);
387 TH1F *hd0d0S =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
392 TH1F *hdeclengthS =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm]",200,0,0.015);
394 namedistr=
"hnormdeclS_";
396 TH1F *hnormdeclengthS =
new TH1F(namedistr.Data(),
"Normalized Decay Length^{2} distribution;(Decay Length/Err)^{2} ",200,0,12.);
398 namedistr=
"hdeclxyS_";
400 TH1F* hdeclxyS=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
401 namedistr=
"hnormdeclxyS_";
403 TH1F* hnormdeclxyS=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
405 namedistr=
"hdeclxyd0d0S_";
407 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);
409 namedistr=
"hnormdeclxyd0d0S_";
411 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);
414 namedistr=
"hcosthetapointS_";
416 TH1F *hcosthetapointS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
418 namedistr=
"hcosthetapointxyS_";
420 TH1F *hcosthetapointxyS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XYdistribution;cos#theta_{Point}",300,0.,1.);
422 TH1F* tmpMS =
new TH1F(nameMassNocutsS.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
425 fDistr->Add(hNclsD0vsptS);
426 fDistr->Add(hNclsD0barvsptS);
427 fDistr->Add(hNITSpointsD0vsptS);
428 fDistr->Add(hNSPDpointsD0S);
433 fDistr->Add(hetaphiD0candidateS);
434 fDistr->Add(hetaphiD0candidatesignalregionS);
435 fDistr->Add(hetaphiD0barcandidateS);
436 fDistr->Add(hetaphiD0barcandidatesignalregionS);
445 fDistr->Add(hcosthetapointS);
447 fDistr->Add(hcosthetapointxyS);
451 fDistr->Add(hnormdeclengthS);
455 fDistr->Add(hnormdeclxyS);
457 fDistr->Add(hdeclxyd0d0S);
458 fDistr->Add(hnormdeclxyd0d0S);
466 namedistr=
"hNclsD0vsptB_";
468 TH2F *hNclsD0vsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
469 namedistr=
"hNclsD0barvsptB_";
471 TH2F *hNclsD0barvsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
473 namedistr=
"hNITSpointsD0vsptB_";
475 TH2F *hNITSpointsD0vsptB =
new TH2F(namedistr.Data(),
"N ITS points distrubution [B];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
477 namedistr=
"hNSPDpointsD0B_";
479 TH1I *hNSPDpointsD0B =
new TH1I(namedistr.Data(),
"N SPD points distrubution [B]; ;N tracks",4,0,4);
480 hNSPDpointsD0B->GetXaxis()->SetBinLabel(1,
"no SPD");
481 hNSPDpointsD0B->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
482 hNSPDpointsD0B->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
483 hNSPDpointsD0B->GetXaxis()->SetBinLabel(4,
"kBoth");
487 TH1F *hptD0B =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
488 namedistr=
"hptD0barB_";
490 TH1F *hptD0barB =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
492 namedistr=
"hphiD0B_";
494 TH1F *hphiD0B =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
495 namedistr=
"hphiD0barB_";
497 TH1F *hphiD0barB =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
499 namedistr=
"hetaphiD0candidateB_";
501 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());
502 namedistr=
"hetaphiD0barcandidateB_";
504 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());
506 namedistr=
"hetaphiD0candidatesignalregionB_";
508 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());
509 namedistr=
"hetaphiD0barcandidatesignalregionB_";
511 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());
516 TH1F *hdcaB =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
521 TH1F *hd0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
525 TH1F *hd0d0B =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
530 TH1F *hdeclengthB =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm^{2}]",200,0,0.015);
532 namedistr=
"hnormdeclB_";
534 TH1F *hnormdeclengthB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution;(Decay Length/Err)^{2} ",200,0,12.);
536 namedistr=
"hdeclxyB_";
538 TH1F* hdeclxyB=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
539 namedistr=
"hnormdeclxyB_";
541 TH1F* hnormdeclxyB=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
543 namedistr=
"hdeclxyd0d0B_";
545 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);
547 namedistr=
"hnormdeclxyd0d0B_";
549 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);
552 namedistr=
"hcosthetapointB_";
554 TH1F *hcosthetapointB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
556 namedistr=
"hcosthetapointxyB_";
558 TH1F *hcosthetapointxyB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XY distribution;cos#theta_{Point} XY",300,0.,1.);
560 TH1F* tmpMB =
new TH1F(nameMassNocutsB.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
564 fDistr->Add(hNclsD0vsptB);
565 fDistr->Add(hNclsD0barvsptB);
566 fDistr->Add(hNITSpointsD0vsptB);
567 fDistr->Add(hNSPDpointsD0B);
572 fDistr->Add(hetaphiD0candidateB);
573 fDistr->Add(hetaphiD0candidatesignalregionB);
574 fDistr->Add(hetaphiD0barcandidateB);
575 fDistr->Add(hetaphiD0barcandidatesignalregionB);
583 fDistr->Add(hcosthetapointB);
585 fDistr->Add(hcosthetapointxyB);
589 fDistr->Add(hnormdeclengthB);
593 fDistr->Add(hnormdeclxyB);
595 fDistr->Add(hdeclxyd0d0B);
596 fDistr->Add(hnormdeclxyd0d0B);
604 namedistr=
"hd0vpiS_";
606 TH1F *hd0vpiS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions)(vtx w/o these tracks);d0(#pi) [cm]",200,-0.1,0.1);
610 TH1F *hd0vKS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons) (vtx w/o these tracks);d0(K) [cm]",200,-0.1,0.1);
612 namedistr=
"hd0d0vS_";
614 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);
616 namedistr=
"hdeclvS_";
618 TH1F *hdeclengthvS =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
620 namedistr=
"hnormdeclvS_";
622 TH1F *hnormdeclengthvS =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
627 fDistr->Add(hdeclengthvS);
628 fDistr->Add(hnormdeclengthvS);
632 namedistr=
"hd0vmoresB_";
634 TH1F *hd0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
636 namedistr=
"hd0d0vmoresB_";
638 TH1F *hd0d0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
643 TH1F *hd0vB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
645 namedistr=
"hd0vp0B_";
647 TH1F *hd0vp0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong + ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
649 namedistr=
"hd0vp1B_";
651 TH1F *hd0vp1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong - ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
653 namedistr=
"hd0d0vB_";
655 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);
657 namedistr=
"hdeclvB_";
659 TH1F *hdeclengthvB =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
661 namedistr=
"hnormdeclvB_";
663 TH1F *hnormdeclengthvB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
671 fDistr->Add(hd0d0vmoresB);
673 fDistr->Add(hdeclengthvB);
675 fDistr->Add(hnormdeclengthvB);
685 TH1F* tmpSt =
new TH1F(nameSgn.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
687 TH1F *tmpSl=(TH1F*)tmpSt->Clone();
692 TH1F* tmpRt =
new TH1F(nameRfl.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
694 TH1F* tmpBt =
new TH1F(nameBkg.Data(),
"Background invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
708 TH1F* tmpMt =
new TH1F(nameMass.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
719 nameMassSubSample=
"histMassvsSubSample_";
720 nameMassSubSample+=i;
721 TH2F* tmpMtSub =
new TH2F(nameMassSubSample.Data(),
"D^{0} invariant mass; M [GeV]; Sample ID; Entries",600,1.6248,2.2248,25,-0.5,24.5);
733 TH1F *hptpiS =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
737 TH1F *hptKS =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
740 namedistr=
"hcosthetastarS_";
742 TH1F *hcosthetastarS =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
746 namedistr=
"hptpiSnoMcut_";
748 TH1F *hptpiSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
750 namedistr=
"hptKSnoMcut_";
752 TH1F *hptKSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
756 fDistr->Add(hcosthetastarS);
758 fDistr->Add(hptpiSnoMcut);
762 namedistr=
"hcosthpointd0S_";
764 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);
765 namedistr=
"hcosthpointd0d0S_";
767 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);
769 fDistr->Add(hcosthpointd0S);
770 fDistr->Add(hcosthpointd0d0S);
773 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);
774 TH1F *tmpS27l=(TH1F*)tmpS27t->Clone();
786 TH1F *hptB =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
789 namedistr=
"hcosthetastarB_";
791 TH1F *hcosthetastarB =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
794 namedistr=
"hptB1prongnoMcut_";
796 TH1F *hptB1pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
798 namedistr=
"hptB2prongsnoMcut_";
800 TH1F *hptB2pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
803 fDistr->Add(hcosthetastarB);
805 fDistr->Add(hptB1pnoMcut);
806 fDistr->Add(hptB2pnoMcut);
811 TH1F *hd0p0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.1,0.1);
815 TH1F *hd0p1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong -);d0 [cm]",200,-0.1,0.1);
818 namedistr=
"hd0moresB_";
820 TH1F *hd0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
822 namedistr=
"hd0d0moresB_";
824 TH1F *hd0d0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
827 namedistr=
"hcosthetapointmoresB_";
829 TH1F *hcosthetapointmoresB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
832 namedistr=
"hcosthpointd0B_";
834 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);
836 namedistr=
"hcosthpointd0d0B_";
838 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);
845 fDistr->Add(hcosthetapointmoresB);
848 fDistr->Add(hcosthpointd0B);
851 fDistr->Add(hcosthpointd0d0B);
859 Int_t nbinsImpParStudy[9]= {50, 40, 40, 20, 15, 600, 3,4,2};
860 Double_t limitLowImpParStudy[9]={0, -5, -5, 0, 0,1.6248,1,0,0};
861 Double_t limitUpImpParStudy[9]= {50., 5, 5, 0.2,15,2.2248,4,4,2};
862 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"};
863 fhStudyImpParSingleTrackCand=
new THnSparseF(
"fhStudyImpParSingleTrackCand",
"fhStudyImpParSingleTrackCand",9,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
871 Int_t nbinsImpParStudy[8]= {50,50,40, 40, 20, 15, 3, 4};
872 Double_t limitLowImpParStudy[8]={0, 0, -5,-5., 0., 0., 1.,0.};
873 Double_t limitUpImpParStudy[8]= {50.,50., 5, 5, 0.2, 15, 3.,4.};
875 fhStudyImpParSingleTrackSign=
new THnSparseF(
"fhStudyImpParSingleTrackSign",
"fhStudyImpParSingleTrackSign",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
876 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"};
881 fhStudyImpParSingleTrackFd=
new THnSparseF(
"fhStudyImpParSingleTrackFd",
"fhStudyImpParSingleTrackFd",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
893 namedistr=
"hpospair";
895 namedistr=
"hnegpair";
905 nameMassPt=
"histMassPt";
906 nameSgnPt=
"histSgnPt";
907 nameBkgPt=
"histBkgPt";
908 nameRflPt=
"histRflPt";
912 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);
913 TH2F *tmpSlPt=(
TH2F*)tmpStPt->Clone();
918 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);
919 TH2F* tmpBtPt =
new TH2F(nameBkgPt.Data(),
"Background invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
933 TH2F* tmpMtPt =
new TH2F(nameMassPt.Data(),
"D^{0} invariant mass; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
945 nameMassY=
"histMassY_";
947 nameSgnY=
"histSgnY_";
949 nameBkgY=
"histBkgY_";
951 nameRflY=
"histRflY_";
955 TH2F* tmpStY =
new TH2F(nameSgnY.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
958 TH2F* tmpRtY =
new TH2F(nameRflY.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
959 TH2F* tmpBtY =
new TH2F(nameBkgY.Data(),
"Background invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
967 TH2F* tmpMtY =
new TH2F(nameMassY.Data(),
"D^{0} invariant mass; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
974 const char* nameoutput=GetOutputSlot(3)->GetContainer()->GetName();
976 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", 23,-0.5,22.5);
978 fNentries->GetXaxis()->SetBinLabel(1,
"nEventsAnal");
979 fNentries->GetXaxis()->SetBinLabel(2,
"nCandSel(Cuts)");
981 else fNentries->GetXaxis()->SetBinLabel(3,
"Dstar<-D0");
982 fNentries->GetXaxis()->SetBinLabel(4,
"nEventsGoodVtxS");
983 fNentries->GetXaxis()->SetBinLabel(5,
"ptbin = -1");
984 fNentries->GetXaxis()->SetBinLabel(6,
"no daughter");
985 if(
fSys==0)
fNentries->GetXaxis()->SetBinLabel(7,
"nCandSel(Tr)");
987 fNentries->GetXaxis()->SetBinLabel(8,
"PID=0");
988 fNentries->GetXaxis()->SetBinLabel(9,
"PID=1");
989 fNentries->GetXaxis()->SetBinLabel(10,
"PID=2");
990 fNentries->GetXaxis()->SetBinLabel(11,
"PID=3");
993 fNentries->GetXaxis()->SetBinLabel(12,
"K");
994 fNentries->GetXaxis()->SetBinLabel(13,
"Lambda");
996 fNentries->GetXaxis()->SetBinLabel(14,
"Pile-up Rej");
997 fNentries->GetXaxis()->SetBinLabel(15,
"N. of 0SMH");
998 if(
fSys==1)
fNentries->GetXaxis()->SetBinLabel(16,
"Nev in centr");
1000 fNentries->GetXaxis()->SetBinLabel(18,
"Phys.Sel.Rej");
1001 fNentries->GetXaxis()->SetBinLabel(19,
"D0 failed to be filled");
1002 fNentries->GetXaxis()->SetBinLabel(20,
"fisFilled is 0");
1003 fNentries->GetXaxis()->SetBinLabel(21,
"fisFilled is 1");
1004 fNentries->GetXaxis()->SetBinLabel(22,
"AOD/dAOD mismatch");
1005 fNentries->GetXaxis()->SetBinLabel(23,
"AOD/dAOD #events ok");
1006 fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
1014 nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
1019 fCandidateVariableNames[0] =
"massD0";
1020 fCandidateVariableNames[1] =
"massD0bar";
1021 fCandidateVariableNames[2] =
"pt";
1022 fCandidateVariableNames[3] =
"dca";
1023 fCandidateVariableNames[4] =
"costhsD0";
1024 fCandidateVariableNames[5] =
"costhsD0bar";
1025 fCandidateVariableNames[6] =
"ptk";
1026 fCandidateVariableNames[7] =
"ptpi";
1027 fCandidateVariableNames[8] =
"d0k";
1028 fCandidateVariableNames[9] =
"d0pi";
1029 fCandidateVariableNames[10] =
"d0xd0";
1030 fCandidateVariableNames[11] =
"costhp";
1031 fCandidateVariableNames[12] =
"costhpxy";
1032 fCandidateVariableNames[13] =
"lxy";
1033 fCandidateVariableNames[14] =
"specialcuts";
1043 TH2F *TOFSigBefPID =
new TH2F(
"TOFSigBefPID",
"TOF signal of daughters before PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1044 TH2F *TOFSigAftPID =
new TH2F(
"TOFSigAftPID",
"TOF signal after PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1046 TH2F *TPCSigBefPID =
new TH2F(
"TPCSigBefPID",
"TPC dE/dx before PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1047 TH2F *TPCSigAftPID =
new TH2F(
"TPCSigAftPID",
"TPC dE/dx after PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1057 fhMultVZEROTPCoutTrackCorr =
new TH2F(
"hMultVZEROTPCoutTrackCorr",
";Tracks with kTPCout on;VZERO multiplicity", 1000, 0., 30000., 1000, 0., 40000.);
1102 if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 &&
fAODProtection==1)) {
1118 bname=
"LikeSign2Prong";
1120 TClonesArray *inputArray=0;
1121 if(!aod && AODEvent() && IsStandardAOD()) {
1127 AliAODHandler* aodHandler = (AliAODHandler*)
1128 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1130 if(aodHandler->GetExtensions()) {
1131 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
1133 inputArray=(TClonesArray*)aodFromExt->GetList()->FindObject(bname.Data());
1136 inputArray=(TClonesArray*)aod->GetList()->FindObject(bname.Data());
1139 if(!inputArray || !aod) {
1140 printf(
"AliAnalysisTaskSED0Mass::UserExec: input branch not found!\n");
1145 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001)
return;
1147 TClonesArray *mcArray = 0;
1148 AliAODMCHeader *mcHeader = 0;
1152 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1154 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC particles branch not found!\n");
1159 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1161 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC header branch not found!\n");
1169 AliAODVZERO* v0data=(AliAODVZERO*)((
AliAODEvent*)aod)->GetVZEROData();
1170 Float_t mTotV0A=v0data->GetMTotV0A();
1171 Float_t mTotV0C=v0data->GetMTotV0C();
1172 mTotV0=mTotV0A+mTotV0C;
1173 Int_t ntracksEv = aod->GetNumberOfTracks();
1174 for(
Int_t itrack=0; itrack<ntracksEv; itrack++) {
1176 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1177 if(!track) {AliFatal(
"Not a standard AOD");}
1178 if(track->GetID()<0)
continue;
1179 if((track->GetFlags())&(AliESDtrack::kTPCout)) nTPCout++;
1183 Float_t mV0Cut=-2200.+(2.5*nTPCout)+(0.000012*nTPCout*nTPCout);
1185 if(mTotV0<mV0Cut)
return;
1195 TString trigclass=aod->GetFiredTriggerClasses();
1196 if(trigclass.Contains(
"C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains(
"C0SMH-B-NOPF-ALL"))
fNentries->Fill(14);
1210 Bool_t skipEvent = kFALSE;
1212 if (aod) ntracks = aod->GetNumberOfTracks();
1213 for(
Int_t itrack=0; itrack<ntracks; itrack++) {
1215 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1216 if(!track) AliFatal(
"Not a standard AOD");
1217 if(TESTBIT(track->GetITSClusterMap(),2) || TESTBIT(track->GetITSClusterMap(),3) ){
1223 if (skipEvent)
return;
1231 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1236 TString primTitle = vtx1->GetTitle();
1237 if(primTitle.Contains(
"VertexerTracks") && vtx1->GetNContributors()>0) {
1245 Int_t nInD0toKpi = inputArray->GetEntriesFast();
1246 if(fDebug>2) printf(
"Number of D0->Kpi: %d\n",nInD0toKpi);
1250 Int_t nSelectedloose=0,nSelectedtight=0;
1257 for (
Int_t iD0toKpi = 0; iD0toKpi < nInD0toKpi; iD0toKpi++) {
1278 if(ptbin==-1) {
fNentries->Fill(4);
continue;}
1286 AliDebug(1,
"at least one daughter not found!");
1301 Int_t isSelectedPIDfill = 3;
1304 if (isSelectedPIDfill == 0)
fNentries->Fill(7);
1305 if (isSelectedPIDfill == 1)
fNentries->Fill(8);
1306 if (isSelectedPIDfill == 2)
fNentries->Fill(9);
1307 if (isSelectedPIDfill == 3)
fNentries->Fill(10);
1339 AliESDtrack *esdtrack1 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1340 AliESDtrack *esdtrack2 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1344 Int_t isSelectedPIDfill = 3;
1349 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1350 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1351 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1352 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1354 if (isSelectedPIDfill != 0) {
1355 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1356 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1357 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1358 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1375 Int_t pdgDgD0toKpi[2]={321,211};
1377 if(
fReadMC) lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
1379 Int_t isSelectedPID=3;
1382 if (isSelectedPID==0)
fNentries->Fill(7);
1383 if (isSelectedPID==1)
fNentries->Fill(8);
1384 if (isSelectedPID==2)
fNentries->Fill(9);
1385 if (isSelectedPID==3)
fNentries->Fill(10);
1396 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1407 TString fillthispi=
"",fillthisK=
"",fillthis=
"", fillthispt=
"", fillthisetaphi=
"";
1412 Double_t dz1[2],dz2[2],covar1[3],covar2[3];
1413 dz1[0]=-99; dz2[0]=-99;
1423 AliAODVertex *vtxProp=0x0;
1429 AliESDtrack *esdtrack1=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1430 AliESDtrack *esdtrack2=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1431 esdtrack1->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz1,covar1);
1432 esdtrack2->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz2,covar2);
1433 delete vtxProp; vtxProp=NULL;
1450 Double_t normalizedDecayLength2 = -1, normalizedDecayLengthxy=-1;
1451 Double_t decayLength2 = -1, decayLengthxy=-1;
1466 if(!prong0 || !prong1) {
1471 labprong[0]=prong0->GetLabel();
1472 labprong[1]=prong1->GetLabel();
1474 AliAODMCParticle *mcprong=0;
1475 Int_t pdgProng[2]={0,0};
1477 for (
Int_t iprong=0;iprong<2;iprong++){
1478 if(
fReadMC && labprong[iprong]>=0) {
1479 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1480 pdgProng[iprong]=mcprong->GetPdgCode();
1487 fillthispi=
"hptpiSnoMcut_";
1490 fillthisK=
"hptKSnoMcut_";
1493 if ((TMath::Abs(pdgProng[0]) == 211 && TMath::Abs(pdgProng[1]) == 321)
1494 || (isSelectedPID==1 || isSelectedPID==3)){
1495 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong0->Pt());
1496 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong1->Pt());
1499 if ((TMath::Abs(pdgProng[0]) == 321 && TMath::Abs(pdgProng[1]) == 211)
1500 || (isSelectedPID==2 || isSelectedPID==3)){
1501 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong0->Pt());
1502 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong1->Pt());
1514 fillthispt=
"histSgnPt";
1516 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)
1517 || (!
fReadMC && (isSelectedPID==1 || isSelectedPID==3))){
1518 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1521 fillthisetaphi=
"hetaphiD0candidateS_";
1522 fillthisetaphi+=ptbin;
1523 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1525 if(TMath::Abs(minvD0-mPDG)<0.05){
1526 fillthisetaphi=
"hetaphiD0candidatesignalregionS_";
1527 fillthisetaphi+=ptbin;
1528 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1534 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1537 fillthisetaphi=
"hetaphiD0barcandidateS_";
1538 fillthisetaphi+=ptbin;
1539 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1541 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1542 fillthisetaphi=
"hetaphiD0barcandidatesignalregionS_";
1543 fillthisetaphi+=ptbin;
1544 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1551 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1561 ptProng[0]=prong0->Pt(); ptProng[1]=prong1->Pt();
1562 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1564 if(
fArray==1) cout<<
"LS signal: ERROR"<<endl;
1565 for (
Int_t iprong=0; iprong<2; iprong++){
1567 if (
fReadMC) labprong[iprong]=prong->GetLabel();
1571 if(
fReadMC && labprong[iprong]>=0) {
1572 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1573 pdgprong=mcprong->GetPdgCode();
1576 Bool_t isPionHere[2]={(isSelectedPID==1 || isSelectedPID==3) ? kTRUE : kFALSE,(isSelectedPID==2 || isSelectedPID==3) ? kTRUE : kFALSE};
1578 if(TMath::Abs(pdgprong)==211 || isPionHere[iprong]) {
1582 fillthispi=
"hptpiS_";
1584 ((TH1F*)listout->FindObject(fillthispi))->Fill(ptProng[iprong]);
1587 fillthispi=
"hd0piS_";
1589 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0Prong[iprong]);
1592 fillthispi=
"hd0vpiS_";
1594 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0[iprong]);
1599 if(TMath::Abs(pdgprong)==321 || !isPionHere[iprong]) {
1604 ((TH1F*)listout->FindObject(fillthisK))->Fill(ptProng[iprong]);
1610 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0Prong[iprong]);
1612 fillthisK=
"hd0vKS_";
1614 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0[iprong]);
1619 fillthis=
"hcosthpointd0S_";
1621 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[iprong]);
1627 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1629 fillthis=
"hcosthetapointS_";
1631 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1633 fillthis=
"hcosthetapointxyS_";
1640 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0());
1644 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1646 fillthis=
"hnormdeclS_";
1648 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1650 fillthis=
"hdeclxyS_";
1652 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1654 fillthis=
"hnormdeclxyS_";
1656 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1658 fillthis=
"hdeclxyd0d0S_";
1660 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1662 fillthis=
"hnormdeclxyd0d0S_";
1664 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1667 fillthis=
"hdeclvS_";
1669 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1671 fillthis=
"hnormdeclvS_";
1673 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1675 fillthis=
"hd0d0vS_";
1677 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1681 fillthis=
"hcosthetastarS_";
1683 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)) ((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1685 if (
fReadMC || isSelectedPID>1)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar);
1686 if(isSelectedPID==1 || isSelectedPID==3)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1689 fillthis=
"hcosthpointd0d0S_";
1691 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1694 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)){
1695 for(
Int_t it=0; it<2; it++){
1698 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1699 fillthis=
"hphiD0S_";
1701 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1702 Int_t nPointsITS = 0;
1703 for (
Int_t il=0; il<6; il++){
1704 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1706 fillthis=
"hNITSpointsD0vsptS_";
1708 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(),nPointsITS);
1709 fillthis=
"hNSPDpointsD0S_";
1711 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1712 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1714 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1715 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1717 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1718 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1720 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1721 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1723 fillthis=
"hNclsD0vsptS_";
1727 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1731 if (
fReadMC || isSelectedPID>1){
1732 for(
Int_t it=0; it<2; it++){
1733 fillthis=
"hptD0barS_";
1735 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1736 fillthis=
"hphiD0barS_";
1738 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1739 fillthis=
"hNclsD0barvsptS_";
1743 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1746 if(isSelectedPID==1 || isSelectedPID==3){
1747 for(
Int_t it=0; it<2; it++){
1750 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1751 fillthis=
"hphiD0S_";
1753 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1754 Int_t nPointsITS = 0;
1755 for (
Int_t il=0; il<6; il++){
1756 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1758 fillthis=
"hNITSpointsD0vsptS_";
1760 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1761 fillthis=
"hNSPDpointsD0S_";
1763 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1764 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1766 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1767 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1769 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1770 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1772 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1773 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1775 fillthis=
"hNclsD0vsptS_";
1779 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1797 fillthispt=
"histBkgPt";
1800 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1803 fillthisetaphi=
"hetaphiD0candidateB_";
1804 fillthisetaphi+=ptbin;
1805 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1807 if(TMath::Abs(minvD0-mPDG)<0.05){
1808 fillthisetaphi=
"hetaphiD0candidatesignalregionB_";
1809 fillthisetaphi+=ptbin;
1810 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1814 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1817 fillthisetaphi=
"hetaphiD0barcandidateB_";
1818 fillthisetaphi+=ptbin;
1819 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1821 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1822 fillthisetaphi=
"hetaphiD0barcandidatesignalregionB_";
1823 fillthisetaphi+=ptbin;
1824 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1829 fillthis=
"hptB1prongnoMcut_";
1832 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1834 fillthis=
"hptB2prongsnoMcut_";
1836 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1837 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1842 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1854 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1859 if(fDebug>2) cout<<
"No daughter found";
1864 if(prongg->Charge()==1) {
1866 ((TH1F*)
fOutputMass->FindObject(
"hpospair"))->Fill(ptbin);
1869 ((TH1F*)
fOutputMass->FindObject(
"hnegpair"))->Fill(ptbin);
1877 for(
Int_t it=0; it<2; it++){
1880 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1881 fillthis=
"hphiD0B_";
1883 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1885 Int_t nPointsITS = 0;
1886 for (
Int_t il=0; il<6; il++){
1887 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1889 fillthis=
"hNITSpointsD0vsptB_";
1891 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1892 fillthis=
"hNSPDpointsD0B_";
1894 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1895 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1897 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1898 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1900 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1901 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1903 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1904 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1906 fillthis=
"hNclsD0vsptB_";
1910 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1917 for(
Int_t it=0; it<2; it++){
1918 fillthis=
"hptD0barB_";
1920 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1921 fillthis=
"hphiD0barB_";
1923 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1924 fillthis=
"hNclsD0barvsptB_";
1928 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1934 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1935 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1938 Int_t pdgMother[2]={0,0};
1941 for(
Int_t iprong=0;iprong<2;iprong++){
1943 lab=prong->GetLabel();
1945 AliAODMCParticle* mcprong=(AliAODMCParticle*)arrMC->At(lab);
1947 Int_t labmom=mcprong->GetMother();
1949 AliAODMCParticle* mcmother=(AliAODMCParticle*)arrMC->At(labmom);
1950 if(mcmother) pdgMother[iprong]=mcmother->GetPdgCode();
1957 fillthis=
"hd0moresB_";
1960 if(TMath::Abs(pdgMother[iprong])==310 || TMath::Abs(pdgMother[iprong])==130 || TMath::Abs(pdgMother[iprong])==321){
1961 if(ptProng[iprong]<=1)factor[iprong]=1./.7;
1962 else factor[iprong]=1./.6;
1966 if(TMath::Abs(pdgMother[iprong])==3122) {
1967 factor[iprong]=1./0.25;
1970 fillthis=
"hd0moresB_";
1973 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[iprong],factor[iprong]);
1976 fillthis=
"hd0vmoresB_";
1978 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[iprong],factor[iprong]);
1984 fillthis=
"hd0d0moresB_";
1986 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0(),factor[0]*factor[1]);
1988 fillthis=
"hcosthetapointmoresB_";
1990 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,factor[0]*factor[1]);
1993 fillthis=
"hd0d0vmoresB_";
1995 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1],factor[0]*factor[1]);
2004 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[0]);
2005 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[1]);
2007 fillthis=
"hcosthetastarB_";
2015 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
2018 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
2020 fillthis=
"hcosthpointd0d0B_";
2022 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
2024 fillthis=
"hcosthpointd0B_";
2026 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[0]);
2027 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[1]);
2032 fillthis=
"hd0vp0B_";
2034 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
2035 fillthis=
"hd0vp1B_";
2037 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
2041 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
2042 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
2050 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
2054 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]*d0Prong[1]);
2057 fillthis=
"hd0d0vB_";
2059 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
2062 fillthis=
"hcosthetapointB_";
2064 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
2066 fillthis=
"hcosthetapointxyB_";
2072 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
2074 fillthis=
"hnormdeclB_";
2076 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
2078 fillthis=
"hdeclxyB_";
2080 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
2082 fillthis=
"hnormdeclxyB_";
2084 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
2086 fillthis=
"hdeclxyd0d0B_";
2088 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
2090 fillthis=
"hnormdeclxyd0d0B_";
2092 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
2097 fillthis=
"hdeclvB_";
2099 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
2101 fillthis=
"hnormdeclvB_";
2103 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
2120 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
2154 if(fDebug>2) cout<<
"Candidate selected"<<endl;
2164 Double_t arrayForSparse[3]={invmassD0,pt,impparXY};
2165 Double_t arrayForSparseTrue[3]={invmassD0,pt,trueImpParXY};
2194 TString fillthis=
"", fillthispt=
"", fillthismasspt=
"", fillthismassy=
"", fillthissub=
"";
2195 Int_t pdgDgD0toKpi[2]={321,211};
2198 if (
fReadMC) labD0 = part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2207 if (weigD0 > 1.0 || weigD0 < 0.) {weigD0 = 0.;}
2208 if (weigD0bar > 1.0 || weigD0bar < 0.) {weigD0bar = 0.;}
2218 arrayForSparse[0]=invmassD0; arrayForSparse[2]=impparXY;
2222 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2224 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2225 Int_t pdgD0 = partD0->GetPdgCode();
2232 arrayForSparseTrue[0]=invmassD0; arrayForSparseTrue[2]=trueImpParXY;
2236 fillthis=
"histSgn_";
2238 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2241 fillthismasspt=
"histSgnPt";
2242 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2253 fillthismassy=
"histSgnY_";
2254 fillthismassy+=ptbin;
2255 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2260 fillthis=
"histSgn27_";
2262 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2266 fillthis=
"histRfl_";
2268 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2271 fillthismasspt=
"histRflPt";
2273 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2277 fillthismassy=
"histRflY_";
2278 fillthismassy+=ptbin;
2280 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2285 fillthis=
"histBkg_";
2287 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2290 fillthismasspt=
"histBkgPt";
2292 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2297 fillthismassy=
"histBkgY_";
2298 fillthismassy+=ptbin;
2300 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2306 fillthis=
"histMass_";
2311 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2314 fillthissub=
"histMassvsSubSample_";
2320 fillthismasspt=
"histMassPt";
2322 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2330 fillthismassy=
"histMassY_";
2331 fillthismassy+=ptbin;
2333 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2341 arrayForSparse[0]=invmassD0bar; arrayForSparse[2]=impparXY;
2345 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2346 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2347 Int_t pdgD0 = partD0->GetPdgCode();
2354 arrayForSparseTrue[0]=invmassD0bar; arrayForSparseTrue[2]=trueImpParXY;
2357 fillthis=
"histSgn_";
2359 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2367 fillthismasspt=
"histSgnPt";
2369 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2381 fillthismassy=
"histSgnY_";
2382 fillthismassy+=ptbin;
2384 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2388 fillthis=
"histRfl_";
2390 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2392 fillthismasspt=
"histRflPt";
2394 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2397 fillthismassy=
"histRflY_";
2398 fillthismassy+=ptbin;
2400 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2404 fillthis=
"histBkg_";
2406 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2409 fillthismasspt=
"histBkgPt";
2411 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2415 fillthismassy=
"histBkgY_";
2416 fillthismassy+=ptbin;
2418 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2422 fillthis=
"histMass_";
2426 ((TH1F*)listout->FindObject(fillthis))->Fill(invmassD0bar,weigD0bar);
2429 fillthissub=
"histMassvsSubSample_";
2435 fillthismasspt=
"histMassPt";
2437 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2441 fillthismassy=
"histMassY_";
2442 fillthismassy+=ptbin;
2444 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2457 Int_t nTrksToSkip=2;
2460 AliDebug(2,
"no daughter found!");
2463 skipped[0]=dgTrack->GetID();
2466 AliDebug(2,
"no daughter found!");
2469 skipped[1]=dgTrack->GetID();
2471 AliESDVertex *vertexESD=0x0;
2472 AliAODVertex *vertexAOD=0x0;
2473 AliVertexerTracks *vertexer =
new AliVertexerTracks(aodev->GetMagneticField());
2476 vertexer->SetSkipTracks(nTrksToSkip,skipped);
2477 vertexer->SetMinClusters(4);
2478 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
2479 if(!vertexESD)
return vertexAOD;
2480 if(vertexESD->GetNContributors()<=0) {
2481 AliDebug(2,
"vertexing failed");
2482 delete vertexESD; vertexESD=NULL;
2486 delete vertexer; vertexer=NULL;
2491 vertexESD->GetXYZ(pos);
2492 vertexESD->GetCovMatrix(cov);
2493 chi2perNDF = vertexESD->GetChi2toNDF();
2494 delete vertexESD; vertexESD=NULL;
2496 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF);
2507 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass: Terminate() \n");
2512 printf(
"ERROR: fOutputMass not available\n");
2517 printf(
"ERROR: fOutputMass not available\n");
2524 printf(
"ERROR: fDistr not available\n");
2529 fNentries =
dynamic_cast<TH1F*
>(GetOutputData(3));
2532 printf(
"ERROR: fNEntries not available\n");
2537 printf(
"ERROR: fCuts not available\n");
2542 printf(
"ERROR: fCounter not available\n");
2548 printf(
"ERROR: fDetSignal not available\n");
2555 printf(
"ERROR: fOutputMassY not available\n");
2564 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));
2587 nameDistr=
"hd0d0B_";
2590 nameDistr=
"hcosthetapointB_";
2597 nameDistr=
"hcosthetastarB_";
2600 nameDistr=
"hcosthpointd0d0B_";
2617 TCanvas *cMass=
new TCanvas(cvname,cvname);
2621 TCanvas* cStat=
new TCanvas(cstname,Form(
"Stat%s",
fArray ?
"LS" :
"D0"));
2637 Int_t nmassbins=200;
2638 Double_t fLowmasslimit=1.5648, fUpmasslimit=2.1648;
2639 Int_t fNImpParBins=400;
2640 Double_t fLowerImpPar=-2000., fHigherImpPar=2000.;
2642 Double_t xmin[3]={fLowmasslimit,0.,fLowerImpPar};
2643 Double_t xmax[3]={fUpmasslimit,20.,fHigherImpPar};
2647 "Mass vs. pt vs.imppar - All",
2650 "Mass vs. pt vs.imppar - promptD",
2653 "Mass vs. pt vs.imppar - DfromB",
2656 "Mass vs. pt vs.true imppar -DfromB",
2659 "Mass vs. pt vs.imppar - backgr.",
2662 for(
Int_t i=0; i<5;i++){
2671 printf(
" AliAnalysisTaskSED0MassV1::GetTrueImpactParameter() \n");
2674 mcHeader->GetVertex(vtxTrue);
2676 partD0->XvYvZv(origD);
2678 Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2];
2679 for(
Int_t iDau=0; iDau<2; iDau++){
2686 Int_t labelFirstDau = partD0->GetDaughter(0);
2688 for(
Int_t iDau=0; iDau<2; iDau++){
2689 Int_t ind = labelFirstDau+iDau;
2690 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
2692 Int_t pdgCode = TMath::Abs( part->GetPdgCode() );
2694 AliError(
"Daughter particle not found in MC array");
2697 if(pdgCode==211 || pdgCode==321){
2698 pXdauTrue[iDau]=part->Px();
2699 pYdauTrue[iDau]=part->Py();
2700 pZdauTrue[iDau]=part->Pz();
2705 AliAODRecoDecayHF aodDzeroMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
2715 printf(
" AliAnalysisTaskSED0Mass V1::CheckOrigin() \n");
2717 Int_t pdgGranma = 0;
2719 mother = mcPartCandidate->GetMother();
2721 Int_t abspdgGranma =0;
2723 Bool_t isQuarkFound=kFALSE;
2726 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
2728 pdgGranma = mcGranma->GetPdgCode();
2729 abspdgGranma = TMath::Abs(pdgGranma);
2730 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
2733 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
2734 mother = mcGranma->GetMother();
2736 AliError(
"Failed casting the mother particle!");
2741 if(isFromB)
return 5;
2748 const Int_t nVarPrompt = 2;
2749 const Int_t nVarFD = 3;
2751 Int_t nbinsPrompt[nVarPrompt]={200,100};
2752 Int_t nbinsFD[nVarFD]={200,100,200};
2754 Double_t xminPrompt[nVarPrompt] = {0.,-1.};
2755 Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
2757 Double_t xminFD[nVarFD] = {0.,-1.,0.};
2758 Double_t xmaxFD[nVarFD] = {40.,1.,40.};
2761 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
2766 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
2767 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
2769 fMCAccBFeed->GetAxis(2)->SetTitle(
"p_{T}^{B} (GeV/c)");
2777 const Int_t nProng = 2;
2778 Double_t zMCVertex = mcHeader->GetVtxZ();
2780 for(
Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
2781 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
2782 if (TMath::Abs(mcPart->GetPdgCode()) == 421){
2787 Bool_t isGoodDecay=kFALSE;
2788 Int_t labDau[4]={-1,-1,-1,-1};
2790 Bool_t isFidAcc = kFALSE;
2793 if(deca > 0) isGoodDecay=kTRUE;
2800 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
2802 if(isGoodDecay && TMath::Abs(zMCVertex) <
fCuts->
GetMaxVtxZ() && isFidAcc && isInAcc) {
2806 Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
2813 Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
2825 for (
Int_t iProng = 0; iProng<nProng; iProng++){
2826 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
2827 if(!mcPartDaughter)
return kFALSE;
2828 Double_t eta = mcPartDaughter->Eta();
2829 Double_t pt = mcPartDaughter->Pt();
2830 if (TMath::Abs(eta) > 0.9 || pt < 0.1)
return kFALSE;
2847 normIP[0]=diffIP[0]/errdiffIP[0];
2848 normIP[1]=diffIP[1]/errdiffIP[1];
2850 AliAODVertex* secvtx=part->GetSecondaryVtx();
2852 Double_t err2decaylength=secvtx->Error2DistanceXYToVertex(primvtx);
2853 Double_t lxy=part->AliAODRecoDecay::DecayLengthXY(primvtx);
2858 Int_t pdgDgD0toKpi[2]={321,211};
2860 lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2863 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(lab);
2865 if(orig==4)signalType=1;
2866 else if(orig==5)signalType=2;
2874 Double_t arrayMC[8]={part->Pt(), ptB,normIP[0], normIP[1], lxy, lxy/TMath::Sqrt(err2decaylength),(
Double_t)isCuts, (
Double_t)isPid};
2877 for(
Int_t i=0; i<8; i++){
2878 pointD0MC[i]=arrayMC[i];
2890 if(!IsSelectedPIDoff)
return;
2894 for(
Int_t i=0;i<9;i++){
2895 pointD0[i]=array[i];
2901 for(
Int_t i=0;i<9;i++){
2902 pointD0bar[i]=arrayD0bar[i];
THnSparseF * fMCAccBFeed
!histo for StepMCAcc for D0 FD (pt,y,ptB)
Double_t NormalizedDecayLengthXY() const
static Int_t CheckD0Decay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
Bool_t fFillSubSampleHist
flag to fill Pt and Impact Parameter Histograms
TList * fOutputMassPt
! list send on output slot 6
Bool_t fDrawDetSignal
flag to decide whether to fill "PID = x" bins in fNentrie
void Draw(const char *filename, const char *title="", const char *others="ALL", const char *options="DEFAULT", const char *outFlg="ALL", UShort_t rebin=5, Float_t eff=0, const char *base="")
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
Bool_t HasSelectionBit(Int_t i) const
void UnsetOwnPrimaryVtx()
AliAnalysisTaskSED0Mass()
Double_t NormalizedDecayLength2() const
Double_t ImpParXY() const
Int_t fAODProtection
flag to check or not the selection bit
Bool_t fWriteVariableTree
static Int_t CheckMatchingAODdeltaAODevents()
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
event counter used for sub sample test
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
TH2F * fhMultVZEROTPCoutTrackCorrNoCut
!
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)
Functions to check the decay tree.
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 ...
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
TH2F * fhMultVZEROTPCoutTrackCorr
!
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 AreDaughtersSelected(AliAODRecoDecayHF *rd, const AliAODEvent *aod=0x0) 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
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
TH2 * Scale(TH2 *h, TH1 *g)
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...
Bool_t fEnablePileupRejVZEROTPCout
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
Int_t fEventCounter
flag to fill SubSample histogram