29 #include <Riostream.h>
30 #include <TClonesArray.h>
37 #include <TDatabasePDG.h>
39 #include <AliAnalysisDataSlot.h>
40 #include <AliAnalysisDataContainer.h>
41 #include "AliAnalysisManager.h"
42 #include "AliESDtrack.h"
43 #include "AliVertexerTracks.h"
44 #include "AliAODHandler.h"
45 #include "AliAODEvent.h"
46 #include "AliAODVertex.h"
47 #include "AliAODTrack.h"
48 #include "AliAODMCHeader.h"
49 #include "AliAODMCParticle.h"
53 #include "AliAnalysisTaskSE.h"
82 fIsSelectedCandidate(0),
85 fIsRejectSDDClusters(0),
88 fFillImpParHist(kFALSE),
89 fUseSelectionBit(kTRUE),
90 fWriteVariableTree(kFALSE),
92 fCandidateVariables(),
94 fDrawDetSignal(kFALSE),
104 AliAnalysisTaskSE(name),
117 fLsNormalization(1.),
120 fIsSelectedCandidate(0),
121 fFillVarHists(kTRUE),
123 fIsRejectSDDClusters(0),
126 fFillImpParHist(kFALSE),
127 fUseSelectionBit(kTRUE),
128 fWriteVariableTree(kFALSE),
130 fCandidateVariables(),
132 fDrawDetSignal(kFALSE),
143 DefineOutput(1,TList::Class());
145 DefineOutput(2,TList::Class());
147 DefineOutput(3,TH1F::Class());
149 DefineOutput(4,AliRDHFCutsD0toKpi::Class());
151 DefineOutput(5,AliNormalizationCounter::Class());
153 DefineOutput(6,TList::Class());
155 DefineOutput(7,TTree::Class());
157 DefineOutput(8, TList::Class());
159 DefineOutput(9, TList::Class());
185 for(Int_t i=0; i<5; i++){
212 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::Init() \n");
216 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
217 copyfCuts->SetName(nameoutput);
219 PostData(4,copyfCuts);
231 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass::UserCreateOutputObjects() \n");
248 fDistr->SetName(
"distributionslist");
254 TString nameMass=
" ",nameSgn27=
" ",nameSgn=
" ", nameBkg=
" ", nameRfl=
" ",nameMassNocutsS =
" ",nameMassNocutsB =
" ", namedistr=
" ";
255 TString nameMassPt=
"", nameSgnPt=
"", nameBkgPt=
"", nameRflPt=
"";
256 TString nameMassY=
"", nameSgnY=
"", nameBkgY=
"", nameRflY=
"";
257 Int_t nbins2dPt=60; Float_t binInPt=0., binFinPt=30.;
258 Int_t nbins2dY=60; Float_t binInY=-1.5, binFinY=1.5;
262 nameMass=
"histMass_";
264 nameSgn27=
"histSgn27_";
272 nameMassNocutsS=
"hMassS_";
274 nameMassNocutsB=
"hMassB_";
281 namedistr=
"hNclsD0vsptS_";
283 TH2F *hNclsD0vsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
284 namedistr=
"hNclsD0barvsptS_";
286 TH2F *hNclsD0barvsptS =
new TH2F(namedistr.Data(),
"N cls distrubution [S];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
288 namedistr=
"hNITSpointsD0vsptS_";
290 TH2F *hNITSpointsD0vsptS =
new TH2F(namedistr.Data(),
"N ITS points distrubution [S];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
292 namedistr=
"hNSPDpointsD0S_";
294 TH1I *hNSPDpointsD0S =
new TH1I(namedistr.Data(),
"N SPD points distrubution [S]; ;N tracks",4,0,4);
295 hNSPDpointsD0S->GetXaxis()->SetBinLabel(1,
"no SPD");
296 hNSPDpointsD0S->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
297 hNSPDpointsD0S->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
298 hNSPDpointsD0S->GetXaxis()->SetBinLabel(4,
"kBoth");
302 TH1F *hptD0S =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
303 namedistr=
"hptD0barS_";
305 TH1F *hptD0barS =
new TH1F(namedistr.Data(),
"p_{T} distribution [S];p_{T} [GeV/c]",200,0.,20.);
307 namedistr=
"hphiD0S_";
309 TH1F *hphiD0S =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
310 namedistr=
"hphiD0barS_";
312 TH1F *hphiD0barS =
new TH1F(namedistr.Data(),
"#phi distribution [S];#phi [rad]",100,0.,2*TMath::Pi());
315 namedistr=
"hetaphiD0candidateS_";
317 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());
318 namedistr=
"hetaphiD0barcandidateS_";
320 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());
322 namedistr=
"hetaphiD0candidatesignalregionS_";
324 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());
325 namedistr=
"hetaphiD0barcandidatesignalregionS_";
327 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());
332 TH1F *hdcaS =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
336 TH1F *hd0piS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions);d0(#pi) [cm]",200,-0.1,0.1);
340 TH1F *hd0KS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons);d0(K) [cm]",200,-0.1,0.1);
343 TH1F *hd0d0S =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
348 TH1F *hdeclengthS =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm]",200,0,0.015);
350 namedistr=
"hnormdeclS_";
352 TH1F *hnormdeclengthS =
new TH1F(namedistr.Data(),
"Normalized Decay Length^{2} distribution;(Decay Length/Err)^{2} ",200,0,12.);
354 namedistr=
"hdeclxyS_";
356 TH1F* hdeclxyS=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
357 namedistr=
"hnormdeclxyS_";
359 TH1F* hnormdeclxyS=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
361 namedistr=
"hdeclxyd0d0S_";
363 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);
365 namedistr=
"hnormdeclxyd0d0S_";
367 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);
370 namedistr=
"hcosthetapointS_";
372 TH1F *hcosthetapointS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
374 namedistr=
"hcosthetapointxyS_";
376 TH1F *hcosthetapointxyS =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XYdistribution;cos#theta_{Point}",300,0.,1.);
378 TH1F* tmpMS =
new TH1F(nameMassNocutsS.Data(),
"D^{0} invariant mass; M [GeV]; Entries",300,1.5648,2.1648);
381 fDistr->Add(hNclsD0vsptS);
382 fDistr->Add(hNclsD0barvsptS);
383 fDistr->Add(hNITSpointsD0vsptS);
384 fDistr->Add(hNSPDpointsD0S);
389 fDistr->Add(hetaphiD0candidateS);
390 fDistr->Add(hetaphiD0candidatesignalregionS);
391 fDistr->Add(hetaphiD0barcandidateS);
392 fDistr->Add(hetaphiD0barcandidatesignalregionS);
401 fDistr->Add(hcosthetapointS);
403 fDistr->Add(hcosthetapointxyS);
407 fDistr->Add(hnormdeclengthS);
411 fDistr->Add(hnormdeclxyS);
413 fDistr->Add(hdeclxyd0d0S);
414 fDistr->Add(hnormdeclxyd0d0S);
422 namedistr=
"hNclsD0vsptB_";
424 TH2F *hNclsD0vsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
425 namedistr=
"hNclsD0barvsptB_";
427 TH2F *hNclsD0barvsptB =
new TH2F(namedistr.Data(),
"N cls distrubution [B];p_{T} [GeV/c];N cls",200,0.,20.,100,0.,200.);
429 namedistr=
"hNITSpointsD0vsptB_";
431 TH2F *hNITSpointsD0vsptB =
new TH2F(namedistr.Data(),
"N ITS points distrubution [B];p_{T} [GeV/c];N points",200,0.,20.,7,0.,7.);
433 namedistr=
"hNSPDpointsD0B_";
435 TH1I *hNSPDpointsD0B =
new TH1I(namedistr.Data(),
"N SPD points distrubution [B]; ;N tracks",4,0,4);
436 hNSPDpointsD0B->GetXaxis()->SetBinLabel(1,
"no SPD");
437 hNSPDpointsD0B->GetXaxis()->SetBinLabel(2,
"kOnlyFirst");
438 hNSPDpointsD0B->GetXaxis()->SetBinLabel(3,
"kOnlySecond");
439 hNSPDpointsD0B->GetXaxis()->SetBinLabel(4,
"kBoth");
443 TH1F *hptD0B =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
444 namedistr=
"hptD0barB_";
446 TH1F *hptD0barB =
new TH1F(namedistr.Data(),
"p_{T} distribution [B];p_{T} [GeV/c]",200,0.,20.);
448 namedistr=
"hphiD0B_";
450 TH1F *hphiD0B =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
451 namedistr=
"hphiD0barB_";
453 TH1F *hphiD0barB =
new TH1F(namedistr.Data(),
"#phi distribution [B];#phi [rad]",100,0.,2*TMath::Pi());
455 namedistr=
"hetaphiD0candidateB_";
457 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());
458 namedistr=
"hetaphiD0barcandidateB_";
460 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());
462 namedistr=
"hetaphiD0candidatesignalregionB_";
464 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());
465 namedistr=
"hetaphiD0barcandidatesignalregionB_";
467 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());
472 TH1F *hdcaB =
new TH1F(namedistr.Data(),
"DCA distribution;dca [cm]",200,0.,0.1);
477 TH1F *hd0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
481 TH1F *hd0d0B =
new TH1F(namedistr.Data(),
"d_{0}#timesd_{0} distribution;d_{0}#timesd_{0} [cm^{2}]",200,-0.001,0.001);
486 TH1F *hdeclengthB =
new TH1F(namedistr.Data(),
"Decay Length^{2} distribution;Decay Length^{2} [cm^{2}]",200,0,0.015);
488 namedistr=
"hnormdeclB_";
490 TH1F *hnormdeclengthB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution;(Decay Length/Err)^{2} ",200,0,12.);
492 namedistr=
"hdeclxyB_";
494 TH1F* hdeclxyB=
new TH1F(namedistr.Data(),
"Decay Length XY distribution;Decay Length XY [cm]",200,0,0.15);
495 namedistr=
"hnormdeclxyB_";
497 TH1F* hnormdeclxyB=
new TH1F(namedistr.Data(),
"Normalized decay Length XY distribution;Decay Length XY/Err",200,0,6.);
499 namedistr=
"hdeclxyd0d0B_";
501 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);
503 namedistr=
"hnormdeclxyd0d0B_";
505 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);
508 namedistr=
"hcosthetapointB_";
510 TH1F *hcosthetapointB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
512 namedistr=
"hcosthetapointxyB_";
514 TH1F *hcosthetapointxyB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} XY distribution;cos#theta_{Point} XY",300,0.,1.);
516 TH1F* tmpMB =
new TH1F(nameMassNocutsB.Data(),
"D^{0} invariant mass; M [GeV]; Entries",300,1.5648,2.1648);
520 fDistr->Add(hNclsD0vsptB);
521 fDistr->Add(hNclsD0barvsptB);
522 fDistr->Add(hNITSpointsD0vsptB);
523 fDistr->Add(hNSPDpointsD0B);
528 fDistr->Add(hetaphiD0candidateB);
529 fDistr->Add(hetaphiD0candidatesignalregionB);
530 fDistr->Add(hetaphiD0barcandidateB);
531 fDistr->Add(hetaphiD0barcandidatesignalregionB);
539 fDistr->Add(hcosthetapointB);
541 fDistr->Add(hcosthetapointxyB);
545 fDistr->Add(hnormdeclengthB);
549 fDistr->Add(hnormdeclxyB);
551 fDistr->Add(hdeclxyd0d0B);
552 fDistr->Add(hnormdeclxyd0d0B);
560 namedistr=
"hd0vpiS_";
562 TH1F *hd0vpiS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (pions)(vtx w/o these tracks);d0(#pi) [cm]",200,-0.1,0.1);
566 TH1F *hd0vKS =
new TH1F(namedistr.Data(),
"Impact parameter distribution (kaons) (vtx w/o these tracks);d0(K) [cm]",200,-0.1,0.1);
568 namedistr=
"hd0d0vS_";
570 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);
572 namedistr=
"hdeclvS_";
574 TH1F *hdeclengthvS =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
576 namedistr=
"hnormdeclvS_";
578 TH1F *hnormdeclengthvS =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
583 fDistr->Add(hdeclengthvS);
584 fDistr->Add(hnormdeclengthvS);
588 namedistr=
"hd0vmoresB_";
590 TH1F *hd0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
592 namedistr=
"hd0d0vmoresB_";
594 TH1F *hd0d0vmoresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
599 TH1F *hd0vB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
601 namedistr=
"hd0vp0B_";
603 TH1F *hd0vp0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong + ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
605 namedistr=
"hd0vp1B_";
607 TH1F *hd0vp1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong - ** vtx w/o these tracks);d0 [cm]",200,-0.1,0.1);
609 namedistr=
"hd0d0vB_";
611 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);
613 namedistr=
"hdeclvB_";
615 TH1F *hdeclengthvB =
new TH1F(namedistr.Data(),
"Decay Length distribution (vtx w/o tracks);Decay Length [cm]",200,0,0.6);
617 namedistr=
"hnormdeclvB_";
619 TH1F *hnormdeclengthvB =
new TH1F(namedistr.Data(),
"Normalized Decay Length distribution (vtx w/o tracks);Decay Length/Err ",200,0,10.);
627 fDistr->Add(hd0d0vmoresB);
629 fDistr->Add(hdeclengthvB);
631 fDistr->Add(hnormdeclengthvB);
641 TH1F* tmpSt =
new TH1F(nameSgn.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries",600,1.5648,2.1648);
643 TH1F *tmpSl=(TH1F*)tmpSt->Clone();
648 TH1F* tmpRt =
new TH1F(nameRfl.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries",600,1.5648,2.1648);
650 TH1F* tmpBt =
new TH1F(nameBkg.Data(),
"Background invariant mass - MC; M [GeV]; Entries",600,1.5648,2.1648);
664 TH1F* tmpMt =
new TH1F(nameMass.Data(),
"D^{0} invariant mass; M [GeV]; Entries",600,1.5648,2.1648);
680 TH1F *hptpiS =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
684 TH1F *hptKS =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
687 namedistr=
"hcosthetastarS_";
689 TH1F *hcosthetastarS =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
693 namedistr=
"hptpiSnoMcut_";
695 TH1F *hptpiSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (pions);p_{T} [GeV/c]",200,0.,8.);
697 namedistr=
"hptKSnoMcut_";
699 TH1F *hptKSnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution (kaons);p_{T} [GeV/c]",200,0.,8.);
703 fDistr->Add(hcosthetastarS);
705 fDistr->Add(hptpiSnoMcut);
709 namedistr=
"hcosthpointd0S_";
711 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);
712 namedistr=
"hcosthpointd0d0S_";
714 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);
716 fDistr->Add(hcosthpointd0S);
717 fDistr->Add(hcosthpointd0d0S);
720 TH1F* tmpS27t =
new TH1F(nameSgn27.Data(),
"D^{0} invariant mass in M(D^{0}) +/- 27 MeV - MC; M [GeV]; Entries",600,1.5648,2.1648);
721 TH1F *tmpS27l=(TH1F*)tmpS27t->Clone();
733 TH1F *hptB =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
736 namedistr=
"hcosthetastarB_";
738 TH1F *hcosthetastarB =
new TH1F(namedistr.Data(),
"cos#theta* distribution;cos#theta*",200,-1.,1.);
741 namedistr=
"hptB1prongnoMcut_";
743 TH1F *hptB1pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
745 namedistr=
"hptB2prongsnoMcut_";
747 TH1F *hptB2pnoMcut =
new TH1F(namedistr.Data(),
"P_{T} distribution;p_{T} [GeV/c]",200,0.,8.);
750 fDistr->Add(hcosthetastarB);
752 fDistr->Add(hptB1pnoMcut);
753 fDistr->Add(hptB2pnoMcut);
758 TH1F *hd0p0B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.1,0.1);
762 TH1F *hd0p1B =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong -);d0 [cm]",200,-0.1,0.1);
765 namedistr=
"hd0moresB_";
767 TH1F *hd0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (both);d0 [cm]",200,-0.1,0.1);
769 namedistr=
"hd0d0moresB_";
771 TH1F *hd0d0moresB =
new TH1F(namedistr.Data(),
"Impact parameter distribution (prong +);d0 [cm]",200,-0.001,0.001);
774 namedistr=
"hcosthetapointmoresB_";
776 TH1F *hcosthetapointmoresB =
new TH1F(namedistr.Data(),
"cos#theta_{Point} distribution;cos#theta_{Point}",200,0,1.);
779 namedistr=
"hcosthpointd0B_";
781 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);
783 namedistr=
"hcosthpointd0d0B_";
785 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);
792 fDistr->Add(hcosthetapointmoresB);
795 fDistr->Add(hcosthpointd0B);
798 fDistr->Add(hcosthpointd0d0B);
808 namedistr=
"hpospair";
810 namedistr=
"hnegpair";
820 nameMassPt=
"histMassPt";
821 nameSgnPt=
"histSgnPt";
822 nameBkgPt=
"histBkgPt";
823 nameRflPt=
"histRflPt";
827 TH2F* tmpStPt =
new TH2F(nameSgnPt.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.5648,2.16484,nbins2dPt,binInPt,binFinPt);
828 TH2F *tmpSlPt=(TH2F*)tmpStPt->Clone();
833 TH2F* tmpRtPt =
new TH2F(nameRflPt.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.5648,2.1648,nbins2dPt,binInPt,binFinPt);
834 TH2F* tmpBtPt =
new TH2F(nameBkgPt.Data(),
"Background invariant mass - MC; M [GeV]; Entries; Pt[GeV/c]",600,1.5648,2.1648,nbins2dPt,binInPt,binFinPt);
848 TH2F* tmpMtPt =
new TH2F(nameMassPt.Data(),
"D^{0} invariant mass; M [GeV]; Entries; Pt[GeV/c]",600,1.5648,2.1648,nbins2dPt,binInPt,binFinPt);
860 nameMassY=
"histMassY_";
862 nameSgnY=
"histSgnY_";
864 nameBkgY=
"histBkgY_";
866 nameRflY=
"histRflY_";
870 TH2F* tmpStY =
new TH2F(nameSgnY.Data(),
"D^{0} invariant mass - MC; M [GeV]; Entries; y",600,1.5648,2.16484,nbins2dY,binInY,binFinY);
873 TH2F* tmpRtY =
new TH2F(nameRflY.Data(),
"Reflected signal invariant mass - MC; M [GeV]; Entries; y",600,1.5648,2.1648,nbins2dY,binInY,binFinY);
874 TH2F* tmpBtY =
new TH2F(nameBkgY.Data(),
"Background invariant mass - MC; M [GeV]; Entries; y",600,1.5648,2.1648,nbins2dY,binInY,binFinY);
882 TH2F* tmpMtY =
new TH2F(nameMassY.Data(),
"D^{0} invariant mass; M [GeV]; Entries; y",600,1.5648,2.1648,nbins2dY,binInY,binFinY);
889 const char* nameoutput=GetOutputSlot(3)->GetContainer()->GetName();
891 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", 19,-0.5,18.5);
893 fNentries->GetXaxis()->SetBinLabel(1,
"nEventsAnal");
894 fNentries->GetXaxis()->SetBinLabel(2,
"nCandSel(Cuts)");
896 else fNentries->GetXaxis()->SetBinLabel(3,
"Dstar<-D0");
897 fNentries->GetXaxis()->SetBinLabel(4,
"nEventsGoodVtxS");
898 fNentries->GetXaxis()->SetBinLabel(5,
"ptbin = -1");
899 fNentries->GetXaxis()->SetBinLabel(6,
"no daughter");
900 if(
fSys==0)
fNentries->GetXaxis()->SetBinLabel(7,
"nCandSel(Tr)");
902 fNentries->GetXaxis()->SetBinLabel(8,
"PID=0");
903 fNentries->GetXaxis()->SetBinLabel(9,
"PID=1");
904 fNentries->GetXaxis()->SetBinLabel(10,
"PID=2");
905 fNentries->GetXaxis()->SetBinLabel(11,
"PID=3");
908 fNentries->GetXaxis()->SetBinLabel(12,
"K");
909 fNentries->GetXaxis()->SetBinLabel(13,
"Lambda");
911 fNentries->GetXaxis()->SetBinLabel(14,
"Pile-up Rej");
912 fNentries->GetXaxis()->SetBinLabel(15,
"N. of 0SMH");
913 if(
fSys==1)
fNentries->GetXaxis()->SetBinLabel(16,
"Nev in centr");
915 fNentries->GetXaxis()->SetBinLabel(18,
"Phys.Sel.Rej");
916 fNentries->GetXaxis()->SetBinLabel(19,
"D0 failed to be filled");
917 fNentries->GetXaxis()->SetNdivisions(1,kFALSE);
925 nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
926 fVariablesTree =
new TTree(nameoutput,
"Candidates variables tree");
929 TString * fCandidateVariableNames =
new TString[nVar];
930 fCandidateVariableNames[0] =
"massD0";
931 fCandidateVariableNames[1] =
"massD0bar";
932 fCandidateVariableNames[2] =
"pt";
933 fCandidateVariableNames[3] =
"dca";
934 fCandidateVariableNames[4] =
"costhsD0";
935 fCandidateVariableNames[5] =
"costhsD0bar";
936 fCandidateVariableNames[6] =
"ptk";
937 fCandidateVariableNames[7] =
"ptpi";
938 fCandidateVariableNames[8] =
"d0k";
939 fCandidateVariableNames[9] =
"d0pi";
940 fCandidateVariableNames[10] =
"d0xd0";
941 fCandidateVariableNames[11] =
"costhp";
942 fCandidateVariableNames[12] =
"costhpxy";
943 fCandidateVariableNames[13] =
"lxy";
944 fCandidateVariableNames[14] =
"specialcuts";
945 for(Int_t ivar=0; ivar<nVar; ivar++){
953 TH2F *TOFSigBefPID =
new TH2F(
"TOFSigBefPID",
"TOF signal of daughters before PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
954 TH2F *TOFSigAftPID =
new TH2F(
"TOFSigAftPID",
"TOF signal after PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
956 TH2F *TPCSigBefPID =
new TH2F(
"TPCSigBefPID",
"TPC dE/dx before PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
957 TH2F *TPCSigAftPID =
new TH2F(
"TPCSigAftPID",
"TPC dE/dx after PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
995 AliAODEvent *aod =
dynamic_cast<AliAODEvent*
> (InputEvent());
1004 bname=
"LikeSign2Prong";
1006 TClonesArray *inputArray=0;
1007 if(!aod && AODEvent() && IsStandardAOD()) {
1010 aod =
dynamic_cast<AliAODEvent*
> (AODEvent());
1013 AliAODHandler* aodHandler = (AliAODHandler*)
1014 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1016 if(aodHandler->GetExtensions()) {
1017 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
1018 AliAODEvent* aodFromExt = ext->GetAOD();
1019 inputArray=(TClonesArray*)aodFromExt->GetList()->FindObject(bname.Data());
1022 inputArray=(TClonesArray*)aod->GetList()->FindObject(bname.Data());
1025 if(!inputArray || !aod) {
1026 printf(
"AliAnalysisTaskSED0Mass::UserExec: input branch not found!\n");
1031 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001)
return;
1034 TClonesArray *mcArray = 0;
1035 AliAODMCHeader *mcHeader = 0;
1039 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1041 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC particles branch not found!\n");
1046 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1048 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC header branch not found!\n");
1061 TString trigclass=aod->GetFiredTriggerClasses();
1062 if(trigclass.Contains(
"C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains(
"C0SMH-B-NOPF-ALL"))
fNentries->Fill(14);
1074 Bool_t skipEvent = kFALSE;
1076 if (aod) ntracks = aod->GetNumberOfTracks();
1077 for(Int_t itrack=0; itrack<ntracks; itrack++) {
1079 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1080 if(!track) AliFatal(
"Not a standard AOD");
1081 if(TESTBIT(track->GetITSClusterMap(),2) || TESTBIT(track->GetITSClusterMap(),3) ){
1087 if (skipEvent)
return;
1091 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1093 Bool_t isGoodVtx=kFALSE;
1096 TString primTitle = vtx1->GetTitle();
1097 if(primTitle.Contains(
"VertexerTracks") && vtx1->GetNContributors()>0) {
1103 Int_t nInD0toKpi = inputArray->GetEntriesFast();
1104 if(fDebug>2) printf(
"Number of D0->Kpi: %d\n",nInD0toKpi);
1108 Int_t nSelectedloose=0,nSelectedtight=0;
1115 for (Int_t iD0toKpi = 0; iD0toKpi < nInD0toKpi; iD0toKpi++) {
1135 if(ptbin==-1) {
fNentries->Fill(4);
continue;}
1143 AliDebug(1,
"at least one daughter not found!");
1158 Int_t isSelectedPIDfill = 3;
1161 if (isSelectedPIDfill == 0)
fNentries->Fill(7);
1162 if (isSelectedPIDfill == 1)
fNentries->Fill(8);
1163 if (isSelectedPIDfill == 2)
fNentries->Fill(9);
1164 if (isSelectedPIDfill == 3)
fNentries->Fill(10);
1196 AliESDtrack *esdtrack1 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1197 AliESDtrack *esdtrack2 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1201 Int_t isSelectedPIDfill = 3;
1206 ((TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1207 ((TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1208 ((TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1209 ((TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1211 if (isSelectedPIDfill != 0) {
1212 ((TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1213 ((TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1214 ((TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1215 ((TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1232 Int_t pdgDgD0toKpi[2]={321,211};
1234 if(
fReadMC) lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
1236 Int_t isSelectedPID=3;
1239 if (isSelectedPID==0)
fNentries->Fill(7);
1240 if (isSelectedPID==1)
fNentries->Fill(8);
1241 if (isSelectedPID==2)
fNentries->Fill(9);
1242 if (isSelectedPID==3)
fNentries->Fill(10);
1253 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1262 Double_t invmasscut=0.03;
1264 TString fillthispi=
"",fillthisK=
"",fillthis=
"", fillthispt=
"", fillthisetaphi=
"";
1266 Int_t ptbin=cuts->
PtBin(part->Pt());
1267 Double_t pt = part->Pt();
1269 Double_t dz1[2],dz2[2],covar1[3],covar2[3];
1270 dz1[0]=-99; dz2[0]=-99;
1272 Double_t decl[2]={-99,-99};
1273 Bool_t recalcvtx=kFALSE;
1280 AliAODVertex *vtxProp=0x0;
1286 AliESDtrack *esdtrack1=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1287 AliESDtrack *esdtrack2=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1288 esdtrack1->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz1,covar1);
1289 esdtrack2->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz2,covar2);
1290 delete vtxProp; vtxProp=NULL;
1304 Double_t cosThetaStarD0 = 99;
1305 Double_t cosThetaStarD0bar = 99;
1306 Double_t cosPointingAngle = 99;
1307 Double_t normalizedDecayLength2 = -1, normalizedDecayLengthxy=-1;
1308 Double_t decayLength2 = -1, decayLengthxy=-1;
1309 Double_t ptProng[2]={-99,-99};
1310 Double_t d0Prong[2]={-99,-99};
1311 Double_t etaD = 99.;
1312 Double_t phiD = 99.;
1323 if(!prong0 || !prong1) {
1328 labprong[0]=prong0->GetLabel();
1329 labprong[1]=prong1->GetLabel();
1331 AliAODMCParticle *mcprong=0;
1332 Int_t pdgProng[2]={0,0};
1334 for (Int_t iprong=0;iprong<2;iprong++){
1335 if(
fReadMC && labprong[iprong]>=0) {
1336 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1337 pdgProng[iprong]=mcprong->GetPdgCode();
1344 fillthispi=
"hptpiSnoMcut_";
1347 fillthisK=
"hptKSnoMcut_";
1350 if ((TMath::Abs(pdgProng[0]) == 211 && TMath::Abs(pdgProng[1]) == 321)
1351 || (isSelectedPID==1 || isSelectedPID==3)){
1352 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong0->Pt());
1353 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong1->Pt());
1356 if ((TMath::Abs(pdgProng[0]) == 321 && TMath::Abs(pdgProng[1]) == 211)
1357 || (isSelectedPID==2 || isSelectedPID==3)){
1358 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong0->Pt());
1359 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong1->Pt());
1371 fillthispt=
"histSgnPt";
1373 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)
1374 || (!
fReadMC && (isSelectedPID==1 || isSelectedPID==3))){
1375 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1378 fillthisetaphi=
"hetaphiD0candidateS_";
1379 fillthisetaphi+=ptbin;
1380 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1382 if(TMath::Abs(minvD0-mPDG)<0.05){
1383 fillthisetaphi=
"hetaphiD0candidatesignalregionS_";
1384 fillthisetaphi+=ptbin;
1385 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1391 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1394 fillthisetaphi=
"hetaphiD0barcandidateS_";
1395 fillthisetaphi+=ptbin;
1396 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1398 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1399 fillthisetaphi=
"hetaphiD0barcandidatesignalregionS_";
1400 fillthisetaphi+=ptbin;
1401 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1408 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1418 ptProng[0]=prong0->Pt(); ptProng[1]=prong1->Pt();
1419 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1421 if(
fArray==1) cout<<
"LS signal: ERROR"<<endl;
1422 for (Int_t iprong=0; iprong<2; iprong++){
1424 if (
fReadMC) labprong[iprong]=prong->GetLabel();
1428 if(
fReadMC && labprong[iprong]>=0) {
1429 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1430 pdgprong=mcprong->GetPdgCode();
1433 Bool_t isPionHere[2]={(isSelectedPID==1 || isSelectedPID==3) ? kTRUE : kFALSE,(isSelectedPID==2 || isSelectedPID==3) ? kTRUE : kFALSE};
1435 if(TMath::Abs(pdgprong)==211 || isPionHere[iprong]) {
1439 fillthispi=
"hptpiS_";
1441 ((TH1F*)listout->FindObject(fillthispi))->Fill(ptProng[iprong]);
1444 fillthispi=
"hd0piS_";
1446 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0Prong[iprong]);
1449 fillthispi=
"hd0vpiS_";
1451 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0[iprong]);
1456 if(TMath::Abs(pdgprong)==321 || !isPionHere[iprong]) {
1461 ((TH1F*)listout->FindObject(fillthisK))->Fill(ptProng[iprong]);
1467 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0Prong[iprong]);
1469 fillthisK=
"hd0vKS_";
1471 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0[iprong]);
1476 fillthis=
"hcosthpointd0S_";
1478 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[iprong]);
1484 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1486 fillthis=
"hcosthetapointS_";
1488 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1490 fillthis=
"hcosthetapointxyS_";
1497 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0());
1501 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1503 fillthis=
"hnormdeclS_";
1505 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1507 fillthis=
"hdeclxyS_";
1509 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1511 fillthis=
"hnormdeclxyS_";
1513 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1515 fillthis=
"hdeclxyd0d0S_";
1517 ((TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1519 fillthis=
"hnormdeclxyd0d0S_";
1521 ((TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1524 fillthis=
"hdeclvS_";
1526 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1528 fillthis=
"hnormdeclvS_";
1530 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1532 fillthis=
"hd0d0vS_";
1534 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1538 fillthis=
"hcosthetastarS_";
1540 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)) ((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1542 if (
fReadMC || isSelectedPID>1)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar);
1543 if(isSelectedPID==1 || isSelectedPID==3)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1546 fillthis=
"hcosthpointd0d0S_";
1548 ((TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1551 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)){
1552 for(Int_t it=0; it<2; it++){
1555 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1556 fillthis=
"hphiD0S_";
1558 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1559 Int_t nPointsITS = 0;
1560 for (Int_t il=0; il<6; il++){
1561 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1563 fillthis=
"hNITSpointsD0vsptS_";
1565 ((TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(),nPointsITS);
1566 fillthis=
"hNSPDpointsD0S_";
1568 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1569 ((TH1I*)listout->FindObject(fillthis))->Fill(0);
1571 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1572 ((TH1I*)listout->FindObject(fillthis))->Fill(1);
1574 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1575 ((TH1I*)listout->FindObject(fillthis))->Fill(2);
1577 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1578 ((TH1I*)listout->FindObject(fillthis))->Fill(3);
1580 fillthis=
"hNclsD0vsptS_";
1583 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->GetTPCNcls();
1584 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1588 if (
fReadMC || isSelectedPID>1){
1589 for(Int_t it=0; it<2; it++){
1590 fillthis=
"hptD0barS_";
1592 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1593 fillthis=
"hphiD0barS_";
1595 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1596 fillthis=
"hNclsD0barvsptS_";
1599 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->GetTPCNcls();
1600 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1603 if(isSelectedPID==1 || isSelectedPID==3){
1604 for(Int_t it=0; it<2; it++){
1607 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1608 fillthis=
"hphiD0S_";
1610 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1611 Int_t nPointsITS = 0;
1612 for (Int_t il=0; il<6; il++){
1613 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1615 fillthis=
"hNITSpointsD0vsptS_";
1617 ((TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1618 fillthis=
"hNSPDpointsD0S_";
1620 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1621 ((TH1I*)listout->FindObject(fillthis))->Fill(0);
1623 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1624 ((TH1I*)listout->FindObject(fillthis))->Fill(1);
1626 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1627 ((TH1I*)listout->FindObject(fillthis))->Fill(2);
1629 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1630 ((TH1I*)listout->FindObject(fillthis))->Fill(3);
1632 fillthis=
"hNclsD0vsptS_";
1635 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->GetTPCNcls();
1636 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1654 fillthispt=
"histBkgPt";
1657 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1660 fillthisetaphi=
"hetaphiD0candidateB_";
1661 fillthisetaphi+=ptbin;
1662 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1664 if(TMath::Abs(minvD0-mPDG)<0.05){
1665 fillthisetaphi=
"hetaphiD0candidatesignalregionB_";
1666 fillthisetaphi+=ptbin;
1667 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1671 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1674 fillthisetaphi=
"hetaphiD0barcandidateB_";
1675 fillthisetaphi+=ptbin;
1676 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1678 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1679 fillthisetaphi=
"hetaphiD0barcandidatesignalregionB_";
1680 fillthisetaphi+=ptbin;
1681 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1686 fillthis=
"hptB1prongnoMcut_";
1689 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1691 fillthis=
"hptB2prongsnoMcut_";
1693 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1694 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1699 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1711 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1716 if(fDebug>2) cout<<
"No daughter found";
1721 if(prongg->Charge()==1) {
1723 ((TH1F*)
fOutputMass->FindObject(
"hpospair"))->Fill(ptbin);
1726 ((TH1F*)
fOutputMass->FindObject(
"hnegpair"))->Fill(ptbin);
1734 for(Int_t it=0; it<2; it++){
1737 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1738 fillthis=
"hphiD0B_";
1740 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1742 Int_t nPointsITS = 0;
1743 for (Int_t il=0; il<6; il++){
1744 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1746 fillthis=
"hNITSpointsD0vsptB_";
1748 ((TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1749 fillthis=
"hNSPDpointsD0B_";
1751 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1752 ((TH1I*)listout->FindObject(fillthis))->Fill(0);
1754 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1755 ((TH1I*)listout->FindObject(fillthis))->Fill(1);
1757 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1758 ((TH1I*)listout->FindObject(fillthis))->Fill(2);
1760 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1761 ((TH1I*)listout->FindObject(fillthis))->Fill(3);
1763 fillthis=
"hNclsD0vsptB_";
1766 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->GetTPCNcls();
1767 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1774 for(Int_t it=0; it<2; it++){
1775 fillthis=
"hptD0barB_";
1777 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1778 fillthis=
"hphiD0barB_";
1780 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1781 fillthis=
"hNclsD0barvsptB_";
1784 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->GetTPCNcls();
1785 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1791 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1792 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1795 Int_t pdgMother[2]={0,0};
1796 Double_t factor[2]={1,1};
1798 for(Int_t iprong=0;iprong<2;iprong++){
1800 lab=prong->GetLabel();
1802 AliAODMCParticle* mcprong=(AliAODMCParticle*)arrMC->At(lab);
1804 Int_t labmom=mcprong->GetMother();
1806 AliAODMCParticle* mcmother=(AliAODMCParticle*)arrMC->At(labmom);
1807 if(mcmother) pdgMother[iprong]=mcmother->GetPdgCode();
1814 fillthis=
"hd0moresB_";
1817 if(TMath::Abs(pdgMother[iprong])==310 || TMath::Abs(pdgMother[iprong])==130 || TMath::Abs(pdgMother[iprong])==321){
1818 if(ptProng[iprong]<=1)factor[iprong]=1./.7;
1819 else factor[iprong]=1./.6;
1823 if(TMath::Abs(pdgMother[iprong])==3122) {
1824 factor[iprong]=1./0.25;
1827 fillthis=
"hd0moresB_";
1830 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[iprong],factor[iprong]);
1833 fillthis=
"hd0vmoresB_";
1835 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[iprong],factor[iprong]);
1841 fillthis=
"hd0d0moresB_";
1843 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0(),factor[0]*factor[1]);
1845 fillthis=
"hcosthetapointmoresB_";
1847 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,factor[0]*factor[1]);
1850 fillthis=
"hd0d0vmoresB_";
1852 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1],factor[0]*factor[1]);
1861 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[0]);
1862 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[1]);
1864 fillthis=
"hcosthetastarB_";
1872 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1875 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1877 fillthis=
"hcosthpointd0d0B_";
1879 ((TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1881 fillthis=
"hcosthpointd0B_";
1883 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[0]);
1884 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[1]);
1889 fillthis=
"hd0vp0B_";
1891 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
1892 fillthis=
"hd0vp1B_";
1894 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
1898 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
1899 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
1907 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1911 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]*d0Prong[1]);
1914 fillthis=
"hd0d0vB_";
1916 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1919 fillthis=
"hcosthetapointB_";
1921 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1923 fillthis=
"hcosthetapointxyB_";
1929 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1931 fillthis=
"hnormdeclB_";
1933 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1935 fillthis=
"hdeclxyB_";
1937 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1939 fillthis=
"hnormdeclxyB_";
1941 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1943 fillthis=
"hdeclxyd0d0B_";
1945 ((TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1947 fillthis=
"hnormdeclxyd0d0B_";
1949 ((TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1954 fillthis=
"hdeclvB_";
1956 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1958 fillthis=
"hnormdeclvB_";
1960 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1977 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1988 Double_t ctsD0=0. ,ctsD0bar=0.; part->
CosThetaStarD0(ctsD0,ctsD0bar);
2011 if(fDebug>2) cout<<
"Candidate selected"<<endl;
2015 Int_t ptbin=cuts->
PtBin(part->Pt());
2016 Double_t pt = part->Pt();
2017 Double_t y = part->
YD0();
2019 Double_t impparXY=part->
ImpParXY()*10000.;
2020 Double_t trueImpParXY=0.;
2021 Double_t arrayForSparse[3]={invmassD0,pt,impparXY};
2022 Double_t arrayForSparseTrue[3]={invmassD0,pt,trueImpParXY};
2051 TString fillthis=
"", fillthispt=
"", fillthismasspt=
"", fillthismassy=
"";
2052 Int_t pdgDgD0toKpi[2]={321,211};
2054 Bool_t isPrimary=kTRUE;
2055 if (
fReadMC) labD0 = part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2060 Double_t weigD0bar=1.;
2064 if (weigD0 > 1.0 || weigD0 < 0.) {weigD0 = 0.;}
2065 if (weigD0bar > 1.0 || weigD0bar < 0.) {weigD0bar = 0.;}
2075 arrayForSparse[0]=invmassD0; arrayForSparse[2]=impparXY;
2079 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2081 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2082 Int_t pdgD0 = partD0->GetPdgCode();
2085 if(
CheckOrigin(arrMC,partD0)==5) isPrimary=kFALSE;
2088 arrayForSparseTrue[0]=invmassD0; arrayForSparseTrue[2]=trueImpParXY;
2092 fillthis=
"histSgn_";
2094 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2097 fillthismasspt=
"histSgnPt";
2098 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2109 fillthismassy=
"histSgnY_";
2110 fillthismassy+=ptbin;
2111 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2116 fillthis=
"histSgn27_";
2118 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2122 fillthis=
"histRfl_";
2124 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2127 fillthismasspt=
"histRflPt";
2129 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2133 fillthismassy=
"histRflY_";
2134 fillthismassy+=ptbin;
2136 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2141 fillthis=
"histBkg_";
2143 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2146 fillthismasspt=
"histBkgPt";
2148 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2153 fillthismassy=
"histBkgY_";
2154 fillthismassy+=ptbin;
2156 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2162 fillthis=
"histMass_";
2167 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2171 fillthismasspt=
"histMassPt";
2173 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2181 fillthismassy=
"histMassY_";
2182 fillthismassy+=ptbin;
2184 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2192 arrayForSparse[0]=invmassD0bar; arrayForSparse[2]=impparXY;
2196 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2197 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2198 Int_t pdgD0 = partD0->GetPdgCode();
2201 if(
CheckOrigin(arrMC,partD0)==5) isPrimary=kFALSE;
2204 arrayForSparseTrue[0]=invmassD0bar; arrayForSparseTrue[2]=trueImpParXY;
2207 fillthis=
"histSgn_";
2209 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2217 fillthismasspt=
"histSgnPt";
2219 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2231 fillthismassy=
"histSgnY_";
2232 fillthismassy+=ptbin;
2234 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2238 fillthis=
"histRfl_";
2240 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2242 fillthismasspt=
"histRflPt";
2244 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2247 fillthismassy=
"histRflY_";
2248 fillthismassy+=ptbin;
2250 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2254 fillthis=
"histBkg_";
2256 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2259 fillthismasspt=
"histBkgPt";
2261 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2265 fillthismassy=
"histBkgY_";
2266 fillthismassy+=ptbin;
2268 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2272 fillthis=
"histMass_";
2276 ((TH1F*)listout->FindObject(fillthis))->Fill(invmassD0bar,weigD0bar);
2280 fillthismasspt=
"histMassPt";
2282 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2286 fillthismassy=
"histMassY_";
2287 fillthismassy+=ptbin;
2289 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2302 Int_t nTrksToSkip=2;
2305 AliDebug(2,
"no daughter found!");
2308 skipped[0]=dgTrack->GetID();
2311 AliDebug(2,
"no daughter found!");
2314 skipped[1]=dgTrack->GetID();
2316 AliESDVertex *vertexESD=0x0;
2317 AliAODVertex *vertexAOD=0x0;
2318 AliVertexerTracks *vertexer =
new AliVertexerTracks(aodev->GetMagneticField());
2321 vertexer->SetSkipTracks(nTrksToSkip,skipped);
2322 vertexer->SetMinClusters(4);
2323 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
2324 if(!vertexESD)
return vertexAOD;
2325 if(vertexESD->GetNContributors()<=0) {
2326 AliDebug(2,
"vertexing failed");
2327 delete vertexESD; vertexESD=NULL;
2331 delete vertexer; vertexer=NULL;
2335 Double_t pos[3],cov[6],chi2perNDF;
2336 vertexESD->GetXYZ(pos);
2337 vertexESD->GetCovMatrix(cov);
2338 chi2perNDF = vertexESD->GetChi2toNDF();
2339 delete vertexESD; vertexESD=NULL;
2341 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF);
2352 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass: Terminate() \n");
2355 fOutputMass =
dynamic_cast<TList*
> (GetOutputData(1));
2357 printf(
"ERROR: fOutputMass not available\n");
2362 printf(
"ERROR: fOutputMass not available\n");
2367 fDistr =
dynamic_cast<TList*
> (GetOutputData(2));
2369 printf(
"ERROR: fDistr not available\n");
2374 fNentries =
dynamic_cast<TH1F*
>(GetOutputData(3));
2377 printf(
"ERROR: fNEntries not available\n");
2382 printf(
"ERROR: fCuts not available\n");
2387 printf(
"ERROR: fCounter not available\n");
2391 fDetSignal =
dynamic_cast<TList*
>(GetOutputData(8));
2393 printf(
"ERROR: fDetSignal not available\n");
2398 fOutputMassY =
dynamic_cast<TList*
> (GetOutputData(9));
2400 printf(
"ERROR: fOutputMassY not available\n");
2406 for(Int_t ipt=0;ipt<
nptbins;ipt++){
2409 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));
2414 TString massName=
"histMass_";
2426 TString nameDistr=
"hdcaB_";
2432 nameDistr=
"hd0d0B_";
2435 nameDistr=
"hcosthetapointB_";
2442 nameDistr=
"hcosthetastarB_";
2445 nameDistr=
"hcosthpointd0d0B_";
2452 TString cvname,cstname;
2462 TCanvas *cMass=
new TCanvas(cvname,cvname);
2466 TCanvas* cStat=
new TCanvas(cstname,Form(
"Stat%s",
fArray ?
"LS" :
"D0"));
2482 Int_t nmassbins=200;
2483 Double_t fLowmasslimit=1.5648, fUpmasslimit=2.1648;
2484 Int_t fNImpParBins=400;
2485 Double_t fLowerImpPar=-2000., fHigherImpPar=2000.;
2486 Int_t
nbins[3]={nmassbins,200,fNImpParBins};
2487 Double_t xmin[3]={fLowmasslimit,0.,fLowerImpPar};
2488 Double_t xmax[3]={fUpmasslimit,20.,fHigherImpPar};
2492 "Mass vs. pt vs.imppar - All",
2495 "Mass vs. pt vs.imppar - promptD",
2498 "Mass vs. pt vs.imppar - DfromB",
2501 "Mass vs. pt vs.true imppar -DfromB",
2504 "Mass vs. pt vs.imppar - backgr.",
2507 for(Int_t i=0; i<5;i++){
2516 printf(
" AliAnalysisTaskSED0MassV1::GetTrueImpactParameter() \n");
2518 Double_t vtxTrue[3];
2519 mcHeader->GetVertex(vtxTrue);
2521 partD0->XvYvZv(origD);
2522 Short_t
charge=partD0->Charge();
2523 Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2];
2524 for(Int_t iDau=0; iDau<2; iDau++){
2531 Int_t labelFirstDau = partD0->GetDaughter(0);
2533 for(Int_t iDau=0; iDau<2; iDau++){
2534 Int_t ind = labelFirstDau+iDau;
2535 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
2537 Int_t pdgCode = TMath::Abs( part->GetPdgCode() );
2539 AliError(
"Daughter particle not found in MC array");
2542 if(pdgCode==211 || pdgCode==321){
2543 pXdauTrue[iDau]=part->Px();
2544 pYdauTrue[iDau]=part->Py();
2545 pZdauTrue[iDau]=part->Pz();
2549 Double_t d0dummy[2]={0.,0.};
2550 AliAODRecoDecayHF aodDzeroMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
2560 printf(
" AliAnalysisTaskSED0Mass V1::CheckOrigin() \n");
2562 Int_t pdgGranma = 0;
2564 mother = mcPartCandidate->GetMother();
2566 Int_t abspdgGranma =0;
2567 Bool_t isFromB=kFALSE;
2568 Bool_t isQuarkFound=kFALSE;
2571 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
2573 pdgGranma = mcGranma->GetPdgCode();
2574 abspdgGranma = TMath::Abs(pdgGranma);
2575 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
2578 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
2579 mother = mcGranma->GetMother();
2581 AliError(
"Failed casting the mother particle!");
2586 if(isFromB)
return 5;
Double_t NormalizedDecayLengthXY() const
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
TList * fOutputMassPt
! list send on output slot 6
Bool_t fDrawDetSignal
flag to decide whether to fill "PID = x" bins in fNentrie
Bool_t fFillYHist
flag to fill Pt and Impact Parameter Histograms
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
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
Bool_t fWriteVariableTree
flag to check or not the selection bit
void CreateImpactParameterHistos()
TList * fDistr
! list send on output slot 2
Int_t GetWhyRejection() const
TList * fDetSignal
flag to decide whether to draw the TPC dE/dx and TOF signal before/after PID
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
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 fReadMC
can be D0 or Like Sign candidates
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
Double_t CosThetaStarD0bar() const
angle of K
Bool_t fIsRejectSDDClusters
fSys=0 -> p-p; fSys=1 ->PbPb (in this case fFillVarHists=kFALSE by default: set it to kTRUE after if ...
Bool_t AreDaughtersSelected(AliAODRecoDecayHF *rd) const
Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPartCandidate) const
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
void Draw(Int_t cell[], Int_t iBC, Int_t nBC, const Int_t cellref=151)
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
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
Double_t DecayLengthXY() const
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 IsEventSelected(AliVEvent *event)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
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
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
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
Int_t PtBin(Double_t pt) const
Bool_t fFillVarHists
selection outcome
AliNormalizationCounter * fCounter
! AliNormalizationCounter on output slot 5
Double_t * GetWeightsNegative() const