29 #include <Riostream.h>
30 #include <TClonesArray.h>
37 #include <TDatabasePDG.h>
38 #include <THnSparse.h>
40 #include <AliAnalysisDataSlot.h>
41 #include <AliAnalysisDataContainer.h>
42 #include "AliAnalysisManager.h"
43 #include "AliESDtrack.h"
44 #include "AliVertexerTracks.h"
45 #include "AliAODHandler.h"
46 #include "AliAODEvent.h"
47 #include "AliAODVertex.h"
48 #include "AliAODTrack.h"
49 #include "AliAODMCHeader.h"
50 #include "AliAODMCParticle.h"
54 #include "AliAnalysisTaskSE.h"
86 fIsSelectedCandidate(0),
89 fIsRejectSDDClusters(0),
92 fFillImpParHist(kFALSE),
93 fUseSelectionBit(kTRUE),
95 fWriteVariableTree(kFALSE),
97 fCandidateVariables(),
99 fDrawDetSignal(kFALSE),
100 fUseQuarkTagInKine(kTRUE),
102 fhStudyImpParSingleTrackSign(0),
103 fhStudyImpParSingleTrackCand(0),
104 fhStudyImpParSingleTrackFd(0),
106 fhMultVZEROTPCoutTrackCorrNoCut(0x0),
107 fhMultVZEROTPCoutTrackCorr(0x0),
108 fEnablePileupRejVZEROTPCout(kFALSE)
133 fLsNormalization(1.),
136 fIsSelectedCandidate(0),
137 fFillVarHists(kTRUE),
139 fIsRejectSDDClusters(0),
142 fFillImpParHist(kFALSE),
143 fUseSelectionBit(kTRUE),
145 fWriteVariableTree(kFALSE),
147 fCandidateVariables(),
149 fDrawDetSignal(kFALSE),
150 fUseQuarkTagInKine(kTRUE),
152 fhStudyImpParSingleTrackSign(0),
153 fhStudyImpParSingleTrackCand(0),
154 fhStudyImpParSingleTrackFd(0),
156 fhMultVZEROTPCoutTrackCorrNoCut(0x0),
157 fhMultVZEROTPCoutTrackCorr(0x0),
158 fEnablePileupRejVZEROTPCout(kFALSE)
168 DefineOutput(1,TList::Class());
170 DefineOutput(2,TList::Class());
172 DefineOutput(3,TH1F::Class());
174 DefineOutput(4,AliRDHFCutsD0toKpi::Class());
176 DefineOutput(5,AliNormalizationCounter::Class());
178 DefineOutput(6,TList::Class());
180 DefineOutput(7,TTree::Class());
182 DefineOutput(8, TList::Class());
184 DefineOutput(9, TList::Class());
210 for(
Int_t i=0; i<5; i++){
251 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::Init() \n");
255 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
256 copyfCuts->SetName(nameoutput);
258 PostData(4,copyfCuts);
270 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::UserCreateOutputObjects() \n");
287 fDistr->SetName(
"distributionslist");
293 TString nameMass=
" ",nameSgn27=
" ",nameSgn=
" ", nameBkg=
" ", nameRfl=
" ",nameMassNocutsS =
" ",nameMassNocutsB =
" ", namedistr=
" ";
294 TString nameMassPt=
"", nameSgnPt=
"", nameBkgPt=
"", nameRflPt=
"";
295 TString nameMassY=
"", nameSgnY=
"", nameBkgY=
"", nameRflY=
"";
301 nameMass=
"histMass_";
303 nameSgn27=
"histSgn27_";
311 nameMassNocutsS=
"hMassS_";
313 nameMassNocutsB=
"hMassB_";
320 namedistr=
"hNclsD0vsptS_";
322 TH2F *hNclsD0vsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
323 namedistr=
"hNclsD0barvsptS_";
325 TH2F *hNclsD0barvsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
327 namedistr=
"hNITSpointsD0vsptS_";
329 TH2F *hNITSpointsD0vsptS =
new TH2F(namedistr.Data(),
"N ITS points distrubution [S];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
331 namedistr=
"hNSPDpointsD0S_";
333 TH1I *hNSPDpointsD0S =
new TH1I(namedistr.Data(),
"N SPD points distrubution [S]; ;N tracks",4,0,4);
334 hNSPDpointsD0S->GetXaxis()->SetBinLabel(1,
"no SPD");
335 hNSPDpointsD0S->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
336 hNSPDpointsD0S->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
337 hNSPDpointsD0S->GetXaxis()->SetBinLabel(4,
"kBoth");
341 TH1F *hptD0S =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
342 namedistr=
"hptD0barS_";
344 TH1F *hptD0barS =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
346 namedistr=
"hphiD0S_";
348 TH1F *hphiD0S =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
349 namedistr=
"hphiD0barS_";
351 TH1F *hphiD0barS =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
354 namedistr=
"hetaphiD0candidateS_";
356 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());
357 namedistr=
"hetaphiD0barcandidateS_";
359 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());
361 namedistr=
"hetaphiD0candidatesignalregionS_";
363 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());
364 namedistr=
"hetaphiD0barcandidatesignalregionS_";
366 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());
371 TH1F *hdcaS =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
375 TH1F *hd0piS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions);d0(#pi) [cm]",200,-0.1,0.1);
379 TH1F *hd0KS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons);d0(K) [cm]",200,-0.1,0.1);
382 TH1F *hd0d0S =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
387 TH1F *hdeclengthS =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm]",200,0,0.015);
389 namedistr=
"hnormdeclS_";
391 TH1F *hnormdeclengthS =
new TH1F(namedistr.Data(),
"Normalized Decay Length^{2} distribution;(Decay Length/Err)^{2} ",200,0,12.);
393 namedistr=
"hdeclxyS_";
395 TH1F* hdeclxyS=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
396 namedistr=
"hnormdeclxyS_";
398 TH1F* hnormdeclxyS=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
400 namedistr=
"hdeclxyd0d0S_";
402 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);
404 namedistr=
"hnormdeclxyd0d0S_";
406 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);
409 namedistr=
"hcosthetapointS_";
411 TH1F *hcosthetapointS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
413 namedistr=
"hcosthetapointxyS_";
415 TH1F *hcosthetapointxyS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XYdistribution;cos#theta_{Point}",300,0.,1.);
417 TH1F* tmpMS =
new TH1F(nameMassNocutsS.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
420 fDistr->Add(hNclsD0vsptS);
421 fDistr->Add(hNclsD0barvsptS);
422 fDistr->Add(hNITSpointsD0vsptS);
423 fDistr->Add(hNSPDpointsD0S);
428 fDistr->Add(hetaphiD0candidateS);
429 fDistr->Add(hetaphiD0candidatesignalregionS);
430 fDistr->Add(hetaphiD0barcandidateS);
431 fDistr->Add(hetaphiD0barcandidatesignalregionS);
440 fDistr->Add(hcosthetapointS);
442 fDistr->Add(hcosthetapointxyS);
446 fDistr->Add(hnormdeclengthS);
450 fDistr->Add(hnormdeclxyS);
452 fDistr->Add(hdeclxyd0d0S);
453 fDistr->Add(hnormdeclxyd0d0S);
461 namedistr=
"hNclsD0vsptB_";
463 TH2F *hNclsD0vsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
464 namedistr=
"hNclsD0barvsptB_";
466 TH2F *hNclsD0barvsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
468 namedistr=
"hNITSpointsD0vsptB_";
470 TH2F *hNITSpointsD0vsptB =
new TH2F(namedistr.Data(),
"N ITS points distrubution [B];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
472 namedistr=
"hNSPDpointsD0B_";
474 TH1I *hNSPDpointsD0B =
new TH1I(namedistr.Data(),
"N SPD points distrubution [B]; ;N tracks",4,0,4);
475 hNSPDpointsD0B->GetXaxis()->SetBinLabel(1,
"no SPD");
476 hNSPDpointsD0B->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
477 hNSPDpointsD0B->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
478 hNSPDpointsD0B->GetXaxis()->SetBinLabel(4,
"kBoth");
482 TH1F *hptD0B =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
483 namedistr=
"hptD0barB_";
485 TH1F *hptD0barB =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
487 namedistr=
"hphiD0B_";
489 TH1F *hphiD0B =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
490 namedistr=
"hphiD0barB_";
492 TH1F *hphiD0barB =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
494 namedistr=
"hetaphiD0candidateB_";
496 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());
497 namedistr=
"hetaphiD0barcandidateB_";
499 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());
501 namedistr=
"hetaphiD0candidatesignalregionB_";
503 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());
504 namedistr=
"hetaphiD0barcandidatesignalregionB_";
506 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());
511 TH1F *hdcaB =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
516 TH1F *hd0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
520 TH1F *hd0d0B =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
525 TH1F *hdeclengthB =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm^{2}]",200,0,0.015);
527 namedistr=
"hnormdeclB_";
529 TH1F *hnormdeclengthB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution;(Decay Length/Err)^{2} ",200,0,12.);
531 namedistr=
"hdeclxyB_";
533 TH1F* hdeclxyB=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
534 namedistr=
"hnormdeclxyB_";
536 TH1F* hnormdeclxyB=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
538 namedistr=
"hdeclxyd0d0B_";
540 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);
542 namedistr=
"hnormdeclxyd0d0B_";
544 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);
547 namedistr=
"hcosthetapointB_";
549 TH1F *hcosthetapointB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
551 namedistr=
"hcosthetapointxyB_";
553 TH1F *hcosthetapointxyB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XY distribution;cos#theta_{Point} XY",300,0.,1.);
555 TH1F* tmpMB =
new TH1F(nameMassNocutsB.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
559 fDistr->Add(hNclsD0vsptB);
560 fDistr->Add(hNclsD0barvsptB);
561 fDistr->Add(hNITSpointsD0vsptB);
562 fDistr->Add(hNSPDpointsD0B);
567 fDistr->Add(hetaphiD0candidateB);
568 fDistr->Add(hetaphiD0candidatesignalregionB);
569 fDistr->Add(hetaphiD0barcandidateB);
570 fDistr->Add(hetaphiD0barcandidatesignalregionB);
578 fDistr->Add(hcosthetapointB);
580 fDistr->Add(hcosthetapointxyB);
584 fDistr->Add(hnormdeclengthB);
588 fDistr->Add(hnormdeclxyB);
590 fDistr->Add(hdeclxyd0d0B);
591 fDistr->Add(hnormdeclxyd0d0B);
599 namedistr=
"hd0vpiS_";
601 TH1F *hd0vpiS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions)(vtx w/o these tracks);d0(#pi) [cm]",200,-0.1,0.1);
605 TH1F *hd0vKS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons) (vtx w/o these tracks);d0(K) [cm]",200,-0.1,0.1);
607 namedistr=
"hd0d0vS_";
609 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);
611 namedistr=
"hdeclvS_";
613 TH1F *hdeclengthvS =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
615 namedistr=
"hnormdeclvS_";
617 TH1F *hnormdeclengthvS =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
622 fDistr->Add(hdeclengthvS);
623 fDistr->Add(hnormdeclengthvS);
627 namedistr=
"hd0vmoresB_";
629 TH1F *hd0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
631 namedistr=
"hd0d0vmoresB_";
633 TH1F *hd0d0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
638 TH1F *hd0vB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
640 namedistr=
"hd0vp0B_";
642 TH1F *hd0vp0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong + ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
644 namedistr=
"hd0vp1B_";
646 TH1F *hd0vp1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong - ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
648 namedistr=
"hd0d0vB_";
650 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);
652 namedistr=
"hdeclvB_";
654 TH1F *hdeclengthvB =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
656 namedistr=
"hnormdeclvB_";
658 TH1F *hnormdeclengthvB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
666 fDistr->Add(hd0d0vmoresB);
668 fDistr->Add(hdeclengthvB);
670 fDistr->Add(hnormdeclengthvB);
680 TH1F* tmpSt =
new TH1F(nameSgn.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
682 TH1F *tmpSl=(TH1F*)tmpSt->Clone();
687 TH1F* tmpRt =
new TH1F(nameRfl.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
689 TH1F* tmpBt =
new TH1F(nameBkg.Data(),
"Background invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
703 TH1F* tmpMt =
new TH1F(nameMass.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
719 TH1F *hptpiS =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
723 TH1F *hptKS =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
726 namedistr=
"hcosthetastarS_";
728 TH1F *hcosthetastarS =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
732 namedistr=
"hptpiSnoMcut_";
734 TH1F *hptpiSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
736 namedistr=
"hptKSnoMcut_";
738 TH1F *hptKSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
742 fDistr->Add(hcosthetastarS);
744 fDistr->Add(hptpiSnoMcut);
748 namedistr=
"hcosthpointd0S_";
750 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);
751 namedistr=
"hcosthpointd0d0S_";
753 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);
755 fDistr->Add(hcosthpointd0S);
756 fDistr->Add(hcosthpointd0d0S);
759 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);
760 TH1F *tmpS27l=(TH1F*)tmpS27t->Clone();
772 TH1F *hptB =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
775 namedistr=
"hcosthetastarB_";
777 TH1F *hcosthetastarB =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
780 namedistr=
"hptB1prongnoMcut_";
782 TH1F *hptB1pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
784 namedistr=
"hptB2prongsnoMcut_";
786 TH1F *hptB2pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
789 fDistr->Add(hcosthetastarB);
791 fDistr->Add(hptB1pnoMcut);
792 fDistr->Add(hptB2pnoMcut);
797 TH1F *hd0p0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.1,0.1);
801 TH1F *hd0p1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong -);d0 [cm]",200,-0.1,0.1);
804 namedistr=
"hd0moresB_";
806 TH1F *hd0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
808 namedistr=
"hd0d0moresB_";
810 TH1F *hd0d0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
813 namedistr=
"hcosthetapointmoresB_";
815 TH1F *hcosthetapointmoresB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
818 namedistr=
"hcosthpointd0B_";
820 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);
822 namedistr=
"hcosthpointd0d0B_";
824 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);
831 fDistr->Add(hcosthetapointmoresB);
834 fDistr->Add(hcosthpointd0B);
837 fDistr->Add(hcosthpointd0d0B);
845 Int_t nbinsImpParStudy[9]= {50, 40, 40, 20, 15, 600, 3,4,2};
846 Double_t limitLowImpParStudy[9]={0, -5, -5, 0, 0,1.6248,1,0,0};
847 Double_t limitUpImpParStudy[9]= {50., 5, 5, 0.2,15,2.2248,4,4,2};
848 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"};
849 fhStudyImpParSingleTrackCand=
new THnSparseF(
"fhStudyImpParSingleTrackCand",
"fhStudyImpParSingleTrackCand",9,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
857 Int_t nbinsImpParStudy[8]= {50,50,40, 40, 20, 15, 3, 4};
858 Double_t limitLowImpParStudy[8]={0, 0, -5,-5., 0., 0., 1.,0.};
859 Double_t limitUpImpParStudy[8]= {50.,50., 5, 5, 0.2, 15, 3.,4.};
861 fhStudyImpParSingleTrackSign=
new THnSparseF(
"fhStudyImpParSingleTrackSign",
"fhStudyImpParSingleTrackSign",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
862 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"};
867 fhStudyImpParSingleTrackFd=
new THnSparseF(
"fhStudyImpParSingleTrackFd",
"fhStudyImpParSingleTrackFd",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
879 namedistr=
"hpospair";
881 namedistr=
"hnegpair";
891 nameMassPt=
"histMassPt";
892 nameSgnPt=
"histSgnPt";
893 nameBkgPt=
"histBkgPt";
894 nameRflPt=
"histRflPt";
898 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);
899 TH2F *tmpSlPt=(
TH2F*)tmpStPt->Clone();
904 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);
905 TH2F* tmpBtPt =
new TH2F(nameBkgPt.Data(),
"Background invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
919 TH2F* tmpMtPt =
new TH2F(nameMassPt.Data(),
"D^{0} invariant mass; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
931 nameMassY=
"histMassY_";
933 nameSgnY=
"histSgnY_";
935 nameBkgY=
"histBkgY_";
937 nameRflY=
"histRflY_";
941 TH2F* tmpStY =
new TH2F(nameSgnY.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
944 TH2F* tmpRtY =
new TH2F(nameRflY.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
945 TH2F* tmpBtY =
new TH2F(nameBkgY.Data(),
"Background invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
953 TH2F* tmpMtY =
new TH2F(nameMassY.Data(),
"D^{0} invariant mass; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
960 const char* nameoutput=GetOutputSlot(3)->GetContainer()->GetName();
962 fNentries=
new TH1F(nameoutput,
"Integral(1,2) = number of AODs *** Integral(2,3) = number of candidates selected with cuts *** Integral(3,4) = number of D0 selected with cuts *** Integral(4,5) = events with good vertex *** Integral(5,6) = pt out of bounds", 23,-0.5,22.5);
964 fNentries->GetXaxis()->SetBinLabel(1,
"nEventsAnal");
965 fNentries->GetXaxis()->SetBinLabel(2,
"nCandSel(Cuts)");
967 else fNentries->GetXaxis()->SetBinLabel(3,
"Dstar<-D0");
968 fNentries->GetXaxis()->SetBinLabel(4,
"nEventsGoodVtxS");
969 fNentries->GetXaxis()->SetBinLabel(5,
"ptbin = -1");
970 fNentries->GetXaxis()->SetBinLabel(6,
"no daughter");
971 if(
fSys==0)
fNentries->GetXaxis()->SetBinLabel(7,
"nCandSel(Tr)");
973 fNentries->GetXaxis()->SetBinLabel(8,
"PID=0");
974 fNentries->GetXaxis()->SetBinLabel(9,
"PID=1");
975 fNentries->GetXaxis()->SetBinLabel(10,
"PID=2");
976 fNentries->GetXaxis()->SetBinLabel(11,
"PID=3");
979 fNentries->GetXaxis()->SetBinLabel(12,
"K");
980 fNentries->GetXaxis()->SetBinLabel(13,
"Lambda");
982 fNentries->GetXaxis()->SetBinLabel(14,
"Pile-up Rej");
983 fNentries->GetXaxis()->SetBinLabel(15,
"N. of 0SMH");
984 if(
fSys==1)
fNentries->GetXaxis()->SetBinLabel(16,
"Nev in centr");
986 fNentries->GetXaxis()->SetBinLabel(18,
"Phys.Sel.Rej");
987 fNentries->GetXaxis()->SetBinLabel(19,
"D0 failed to be filled");
988 fNentries->GetXaxis()->SetBinLabel(20,
"fisFilled is 0");
989 fNentries->GetXaxis()->SetBinLabel(21,
"fisFilled is 1");
990 fNentries->GetXaxis()->SetBinLabel(22,
"AOD/dAOD mismatch");
991 fNentries->GetXaxis()->SetBinLabel(23,
"AOD/dAOD #events ok");
992 fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
1000 nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
1005 fCandidateVariableNames[0] =
"massD0";
1006 fCandidateVariableNames[1] =
"massD0bar";
1007 fCandidateVariableNames[2] =
"pt";
1008 fCandidateVariableNames[3] =
"dca";
1009 fCandidateVariableNames[4] =
"costhsD0";
1010 fCandidateVariableNames[5] =
"costhsD0bar";
1011 fCandidateVariableNames[6] =
"ptk";
1012 fCandidateVariableNames[7] =
"ptpi";
1013 fCandidateVariableNames[8] =
"d0k";
1014 fCandidateVariableNames[9] =
"d0pi";
1015 fCandidateVariableNames[10] =
"d0xd0";
1016 fCandidateVariableNames[11] =
"costhp";
1017 fCandidateVariableNames[12] =
"costhpxy";
1018 fCandidateVariableNames[13] =
"lxy";
1019 fCandidateVariableNames[14] =
"specialcuts";
1029 TH2F *TOFSigBefPID =
new TH2F(
"TOFSigBefPID",
"TOF signal of daughters before PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1030 TH2F *TOFSigAftPID =
new TH2F(
"TOFSigAftPID",
"TOF signal after PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1032 TH2F *TPCSigBefPID =
new TH2F(
"TPCSigBefPID",
"TPC dE/dx before PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1033 TH2F *TPCSigAftPID =
new TH2F(
"TPCSigAftPID",
"TPC dE/dx after PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1043 fhMultVZEROTPCoutTrackCorr =
new TH2F(
"hMultVZEROTPCoutTrackCorr",
";Tracks with kTPCout on;VZERO multiplicity", 1000, 0., 30000., 1000, 0., 40000.);
1088 if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 &&
fAODProtection==1)) {
1104 bname=
"LikeSign2Prong";
1106 TClonesArray *inputArray=0;
1107 if(!aod && AODEvent() && IsStandardAOD()) {
1113 AliAODHandler* aodHandler = (AliAODHandler*)
1114 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1116 if(aodHandler->GetExtensions()) {
1117 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
1119 inputArray=(TClonesArray*)aodFromExt->GetList()->FindObject(bname.Data());
1122 inputArray=(TClonesArray*)aod->GetList()->FindObject(bname.Data());
1125 if(!inputArray || !aod) {
1126 printf(
"AliAnalysisTaskSED0Mass::UserExec: input branch not found!\n");
1131 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001)
return;
1133 TClonesArray *mcArray = 0;
1134 AliAODMCHeader *mcHeader = 0;
1138 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1140 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC particles branch not found!\n");
1145 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1147 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC header branch not found!\n");
1155 AliAODVZERO* v0data=(AliAODVZERO*)((
AliAODEvent*)aod)->GetVZEROData();
1156 Float_t mTotV0A=v0data->GetMTotV0A();
1157 Float_t mTotV0C=v0data->GetMTotV0C();
1158 mTotV0=mTotV0A+mTotV0C;
1159 Int_t ntracksEv = aod->GetNumberOfTracks();
1160 for(
Int_t itrack=0; itrack<ntracksEv; itrack++) {
1162 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1163 if(!track) {AliFatal(
"Not a standard AOD");}
1164 if(track->GetID()<0)
continue;
1165 if((track->GetFlags())&(AliESDtrack::kTPCout)) nTPCout++;
1169 Float_t mV0Cut=-2200.+(2.5*nTPCout)+(0.000012*nTPCout*nTPCout);
1171 if(mTotV0<mV0Cut)
return;
1181 TString trigclass=aod->GetFiredTriggerClasses();
1182 if(trigclass.Contains(
"C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains(
"C0SMH-B-NOPF-ALL"))
fNentries->Fill(14);
1196 Bool_t skipEvent = kFALSE;
1198 if (aod) ntracks = aod->GetNumberOfTracks();
1199 for(
Int_t itrack=0; itrack<ntracks; itrack++) {
1201 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1202 if(!track) AliFatal(
"Not a standard AOD");
1203 if(TESTBIT(track->GetITSClusterMap(),2) || TESTBIT(track->GetITSClusterMap(),3) ){
1209 if (skipEvent)
return;
1217 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1222 TString primTitle = vtx1->GetTitle();
1223 if(primTitle.Contains(
"VertexerTracks") && vtx1->GetNContributors()>0) {
1229 Int_t nInD0toKpi = inputArray->GetEntriesFast();
1230 if(fDebug>2) printf(
"Number of D0->Kpi: %d\n",nInD0toKpi);
1234 Int_t nSelectedloose=0,nSelectedtight=0;
1241 for (
Int_t iD0toKpi = 0; iD0toKpi < nInD0toKpi; iD0toKpi++) {
1262 if(ptbin==-1) {
fNentries->Fill(4);
continue;}
1270 AliDebug(1,
"at least one daughter not found!");
1285 Int_t isSelectedPIDfill = 3;
1288 if (isSelectedPIDfill == 0)
fNentries->Fill(7);
1289 if (isSelectedPIDfill == 1)
fNentries->Fill(8);
1290 if (isSelectedPIDfill == 2)
fNentries->Fill(9);
1291 if (isSelectedPIDfill == 3)
fNentries->Fill(10);
1323 AliESDtrack *esdtrack1 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1324 AliESDtrack *esdtrack2 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1328 Int_t isSelectedPIDfill = 3;
1333 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1334 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1335 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1336 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1338 if (isSelectedPIDfill != 0) {
1339 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1340 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1341 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1342 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1359 Int_t pdgDgD0toKpi[2]={321,211};
1361 if(
fReadMC) lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
1363 Int_t isSelectedPID=3;
1366 if (isSelectedPID==0)
fNentries->Fill(7);
1367 if (isSelectedPID==1)
fNentries->Fill(8);
1368 if (isSelectedPID==2)
fNentries->Fill(9);
1369 if (isSelectedPID==3)
fNentries->Fill(10);
1380 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1391 TString fillthispi=
"",fillthisK=
"",fillthis=
"", fillthispt=
"", fillthisetaphi=
"";
1396 Double_t dz1[2],dz2[2],covar1[3],covar2[3];
1397 dz1[0]=-99; dz2[0]=-99;
1407 AliAODVertex *vtxProp=0x0;
1413 AliESDtrack *esdtrack1=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1414 AliESDtrack *esdtrack2=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1415 esdtrack1->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz1,covar1);
1416 esdtrack2->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz2,covar2);
1417 delete vtxProp; vtxProp=NULL;
1434 Double_t normalizedDecayLength2 = -1, normalizedDecayLengthxy=-1;
1435 Double_t decayLength2 = -1, decayLengthxy=-1;
1450 if(!prong0 || !prong1) {
1455 labprong[0]=prong0->GetLabel();
1456 labprong[1]=prong1->GetLabel();
1458 AliAODMCParticle *mcprong=0;
1459 Int_t pdgProng[2]={0,0};
1461 for (
Int_t iprong=0;iprong<2;iprong++){
1462 if(
fReadMC && labprong[iprong]>=0) {
1463 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1464 pdgProng[iprong]=mcprong->GetPdgCode();
1471 fillthispi=
"hptpiSnoMcut_";
1474 fillthisK=
"hptKSnoMcut_";
1477 if ((TMath::Abs(pdgProng[0]) == 211 && TMath::Abs(pdgProng[1]) == 321)
1478 || (isSelectedPID==1 || isSelectedPID==3)){
1479 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong0->Pt());
1480 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong1->Pt());
1483 if ((TMath::Abs(pdgProng[0]) == 321 && TMath::Abs(pdgProng[1]) == 211)
1484 || (isSelectedPID==2 || isSelectedPID==3)){
1485 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong0->Pt());
1486 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong1->Pt());
1498 fillthispt=
"histSgnPt";
1500 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)
1501 || (!
fReadMC && (isSelectedPID==1 || isSelectedPID==3))){
1502 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1505 fillthisetaphi=
"hetaphiD0candidateS_";
1506 fillthisetaphi+=ptbin;
1507 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1509 if(TMath::Abs(minvD0-mPDG)<0.05){
1510 fillthisetaphi=
"hetaphiD0candidatesignalregionS_";
1511 fillthisetaphi+=ptbin;
1512 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1518 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1521 fillthisetaphi=
"hetaphiD0barcandidateS_";
1522 fillthisetaphi+=ptbin;
1523 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1525 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1526 fillthisetaphi=
"hetaphiD0barcandidatesignalregionS_";
1527 fillthisetaphi+=ptbin;
1528 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1535 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1545 ptProng[0]=prong0->Pt(); ptProng[1]=prong1->Pt();
1546 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1548 if(
fArray==1) cout<<
"LS signal: ERROR"<<endl;
1549 for (
Int_t iprong=0; iprong<2; iprong++){
1551 if (
fReadMC) labprong[iprong]=prong->GetLabel();
1555 if(
fReadMC && labprong[iprong]>=0) {
1556 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1557 pdgprong=mcprong->GetPdgCode();
1560 Bool_t isPionHere[2]={(isSelectedPID==1 || isSelectedPID==3) ? kTRUE : kFALSE,(isSelectedPID==2 || isSelectedPID==3) ? kTRUE : kFALSE};
1562 if(TMath::Abs(pdgprong)==211 || isPionHere[iprong]) {
1566 fillthispi=
"hptpiS_";
1568 ((TH1F*)listout->FindObject(fillthispi))->Fill(ptProng[iprong]);
1571 fillthispi=
"hd0piS_";
1573 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0Prong[iprong]);
1576 fillthispi=
"hd0vpiS_";
1578 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0[iprong]);
1583 if(TMath::Abs(pdgprong)==321 || !isPionHere[iprong]) {
1588 ((TH1F*)listout->FindObject(fillthisK))->Fill(ptProng[iprong]);
1594 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0Prong[iprong]);
1596 fillthisK=
"hd0vKS_";
1598 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0[iprong]);
1603 fillthis=
"hcosthpointd0S_";
1605 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[iprong]);
1611 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1613 fillthis=
"hcosthetapointS_";
1615 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1617 fillthis=
"hcosthetapointxyS_";
1624 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0());
1628 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1630 fillthis=
"hnormdeclS_";
1632 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1634 fillthis=
"hdeclxyS_";
1636 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1638 fillthis=
"hnormdeclxyS_";
1640 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1642 fillthis=
"hdeclxyd0d0S_";
1644 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1646 fillthis=
"hnormdeclxyd0d0S_";
1648 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1651 fillthis=
"hdeclvS_";
1653 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1655 fillthis=
"hnormdeclvS_";
1657 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1659 fillthis=
"hd0d0vS_";
1661 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1665 fillthis=
"hcosthetastarS_";
1667 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)) ((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1669 if (
fReadMC || isSelectedPID>1)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar);
1670 if(isSelectedPID==1 || isSelectedPID==3)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1673 fillthis=
"hcosthpointd0d0S_";
1675 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1678 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)){
1679 for(
Int_t it=0; it<2; it++){
1682 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1683 fillthis=
"hphiD0S_";
1685 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1686 Int_t nPointsITS = 0;
1687 for (
Int_t il=0; il<6; il++){
1688 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1690 fillthis=
"hNITSpointsD0vsptS_";
1692 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(),nPointsITS);
1693 fillthis=
"hNSPDpointsD0S_";
1695 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1696 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1698 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1699 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1701 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1702 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1704 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1705 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1707 fillthis=
"hNclsD0vsptS_";
1711 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1715 if (
fReadMC || isSelectedPID>1){
1716 for(
Int_t it=0; it<2; it++){
1717 fillthis=
"hptD0barS_";
1719 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1720 fillthis=
"hphiD0barS_";
1722 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1723 fillthis=
"hNclsD0barvsptS_";
1727 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1730 if(isSelectedPID==1 || isSelectedPID==3){
1731 for(
Int_t it=0; it<2; it++){
1734 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1735 fillthis=
"hphiD0S_";
1737 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1738 Int_t nPointsITS = 0;
1739 for (
Int_t il=0; il<6; il++){
1740 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1742 fillthis=
"hNITSpointsD0vsptS_";
1744 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1745 fillthis=
"hNSPDpointsD0S_";
1747 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1748 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1750 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1751 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1753 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1754 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1756 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1757 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1759 fillthis=
"hNclsD0vsptS_";
1763 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1781 fillthispt=
"histBkgPt";
1784 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1787 fillthisetaphi=
"hetaphiD0candidateB_";
1788 fillthisetaphi+=ptbin;
1789 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1791 if(TMath::Abs(minvD0-mPDG)<0.05){
1792 fillthisetaphi=
"hetaphiD0candidatesignalregionB_";
1793 fillthisetaphi+=ptbin;
1794 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1798 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1801 fillthisetaphi=
"hetaphiD0barcandidateB_";
1802 fillthisetaphi+=ptbin;
1803 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1805 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1806 fillthisetaphi=
"hetaphiD0barcandidatesignalregionB_";
1807 fillthisetaphi+=ptbin;
1808 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1813 fillthis=
"hptB1prongnoMcut_";
1816 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1818 fillthis=
"hptB2prongsnoMcut_";
1820 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1821 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1826 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1838 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1843 if(fDebug>2) cout<<
"No daughter found";
1848 if(prongg->Charge()==1) {
1850 ((TH1F*)
fOutputMass->FindObject(
"hpospair"))->Fill(ptbin);
1853 ((TH1F*)
fOutputMass->FindObject(
"hnegpair"))->Fill(ptbin);
1861 for(
Int_t it=0; it<2; it++){
1864 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1865 fillthis=
"hphiD0B_";
1867 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1869 Int_t nPointsITS = 0;
1870 for (
Int_t il=0; il<6; il++){
1871 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1873 fillthis=
"hNITSpointsD0vsptB_";
1875 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1876 fillthis=
"hNSPDpointsD0B_";
1878 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1879 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1881 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1882 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1884 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1885 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1887 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1888 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1890 fillthis=
"hNclsD0vsptB_";
1894 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1901 for(
Int_t it=0; it<2; it++){
1902 fillthis=
"hptD0barB_";
1904 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1905 fillthis=
"hphiD0barB_";
1907 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1908 fillthis=
"hNclsD0barvsptB_";
1912 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1918 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1919 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1922 Int_t pdgMother[2]={0,0};
1925 for(
Int_t iprong=0;iprong<2;iprong++){
1927 lab=prong->GetLabel();
1929 AliAODMCParticle* mcprong=(AliAODMCParticle*)arrMC->At(lab);
1931 Int_t labmom=mcprong->GetMother();
1933 AliAODMCParticle* mcmother=(AliAODMCParticle*)arrMC->At(labmom);
1934 if(mcmother) pdgMother[iprong]=mcmother->GetPdgCode();
1941 fillthis=
"hd0moresB_";
1944 if(TMath::Abs(pdgMother[iprong])==310 || TMath::Abs(pdgMother[iprong])==130 || TMath::Abs(pdgMother[iprong])==321){
1945 if(ptProng[iprong]<=1)factor[iprong]=1./.7;
1946 else factor[iprong]=1./.6;
1950 if(TMath::Abs(pdgMother[iprong])==3122) {
1951 factor[iprong]=1./0.25;
1954 fillthis=
"hd0moresB_";
1957 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[iprong],factor[iprong]);
1960 fillthis=
"hd0vmoresB_";
1962 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[iprong],factor[iprong]);
1968 fillthis=
"hd0d0moresB_";
1970 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0(),factor[0]*factor[1]);
1972 fillthis=
"hcosthetapointmoresB_";
1974 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,factor[0]*factor[1]);
1977 fillthis=
"hd0d0vmoresB_";
1979 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1],factor[0]*factor[1]);
1988 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[0]);
1989 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[1]);
1991 fillthis=
"hcosthetastarB_";
1999 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
2002 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
2004 fillthis=
"hcosthpointd0d0B_";
2006 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
2008 fillthis=
"hcosthpointd0B_";
2010 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[0]);
2011 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[1]);
2016 fillthis=
"hd0vp0B_";
2018 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
2019 fillthis=
"hd0vp1B_";
2021 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
2025 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
2026 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
2034 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
2038 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]*d0Prong[1]);
2041 fillthis=
"hd0d0vB_";
2043 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
2046 fillthis=
"hcosthetapointB_";
2048 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
2050 fillthis=
"hcosthetapointxyB_";
2056 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
2058 fillthis=
"hnormdeclB_";
2060 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
2062 fillthis=
"hdeclxyB_";
2064 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
2066 fillthis=
"hnormdeclxyB_";
2068 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
2070 fillthis=
"hdeclxyd0d0B_";
2072 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
2074 fillthis=
"hnormdeclxyd0d0B_";
2076 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
2081 fillthis=
"hdeclvB_";
2083 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
2085 fillthis=
"hnormdeclvB_";
2087 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
2104 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
2138 if(fDebug>2) cout<<
"Candidate selected"<<endl;
2148 Double_t arrayForSparse[3]={invmassD0,pt,impparXY};
2149 Double_t arrayForSparseTrue[3]={invmassD0,pt,trueImpParXY};
2178 TString fillthis=
"", fillthispt=
"", fillthismasspt=
"", fillthismassy=
"";
2179 Int_t pdgDgD0toKpi[2]={321,211};
2182 if (
fReadMC) labD0 = part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2191 if (weigD0 > 1.0 || weigD0 < 0.) {weigD0 = 0.;}
2192 if (weigD0bar > 1.0 || weigD0bar < 0.) {weigD0bar = 0.;}
2202 arrayForSparse[0]=invmassD0; arrayForSparse[2]=impparXY;
2206 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2208 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2209 Int_t pdgD0 = partD0->GetPdgCode();
2216 arrayForSparseTrue[0]=invmassD0; arrayForSparseTrue[2]=trueImpParXY;
2220 fillthis=
"histSgn_";
2222 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2225 fillthismasspt=
"histSgnPt";
2226 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2237 fillthismassy=
"histSgnY_";
2238 fillthismassy+=ptbin;
2239 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2244 fillthis=
"histSgn27_";
2246 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2250 fillthis=
"histRfl_";
2252 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2255 fillthismasspt=
"histRflPt";
2257 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2261 fillthismassy=
"histRflY_";
2262 fillthismassy+=ptbin;
2264 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2269 fillthis=
"histBkg_";
2271 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2274 fillthismasspt=
"histBkgPt";
2276 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2281 fillthismassy=
"histBkgY_";
2282 fillthismassy+=ptbin;
2284 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2290 fillthis=
"histMass_";
2295 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2299 fillthismasspt=
"histMassPt";
2301 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2309 fillthismassy=
"histMassY_";
2310 fillthismassy+=ptbin;
2312 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2320 arrayForSparse[0]=invmassD0bar; arrayForSparse[2]=impparXY;
2324 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2325 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2326 Int_t pdgD0 = partD0->GetPdgCode();
2333 arrayForSparseTrue[0]=invmassD0bar; arrayForSparseTrue[2]=trueImpParXY;
2336 fillthis=
"histSgn_";
2338 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2346 fillthismasspt=
"histSgnPt";
2348 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2360 fillthismassy=
"histSgnY_";
2361 fillthismassy+=ptbin;
2363 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2367 fillthis=
"histRfl_";
2369 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2371 fillthismasspt=
"histRflPt";
2373 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2376 fillthismassy=
"histRflY_";
2377 fillthismassy+=ptbin;
2379 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2383 fillthis=
"histBkg_";
2385 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2388 fillthismasspt=
"histBkgPt";
2390 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2394 fillthismassy=
"histBkgY_";
2395 fillthismassy+=ptbin;
2397 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2401 fillthis=
"histMass_";
2405 ((TH1F*)listout->FindObject(fillthis))->Fill(invmassD0bar,weigD0bar);
2409 fillthismasspt=
"histMassPt";
2411 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2415 fillthismassy=
"histMassY_";
2416 fillthismassy+=ptbin;
2418 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2431 Int_t nTrksToSkip=2;
2434 AliDebug(2,
"no daughter found!");
2437 skipped[0]=dgTrack->GetID();
2440 AliDebug(2,
"no daughter found!");
2443 skipped[1]=dgTrack->GetID();
2445 AliESDVertex *vertexESD=0x0;
2446 AliAODVertex *vertexAOD=0x0;
2447 AliVertexerTracks *vertexer =
new AliVertexerTracks(aodev->GetMagneticField());
2450 vertexer->SetSkipTracks(nTrksToSkip,skipped);
2451 vertexer->SetMinClusters(4);
2452 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
2453 if(!vertexESD)
return vertexAOD;
2454 if(vertexESD->GetNContributors()<=0) {
2455 AliDebug(2,
"vertexing failed");
2456 delete vertexESD; vertexESD=NULL;
2460 delete vertexer; vertexer=NULL;
2465 vertexESD->GetXYZ(pos);
2466 vertexESD->GetCovMatrix(cov);
2467 chi2perNDF = vertexESD->GetChi2toNDF();
2468 delete vertexESD; vertexESD=NULL;
2470 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF);
2481 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass: Terminate() \n");
2486 printf(
"ERROR: fOutputMass not available\n");
2491 printf(
"ERROR: fOutputMass not available\n");
2498 printf(
"ERROR: fDistr not available\n");
2503 fNentries =
dynamic_cast<TH1F*
>(GetOutputData(3));
2506 printf(
"ERROR: fNEntries not available\n");
2511 printf(
"ERROR: fCuts not available\n");
2516 printf(
"ERROR: fCounter not available\n");
2522 printf(
"ERROR: fDetSignal not available\n");
2529 printf(
"ERROR: fOutputMassY not available\n");
2538 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));
2561 nameDistr=
"hd0d0B_";
2564 nameDistr=
"hcosthetapointB_";
2571 nameDistr=
"hcosthetastarB_";
2574 nameDistr=
"hcosthpointd0d0B_";
2591 TCanvas *cMass=
new TCanvas(cvname,cvname);
2595 TCanvas* cStat=
new TCanvas(cstname,Form(
"Stat%s",
fArray ?
"LS" :
"D0"));
2611 Int_t nmassbins=200;
2612 Double_t fLowmasslimit=1.5648, fUpmasslimit=2.1648;
2613 Int_t fNImpParBins=400;
2614 Double_t fLowerImpPar=-2000., fHigherImpPar=2000.;
2616 Double_t xmin[3]={fLowmasslimit,0.,fLowerImpPar};
2617 Double_t xmax[3]={fUpmasslimit,20.,fHigherImpPar};
2621 "Mass vs. pt vs.imppar - All",
2624 "Mass vs. pt vs.imppar - promptD",
2627 "Mass vs. pt vs.imppar - DfromB",
2630 "Mass vs. pt vs.true imppar -DfromB",
2633 "Mass vs. pt vs.imppar - backgr.",
2636 for(
Int_t i=0; i<5;i++){
2645 printf(
" AliAnalysisTaskSED0MassV1::GetTrueImpactParameter() \n");
2648 mcHeader->GetVertex(vtxTrue);
2650 partD0->XvYvZv(origD);
2652 Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2];
2653 for(
Int_t iDau=0; iDau<2; iDau++){
2660 Int_t labelFirstDau = partD0->GetDaughter(0);
2662 for(
Int_t iDau=0; iDau<2; iDau++){
2663 Int_t ind = labelFirstDau+iDau;
2664 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
2666 Int_t pdgCode = TMath::Abs( part->GetPdgCode() );
2668 AliError(
"Daughter particle not found in MC array");
2671 if(pdgCode==211 || pdgCode==321){
2672 pXdauTrue[iDau]=part->Px();
2673 pYdauTrue[iDau]=part->Py();
2674 pZdauTrue[iDau]=part->Pz();
2679 AliAODRecoDecayHF aodDzeroMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
2689 printf(
" AliAnalysisTaskSED0Mass V1::CheckOrigin() \n");
2691 Int_t pdgGranma = 0;
2693 mother = mcPartCandidate->GetMother();
2695 Int_t abspdgGranma =0;
2697 Bool_t isQuarkFound=kFALSE;
2700 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
2702 pdgGranma = mcGranma->GetPdgCode();
2703 abspdgGranma = TMath::Abs(pdgGranma);
2704 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
2707 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
2708 mother = mcGranma->GetMother();
2710 AliError(
"Failed casting the mother particle!");
2715 if(isFromB)
return 5;
2722 const Int_t nVarPrompt = 2;
2723 const Int_t nVarFD = 3;
2725 Int_t nbinsPrompt[nVarPrompt]={200,100};
2726 Int_t nbinsFD[nVarFD]={200,100,200};
2728 Double_t xminPrompt[nVarPrompt] = {0.,-1.};
2729 Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
2731 Double_t xminFD[nVarFD] = {0.,-1.,0.};
2732 Double_t xmaxFD[nVarFD] = {40.,1.,40.};
2735 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
2740 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
2741 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
2743 fMCAccBFeed->GetAxis(2)->SetTitle(
"p_{T}^{B} (GeV/c)");
2751 const Int_t nProng = 2;
2752 Double_t zMCVertex = mcHeader->GetVtxZ();
2754 for(
Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
2755 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
2756 if (TMath::Abs(mcPart->GetPdgCode()) == 421){
2761 Bool_t isGoodDecay=kFALSE;
2762 Int_t labDau[4]={-1,-1,-1,-1};
2764 Bool_t isFidAcc = kFALSE;
2767 if(deca > 0) isGoodDecay=kTRUE;
2774 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
2776 if(isGoodDecay && TMath::Abs(zMCVertex) <
fCuts->
GetMaxVtxZ() && isFidAcc && isInAcc) {
2780 Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
2787 Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
2799 for (
Int_t iProng = 0; iProng<nProng; iProng++){
2800 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
2801 if(!mcPartDaughter)
return kFALSE;
2802 Double_t eta = mcPartDaughter->Eta();
2803 Double_t pt = mcPartDaughter->Pt();
2804 if (TMath::Abs(eta) > 0.9 || pt < 0.1)
return kFALSE;
2821 normIP[0]=diffIP[0]/errdiffIP[0];
2822 normIP[1]=diffIP[1]/errdiffIP[1];
2824 AliAODVertex* secvtx=part->GetSecondaryVtx();
2826 Double_t err2decaylength=secvtx->Error2DistanceXYToVertex(primvtx);
2827 Double_t lxy=part->AliAODRecoDecay::DecayLengthXY(primvtx);
2832 Int_t pdgDgD0toKpi[2]={321,211};
2834 lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2837 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(lab);
2839 if(orig==4)signalType=1;
2840 else if(orig==5)signalType=2;
2848 Double_t arrayMC[8]={part->Pt(), ptB,normIP[0], normIP[1], lxy, lxy/TMath::Sqrt(err2decaylength),(
Double_t)isCuts, (
Double_t)isPid};
2851 for(
Int_t i=0; i<8; i++){
2852 pointD0MC[i]=arrayMC[i];
2864 if(!IsSelectedPIDoff)
return;
2868 for(
Int_t i=0;i<9;i++){
2869 pointD0[i]=array[i];
2875 for(
Int_t i=0;i<9;i++){
2876 pointD0bar[i]=arrayD0bar[i];
THnSparseF * fMCAccBFeed
!histo for StepMCAcc for D0 FD (pt,y,ptB)
Double_t NormalizedDecayLengthXY() const
TList * fOutputMassPt
! list send on output slot 6
Bool_t fDrawDetSignal
flag to decide whether to fill "PID = x" bins in fNentrie
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
flag to fill Pt and Impact Parameter Histograms
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
Double_t InvMassD0() const
void FillMCAcceptanceHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader)
Int_t fSys
flag to enable filling variable histos
ULong_t GetSelectionMap() const
Double_t Prodd0d0() const
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)
Double_t GetMaxVtxZ() const
AliRDHFCutsD0toKpi * fCuts
virtual ~AliAnalysisTaskSED0Mass()
Int_t GetBayesianStrategy() const
Bool_t HasBadDaughters() const
THnSparseF * fHistMassPtImpParTC[5]
! histograms for impact paramter studies
TH1F * fNentries
! histogram with number of events on output slot 3
virtual void UserCreateOutputObjects()
Implementation of interface methods.
Bool_t fFillPtHist
flag to reject events with SDD clusters
Bool_t fFillImpParHist
flag to fill Y Histograms
Int_t GetIsFilled() const
Double_t CosThetaStarD0bar() const
angle of K
Bool_t fUseQuarkTagInKine
flag to decide whether to draw the TPC dE/dx and TOF signal before/after PID
Bool_t fIsRejectSDDClusters
fSys=0 -> p-p; fSys=1 ->PbPb (in this case fFillVarHists=kFALSE by default: set it to kTRUE after if ...
static Int_t CheckD0Decay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
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
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
virtual Int_t IsSelectedPID(AliAODRecoDecayHF *rd)
TList * fOutputMassY
! list send on output slot 9
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
TH2 * Scale(TH2 *h, TH1 *g)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Bool_t GetIsUsePID() const
AliAODVertex * GetPrimaryVtx() const
virtual void UserExec(Option_t *option)
TObjArray fDaughterTracks
flag to fill mass histogram with D0/D0bar only (0 = fill with both, 1 = fill with D0 only...
Bool_t fEnablePileupRejVZEROTPCout
Double_t CosPointingAngle() const
Double_t DecayLengthXYError() const
Double_t CosThetaStarD0() const
Int_t fFillOnlyD0D0bar
normalization
THnSparseF * fMCAccPrompt
!histo for StepMCAcc for D0 prompt (pt,y,ptB)
Int_t PtBin(Double_t pt) const
Bool_t fFillVarHists
selection outcome
AliNormalizationCounter * fCounter
! AliNormalizationCounter on output slot 5
Double_t * GetWeightsNegative() const