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),
101 fhStudyImpParSingleTrackSign(0),
102 fhStudyImpParSingleTrackCand(0),
103 fhStudyImpParSingleTrackFd(0),
129 fLsNormalization(1.),
132 fIsSelectedCandidate(0),
133 fFillVarHists(kTRUE),
135 fIsRejectSDDClusters(0),
138 fFillImpParHist(kFALSE),
139 fUseSelectionBit(kTRUE),
141 fWriteVariableTree(kFALSE),
143 fCandidateVariables(),
145 fDrawDetSignal(kFALSE),
146 fUseQuarkTagInKine(kTRUE),
147 fhStudyImpParSingleTrackSign(0),
148 fhStudyImpParSingleTrackCand(0),
149 fhStudyImpParSingleTrackFd(0),
160 DefineOutput(1,TList::Class());
162 DefineOutput(2,TList::Class());
164 DefineOutput(3,TH1F::Class());
166 DefineOutput(4,AliRDHFCutsD0toKpi::Class());
168 DefineOutput(5,AliNormalizationCounter::Class());
170 DefineOutput(6,TList::Class());
172 DefineOutput(7,TTree::Class());
174 DefineOutput(8, TList::Class());
176 DefineOutput(9, TList::Class());
202 for(
Int_t i=0; i<5; i++){
234 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::Init() \n");
238 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
239 copyfCuts->SetName(nameoutput);
241 PostData(4,copyfCuts);
253 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::UserCreateOutputObjects() \n");
270 fDistr->SetName(
"distributionslist");
276 TString nameMass=
" ",nameSgn27=
" ",nameSgn=
" ", nameBkg=
" ", nameRfl=
" ",nameMassNocutsS =
" ",nameMassNocutsB =
" ", namedistr=
" ";
277 TString nameMassPt=
"", nameSgnPt=
"", nameBkgPt=
"", nameRflPt=
"";
278 TString nameMassY=
"", nameSgnY=
"", nameBkgY=
"", nameRflY=
"";
284 nameMass=
"histMass_";
286 nameSgn27=
"histSgn27_";
294 nameMassNocutsS=
"hMassS_";
296 nameMassNocutsB=
"hMassB_";
303 namedistr=
"hNclsD0vsptS_";
305 TH2F *hNclsD0vsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
306 namedistr=
"hNclsD0barvsptS_";
308 TH2F *hNclsD0barvsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
310 namedistr=
"hNITSpointsD0vsptS_";
312 TH2F *hNITSpointsD0vsptS =
new TH2F(namedistr.Data(),
"N ITS points distrubution [S];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
314 namedistr=
"hNSPDpointsD0S_";
316 TH1I *hNSPDpointsD0S =
new TH1I(namedistr.Data(),
"N SPD points distrubution [S]; ;N tracks",4,0,4);
317 hNSPDpointsD0S->GetXaxis()->SetBinLabel(1,
"no SPD");
318 hNSPDpointsD0S->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
319 hNSPDpointsD0S->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
320 hNSPDpointsD0S->GetXaxis()->SetBinLabel(4,
"kBoth");
324 TH1F *hptD0S =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
325 namedistr=
"hptD0barS_";
327 TH1F *hptD0barS =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
329 namedistr=
"hphiD0S_";
331 TH1F *hphiD0S =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
332 namedistr=
"hphiD0barS_";
334 TH1F *hphiD0barS =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
337 namedistr=
"hetaphiD0candidateS_";
339 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());
340 namedistr=
"hetaphiD0barcandidateS_";
342 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());
344 namedistr=
"hetaphiD0candidatesignalregionS_";
346 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());
347 namedistr=
"hetaphiD0barcandidatesignalregionS_";
349 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());
354 TH1F *hdcaS =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
358 TH1F *hd0piS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions);d0(#pi) [cm]",200,-0.1,0.1);
362 TH1F *hd0KS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons);d0(K) [cm]",200,-0.1,0.1);
365 TH1F *hd0d0S =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
370 TH1F *hdeclengthS =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm]",200,0,0.015);
372 namedistr=
"hnormdeclS_";
374 TH1F *hnormdeclengthS =
new TH1F(namedistr.Data(),
"Normalized Decay Length^{2} distribution;(Decay Length/Err)^{2} ",200,0,12.);
376 namedistr=
"hdeclxyS_";
378 TH1F* hdeclxyS=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
379 namedistr=
"hnormdeclxyS_";
381 TH1F* hnormdeclxyS=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
383 namedistr=
"hdeclxyd0d0S_";
385 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);
387 namedistr=
"hnormdeclxyd0d0S_";
389 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);
392 namedistr=
"hcosthetapointS_";
394 TH1F *hcosthetapointS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
396 namedistr=
"hcosthetapointxyS_";
398 TH1F *hcosthetapointxyS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XYdistribution;cos#theta_{Point}",300,0.,1.);
400 TH1F* tmpMS =
new TH1F(nameMassNocutsS.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
403 fDistr->Add(hNclsD0vsptS);
404 fDistr->Add(hNclsD0barvsptS);
405 fDistr->Add(hNITSpointsD0vsptS);
406 fDistr->Add(hNSPDpointsD0S);
411 fDistr->Add(hetaphiD0candidateS);
412 fDistr->Add(hetaphiD0candidatesignalregionS);
413 fDistr->Add(hetaphiD0barcandidateS);
414 fDistr->Add(hetaphiD0barcandidatesignalregionS);
423 fDistr->Add(hcosthetapointS);
425 fDistr->Add(hcosthetapointxyS);
429 fDistr->Add(hnormdeclengthS);
433 fDistr->Add(hnormdeclxyS);
435 fDistr->Add(hdeclxyd0d0S);
436 fDistr->Add(hnormdeclxyd0d0S);
444 namedistr=
"hNclsD0vsptB_";
446 TH2F *hNclsD0vsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
447 namedistr=
"hNclsD0barvsptB_";
449 TH2F *hNclsD0barvsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
451 namedistr=
"hNITSpointsD0vsptB_";
453 TH2F *hNITSpointsD0vsptB =
new TH2F(namedistr.Data(),
"N ITS points distrubution [B];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
455 namedistr=
"hNSPDpointsD0B_";
457 TH1I *hNSPDpointsD0B =
new TH1I(namedistr.Data(),
"N SPD points distrubution [B]; ;N tracks",4,0,4);
458 hNSPDpointsD0B->GetXaxis()->SetBinLabel(1,
"no SPD");
459 hNSPDpointsD0B->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
460 hNSPDpointsD0B->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
461 hNSPDpointsD0B->GetXaxis()->SetBinLabel(4,
"kBoth");
465 TH1F *hptD0B =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
466 namedistr=
"hptD0barB_";
468 TH1F *hptD0barB =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
470 namedistr=
"hphiD0B_";
472 TH1F *hphiD0B =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
473 namedistr=
"hphiD0barB_";
475 TH1F *hphiD0barB =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
477 namedistr=
"hetaphiD0candidateB_";
479 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());
480 namedistr=
"hetaphiD0barcandidateB_";
482 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());
484 namedistr=
"hetaphiD0candidatesignalregionB_";
486 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());
487 namedistr=
"hetaphiD0barcandidatesignalregionB_";
489 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());
494 TH1F *hdcaB =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
499 TH1F *hd0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
503 TH1F *hd0d0B =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
508 TH1F *hdeclengthB =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm^{2}]",200,0,0.015);
510 namedistr=
"hnormdeclB_";
512 TH1F *hnormdeclengthB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution;(Decay Length/Err)^{2} ",200,0,12.);
514 namedistr=
"hdeclxyB_";
516 TH1F* hdeclxyB=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
517 namedistr=
"hnormdeclxyB_";
519 TH1F* hnormdeclxyB=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
521 namedistr=
"hdeclxyd0d0B_";
523 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);
525 namedistr=
"hnormdeclxyd0d0B_";
527 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);
530 namedistr=
"hcosthetapointB_";
532 TH1F *hcosthetapointB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
534 namedistr=
"hcosthetapointxyB_";
536 TH1F *hcosthetapointxyB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XY distribution;cos#theta_{Point} XY",300,0.,1.);
538 TH1F* tmpMB =
new TH1F(nameMassNocutsB.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
542 fDistr->Add(hNclsD0vsptB);
543 fDistr->Add(hNclsD0barvsptB);
544 fDistr->Add(hNITSpointsD0vsptB);
545 fDistr->Add(hNSPDpointsD0B);
550 fDistr->Add(hetaphiD0candidateB);
551 fDistr->Add(hetaphiD0candidatesignalregionB);
552 fDistr->Add(hetaphiD0barcandidateB);
553 fDistr->Add(hetaphiD0barcandidatesignalregionB);
561 fDistr->Add(hcosthetapointB);
563 fDistr->Add(hcosthetapointxyB);
567 fDistr->Add(hnormdeclengthB);
571 fDistr->Add(hnormdeclxyB);
573 fDistr->Add(hdeclxyd0d0B);
574 fDistr->Add(hnormdeclxyd0d0B);
582 namedistr=
"hd0vpiS_";
584 TH1F *hd0vpiS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions)(vtx w/o these tracks);d0(#pi) [cm]",200,-0.1,0.1);
588 TH1F *hd0vKS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons) (vtx w/o these tracks);d0(K) [cm]",200,-0.1,0.1);
590 namedistr=
"hd0d0vS_";
592 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);
594 namedistr=
"hdeclvS_";
596 TH1F *hdeclengthvS =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
598 namedistr=
"hnormdeclvS_";
600 TH1F *hnormdeclengthvS =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
605 fDistr->Add(hdeclengthvS);
606 fDistr->Add(hnormdeclengthvS);
610 namedistr=
"hd0vmoresB_";
612 TH1F *hd0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
614 namedistr=
"hd0d0vmoresB_";
616 TH1F *hd0d0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
621 TH1F *hd0vB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
623 namedistr=
"hd0vp0B_";
625 TH1F *hd0vp0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong + ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
627 namedistr=
"hd0vp1B_";
629 TH1F *hd0vp1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong - ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
631 namedistr=
"hd0d0vB_";
633 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);
635 namedistr=
"hdeclvB_";
637 TH1F *hdeclengthvB =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
639 namedistr=
"hnormdeclvB_";
641 TH1F *hnormdeclengthvB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
649 fDistr->Add(hd0d0vmoresB);
651 fDistr->Add(hdeclengthvB);
653 fDistr->Add(hnormdeclengthvB);
663 TH1F* tmpSt =
new TH1F(nameSgn.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
665 TH1F *tmpSl=(TH1F*)tmpSt->Clone();
670 TH1F* tmpRt =
new TH1F(nameRfl.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
672 TH1F* tmpBt =
new TH1F(nameBkg.Data(),
"Background invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
686 TH1F* tmpMt =
new TH1F(nameMass.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
702 TH1F *hptpiS =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
706 TH1F *hptKS =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
709 namedistr=
"hcosthetastarS_";
711 TH1F *hcosthetastarS =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
715 namedistr=
"hptpiSnoMcut_";
717 TH1F *hptpiSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
719 namedistr=
"hptKSnoMcut_";
721 TH1F *hptKSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
725 fDistr->Add(hcosthetastarS);
727 fDistr->Add(hptpiSnoMcut);
731 namedistr=
"hcosthpointd0S_";
733 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);
734 namedistr=
"hcosthpointd0d0S_";
736 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);
738 fDistr->Add(hcosthpointd0S);
739 fDistr->Add(hcosthpointd0d0S);
742 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);
743 TH1F *tmpS27l=(TH1F*)tmpS27t->Clone();
755 TH1F *hptB =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
758 namedistr=
"hcosthetastarB_";
760 TH1F *hcosthetastarB =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
763 namedistr=
"hptB1prongnoMcut_";
765 TH1F *hptB1pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
767 namedistr=
"hptB2prongsnoMcut_";
769 TH1F *hptB2pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
772 fDistr->Add(hcosthetastarB);
774 fDistr->Add(hptB1pnoMcut);
775 fDistr->Add(hptB2pnoMcut);
780 TH1F *hd0p0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.1,0.1);
784 TH1F *hd0p1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong -);d0 [cm]",200,-0.1,0.1);
787 namedistr=
"hd0moresB_";
789 TH1F *hd0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
791 namedistr=
"hd0d0moresB_";
793 TH1F *hd0d0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
796 namedistr=
"hcosthetapointmoresB_";
798 TH1F *hcosthetapointmoresB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
801 namedistr=
"hcosthpointd0B_";
803 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);
805 namedistr=
"hcosthpointd0d0B_";
807 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);
814 fDistr->Add(hcosthetapointmoresB);
817 fDistr->Add(hcosthpointd0B);
820 fDistr->Add(hcosthpointd0d0B);
827 Int_t nbinsImpParStudy[9]= {50, 40, 40, 20, 15, 600, 3,4,2};
828 Double_t limitLowImpParStudy[9]={0, -5, -5, 0, 0,1.6248,1,0,0};
829 Double_t limitUpImpParStudy[9]= {50., 5, 5, 0.2,15,2.2248,4,4,2};
830 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"};
831 fhStudyImpParSingleTrackCand=
new THnSparseF(
"fhStudyImpParSingleTrackCand",
"fhStudyImpParSingleTrackCand",9,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
836 Int_t nbinsImpParStudy[8]= {50,50,40, 40, 20, 15, 3, 4};
837 Double_t limitLowImpParStudy[8]={0, 0, -5,-5., 0., 0., 1.,0.};
838 Double_t limitUpImpParStudy[8]= {50.,50., 5, 5, 0.2, 15, 3.,4.};
840 fhStudyImpParSingleTrackSign=
new THnSparseF(
"fhStudyImpParSingleTrackSign",
"fhStudyImpParSingleTrackSign",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
841 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"};
846 fhStudyImpParSingleTrackFd=
new THnSparseF(
"fhStudyImpParSingleTrackFd",
"fhStudyImpParSingleTrackFd",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
857 namedistr=
"hpospair";
859 namedistr=
"hnegpair";
869 nameMassPt=
"histMassPt";
870 nameSgnPt=
"histSgnPt";
871 nameBkgPt=
"histBkgPt";
872 nameRflPt=
"histRflPt";
876 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);
877 TH2F *tmpSlPt=(
TH2F*)tmpStPt->Clone();
882 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);
883 TH2F* tmpBtPt =
new TH2F(nameBkgPt.Data(),
"Background invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
897 TH2F* tmpMtPt =
new TH2F(nameMassPt.Data(),
"D^{0} invariant mass; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
909 nameMassY=
"histMassY_";
911 nameSgnY=
"histSgnY_";
913 nameBkgY=
"histBkgY_";
915 nameRflY=
"histRflY_";
919 TH2F* tmpStY =
new TH2F(nameSgnY.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
922 TH2F* tmpRtY =
new TH2F(nameRflY.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
923 TH2F* tmpBtY =
new TH2F(nameBkgY.Data(),
"Background invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
931 TH2F* tmpMtY =
new TH2F(nameMassY.Data(),
"D^{0} invariant mass; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
938 const char* nameoutput=GetOutputSlot(3)->GetContainer()->GetName();
940 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);
942 fNentries->GetXaxis()->SetBinLabel(1,
"nEventsAnal");
943 fNentries->GetXaxis()->SetBinLabel(2,
"nCandSel(Cuts)");
945 else fNentries->GetXaxis()->SetBinLabel(3,
"Dstar<-D0");
946 fNentries->GetXaxis()->SetBinLabel(4,
"nEventsGoodVtxS");
947 fNentries->GetXaxis()->SetBinLabel(5,
"ptbin = -1");
948 fNentries->GetXaxis()->SetBinLabel(6,
"no daughter");
949 if(
fSys==0)
fNentries->GetXaxis()->SetBinLabel(7,
"nCandSel(Tr)");
951 fNentries->GetXaxis()->SetBinLabel(8,
"PID=0");
952 fNentries->GetXaxis()->SetBinLabel(9,
"PID=1");
953 fNentries->GetXaxis()->SetBinLabel(10,
"PID=2");
954 fNentries->GetXaxis()->SetBinLabel(11,
"PID=3");
957 fNentries->GetXaxis()->SetBinLabel(12,
"K");
958 fNentries->GetXaxis()->SetBinLabel(13,
"Lambda");
960 fNentries->GetXaxis()->SetBinLabel(14,
"Pile-up Rej");
961 fNentries->GetXaxis()->SetBinLabel(15,
"N. of 0SMH");
962 if(
fSys==1)
fNentries->GetXaxis()->SetBinLabel(16,
"Nev in centr");
964 fNentries->GetXaxis()->SetBinLabel(18,
"Phys.Sel.Rej");
965 fNentries->GetXaxis()->SetBinLabel(19,
"D0 failed to be filled");
966 fNentries->GetXaxis()->SetBinLabel(20,
"fisFilled is 0");
967 fNentries->GetXaxis()->SetBinLabel(21,
"fisFilled is 1");
968 fNentries->GetXaxis()->SetBinLabel(22,
"AOD/dAOD mismatch");
969 fNentries->GetXaxis()->SetBinLabel(23,
"AOD/dAOD #events ok");
970 fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
978 nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
983 fCandidateVariableNames[0] =
"massD0";
984 fCandidateVariableNames[1] =
"massD0bar";
985 fCandidateVariableNames[2] =
"pt";
986 fCandidateVariableNames[3] =
"dca";
987 fCandidateVariableNames[4] =
"costhsD0";
988 fCandidateVariableNames[5] =
"costhsD0bar";
989 fCandidateVariableNames[6] =
"ptk";
990 fCandidateVariableNames[7] =
"ptpi";
991 fCandidateVariableNames[8] =
"d0k";
992 fCandidateVariableNames[9] =
"d0pi";
993 fCandidateVariableNames[10] =
"d0xd0";
994 fCandidateVariableNames[11] =
"costhp";
995 fCandidateVariableNames[12] =
"costhpxy";
996 fCandidateVariableNames[13] =
"lxy";
997 fCandidateVariableNames[14] =
"specialcuts";
1007 TH2F *TOFSigBefPID =
new TH2F(
"TOFSigBefPID",
"TOF signal of daughters before PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1008 TH2F *TOFSigAftPID =
new TH2F(
"TOFSigAftPID",
"TOF signal after PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1010 TH2F *TPCSigBefPID =
new TH2F(
"TPCSigBefPID",
"TPC dE/dx before PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1011 TH2F *TPCSigAftPID =
new TH2F(
"TPCSigAftPID",
"TPC dE/dx after PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1056 if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 &&
fAODProtection==1)) {
1072 bname=
"LikeSign2Prong";
1074 TClonesArray *inputArray=0;
1075 if(!aod && AODEvent() && IsStandardAOD()) {
1081 AliAODHandler* aodHandler = (AliAODHandler*)
1082 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1084 if(aodHandler->GetExtensions()) {
1085 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
1087 inputArray=(TClonesArray*)aodFromExt->GetList()->FindObject(bname.Data());
1090 inputArray=(TClonesArray*)aod->GetList()->FindObject(bname.Data());
1093 if(!inputArray || !aod) {
1094 printf(
"AliAnalysisTaskSED0Mass::UserExec: input branch not found!\n");
1099 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001)
return;
1101 TClonesArray *mcArray = 0;
1102 AliAODMCHeader *mcHeader = 0;
1106 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1108 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC particles branch not found!\n");
1113 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1115 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC header branch not found!\n");
1128 TString trigclass=aod->GetFiredTriggerClasses();
1129 if(trigclass.Contains(
"C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains(
"C0SMH-B-NOPF-ALL"))
fNentries->Fill(14);
1143 Bool_t skipEvent = kFALSE;
1145 if (aod) ntracks = aod->GetNumberOfTracks();
1146 for(
Int_t itrack=0; itrack<ntracks; itrack++) {
1148 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1149 if(!track) AliFatal(
"Not a standard AOD");
1150 if(TESTBIT(track->GetITSClusterMap(),2) || TESTBIT(track->GetITSClusterMap(),3) ){
1156 if (skipEvent)
return;
1160 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1165 TString primTitle = vtx1->GetTitle();
1166 if(primTitle.Contains(
"VertexerTracks") && vtx1->GetNContributors()>0) {
1172 Int_t nInD0toKpi = inputArray->GetEntriesFast();
1173 if(fDebug>2) printf(
"Number of D0->Kpi: %d\n",nInD0toKpi);
1177 Int_t nSelectedloose=0,nSelectedtight=0;
1184 for (
Int_t iD0toKpi = 0; iD0toKpi < nInD0toKpi; iD0toKpi++) {
1205 if(ptbin==-1) {
fNentries->Fill(4);
continue;}
1213 AliDebug(1,
"at least one daughter not found!");
1228 Int_t isSelectedPIDfill = 3;
1231 if (isSelectedPIDfill == 0)
fNentries->Fill(7);
1232 if (isSelectedPIDfill == 1)
fNentries->Fill(8);
1233 if (isSelectedPIDfill == 2)
fNentries->Fill(9);
1234 if (isSelectedPIDfill == 3)
fNentries->Fill(10);
1266 AliESDtrack *esdtrack1 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1267 AliESDtrack *esdtrack2 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1271 Int_t isSelectedPIDfill = 3;
1276 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1277 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1278 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1279 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1281 if (isSelectedPIDfill != 0) {
1282 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1283 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1284 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1285 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1302 Int_t pdgDgD0toKpi[2]={321,211};
1304 if(
fReadMC) lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
1306 Int_t isSelectedPID=3;
1309 if (isSelectedPID==0)
fNentries->Fill(7);
1310 if (isSelectedPID==1)
fNentries->Fill(8);
1311 if (isSelectedPID==2)
fNentries->Fill(9);
1312 if (isSelectedPID==3)
fNentries->Fill(10);
1323 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1334 TString fillthispi=
"",fillthisK=
"",fillthis=
"", fillthispt=
"", fillthisetaphi=
"";
1339 Double_t dz1[2],dz2[2],covar1[3],covar2[3];
1340 dz1[0]=-99; dz2[0]=-99;
1350 AliAODVertex *vtxProp=0x0;
1356 AliESDtrack *esdtrack1=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1357 AliESDtrack *esdtrack2=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1358 esdtrack1->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz1,covar1);
1359 esdtrack2->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz2,covar2);
1360 delete vtxProp; vtxProp=NULL;
1377 Double_t normalizedDecayLength2 = -1, normalizedDecayLengthxy=-1;
1378 Double_t decayLength2 = -1, decayLengthxy=-1;
1393 if(!prong0 || !prong1) {
1398 labprong[0]=prong0->GetLabel();
1399 labprong[1]=prong1->GetLabel();
1401 AliAODMCParticle *mcprong=0;
1402 Int_t pdgProng[2]={0,0};
1404 for (
Int_t iprong=0;iprong<2;iprong++){
1405 if(
fReadMC && labprong[iprong]>=0) {
1406 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1407 pdgProng[iprong]=mcprong->GetPdgCode();
1414 fillthispi=
"hptpiSnoMcut_";
1417 fillthisK=
"hptKSnoMcut_";
1420 if ((TMath::Abs(pdgProng[0]) == 211 && TMath::Abs(pdgProng[1]) == 321)
1421 || (isSelectedPID==1 || isSelectedPID==3)){
1422 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong0->Pt());
1423 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong1->Pt());
1426 if ((TMath::Abs(pdgProng[0]) == 321 && TMath::Abs(pdgProng[1]) == 211)
1427 || (isSelectedPID==2 || isSelectedPID==3)){
1428 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong0->Pt());
1429 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong1->Pt());
1441 fillthispt=
"histSgnPt";
1443 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)
1444 || (!
fReadMC && (isSelectedPID==1 || isSelectedPID==3))){
1445 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1448 fillthisetaphi=
"hetaphiD0candidateS_";
1449 fillthisetaphi+=ptbin;
1450 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1452 if(TMath::Abs(minvD0-mPDG)<0.05){
1453 fillthisetaphi=
"hetaphiD0candidatesignalregionS_";
1454 fillthisetaphi+=ptbin;
1455 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1461 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1464 fillthisetaphi=
"hetaphiD0barcandidateS_";
1465 fillthisetaphi+=ptbin;
1466 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1468 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1469 fillthisetaphi=
"hetaphiD0barcandidatesignalregionS_";
1470 fillthisetaphi+=ptbin;
1471 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1478 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1488 ptProng[0]=prong0->Pt(); ptProng[1]=prong1->Pt();
1489 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1491 if(
fArray==1) cout<<
"LS signal: ERROR"<<endl;
1492 for (
Int_t iprong=0; iprong<2; iprong++){
1494 if (
fReadMC) labprong[iprong]=prong->GetLabel();
1498 if(
fReadMC && labprong[iprong]>=0) {
1499 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1500 pdgprong=mcprong->GetPdgCode();
1503 Bool_t isPionHere[2]={(isSelectedPID==1 || isSelectedPID==3) ? kTRUE : kFALSE,(isSelectedPID==2 || isSelectedPID==3) ? kTRUE : kFALSE};
1505 if(TMath::Abs(pdgprong)==211 || isPionHere[iprong]) {
1509 fillthispi=
"hptpiS_";
1511 ((TH1F*)listout->FindObject(fillthispi))->Fill(ptProng[iprong]);
1514 fillthispi=
"hd0piS_";
1516 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0Prong[iprong]);
1519 fillthispi=
"hd0vpiS_";
1521 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0[iprong]);
1526 if(TMath::Abs(pdgprong)==321 || !isPionHere[iprong]) {
1531 ((TH1F*)listout->FindObject(fillthisK))->Fill(ptProng[iprong]);
1537 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0Prong[iprong]);
1539 fillthisK=
"hd0vKS_";
1541 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0[iprong]);
1546 fillthis=
"hcosthpointd0S_";
1548 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[iprong]);
1554 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1556 fillthis=
"hcosthetapointS_";
1558 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1560 fillthis=
"hcosthetapointxyS_";
1567 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0());
1571 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1573 fillthis=
"hnormdeclS_";
1575 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1577 fillthis=
"hdeclxyS_";
1579 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1581 fillthis=
"hnormdeclxyS_";
1583 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1585 fillthis=
"hdeclxyd0d0S_";
1587 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1589 fillthis=
"hnormdeclxyd0d0S_";
1591 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1594 fillthis=
"hdeclvS_";
1596 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1598 fillthis=
"hnormdeclvS_";
1600 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1602 fillthis=
"hd0d0vS_";
1604 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1608 fillthis=
"hcosthetastarS_";
1610 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)) ((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1612 if (
fReadMC || isSelectedPID>1)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar);
1613 if(isSelectedPID==1 || isSelectedPID==3)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1616 fillthis=
"hcosthpointd0d0S_";
1618 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1621 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)){
1622 for(
Int_t it=0; it<2; it++){
1625 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1626 fillthis=
"hphiD0S_";
1628 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1629 Int_t nPointsITS = 0;
1630 for (
Int_t il=0; il<6; il++){
1631 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1633 fillthis=
"hNITSpointsD0vsptS_";
1635 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(),nPointsITS);
1636 fillthis=
"hNSPDpointsD0S_";
1638 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1639 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1641 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1642 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1644 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1645 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1647 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1648 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1650 fillthis=
"hNclsD0vsptS_";
1654 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1658 if (
fReadMC || isSelectedPID>1){
1659 for(
Int_t it=0; it<2; it++){
1660 fillthis=
"hptD0barS_";
1662 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1663 fillthis=
"hphiD0barS_";
1665 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1666 fillthis=
"hNclsD0barvsptS_";
1670 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1673 if(isSelectedPID==1 || isSelectedPID==3){
1674 for(
Int_t it=0; it<2; it++){
1677 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1678 fillthis=
"hphiD0S_";
1680 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1681 Int_t nPointsITS = 0;
1682 for (
Int_t il=0; il<6; il++){
1683 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1685 fillthis=
"hNITSpointsD0vsptS_";
1687 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1688 fillthis=
"hNSPDpointsD0S_";
1690 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1691 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1693 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1694 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1696 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1697 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1699 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1700 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1702 fillthis=
"hNclsD0vsptS_";
1706 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1724 fillthispt=
"histBkgPt";
1727 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1730 fillthisetaphi=
"hetaphiD0candidateB_";
1731 fillthisetaphi+=ptbin;
1732 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1734 if(TMath::Abs(minvD0-mPDG)<0.05){
1735 fillthisetaphi=
"hetaphiD0candidatesignalregionB_";
1736 fillthisetaphi+=ptbin;
1737 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1741 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1744 fillthisetaphi=
"hetaphiD0barcandidateB_";
1745 fillthisetaphi+=ptbin;
1746 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1748 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1749 fillthisetaphi=
"hetaphiD0barcandidatesignalregionB_";
1750 fillthisetaphi+=ptbin;
1751 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1756 fillthis=
"hptB1prongnoMcut_";
1759 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1761 fillthis=
"hptB2prongsnoMcut_";
1763 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1764 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1769 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1781 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1786 if(fDebug>2) cout<<
"No daughter found";
1791 if(prongg->Charge()==1) {
1793 ((TH1F*)
fOutputMass->FindObject(
"hpospair"))->Fill(ptbin);
1796 ((TH1F*)
fOutputMass->FindObject(
"hnegpair"))->Fill(ptbin);
1804 for(
Int_t it=0; it<2; it++){
1807 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1808 fillthis=
"hphiD0B_";
1810 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1812 Int_t nPointsITS = 0;
1813 for (
Int_t il=0; il<6; il++){
1814 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1816 fillthis=
"hNITSpointsD0vsptB_";
1818 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1819 fillthis=
"hNSPDpointsD0B_";
1821 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1822 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1824 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1825 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1827 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1828 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1830 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1831 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1833 fillthis=
"hNclsD0vsptB_";
1837 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1844 for(
Int_t it=0; it<2; it++){
1845 fillthis=
"hptD0barB_";
1847 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1848 fillthis=
"hphiD0barB_";
1850 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1851 fillthis=
"hNclsD0barvsptB_";
1855 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1861 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1862 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1865 Int_t pdgMother[2]={0,0};
1868 for(
Int_t iprong=0;iprong<2;iprong++){
1870 lab=prong->GetLabel();
1872 AliAODMCParticle* mcprong=(AliAODMCParticle*)arrMC->At(lab);
1874 Int_t labmom=mcprong->GetMother();
1876 AliAODMCParticle* mcmother=(AliAODMCParticle*)arrMC->At(labmom);
1877 if(mcmother) pdgMother[iprong]=mcmother->GetPdgCode();
1884 fillthis=
"hd0moresB_";
1887 if(TMath::Abs(pdgMother[iprong])==310 || TMath::Abs(pdgMother[iprong])==130 || TMath::Abs(pdgMother[iprong])==321){
1888 if(ptProng[iprong]<=1)factor[iprong]=1./.7;
1889 else factor[iprong]=1./.6;
1893 if(TMath::Abs(pdgMother[iprong])==3122) {
1894 factor[iprong]=1./0.25;
1897 fillthis=
"hd0moresB_";
1900 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[iprong],factor[iprong]);
1903 fillthis=
"hd0vmoresB_";
1905 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[iprong],factor[iprong]);
1911 fillthis=
"hd0d0moresB_";
1913 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0(),factor[0]*factor[1]);
1915 fillthis=
"hcosthetapointmoresB_";
1917 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,factor[0]*factor[1]);
1920 fillthis=
"hd0d0vmoresB_";
1922 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1],factor[0]*factor[1]);
1931 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[0]);
1932 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[1]);
1934 fillthis=
"hcosthetastarB_";
1942 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1945 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1947 fillthis=
"hcosthpointd0d0B_";
1949 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1951 fillthis=
"hcosthpointd0B_";
1953 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[0]);
1954 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[1]);
1959 fillthis=
"hd0vp0B_";
1961 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
1962 fillthis=
"hd0vp1B_";
1964 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
1968 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
1969 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
1977 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1981 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]*d0Prong[1]);
1984 fillthis=
"hd0d0vB_";
1986 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1989 fillthis=
"hcosthetapointB_";
1991 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1993 fillthis=
"hcosthetapointxyB_";
1999 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
2001 fillthis=
"hnormdeclB_";
2003 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
2005 fillthis=
"hdeclxyB_";
2007 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
2009 fillthis=
"hnormdeclxyB_";
2011 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
2013 fillthis=
"hdeclxyd0d0B_";
2015 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
2017 fillthis=
"hnormdeclxyd0d0B_";
2019 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
2024 fillthis=
"hdeclvB_";
2026 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
2028 fillthis=
"hnormdeclvB_";
2030 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
2047 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
2081 if(fDebug>2) cout<<
"Candidate selected"<<endl;
2091 Double_t arrayForSparse[3]={invmassD0,pt,impparXY};
2092 Double_t arrayForSparseTrue[3]={invmassD0,pt,trueImpParXY};
2121 TString fillthis=
"", fillthispt=
"", fillthismasspt=
"", fillthismassy=
"";
2122 Int_t pdgDgD0toKpi[2]={321,211};
2125 if (
fReadMC) labD0 = part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2134 if (weigD0 > 1.0 || weigD0 < 0.) {weigD0 = 0.;}
2135 if (weigD0bar > 1.0 || weigD0bar < 0.) {weigD0bar = 0.;}
2145 arrayForSparse[0]=invmassD0; arrayForSparse[2]=impparXY;
2149 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2151 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2152 Int_t pdgD0 = partD0->GetPdgCode();
2159 arrayForSparseTrue[0]=invmassD0; arrayForSparseTrue[2]=trueImpParXY;
2163 fillthis=
"histSgn_";
2165 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2168 fillthismasspt=
"histSgnPt";
2169 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2180 fillthismassy=
"histSgnY_";
2181 fillthismassy+=ptbin;
2182 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2187 fillthis=
"histSgn27_";
2189 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2193 fillthis=
"histRfl_";
2195 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2198 fillthismasspt=
"histRflPt";
2200 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2204 fillthismassy=
"histRflY_";
2205 fillthismassy+=ptbin;
2207 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2212 fillthis=
"histBkg_";
2214 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2217 fillthismasspt=
"histBkgPt";
2219 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2224 fillthismassy=
"histBkgY_";
2225 fillthismassy+=ptbin;
2227 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2233 fillthis=
"histMass_";
2238 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2242 fillthismasspt=
"histMassPt";
2244 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2252 fillthismassy=
"histMassY_";
2253 fillthismassy+=ptbin;
2255 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2263 arrayForSparse[0]=invmassD0bar; arrayForSparse[2]=impparXY;
2267 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2268 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2269 Int_t pdgD0 = partD0->GetPdgCode();
2276 arrayForSparseTrue[0]=invmassD0bar; arrayForSparseTrue[2]=trueImpParXY;
2279 fillthis=
"histSgn_";
2281 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2289 fillthismasspt=
"histSgnPt";
2291 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2303 fillthismassy=
"histSgnY_";
2304 fillthismassy+=ptbin;
2306 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2310 fillthis=
"histRfl_";
2312 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2314 fillthismasspt=
"histRflPt";
2316 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2319 fillthismassy=
"histRflY_";
2320 fillthismassy+=ptbin;
2322 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2326 fillthis=
"histBkg_";
2328 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2331 fillthismasspt=
"histBkgPt";
2333 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2337 fillthismassy=
"histBkgY_";
2338 fillthismassy+=ptbin;
2340 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2344 fillthis=
"histMass_";
2348 ((TH1F*)listout->FindObject(fillthis))->Fill(invmassD0bar,weigD0bar);
2352 fillthismasspt=
"histMassPt";
2354 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2358 fillthismassy=
"histMassY_";
2359 fillthismassy+=ptbin;
2361 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2374 Int_t nTrksToSkip=2;
2377 AliDebug(2,
"no daughter found!");
2380 skipped[0]=dgTrack->GetID();
2383 AliDebug(2,
"no daughter found!");
2386 skipped[1]=dgTrack->GetID();
2388 AliESDVertex *vertexESD=0x0;
2389 AliAODVertex *vertexAOD=0x0;
2390 AliVertexerTracks *vertexer =
new AliVertexerTracks(aodev->GetMagneticField());
2393 vertexer->SetSkipTracks(nTrksToSkip,skipped);
2394 vertexer->SetMinClusters(4);
2395 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
2396 if(!vertexESD)
return vertexAOD;
2397 if(vertexESD->GetNContributors()<=0) {
2398 AliDebug(2,
"vertexing failed");
2399 delete vertexESD; vertexESD=NULL;
2403 delete vertexer; vertexer=NULL;
2408 vertexESD->GetXYZ(pos);
2409 vertexESD->GetCovMatrix(cov);
2410 chi2perNDF = vertexESD->GetChi2toNDF();
2411 delete vertexESD; vertexESD=NULL;
2413 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF);
2424 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass: Terminate() \n");
2429 printf(
"ERROR: fOutputMass not available\n");
2434 printf(
"ERROR: fOutputMass not available\n");
2441 printf(
"ERROR: fDistr not available\n");
2446 fNentries =
dynamic_cast<TH1F*
>(GetOutputData(3));
2449 printf(
"ERROR: fNEntries not available\n");
2454 printf(
"ERROR: fCuts not available\n");
2459 printf(
"ERROR: fCounter not available\n");
2465 printf(
"ERROR: fDetSignal not available\n");
2472 printf(
"ERROR: fOutputMassY not available\n");
2481 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));
2504 nameDistr=
"hd0d0B_";
2507 nameDistr=
"hcosthetapointB_";
2514 nameDistr=
"hcosthetastarB_";
2517 nameDistr=
"hcosthpointd0d0B_";
2534 TCanvas *cMass=
new TCanvas(cvname,cvname);
2538 TCanvas* cStat=
new TCanvas(cstname,Form(
"Stat%s",
fArray ?
"LS" :
"D0"));
2554 Int_t nmassbins=200;
2555 Double_t fLowmasslimit=1.5648, fUpmasslimit=2.1648;
2556 Int_t fNImpParBins=400;
2557 Double_t fLowerImpPar=-2000., fHigherImpPar=2000.;
2559 Double_t xmin[3]={fLowmasslimit,0.,fLowerImpPar};
2560 Double_t xmax[3]={fUpmasslimit,20.,fHigherImpPar};
2564 "Mass vs. pt vs.imppar - All",
2567 "Mass vs. pt vs.imppar - promptD",
2570 "Mass vs. pt vs.imppar - DfromB",
2573 "Mass vs. pt vs.true imppar -DfromB",
2576 "Mass vs. pt vs.imppar - backgr.",
2579 for(
Int_t i=0; i<5;i++){
2588 printf(
" AliAnalysisTaskSED0MassV1::GetTrueImpactParameter() \n");
2591 mcHeader->GetVertex(vtxTrue);
2593 partD0->XvYvZv(origD);
2595 Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2];
2596 for(
Int_t iDau=0; iDau<2; iDau++){
2603 Int_t labelFirstDau = partD0->GetDaughter(0);
2605 for(
Int_t iDau=0; iDau<2; iDau++){
2606 Int_t ind = labelFirstDau+iDau;
2607 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
2609 Int_t pdgCode = TMath::Abs( part->GetPdgCode() );
2611 AliError(
"Daughter particle not found in MC array");
2614 if(pdgCode==211 || pdgCode==321){
2615 pXdauTrue[iDau]=part->Px();
2616 pYdauTrue[iDau]=part->Py();
2617 pZdauTrue[iDau]=part->Pz();
2622 AliAODRecoDecayHF aodDzeroMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
2632 printf(
" AliAnalysisTaskSED0Mass V1::CheckOrigin() \n");
2634 Int_t pdgGranma = 0;
2636 mother = mcPartCandidate->GetMother();
2638 Int_t abspdgGranma =0;
2640 Bool_t isQuarkFound=kFALSE;
2643 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
2645 pdgGranma = mcGranma->GetPdgCode();
2646 abspdgGranma = TMath::Abs(pdgGranma);
2647 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
2650 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
2651 mother = mcGranma->GetMother();
2653 AliError(
"Failed casting the mother particle!");
2658 if(isFromB)
return 5;
2665 const Int_t nVarPrompt = 2;
2666 const Int_t nVarFD = 3;
2668 Int_t nbinsPrompt[nVarPrompt]={200,100};
2669 Int_t nbinsFD[nVarFD]={200,100,200};
2671 Double_t xminPrompt[nVarPrompt] = {0.,-1.};
2672 Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
2674 Double_t xminFD[nVarFD] = {0.,-1.,0.};
2675 Double_t xmaxFD[nVarFD] = {40.,1.,40.};
2678 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
2683 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
2684 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
2686 fMCAccBFeed->GetAxis(2)->SetTitle(
"p_{T}^{B} (GeV/c)");
2694 const Int_t nProng = 2;
2695 Double_t zMCVertex = mcHeader->GetVtxZ();
2697 for(
Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
2698 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
2699 if (TMath::Abs(mcPart->GetPdgCode()) == 421){
2704 Bool_t isGoodDecay=kFALSE;
2705 Int_t labDau[4]={-1,-1,-1,-1};
2707 Bool_t isFidAcc = kFALSE;
2710 if(deca > 0) isGoodDecay=kTRUE;
2717 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
2719 if(isGoodDecay && TMath::Abs(zMCVertex) <
fCuts->
GetMaxVtxZ() && isFidAcc && isInAcc) {
2723 Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
2730 Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
2742 for (
Int_t iProng = 0; iProng<nProng; iProng++){
2743 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
2744 if(!mcPartDaughter)
return kFALSE;
2745 Double_t eta = mcPartDaughter->Eta();
2746 Double_t pt = mcPartDaughter->Pt();
2747 if (TMath::Abs(eta) > 0.9 || pt < 0.1)
return kFALSE;
2764 normIP[0]=diffIP[0]/errdiffIP[0];
2765 normIP[1]=diffIP[1]/errdiffIP[1];
2767 AliAODVertex* secvtx=part->GetSecondaryVtx();
2769 Double_t err2decaylength=secvtx->Error2DistanceXYToVertex(primvtx);
2770 Double_t lxy=part->AliAODRecoDecay::DecayLengthXY(primvtx);
2775 Int_t pdgDgD0toKpi[2]={321,211};
2777 lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2780 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(lab);
2782 if(orig==4)signalType=1;
2783 else if(orig==5)signalType=2;
2791 Double_t arrayMC[8]={part->Pt(), ptB,normIP[0], normIP[1], lxy, lxy/TMath::Sqrt(err2decaylength),(
Double_t)isCuts, (
Double_t)isPid};
2794 for(
Int_t i=0; i<8; i++){
2795 pointD0MC[i]=arrayMC[i];
2807 if(!IsSelectedPIDoff)
return;
2811 for(
Int_t i=0;i<9;i++){
2812 pointD0[i]=array[i];
2818 for(
Int_t i=0;i<9;i++){
2819 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
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
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...
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