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),
130 fLsNormalization(1.),
133 fIsSelectedCandidate(0),
134 fFillVarHists(kTRUE),
136 fIsRejectSDDClusters(0),
139 fFillImpParHist(kFALSE),
140 fUseSelectionBit(kTRUE),
142 fWriteVariableTree(kFALSE),
144 fCandidateVariables(),
146 fDrawDetSignal(kFALSE),
147 fUseQuarkTagInKine(kTRUE),
149 fhStudyImpParSingleTrackSign(0),
150 fhStudyImpParSingleTrackCand(0),
151 fhStudyImpParSingleTrackFd(0),
162 DefineOutput(1,TList::Class());
164 DefineOutput(2,TList::Class());
166 DefineOutput(3,TH1F::Class());
168 DefineOutput(4,AliRDHFCutsD0toKpi::Class());
170 DefineOutput(5,AliNormalizationCounter::Class());
172 DefineOutput(6,TList::Class());
174 DefineOutput(7,TTree::Class());
176 DefineOutput(8, TList::Class());
178 DefineOutput(9, TList::Class());
204 for(
Int_t i=0; i<5; i++){
236 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::Init() \n");
240 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
241 copyfCuts->SetName(nameoutput);
243 PostData(4,copyfCuts);
255 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::UserCreateOutputObjects() \n");
272 fDistr->SetName(
"distributionslist");
278 TString nameMass=
" ",nameSgn27=
" ",nameSgn=
" ", nameBkg=
" ", nameRfl=
" ",nameMassNocutsS =
" ",nameMassNocutsB =
" ", namedistr=
" ";
279 TString nameMassPt=
"", nameSgnPt=
"", nameBkgPt=
"", nameRflPt=
"";
280 TString nameMassY=
"", nameSgnY=
"", nameBkgY=
"", nameRflY=
"";
286 nameMass=
"histMass_";
288 nameSgn27=
"histSgn27_";
296 nameMassNocutsS=
"hMassS_";
298 nameMassNocutsB=
"hMassB_";
305 namedistr=
"hNclsD0vsptS_";
307 TH2F *hNclsD0vsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
308 namedistr=
"hNclsD0barvsptS_";
310 TH2F *hNclsD0barvsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
312 namedistr=
"hNITSpointsD0vsptS_";
314 TH2F *hNITSpointsD0vsptS =
new TH2F(namedistr.Data(),
"N ITS points distrubution [S];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
316 namedistr=
"hNSPDpointsD0S_";
318 TH1I *hNSPDpointsD0S =
new TH1I(namedistr.Data(),
"N SPD points distrubution [S]; ;N tracks",4,0,4);
319 hNSPDpointsD0S->GetXaxis()->SetBinLabel(1,
"no SPD");
320 hNSPDpointsD0S->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
321 hNSPDpointsD0S->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
322 hNSPDpointsD0S->GetXaxis()->SetBinLabel(4,
"kBoth");
326 TH1F *hptD0S =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
327 namedistr=
"hptD0barS_";
329 TH1F *hptD0barS =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
331 namedistr=
"hphiD0S_";
333 TH1F *hphiD0S =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
334 namedistr=
"hphiD0barS_";
336 TH1F *hphiD0barS =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
339 namedistr=
"hetaphiD0candidateS_";
341 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());
342 namedistr=
"hetaphiD0barcandidateS_";
344 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());
346 namedistr=
"hetaphiD0candidatesignalregionS_";
348 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());
349 namedistr=
"hetaphiD0barcandidatesignalregionS_";
351 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());
356 TH1F *hdcaS =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
360 TH1F *hd0piS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions);d0(#pi) [cm]",200,-0.1,0.1);
364 TH1F *hd0KS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons);d0(K) [cm]",200,-0.1,0.1);
367 TH1F *hd0d0S =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
372 TH1F *hdeclengthS =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm]",200,0,0.015);
374 namedistr=
"hnormdeclS_";
376 TH1F *hnormdeclengthS =
new TH1F(namedistr.Data(),
"Normalized Decay Length^{2} distribution;(Decay Length/Err)^{2} ",200,0,12.);
378 namedistr=
"hdeclxyS_";
380 TH1F* hdeclxyS=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
381 namedistr=
"hnormdeclxyS_";
383 TH1F* hnormdeclxyS=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
385 namedistr=
"hdeclxyd0d0S_";
387 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);
389 namedistr=
"hnormdeclxyd0d0S_";
391 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);
394 namedistr=
"hcosthetapointS_";
396 TH1F *hcosthetapointS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
398 namedistr=
"hcosthetapointxyS_";
400 TH1F *hcosthetapointxyS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XYdistribution;cos#theta_{Point}",300,0.,1.);
402 TH1F* tmpMS =
new TH1F(nameMassNocutsS.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
405 fDistr->Add(hNclsD0vsptS);
406 fDistr->Add(hNclsD0barvsptS);
407 fDistr->Add(hNITSpointsD0vsptS);
408 fDistr->Add(hNSPDpointsD0S);
413 fDistr->Add(hetaphiD0candidateS);
414 fDistr->Add(hetaphiD0candidatesignalregionS);
415 fDistr->Add(hetaphiD0barcandidateS);
416 fDistr->Add(hetaphiD0barcandidatesignalregionS);
425 fDistr->Add(hcosthetapointS);
427 fDistr->Add(hcosthetapointxyS);
431 fDistr->Add(hnormdeclengthS);
435 fDistr->Add(hnormdeclxyS);
437 fDistr->Add(hdeclxyd0d0S);
438 fDistr->Add(hnormdeclxyd0d0S);
446 namedistr=
"hNclsD0vsptB_";
448 TH2F *hNclsD0vsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
449 namedistr=
"hNclsD0barvsptB_";
451 TH2F *hNclsD0barvsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
453 namedistr=
"hNITSpointsD0vsptB_";
455 TH2F *hNITSpointsD0vsptB =
new TH2F(namedistr.Data(),
"N ITS points distrubution [B];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
457 namedistr=
"hNSPDpointsD0B_";
459 TH1I *hNSPDpointsD0B =
new TH1I(namedistr.Data(),
"N SPD points distrubution [B]; ;N tracks",4,0,4);
460 hNSPDpointsD0B->GetXaxis()->SetBinLabel(1,
"no SPD");
461 hNSPDpointsD0B->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
462 hNSPDpointsD0B->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
463 hNSPDpointsD0B->GetXaxis()->SetBinLabel(4,
"kBoth");
467 TH1F *hptD0B =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
468 namedistr=
"hptD0barB_";
470 TH1F *hptD0barB =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
472 namedistr=
"hphiD0B_";
474 TH1F *hphiD0B =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
475 namedistr=
"hphiD0barB_";
477 TH1F *hphiD0barB =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
479 namedistr=
"hetaphiD0candidateB_";
481 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());
482 namedistr=
"hetaphiD0barcandidateB_";
484 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());
486 namedistr=
"hetaphiD0candidatesignalregionB_";
488 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());
489 namedistr=
"hetaphiD0barcandidatesignalregionB_";
491 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());
496 TH1F *hdcaB =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
501 TH1F *hd0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
505 TH1F *hd0d0B =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
510 TH1F *hdeclengthB =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm^{2}]",200,0,0.015);
512 namedistr=
"hnormdeclB_";
514 TH1F *hnormdeclengthB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution;(Decay Length/Err)^{2} ",200,0,12.);
516 namedistr=
"hdeclxyB_";
518 TH1F* hdeclxyB=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
519 namedistr=
"hnormdeclxyB_";
521 TH1F* hnormdeclxyB=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
523 namedistr=
"hdeclxyd0d0B_";
525 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);
527 namedistr=
"hnormdeclxyd0d0B_";
529 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);
532 namedistr=
"hcosthetapointB_";
534 TH1F *hcosthetapointB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
536 namedistr=
"hcosthetapointxyB_";
538 TH1F *hcosthetapointxyB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XY distribution;cos#theta_{Point} XY",300,0.,1.);
540 TH1F* tmpMB =
new TH1F(nameMassNocutsB.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
544 fDistr->Add(hNclsD0vsptB);
545 fDistr->Add(hNclsD0barvsptB);
546 fDistr->Add(hNITSpointsD0vsptB);
547 fDistr->Add(hNSPDpointsD0B);
552 fDistr->Add(hetaphiD0candidateB);
553 fDistr->Add(hetaphiD0candidatesignalregionB);
554 fDistr->Add(hetaphiD0barcandidateB);
555 fDistr->Add(hetaphiD0barcandidatesignalregionB);
563 fDistr->Add(hcosthetapointB);
565 fDistr->Add(hcosthetapointxyB);
569 fDistr->Add(hnormdeclengthB);
573 fDistr->Add(hnormdeclxyB);
575 fDistr->Add(hdeclxyd0d0B);
576 fDistr->Add(hnormdeclxyd0d0B);
584 namedistr=
"hd0vpiS_";
586 TH1F *hd0vpiS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions)(vtx w/o these tracks);d0(#pi) [cm]",200,-0.1,0.1);
590 TH1F *hd0vKS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons) (vtx w/o these tracks);d0(K) [cm]",200,-0.1,0.1);
592 namedistr=
"hd0d0vS_";
594 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);
596 namedistr=
"hdeclvS_";
598 TH1F *hdeclengthvS =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
600 namedistr=
"hnormdeclvS_";
602 TH1F *hnormdeclengthvS =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
607 fDistr->Add(hdeclengthvS);
608 fDistr->Add(hnormdeclengthvS);
612 namedistr=
"hd0vmoresB_";
614 TH1F *hd0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
616 namedistr=
"hd0d0vmoresB_";
618 TH1F *hd0d0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
623 TH1F *hd0vB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
625 namedistr=
"hd0vp0B_";
627 TH1F *hd0vp0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong + ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
629 namedistr=
"hd0vp1B_";
631 TH1F *hd0vp1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong - ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
633 namedistr=
"hd0d0vB_";
635 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);
637 namedistr=
"hdeclvB_";
639 TH1F *hdeclengthvB =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
641 namedistr=
"hnormdeclvB_";
643 TH1F *hnormdeclengthvB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
651 fDistr->Add(hd0d0vmoresB);
653 fDistr->Add(hdeclengthvB);
655 fDistr->Add(hnormdeclengthvB);
665 TH1F* tmpSt =
new TH1F(nameSgn.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
667 TH1F *tmpSl=(TH1F*)tmpSt->Clone();
672 TH1F* tmpRt =
new TH1F(nameRfl.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
674 TH1F* tmpBt =
new TH1F(nameBkg.Data(),
"Background invariant mass - MC; M [GeV]; Entries",600,1.6248,2.2248);
688 TH1F* tmpMt =
new TH1F(nameMass.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.6248,2.2248);
704 TH1F *hptpiS =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
708 TH1F *hptKS =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
711 namedistr=
"hcosthetastarS_";
713 TH1F *hcosthetastarS =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
717 namedistr=
"hptpiSnoMcut_";
719 TH1F *hptpiSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
721 namedistr=
"hptKSnoMcut_";
723 TH1F *hptKSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
727 fDistr->Add(hcosthetastarS);
729 fDistr->Add(hptpiSnoMcut);
733 namedistr=
"hcosthpointd0S_";
735 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);
736 namedistr=
"hcosthpointd0d0S_";
738 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);
740 fDistr->Add(hcosthpointd0S);
741 fDistr->Add(hcosthpointd0d0S);
744 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);
745 TH1F *tmpS27l=(TH1F*)tmpS27t->Clone();
757 TH1F *hptB =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
760 namedistr=
"hcosthetastarB_";
762 TH1F *hcosthetastarB =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
765 namedistr=
"hptB1prongnoMcut_";
767 TH1F *hptB1pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
769 namedistr=
"hptB2prongsnoMcut_";
771 TH1F *hptB2pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
774 fDistr->Add(hcosthetastarB);
776 fDistr->Add(hptB1pnoMcut);
777 fDistr->Add(hptB2pnoMcut);
782 TH1F *hd0p0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.1,0.1);
786 TH1F *hd0p1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong -);d0 [cm]",200,-0.1,0.1);
789 namedistr=
"hd0moresB_";
791 TH1F *hd0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
793 namedistr=
"hd0d0moresB_";
795 TH1F *hd0d0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
798 namedistr=
"hcosthetapointmoresB_";
800 TH1F *hcosthetapointmoresB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
803 namedistr=
"hcosthpointd0B_";
805 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);
807 namedistr=
"hcosthpointd0d0B_";
809 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);
816 fDistr->Add(hcosthetapointmoresB);
819 fDistr->Add(hcosthpointd0B);
822 fDistr->Add(hcosthpointd0d0B);
830 Int_t nbinsImpParStudy[9]= {50, 40, 40, 20, 15, 600, 3,4,2};
831 Double_t limitLowImpParStudy[9]={0, -5, -5, 0, 0,1.6248,1,0,0};
832 Double_t limitUpImpParStudy[9]= {50., 5, 5, 0.2,15,2.2248,4,4,2};
833 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"};
834 fhStudyImpParSingleTrackCand=
new THnSparseF(
"fhStudyImpParSingleTrackCand",
"fhStudyImpParSingleTrackCand",9,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
842 Int_t nbinsImpParStudy[8]= {50,50,40, 40, 20, 15, 3, 4};
843 Double_t limitLowImpParStudy[8]={0, 0, -5,-5., 0., 0., 1.,0.};
844 Double_t limitUpImpParStudy[8]= {50.,50., 5, 5, 0.2, 15, 3.,4.};
846 fhStudyImpParSingleTrackSign=
new THnSparseF(
"fhStudyImpParSingleTrackSign",
"fhStudyImpParSingleTrackSign",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
847 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"};
852 fhStudyImpParSingleTrackFd=
new THnSparseF(
"fhStudyImpParSingleTrackFd",
"fhStudyImpParSingleTrackFd",8,nbinsImpParStudy,limitLowImpParStudy,limitUpImpParStudy);
864 namedistr=
"hpospair";
866 namedistr=
"hnegpair";
876 nameMassPt=
"histMassPt";
877 nameSgnPt=
"histSgnPt";
878 nameBkgPt=
"histBkgPt";
879 nameRflPt=
"histRflPt";
883 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);
884 TH2F *tmpSlPt=(
TH2F*)tmpStPt->Clone();
889 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);
890 TH2F* tmpBtPt =
new TH2F(nameBkgPt.Data(),
"Background invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
904 TH2F* tmpMtPt =
new TH2F(nameMassPt.Data(),
"D^{0} invariant mass; M [GeV]; Entries; Pt[GeV/c]",600,1.6248,2.2248,nbins2dPt,binInPt,binFinPt);
916 nameMassY=
"histMassY_";
918 nameSgnY=
"histSgnY_";
920 nameBkgY=
"histBkgY_";
922 nameRflY=
"histRflY_";
926 TH2F* tmpStY =
new TH2F(nameSgnY.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
929 TH2F* tmpRtY =
new TH2F(nameRflY.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
930 TH2F* tmpBtY =
new TH2F(nameBkgY.Data(),
"Background invariant mass - MC; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
938 TH2F* tmpMtY =
new TH2F(nameMassY.Data(),
"D^{0} invariant mass; M [GeV]; Entries; y",600,1.6248,2.2248,nbins2dY,binInY,binFinY);
945 const char* nameoutput=GetOutputSlot(3)->GetContainer()->GetName();
947 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);
949 fNentries->GetXaxis()->SetBinLabel(1,
"nEventsAnal");
950 fNentries->GetXaxis()->SetBinLabel(2,
"nCandSel(Cuts)");
952 else fNentries->GetXaxis()->SetBinLabel(3,
"Dstar<-D0");
953 fNentries->GetXaxis()->SetBinLabel(4,
"nEventsGoodVtxS");
954 fNentries->GetXaxis()->SetBinLabel(5,
"ptbin = -1");
955 fNentries->GetXaxis()->SetBinLabel(6,
"no daughter");
956 if(
fSys==0)
fNentries->GetXaxis()->SetBinLabel(7,
"nCandSel(Tr)");
958 fNentries->GetXaxis()->SetBinLabel(8,
"PID=0");
959 fNentries->GetXaxis()->SetBinLabel(9,
"PID=1");
960 fNentries->GetXaxis()->SetBinLabel(10,
"PID=2");
961 fNentries->GetXaxis()->SetBinLabel(11,
"PID=3");
964 fNentries->GetXaxis()->SetBinLabel(12,
"K");
965 fNentries->GetXaxis()->SetBinLabel(13,
"Lambda");
967 fNentries->GetXaxis()->SetBinLabel(14,
"Pile-up Rej");
968 fNentries->GetXaxis()->SetBinLabel(15,
"N. of 0SMH");
969 if(
fSys==1)
fNentries->GetXaxis()->SetBinLabel(16,
"Nev in centr");
971 fNentries->GetXaxis()->SetBinLabel(18,
"Phys.Sel.Rej");
972 fNentries->GetXaxis()->SetBinLabel(19,
"D0 failed to be filled");
973 fNentries->GetXaxis()->SetBinLabel(20,
"fisFilled is 0");
974 fNentries->GetXaxis()->SetBinLabel(21,
"fisFilled is 1");
975 fNentries->GetXaxis()->SetBinLabel(22,
"AOD/dAOD mismatch");
976 fNentries->GetXaxis()->SetBinLabel(23,
"AOD/dAOD #events ok");
977 fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
985 nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
990 fCandidateVariableNames[0] =
"massD0";
991 fCandidateVariableNames[1] =
"massD0bar";
992 fCandidateVariableNames[2] =
"pt";
993 fCandidateVariableNames[3] =
"dca";
994 fCandidateVariableNames[4] =
"costhsD0";
995 fCandidateVariableNames[5] =
"costhsD0bar";
996 fCandidateVariableNames[6] =
"ptk";
997 fCandidateVariableNames[7] =
"ptpi";
998 fCandidateVariableNames[8] =
"d0k";
999 fCandidateVariableNames[9] =
"d0pi";
1000 fCandidateVariableNames[10] =
"d0xd0";
1001 fCandidateVariableNames[11] =
"costhp";
1002 fCandidateVariableNames[12] =
"costhpxy";
1003 fCandidateVariableNames[13] =
"lxy";
1004 fCandidateVariableNames[14] =
"specialcuts";
1014 TH2F *TOFSigBefPID =
new TH2F(
"TOFSigBefPID",
"TOF signal of daughters before PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1015 TH2F *TOFSigAftPID =
new TH2F(
"TOFSigAftPID",
"TOF signal after PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
1017 TH2F *TPCSigBefPID =
new TH2F(
"TPCSigBefPID",
"TPC dE/dx before PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1018 TH2F *TPCSigAftPID =
new TH2F(
"TPCSigAftPID",
"TPC dE/dx after PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
1063 if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 &&
fAODProtection==1)) {
1079 bname=
"LikeSign2Prong";
1081 TClonesArray *inputArray=0;
1082 if(!aod && AODEvent() && IsStandardAOD()) {
1088 AliAODHandler* aodHandler = (AliAODHandler*)
1089 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1091 if(aodHandler->GetExtensions()) {
1092 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
1094 inputArray=(TClonesArray*)aodFromExt->GetList()->FindObject(bname.Data());
1097 inputArray=(TClonesArray*)aod->GetList()->FindObject(bname.Data());
1100 if(!inputArray || !aod) {
1101 printf(
"AliAnalysisTaskSED0Mass::UserExec: input branch not found!\n");
1106 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001)
return;
1108 TClonesArray *mcArray = 0;
1109 AliAODMCHeader *mcHeader = 0;
1113 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1115 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC particles branch not found!\n");
1120 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1122 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC header branch not found!\n");
1135 TString trigclass=aod->GetFiredTriggerClasses();
1136 if(trigclass.Contains(
"C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains(
"C0SMH-B-NOPF-ALL"))
fNentries->Fill(14);
1150 Bool_t skipEvent = kFALSE;
1152 if (aod) ntracks = aod->GetNumberOfTracks();
1153 for(
Int_t itrack=0; itrack<ntracks; itrack++) {
1155 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1156 if(!track) AliFatal(
"Not a standard AOD");
1157 if(TESTBIT(track->GetITSClusterMap(),2) || TESTBIT(track->GetITSClusterMap(),3) ){
1163 if (skipEvent)
return;
1167 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1172 TString primTitle = vtx1->GetTitle();
1173 if(primTitle.Contains(
"VertexerTracks") && vtx1->GetNContributors()>0) {
1179 Int_t nInD0toKpi = inputArray->GetEntriesFast();
1180 if(fDebug>2) printf(
"Number of D0->Kpi: %d\n",nInD0toKpi);
1184 Int_t nSelectedloose=0,nSelectedtight=0;
1191 for (
Int_t iD0toKpi = 0; iD0toKpi < nInD0toKpi; iD0toKpi++) {
1212 if(ptbin==-1) {
fNentries->Fill(4);
continue;}
1220 AliDebug(1,
"at least one daughter not found!");
1235 Int_t isSelectedPIDfill = 3;
1238 if (isSelectedPIDfill == 0)
fNentries->Fill(7);
1239 if (isSelectedPIDfill == 1)
fNentries->Fill(8);
1240 if (isSelectedPIDfill == 2)
fNentries->Fill(9);
1241 if (isSelectedPIDfill == 3)
fNentries->Fill(10);
1273 AliESDtrack *esdtrack1 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1274 AliESDtrack *esdtrack2 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1278 Int_t isSelectedPIDfill = 3;
1283 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1284 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1285 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1286 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1288 if (isSelectedPIDfill != 0) {
1289 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1290 ((
TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1291 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1292 ((
TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1309 Int_t pdgDgD0toKpi[2]={321,211};
1311 if(
fReadMC) lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
1313 Int_t isSelectedPID=3;
1316 if (isSelectedPID==0)
fNentries->Fill(7);
1317 if (isSelectedPID==1)
fNentries->Fill(8);
1318 if (isSelectedPID==2)
fNentries->Fill(9);
1319 if (isSelectedPID==3)
fNentries->Fill(10);
1330 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1341 TString fillthispi=
"",fillthisK=
"",fillthis=
"", fillthispt=
"", fillthisetaphi=
"";
1346 Double_t dz1[2],dz2[2],covar1[3],covar2[3];
1347 dz1[0]=-99; dz2[0]=-99;
1357 AliAODVertex *vtxProp=0x0;
1363 AliESDtrack *esdtrack1=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1364 AliESDtrack *esdtrack2=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1365 esdtrack1->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz1,covar1);
1366 esdtrack2->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz2,covar2);
1367 delete vtxProp; vtxProp=NULL;
1384 Double_t normalizedDecayLength2 = -1, normalizedDecayLengthxy=-1;
1385 Double_t decayLength2 = -1, decayLengthxy=-1;
1400 if(!prong0 || !prong1) {
1405 labprong[0]=prong0->GetLabel();
1406 labprong[1]=prong1->GetLabel();
1408 AliAODMCParticle *mcprong=0;
1409 Int_t pdgProng[2]={0,0};
1411 for (
Int_t iprong=0;iprong<2;iprong++){
1412 if(
fReadMC && labprong[iprong]>=0) {
1413 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1414 pdgProng[iprong]=mcprong->GetPdgCode();
1421 fillthispi=
"hptpiSnoMcut_";
1424 fillthisK=
"hptKSnoMcut_";
1427 if ((TMath::Abs(pdgProng[0]) == 211 && TMath::Abs(pdgProng[1]) == 321)
1428 || (isSelectedPID==1 || isSelectedPID==3)){
1429 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong0->Pt());
1430 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong1->Pt());
1433 if ((TMath::Abs(pdgProng[0]) == 321 && TMath::Abs(pdgProng[1]) == 211)
1434 || (isSelectedPID==2 || isSelectedPID==3)){
1435 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong0->Pt());
1436 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong1->Pt());
1448 fillthispt=
"histSgnPt";
1450 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)
1451 || (!
fReadMC && (isSelectedPID==1 || isSelectedPID==3))){
1452 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1455 fillthisetaphi=
"hetaphiD0candidateS_";
1456 fillthisetaphi+=ptbin;
1457 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1459 if(TMath::Abs(minvD0-mPDG)<0.05){
1460 fillthisetaphi=
"hetaphiD0candidatesignalregionS_";
1461 fillthisetaphi+=ptbin;
1462 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1468 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1471 fillthisetaphi=
"hetaphiD0barcandidateS_";
1472 fillthisetaphi+=ptbin;
1473 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1475 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1476 fillthisetaphi=
"hetaphiD0barcandidatesignalregionS_";
1477 fillthisetaphi+=ptbin;
1478 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1485 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1495 ptProng[0]=prong0->Pt(); ptProng[1]=prong1->Pt();
1496 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1498 if(
fArray==1) cout<<
"LS signal: ERROR"<<endl;
1499 for (
Int_t iprong=0; iprong<2; iprong++){
1501 if (
fReadMC) labprong[iprong]=prong->GetLabel();
1505 if(
fReadMC && labprong[iprong]>=0) {
1506 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1507 pdgprong=mcprong->GetPdgCode();
1510 Bool_t isPionHere[2]={(isSelectedPID==1 || isSelectedPID==3) ? kTRUE : kFALSE,(isSelectedPID==2 || isSelectedPID==3) ? kTRUE : kFALSE};
1512 if(TMath::Abs(pdgprong)==211 || isPionHere[iprong]) {
1516 fillthispi=
"hptpiS_";
1518 ((TH1F*)listout->FindObject(fillthispi))->Fill(ptProng[iprong]);
1521 fillthispi=
"hd0piS_";
1523 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0Prong[iprong]);
1526 fillthispi=
"hd0vpiS_";
1528 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0[iprong]);
1533 if(TMath::Abs(pdgprong)==321 || !isPionHere[iprong]) {
1538 ((TH1F*)listout->FindObject(fillthisK))->Fill(ptProng[iprong]);
1544 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0Prong[iprong]);
1546 fillthisK=
"hd0vKS_";
1548 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0[iprong]);
1553 fillthis=
"hcosthpointd0S_";
1555 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[iprong]);
1561 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1563 fillthis=
"hcosthetapointS_";
1565 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1567 fillthis=
"hcosthetapointxyS_";
1574 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0());
1578 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1580 fillthis=
"hnormdeclS_";
1582 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1584 fillthis=
"hdeclxyS_";
1586 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1588 fillthis=
"hnormdeclxyS_";
1590 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1592 fillthis=
"hdeclxyd0d0S_";
1594 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1596 fillthis=
"hnormdeclxyd0d0S_";
1598 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1601 fillthis=
"hdeclvS_";
1603 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1605 fillthis=
"hnormdeclvS_";
1607 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1609 fillthis=
"hd0d0vS_";
1611 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1615 fillthis=
"hcosthetastarS_";
1617 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)) ((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1619 if (
fReadMC || isSelectedPID>1)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar);
1620 if(isSelectedPID==1 || isSelectedPID==3)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1623 fillthis=
"hcosthpointd0d0S_";
1625 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1628 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)){
1629 for(
Int_t it=0; it<2; it++){
1632 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1633 fillthis=
"hphiD0S_";
1635 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1636 Int_t nPointsITS = 0;
1637 for (
Int_t il=0; il<6; il++){
1638 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1640 fillthis=
"hNITSpointsD0vsptS_";
1642 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(),nPointsITS);
1643 fillthis=
"hNSPDpointsD0S_";
1645 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1646 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1648 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1649 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1651 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1652 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1654 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1655 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1657 fillthis=
"hNclsD0vsptS_";
1661 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1665 if (
fReadMC || isSelectedPID>1){
1666 for(
Int_t it=0; it<2; it++){
1667 fillthis=
"hptD0barS_";
1669 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1670 fillthis=
"hphiD0barS_";
1672 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1673 fillthis=
"hNclsD0barvsptS_";
1677 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1680 if(isSelectedPID==1 || isSelectedPID==3){
1681 for(
Int_t it=0; it<2; it++){
1684 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1685 fillthis=
"hphiD0S_";
1687 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1688 Int_t nPointsITS = 0;
1689 for (
Int_t il=0; il<6; il++){
1690 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1692 fillthis=
"hNITSpointsD0vsptS_";
1694 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1695 fillthis=
"hNSPDpointsD0S_";
1697 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1698 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1700 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1701 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1703 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1704 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1706 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1707 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1709 fillthis=
"hNclsD0vsptS_";
1713 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1731 fillthispt=
"histBkgPt";
1734 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1737 fillthisetaphi=
"hetaphiD0candidateB_";
1738 fillthisetaphi+=ptbin;
1739 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1741 if(TMath::Abs(minvD0-mPDG)<0.05){
1742 fillthisetaphi=
"hetaphiD0candidatesignalregionB_";
1743 fillthisetaphi+=ptbin;
1744 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1748 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1751 fillthisetaphi=
"hetaphiD0barcandidateB_";
1752 fillthisetaphi+=ptbin;
1753 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1755 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1756 fillthisetaphi=
"hetaphiD0barcandidatesignalregionB_";
1757 fillthisetaphi+=ptbin;
1758 ((
TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1763 fillthis=
"hptB1prongnoMcut_";
1766 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1768 fillthis=
"hptB2prongsnoMcut_";
1770 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1771 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1776 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1788 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1793 if(fDebug>2) cout<<
"No daughter found";
1798 if(prongg->Charge()==1) {
1800 ((TH1F*)
fOutputMass->FindObject(
"hpospair"))->Fill(ptbin);
1803 ((TH1F*)
fOutputMass->FindObject(
"hnegpair"))->Fill(ptbin);
1811 for(
Int_t it=0; it<2; it++){
1814 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1815 fillthis=
"hphiD0B_";
1817 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1819 Int_t nPointsITS = 0;
1820 for (
Int_t il=0; il<6; il++){
1821 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1823 fillthis=
"hNITSpointsD0vsptB_";
1825 ((
TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1826 fillthis=
"hNSPDpointsD0B_";
1828 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1829 ((
TH1I*)listout->FindObject(fillthis))->Fill(0);
1831 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1832 ((
TH1I*)listout->FindObject(fillthis))->Fill(1);
1834 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1835 ((
TH1I*)listout->FindObject(fillthis))->Fill(2);
1837 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1838 ((
TH1I*)listout->FindObject(fillthis))->Fill(3);
1840 fillthis=
"hNclsD0vsptB_";
1844 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1851 for(
Int_t it=0; it<2; it++){
1852 fillthis=
"hptD0barB_";
1854 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1855 fillthis=
"hphiD0barB_";
1857 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1858 fillthis=
"hNclsD0barvsptB_";
1862 ((
TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1868 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1869 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1872 Int_t pdgMother[2]={0,0};
1875 for(
Int_t iprong=0;iprong<2;iprong++){
1877 lab=prong->GetLabel();
1879 AliAODMCParticle* mcprong=(AliAODMCParticle*)arrMC->At(lab);
1881 Int_t labmom=mcprong->GetMother();
1883 AliAODMCParticle* mcmother=(AliAODMCParticle*)arrMC->At(labmom);
1884 if(mcmother) pdgMother[iprong]=mcmother->GetPdgCode();
1891 fillthis=
"hd0moresB_";
1894 if(TMath::Abs(pdgMother[iprong])==310 || TMath::Abs(pdgMother[iprong])==130 || TMath::Abs(pdgMother[iprong])==321){
1895 if(ptProng[iprong]<=1)factor[iprong]=1./.7;
1896 else factor[iprong]=1./.6;
1900 if(TMath::Abs(pdgMother[iprong])==3122) {
1901 factor[iprong]=1./0.25;
1904 fillthis=
"hd0moresB_";
1907 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[iprong],factor[iprong]);
1910 fillthis=
"hd0vmoresB_";
1912 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[iprong],factor[iprong]);
1918 fillthis=
"hd0d0moresB_";
1920 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0(),factor[0]*factor[1]);
1922 fillthis=
"hcosthetapointmoresB_";
1924 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,factor[0]*factor[1]);
1927 fillthis=
"hd0d0vmoresB_";
1929 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1],factor[0]*factor[1]);
1938 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[0]);
1939 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[1]);
1941 fillthis=
"hcosthetastarB_";
1949 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1952 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1954 fillthis=
"hcosthpointd0d0B_";
1956 ((
TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1958 fillthis=
"hcosthpointd0B_";
1960 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[0]);
1961 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[1]);
1966 fillthis=
"hd0vp0B_";
1968 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
1969 fillthis=
"hd0vp1B_";
1971 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
1975 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
1976 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
1984 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1988 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]*d0Prong[1]);
1991 fillthis=
"hd0d0vB_";
1993 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1996 fillthis=
"hcosthetapointB_";
1998 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
2000 fillthis=
"hcosthetapointxyB_";
2006 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
2008 fillthis=
"hnormdeclB_";
2010 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
2012 fillthis=
"hdeclxyB_";
2014 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
2016 fillthis=
"hnormdeclxyB_";
2018 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
2020 fillthis=
"hdeclxyd0d0B_";
2022 ((
TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
2024 fillthis=
"hnormdeclxyd0d0B_";
2026 ((
TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
2031 fillthis=
"hdeclvB_";
2033 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
2035 fillthis=
"hnormdeclvB_";
2037 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
2054 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
2088 if(fDebug>2) cout<<
"Candidate selected"<<endl;
2098 Double_t arrayForSparse[3]={invmassD0,pt,impparXY};
2099 Double_t arrayForSparseTrue[3]={invmassD0,pt,trueImpParXY};
2128 TString fillthis=
"", fillthispt=
"", fillthismasspt=
"", fillthismassy=
"";
2129 Int_t pdgDgD0toKpi[2]={321,211};
2132 if (
fReadMC) labD0 = part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2141 if (weigD0 > 1.0 || weigD0 < 0.) {weigD0 = 0.;}
2142 if (weigD0bar > 1.0 || weigD0bar < 0.) {weigD0bar = 0.;}
2152 arrayForSparse[0]=invmassD0; arrayForSparse[2]=impparXY;
2156 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2158 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2159 Int_t pdgD0 = partD0->GetPdgCode();
2166 arrayForSparseTrue[0]=invmassD0; arrayForSparseTrue[2]=trueImpParXY;
2170 fillthis=
"histSgn_";
2172 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2175 fillthismasspt=
"histSgnPt";
2176 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2187 fillthismassy=
"histSgnY_";
2188 fillthismassy+=ptbin;
2189 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2194 fillthis=
"histSgn27_";
2196 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2200 fillthis=
"histRfl_";
2202 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2205 fillthismasspt=
"histRflPt";
2207 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2211 fillthismassy=
"histRflY_";
2212 fillthismassy+=ptbin;
2214 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2219 fillthis=
"histBkg_";
2221 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2224 fillthismasspt=
"histBkgPt";
2226 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2231 fillthismassy=
"histBkgY_";
2232 fillthismassy+=ptbin;
2234 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2240 fillthis=
"histMass_";
2245 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2249 fillthismasspt=
"histMassPt";
2251 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2259 fillthismassy=
"histMassY_";
2260 fillthismassy+=ptbin;
2262 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2270 arrayForSparse[0]=invmassD0bar; arrayForSparse[2]=impparXY;
2274 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2275 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2276 Int_t pdgD0 = partD0->GetPdgCode();
2283 arrayForSparseTrue[0]=invmassD0bar; arrayForSparseTrue[2]=trueImpParXY;
2286 fillthis=
"histSgn_";
2288 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2296 fillthismasspt=
"histSgnPt";
2298 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2310 fillthismassy=
"histSgnY_";
2311 fillthismassy+=ptbin;
2313 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2317 fillthis=
"histRfl_";
2319 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2321 fillthismasspt=
"histRflPt";
2323 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2326 fillthismassy=
"histRflY_";
2327 fillthismassy+=ptbin;
2329 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2333 fillthis=
"histBkg_";
2335 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2338 fillthismasspt=
"histBkgPt";
2340 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2344 fillthismassy=
"histBkgY_";
2345 fillthismassy+=ptbin;
2347 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2351 fillthis=
"histMass_";
2355 ((TH1F*)listout->FindObject(fillthis))->Fill(invmassD0bar,weigD0bar);
2359 fillthismasspt=
"histMassPt";
2361 ((
TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2365 fillthismassy=
"histMassY_";
2366 fillthismassy+=ptbin;
2368 ((
TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2381 Int_t nTrksToSkip=2;
2384 AliDebug(2,
"no daughter found!");
2387 skipped[0]=dgTrack->GetID();
2390 AliDebug(2,
"no daughter found!");
2393 skipped[1]=dgTrack->GetID();
2395 AliESDVertex *vertexESD=0x0;
2396 AliAODVertex *vertexAOD=0x0;
2397 AliVertexerTracks *vertexer =
new AliVertexerTracks(aodev->GetMagneticField());
2400 vertexer->SetSkipTracks(nTrksToSkip,skipped);
2401 vertexer->SetMinClusters(4);
2402 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
2403 if(!vertexESD)
return vertexAOD;
2404 if(vertexESD->GetNContributors()<=0) {
2405 AliDebug(2,
"vertexing failed");
2406 delete vertexESD; vertexESD=NULL;
2410 delete vertexer; vertexer=NULL;
2415 vertexESD->GetXYZ(pos);
2416 vertexESD->GetCovMatrix(cov);
2417 chi2perNDF = vertexESD->GetChi2toNDF();
2418 delete vertexESD; vertexESD=NULL;
2420 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF);
2431 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass: Terminate() \n");
2436 printf(
"ERROR: fOutputMass not available\n");
2441 printf(
"ERROR: fOutputMass not available\n");
2448 printf(
"ERROR: fDistr not available\n");
2453 fNentries =
dynamic_cast<TH1F*
>(GetOutputData(3));
2456 printf(
"ERROR: fNEntries not available\n");
2461 printf(
"ERROR: fCuts not available\n");
2466 printf(
"ERROR: fCounter not available\n");
2472 printf(
"ERROR: fDetSignal not available\n");
2479 printf(
"ERROR: fOutputMassY not available\n");
2488 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));
2511 nameDistr=
"hd0d0B_";
2514 nameDistr=
"hcosthetapointB_";
2521 nameDistr=
"hcosthetastarB_";
2524 nameDistr=
"hcosthpointd0d0B_";
2541 TCanvas *cMass=
new TCanvas(cvname,cvname);
2545 TCanvas* cStat=
new TCanvas(cstname,Form(
"Stat%s",
fArray ?
"LS" :
"D0"));
2561 Int_t nmassbins=200;
2562 Double_t fLowmasslimit=1.5648, fUpmasslimit=2.1648;
2563 Int_t fNImpParBins=400;
2564 Double_t fLowerImpPar=-2000., fHigherImpPar=2000.;
2566 Double_t xmin[3]={fLowmasslimit,0.,fLowerImpPar};
2567 Double_t xmax[3]={fUpmasslimit,20.,fHigherImpPar};
2571 "Mass vs. pt vs.imppar - All",
2574 "Mass vs. pt vs.imppar - promptD",
2577 "Mass vs. pt vs.imppar - DfromB",
2580 "Mass vs. pt vs.true imppar -DfromB",
2583 "Mass vs. pt vs.imppar - backgr.",
2586 for(
Int_t i=0; i<5;i++){
2595 printf(
" AliAnalysisTaskSED0MassV1::GetTrueImpactParameter() \n");
2598 mcHeader->GetVertex(vtxTrue);
2600 partD0->XvYvZv(origD);
2602 Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2];
2603 for(
Int_t iDau=0; iDau<2; iDau++){
2610 Int_t labelFirstDau = partD0->GetDaughter(0);
2612 for(
Int_t iDau=0; iDau<2; iDau++){
2613 Int_t ind = labelFirstDau+iDau;
2614 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
2616 Int_t pdgCode = TMath::Abs( part->GetPdgCode() );
2618 AliError(
"Daughter particle not found in MC array");
2621 if(pdgCode==211 || pdgCode==321){
2622 pXdauTrue[iDau]=part->Px();
2623 pYdauTrue[iDau]=part->Py();
2624 pZdauTrue[iDau]=part->Pz();
2629 AliAODRecoDecayHF aodDzeroMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
2639 printf(
" AliAnalysisTaskSED0Mass V1::CheckOrigin() \n");
2641 Int_t pdgGranma = 0;
2643 mother = mcPartCandidate->GetMother();
2645 Int_t abspdgGranma =0;
2647 Bool_t isQuarkFound=kFALSE;
2650 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
2652 pdgGranma = mcGranma->GetPdgCode();
2653 abspdgGranma = TMath::Abs(pdgGranma);
2654 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
2657 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
2658 mother = mcGranma->GetMother();
2660 AliError(
"Failed casting the mother particle!");
2665 if(isFromB)
return 5;
2672 const Int_t nVarPrompt = 2;
2673 const Int_t nVarFD = 3;
2675 Int_t nbinsPrompt[nVarPrompt]={200,100};
2676 Int_t nbinsFD[nVarFD]={200,100,200};
2678 Double_t xminPrompt[nVarPrompt] = {0.,-1.};
2679 Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
2681 Double_t xminFD[nVarFD] = {0.,-1.,0.};
2682 Double_t xmaxFD[nVarFD] = {40.,1.,40.};
2685 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
2690 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
2691 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
2693 fMCAccBFeed->GetAxis(2)->SetTitle(
"p_{T}^{B} (GeV/c)");
2701 const Int_t nProng = 2;
2702 Double_t zMCVertex = mcHeader->GetVtxZ();
2704 for(
Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
2705 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
2706 if (TMath::Abs(mcPart->GetPdgCode()) == 421){
2711 Bool_t isGoodDecay=kFALSE;
2712 Int_t labDau[4]={-1,-1,-1,-1};
2714 Bool_t isFidAcc = kFALSE;
2717 if(deca > 0) isGoodDecay=kTRUE;
2724 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
2726 if(isGoodDecay && TMath::Abs(zMCVertex) <
fCuts->
GetMaxVtxZ() && isFidAcc && isInAcc) {
2730 Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
2737 Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
2749 for (
Int_t iProng = 0; iProng<nProng; iProng++){
2750 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
2751 if(!mcPartDaughter)
return kFALSE;
2752 Double_t eta = mcPartDaughter->Eta();
2753 Double_t pt = mcPartDaughter->Pt();
2754 if (TMath::Abs(eta) > 0.9 || pt < 0.1)
return kFALSE;
2771 normIP[0]=diffIP[0]/errdiffIP[0];
2772 normIP[1]=diffIP[1]/errdiffIP[1];
2774 AliAODVertex* secvtx=part->GetSecondaryVtx();
2776 Double_t err2decaylength=secvtx->Error2DistanceXYToVertex(primvtx);
2777 Double_t lxy=part->AliAODRecoDecay::DecayLengthXY(primvtx);
2782 Int_t pdgDgD0toKpi[2]={321,211};
2784 lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2787 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(lab);
2789 if(orig==4)signalType=1;
2790 else if(orig==5)signalType=2;
2798 Double_t arrayMC[8]={part->Pt(), ptB,normIP[0], normIP[1], lxy, lxy/TMath::Sqrt(err2decaylength),(
Double_t)isCuts, (
Double_t)isPid};
2801 for(
Int_t i=0; i<8; i++){
2802 pointD0MC[i]=arrayMC[i];
2814 if(!IsSelectedPIDoff)
return;
2818 for(
Int_t i=0;i<9;i++){
2819 pointD0[i]=array[i];
2825 for(
Int_t i=0;i<9;i++){
2826 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