29 #include <Riostream.h> 30 #include <TClonesArray.h> 31 #include <TObjArray.h> 38 #include <TDatabasePDG.h> 39 #include <THnSparse.h> 41 #include <AliAnalysisDataSlot.h> 42 #include <AliAnalysisDataContainer.h> 43 #include "AliAnalysisManager.h" 44 #include "AliESDtrack.h" 45 #include "AliVertexerTracks.h" 46 #include "AliAODHandler.h" 47 #include "AliAODEvent.h" 48 #include "AliAODVertex.h" 49 #include "AliAODTrack.h" 50 #include "AliAODMCHeader.h" 51 #include "AliAODMCParticle.h" 55 #include "AliAnalysisTaskSE.h" 87 fIsSelectedCandidate(0),
90 fIsRejectSDDClusters(0),
93 fFillImpParHist(kFALSE),
94 fFillSubSampleHist(kFALSE),
96 fUseSelectionBit(kTRUE),
98 fWriteVariableTree(kFALSE),
100 fCandidateVariables(),
102 fDrawDetSignal(kFALSE),
103 fUseQuarkTagInKine(kTRUE),
105 fhStudyImpParSingleTrackSign(0),
106 fhStudyImpParSingleTrackCand(0),
107 fhStudyImpParSingleTrackFd(0),
109 fhMultVZEROTPCoutTrackCorrNoCut(0x0),
110 fhMultVZEROTPCoutTrackCorr(0x0),
111 fEnablePileupRejVZEROTPCout(kFALSE)
173 DefineOutput(1,TList::Class());
175 DefineOutput(2,TList::Class());
177 DefineOutput(3,TH1F::Class());
179 DefineOutput(4,AliRDHFCutsD0toKpi::Class());
181 DefineOutput(5,AliNormalizationCounter::Class());
183 DefineOutput(6,TList::Class());
185 DefineOutput(7,TTree::Class());
187 DefineOutput(8, TList::Class());
189 DefineOutput(9, TList::Class());
215 for(
Int_t i=0; i<5; i++){
256 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::Init() \n");
260 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
261 copyfCuts->SetName(nameoutput);
263 PostData(4,copyfCuts);
275 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::UserCreateOutputObjects() \n");
292 fDistr->SetName(
"distributionslist");
298 TString nameMass=
" ",nameSgn27=
" ",nameSgn=
" ", nameBkg=
" ", nameRfl=
" ",nameMassNocutsS =
" ",nameMassNocutsB =
" ", namedistr=
" ";
299 TString nameMassPt=
"", nameSgnPt=
"", nameBkgPt=
"", nameRflPt=
"";
300 TString nameMassY=
"", nameSgnY=
"", nameBkgY=
"", nameRflY=
"";
307 nameMass=
"histMass_";
309 nameSgn27=
"histSgn27_";
317 nameMassNocutsS=
"hMassS_";
319 nameMassNocutsB=
"hMassB_";
326 namedistr=
"hNclsD0vsptS_";
328 TH2F *hNclsD0vsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
329 namedistr=
"hNclsD0barvsptS_";
331 TH2F *hNclsD0barvsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
333 namedistr=
"hNITSpointsD0vsptS_";
335 TH2F *hNITSpointsD0vsptS =
new TH2F(namedistr.Data(),
"N ITS points distrubution [S];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
337 namedistr=
"hNSPDpointsD0S_";
339 TH1I *hNSPDpointsD0S =
new TH1I(namedistr.Data(),
"N SPD points distrubution [S]; ;N tracks",4,0,4);
340 hNSPDpointsD0S->GetXaxis()->SetBinLabel(1,
"no SPD");
341 hNSPDpointsD0S->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
342 hNSPDpointsD0S->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
343 hNSPDpointsD0S->GetXaxis()->SetBinLabel(4,
"kBoth");
347 TH1F *hptD0S =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
348 namedistr=
"hptD0barS_";
350 TH1F *hptD0barS =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
352 namedistr=
"hphiD0S_";
354 TH1F *hphiD0S =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
355 namedistr=
"hphiD0barS_";
357 TH1F *hphiD0barS =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
360 namedistr=
"hetaphiD0candidateS_";
362 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());
363 namedistr=
"hetaphiD0barcandidateS_";
365 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());
367 namedistr=
"hetaphiD0candidatesignalregionS_";
369 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());
370 namedistr=
"hetaphiD0barcandidatesignalregionS_";
372 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());
377 TH1F *hdcaS =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
381 TH1F *hd0piS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions);d0(#pi) [cm]",200,-0.1,0.1);
385 TH1F *hd0KS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons);d0(K) [cm]",200,-0.1,0.1);
388 TH1F *hd0d0S =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
393 TH1F *hdeclengthS =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm]",200,0,0.015);
395 namedistr=
"hnormdeclS_";
397 TH1F *hnormdeclengthS =
new TH1F(namedistr.Data(),
"Normalized Decay Length^{2} distribution;(Decay Length/Err)^{2} ",200,0,12.);
399 namedistr=
"hdeclxyS_";
401 TH1F* hdeclxyS=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
402 namedistr=
"hnormdeclxyS_";
404 TH1F* hnormdeclxyS=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
406 namedistr=
"hdeclxyd0d0S_";
408 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);
410 namedistr=
"hnormdeclxyd0d0S_";
412 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);
415 namedistr=
"hcosthetapointS_";
417 TH1F *hcosthetapointS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
419 namedistr=
"hcosthetapointxyS_";
421 TH1F *hcosthetapointxyS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XYdistribution;cos#theta_{Point}",300,0.,1.);
423 TH1F* tmpMS =
new TH1F(nameMassNocutsS.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
426 fDistr->Add(hNclsD0vsptS);
427 fDistr->Add(hNclsD0barvsptS);
428 fDistr->Add(hNITSpointsD0vsptS);
429 fDistr->Add(hNSPDpointsD0S);
434 fDistr->Add(hetaphiD0candidateS);
435 fDistr->Add(hetaphiD0candidatesignalregionS);
436 fDistr->Add(hetaphiD0barcandidateS);
437 fDistr->Add(hetaphiD0barcandidatesignalregionS);
446 fDistr->Add(hcosthetapointS);
448 fDistr->Add(hcosthetapointxyS);
452 fDistr->Add(hnormdeclengthS);
456 fDistr->Add(hnormdeclxyS);
458 fDistr->Add(hdeclxyd0d0S);
459 fDistr->Add(hnormdeclxyd0d0S);
467 namedistr=
"hNclsD0vsptB_";
469 TH2F *hNclsD0vsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
470 namedistr=
"hNclsD0barvsptB_";
472 TH2F *hNclsD0barvsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
474 namedistr=
"hNITSpointsD0vsptB_";
476 TH2F *hNITSpointsD0vsptB =
new TH2F(namedistr.Data(),
"N ITS points distrubution [B];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
478 namedistr=
"hNSPDpointsD0B_";
480 TH1I *hNSPDpointsD0B =
new TH1I(namedistr.Data(),
"N SPD points distrubution [B]; ;N tracks",4,0,4);
481 hNSPDpointsD0B->GetXaxis()->SetBinLabel(1,
"no SPD");
482 hNSPDpointsD0B->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
483 hNSPDpointsD0B->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
484 hNSPDpointsD0B->GetXaxis()->SetBinLabel(4,
"kBoth");
488 TH1F *hptD0B =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
489 namedistr=
"hptD0barB_";
491 TH1F *hptD0barB =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
493 namedistr=
"hphiD0B_";
495 TH1F *hphiD0B =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
496 namedistr=
"hphiD0barB_";
498 TH1F *hphiD0barB =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
500 namedistr=
"hetaphiD0candidateB_";
502 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());
503 namedistr=
"hetaphiD0barcandidateB_";
505 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());
507 namedistr=
"hetaphiD0candidatesignalregionB_";
509 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());
510 namedistr=
"hetaphiD0barcandidatesignalregionB_";
512 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());
517 TH1F *hdcaB =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
522 TH1F *hd0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
526 TH1F *hd0d0B =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
531 TH1F *hdeclengthB =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm^{2}]",200,0,0.015);
533 namedistr=
"hnormdeclB_";
535 TH1F *hnormdeclengthB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution;(Decay Length/Err)^{2} ",200,0,12.);
537 namedistr=
"hdeclxyB_";
539 TH1F* hdeclxyB=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
540 namedistr=
"hnormdeclxyB_";
542 TH1F* hnormdeclxyB=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
544 namedistr=
"hdeclxyd0d0B_";
546 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);
548 namedistr=
"hnormdeclxyd0d0B_";
550 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);
553 namedistr=
"hcosthetapointB_";
555 TH1F *hcosthetapointB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
557 namedistr=
"hcosthetapointxyB_";
559 TH1F *hcosthetapointxyB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XY distribution;cos#theta_{Point} XY",300,0.,1.);
561 TH1F* tmpMB =
new TH1F(nameMassNocutsB.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
565 fDistr->Add(hNclsD0vsptB);
566 fDistr->Add(hNclsD0barvsptB);
567 fDistr->Add(hNITSpointsD0vsptB);
568 fDistr->Add(hNSPDpointsD0B);
573 fDistr->Add(hetaphiD0candidateB);
574 fDistr->Add(hetaphiD0candidatesignalregionB);
575 fDistr->Add(hetaphiD0barcandidateB);
576 fDistr->Add(hetaphiD0barcandidatesignalregionB);
584 fDistr->Add(hcosthetapointB);
586 fDistr->Add(hcosthetapointxyB);
590 fDistr->Add(hnormdeclengthB);
594 fDistr->Add(hnormdeclxyB);
596 fDistr->Add(hdeclxyd0d0B);
597 fDistr->Add(hnormdeclxyd0d0B);
605 namedistr=
"hd0vpiS_";
607 TH1F *hd0vpiS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions)(vtx w/o these tracks);d0(#pi) [cm]",200,-0.1,0.1);
611 TH1F *hd0vKS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons) (vtx w/o these tracks);d0(K) [cm]",200,-0.1,0.1);
613 namedistr=
"hd0d0vS_";
615 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);
617 namedistr=
"hdeclvS_";
619 TH1F *hdeclengthvS =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
621 namedistr=
"hnormdeclvS_";
623 TH1F *hnormdeclengthvS =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
628 fDistr->Add(hdeclengthvS);
629 fDistr->Add(hnormdeclengthvS);
633 namedistr=
"hd0vmoresB_";
635 TH1F *hd0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
637 namedistr=
"hd0d0vmoresB_";
639 TH1F *hd0d0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
644 TH1F *hd0vB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
646 namedistr=
"hd0vp0B_";
648 TH1F *hd0vp0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong + ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
650 namedistr=
"hd0vp1B_";
652 TH1F *hd0vp1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong - ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
654 namedistr=
"hd0d0vB_";
656 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);
658 namedistr=
"hdeclvB_";
660 TH1F *hdeclengthvB =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
662 namedistr=
"hnormdeclvB_";
664 TH1F *hnormdeclengthvB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
672 fDistr->Add(hd0d0vmoresB);
674 fDistr->Add(hdeclengthvB);
676 fDistr->Add(hnormdeclengthvB);
686 TH1F* tmpSt =
new TH1F(nameSgn.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
688 TH1F *tmpSl=(TH1F*)tmpSt->Clone();
693 TH1F* tmpRt =
new TH1F(nameRfl.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
695 TH1F* tmpBt =
new TH1F(nameBkg.Data(),
"Background invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
709 TH1F* tmpMt =
new TH1F(nameMass.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
720 nameMassSubSample=
"histMassvsSubSample_";
721 nameMassSubSample+=i;
722 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);
734 TH1F *hptpiS =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
738 TH1F *hptKS =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
741 namedistr=
"hcosthetastarS_";
743 TH1F *hcosthetastarS =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
747 namedistr=
"hptpiSnoMcut_";
749 TH1F *hptpiSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
751 namedistr=
"hptKSnoMcut_";
753 TH1F *hptKSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
757 fDistr->Add(hcosthetastarS);
759 fDistr->Add(hptpiSnoMcut);
763 namedistr=
"hcosthpointd0S_";
765 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);
766 namedistr=
"hcosthpointd0d0S_";
768 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);
770 fDistr->Add(hcosthpointd0S);
771 fDistr->Add(hcosthpointd0d0S);
774 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);
775 TH1F *tmpS27l=(TH1F*)tmpS27t->Clone();
787 TH1F *hptB =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
790 namedistr=
"hcosthetastarB_";
792 TH1F *hcosthetastarB =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
795 namedistr=
"hptB1prongnoMcut_";
797 TH1F *hptB1pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
799 namedistr=
"hptB2prongsnoMcut_";
801 TH1F *hptB2pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
804 fDistr->Add(hcosthetastarB);
806 fDistr->Add(hptB1pnoMcut);
807 fDistr->Add(hptB2pnoMcut);
812 TH1F *hd0p0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.1,0.1);
816 TH1F *hd0p1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong -);d0 [cm]",200,-0.1,0.1);
819 namedistr=
"hd0moresB_";
821 TH1F *hd0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
823 namedistr=
"hd0d0moresB_";
825 TH1F *hd0d0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
828 namedistr=
"hcosthetapointmoresB_";
830 TH1F *hcosthetapointmoresB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
833 namedistr=
"hcosthpointd0B_";
835 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);
837 namedistr=
"hcosthpointd0d0B_";
839 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);
846 fDistr->Add(hcosthetapointmoresB);
849 fDistr->Add(hcosthpointd0B);
852 fDistr->Add(hcosthpointd0d0B);
860 Int_t nbinsImpParStudy[9]= {50, 40, 40, 20, 15, 600, 3,4,2};
861 Double_t limitLowImpParStudy[9]={0, -5, -5, 0, 0,1.6248,1,0,0};
862 Double_t limitUpImpParStudy[9]= {50., 5, 5, 0.2,15,2.2248,4,4,2};
863 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"};
864 fhStudyImpParSingleTrackCand=
new THnSparseF(
"fhStudyImpParSingleTrackCand",
"fhStudyImpParSingleTrackCand",9,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
872 Int_t nbinsImpParStudy[8]= {50,50,40, 40, 20, 15, 3, 4};
873 Double_t limitLowImpParStudy[8]={0, 0, -5,-5., 0., 0., 1.,0.};
874 Double_t limitUpImpParStudy[8]= {50.,50., 5, 5, 0.2, 15, 3.,4.};
876 fhStudyImpParSingleTrackSign=
new THnSparseF(
"fhStudyImpParSingleTrackSign",
"fhStudyImpParSingleTrackSign",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
877 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"};
882 fhStudyImpParSingleTrackFd=
new THnSparseF(
"fhStudyImpParSingleTrackFd",
"fhStudyImpParSingleTrackFd",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
894 namedistr=
"hpospair";
896 namedistr=
"hnegpair";
906 nameMassPt=
"histMassPt";
907 nameSgnPt=
"histSgnPt";
908 nameBkgPt=
"histBkgPt";
909 nameRflPt=
"histRflPt";
913 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);
914 TH2F *tmpSlPt=(
TH2F*)tmpStPt->Clone();
919 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);
920 TH2F* tmpBtPt =
new TH2F(nameBkgPt.Data(),
"Background invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
934 TH2F* tmpMtPt =
new TH2F(nameMassPt.Data(),
"D^{0} invariant mass; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
946 nameMassY=
"histMassY_";
948 nameSgnY=
"histSgnY_";
950 nameBkgY=
"histBkgY_";
952 nameRflY=
"histRflY_";
956 TH2F* tmpStY =
new TH2F(nameSgnY.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
959 TH2F* tmpRtY =
new TH2F(nameRflY.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
960 TH2F* tmpBtY =
new TH2F(nameBkgY.Data(),
"Background invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
968 TH2F* tmpMtY =
new TH2F(nameMassY.Data(),
"D^{0} invariant mass; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
975 const char* nameoutput=GetOutputSlot(3)->GetContainer()->GetName();
977 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", 24,-0.5,23.5);
979 fNentries->GetXaxis()->SetBinLabel(1,
"nEventsAnal");
980 fNentries->GetXaxis()->SetBinLabel(2,
"nCandSel(Cuts)");
982 else fNentries->GetXaxis()->SetBinLabel(3,
"Dstar<-D0");
983 fNentries->GetXaxis()->SetBinLabel(4,
"nEventsGoodVtxS");
984 fNentries->GetXaxis()->SetBinLabel(5,
"ptbin = -1");
985 fNentries->GetXaxis()->SetBinLabel(6,
"no daughter");
986 if(
fSys==0)
fNentries->GetXaxis()->SetBinLabel(7,
"nCandSel(Tr)");
988 fNentries->GetXaxis()->SetBinLabel(8,
"PID=0");
989 fNentries->GetXaxis()->SetBinLabel(9,
"PID=1");
990 fNentries->GetXaxis()->SetBinLabel(10,
"PID=2");
991 fNentries->GetXaxis()->SetBinLabel(11,
"PID=3");
994 fNentries->GetXaxis()->SetBinLabel(12,
"K");
995 fNentries->GetXaxis()->SetBinLabel(13,
"Lambda");
997 fNentries->GetXaxis()->SetBinLabel(14,
"Pile-up Rej");
998 fNentries->GetXaxis()->SetBinLabel(15,
"N. of 0SMH");
999 if(
fSys==1)
fNentries->GetXaxis()->SetBinLabel(16,
"Nev in centr");
1001 fNentries->GetXaxis()->SetBinLabel(18,
"Phys.Sel.Rej");
1002 fNentries->GetXaxis()->SetBinLabel(19,
"D0 failed to be filled");
1003 fNentries->GetXaxis()->SetBinLabel(20,
"fisFilled is 0");
1004 fNentries->GetXaxis()->SetBinLabel(21,
"fisFilled is 1");
1005 fNentries->GetXaxis()->SetBinLabel(22,
"AOD/dAOD mismatch");
1006 fNentries->GetXaxis()->SetBinLabel(23,
"AOD/dAOD #events ok");
1007 fNentries->GetXaxis()->SetBinLabel(24,
"PreSelect rejection");
1008 fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
1016 nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
1021 fCandidateVariableNames[0] =
"massD0";
1022 fCandidateVariableNames[1] =
"massD0bar";
1023 fCandidateVariableNames[2] =
"pt";
1024 fCandidateVariableNames[3] =
"dca";
1025 fCandidateVariableNames[4] =
"costhsD0";
1026 fCandidateVariableNames[5] =
"costhsD0bar";
1027 fCandidateVariableNames[6] =
"ptk";
1028 fCandidateVariableNames[7] =
"ptpi";
1029 fCandidateVariableNames[8] =
"d0k";
1030 fCandidateVariableNames[9] =
"d0pi";
1031 fCandidateVariableNames[10] =
"d0xd0";
1032 fCandidateVariableNames[11] =
"costhp";
1033 fCandidateVariableNames[12] =
"costhpxy";
1034 fCandidateVariableNames[13] =
"lxy";
1035 fCandidateVariableNames[14] =
"specialcuts";
1036 for(
Int_t ivar=0; ivar<nVar; ivar++){
1045 TH2F *TOFSigBefPID =
new TH2F(
"TOFSigBefPID",
"TOF signal of daughters before PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1046 TH2F *TOFSigAftPID =
new TH2F(
"TOFSigAftPID",
"TOF signal after PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1048 TH2F *TPCSigBefPID =
new TH2F(
"TPCSigBefPID",
"TPC dE/dx before PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1049 TH2F *TPCSigAftPID =
new TH2F(
"TPCSigAftPID",
"TPC dE/dx after PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1059 fhMultVZEROTPCoutTrackCorr =
new TH2F(
"hMultVZEROTPCoutTrackCorr",
";Tracks with kTPCout on;VZERO multiplicity", 1000, 0., 30000., 1000, 0., 40000.);
1104 if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 &&
fAODProtection==1)) {
1120 bname=
"LikeSign2Prong";
1122 TClonesArray *inputArray=0;
1123 if(!aod && AODEvent() && IsStandardAOD()) {
1129 AliAODHandler* aodHandler = (AliAODHandler*)
1130 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1132 if(aodHandler->GetExtensions()) {
1133 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
1135 inputArray=(TClonesArray*)aodFromExt->GetList()->FindObject(bname.Data());
1138 inputArray=(TClonesArray*)aod->GetList()->FindObject(bname.Data());
1141 if(!inputArray || !aod) {
1142 printf(
"AliAnalysisTaskSED0Mass::UserExec: input branch not found!\n");
1147 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001)
return;
1149 TClonesArray *mcArray = 0;
1150 AliAODMCHeader *mcHeader = 0;
1154 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1156 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC particles branch not found!\n");
1161 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1163 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC header branch not found!\n");
1171 AliAODVZERO* v0data=(AliAODVZERO*)((
AliAODEvent*)aod)->GetVZEROData();
1172 Float_t mTotV0A=v0data->GetMTotV0A();
1173 Float_t mTotV0C=v0data->GetMTotV0C();
1174 mTotV0=mTotV0A+mTotV0C;
1175 Int_t ntracksEv = aod->GetNumberOfTracks();
1176 for(
Int_t itrack=0; itrack<ntracksEv; itrack++) {
1178 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1179 if(!track) {AliFatal(
"Not a standard AOD");}
1180 if(track->GetID()<0)
continue;
1181 if((track->GetFlags())&(AliESDtrack::kTPCout)) nTPCout++;
1185 Float_t mV0Cut=-2200.+(2.5*nTPCout)+(0.000012*nTPCout*nTPCout);
1187 if(mTotV0<mV0Cut)
return;
1197 TString trigclass=aod->GetFiredTriggerClasses();
1198 if(trigclass.Contains(
"C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains(
"C0SMH-B-NOPF-ALL"))
fNentries->Fill(14);
1212 Bool_t skipEvent = kFALSE;
1214 if (aod) ntracks = aod->GetNumberOfTracks();
1215 for(
Int_t itrack=0; itrack<ntracks; itrack++) {
1217 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1218 if(!track) AliFatal(
"Not a standard AOD");
1219 if(TESTBIT(track->GetITSClusterMap(),2) || TESTBIT(track->GetITSClusterMap(),3) ){
1225 if (skipEvent)
return;
1233 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1238 TString primTitle = vtx1->GetTitle();
1239 if(primTitle.Contains(
"VertexerTracks") && vtx1->GetNContributors()>0) {
1247 Int_t nInD0toKpi = inputArray->GetEntriesFast();
1248 if(fDebug>2) printf(
"Number of D0->Kpi: %d\n",nInD0toKpi);
1252 Int_t nSelectedloose=0,nSelectedtight=0;
1259 for (
Int_t iD0toKpi = 0; iD0toKpi < nInD0toKpi; iD0toKpi++) {
1269 for(
Int_t ipr=0;ipr<2;ipr++){
1270 AliAODTrack *tr=vHF->
GetProng(aod,d,ipr);
1271 arrTracks.AddAt(tr,ipr);
1290 if(ptbin==-1) {
fNentries->Fill(4);
continue;}
1298 AliDebug(1,
"at least one daughter not found!");
1313 Int_t isSelectedPIDfill = 3;
1316 if (isSelectedPIDfill == 0)
fNentries->Fill(7);
1317 if (isSelectedPIDfill == 1)
fNentries->Fill(8);
1318 if (isSelectedPIDfill == 2)
fNentries->Fill(9);
1319 if (isSelectedPIDfill == 3)
fNentries->Fill(10);
1351 AliESDtrack *esdtrack1 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1352 AliESDtrack *esdtrack2 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1356 Int_t isSelectedPIDfill = 3;
1361 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1362 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1363 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1364 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1366 if (isSelectedPIDfill != 0) {
1367 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1368 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1369 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1370 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1387 Int_t pdgDgD0toKpi[2]={321,211};
1389 if(
fReadMC) lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
1391 Int_t isSelectedPID=3;
1394 if (isSelectedPID==0)
fNentries->Fill(7);
1395 if (isSelectedPID==1)
fNentries->Fill(8);
1396 if (isSelectedPID==2)
fNentries->Fill(9);
1397 if (isSelectedPID==3)
fNentries->Fill(10);
1408 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1419 TString fillthispi=
"",fillthisK=
"",fillthis=
"", fillthispt=
"", fillthisetaphi=
"";
1424 Double_t dz1[2],dz2[2],covar1[3],covar2[3];
1425 dz1[0]=-99; dz2[0]=-99;
1435 AliAODVertex *vtxProp=0x0;
1441 AliESDtrack *esdtrack1=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1442 AliESDtrack *esdtrack2=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1443 esdtrack1->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz1,covar1);
1444 esdtrack2->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz2,covar2);
1445 delete vtxProp; vtxProp=NULL;
1462 Double_t normalizedDecayLength2 = -1, normalizedDecayLengthxy=-1;
1463 Double_t decayLength2 = -1, decayLengthxy=-1;
1478 if(!prong0 || !prong1) {
1483 labprong[0]=prong0->GetLabel();
1484 labprong[1]=prong1->GetLabel();
1486 AliAODMCParticle *mcprong=0;
1487 Int_t pdgProng[2]={0,0};
1489 for (
Int_t iprong=0;iprong<2;iprong++){
1490 if(
fReadMC && labprong[iprong]>=0) {
1491 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1492 pdgProng[iprong]=mcprong->GetPdgCode();
1499 fillthispi=
"hptpiSnoMcut_";
1502 fillthisK=
"hptKSnoMcut_";
1505 if ((TMath::Abs(pdgProng[0]) == 211 && TMath::Abs(pdgProng[1]) == 321)
1506 || (isSelectedPID==1 || isSelectedPID==3)){
1507 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong0->Pt());
1508 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong1->Pt());
1511 if ((TMath::Abs(pdgProng[0]) == 321 && TMath::Abs(pdgProng[1]) == 211)
1512 || (isSelectedPID==2 || isSelectedPID==3)){
1513 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong0->Pt());
1514 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong1->Pt());
1526 fillthispt=
"histSgnPt";
1528 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)
1529 || (!
fReadMC && (isSelectedPID==1 || isSelectedPID==3))){
1530 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1533 fillthisetaphi=
"hetaphiD0candidateS_";
1534 fillthisetaphi+=ptbin;
1535 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1537 if(TMath::Abs(minvD0-mPDG)<0.05){
1538 fillthisetaphi=
"hetaphiD0candidatesignalregionS_";
1539 fillthisetaphi+=ptbin;
1540 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1546 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1549 fillthisetaphi=
"hetaphiD0barcandidateS_";
1550 fillthisetaphi+=ptbin;
1551 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1553 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1554 fillthisetaphi=
"hetaphiD0barcandidatesignalregionS_";
1555 fillthisetaphi+=ptbin;
1556 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1563 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1573 ptProng[0]=prong0->Pt(); ptProng[1]=prong1->Pt();
1574 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1576 if(
fArray==1) cout<<
"LS signal: ERROR"<<endl;
1577 for (
Int_t iprong=0; iprong<2; iprong++){
1579 if (
fReadMC) labprong[iprong]=prong->GetLabel();
1583 if(
fReadMC && labprong[iprong]>=0) {
1584 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1585 pdgprong=mcprong->GetPdgCode();
1588 Bool_t isPionHere[2]={(isSelectedPID==1 || isSelectedPID==3) ? kTRUE : kFALSE,(isSelectedPID==2 || isSelectedPID==3) ? kTRUE : kFALSE};
1590 if(TMath::Abs(pdgprong)==211 || isPionHere[iprong]) {
1594 fillthispi=
"hptpiS_";
1596 ((TH1F*)listout->FindObject(fillthispi))->Fill(ptProng[iprong]);
1599 fillthispi=
"hd0piS_";
1601 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0Prong[iprong]);
1604 fillthispi=
"hd0vpiS_";
1606 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0[iprong]);
1611 if(TMath::Abs(pdgprong)==321 || !isPionHere[iprong]) {
1616 ((TH1F*)listout->FindObject(fillthisK))->Fill(ptProng[iprong]);
1622 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0Prong[iprong]);
1624 fillthisK=
"hd0vKS_";
1626 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0[iprong]);
1631 fillthis=
"hcosthpointd0S_";
1633 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[iprong]);
1639 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1641 fillthis=
"hcosthetapointS_";
1643 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1645 fillthis=
"hcosthetapointxyS_";
1652 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0());
1656 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1658 fillthis=
"hnormdeclS_";
1660 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1662 fillthis=
"hdeclxyS_";
1664 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1666 fillthis=
"hnormdeclxyS_";
1668 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1670 fillthis=
"hdeclxyd0d0S_";
1672 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1674 fillthis=
"hnormdeclxyd0d0S_";
1676 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1679 fillthis=
"hdeclvS_";
1681 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1683 fillthis=
"hnormdeclvS_";
1685 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1687 fillthis=
"hd0d0vS_";
1689 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1693 fillthis=
"hcosthetastarS_";
1695 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)) ((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1697 if (
fReadMC || isSelectedPID>1)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar);
1698 if(isSelectedPID==1 || isSelectedPID==3)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1701 fillthis=
"hcosthpointd0d0S_";
1703 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1706 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)){
1707 for(
Int_t it=0; it<2; it++){
1710 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1711 fillthis=
"hphiD0S_";
1713 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1714 Int_t nPointsITS = 0;
1715 for (
Int_t il=0; il<6; il++){
1716 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1718 fillthis=
"hNITSpointsD0vsptS_";
1720 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(),nPointsITS);
1721 fillthis=
"hNSPDpointsD0S_";
1723 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1724 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1726 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1727 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1729 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1730 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1732 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1733 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1735 fillthis=
"hNclsD0vsptS_";
1739 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1743 if (
fReadMC || isSelectedPID>1){
1744 for(
Int_t it=0; it<2; it++){
1745 fillthis=
"hptD0barS_";
1747 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1748 fillthis=
"hphiD0barS_";
1750 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1751 fillthis=
"hNclsD0barvsptS_";
1755 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1758 if(isSelectedPID==1 || isSelectedPID==3){
1759 for(
Int_t it=0; it<2; it++){
1762 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1763 fillthis=
"hphiD0S_";
1765 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1766 Int_t nPointsITS = 0;
1767 for (
Int_t il=0; il<6; il++){
1768 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1770 fillthis=
"hNITSpointsD0vsptS_";
1772 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1773 fillthis=
"hNSPDpointsD0S_";
1775 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1776 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1778 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1779 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1781 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1782 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1784 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1785 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1787 fillthis=
"hNclsD0vsptS_";
1791 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1809 fillthispt=
"histBkgPt";
1812 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1815 fillthisetaphi=
"hetaphiD0candidateB_";
1816 fillthisetaphi+=ptbin;
1817 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1819 if(TMath::Abs(minvD0-mPDG)<0.05){
1820 fillthisetaphi=
"hetaphiD0candidatesignalregionB_";
1821 fillthisetaphi+=ptbin;
1822 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1826 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1829 fillthisetaphi=
"hetaphiD0barcandidateB_";
1830 fillthisetaphi+=ptbin;
1831 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1833 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1834 fillthisetaphi=
"hetaphiD0barcandidatesignalregionB_";
1835 fillthisetaphi+=ptbin;
1836 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1841 fillthis=
"hptB1prongnoMcut_";
1844 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1846 fillthis=
"hptB2prongsnoMcut_";
1848 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1849 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1854 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1866 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1871 if(fDebug>2) cout<<
"No daughter found";
1876 if(prongg->Charge()==1) {
1878 ((TH1F*)
fOutputMass->FindObject(
"hpospair"))->Fill(ptbin);
1881 ((TH1F*)
fOutputMass->FindObject(
"hnegpair"))->Fill(ptbin);
1889 for(
Int_t it=0; it<2; it++){
1892 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1893 fillthis=
"hphiD0B_";
1895 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1897 Int_t nPointsITS = 0;
1898 for (
Int_t il=0; il<6; il++){
1899 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1901 fillthis=
"hNITSpointsD0vsptB_";
1903 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1904 fillthis=
"hNSPDpointsD0B_";
1906 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1907 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1909 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1910 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1912 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1913 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1915 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1916 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1918 fillthis=
"hNclsD0vsptB_";
1922 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1929 for(
Int_t it=0; it<2; it++){
1930 fillthis=
"hptD0barB_";
1932 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1933 fillthis=
"hphiD0barB_";
1935 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1936 fillthis=
"hNclsD0barvsptB_";
1940 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1946 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1947 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1950 Int_t pdgMother[2]={0,0};
1953 for(
Int_t iprong=0;iprong<2;iprong++){
1955 lab=prong->GetLabel();
1957 AliAODMCParticle* mcprong=(AliAODMCParticle*)arrMC->At(lab);
1959 Int_t labmom=mcprong->GetMother();
1961 AliAODMCParticle* mcmother=(AliAODMCParticle*)arrMC->At(labmom);
1962 if(mcmother) pdgMother[iprong]=mcmother->GetPdgCode();
1969 fillthis=
"hd0moresB_";
1972 if(TMath::Abs(pdgMother[iprong])==310 || TMath::Abs(pdgMother[iprong])==130 || TMath::Abs(pdgMother[iprong])==321){
1973 if(ptProng[iprong]<=1)factor[iprong]=1./.7;
1974 else factor[iprong]=1./.6;
1978 if(TMath::Abs(pdgMother[iprong])==3122) {
1979 factor[iprong]=1./0.25;
1982 fillthis=
"hd0moresB_";
1985 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[iprong],factor[iprong]);
1988 fillthis=
"hd0vmoresB_";
1990 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[iprong],factor[iprong]);
1996 fillthis=
"hd0d0moresB_";
1998 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0(),factor[0]*factor[1]);
2000 fillthis=
"hcosthetapointmoresB_";
2002 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,factor[0]*factor[1]);
2005 fillthis=
"hd0d0vmoresB_";
2007 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1],factor[0]*factor[1]);
2016 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[0]);
2017 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[1]);
2019 fillthis=
"hcosthetastarB_";
2027 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
2030 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
2032 fillthis=
"hcosthpointd0d0B_";
2034 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
2036 fillthis=
"hcosthpointd0B_";
2038 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[0]);
2039 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[1]);
2044 fillthis=
"hd0vp0B_";
2046 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
2047 fillthis=
"hd0vp1B_";
2049 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
2053 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
2054 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
2062 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
2066 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]*d0Prong[1]);
2069 fillthis=
"hd0d0vB_";
2071 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
2074 fillthis=
"hcosthetapointB_";
2076 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
2078 fillthis=
"hcosthetapointxyB_";
2084 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
2086 fillthis=
"hnormdeclB_";
2088 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
2090 fillthis=
"hdeclxyB_";
2092 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
2094 fillthis=
"hnormdeclxyB_";
2096 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
2098 fillthis=
"hdeclxyd0d0B_";
2100 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
2102 fillthis=
"hnormdeclxyd0d0B_";
2104 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
2109 fillthis=
"hdeclvB_";
2111 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
2113 fillthis=
"hnormdeclvB_";
2115 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
2132 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
2166 if(fDebug>2) cout<<
"Candidate selected"<<endl;
2176 Double_t arrayForSparse[3]={invmassD0,pt,impparXY};
2177 Double_t arrayForSparseTrue[3]={invmassD0,pt,trueImpParXY};
2206 TString fillthis=
"", fillthispt=
"", fillthismasspt=
"", fillthismassy=
"", fillthissub=
"";
2207 Int_t pdgDgD0toKpi[2]={321,211};
2210 if (
fReadMC) labD0 = part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2219 if (weigD0 > 1.0 || weigD0 < 0.) {weigD0 = 0.;}
2220 if (weigD0bar > 1.0 || weigD0bar < 0.) {weigD0bar = 0.;}
2230 arrayForSparse[0]=invmassD0; arrayForSparse[2]=impparXY;
2234 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2236 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2237 Int_t pdgD0 = partD0->GetPdgCode();
2244 arrayForSparseTrue[0]=invmassD0; arrayForSparseTrue[2]=trueImpParXY;
2248 fillthis=
"histSgn_";
2250 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2253 fillthismasspt=
"histSgnPt";
2254 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2265 fillthismassy=
"histSgnY_";
2266 fillthismassy+=ptbin;
2267 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2272 fillthis=
"histSgn27_";
2274 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2278 fillthis=
"histRfl_";
2280 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2283 fillthismasspt=
"histRflPt";
2285 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2289 fillthismassy=
"histRflY_";
2290 fillthismassy+=ptbin;
2292 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2297 fillthis=
"histBkg_";
2299 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2302 fillthismasspt=
"histBkgPt";
2304 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2309 fillthismassy=
"histBkgY_";
2310 fillthismassy+=ptbin;
2312 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2318 fillthis=
"histMass_";
2323 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2326 fillthissub=
"histMassvsSubSample_";
2332 fillthismasspt=
"histMassPt";
2334 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2342 fillthismassy=
"histMassY_";
2343 fillthismassy+=ptbin;
2345 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2353 arrayForSparse[0]=invmassD0bar; arrayForSparse[2]=impparXY;
2357 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2358 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2359 Int_t pdgD0 = partD0->GetPdgCode();
2366 arrayForSparseTrue[0]=invmassD0bar; arrayForSparseTrue[2]=trueImpParXY;
2369 fillthis=
"histSgn_";
2371 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2379 fillthismasspt=
"histSgnPt";
2381 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2393 fillthismassy=
"histSgnY_";
2394 fillthismassy+=ptbin;
2396 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2400 fillthis=
"histRfl_";
2402 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2404 fillthismasspt=
"histRflPt";
2406 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2409 fillthismassy=
"histRflY_";
2410 fillthismassy+=ptbin;
2412 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2416 fillthis=
"histBkg_";
2418 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2421 fillthismasspt=
"histBkgPt";
2423 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2427 fillthismassy=
"histBkgY_";
2428 fillthismassy+=ptbin;
2430 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2434 fillthis=
"histMass_";
2438 ((TH1F*)listout->FindObject(fillthis))->Fill(invmassD0bar,weigD0bar);
2441 fillthissub=
"histMassvsSubSample_";
2447 fillthismasspt=
"histMassPt";
2449 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2453 fillthismassy=
"histMassY_";
2454 fillthismassy+=ptbin;
2456 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2469 Int_t nTrksToSkip=2;
2472 AliDebug(2,
"no daughter found!");
2475 skipped[0]=dgTrack->GetID();
2478 AliDebug(2,
"no daughter found!");
2481 skipped[1]=dgTrack->GetID();
2483 AliESDVertex *vertexESD=0x0;
2484 AliAODVertex *vertexAOD=0x0;
2485 AliVertexerTracks *vertexer =
new AliVertexerTracks(aodev->GetMagneticField());
2488 vertexer->SetSkipTracks(nTrksToSkip,skipped);
2489 vertexer->SetMinClusters(4);
2490 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
2491 if(!vertexESD)
return vertexAOD;
2492 if(vertexESD->GetNContributors()<=0) {
2493 AliDebug(2,
"vertexing failed");
2494 delete vertexESD; vertexESD=NULL;
2498 delete vertexer; vertexer=NULL;
2503 vertexESD->GetXYZ(pos);
2504 vertexESD->GetCovMatrix(cov);
2505 chi2perNDF = vertexESD->GetChi2toNDF();
2506 delete vertexESD; vertexESD=NULL;
2508 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF);
2519 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass: Terminate() \n");
2524 printf(
"ERROR: fOutputMass not available\n");
2529 printf(
"ERROR: fOutputMass not available\n");
2536 printf(
"ERROR: fDistr not available\n");
2541 fNentries =
dynamic_cast<TH1F*
>(GetOutputData(3));
2544 printf(
"ERROR: fNEntries not available\n");
2549 printf(
"ERROR: fCuts not available\n");
2554 printf(
"ERROR: fCounter not available\n");
2560 printf(
"ERROR: fDetSignal not available\n");
2567 printf(
"ERROR: fOutputMassY not available\n");
2576 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));
2599 nameDistr=
"hd0d0B_";
2602 nameDistr=
"hcosthetapointB_";
2609 nameDistr=
"hcosthetastarB_";
2612 nameDistr=
"hcosthpointd0d0B_";
2629 TCanvas *cMass=
new TCanvas(cvname,cvname);
2633 TCanvas* cStat=
new TCanvas(cstname,Form(
"Stat%s",
fArray ?
"LS" :
"D0"));
2649 Int_t nmassbins=200;
2650 Double_t fLowmasslimit=1.5648, fUpmasslimit=2.1648;
2651 Int_t fNImpParBins=400;
2652 Double_t fLowerImpPar=-2000., fHigherImpPar=2000.;
2654 Double_t xmin[3]={fLowmasslimit,0.,fLowerImpPar};
2655 Double_t xmax[3]={fUpmasslimit,20.,fHigherImpPar};
2659 "Mass vs. pt vs.imppar - All",
2662 "Mass vs. pt vs.imppar - promptD",
2665 "Mass vs. pt vs.imppar - DfromB",
2668 "Mass vs. pt vs.true imppar -DfromB",
2671 "Mass vs. pt vs.imppar - backgr.",
2674 for(
Int_t i=0; i<5;i++){
2683 printf(
" AliAnalysisTaskSED0MassV1::GetTrueImpactParameter() \n");
2686 mcHeader->GetVertex(vtxTrue);
2688 partD0->XvYvZv(origD);
2690 Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2];
2691 for(
Int_t iDau=0; iDau<2; iDau++){
2698 Int_t labelFirstDau = partD0->GetDaughter(0);
2700 for(
Int_t iDau=0; iDau<2; iDau++){
2701 Int_t ind = labelFirstDau+iDau;
2702 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
2704 Int_t pdgCode = TMath::Abs( part->GetPdgCode() );
2706 AliError(
"Daughter particle not found in MC array");
2709 if(pdgCode==211 || pdgCode==321){
2710 pXdauTrue[iDau]=part->Px();
2711 pYdauTrue[iDau]=part->Py();
2712 pZdauTrue[iDau]=part->Pz();
2717 AliAODRecoDecayHF aodDzeroMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
2727 printf(
" AliAnalysisTaskSED0Mass V1::CheckOrigin() \n");
2729 Int_t pdgGranma = 0;
2731 mother = mcPartCandidate->GetMother();
2733 Int_t abspdgGranma =0;
2735 Bool_t isQuarkFound=kFALSE;
2738 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
2740 pdgGranma = mcGranma->GetPdgCode();
2741 abspdgGranma = TMath::Abs(pdgGranma);
2742 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
2745 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
2746 mother = mcGranma->GetMother();
2748 AliError(
"Failed casting the mother particle!");
2753 if(isFromB)
return 5;
2760 const Int_t nVarPrompt = 2;
2761 const Int_t nVarFD = 3;
2763 Int_t nbinsPrompt[nVarPrompt]={200,100};
2764 Int_t nbinsFD[nVarFD]={200,100,200};
2766 Double_t xminPrompt[nVarPrompt] = {0.,-1.};
2767 Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
2769 Double_t xminFD[nVarFD] = {0.,-1.,0.};
2770 Double_t xmaxFD[nVarFD] = {40.,1.,40.};
2773 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
2778 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
2779 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
2781 fMCAccBFeed->GetAxis(2)->SetTitle(
"p_{T}^{B} (GeV/c)");
2789 const Int_t nProng = 2;
2790 Double_t zMCVertex = mcHeader->GetVtxZ();
2792 for(
Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
2793 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
2794 if (TMath::Abs(mcPart->GetPdgCode()) == 421){
2799 Bool_t isGoodDecay=kFALSE;
2800 Int_t labDau[4]={-1,-1,-1,-1};
2802 Bool_t isFidAcc = kFALSE;
2805 if(deca > 0) isGoodDecay=kTRUE;
2812 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
2814 if(isGoodDecay && TMath::Abs(zMCVertex) <
fCuts->
GetMaxVtxZ() && isFidAcc && isInAcc) {
2818 Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
2825 Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
2837 for (
Int_t iProng = 0; iProng<nProng; iProng++){
2838 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
2839 if(!mcPartDaughter)
return kFALSE;
2840 Double_t eta = mcPartDaughter->Eta();
2841 Double_t pt = mcPartDaughter->Pt();
2842 if (TMath::Abs(eta) > 0.9 || pt < 0.1)
return kFALSE;
2859 normIP[0]=diffIP[0]/errdiffIP[0];
2860 normIP[1]=diffIP[1]/errdiffIP[1];
2862 AliAODVertex* secvtx=part->GetSecondaryVtx();
2864 Double_t err2decaylength=secvtx->Error2DistanceXYToVertex(primvtx);
2865 Double_t lxy=part->AliAODRecoDecay::DecayLengthXY(primvtx);
2870 Int_t pdgDgD0toKpi[2]={321,211};
2872 lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2875 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(lab);
2877 if(orig==4)signalType=1;
2878 else if(orig==5)signalType=2;
2886 Double_t arrayMC[8]={part->Pt(), ptB,normIP[0], normIP[1], lxy, lxy/TMath::Sqrt(err2decaylength),(
Double_t)isCuts, (
Double_t)isPid};
2889 for(
Int_t i=0; i<8; i++){
2890 pointD0MC[i]=arrayMC[i];
2902 if(!IsSelectedPIDoff)
return;
2906 for(
Int_t i=0;i<9;i++){
2907 pointD0[i]=array[i];
2913 for(
Int_t i=0;i<9;i++){
2914 pointD0bar[i]=arrayD0bar[i];
THnSparseF * fMCAccBFeed
!histo for StepMCAcc for D0 FD (pt,y,ptB)
Double_t NormalizedDecayLengthXY() const
AliAODTrack * GetProng(AliVEvent *event, AliAODRecoDecayHF *rd, Int_t iprong)
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
virtual Int_t PreSelect(TObjArray aodtracks)
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