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", 18,-0.5,17.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()->SetNdivisions(1,kFALSE);
924 nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
925 fVariablesTree =
new TTree(nameoutput,
"Candidates variables tree");
928 TString * fCandidateVariableNames =
new TString[nVar];
929 fCandidateVariableNames[0] =
"massD0";
930 fCandidateVariableNames[1] =
"massD0bar";
931 fCandidateVariableNames[2] =
"pt";
932 fCandidateVariableNames[3] =
"dca";
933 fCandidateVariableNames[4] =
"costhsD0";
934 fCandidateVariableNames[5] =
"costhsD0bar";
935 fCandidateVariableNames[6] =
"ptk";
936 fCandidateVariableNames[7] =
"ptpi";
937 fCandidateVariableNames[8] =
"d0k";
938 fCandidateVariableNames[9] =
"d0pi";
939 fCandidateVariableNames[10] =
"d0xd0";
940 fCandidateVariableNames[11] =
"costhp";
941 fCandidateVariableNames[12] =
"costhpxy";
942 fCandidateVariableNames[13] =
"lxy";
943 fCandidateVariableNames[14] =
"specialcuts";
944 for(Int_t ivar=0; ivar<nVar; ivar++){
952 TH2F *TOFSigBefPID =
new TH2F(
"TOFSigBefPID",
"TOF signal of daughters before PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
953 TH2F *TOFSigAftPID =
new TH2F(
"TOFSigAftPID",
"TOF signal after PID;p(daught)(GeV/c);Signal", 500, 0, 10, 5000, 0, 50e3);
955 TH2F *TPCSigBefPID =
new TH2F(
"TPCSigBefPID",
"TPC dE/dx before PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
956 TH2F *TPCSigAftPID =
new TH2F(
"TPCSigAftPID",
"TPC dE/dx after PID;p(daught)(GeV/c);dE/dx (arb. units)", 1000, 0, 10, 1000, 0, 500);
997 AliAODEvent *aod =
dynamic_cast<AliAODEvent*
> (InputEvent());
1007 bname=
"LikeSign2Prong";
1010 TClonesArray *inputArray=0;
1012 if(!aod && AODEvent() && IsStandardAOD()) {
1015 aod =
dynamic_cast<AliAODEvent*
> (AODEvent());
1018 AliAODHandler* aodHandler = (AliAODHandler*)
1019 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1021 if(aodHandler->GetExtensions()) {
1022 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
1023 AliAODEvent* aodFromExt = ext->GetAOD();
1024 inputArray=(TClonesArray*)aodFromExt->GetList()->FindObject(bname.Data());
1027 inputArray=(TClonesArray*)aod->GetList()->FindObject(bname.Data());
1031 if(!inputArray || !aod) {
1032 printf(
"AliAnalysisTaskSED0Mass::UserExec: input branch not found!\n");
1038 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001)
return;
1041 TClonesArray *mcArray = 0;
1042 AliAODMCHeader *mcHeader = 0;
1046 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1048 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC particles branch not found!\n");
1053 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1055 printf(
"AliAnalysisTaskSED0Mass::UserExec: MC header branch not found!\n");
1068 TString trigclass=aod->GetFiredTriggerClasses();
1069 if(trigclass.Contains(
"C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains(
"C0SMH-B-NOPF-ALL"))
fNentries->Fill(14);
1081 Bool_t skipEvent = kFALSE;
1083 if (aod) ntracks = aod->GetNumberOfTracks();
1084 for(Int_t itrack=0; itrack<ntracks; itrack++) {
1086 AliAODTrack * track =
dynamic_cast<AliAODTrack*
>(aod->GetTrack(itrack));
1087 if(!track) AliFatal(
"Not a standard AOD");
1088 if(TESTBIT(track->GetITSClusterMap(),2) || TESTBIT(track->GetITSClusterMap(),3) ){
1094 if (skipEvent)
return;
1098 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1100 Bool_t isGoodVtx=kFALSE;
1103 TString primTitle = vtx1->GetTitle();
1104 if(primTitle.Contains(
"VertexerTracks") && vtx1->GetNContributors()>0) {
1110 Int_t nInD0toKpi = inputArray->GetEntriesFast();
1111 if(fDebug>2) printf(
"Number of D0->Kpi: %d\n",nInD0toKpi);
1115 Int_t nSelectedloose=0,nSelectedtight=0;
1116 for (Int_t iD0toKpi = 0; iD0toKpi < nInD0toKpi; iD0toKpi++) {
1138 if(ptbin==-1) {
fNentries->Fill(4);
continue;}
1146 AliDebug(1,
"at least one daughter not found!");
1161 Int_t isSelectedPIDfill = 3;
1164 if (isSelectedPIDfill == 0)
fNentries->Fill(7);
1165 if (isSelectedPIDfill == 1)
fNentries->Fill(8);
1166 if (isSelectedPIDfill == 2)
fNentries->Fill(9);
1167 if (isSelectedPIDfill == 3)
fNentries->Fill(10);
1198 AliESDtrack *esdtrack1 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1199 AliESDtrack *esdtrack2 =
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1203 Int_t isSelectedPIDfill = 3;
1208 ((TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1209 ((TH2F*)ListDetSignal->FindObject(
"TOFSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1210 ((TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1211 ((TH2F*)ListDetSignal->FindObject(
"TPCSigBefPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1213 if (isSelectedPIDfill != 0) {
1214 ((TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTOFsignal());
1215 ((TH2F*)ListDetSignal->FindObject(
"TOFSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTOFsignal());
1216 ((TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack1->P(), esdtrack1->GetTPCsignal());
1217 ((TH2F*)ListDetSignal->FindObject(
"TPCSigAftPID"))->Fill(esdtrack2->P(), esdtrack2->GetTPCsignal());
1234 Int_t pdgDgD0toKpi[2]={321,211};
1236 if(
fReadMC) lab=part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
1238 Int_t isSelectedPID=3;
1241 if (isSelectedPID==0)
fNentries->Fill(7);
1242 if (isSelectedPID==1)
fNentries->Fill(8);
1243 if (isSelectedPID==2)
fNentries->Fill(9);
1244 if (isSelectedPID==3)
fNentries->Fill(10);
1255 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1264 Double_t invmasscut=0.03;
1266 TString fillthispi=
"",fillthisK=
"",fillthis=
"", fillthispt=
"", fillthisetaphi=
"";
1268 Int_t ptbin=cuts->
PtBin(part->Pt());
1269 Double_t pt = part->Pt();
1271 Double_t dz1[2],dz2[2],covar1[3],covar2[3];
1272 dz1[0]=-99; dz2[0]=-99;
1274 Double_t decl[2]={-99,-99};
1275 Bool_t recalcvtx=kFALSE;
1282 AliAODVertex *vtxProp=0x0;
1288 AliESDtrack *esdtrack1=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(0));
1289 AliESDtrack *esdtrack2=
new AliESDtrack((AliVTrack*)
fDaughterTracks.UncheckedAt(1));
1290 esdtrack1->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz1,covar1);
1291 esdtrack2->PropagateToDCA(vtxProp,aod->GetMagneticField(),1.,dz2,covar2);
1292 delete vtxProp; vtxProp=NULL;
1306 Double_t cosThetaStarD0 = 99;
1307 Double_t cosThetaStarD0bar = 99;
1308 Double_t cosPointingAngle = 99;
1309 Double_t normalizedDecayLength2 = -1, normalizedDecayLengthxy=-1;
1310 Double_t decayLength2 = -1, decayLengthxy=-1;
1311 Double_t ptProng[2]={-99,-99};
1312 Double_t d0Prong[2]={-99,-99};
1313 Double_t etaD = 99.;
1314 Double_t phiD = 99.;
1325 if(!prong0 || !prong1) {
1330 labprong[0]=prong0->GetLabel();
1331 labprong[1]=prong1->GetLabel();
1333 AliAODMCParticle *mcprong=0;
1334 Int_t pdgProng[2]={0,0};
1336 for (Int_t iprong=0;iprong<2;iprong++){
1337 if(
fReadMC && labprong[iprong]>=0) {
1338 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1339 pdgProng[iprong]=mcprong->GetPdgCode();
1346 fillthispi=
"hptpiSnoMcut_";
1349 fillthisK=
"hptKSnoMcut_";
1352 if ((TMath::Abs(pdgProng[0]) == 211 && TMath::Abs(pdgProng[1]) == 321)
1353 || (isSelectedPID==1 || isSelectedPID==3)){
1354 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong0->Pt());
1355 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong1->Pt());
1358 if ((TMath::Abs(pdgProng[0]) == 321 && TMath::Abs(pdgProng[1]) == 211)
1359 || (isSelectedPID==2 || isSelectedPID==3)){
1360 ((TH1F*)listout->FindObject(fillthisK))->Fill(prong0->Pt());
1361 ((TH1F*)listout->FindObject(fillthispi))->Fill(prong1->Pt());
1373 fillthispt=
"histSgnPt";
1375 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)
1376 || (!
fReadMC && (isSelectedPID==1 || isSelectedPID==3))){
1377 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1380 fillthisetaphi=
"hetaphiD0candidateS_";
1381 fillthisetaphi+=ptbin;
1382 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1384 if(TMath::Abs(minvD0-mPDG)<0.05){
1385 fillthisetaphi=
"hetaphiD0candidatesignalregionS_";
1386 fillthisetaphi+=ptbin;
1387 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1393 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1396 fillthisetaphi=
"hetaphiD0barcandidateS_";
1397 fillthisetaphi+=ptbin;
1398 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1400 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1401 fillthisetaphi=
"hetaphiD0barcandidatesignalregionS_";
1402 fillthisetaphi+=ptbin;
1403 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1410 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1420 ptProng[0]=prong0->Pt(); ptProng[1]=prong1->Pt();
1421 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1423 if(
fArray==1) cout<<
"LS signal: ERROR"<<endl;
1424 for (Int_t iprong=0; iprong<2; iprong++){
1426 if (
fReadMC) labprong[iprong]=prong->GetLabel();
1430 if(
fReadMC && labprong[iprong]>=0) {
1431 mcprong= (AliAODMCParticle*)arrMC->At(labprong[iprong]);
1432 pdgprong=mcprong->GetPdgCode();
1435 Bool_t isPionHere[2]={(isSelectedPID==1 || isSelectedPID==3) ? kTRUE : kFALSE,(isSelectedPID==2 || isSelectedPID==3) ? kTRUE : kFALSE};
1437 if(TMath::Abs(pdgprong)==211 || isPionHere[iprong]) {
1441 fillthispi=
"hptpiS_";
1443 ((TH1F*)listout->FindObject(fillthispi))->Fill(ptProng[iprong]);
1446 fillthispi=
"hd0piS_";
1448 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0Prong[iprong]);
1451 fillthispi=
"hd0vpiS_";
1453 ((TH1F*)listout->FindObject(fillthispi))->Fill(d0[iprong]);
1458 if(TMath::Abs(pdgprong)==321 || !isPionHere[iprong]) {
1463 ((TH1F*)listout->FindObject(fillthisK))->Fill(ptProng[iprong]);
1469 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0Prong[iprong]);
1471 fillthisK=
"hd0vKS_";
1473 ((TH1F*)listout->FindObject(fillthisK))->Fill(d0[iprong]);
1478 fillthis=
"hcosthpointd0S_";
1480 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[iprong]);
1486 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1488 fillthis=
"hcosthetapointS_";
1490 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1492 fillthis=
"hcosthetapointxyS_";
1499 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0());
1503 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1505 fillthis=
"hnormdeclS_";
1507 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1509 fillthis=
"hdeclxyS_";
1511 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1513 fillthis=
"hnormdeclxyS_";
1515 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1517 fillthis=
"hdeclxyd0d0S_";
1519 ((TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1521 fillthis=
"hnormdeclxyd0d0S_";
1523 ((TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1526 fillthis=
"hdeclvS_";
1528 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1530 fillthis=
"hnormdeclvS_";
1532 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1534 fillthis=
"hd0d0vS_";
1536 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1540 fillthis=
"hcosthetastarS_";
1542 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)) ((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1544 if (
fReadMC || isSelectedPID>1)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0bar);
1545 if(isSelectedPID==1 || isSelectedPID==3)((TH1F*)listout->FindObject(fillthis))->Fill(cosThetaStarD0);
1548 fillthis=
"hcosthpointd0d0S_";
1550 ((TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1553 if ((
fReadMC && ((AliAODMCParticle*)arrMC->At(lab))->GetPdgCode() == 421)){
1554 for(Int_t it=0; it<2; it++){
1557 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1558 fillthis=
"hphiD0S_";
1560 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1561 Int_t nPointsITS = 0;
1562 for (Int_t il=0; il<6; il++){
1563 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1565 fillthis=
"hNITSpointsD0vsptS_";
1567 ((TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(),nPointsITS);
1568 fillthis=
"hNSPDpointsD0S_";
1570 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1571 ((TH1I*)listout->FindObject(fillthis))->Fill(0);
1573 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1574 ((TH1I*)listout->FindObject(fillthis))->Fill(1);
1576 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1577 ((TH1I*)listout->FindObject(fillthis))->Fill(2);
1579 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1580 ((TH1I*)listout->FindObject(fillthis))->Fill(3);
1582 fillthis=
"hNclsD0vsptS_";
1585 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->GetTPCNcls();
1586 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1590 if (
fReadMC || isSelectedPID>1){
1591 for(Int_t it=0; it<2; it++){
1592 fillthis=
"hptD0barS_";
1594 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1595 fillthis=
"hphiD0barS_";
1597 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1598 fillthis=
"hNclsD0barvsptS_";
1601 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->GetTPCNcls();
1602 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1605 if(isSelectedPID==1 || isSelectedPID==3){
1606 for(Int_t it=0; it<2; it++){
1609 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1610 fillthis=
"hphiD0S_";
1612 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1613 Int_t nPointsITS = 0;
1614 for (Int_t il=0; il<6; il++){
1615 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1617 fillthis=
"hNITSpointsD0vsptS_";
1619 ((TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1620 fillthis=
"hNSPDpointsD0S_";
1622 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1623 ((TH1I*)listout->FindObject(fillthis))->Fill(0);
1625 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1626 ((TH1I*)listout->FindObject(fillthis))->Fill(1);
1628 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1629 ((TH1I*)listout->FindObject(fillthis))->Fill(2);
1631 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1632 ((TH1I*)listout->FindObject(fillthis))->Fill(3);
1634 fillthis=
"hNclsD0vsptS_";
1637 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->GetTPCNcls();
1638 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1656 fillthispt=
"histBkgPt";
1659 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0);
1662 fillthisetaphi=
"hetaphiD0candidateB_";
1663 fillthisetaphi+=ptbin;
1664 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1666 if(TMath::Abs(minvD0-mPDG)<0.05){
1667 fillthisetaphi=
"hetaphiD0candidatesignalregionB_";
1668 fillthisetaphi+=ptbin;
1669 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1673 ((TH1F*)listout->FindObject(fillthis))->Fill(minvD0bar);
1676 fillthisetaphi=
"hetaphiD0barcandidateB_";
1677 fillthisetaphi+=ptbin;
1678 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1680 if(TMath::Abs(minvD0bar-mPDG)<0.05){
1681 fillthisetaphi=
"hetaphiD0barcandidatesignalregionB_";
1682 fillthisetaphi+=ptbin;
1683 ((TH2F*)listout->FindObject(fillthisetaphi))->Fill(etaD, phiD);
1688 fillthis=
"hptB1prongnoMcut_";
1691 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1693 fillthis=
"hptB2prongsnoMcut_";
1695 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1696 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(0))->Pt());
1701 if(TMath::Abs(minvD0-mPDG)<invmasscut || TMath::Abs(minvD0bar-mPDG)<invmasscut){
1713 d0Prong[0]=part->Getd0Prong(0); d0Prong[1]=part->Getd0Prong(1);
1718 if(fDebug>2) cout<<
"No daughter found";
1723 if(prongg->Charge()==1) {
1725 ((TH1F*)
fOutputMass->FindObject(
"hpospair"))->Fill(ptbin);
1728 ((TH1F*)
fOutputMass->FindObject(
"hnegpair"))->Fill(ptbin);
1736 for(Int_t it=0; it<2; it++){
1739 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1740 fillthis=
"hphiD0B_";
1742 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1744 Int_t nPointsITS = 0;
1745 for (Int_t il=0; il<6; il++){
1746 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(il)) nPointsITS++;
1748 fillthis=
"hNITSpointsD0vsptB_";
1750 ((TH2F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt(), nPointsITS);
1751 fillthis=
"hNSPDpointsD0B_";
1753 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && !(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1))){
1754 ((TH1I*)listout->FindObject(fillthis))->Fill(0);
1756 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && !(((AliAODTrack*)(
fDaughterTracks.UncheckedAt(it)))->HasPointOnITSLayer(1))){
1757 ((TH1I*)listout->FindObject(fillthis))->Fill(1);
1759 if(!(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0)) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1760 ((TH1I*)listout->FindObject(fillthis))->Fill(2);
1762 if(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(0) && ((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->HasPointOnITSLayer(1)){
1763 ((TH1I*)listout->FindObject(fillthis))->Fill(3);
1765 fillthis=
"hNclsD0vsptB_";
1768 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->GetTPCNcls();
1769 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1776 for(Int_t it=0; it<2; it++){
1777 fillthis=
"hptD0barB_";
1779 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Pt());
1780 fillthis=
"hphiD0barB_";
1782 ((TH1F*)listout->FindObject(fillthis))->Fill(((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->Phi());
1783 fillthis=
"hNclsD0barvsptB_";
1786 Float_t ncls = (Float_t)((AliAODTrack*)
fDaughterTracks.UncheckedAt(it))->GetTPCNcls();
1787 ((TH2F*)listout->FindObject(fillthis))->Fill(mom, ncls);
1793 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1794 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1797 Int_t pdgMother[2]={0,0};
1798 Double_t factor[2]={1,1};
1800 for(Int_t iprong=0;iprong<2;iprong++){
1802 lab=prong->GetLabel();
1804 AliAODMCParticle* mcprong=(AliAODMCParticle*)arrMC->At(lab);
1806 Int_t labmom=mcprong->GetMother();
1808 AliAODMCParticle* mcmother=(AliAODMCParticle*)arrMC->At(labmom);
1809 if(mcmother) pdgMother[iprong]=mcmother->GetPdgCode();
1816 fillthis=
"hd0moresB_";
1819 if(TMath::Abs(pdgMother[iprong])==310 || TMath::Abs(pdgMother[iprong])==130 || TMath::Abs(pdgMother[iprong])==321){
1820 if(ptProng[iprong]<=1)factor[iprong]=1./.7;
1821 else factor[iprong]=1./.6;
1825 if(TMath::Abs(pdgMother[iprong])==3122) {
1826 factor[iprong]=1./0.25;
1829 fillthis=
"hd0moresB_";
1832 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[iprong],factor[iprong]);
1835 fillthis=
"hd0vmoresB_";
1837 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[iprong],factor[iprong]);
1843 fillthis=
"hd0d0moresB_";
1845 ((TH1F*)listout->FindObject(fillthis))->Fill(part->
Prodd0d0(),factor[0]*factor[1]);
1847 fillthis=
"hcosthetapointmoresB_";
1849 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,factor[0]*factor[1]);
1852 fillthis=
"hd0d0vmoresB_";
1854 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1],factor[0]*factor[1]);
1863 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[0]);
1864 ((TH1F*)listout->FindObject(fillthis))->Fill(ptProng[1]);
1866 fillthis=
"hcosthetastarB_";
1874 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]);
1877 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[1]);
1879 fillthis=
"hcosthpointd0d0B_";
1881 ((TH2F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,part->
Prodd0d0());
1883 fillthis=
"hcosthpointd0B_";
1885 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[0]);
1886 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle,d0Prong[1]);
1891 fillthis=
"hd0vp0B_";
1893 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
1894 fillthis=
"hd0vp1B_";
1896 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
1900 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]);
1901 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[1]);
1909 ((TH1F*)listout->FindObject(fillthis))->Fill(part->GetDCA());
1913 ((TH1F*)listout->FindObject(fillthis))->Fill(d0Prong[0]*d0Prong[1]);
1916 fillthis=
"hd0d0vB_";
1918 ((TH1F*)listout->FindObject(fillthis))->Fill(d0[0]*d0[1]);
1921 fillthis=
"hcosthetapointB_";
1923 ((TH1F*)listout->FindObject(fillthis))->Fill(cosPointingAngle);
1925 fillthis=
"hcosthetapointxyB_";
1931 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLength2);
1933 fillthis=
"hnormdeclB_";
1935 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLength2);
1937 fillthis=
"hdeclxyB_";
1939 ((TH1F*)listout->FindObject(fillthis))->Fill(decayLengthxy);
1941 fillthis=
"hnormdeclxyB_";
1943 ((TH1F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy);
1945 fillthis=
"hdeclxyd0d0B_";
1947 ((TH2F*)listout->FindObject(fillthis))->Fill(decayLengthxy,d0Prong[0]*d0Prong[1]);
1949 fillthis=
"hnormdeclxyd0d0B_";
1951 ((TH2F*)listout->FindObject(fillthis))->Fill(normalizedDecayLengthxy,d0Prong[0]*d0Prong[1]);
1956 fillthis=
"hdeclvB_";
1958 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[0]);
1960 fillthis=
"hnormdeclvB_";
1962 ((TH1F*)listout->FindObject(fillthis))->Fill(decl[1]);
1979 Double_t mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass();
1990 Double_t ctsD0=0. ,ctsD0bar=0.; part->
CosThetaStarD0(ctsD0,ctsD0bar);
2014 if(fDebug>2) cout<<
"Candidate selected"<<endl;
2018 Int_t ptbin=cuts->
PtBin(part->Pt());
2019 Double_t pt = part->Pt();
2020 Double_t y = part->
YD0();
2022 Double_t impparXY=part->
ImpParXY()*10000.;
2023 Double_t trueImpParXY=0.;
2024 Double_t arrayForSparse[3]={invmassD0,pt,impparXY};
2025 Double_t arrayForSparseTrue[3]={invmassD0,pt,trueImpParXY};
2054 TString fillthis=
"", fillthispt=
"", fillthismasspt=
"", fillthismassy=
"";
2055 Int_t pdgDgD0toKpi[2]={321,211};
2057 Bool_t isPrimary=kTRUE;
2058 if (
fReadMC) labD0 = part->MatchToMC(421,arrMC,2,pdgDgD0toKpi);
2063 Double_t weigD0bar=1.;
2067 if (weigD0 > 1.0 || weigD0 < 0.) {weigD0 = 0.;}
2068 if (weigD0bar > 1.0 || weigD0bar < 0.) {weigD0bar = 0.;}
2078 arrayForSparse[0]=invmassD0; arrayForSparse[2]=impparXY;
2082 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2084 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2085 Int_t pdgD0 = partD0->GetPdgCode();
2088 if(
CheckOrigin(arrMC,partD0)==5) isPrimary=kFALSE;
2091 arrayForSparseTrue[0]=invmassD0; arrayForSparseTrue[2]=trueImpParXY;
2095 fillthis=
"histSgn_";
2097 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2100 fillthismasspt=
"histSgnPt";
2101 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2112 fillthismassy=
"histSgnY_";
2113 fillthismassy+=ptbin;
2114 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2119 fillthis=
"histSgn27_";
2121 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2125 fillthis=
"histRfl_";
2127 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2130 fillthismasspt=
"histRflPt";
2132 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2136 fillthismassy=
"histRflY_";
2137 fillthismassy+=ptbin;
2139 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2144 fillthis=
"histBkg_";
2146 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2149 fillthismasspt=
"histBkgPt";
2151 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2156 fillthismassy=
"histBkgY_";
2157 fillthismassy+=ptbin;
2159 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2165 fillthis=
"histMass_";
2170 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0,weigD0);
2174 fillthismasspt=
"histMassPt";
2176 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0,pt,weigD0);
2184 fillthismassy=
"histMassY_";
2185 fillthismassy+=ptbin;
2187 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0,y,weigD0);
2195 arrayForSparse[0]=invmassD0bar; arrayForSparse[2]=impparXY;
2199 if(
fArray==1) cout<<
"LS signal ERROR"<<endl;
2200 AliAODMCParticle *partD0 = (AliAODMCParticle*)arrMC->At(labD0);
2201 Int_t pdgD0 = partD0->GetPdgCode();
2204 if(
CheckOrigin(arrMC,partD0)==5) isPrimary=kFALSE;
2207 arrayForSparseTrue[0]=invmassD0bar; arrayForSparseTrue[2]=trueImpParXY;
2210 fillthis=
"histSgn_";
2212 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2220 fillthismasspt=
"histSgnPt";
2222 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2234 fillthismassy=
"histSgnY_";
2235 fillthismassy+=ptbin;
2237 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2241 fillthis=
"histRfl_";
2243 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2245 fillthismasspt=
"histRflPt";
2247 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2250 fillthismassy=
"histRflY_";
2251 fillthismassy+=ptbin;
2253 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2257 fillthis=
"histBkg_";
2259 ((TH1F*)(listout->FindObject(fillthis)))->Fill(invmassD0bar,weigD0bar);
2262 fillthismasspt=
"histBkgPt";
2264 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2268 fillthismassy=
"histBkgY_";
2269 fillthismassy+=ptbin;
2271 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2275 fillthis=
"histMass_";
2279 ((TH1F*)listout->FindObject(fillthis))->Fill(invmassD0bar,weigD0bar);
2283 fillthismasspt=
"histMassPt";
2285 ((TH2F*)(
fOutputMassPt->FindObject(fillthismasspt)))->Fill(invmassD0bar,pt,weigD0bar);
2289 fillthismassy=
"histMassY_";
2290 fillthismassy+=ptbin;
2292 ((TH2F*)(
fOutputMassY->FindObject(fillthismassy)))->Fill(invmassD0bar,y,weigD0bar);
2305 Int_t nTrksToSkip=2;
2308 AliDebug(2,
"no daughter found!");
2311 skipped[0]=dgTrack->GetID();
2314 AliDebug(2,
"no daughter found!");
2317 skipped[1]=dgTrack->GetID();
2319 AliESDVertex *vertexESD=0x0;
2320 AliAODVertex *vertexAOD=0x0;
2321 AliVertexerTracks *vertexer =
new AliVertexerTracks(aodev->GetMagneticField());
2324 vertexer->SetSkipTracks(nTrksToSkip,skipped);
2325 vertexer->SetMinClusters(4);
2326 vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(aodev);
2327 if(!vertexESD)
return vertexAOD;
2328 if(vertexESD->GetNContributors()<=0) {
2329 AliDebug(2,
"vertexing failed");
2330 delete vertexESD; vertexESD=NULL;
2334 delete vertexer; vertexer=NULL;
2338 Double_t pos[3],cov[6],chi2perNDF;
2339 vertexESD->GetXYZ(pos);
2340 vertexESD->GetCovMatrix(cov);
2341 chi2perNDF = vertexESD->GetChi2toNDF();
2342 delete vertexESD; vertexESD=NULL;
2344 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF);
2355 if(fDebug > 1) printf(
"AnalysisTaskSED0Mass: Terminate() \n");
2358 fOutputMass =
dynamic_cast<TList*
> (GetOutputData(1));
2360 printf(
"ERROR: fOutputMass not available\n");
2365 printf(
"ERROR: fOutputMass not available\n");
2370 fDistr =
dynamic_cast<TList*
> (GetOutputData(2));
2372 printf(
"ERROR: fDistr not available\n");
2377 fNentries =
dynamic_cast<TH1F*
>(GetOutputData(3));
2380 printf(
"ERROR: fNEntries not available\n");
2385 printf(
"ERROR: fCuts not available\n");
2390 printf(
"ERROR: fCounter not available\n");
2394 fDetSignal =
dynamic_cast<TList*
>(GetOutputData(8));
2396 printf(
"ERROR: fDetSignal not available\n");
2401 fOutputMassY =
dynamic_cast<TList*
> (GetOutputData(9));
2403 printf(
"ERROR: fOutputMassY not available\n");
2409 for(Int_t ipt=0;ipt<
nptbins;ipt++){
2412 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));
2417 TString massName=
"histMass_";
2429 TString nameDistr=
"hdcaB_";
2435 nameDistr=
"hd0d0B_";
2438 nameDistr=
"hcosthetapointB_";
2445 nameDistr=
"hcosthetastarB_";
2448 nameDistr=
"hcosthpointd0d0B_";
2455 TString cvname,cstname;
2465 TCanvas *cMass=
new TCanvas(cvname,cvname);
2469 TCanvas* cStat=
new TCanvas(cstname,Form(
"Stat%s",
fArray ?
"LS" :
"D0"));
2485 Int_t nmassbins=200;
2486 Double_t fLowmasslimit=1.5648, fUpmasslimit=2.1648;
2487 Int_t fNImpParBins=400;
2488 Double_t fLowerImpPar=-2000., fHigherImpPar=2000.;
2489 Int_t
nbins[3]={nmassbins,200,fNImpParBins};
2490 Double_t xmin[3]={fLowmasslimit,0.,fLowerImpPar};
2491 Double_t xmax[3]={fUpmasslimit,20.,fHigherImpPar};
2495 "Mass vs. pt vs.imppar - All",
2498 "Mass vs. pt vs.imppar - promptD",
2501 "Mass vs. pt vs.imppar - DfromB",
2504 "Mass vs. pt vs.true imppar -DfromB",
2507 "Mass vs. pt vs.imppar - backgr.",
2510 for(Int_t i=0; i<5;i++){
2519 printf(
" AliAnalysisTaskSED0MassV1::GetTrueImpactParameter() \n");
2521 Double_t vtxTrue[3];
2522 mcHeader->GetVertex(vtxTrue);
2524 partD0->XvYvZv(origD);
2525 Short_t
charge=partD0->Charge();
2526 Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2];
2527 for(Int_t iDau=0; iDau<2; iDau++){
2534 Int_t labelFirstDau = partD0->GetDaughter(0);
2536 for(Int_t iDau=0; iDau<2; iDau++){
2537 Int_t ind = labelFirstDau+iDau;
2538 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
2540 Int_t pdgCode = TMath::Abs( part->GetPdgCode() );
2542 AliError(
"Daughter particle not found in MC array");
2545 if(pdgCode==211 || pdgCode==321){
2546 pXdauTrue[iDau]=part->Px();
2547 pYdauTrue[iDau]=part->Py();
2548 pZdauTrue[iDau]=part->Pz();
2552 Double_t d0dummy[2]={0.,0.};
2553 AliAODRecoDecayHF aodDzeroMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
2563 printf(
" AliAnalysisTaskSED0MassV1::CheckOrigin() \n");
2565 Int_t pdgGranma = 0;
2567 mother = mcPartCandidate->GetMother();
2569 Int_t abspdgGranma =0;
2570 Bool_t isFromB=kFALSE;
2571 Bool_t isQuarkFound=kFALSE;
2574 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
2576 pdgGranma = mcGranma->GetPdgCode();
2577 abspdgGranma = TMath::Abs(pdgGranma);
2578 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
2581 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
2582 mother = mcGranma->GetMother();
2584 AliError(
"Failed casting the mother particle!");
2589 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
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)
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...
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999)
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