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++) {
1271 for(
Int_t ipr=0;ipr<2;ipr++){
1272 AliAODTrack *tr=vHF->
GetProng(aod,d,ipr);
1273 arrTracks.AddAt(tr,ipr);
1274 tr->GetImpactParameters(xy[ipr],z[ipr]);
1295 if(ptbin==-1) {
fNentries->Fill(4);
continue;}
1303 AliDebug(1,
"at least one daughter not found!");
1318 Int_t isSelectedPIDfill = 3;
1321 if (isSelectedPIDfill == 0)
fNentries->Fill(7);
1322 if (isSelectedPIDfill == 1)
fNentries->Fill(8);
1323 if (isSelectedPIDfill == 2)
fNentries->Fill(9);
1324 if (isSelectedPIDfill == 3)
fNentries->Fill(10);
1356 AliESDtrack *esdtrack1 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1357 AliESDtrack *esdtrack2 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1361 Int_t isSelectedPIDfill = 3;
1366 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1367 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1368 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1369 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1371 if (isSelectedPIDfill != 0) {
1372 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1373 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1374 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1375 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1392 Int_t pdgDgD0toKpi[2]={321,211};
1394 if(
fReadMC) lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
1396 Int_t isSelectedPID=3;
1399 if (isSelectedPID==0)
fNentries->Fill(7);
1400 if (isSelectedPID==1)
fNentries->Fill(8);
1401 if (isSelectedPID==2)
fNentries->Fill(9);
1402 if (isSelectedPID==3)
fNentries->Fill(10);
1413 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1424 TString fillthispi=
"",fillthisK=
"",fillthis=
"", fillthispt=
"", fillthisetaphi=
"";
1429 Double_t dz1[2],dz2[2],covar1[3],covar2[3];
1430 dz1[0]=-99; dz2[0]=-99;
1440 AliAODVertex *vtxProp=0x0;
1446 AliESDtrack *esdtrack1=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1447 AliESDtrack *esdtrack2=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1448 esdtrack1->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz1,covar1);
1449 esdtrack2->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz2,covar2);
1450 delete vtxProp; vtxProp=NULL;
1467 Double_t normalizedDecayLength2 = -1, normalizedDecayLengthxy=-1;
1468 Double_t decayLength2 = -1, decayLengthxy=-1;
1483 if(!prong0 || !prong1) {
1488 labprong[0]=prong0->GetLabel();
1489 labprong[1]=prong1->GetLabel();
1491 AliAODMCParticle *mcprong=0;
1492 Int_t pdgProng[2]={0,0};
1494 for (
Int_t iprong=0;iprong<2;iprong++){
1495 if(
fReadMC && labprong[iprong]>=0) {
1496 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1497 pdgProng[iprong]=mcprong->GetPdgCode();
1504 fillthispi=
"hptpiSnoMcut_";
1507 fillthisK=
"hptKSnoMcut_";
1510 if ((TMath::Abs(pdgProng[0]) == 211 && TMath::Abs(pdgProng[1]) == 321)
1511 || (isSelectedPID==1 || isSelectedPID==3)){
1512 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong0->Pt());
1513 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong1->Pt());
1516 if ((TMath::Abs(pdgProng[0]) == 321 && TMath::Abs(pdgProng[1]) == 211)
1517 || (isSelectedPID==2 || isSelectedPID==3)){
1518 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong0->Pt());
1519 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong1->Pt());
1531 fillthispt=
"histSgnPt";
1533 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)
1534 || (!
fReadMC && (isSelectedPID==1 || isSelectedPID==3))){
1535 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1538 fillthisetaphi=
"hetaphiD0candidateS_";
1539 fillthisetaphi+=ptbin;
1540 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1542 if(TMath::Abs(minvD0-mPDG)<0.05){
1543 fillthisetaphi=
"hetaphiD0candidatesignalregionS_";
1544 fillthisetaphi+=ptbin;
1545 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1551 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1554 fillthisetaphi=
"hetaphiD0barcandidateS_";
1555 fillthisetaphi+=ptbin;
1556 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1558 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1559 fillthisetaphi=
"hetaphiD0barcandidatesignalregionS_";
1560 fillthisetaphi+=ptbin;
1561 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1568 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1578 ptProng[0]=prong0->Pt(); ptProng[1]=prong1->Pt();
1579 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1581 if(
fArray==1) cout<<
"LS signal: ERROR"<<endl;
1582 for (
Int_t iprong=0; iprong<2; iprong++){
1584 if (
fReadMC) labprong[iprong]=prong->GetLabel();
1588 if(
fReadMC && labprong[iprong]>=0) {
1589 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1590 pdgprong=mcprong->GetPdgCode();
1593 Bool_t isPionHere[2]={(isSelectedPID==1 || isSelectedPID==3) ? kTRUE : kFALSE,(isSelectedPID==2 || isSelectedPID==3) ? kTRUE : kFALSE};
1595 if(TMath::Abs(pdgprong)==211 || isPionHere[iprong]) {
1599 fillthispi=
"hptpiS_";
1601 ((TH1F*)listout->FindObject(fillthispi))->Fill(ptProng[iprong]);
1604 fillthispi=
"hd0piS_";
1606 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0Prong[iprong]);
1609 fillthispi=
"hd0vpiS_";
1611 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0[iprong]);
1616 if(TMath::Abs(pdgprong)==321 || !isPionHere[iprong]) {
1621 ((TH1F*)listout->FindObject(fillthisK))->Fill(ptProng[iprong]);
1627 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0Prong[iprong]);
1629 fillthisK=
"hd0vKS_";
1631 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0[iprong]);
1636 fillthis=
"hcosthpointd0S_";
1638 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[iprong]);
1644 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1646 fillthis=
"hcosthetapointS_";
1648 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1650 fillthis=
"hcosthetapointxyS_";
1657 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0());
1661 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1663 fillthis=
"hnormdeclS_";
1665 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1667 fillthis=
"hdeclxyS_";
1669 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1671 fillthis=
"hnormdeclxyS_";
1673 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1675 fillthis=
"hdeclxyd0d0S_";
1677 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1679 fillthis=
"hnormdeclxyd0d0S_";
1681 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1684 fillthis=
"hdeclvS_";
1686 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1688 fillthis=
"hnormdeclvS_";
1690 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1692 fillthis=
"hd0d0vS_";
1694 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1698 fillthis=
"hcosthetastarS_";
1700 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)) ((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1702 if (
fReadMC || isSelectedPID>1)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar);
1703 if(isSelectedPID==1 || isSelectedPID==3)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1706 fillthis=
"hcosthpointd0d0S_";
1708 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1711 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)){
1712 for(
Int_t it=0; it<2; it++){
1715 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1716 fillthis=
"hphiD0S_";
1718 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1719 Int_t nPointsITS = 0;
1720 for (
Int_t il=0; il<6; il++){
1721 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1723 fillthis=
"hNITSpointsD0vsptS_";
1725 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(),nPointsITS);
1726 fillthis=
"hNSPDpointsD0S_";
1728 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1729 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1731 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1732 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1734 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1735 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1737 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1738 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1740 fillthis=
"hNclsD0vsptS_";
1744 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1748 if (
fReadMC || isSelectedPID>1){
1749 for(
Int_t it=0; it<2; it++){
1750 fillthis=
"hptD0barS_";
1752 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1753 fillthis=
"hphiD0barS_";
1755 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1756 fillthis=
"hNclsD0barvsptS_";
1760 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1763 if(isSelectedPID==1 || isSelectedPID==3){
1764 for(
Int_t it=0; it<2; it++){
1767 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1768 fillthis=
"hphiD0S_";
1770 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1771 Int_t nPointsITS = 0;
1772 for (
Int_t il=0; il<6; il++){
1773 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1775 fillthis=
"hNITSpointsD0vsptS_";
1777 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1778 fillthis=
"hNSPDpointsD0S_";
1780 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1781 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1783 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1784 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1786 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1787 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1789 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1790 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1792 fillthis=
"hNclsD0vsptS_";
1796 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1814 fillthispt=
"histBkgPt";
1817 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1820 fillthisetaphi=
"hetaphiD0candidateB_";
1821 fillthisetaphi+=ptbin;
1822 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1824 if(TMath::Abs(minvD0-mPDG)<0.05){
1825 fillthisetaphi=
"hetaphiD0candidatesignalregionB_";
1826 fillthisetaphi+=ptbin;
1827 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1831 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1834 fillthisetaphi=
"hetaphiD0barcandidateB_";
1835 fillthisetaphi+=ptbin;
1836 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1838 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1839 fillthisetaphi=
"hetaphiD0barcandidatesignalregionB_";
1840 fillthisetaphi+=ptbin;
1841 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1846 fillthis=
"hptB1prongnoMcut_";
1849 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1851 fillthis=
"hptB2prongsnoMcut_";
1853 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1854 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1859 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1871 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1876 if(fDebug>2) cout<<
"No daughter found";
1881 if(prongg->Charge()==1) {
1883 ((TH1F*)
fOutputMass->FindObject(
"hpospair"))->Fill(ptbin);
1886 ((TH1F*)
fOutputMass->FindObject(
"hnegpair"))->Fill(ptbin);
1894 for(
Int_t it=0; it<2; it++){
1897 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1898 fillthis=
"hphiD0B_";
1900 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1902 Int_t nPointsITS = 0;
1903 for (
Int_t il=0; il<6; il++){
1904 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1906 fillthis=
"hNITSpointsD0vsptB_";
1908 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1909 fillthis=
"hNSPDpointsD0B_";
1911 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1912 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1914 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1915 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1917 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1918 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1920 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1921 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1923 fillthis=
"hNclsD0vsptB_";
1927 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1934 for(
Int_t it=0; it<2; it++){
1935 fillthis=
"hptD0barB_";
1937 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1938 fillthis=
"hphiD0barB_";
1940 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1941 fillthis=
"hNclsD0barvsptB_";
1945 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1951 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1952 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1955 Int_t pdgMother[2]={0,0};
1958 for(
Int_t iprong=0;iprong<2;iprong++){
1960 lab=prong->GetLabel();
1962 AliAODMCParticle* mcprong=(AliAODMCParticle*)arrMC->At(lab);
1964 Int_t labmom=mcprong->GetMother();
1966 AliAODMCParticle* mcmother=(AliAODMCParticle*)arrMC->At(labmom);
1967 if(mcmother) pdgMother[iprong]=mcmother->GetPdgCode();
1974 fillthis=
"hd0moresB_";
1977 if(TMath::Abs(pdgMother[iprong])==310 || TMath::Abs(pdgMother[iprong])==130 || TMath::Abs(pdgMother[iprong])==321){
1978 if(ptProng[iprong]<=1)factor[iprong]=1./.7;
1979 else factor[iprong]=1./.6;
1983 if(TMath::Abs(pdgMother[iprong])==3122) {
1984 factor[iprong]=1./0.25;
1987 fillthis=
"hd0moresB_";
1990 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[iprong],factor[iprong]);
1993 fillthis=
"hd0vmoresB_";
1995 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[iprong],factor[iprong]);
2001 fillthis=
"hd0d0moresB_";
2003 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0(),factor[0]*factor[1]);
2005 fillthis=
"hcosthetapointmoresB_";
2007 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,factor[0]*factor[1]);
2010 fillthis=
"hd0d0vmoresB_";
2012 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1],factor[0]*factor[1]);
2021 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[0]);
2022 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[1]);
2024 fillthis=
"hcosthetastarB_";
2032 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
2035 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
2037 fillthis=
"hcosthpointd0d0B_";
2039 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
2041 fillthis=
"hcosthpointd0B_";
2043 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[0]);
2044 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[1]);
2049 fillthis=
"hd0vp0B_";
2051 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
2052 fillthis=
"hd0vp1B_";
2054 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
2058 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
2059 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
2067 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
2071 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]*d0Prong[1]);
2074 fillthis=
"hd0d0vB_";
2076 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
2079 fillthis=
"hcosthetapointB_";
2081 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
2083 fillthis=
"hcosthetapointxyB_";
2089 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
2091 fillthis=
"hnormdeclB_";
2093 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
2095 fillthis=
"hdeclxyB_";
2097 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
2099 fillthis=
"hnormdeclxyB_";
2101 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
2103 fillthis=
"hdeclxyd0d0B_";
2105 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
2107 fillthis=
"hnormdeclxyd0d0B_";
2109 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
2114 fillthis=
"hdeclvB_";
2116 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
2118 fillthis=
"hnormdeclvB_";
2120 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
2137 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
2171 if(fDebug>2) cout<<
"Candidate selected"<<endl;
2181 Double_t arrayForSparse[3]={invmassD0,pt,impparXY};
2182 Double_t arrayForSparseTrue[3]={invmassD0,pt,trueImpParXY};
2211 TString fillthis=
"", fillthispt=
"", fillthismasspt=
"", fillthismassy=
"", fillthissub=
"";
2212 Int_t pdgDgD0toKpi[2]={321,211};
2215 if (
fReadMC) labD0 = part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2224 if (weigD0 > 1.0 || weigD0 < 0.) {weigD0 = 0.;}
2225 if (weigD0bar > 1.0 || weigD0bar < 0.) {weigD0bar = 0.;}
2235 arrayForSparse[0]=invmassD0; arrayForSparse[2]=impparXY;
2239 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2241 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2242 Int_t pdgD0 = partD0->GetPdgCode();
2249 arrayForSparseTrue[0]=invmassD0; arrayForSparseTrue[2]=trueImpParXY;
2253 fillthis=
"histSgn_";
2255 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2258 fillthismasspt=
"histSgnPt";
2259 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2270 fillthismassy=
"histSgnY_";
2271 fillthismassy+=ptbin;
2272 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2277 fillthis=
"histSgn27_";
2279 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2283 fillthis=
"histRfl_";
2285 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2288 fillthismasspt=
"histRflPt";
2290 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2294 fillthismassy=
"histRflY_";
2295 fillthismassy+=ptbin;
2297 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2302 fillthis=
"histBkg_";
2304 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2307 fillthismasspt=
"histBkgPt";
2309 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2314 fillthismassy=
"histBkgY_";
2315 fillthismassy+=ptbin;
2317 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2323 fillthis=
"histMass_";
2328 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2331 fillthissub=
"histMassvsSubSample_";
2337 fillthismasspt=
"histMassPt";
2339 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2347 fillthismassy=
"histMassY_";
2348 fillthismassy+=ptbin;
2350 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2358 arrayForSparse[0]=invmassD0bar; arrayForSparse[2]=impparXY;
2362 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2363 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2364 Int_t pdgD0 = partD0->GetPdgCode();
2371 arrayForSparseTrue[0]=invmassD0bar; arrayForSparseTrue[2]=trueImpParXY;
2374 fillthis=
"histSgn_";
2376 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2384 fillthismasspt=
"histSgnPt";
2386 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2398 fillthismassy=
"histSgnY_";
2399 fillthismassy+=ptbin;
2401 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2405 fillthis=
"histRfl_";
2407 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2409 fillthismasspt=
"histRflPt";
2411 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2414 fillthismassy=
"histRflY_";
2415 fillthismassy+=ptbin;
2417 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2421 fillthis=
"histBkg_";
2423 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2426 fillthismasspt=
"histBkgPt";
2428 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2432 fillthismassy=
"histBkgY_";
2433 fillthismassy+=ptbin;
2435 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2439 fillthis=
"histMass_";
2443 ((TH1F*)listout->FindObject(fillthis))->Fill(invmassD0bar,weigD0bar);
2446 fillthissub=
"histMassvsSubSample_";
2452 fillthismasspt=
"histMassPt";
2454 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2458 fillthismassy=
"histMassY_";
2459 fillthismassy+=ptbin;
2461 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2474 Int_t nTrksToSkip=2;
2477 AliDebug(2,
"no daughter found!");
2480 skipped[0]=dgTrack->GetID();
2483 AliDebug(2,
"no daughter found!");
2486 skipped[1]=dgTrack->GetID();
2488 AliESDVertex *vertexESD=0x0;
2489 AliAODVertex *vertexAOD=0x0;
2490 AliVertexerTracks *vertexer =
new AliVertexerTracks(aodev->GetMagneticField());
2493 vertexer->SetSkipTracks(nTrksToSkip,skipped);
2494 vertexer->SetMinClusters(4);
2495 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
2496 if(!vertexESD)
return vertexAOD;
2497 if(vertexESD->GetNContributors()<=0) {
2498 AliDebug(2,
"vertexing failed");
2499 delete vertexESD; vertexESD=NULL;
2503 delete vertexer; vertexer=NULL;
2508 vertexESD->GetXYZ(pos);
2509 vertexESD->GetCovMatrix(cov);
2510 chi2perNDF = vertexESD->GetChi2toNDF();
2511 delete vertexESD; vertexESD=NULL;
2513 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF);
2524 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass: Terminate() \n");
2529 printf(
"ERROR: fOutputMass not available\n");
2534 printf(
"ERROR: fOutputMass not available\n");
2541 printf(
"ERROR: fDistr not available\n");
2546 fNentries =
dynamic_cast<TH1F*
>(GetOutputData(3));
2549 printf(
"ERROR: fNEntries not available\n");
2554 printf(
"ERROR: fCuts not available\n");
2559 printf(
"ERROR: fCounter not available\n");
2565 printf(
"ERROR: fDetSignal not available\n");
2572 printf(
"ERROR: fOutputMassY not available\n");
2581 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));
2604 nameDistr=
"hd0d0B_";
2607 nameDistr=
"hcosthetapointB_";
2614 nameDistr=
"hcosthetastarB_";
2617 nameDistr=
"hcosthpointd0d0B_";
2634 TCanvas *cMass=
new TCanvas(cvname,cvname);
2638 TCanvas* cStat=
new TCanvas(cstname,Form(
"Stat%s",
fArray ?
"LS" :
"D0"));
2654 Int_t nmassbins=200;
2655 Double_t fLowmasslimit=1.5648, fUpmasslimit=2.1648;
2656 Int_t fNImpParBins=400;
2657 Double_t fLowerImpPar=-2000., fHigherImpPar=2000.;
2659 Double_t xmin[3]={fLowmasslimit,0.,fLowerImpPar};
2660 Double_t xmax[3]={fUpmasslimit,20.,fHigherImpPar};
2664 "Mass vs. pt vs.imppar - All",
2667 "Mass vs. pt vs.imppar - promptD",
2670 "Mass vs. pt vs.imppar - DfromB",
2673 "Mass vs. pt vs.true imppar -DfromB",
2676 "Mass vs. pt vs.imppar - backgr.",
2679 for(
Int_t i=0; i<5;i++){
2688 printf(
" AliAnalysisTaskSED0MassV1::GetTrueImpactParameter() \n");
2691 mcHeader->GetVertex(vtxTrue);
2693 partD0->XvYvZv(origD);
2695 Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2];
2696 for(
Int_t iDau=0; iDau<2; iDau++){
2703 Int_t labelFirstDau = partD0->GetDaughter(0);
2705 for(
Int_t iDau=0; iDau<2; iDau++){
2706 Int_t ind = labelFirstDau+iDau;
2707 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
2709 Int_t pdgCode = TMath::Abs( part->GetPdgCode() );
2711 AliError(
"Daughter particle not found in MC array");
2714 if(pdgCode==211 || pdgCode==321){
2715 pXdauTrue[iDau]=part->Px();
2716 pYdauTrue[iDau]=part->Py();
2717 pZdauTrue[iDau]=part->Pz();
2722 AliAODRecoDecayHF aodDzeroMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
2732 printf(
" AliAnalysisTaskSED0Mass V1::CheckOrigin() \n");
2734 Int_t pdgGranma = 0;
2736 mother = mcPartCandidate->GetMother();
2738 Int_t abspdgGranma =0;
2740 Bool_t isQuarkFound=kFALSE;
2743 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
2745 pdgGranma = mcGranma->GetPdgCode();
2746 abspdgGranma = TMath::Abs(pdgGranma);
2747 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
2750 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
2751 mother = mcGranma->GetMother();
2753 AliError(
"Failed casting the mother particle!");
2758 if(isFromB)
return 5;
2765 const Int_t nVarPrompt = 2;
2766 const Int_t nVarFD = 3;
2768 Int_t nbinsPrompt[nVarPrompt]={200,100};
2769 Int_t nbinsFD[nVarFD]={200,100,200};
2771 Double_t xminPrompt[nVarPrompt] = {0.,-1.};
2772 Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
2774 Double_t xminFD[nVarFD] = {0.,-1.,0.};
2775 Double_t xmaxFD[nVarFD] = {40.,1.,40.};
2778 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
2783 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
2784 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
2786 fMCAccBFeed->GetAxis(2)->SetTitle(
"p_{T}^{B} (GeV/c)");
2794 const Int_t nProng = 2;
2795 Double_t zMCVertex = mcHeader->GetVtxZ();
2797 for(
Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
2798 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
2799 if (TMath::Abs(mcPart->GetPdgCode()) == 421){
2804 Bool_t isGoodDecay=kFALSE;
2805 Int_t labDau[4]={-1,-1,-1,-1};
2807 Bool_t isFidAcc = kFALSE;
2810 if(deca > 0) isGoodDecay=kTRUE;
2817 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
2819 if(isGoodDecay && TMath::Abs(zMCVertex) <
fCuts->
GetMaxVtxZ() && isFidAcc && isInAcc) {
2823 Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
2830 Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
2842 for (
Int_t iProng = 0; iProng<nProng; iProng++){
2843 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
2844 if(!mcPartDaughter)
return kFALSE;
2845 Double_t eta = mcPartDaughter->Eta();
2846 Double_t pt = mcPartDaughter->Pt();
2847 if (TMath::Abs(eta) > 0.9 || pt < 0.1)
return kFALSE;
2864 normIP[0]=diffIP[0]/errdiffIP[0];
2865 normIP[1]=diffIP[1]/errdiffIP[1];
2867 AliAODVertex* secvtx=part->GetSecondaryVtx();
2869 Double_t err2decaylength=secvtx->Error2DistanceXYToVertex(primvtx);
2870 Double_t lxy=part->AliAODRecoDecay::DecayLengthXY(primvtx);
2875 Int_t pdgDgD0toKpi[2]={321,211};
2877 lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2880 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(lab);
2882 if(orig==4)signalType=1;
2883 else if(orig==5)signalType=2;
2891 Double_t arrayMC[8]={part->Pt(), ptB,normIP[0], normIP[1], lxy, lxy/TMath::Sqrt(err2decaylength),(
Double_t)isCuts, (
Double_t)isPid};
2894 for(
Int_t i=0; i<8; i++){
2895 pointD0MC[i]=arrayMC[i];
2907 if(!IsSelectedPIDoff)
return;
2911 for(
Int_t i=0;i<9;i++){
2912 pointD0[i]=array[i];
2918 for(
Int_t i=0;i<9;i++){
2919 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