43 #include <TParticle.h>
46 #include <TDatabasePDG.h>
47 #include <AliAnalysisDataSlot.h>
48 #include <AliAnalysisDataContainer.h>
51 #include "AliMCEvent.h"
52 #include "AliAnalysisManager.h"
53 #include "AliAODMCHeader.h"
54 #include "AliAODHandler.h"
56 #include "AliVertex.h"
57 #include "AliVVertex.h"
58 #include "AliESDVertex.h"
59 #include "AliAODVertex.h"
60 #include "AliVertexerTracks.h"
61 #include "AliExternalTrackParam.h"
62 #include "AliNeutralTrackParam.h"
63 #include "AliAODRecoDecay.h"
68 #include "AliESDtrack.h"
69 #include "AliAODMCParticle.h"
71 #include "AliAODEvent.h"
73 #include "AliAODInputHandler.h"
100 fOutputD0_DStarPt(0),
101 fOutputDStar_DStarPt(0),
104 fQuickSignalAnalysis(0),
116 fnPtBinsD0forD0ptbin(0),
117 fnPtBinsD0forDStarptbin(0),
118 fnPtBinsDStarforDStarptbin(0),
120 fnPtBinsD0forD0ptbinLimits(0),
121 fnPtBinsD0forDStarptbinLimits(0),
122 fnPtBinsDStarforDStarptbinLimits(0),
124 fPtBinLimitsD0forD0ptbin(0),
125 fPtBinLimitsD0forDStarptbin(0),
126 fPtBinLimitsDStarforDStarptbin(0),
127 fDaughterHistogramArray(),
128 fDaughterHistogramArray2D(),
129 fMotherHistogramArray(),
130 fMotherHistogramArray2D()
150 fOutputD0_DStarPt(0),
151 fOutputDStar_DStarPt(0),
154 fQuickSignalAnalysis(0),
166 fnPtBinsD0forD0ptbin(0),
167 fnPtBinsD0forDStarptbin(0),
168 fnPtBinsDStarforDStarptbin(0),
170 fnPtBinsD0forD0ptbinLimits(0),
171 fnPtBinsD0forDStarptbinLimits(0),
172 fnPtBinsDStarforDStarptbinLimits(0),
174 fPtBinLimitsD0forD0ptbin(0),
175 fPtBinLimitsD0forDStarptbin(0),
176 fPtBinLimitsDStarforDStarptbin(0),
177 fDaughterHistogramArray(),
178 fDaughterHistogramArray2D(),
179 fMotherHistogramArray(),
180 fMotherHistogramArray2D()
185 Info(
"AliAnalysisTaskSEB0toDStarPi",
"Calling Constructor");
193 fD0Tracks =
new TClonesArray(
"AliAODRecoDecayHF2Prong", 5000);
194 fDStarTracks =
new TClonesArray(
"AliAODRecoCascadeHF", 5000);
195 fB0Tracks =
new TClonesArray(
"AliAODRecoCascadeHF", 5000);
239 DefineOutput(1,TList::Class());
240 DefineOutput(2,TList::Class());
241 DefineOutput(3,TList::Class());
242 DefineOutput(4,AliRDHFCutsB0toDStarPi::Class());
243 DefineOutput(5,AliNormalizationCounter::Class());
244 DefineOutput(6,TList::Class());
245 DefineOutput(7,TList::Class());
246 DefineOutput(8,TList::Class());
247 DefineOutput(9,TList::Class());
248 DefineOutput(10,TList::Class());
249 DefineOutput(11,TList::Class());
250 DefineOutput(12,TList::Class());
251 DefineOutput(13,TList::Class());
252 DefineOutput(14,TList::Class());
253 DefineOutput(15,TList::Class());
254 DefineOutput(16,TList::Class());
262 Info(
"~AliAnalysisTaskSEB0toDStarPi",
"Calling Destructor");
296 if(fDebug > 1) printf(
"AliAnalysisTaskSEB0toDStarPi::Init() \n");
299 PostData(4,copyfCuts);
316 Error(
"UserExec",
"NO EVENT FOUND!");
321 std::cout <<
"\r" <<
"Analysing event number: " <<
fEvents << std::endl;
341 if(!aodEvent && AODEvent() && IsStandardAOD()) {
344 aodEvent =
dynamic_cast<AliAODEvent*
> (AODEvent());
349 if(!aodEvent->GetPrimaryVertex() || TMath::Abs(aodEvent->GetMagneticField())<0.001)
return;
355 TString trigclass=aodEvent->GetFiredTriggerClasses();
356 if(trigclass.Contains(
"C0SMH-B-NOPF-ALLNOTRD")||trigclass.Contains(
"C0SMH-B-NOPF-ALL"))
fCEvents->Fill(5);
371 Int_t icountReco = 0;
377 AliAODVertex *primaryVertex = (AliAODVertex*)aodEvent->GetPrimaryVertex();
378 if(!primaryVertex)
return;
379 if(primaryVertex->GetNContributors()<1)
return;
382 Int_t nSelectedAna =0;
383 Int_t nSelectedProd =0;
392 TClonesArray *mcTrackArray = 0;
393 if(
fUseMCInfo) mcTrackArray =
dynamic_cast<TClonesArray*
>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
396 TMatrix * B0toDStarPiLabelMatrix =
new TMatrix(0,7);
418 D0Selection(aodEvent,primaryVertex,bz,mcTrackArray,B0toDStarPiLabelMatrix);
423 for (
int i = 0; i <
fD0Tracks->GetEntriesFast(); ++i){
425 delete vertex; vertex = NULL;
427 for (
int i = 0; i <
fDStarTracks->GetEntriesFast(); ++i){
428 AliAODVertex * vertex = (AliAODVertex*)((
AliAODRecoCascadeHF*)(*fDStarTracks)[i])->GetOwnSecondaryVtx();
429 delete vertex; vertex = NULL;
431 for (
int i = 0; i <
fB0Tracks->GetEntriesFast(); ++i){
432 AliAODVertex * vertex = (AliAODVertex*)((
AliAODRecoCascadeHF*)(*fB0Tracks)[i])->GetOwnSecondaryVtx();
433 delete vertex; vertex = NULL;
445 delete B0toDStarPiLabelMatrix; B0toDStarPiLabelMatrix = NULL;
454 AliDebug(2, Form(
"Found %i Reco particles that are D*!!",icountReco));
483 AliAnalysisTaskSE::Terminate();
487 printf(
"ERROR: fOutput not available\n");
495 printf(
"ERROR: fOutputD0Pion not available\n");
500 printf(
"ERROR: fOutputD0Kaon not available\n");
505 printf(
"ERROR: fOutputDStarPion not available\n");
510 printf(
"ERROR: fOutputB0Pion not available\n");
515 printf(
"ERROR: fOutputD0 not available\n");
520 printf(
"ERROR: fOutputDStar not available\n");
525 printf(
"ERROR: fOutputB0 not available\n");
530 printf(
"ERROR: fOutputD0_D0Pt not available\n");
535 printf(
"ERROR: fOutputD0_DStarPt not available\n");
540 printf(
"ERROR: fOutputDStar_DStarPt not available\n");
545 printf(
"ERROR: fOutputB0MC not available\n");
554 Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s\n", GetName());
633 fCEvents =
new TH1F(
"fCEvents",
"conter",13,0,13);
635 fCEvents->GetXaxis()->SetTitle(
"1");
636 fCEvents->GetYaxis()->SetTitle(
"counts");
637 fCEvents->GetXaxis()->SetBinLabel(2,
"no. of events");
638 fCEvents->GetXaxis()->SetBinLabel(3,
"good prim vtx and B field");
639 fCEvents->GetXaxis()->SetBinLabel(4,
"no event selected");
640 fCEvents->GetXaxis()->SetBinLabel(5,
"no vtx contributors");
641 fCEvents->GetXaxis()->SetBinLabel(6,
"trigger for PbPb");
642 fCEvents->GetXaxis()->SetBinLabel(7,
"no z vtx");
643 fCEvents->GetXaxis()->SetBinLabel(12,
"no. of D0 fail to be rec");
648 TString name_mc_B0_pt =
"mc_B0_pt";
649 TH1F* hist_mc_B0_pt =
new TH1F(name_mc_B0_pt.Data(),
"Pt monte carlo B0 in B0->D*#pi; p_{T} [GeV/c]; Entries",400,0,20);
650 hist_mc_B0_pt->Sumw2();
651 hist_mc_B0_pt->SetLineColor(6);
652 hist_mc_B0_pt->SetMarkerStyle(20);
653 hist_mc_B0_pt->SetMarkerSize(0.6);
654 hist_mc_B0_pt->SetMarkerColor(6);
655 TH1F* histogram_mc_B0_pt = (TH1F*)hist_mc_B0_pt->Clone();
658 TString name_mc_B0_pion_pt =
"mc_B0_pion_pt";
659 TH1F* hist_mc_B0_pion_pt =
new TH1F(name_mc_B0_pion_pt.Data(),
"Pt monte carlo pion of B0 in B0->D*#pi; p_{T} [GeV/c]; Entries",400,0,20);
660 hist_mc_B0_pion_pt->Sumw2();
661 hist_mc_B0_pion_pt->SetLineColor(6);
662 hist_mc_B0_pion_pt->SetMarkerStyle(20);
663 hist_mc_B0_pion_pt->SetMarkerSize(0.6);
664 hist_mc_B0_pion_pt->SetMarkerColor(6);
665 TH1F* histogram_mc_B0_pion_pt = (TH1F*)hist_mc_B0_pion_pt->Clone();
668 TString name_mc_DStar_pt =
"mc_DStar_pt";
669 TH1F* hist_mc_DStar_pt =
new TH1F(name_mc_DStar_pt.Data(),
"Pt monte carlo DStar in B0->D*#pi; p_{T} [GeV/c]; Entries",400,0,20);
670 hist_mc_DStar_pt->Sumw2();
671 hist_mc_DStar_pt->SetLineColor(6);
672 hist_mc_DStar_pt->SetMarkerStyle(20);
673 hist_mc_DStar_pt->SetMarkerSize(0.6);
674 hist_mc_DStar_pt->SetMarkerColor(6);
675 TH1F* histogram_mc_DStar_pt = (TH1F*)hist_mc_DStar_pt->Clone();
678 TString name_mc_DStar_pion_pt =
"mc_DStar_pion_pt";
679 TH1F* hist_mc_DStar_pion_pt =
new TH1F(name_mc_DStar_pion_pt.Data(),
"Pt monte carlo pion of DStar in B0->D*#pi; p_{T} [GeV/c]; Entries",400,0,20);
680 hist_mc_DStar_pion_pt->Sumw2();
681 hist_mc_DStar_pion_pt->SetLineColor(6);
682 hist_mc_DStar_pion_pt->SetMarkerStyle(20);
683 hist_mc_DStar_pion_pt->SetMarkerSize(0.6);
684 hist_mc_DStar_pion_pt->SetMarkerColor(6);
685 TH1F* histogram_mc_DStar_pion_pt = (TH1F*)hist_mc_DStar_pion_pt->Clone();
688 TString name_mc_D0_pt =
"mc_D0_pt";
689 TH1F* hist_mc_D0_pt =
new TH1F(name_mc_D0_pt.Data(),
"Pt monte carlo D0 in B0->D*#pi; p_{T} [GeV/c]; Entries",400,0,20);
690 hist_mc_D0_pt->Sumw2();
691 hist_mc_D0_pt->SetLineColor(6);
692 hist_mc_D0_pt->SetMarkerStyle(20);
693 hist_mc_D0_pt->SetMarkerSize(0.6);
694 hist_mc_D0_pt->SetMarkerColor(6);
695 TH1F* histogram_mc_D0_pt = (TH1F*)hist_mc_D0_pt->Clone();
698 TString name_mc_D0_pion_pt =
"mc_D0_pion_pt";
699 TH1F* hist_mc_D0_pion_pt =
new TH1F(name_mc_D0_pion_pt.Data(),
"Pt monte carlo pion of D0 in B0->D*#pi; p_{T} [GeV/c]; Entries",400,0,20);
700 hist_mc_D0_pion_pt->Sumw2();
701 hist_mc_D0_pion_pt->SetLineColor(6);
702 hist_mc_D0_pion_pt->SetMarkerStyle(20);
703 hist_mc_D0_pion_pt->SetMarkerSize(0.6);
704 hist_mc_D0_pion_pt->SetMarkerColor(6);
705 TH1F* histogram_mc_D0_pion_pt = (TH1F*)hist_mc_D0_pion_pt->Clone();
708 TString name_mc_D0_kaon_pt =
"mc_D0_kaon_pt";
709 TH1F* hist_mc_D0_kaon_pt =
new TH1F(name_mc_D0_kaon_pt.Data(),
"Pt monte carlo kaon of D0 in B0->D*#pi; p_{T} [GeV/c]; Entries",400,0,20);
710 hist_mc_D0_kaon_pt->Sumw2();
711 hist_mc_D0_kaon_pt->SetLineColor(6);
712 hist_mc_D0_kaon_pt->SetMarkerStyle(20);
713 hist_mc_D0_kaon_pt->SetMarkerSize(0.6);
714 hist_mc_D0_kaon_pt->SetMarkerColor(6);
715 TH1F* histogram_mc_D0_kaon_pt = (TH1F*)hist_mc_D0_kaon_pt->Clone();
720 TString name_B0s_in_analysis =
"B0s_in_analysis";
721 TH1F* hist_B0s_in_analysis =
new TH1F(name_B0s_in_analysis.Data(),
"Number of B0 to kpipipi in the Analysis; Entries",10,0,10);
722 hist_B0s_in_analysis->Sumw2();
723 hist_B0s_in_analysis->SetLineColor(6);
724 hist_B0s_in_analysis->SetMarkerStyle(20);
725 hist_B0s_in_analysis->SetMarkerSize(0.6);
726 hist_B0s_in_analysis->SetMarkerColor(6);
727 hist_B0s_in_analysis->SetStats(kTRUE);
728 hist_B0s_in_analysis->GetXaxis()->SetBinLabel(1,
"no. of B0s");
729 hist_B0s_in_analysis->GetXaxis()->SetBinLabel(2,
"no. of B0s to kpipipi");
730 hist_B0s_in_analysis->GetXaxis()->SetBinLabel(3,
"no. with all tracks in event");
731 hist_B0s_in_analysis->GetXaxis()->SetBinLabel(4,
"no. ...");
732 hist_B0s_in_analysis->GetXaxis()->SetBinLabel(5,
"no. ...");
733 hist_B0s_in_analysis->GetXaxis()->SetBinLabel(6,
"no. ...");
734 hist_B0s_in_analysis->GetXaxis()->SetBinLabel(7,
"no. ...");
735 hist_B0s_in_analysis->GetXaxis()->SetBinLabel(8,
"no. ...");
736 TH1F* hist_B0s_in_analysis_mc = (TH1F*)hist_B0s_in_analysis->Clone();
739 TString name_B0s_per_bin =
"B0s_per_bin";
740 TH1F* hist_B0s_per_bin =
new TH1F(name_B0s_per_bin.Data(),
"Number of B0 to kpipipi in the Analysis per bin; Entries",6,0,6);
741 hist_B0s_per_bin->GetXaxis()->SetBinLabel(1,
"0-3");
742 hist_B0s_per_bin->GetXaxis()->SetBinLabel(2,
"3-6");
743 hist_B0s_per_bin->GetXaxis()->SetBinLabel(3,
"6-10");
744 hist_B0s_per_bin->GetXaxis()->SetBinLabel(4,
"10-18");
745 hist_B0s_per_bin->GetXaxis()->SetBinLabel(5,
"18-30");
746 hist_B0s_per_bin->GetXaxis()->SetBinLabel(6,
"30-inf");
747 TH1F* hist_B0s_per_bin_mc = (TH1F*)hist_B0s_per_bin->Clone();
753 for (
Int_t i = 0; i < 4; i++){
762 for (
Int_t j = 0; j < 5; j++){
763 if(j==0) add_name =
"";
764 if(j==1) add_name =
"Cut";
765 if(j==2) add_name =
"MC";
766 if(j==3) add_name =
"Result";
767 if(j==4) add_name =
"MCResult";
770 TString discription_Histogram =
"";
771 Int_t numberOfBins = 0;
775 for (
Int_t k = 0; k < 11; ++k)
777 if(k==0){name_Histogram =
"ptTrack"; discription_Histogram =
"pt track; p_{T} [GeV/c]; Entries"; numberOfBins = 600; lowerBound = 0; upperBound = 30;}
778 if(k==1){name_Histogram =
"momentumTrack"; discription_Histogram =
"momentum track; p [GeV/c]; Entries"; numberOfBins = 600; lowerBound = 0; upperBound = 30;}
779 if(k==2){name_Histogram =
"energyOverMomentumTrack"; discription_Histogram =
"E/P; E/P; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 10;}
780 if(k==3){name_Histogram =
"dcaTrack"; discription_Histogram =
"dca track; distance [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 1;}
781 if(k==4){name_Histogram =
"momentumdcaTrack"; discription_Histogram =
"momentum at dca track; p_{T} [GeV/c]; Entries"; numberOfBins = 600; lowerBound = 0; upperBound = 30;}
782 if(k==5){name_Histogram =
"numberOfITS"; discription_Histogram =
"Number of ITS clusters track; [#]; Entries"; numberOfBins = 7; lowerBound = -0.5; upperBound = 6.5;}
783 if(k==6){name_Histogram =
"numberOfTPC"; discription_Histogram =
"Number of TPC clusters track; [#]; Entries"; numberOfBins = 601; lowerBound = -0.5; upperBound = 600.5;}
784 if(k==7){name_Histogram =
"pointsOnITS"; discription_Histogram =
"Number of ITS clusters track per layer; [#]; Entries"; numberOfBins = 6; lowerBound = -0.5; upperBound = 5.5;}
785 if(k==8){name_Histogram =
"nSigmaTPC"; discription_Histogram =
"n sigma TPC for track PID; sigma; Entries"; numberOfBins = 500; lowerBound = -5; upperBound = 5;}
786 if(k==9){name_Histogram =
"nSigmaTOF"; discription_Histogram =
"n sigma TOF for track PID; sigma; Entries"; numberOfBins = 500; lowerBound = -5; upperBound = 5;}
787 if(k==10){name_Histogram =
"nSigmaTPCandTOF"; discription_Histogram =
"n sigma TPC and TOF for track PID; a.u.; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 10;}
789 name_Histogram += add_name;
790 TH1F* histogram =
new TH1F(name_Histogram.Data(),discription_Histogram.Data(),numberOfBins,lowerBound,upperBound);
792 if(j%2==0) histogram->SetLineColor(6);
793 if(j%2==1) histogram->SetLineColor(4);
794 histogram->SetMarkerStyle(20);
795 histogram->SetMarkerSize(0.6);
796 if(j%2==0) histogram->SetMarkerColor(6);
797 if(j%2==1) histogram->SetMarkerColor(4);
798 TH1F* histogram_Clone = (TH1F*)histogram->Clone();
799 listout->Add(histogram_Clone);
803 TString name_ptdcaTrack =
"pt_vs_dcaTrack";
804 name_ptdcaTrack += add_name;
805 TH2F* hist_ptdcaTrack =
new TH2F(name_ptdcaTrack.Data(),
"Pt vs dca track; p_{T} [GeV/c]; distance [cm]",100,0,30,200,0,10);
806 hist_ptdcaTrack->Sumw2();
807 hist_ptdcaTrack->SetLineColor(6);
808 hist_ptdcaTrack->SetMarkerStyle(20);
809 hist_ptdcaTrack->SetMarkerSize(0.6);
810 hist_ptdcaTrack->SetMarkerColor(6);
811 TH2F* histogram_ptdcaTrack = (
TH2F*)hist_ptdcaTrack->Clone();
812 listout->Add(histogram_ptdcaTrack);
815 TString numberofparticlesperevent=
"numberofparticlesperevent";
816 numberofparticlesperevent += add_name;
817 TH1F* hist_numberofparticlesperevent =
new TH1F(numberofparticlesperevent.Data(),
"Number of particles per event; number of particles in one event; Entries",100,0,100);
818 hist_numberofparticlesperevent->Sumw2();
819 hist_numberofparticlesperevent->SetLineColor(6);
820 hist_numberofparticlesperevent->SetMarkerStyle(20);
821 hist_numberofparticlesperevent->SetMarkerSize(0.6);
822 hist_numberofparticlesperevent->SetMarkerColor(6);
823 TH1F* histogram_numberofparticlesperevent = (TH1F*)hist_numberofparticlesperevent->Clone();
824 listout->Add(histogram_numberofparticlesperevent);
828 TH1F * effectOfCuts =
new TH1F(
"effectOfCuts",
"Removal counter",18,0,18);
829 effectOfCuts->SetStats(kTRUE);
830 effectOfCuts->GetXaxis()->SetTitle(
"Cut number");
831 effectOfCuts->GetYaxis()->SetTitle(
"Particles cut");
832 effectOfCuts->GetXaxis()->SetBinLabel(1,
"total");
833 effectOfCuts->GetXaxis()->SetBinLabel(2,
"1");
834 effectOfCuts->GetXaxis()->SetBinLabel(3,
"2");
835 effectOfCuts->GetXaxis()->SetBinLabel(4,
"3");
836 effectOfCuts->GetXaxis()->SetBinLabel(5,
"4");
837 effectOfCuts->GetXaxis()->SetBinLabel(6,
"5");
838 effectOfCuts->GetXaxis()->SetBinLabel(7,
"6");
839 effectOfCuts->GetXaxis()->SetBinLabel(8,
"7");
840 effectOfCuts->GetXaxis()->SetBinLabel(9,
"8");
841 effectOfCuts->GetXaxis()->SetBinLabel(10,
"9");
842 effectOfCuts->GetXaxis()->SetBinLabel(11,
"10");
843 effectOfCuts->GetXaxis()->SetBinLabel(12,
"11");
844 effectOfCuts->GetXaxis()->SetBinLabel(13,
"12");
845 effectOfCuts->GetXaxis()->SetBinLabel(14,
"13");
846 effectOfCuts->GetXaxis()->SetBinLabel(15,
"14");
847 effectOfCuts->GetXaxis()->SetBinLabel(16,
"15");
848 effectOfCuts->GetXaxis()->SetBinLabel(17,
"16");
849 effectOfCuts->GetXaxis()->SetBinLabel(18,
"17");
850 listout->Add(effectOfCuts);
853 TH1F * effectOfCutsMC =
new TH1F(
"effectOfCutsMC",
"Removal counter",18,0,18);
854 effectOfCutsMC->SetStats(kTRUE);
855 effectOfCutsMC->GetXaxis()->SetTitle(
"Cut number");
856 effectOfCutsMC->GetYaxis()->SetTitle(
"Particles cut");
857 effectOfCutsMC->GetXaxis()->SetBinLabel(1,
"total");
858 effectOfCutsMC->GetXaxis()->SetBinLabel(2,
"1");
859 effectOfCutsMC->GetXaxis()->SetBinLabel(3,
"2");
860 effectOfCutsMC->GetXaxis()->SetBinLabel(4,
"3");
861 effectOfCutsMC->GetXaxis()->SetBinLabel(5,
"4");
862 effectOfCutsMC->GetXaxis()->SetBinLabel(6,
"5");
863 effectOfCutsMC->GetXaxis()->SetBinLabel(7,
"6");
864 effectOfCutsMC->GetXaxis()->SetBinLabel(8,
"7");
865 effectOfCutsMC->GetXaxis()->SetBinLabel(9,
"8");
866 effectOfCutsMC->GetXaxis()->SetBinLabel(10,
"9");
867 effectOfCutsMC->GetXaxis()->SetBinLabel(11,
"10");
868 effectOfCutsMC->GetXaxis()->SetBinLabel(12,
"11");
869 effectOfCutsMC->GetXaxis()->SetBinLabel(13,
"12");
870 effectOfCutsMC->GetXaxis()->SetBinLabel(14,
"13");
871 effectOfCutsMC->GetXaxis()->SetBinLabel(15,
"14");
872 effectOfCutsMC->GetXaxis()->SetBinLabel(16,
"15");
873 effectOfCutsMC->GetXaxis()->SetBinLabel(17,
"16");
874 effectOfCutsMC->GetXaxis()->SetBinLabel(18,
"17");
875 listout->Add(effectOfCutsMC);
878 TString name_particle_pdg =
"particle_pdg";
879 TH1F* hist_particle_pdg =
new TH1F(name_particle_pdg.Data(),
"Pdg code particle; pdg code; Entries",2000,-0.5,1999.5);
880 hist_particle_pdg->Sumw2();
881 hist_particle_pdg->SetLineColor(6);
882 hist_particle_pdg->SetMarkerStyle(20);
883 hist_particle_pdg->SetMarkerSize(0.6);
884 hist_particle_pdg->SetMarkerColor(6);
885 TH1F* histogram_particle_pdg = (TH1F*)hist_particle_pdg->Clone();
886 listout->Add(histogram_particle_pdg);
889 TString name_particle_mother_pdg =
"particle_mother_pdg";
890 TH1F* hist_particle_mother_pdg =
new TH1F(name_particle_mother_pdg.Data(),
"Pdg code particle mother; pdg code; Entries",2000,-0.5,1999.5);
891 hist_particle_mother_pdg->Sumw2();
892 hist_particle_mother_pdg->SetLineColor(6);
893 hist_particle_mother_pdg->SetMarkerStyle(20);
894 hist_particle_mother_pdg->SetMarkerSize(0.6);
895 hist_particle_mother_pdg->SetMarkerColor(6);
896 TH1F* histogram_particle_mother_pdg = (TH1F*)hist_particle_mother_pdg->Clone();
897 listout->Add(histogram_particle_mother_pdg);
900 TString name_ptB0_vs_ptTrack =
"ptB0_vs_ptTrack";
901 TH2F* hist_ptB0_vs_ptTrack =
new TH2F(name_ptB0_vs_ptTrack.Data(),
"Pt B0 vs Pt ; p_{T} B0 [GeV/c]; p_{T} track [GeV/c]",100,0,30,100,0,30);
902 hist_ptB0_vs_ptTrack->Sumw2();
903 hist_ptB0_vs_ptTrack->SetLineColor(6);
904 hist_ptB0_vs_ptTrack->SetMarkerStyle(20);
905 hist_ptB0_vs_ptTrack->SetMarkerSize(0.6);
906 hist_ptB0_vs_ptTrack->SetMarkerColor(6);
907 TH2F* histogram_ptB0_vs_ptTrack = (
TH2F*)hist_ptB0_vs_ptTrack->Clone();
908 listout->Add(histogram_ptB0_vs_ptTrack);
911 TString name_ptB0_vs_ptTrackMC =
"ptB0_vs_ptTrackMC";
912 TH2F* hist_ptB0_vs_ptTrackMC =
new TH2F(name_ptB0_vs_ptTrackMC.Data(),
"Pt B0 vs Pt ; p_{T} B0 [GeV/c]; p_{T} track [GeV/c]",100,0,30,100,0,30);
913 hist_ptB0_vs_ptTrackMC->Sumw2();
914 hist_ptB0_vs_ptTrackMC->SetLineColor(4);
915 hist_ptB0_vs_ptTrackMC->SetMarkerStyle(20);
916 hist_ptB0_vs_ptTrackMC->SetMarkerSize(0.6);
917 hist_ptB0_vs_ptTrackMC->SetMarkerColor(6);
918 TH2F* histogram_ptB0_vs_ptTrackMC = (
TH2F*)hist_ptB0_vs_ptTrackMC->Clone();
919 listout->Add(histogram_ptB0_vs_ptTrackMC);
924 for (
Int_t i = 0; i < 6; i++){
928 Int_t nHistogramSets = 0;
936 for (
Int_t j = 0; j < nHistogramSets; j++){
939 if(j==0) add_name =
"";
940 if(j==1) add_name =
"MC";
941 if(j==2) add_name =
"Cut";
942 if(j==3) add_name =
"MCCut";
943 if(j==4) add_name =
"Result";
944 if(j==5) add_name =
"MCResult";
945 if(j%2==0 && j>5) {add_name =
"_ptbin_"; add_name +=
fPtBinLimits[(j-6)/2]; add_name +=
"_to_"; add_name +=
fPtBinLimits[(j-6)/2 + 1];}
946 if(j%2==1 && j>5) {add_name =
"MC_ptbin_"; add_name +=
fPtBinLimits[(j-7)/2]; add_name +=
"_to_"; add_name +=
fPtBinLimits[(j-7)/2 + 1];}
966 TString discription_Histogram =
"";
967 Int_t numberOfBins = 0;
970 Int_t numberOfBinsTwo = 0;
974 for (
Int_t k = 0; k < 46; ++k)
976 if(k==0){name_Histogram =
"ptMother"; discription_Histogram =
"pt mother; p_{T} [GeV/c]; Entries"; numberOfBins = 300; lowerBound = 0; upperBound = 30;}
977 if(k==1){name_Histogram =
"ptFirstDaughter"; discription_Histogram =
"pt first daughter; p_{T} [GeV/c]; Entries"; numberOfBins = 300; lowerBound = 0; upperBound = 30;}
978 if(k==2){name_Histogram =
"ptSecondDaughter"; discription_Histogram =
"pt second daughter; p_{T} [GeV/c]; Entries"; numberOfBins = 300; lowerBound = 0; upperBound = 30;}
979 if(k==3){name_Histogram =
"etaMother"; discription_Histogram =
"eta mother; #eta; Entries"; numberOfBins = 100; lowerBound = -2; upperBound = 2;}
980 if(k==4){name_Histogram =
"phiMother"; discription_Histogram =
"phi mother; #phi; Entries"; numberOfBins = 25; lowerBound = 0; upperBound = 2*TMath::Pi();}
981 if(k==5){name_Histogram =
"d0Mother"; discription_Histogram =
"d0 mother; [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 1.0;}
982 if(k==6){name_Histogram =
"d0FirstDaughter"; discription_Histogram =
"d0 first daughter; [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 1;}
984 if(k==7){name_Histogram =
"d0SecondDaughter"; discription_Histogram =
"d0 second daughter; [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 1;}
986 if(k==8){name_Histogram =
"pointingAngleMother"; discription_Histogram =
"pointing angle; [Cos(#theta)]; Entries"; numberOfBins = 100; lowerBound = -1; upperBound = 1;}
987 if(k==9){name_Histogram =
"impactProduct"; discription_Histogram =
"impact product; [cm^{2}]; Entries"; numberOfBins = 10000; lowerBound = -0.01; upperBound = 0.01;}
988 if(k==10){name_Histogram =
"impactProductXY"; discription_Histogram =
"impact product XY; [cm^{2}]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 0.5;}
989 if(k==11){name_Histogram =
"invariantMassMother"; discription_Histogram =
"mass mother candidate; m [GeV/c^{2}]; Entries"; numberOfBins = 50000; lowerBound = 0; upperBound = 10;}
990 if(k==12){name_Histogram =
"deltaMassMother"; discription_Histogram =
"mass mother candidate; m [GeV/c^{2}]; Entries"; numberOfBins = 50000; lowerBound = 0; upperBound = 10;}
991 if(k==13){name_Histogram =
"dcaMother"; discription_Histogram =
"dca mother; distance [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 0.25;}
992 if(k==14){name_Histogram =
"vertexDistance"; discription_Histogram =
"vertex distance between mother and primary vertex; distance [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 1;}
993 if(k==15){name_Histogram =
"normDecayLength"; discription_Histogram =
"Normalized decay length w.r.t primary vertex; [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 50;}
994 if(k==16){name_Histogram =
"pseudoProperDecayTime"; discription_Histogram =
"Pseudo Proper Decay Time w.r.t primary vertex; [a.u.]; Entries"; numberOfBins = 10000; lowerBound = -10; upperBound = 10;}
995 if(k==17){name_Histogram =
"DecayTime"; discription_Histogram =
"Decay Time w.r.t primary vertex; [a.u.]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 0.00000001;}
996 if(k==18){name_Histogram =
"normDecayTime"; discription_Histogram =
"Normalized Decay Time w.r.t primary vertex; [a.u.]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 0.0000001;}
997 if(k==19){name_Histogram =
"angleMotherFirstDaughter"; discription_Histogram =
"flight angle mother and first daughter; [Cos(#phi)]; Entries"; numberOfBins = 1000; lowerBound = -1; upperBound = 1;}
998 if(k==20){name_Histogram =
"angleMotherSecondDaughter"; discription_Histogram =
"flight angle mother and second daughter; [Cos(#phi)]; Entries"; numberOfBins = 2000; lowerBound = 0.5; upperBound = 1;}
999 if(k==21){name_Histogram =
"angleBetweenBothDaughters"; discription_Histogram =
"angle between both daughters; [Cos(#phi)]; Entries"; numberOfBins = 1000; lowerBound = -1; upperBound = 1;}
1000 if(k==22){name_Histogram =
"cosThetaStar"; discription_Histogram =
"cosThetaStar; [Cos(#theta*)]; Entries"; numberOfBins = 1000; lowerBound = -2; upperBound = 2;}
1003 if(k==23){
if(i==0 || i==3 || i==4){name_Histogram =
"pointingAngleToDStar"; discription_Histogram =
"Pointing angle w.r.t. DStar decay vertex; [Cos(#theta)]; Entries"; numberOfBins = 1000; lowerBound = -1; upperBound = 1;}
1005 if(k==24){
if(i==0 || i==3 || i==4){name_Histogram =
"d0MotherToDStar"; discription_Histogram =
"d0 Mother w.r.t. DStar decay vertex; [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 1;}
1007 if(k==25){
if(i==0 || i==3 || i==4){name_Histogram =
"d0FirstDaughterToDStar"; discription_Histogram =
"d0 first daughter w.r.t. DStar decay vertex; [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 1;}
1009 if(k==26){
if(i==0 || i==3 || i==4){name_Histogram =
"d0SecondDaughterToDStar"; discription_Histogram =
"d0 second daughter w.r.t. DStar decay vertex; [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 1;}
1011 if(k==27){
if(i==0 || i==3 || i==4){name_Histogram =
"impactProductToDStar"; discription_Histogram =
"impact product w.r.t. DStar decay vertex; [cm]; Entries"; numberOfBins = 10000; lowerBound = -0.1; upperBound = 0.1;}
1013 if(k==28){
if(i==0 || i==3 || i==4){name_Histogram =
"impactProductXYToDStar"; discription_Histogram =
"impact product XY w.r.t. DStar decay vertex; [cm^{2}]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 0.5;}
1015 if(k==29){
if(i==0 || i==3 || i==4){name_Histogram =
"normDecayLengthToDStar"; discription_Histogram =
"Normalized decay length w.r.t. DStar decay vertex; [cm]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 50;}
1017 if(k==30){
if(i==0 || i==3 || i==4){name_Histogram =
"pseudoProperDecayTimeToDStar"; discription_Histogram =
"Pseudo Proper Decay Time w.r.t DStar vertex; [a.u.]; Entries"; numberOfBins = 10000; lowerBound = -1; upperBound = 1;}
1019 if(k==31){
if(i==0 || i==3 || i==4){name_Histogram =
"DecayTimeToDStar"; discription_Histogram =
"Decay Time w.r.t DStar vertex; [a.u.]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 0.00000001;}
1021 if(k==32){
if(i==0 || i==3 || i==4){name_Histogram =
"normDecayTimeToDStar"; discription_Histogram =
"Normalized Decay Time w.r.t DStar vertex; [a.u.]; Entries"; numberOfBins = 1000; lowerBound = 0; upperBound = 0.00000001;}
1024 if(k==33){name_Histogram =
"topomaticFirstDaughter"; discription_Histogram =
"topomatic d0 first daughter; [cm]; Entries"; numberOfBins = 10000; lowerBound = -10; upperBound = 10;}
1025 if(k==34){name_Histogram =
"topomaticSecondDaughter"; discription_Histogram =
"topomatic d0 second daughter; [cm]; Entries"; numberOfBins = 10000; lowerBound = -10; upperBound = 10;}
1026 if(k==35){name_Histogram =
"topomaticMax"; discription_Histogram =
"Max topomatic; [cm]; Entries"; numberOfBins = 10000; lowerBound = -10; upperBound = 10;}
1027 if(k==36){name_Histogram =
"topomaticMin"; discription_Histogram =
"Min topomatic; [cm]; Entries"; numberOfBins = 10000; lowerBound = -10; upperBound = 10;}
1029 if(k==37){name_Histogram =
"ptFirstDaughter_vs_ptSecondDaughter"; discription_Histogram =
"Pt first daughter vs Pt second daughter; p_{T} first daughter [GeV/c]; p_{T} second daughter [GeV/c]"; numberOfBins = 200; lowerBound = 0; upperBound = 30; numberOfBinsTwo = 200; lowerBoundTwo = 0; upperBoundTwo = 30;}
1030 if(k==38){name_Histogram =
"ptMother_vs_ptFirstDaughter"; discription_Histogram =
"Pt mother vs Pt first daughter; p_{T} Mother [GeV/c]; p_{T} Daughter [GeV/c]"; numberOfBins = 200; lowerBound = 0; upperBound = 30; numberOfBinsTwo = 200; lowerBoundTwo = 0; upperBoundTwo = 30;}
1031 if(k==39){name_Histogram =
"ptMother_vs_ptSecondDaughter"; discription_Histogram =
"Pt mother vs Pt second daughter; p_{T} Mother [GeV/c]; p_{T} Daughter [GeV/c]"; numberOfBins = 200; lowerBound = 0; upperBound = 30; numberOfBinsTwo = 200; lowerBoundTwo = 0; upperBoundTwo = 30;}
1032 if(k==40){name_Histogram =
"ptMother_vs_d0FirstDaughter"; discription_Histogram =
"Pt mother vs d0 first daughter; p_{T} Mother [GeV/c]; distance [cm]"; numberOfBins = 50; lowerBound = 0; upperBound = 30; numberOfBinsTwo = 50; lowerBoundTwo = 0; upperBoundTwo = 0.01;}
1033 if(k==41){name_Histogram =
"ptMother_vs_d0SecondDaughter"; discription_Histogram =
"Pt mother vs d0 second daughter; p_{T} Mother [GeV/c]; distance [cm]"; numberOfBins = 50; lowerBound = 0; upperBound = 30; numberOfBinsTwo = 50; lowerBoundTwo = 0; upperBoundTwo = 0.01;}
1034 if(k==42){name_Histogram =
"ptMother_vs_PointingAngle"; discription_Histogram =
"Pt mother vs Pointing Angle; p_{T} [GeV/c]; [Cos()]"; numberOfBins = 50; lowerBound = 0; upperBound = 30; numberOfBinsTwo = 50; lowerBoundTwo = 0; upperBoundTwo = 1;}
1035 if(k==43){name_Histogram =
"ptMother_vs_ImpactProduct"; discription_Histogram =
"Pt mother vs Impact product; p_{T} [GeV/c]; distance [cm]"; numberOfBins = 50; lowerBound = 0; upperBound = 30; numberOfBinsTwo = 100; lowerBoundTwo = -0.5; upperBoundTwo = 0.5;}
1036 if(k==44){name_Histogram =
"Momentum_Mother_vs_Angle_one"; discription_Histogram =
"Momentum Mother vs Angle First Daughter; P [GeV/c]; Angle [Cos(#phi)]"; numberOfBins = 50; lowerBound = 0; upperBound = 30; numberOfBinsTwo = 100; lowerBoundTwo = -1; upperBoundTwo = 1;}
1037 if(k==45){name_Histogram =
"Momentum_Mother_vs_Angle_two"; discription_Histogram =
"Momentum Mother vs Angle Second Daughter; P [GeV/c]; Angle [Cos(#phi)]"; numberOfBins = 50; lowerBound = 0; upperBound = 30; numberOfBinsTwo = 100; lowerBoundTwo = -1; upperBoundTwo = 1;}
1040 name_Histogram += add_name;
1041 TH1F* histogram =
new TH1F(name_Histogram.Data(),discription_Histogram.Data(),numberOfBins,lowerBound,upperBound);
1043 if(j%2==0) histogram->SetLineColor(6);
1044 if(j%2==1) histogram->SetLineColor(4);
1045 histogram->SetMarkerStyle(20);
1046 histogram->SetMarkerSize(0.6);
1047 if(j%2==0) histogram->SetMarkerColor(6);
1048 if(j%2==1) histogram->SetMarkerColor(4);
1049 TH1F* histogram_Clone = (TH1F*)histogram->Clone();
1050 listout->Add(histogram_Clone);
1054 name_Histogram += add_name;
1055 TH2F* histogram =
new TH2F(name_Histogram.Data(),discription_Histogram.Data(),numberOfBins,lowerBound,upperBound,numberOfBinsTwo,lowerBoundTwo,upperBoundTwo);
1057 if(j%2==0) histogram->SetLineColor(6);
1058 if(j%2==1) histogram->SetLineColor(4);
1059 histogram->SetMarkerStyle(20);
1060 histogram->SetMarkerSize(0.6);
1061 histogram->SetMarkerColor(6);
1062 TH2F* histogram_Clone = (
TH2F*)histogram->Clone();
1063 listout->Add(histogram_Clone);
1069 TH1F * effectOfCuts =
new TH1F(
"effectOfCuts",
"Removal counter",100,0,100);
1070 effectOfCuts->SetStats(kTRUE);
1071 effectOfCuts->GetXaxis()->SetTitle(
"Cut number");
1072 effectOfCuts->GetYaxis()->SetTitle(
"Particles cut");
1073 effectOfCuts->GetXaxis()->SetBinLabel(1,
"total");
1074 for (
Int_t i = 1; i < 100; ++i)
1078 effectOfCuts->GetXaxis()->SetBinLabel(i+1,integerText);
1080 listout->Add(effectOfCuts);
1083 TH1F * effectOfCutsMC =
new TH1F(
"effectOfCutsMC",
"Removal counter",100,0,100);
1084 effectOfCutsMC->SetStats(kTRUE);
1085 effectOfCutsMC->GetXaxis()->SetTitle(
"Cut number");
1086 effectOfCutsMC->GetYaxis()->SetTitle(
"Particles cut");
1087 effectOfCutsMC->GetXaxis()->SetBinLabel(1,
"total");
1088 for (
Int_t i = 1; i < 100; ++i)
1092 effectOfCutsMC->GetXaxis()->SetBinLabel(i+1,integerText);
1094 listout->Add(effectOfCutsMC);
1097 TString name_particle_pdg =
"particle_pdg";
1098 TH1F* hist_particle_pdg =
new TH1F(name_particle_pdg.Data(),
"Pdg code particle; pdg code; Entries",2000,-0.5,1999.5);
1099 hist_particle_pdg->Sumw2();
1100 hist_particle_pdg->SetLineColor(6);
1101 hist_particle_pdg->SetMarkerStyle(20);
1102 hist_particle_pdg->SetMarkerSize(0.6);
1103 hist_particle_pdg->SetMarkerColor(6);
1104 TH1F* histogram_particle_pdg = (TH1F*)hist_particle_pdg->Clone();
1105 listout->Add(histogram_particle_pdg);
1108 TString name_particle_mother_pdg =
"particle_mother_pdg";
1109 TH1F* hist_particle_mother_pdg =
new TH1F(name_particle_mother_pdg.Data(),
"Pdg code particle mother; pdg code; Entries",2000,-0.5,1999.5);
1110 hist_particle_mother_pdg->Sumw2();
1111 hist_particle_mother_pdg->SetLineColor(6);
1112 hist_particle_mother_pdg->SetMarkerStyle(20);
1113 hist_particle_mother_pdg->SetMarkerSize(0.6);
1114 hist_particle_mother_pdg->SetMarkerColor(6);
1115 TH1F* histogram_particle_mother_pdg = (TH1F*)hist_particle_mother_pdg->Clone();
1116 listout->Add(histogram_particle_mother_pdg);
1119 TString name_distance_vertex_from_real =
"distance_vertex_from_real";
1120 TH1F* hist_distance_vertex_from_real =
new TH1F(name_distance_vertex_from_real.Data(),
"Distance reconstructed vertex from real vertex; distance [cm]; Entries",100,0,1);
1121 hist_distance_vertex_from_real->Sumw2();
1122 hist_distance_vertex_from_real->SetLineColor(6);
1123 hist_distance_vertex_from_real->SetMarkerStyle(20);
1124 hist_distance_vertex_from_real->SetMarkerSize(0.6);
1125 hist_distance_vertex_from_real->SetMarkerColor(6);
1126 TH1F* histogram_distance_vertex_from_real = (TH1F*)hist_distance_vertex_from_real->Clone();
1127 listout->Add(histogram_distance_vertex_from_real);
1130 TString name_distance_vertex_from_real_new =
"distance_vertex_from_real_new";
1131 TH1F* hist_distance_vertex_from_real_new =
new TH1F(name_distance_vertex_from_real_new.Data(),
"Distance reconstructed vertex from real vertex; distance [cm]; Entries",100,0,1);
1132 hist_distance_vertex_from_real_new->Sumw2();
1133 hist_distance_vertex_from_real_new->SetLineColor(6);
1134 hist_distance_vertex_from_real_new->SetMarkerStyle(20);
1135 hist_distance_vertex_from_real_new->SetMarkerSize(0.6);
1136 hist_distance_vertex_from_real_new->SetMarkerColor(6);
1137 TH1F* histogram_distance_vertex_from_real_new = (TH1F*)hist_distance_vertex_from_real_new->Clone();
1138 listout->Add(histogram_distance_vertex_from_real_new);
1141 TString name_momentum_resolution =
"momentum_resolution";
1142 TH1F* hist_momentum_resolution =
new TH1F(name_momentum_resolution.Data(),
"Momentum resolution; difference between real and reconstructed momentum [GeV/c]; Entries",1000,0,1);
1143 hist_momentum_resolution->Sumw2();
1144 hist_momentum_resolution->SetLineColor(6);
1145 hist_momentum_resolution->SetMarkerStyle(20);
1146 hist_momentum_resolution->SetMarkerSize(0.6);
1147 hist_momentum_resolution->SetMarkerColor(6);
1148 TH1F* histogram_momentum_resolution = (TH1F*)hist_momentum_resolution->Clone();
1149 listout->Add(histogram_momentum_resolution);
1156 if(k==0) ptBinMother =
"";
1157 if(k==1) ptBinMother =
"_ptbin_6_to_inf";
1158 if(k==2) ptBinMother =
"_ptbin_3_to_inf";
1159 if(k>2) {ptBinMother +=
"_ptbin_"; ptBinMother +=
fPtBinLimits[k-3]; ptBinMother +=
"_to_"; ptBinMother +=
fPtBinLimits[k-2];}
1161 TString name_deltaMassMother =
"deltaInvMassB0";
1162 name_deltaMassMother += ptBinMother;
1163 TH1F* hist_deltaMassMother =
new TH1F(name_deltaMassMother.Data(),
"mass mother candidate; m [GeV/c^2]; Entries",2000,0,20);
1164 hist_deltaMassMother->Sumw2();
1165 hist_deltaMassMother->SetLineColor(6);
1166 hist_deltaMassMother->SetMarkerStyle(20);
1167 hist_deltaMassMother->SetMarkerSize(0.6);
1168 hist_deltaMassMother->SetMarkerColor(6);
1169 TH1F* histogram_deltaMassMother = (TH1F*)hist_deltaMassMother->Clone();
1172 for (
Int_t i = 0; i < 3; ++i){
1174 if(i==0) signName =
"";
1175 if(i==1) signName =
"_SameSign";
1176 if(i==2) signName =
"_SignSum";
1177 TString name_invariantMassMother =
"invariantMassB0";
1178 name_invariantMassMother += ptBinMother + signName;
1179 TH1F* hist_invariantMassMother =
new TH1F(name_invariantMassMother.Data(),
"mass mother candidate; m [GeV/c^2]; Entries",2000,0,20);
1180 hist_invariantMassMother->Sumw2();
1181 hist_invariantMassMother->SetLineColor(6);
1182 hist_invariantMassMother->SetMarkerStyle(20);
1183 hist_invariantMassMother->SetMarkerSize(0.6);
1184 hist_invariantMassMother->SetMarkerColor(6);
1185 TH1F* histogram_invariantMassMother = (TH1F*)hist_invariantMassMother->Clone();
1190 TString name_cutEffectBackground =
"cutEffectBackground";
1191 TH2I* hist_cutEffectBackground =
new TH2I(name_cutEffectBackground.Data(),
"Effect of Cuts on background; cut number; cut number",99,0,99,99,0,99);
1192 for (
int i = 0; i < 99; ++i)
1196 hist_cutEffectBackground->GetXaxis()->SetBinLabel(i+1,integerText);
1197 hist_cutEffectBackground->GetYaxis()->SetBinLabel(i+1,integerText);
1199 TH2I* histogram_cutEffectBackground = (TH2I*)hist_cutEffectBackground->Clone();
1202 TString name_cutEffectSignal =
"cutEffectSignal";
1203 TH2I* hist_cutEffectSignal =
new TH2I(name_cutEffectSignal.Data(),
"Effect of Cuts on Signal; cut number; cut number",99,0,99,99,0,99);
1204 for (
Int_t i = 0; i < 99; ++i)
1208 hist_cutEffectSignal->GetXaxis()->SetBinLabel(i+1,integerText);
1209 hist_cutEffectSignal->GetYaxis()->SetBinLabel(i+1,integerText);
1211 TH2I* histogram_cutEffectSignal = (TH2I*)hist_cutEffectSignal->Clone();
1214 TString name_cutEffectUniqueBackground =
"cutEffectUniqueBackground";
1215 TH1I* hist_cutEffectUniqueBackground =
new TH1I(name_cutEffectUniqueBackground.Data(),
"Effect of Cuts on Signal; cut number; cut number",99,0,99);
1216 for (
Int_t i = 0; i < 99; ++i)
1220 hist_cutEffectUniqueBackground->GetXaxis()->SetBinLabel(i+1,integerText);
1222 TH1I* histogram_cutEffectUniqueBackground = (
TH1I*)hist_cutEffectUniqueBackground->Clone();
1223 fOutputB0MC->Add(histogram_cutEffectUniqueBackground);
1225 TString name_cutEffectUniqueSignal =
"cutEffectUniqueSignal";
1226 TH1I* hist_cutEffectUniqueSignal =
new TH1I(name_cutEffectUniqueSignal.Data(),
"Effect of Cuts on Signal; cut number; cut number",99,0,99);
1227 for (
Int_t i = 0; i < 99; ++i)
1231 hist_cutEffectUniqueSignal->GetXaxis()->SetBinLabel(i+1,integerText);
1233 TH1I* histogram_cutEffectUniqueSignal = (
TH1I*)hist_cutEffectUniqueSignal->Clone();
1234 fOutputB0MC->Add(histogram_cutEffectUniqueSignal);
1236 TString name_totalITSBackground =
"totalITSBackground";
1237 TH1F* hist_totalITSBackground =
new TH1F(name_totalITSBackground.Data(),
"Total nr. of ITS hits for the daughters; number [#]; Entries",30,0,30);
1238 hist_totalITSBackground->Sumw2();
1239 hist_totalITSBackground->SetLineColor(6);
1240 hist_totalITSBackground->SetMarkerStyle(20);
1241 hist_totalITSBackground->SetMarkerSize(0.6);
1242 hist_totalITSBackground->SetMarkerColor(6);
1243 TH1F* histogram_totalITSBackground = (TH1F*)hist_totalITSBackground->Clone();
1246 TString name_totalITSSignal =
"totalITSSignal";
1247 TH1F* hist_totalITSSignal =
new TH1F(name_totalITSSignal.Data(),
"Total nr. of ITS hits for the daughters; number [#]; Entries",30,0,30);
1248 hist_totalITSSignal->Sumw2();
1249 hist_totalITSSignal->SetLineColor(6);
1250 hist_totalITSSignal->SetMarkerStyle(20);
1251 hist_totalITSSignal->SetMarkerSize(0.6);
1252 hist_totalITSSignal->SetMarkerColor(6);
1253 TH1F* histogram_totalITSSignal = (TH1F*)hist_totalITSSignal->Clone();
1256 TString name_totalTPCBackground =
"totalTPCBackground";
1257 TH1F* hist_totalTPCBackground =
new TH1F(name_totalTPCBackground.Data(),
"Total nr. of TPC hits for the daughters; number [#]; Entries",1000,0,1000);
1258 hist_totalTPCBackground->Sumw2();
1259 hist_totalTPCBackground->SetLineColor(6);
1260 hist_totalTPCBackground->SetMarkerStyle(20);
1261 hist_totalTPCBackground->SetMarkerSize(0.6);
1262 hist_totalTPCBackground->SetMarkerColor(6);
1263 TH1F* histogram_totalTPCBackground = (TH1F*)hist_totalTPCBackground->Clone();
1266 TString name_totalTPCSignal =
"totalTPCSignal";
1267 TH1F* hist_totalTPCSignal =
new TH1F(name_totalTPCSignal.Data(),
"Total nr. of TPC hits for the daughters; number [#]; Entries",1000,0,1000);
1268 hist_totalTPCSignal->Sumw2();
1269 hist_totalTPCSignal->SetLineColor(6);
1270 hist_totalTPCSignal->SetMarkerStyle(20);
1271 hist_totalTPCSignal->SetMarkerSize(0.6);
1272 hist_totalTPCSignal->SetMarkerColor(6);
1273 TH1F* histogram_totalTPCSignal = (TH1F*)hist_totalTPCSignal->Clone();
1276 TString name_totalSigmaPIDBackground =
"totalSigmaPIDBackground";
1277 TH1F* hist_totalSigmaPIDBackground =
new TH1F(name_totalSigmaPIDBackground.Data(),
"Total sigma of TPC and TOF PID for the daughters; number [#]; Entries",1000,0,100);
1278 hist_totalSigmaPIDBackground->Sumw2();
1279 hist_totalSigmaPIDBackground->SetLineColor(6);
1280 hist_totalSigmaPIDBackground->SetMarkerStyle(20);
1281 hist_totalSigmaPIDBackground->SetMarkerSize(0.6);
1282 hist_totalSigmaPIDBackground->SetMarkerColor(6);
1283 TH1F* histogram_totalSigmaPIDBackground = (TH1F*)hist_totalSigmaPIDBackground->Clone();
1284 fOutputB0MC->Add(histogram_totalSigmaPIDBackground);
1286 TString name_totalSigmaPIDSignal =
"totalSigmaPIDSignal";
1287 TH1F* hist_totalSigmaPIDSignal =
new TH1F(name_totalSigmaPIDSignal.Data(),
"Total sigma of TPC and TOF PID for the daughters; number [#]; Entries",1000,0,100);
1288 hist_totalSigmaPIDSignal->Sumw2();
1289 hist_totalSigmaPIDSignal->SetLineColor(6);
1290 hist_totalSigmaPIDSignal->SetMarkerStyle(20);
1291 hist_totalSigmaPIDSignal->SetMarkerSize(0.6);
1292 hist_totalSigmaPIDSignal->SetMarkerColor(6);
1293 TH1F* histogram_totalSigmaPIDSignal = (TH1F*)hist_totalSigmaPIDSignal->Clone();
1303 AliESDVertex *vertexESD = 0;
1304 AliAODVertex *vertexAOD = 0;
1306 AliVertexerTracks *vertexer =
new AliVertexerTracks(bField);
1309 vertexer->SetVtxStart((AliESDVertex*)primary);
1310 vertexESD = (AliESDVertex*)vertexer->VertexForSelectedESDTracks(tracks);
1312 delete vertexer; vertexer=NULL;
1314 if(!vertexESD)
return vertexAOD;
1317 if(vertexESD->GetNContributors()!=tracks->GetEntriesFast()) {
1319 delete vertexESD; vertexESD=NULL;
1329 for(
Int_t a=0;a<3;a++)pos[a]=0.;
1330 for(
Int_t b=0;b<6;b++)cov[b]=0.;
1333 vertexESD->GetXYZ(pos);
1334 vertexESD->GetCovMatrix(cov);
1337 Double_t vertRadius2=pos[0]*pos[0]+pos[1]*pos[1];
1340 delete vertexESD; vertexESD=NULL;
1344 chi2perNDF = vertexESD->GetChi2toNDF();
1345 dispersion = vertexESD->GetDispersion();
1346 delete vertexESD; vertexESD=NULL;
1348 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF,0x0,-1,AliAODVertex::kUndef,nprongs);
1355 TMatrix &particleMatrix = *B0toDStarPiLabelMatrix;
1356 for (
Int_t i=0; i<mcTrackArray->GetEntriesFast(); i++){
1358 Int_t mcLabelPionB0 = 0;
1359 Int_t mcLabelPionDStar = 0;
1360 Int_t mcLabelPionD0 = 0;
1361 Int_t mcLabelKaon = 0;
1362 Int_t mcLabelD0 = 0;
1363 Int_t mcLabelDStar = 0;
1364 Int_t mcLabelB0 = 0;
1369 Bool_t mcPionB0Present = kFALSE;
1370 Bool_t mcPionDStarPresent = kFALSE;
1371 Bool_t mcPionD0Present = kFALSE;
1372 Bool_t mcKaonPresent = kFALSE;
1375 AliAODMCParticle *mcTrackParticle =
dynamic_cast< AliAODMCParticle*
>(mcTrackArray->At(i));
1376 Int_t pdgCodeMC=TMath::Abs(mcTrackParticle->GetPdgCode());
1378 if (pdgCodeMC==511){
1380 mcLabelB0 = mcTrackParticle->GetLabel();
1381 Int_t nDaughterB0 = mcTrackParticle->GetNDaughters();
1382 ptMC[0] = mcTrackParticle->Pt();
1384 TString fillthis=
"B0s_in_analysis";
1385 ((TH1F*)(listout->FindObject(fillthis)))->Fill(0);
1388 for(
Int_t iDaughterB0=0; iDaughterB0<2; iDaughterB0++){
1390 AliAODMCParticle* daughterB0 = (AliAODMCParticle*)mcTrackArray->At(mcTrackParticle->GetDaughter(iDaughterB0));
1391 if(!daughterB0)
break;
1392 Int_t pdgCodeDaughterB0=TMath::Abs(daughterB0->GetPdgCode());
1394 if (pdgCodeDaughterB0==211){
1395 mcLabelPionB0 = daughterB0->GetLabel();
1396 mcPionB0Present = kTRUE;
1397 ptMC[1] = daughterB0->Pt();
1399 }
else if (pdgCodeDaughterB0==413){
1400 mcLabelDStar = daughterB0->GetLabel();
1401 Int_t nDaughterDStar = daughterB0->GetNDaughters();
1402 ptMC[2] = daughterB0->Pt();
1404 if(nDaughterDStar==2){
1405 for(
Int_t iDaughterDStar=0; iDaughterDStar<2; iDaughterDStar++){
1407 AliAODMCParticle* daughterDStar = (AliAODMCParticle*)mcTrackArray->At(daughterB0->GetDaughter(iDaughterDStar));
1408 if(!daughterDStar)
break;
1409 Int_t pdgCodeDaughterDStar=TMath::Abs(daughterDStar->GetPdgCode());
1411 if (pdgCodeDaughterDStar==211){
1412 mcLabelPionDStar = daughterDStar->GetLabel();
1413 mcPionDStarPresent = kTRUE;
1414 ptMC[3] = daughterDStar->Pt();
1416 }
else if (pdgCodeDaughterDStar==421){
1417 mcLabelD0 = daughterDStar->GetLabel();
1418 Int_t nDaughterD0 = daughterDStar->GetNDaughters();
1419 ptMC[4] = daughterDStar->Pt();
1422 for(
Int_t iDaughterD0=0; iDaughterD0<2; iDaughterD0++){
1424 AliAODMCParticle* daughterD0 = (AliAODMCParticle*)mcTrackArray->At(daughterDStar->GetDaughter(iDaughterD0));
1425 if(!daughterD0)
break;
1426 Int_t pdgCodeDaughterD0=TMath::Abs(daughterD0->GetPdgCode());
1428 if (pdgCodeDaughterD0==211){
1429 mcLabelPionD0 = daughterD0->GetLabel();
1430 ptMC[5] = daughterD0->Pt();
1431 mcPionD0Present = kTRUE;
1433 }
else if (pdgCodeDaughterD0==321){
1434 mcLabelKaon = daughterD0->GetLabel();
1435 mcKaonPresent = kTRUE;
1436 ptMC[6] = daughterD0->Pt();
1449 if (mcPionB0Present && mcPionDStarPresent && mcPionD0Present && mcKaonPresent){
1450 Int_t rows = B0toDStarPiLabelMatrix->GetNrows();
1452 B0toDStarPiLabelMatrix->ResizeTo(rows+1,7);
1453 particleMatrix(rows,0) = mcLabelPionB0;
1454 particleMatrix(rows,1) = mcLabelPionDStar;
1455 particleMatrix(rows,2) = mcLabelPionD0;
1456 particleMatrix(rows,3) = mcLabelKaon;
1457 particleMatrix(rows,4) = mcLabelD0;
1458 particleMatrix(rows,5) = mcLabelDStar;
1459 particleMatrix(rows,6) = mcLabelB0;
1462 TString fillthis=
"B0s_in_analysis";
1463 ((TH1F*)(listout->FindObject(fillthis)))->Fill(1);
1465 fillthis=
"B0s_per_bin";
1466 if(0.0 < ptMC[0] && ptMC[0] < 3.0) {((TH1F*)(listout->FindObject(fillthis)))->Fill(0);}
1467 if(3.0 < ptMC[0] && ptMC[0] < 6.0) {((TH1F*)(listout->FindObject(fillthis)))->Fill(1);}
1468 if(6.0 < ptMC[0] && ptMC[0] < 10.0) {((TH1F*)(listout->FindObject(fillthis)))->Fill(2);}
1469 if(10.0 < ptMC[0] && ptMC[0] < 18.0) {((TH1F*)(listout->FindObject(fillthis)))->Fill(3);}
1470 if(18.0 < ptMC[0] && ptMC[0] < 30.0) {((TH1F*)(listout->FindObject(fillthis)))->Fill(4);}
1471 if(30.0 < ptMC[0]) {((TH1F*)(listout->FindObject(fillthis)))->Fill(5);}
1473 fillthis=
"mc_B0_pt";
1474 ((TH1F*)(listout->FindObject(fillthis)))->Fill(ptMC[0]);
1475 fillthis=
"mc_B0_pion_pt";
1476 ((TH1F*)(listout->FindObject(fillthis)))->Fill(ptMC[1]);
1477 fillthis=
"mc_DStar_pt";
1478 ((TH1F*)(listout->FindObject(fillthis)))->Fill(ptMC[2]);
1479 fillthis=
"mc_DStar_pion_pt";
1480 ((TH1F*)(listout->FindObject(fillthis)))->Fill(ptMC[3]);
1481 fillthis=
"mc_D0_pt";
1482 ((TH1F*)(listout->FindObject(fillthis)))->Fill(ptMC[4]);
1483 fillthis=
"mc_D0_pion_pt";
1484 ((TH1F*)(listout->FindObject(fillthis)))->Fill(ptMC[5]);
1485 fillthis=
"mc_D0_kaon_pt";
1486 ((TH1F*)(listout->FindObject(fillthis)))->Fill(ptMC[6]);
1493 Int_t numberOfB0s = 0;
1495 for (
Int_t i = 0; i < B0toDStarPiLabelMatrix->GetNrows(); i++)
1497 Int_t particleCounter = 0;
1498 for (
Int_t j = 0; j < 4; j++)
1500 Int_t labelParticleInList = (
Int_t)particleMatrix(i,j);
1501 for (
Int_t k=0; k<aodevent->GetNumberOfTracks(); k++)
1503 AliAODTrack* aodTrack =
dynamic_cast<AliAODTrack*
>(aodevent->GetTrack(k));
1504 if(!aodTrack) AliFatal(
"Not a standard AOD");
1505 if(TMath::Abs(aodTrack->Eta())>0.9)
continue;
1506 if(aodTrack->GetITSNcls() < 1)
continue;
1507 if(aodTrack->GetTPCNcls() < 1)
continue;
1508 if(aodTrack->GetLabel() == labelParticleInList)
1516 if (particleCounter==4)
1518 TString fillthis=
"B0s_in_analysis";
1519 ((TH1F*)(listout->FindObject(fillthis)))->Fill(2);
1521 correctLabelArray.Set(numberOfB0s);
1522 correctLabelArray.AddAt(i,numberOfB0s-1);
1526 for (
Int_t i = 0; i < correctLabelArray.GetSize(); i++)
1528 particleMatrix(i,0) = (
Int_t)particleMatrix(correctLabelArray[i],0);
1529 particleMatrix(i,1) = (
Int_t)particleMatrix(correctLabelArray[i],1);
1530 particleMatrix(i,2) = (
Int_t)particleMatrix(correctLabelArray[i],2);
1531 particleMatrix(i,3) = (
Int_t)particleMatrix(correctLabelArray[i],3);
1532 particleMatrix(i,4) = (
Int_t)particleMatrix(correctLabelArray[i],4);
1533 particleMatrix(i,5) = (
Int_t)particleMatrix(correctLabelArray[i],5);
1534 particleMatrix(i,6) = (
Int_t)particleMatrix(correctLabelArray[i],6);
1536 B0toDStarPiLabelMatrix->ResizeTo(correctLabelArray.GetSize(),7);
1543 Int_t numberofparticles = 0;
1544 Int_t numberofparticlesused = 0;
1545 Int_t iClonesArray = 0;
1550 for (
Int_t i=0; i<aodEvent->GetNumberOfTracks(); i++){
1551 AliAODTrack* aodTrack =
dynamic_cast<AliAODTrack*
>(aodEvent->GetTrack(i));
1552 if(!aodTrack) AliFatal(
"Not a standard AOD");
1555 if(aodTrack->GetITSNcls() < 1)
continue;
1556 if(aodTrack->GetTPCNcls() < 1)
continue;
1558 Int_t mcLabelParticle = -1;
1559 Int_t pdgParticle = -1;
1560 mcLabelParticle = aodTrack->GetLabel();
1562 numberofparticles++;
1565 Double_t pt_track = aodTrack->Pt();
1566 Double_t momentum_track = aodTrack->P();
1567 Double_t energy_track = aodTrack->E(0.13957);
1568 Double_t dca_track = aodTrack->DCA();
1569 Double_t momentum_dca_track = aodTrack->PAtDCA();
1570 Int_t numberOfITS = aodTrack->GetITSNcls();
1571 Int_t numberOfTPC = aodTrack->GetTPCNcls();
1574 Int_t pionPIDnumber = 2;
1575 Int_t kaonPIDnumber = 3;
1580 TPCok = trackPIDHF->
GetnSigmaTPC(aodTrack, pionPIDnumber, nSigmaTPC);
1581 TOFok = trackPIDHF->
GetnSigmaTOF(aodTrack, pionPIDnumber, nSigmaTOF);
1583 Int_t daughterType = 0;
1596 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
1600 Bool_t isDesiredCandidate = kFALSE;
1602 TMatrix &particleMatrix = *B0toDStarPiLabelMatrix;
1603 for (
Int_t k = 0; k < B0toDStarPiLabelMatrix->GetNrows(); ++k){
1604 if(mcLabelParticle == (
Int_t)particleMatrix(k,2)){
1605 isDesiredCandidate = kTRUE;
1611 if(isDesiredCandidate)
1623 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
1632 if(isDesiredCandidate) {
1639 if(isDesiredCandidate) {
1646 if(isDesiredCandidate) {
1653 if(!(aodTrack->GetStatus()&AliESDtrack::kITSrefit)) {
1654 if(isDesiredCandidate) {
1662 if((!(aodTrack->GetStatus()&AliESDtrack::kTPCrefit))) {
1663 if(isDesiredCandidate) {
1672 if(isDesiredCandidate) {
1680 if(isDesiredCandidate) {
1689 if(isDesiredCandidate) {
1707 numberofparticlesused++;
1718 Int_t numberofparticles = 0;
1719 Int_t numberofparticlesused = 0;
1720 Int_t iClonesArray = 0;
1725 for (
Int_t i=0; i<aodEvent->GetNumberOfTracks(); i++){
1726 AliAODTrack* aodTrack =
dynamic_cast<AliAODTrack*
>(aodEvent->GetTrack(i));
1727 if(!aodTrack) AliFatal(
"Not a standard AOD");
1730 if(aodTrack->GetITSNcls() < 1)
continue;
1731 if(aodTrack->GetTPCNcls() < 1)
continue;
1733 Int_t mcLabelParticle = -1;
1734 Int_t pdgParticle = -1;
1735 mcLabelParticle = aodTrack->GetLabel();
1737 numberofparticles++;
1740 Double_t pt_track = aodTrack->Pt();
1741 Double_t momentum_track = aodTrack->P();
1742 Double_t energy_track = aodTrack->E(0.4937);
1743 Double_t dca_track = aodTrack->DCA();
1744 Double_t momentum_dca_track = aodTrack->PAtDCA();
1745 Int_t numberOfITS = aodTrack->GetITSNcls();
1746 Int_t numberOfTPC = aodTrack->GetTPCNcls();
1749 Int_t pionPIDnumber = 2;
1750 Int_t kaonPIDnumber = 3;
1755 TPCok = trackPIDHF->
GetnSigmaTPC(aodTrack, kaonPIDnumber, nSigmaTPC);
1756 TOFok = trackPIDHF->
GetnSigmaTOF(aodTrack, kaonPIDnumber, nSigmaTOF);
1758 Int_t daughterType = 1;
1771 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
1776 Bool_t isDesiredCandidate = kFALSE;
1778 TMatrix &particleMatrix = *B0toDStarPiLabelMatrix;
1779 for (
Int_t k = 0; k < B0toDStarPiLabelMatrix->GetNrows(); ++k){
1780 if(mcLabelParticle == (
Int_t)particleMatrix(k,3)){
1781 isDesiredCandidate = kTRUE;
1787 if(isDesiredCandidate)
1799 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
1808 if(isDesiredCandidate) {
1815 if(isDesiredCandidate) {
1822 if(isDesiredCandidate) {
1829 if(!(aodTrack->GetStatus()&AliESDtrack::kITSrefit)) {
1830 if(isDesiredCandidate) {
1838 if((!(aodTrack->GetStatus()&AliESDtrack::kTPCrefit))) {
1839 if(isDesiredCandidate) {
1848 if(isDesiredCandidate) {
1856 if(isDesiredCandidate) {
1865 if(isDesiredCandidate) {
1883 numberofparticlesused++;
1894 Int_t numberofparticles = 0;
1895 Int_t numberofparticlesused = 0;
1896 Int_t iClonesArray = 0;
1901 for (
Int_t i=0; i<aodEvent->GetNumberOfTracks(); i++){
1902 AliAODTrack* aodTrack =
dynamic_cast<AliAODTrack*
>(aodEvent->GetTrack(i));
1903 if(!aodTrack) AliFatal(
"Not a standard AOD");
1906 if(aodTrack->GetITSNcls() < 1)
continue;
1907 if(aodTrack->GetTPCNcls() < 1)
continue;
1909 Int_t mcLabelParticle = -1;
1910 Int_t pdgParticle = -1;
1911 mcLabelParticle = aodTrack->GetLabel();
1913 numberofparticles++;
1916 Double_t pt_track = aodTrack->Pt();
1917 Double_t momentum_track = aodTrack->P();
1918 Double_t energy_track = aodTrack->E(0.13957);
1919 Double_t dca_track = aodTrack->DCA();
1920 Double_t momentum_dca_track = aodTrack->PAtDCA();
1921 Int_t numberOfITS = aodTrack->GetITSNcls();
1922 Int_t numberOfTPC = aodTrack->GetTPCNcls();
1925 Int_t pionPIDnumber = 2;
1926 Int_t kaonPIDnumber = 3;
1931 TPCok = trackPIDHF->
GetnSigmaTPC(aodTrack, pionPIDnumber, nSigmaTPC);
1932 TOFok = trackPIDHF->
GetnSigmaTOF(aodTrack, pionPIDnumber, nSigmaTOF);
1934 Int_t daughterType = 2;
1947 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
1952 Bool_t isDesiredCandidate = kFALSE;
1954 TMatrix &particleMatrix = *B0toDStarPiLabelMatrix;
1955 for (
Int_t k = 0; k < B0toDStarPiLabelMatrix->GetNrows(); ++k){
1956 if(mcLabelParticle == (
Int_t)particleMatrix(k,1)){
1957 isDesiredCandidate = kTRUE;
1963 if(isDesiredCandidate)
1975 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
1984 if(isDesiredCandidate) {
1991 if(isDesiredCandidate) {
1998 if(isDesiredCandidate) {
2005 if(!(aodTrack->GetStatus()&AliESDtrack::kITSrefit)) {
2006 if(isDesiredCandidate) {
2014 if((!(aodTrack->GetStatus()&AliESDtrack::kTPCrefit))) {
2015 if(isDesiredCandidate) {
2024 if(isDesiredCandidate) {
2032 if(isDesiredCandidate) {
2041 if(isDesiredCandidate) {
2059 numberofparticlesused++;
2070 Int_t numberofparticles = 0;
2071 Int_t numberofparticlesused = 0;
2072 Int_t iClonesArray = 0;
2077 for (
Int_t i=0; i<aodEvent->GetNumberOfTracks(); i++){
2078 AliAODTrack* aodTrack =
dynamic_cast<AliAODTrack*
>(aodEvent->GetTrack(i));
2079 if(!aodTrack) AliFatal(
"Not a standard AOD");
2082 if(aodTrack->GetITSNcls() < 1)
continue;
2083 if(aodTrack->GetTPCNcls() < 1)
continue;
2085 Int_t mcLabelParticle = -1;
2086 Int_t pdgParticle = -1;
2087 mcLabelParticle = aodTrack->GetLabel();
2089 numberofparticles++;
2092 Double_t pt_track = aodTrack->Pt();
2093 Double_t momentum_track = aodTrack->P();
2094 Double_t energy_track = aodTrack->E(0.13957);
2095 Double_t dca_track = aodTrack->DCA();
2096 Double_t momentum_dca_track = aodTrack->PAtDCA();
2097 Int_t numberOfITS = aodTrack->GetITSNcls();
2098 Int_t numberOfTPC = aodTrack->GetTPCNcls();
2101 Int_t pionPIDnumber = 2;
2102 Int_t kaonPIDnumber = 3;
2107 TPCok = trackPIDHF->
GetnSigmaTPC(aodTrack, pionPIDnumber, nSigmaTPC);
2108 TOFok = trackPIDHF->
GetnSigmaTOF(aodTrack, pionPIDnumber, nSigmaTOF);
2110 Int_t daughterType = 3;
2123 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
2128 Bool_t isDesiredCandidate = kFALSE;
2130 TMatrix &particleMatrix = *B0toDStarPiLabelMatrix;
2131 for (
Int_t k = 0; k < B0toDStarPiLabelMatrix->GetNrows(); ++k){
2132 if(mcLabelParticle == (
Int_t)particleMatrix(k,0)){
2133 isDesiredCandidate = kTRUE;
2139 if(isDesiredCandidate)
2151 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
2160 if(isDesiredCandidate) {
2167 if(isDesiredCandidate) {
2174 if(isDesiredCandidate) {
2181 if(!(aodTrack->GetStatus()&AliESDtrack::kITSrefit)) {
2182 if(isDesiredCandidate) {
2190 if((!(aodTrack->GetStatus()&AliESDtrack::kTPCrefit))) {
2191 if(isDesiredCandidate) {
2200 if(isDesiredCandidate) {
2208 if(isDesiredCandidate) {
2217 if(isDesiredCandidate) {
2235 numberofparticlesused++;
2246 Int_t iClonesArray = 0;
2254 AliAODTrack * trackFirstDaughter =
dynamic_cast<AliAODTrack*
>(aodEvent->GetTrack((
fD0PionTracks->at(i))));
2255 if(!trackFirstDaughter)
continue;
2261 AliAODTrack * trackSecondDaughter =
dynamic_cast<AliAODTrack*
>(aodEvent->GetTrack((
fD0KaonTracks->at(j))));
2262 if(!trackSecondDaughter)
continue;
2265 if(trackFirstDaughter->GetID() == trackSecondDaughter->GetID() )
continue;
2268 if(trackFirstDaughter->Charge() == trackSecondDaughter->Charge() || trackFirstDaughter->Charge() + trackSecondDaughter->Charge() != 0)
continue;
2271 AliExternalTrackParam firstTrack;
2272 firstTrack.CopyFromVTrack(trackFirstDaughter);
2273 AliExternalTrackParam secondTrack;
2274 secondTrack.CopyFromVTrack(trackSecondDaughter);
2278 daughterTracks.Add(&firstTrack);
2279 daughterTracks.Add(&secondTrack);
2280 AliAODVertex *vertexMother =
RecalculateVertex(primaryVertex,&daughterTracks,bz);
2281 if(!vertexMother)
continue;
2282 if(vertexMother==0) {
delete vertexMother; vertexMother = NULL;
continue;}
2284 Double_t xdummy=0.,ydummy=0.,dca,e[2];
2285 Double_t d0z0[2],covd0z0[3],d0[2],d0err[2];
2287 firstTrack.PropagateToDCA(vertexMother,bz,100.,d0z0,covd0z0);
2288 secondTrack.PropagateToDCA(vertexMother,bz,100.,d0z0,covd0z0);
2292 px[0] = firstTrack.Px();
2293 py[0] = firstTrack.Py();
2294 pz[0] = firstTrack.Pz();
2295 px[1] = secondTrack.Px();
2296 py[1] = secondTrack.Py();
2297 pz[1] = secondTrack.Pz();
2304 id[0]= firstTrack.GetID();
2305 id[1]= secondTrack.GetID();
2307 firstTrack.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
2309 d0err[0] = TMath::Sqrt(covd0z0[0]);
2310 secondTrack.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
2312 d0err[1] = TMath::Sqrt(covd0z0[0]);
2314 dca = secondTrack.GetDCA(&firstTrack,bz,xdummy,ydummy);
2318 if(!motherRecoDecayHF2Prong) {
delete vertexMother; vertexMother = NULL;
continue;}
2320 motherRecoDecayHF2Prong->GetSecondaryVtx()->AddDaughter(trackFirstDaughter);
2321 motherRecoDecayHF2Prong->GetSecondaryVtx()->AddDaughter(trackSecondDaughter);
2322 motherRecoDecayHF2Prong->
SetPrimaryVtxRef((AliAODVertex*)aodEvent->GetPrimaryVertex());
2327 Float_t pdgCodeGrandMother = -1;
2328 Bool_t isDesiredCandidate = kFALSE;
2329 Int_t motherType, histType;
2333 Int_t mcLabelMother = -1;
2334 Int_t mcLabelGrandMother = -1;
2335 Int_t mcLabelFirstMother = -1;
2336 Int_t mcLabelSecondMother = -1;
2338 Int_t mcLabelFirstTrack = trackFirstDaughter->GetLabel();
2339 Int_t mcLabelSecondTrack = trackSecondDaughter->GetLabel();
2341 if(mcLabelFirstTrack >= 0 && mcLabelSecondTrack >= 0){
2342 AliAODMCParticle *mcParticleFirstTrack = (AliAODMCParticle*)mcTrackArray->At(mcLabelFirstTrack);
2343 AliAODMCParticle *mcParticleSecondTrack = (AliAODMCParticle*)mcTrackArray->At(mcLabelSecondTrack);
2345 if(mcParticleFirstTrack && mcParticleSecondTrack){
2346 mcLabelFirstMother = mcParticleFirstTrack->GetMother();
2347 mcLabelSecondMother = mcParticleSecondTrack->GetMother();
2348 if(mcLabelFirstMother == mcLabelSecondMother) mcLabelMother = mcLabelFirstMother;
2351 if(mcLabelMother >= 0){
2353 AliAODMCParticle *mcMotherParticle = (AliAODMCParticle*)mcTrackArray->At(mcLabelMother);
2354 pdgCodeMother = TMath::Abs(mcMotherParticle->GetPdgCode());
2357 mcLabelGrandMother = mcMotherParticle->GetMother();
2359 if(mcLabelGrandMother >= 0){
2360 AliAODMCParticle *mcGrandMotherParticle = (AliAODMCParticle*)mcTrackArray->At(mcLabelGrandMother);
2361 pdgCodeGrandMother = TMath::Abs(mcGrandMotherParticle->GetPdgCode());
2366 TMatrix &particleMatrix = *B0toDStarPiLabelMatrix;
2367 for (
Int_t k = 0; k < B0toDStarPiLabelMatrix->GetNrows(); ++k){
2368 if(mcLabelMother == (
Int_t)particleMatrix(k,4) && mcLabelFirstTrack == (
Int_t)particleMatrix(k,2) && mcLabelSecondTrack == (
Int_t)particleMatrix(k,3)){
2370 isDesiredCandidate = kTRUE;
2380 FillD0Histograms(motherRecoDecayHF2Prong, primaryVertex, bz, motherType, histType);
2383 FillD0Histograms(motherRecoDecayHF2Prong, primaryVertex, bz, motherType, histType);
2387 Bool_t cutMother = kFALSE;
2389 Bool_t bCutArray[25] = {0};
2391 if(cutReturnValue == -1) cutMother = kTRUE;
2392 if(cutReturnValue == 0) cutMother = kTRUE;
2397 for (
Int_t k = 0; k < 25; ++k)
2399 if (bCutArray[k] == kTRUE){
2400 if(isDesiredCandidate){
2412 if(isDesiredCandidate){
2415 delete vertexMother; vertexMother = NULL;
2416 delete motherRecoDecayHF2Prong; motherRecoDecayHF2Prong = NULL;
2422 FillD0Histograms(motherRecoDecayHF2Prong, primaryVertex, bz, motherType, histType);
2425 FillD0Histograms(motherRecoDecayHF2Prong, primaryVertex, bz, motherType, histType);
2430 delete motherRecoDecayHF2Prong; motherRecoDecayHF2Prong = NULL;
2438 Int_t iClonesArray = 0;
2447 AliAODTrack * trackFirstDaughter = (AliAODTrack*)(aodEvent->GetTrack(
fDStarPionTracks->at(i)));
2448 if(!trackFirstDaughter)
continue;
2456 if(!trackSecondDaughter) {std::cout <<
"found none" << std::endl;
continue;}
2457 if(trackSecondDaughter == NULL) {std::cout <<
"found NULL" << std::endl;
continue;}
2460 if(trackFirstDaughter->GetID() == trackSecondDaughter->
GetProngID(0) || trackFirstDaughter->GetID() == trackSecondDaughter->
GetProngID(1))
continue;
2463 if(trackFirstDaughter->Charge() == trackSecondDaughter->Charge() || TMath::Abs(trackFirstDaughter->Charge() + trackSecondDaughter->Charge()) != 1)
continue;
2466 if(trackFirstDaughter->Charge() != ((AliAODTrack*)trackSecondDaughter->GetDaughter(0))->Charge())
continue;
2473 AliAODTrack * trackB0Pion =
dynamic_cast<AliAODTrack*
>(aodEvent->GetTrack(
fB0PionTracks->at(k)));
2474 if(!trackB0Pion)
continue;
2479 AliAODTrack* twoProngdaughter0 = (AliAODTrack*)trackSecondDaughter->GetDaughter(0);
2480 AliAODTrack* twoProngdaughter1 = (AliAODTrack*)trackSecondDaughter->GetDaughter(1);
2481 UShort_t idProng0 = twoProngdaughter0->GetID();
2482 UShort_t idProng1 = twoProngdaughter1->GetID();
2484 if(trackB0Pion->GetID() == trackFirstDaughter->GetID() || trackB0Pion->GetID() == idProng0 || trackB0Pion->GetID() == idProng1)
continue;
2487 Bool_t bSameSign = kFALSE;
2488 if(trackB0Pion->Charge() == (trackSecondDaughter->Charge() + trackFirstDaughter->Charge()) && trackB0Pion->Charge() + (trackSecondDaughter->Charge() + trackFirstDaughter->Charge()) != 0) bSameSign = kTRUE;
2491 AliExternalTrackParam firstTrack;
2492 firstTrack.CopyFromVTrack(trackFirstDaughter);
2493 AliExternalTrackParam secondTrack;
2494 secondTrack.CopyFromVTrack(trackSecondDaughter);
2495 AliExternalTrackParam thirdTrack;
2496 thirdTrack.CopyFromVTrack(trackB0Pion);
2500 TObjArray daughterTracksWithRecalculation;
2502 daughterTracksWithRecalculation.Add(&firstTrack);
2503 daughterTracksWithRecalculation.Add(&secondTrack);
2504 daughterTracksWithRecalculation.Add(&thirdTrack);
2506 AliAODVertex *vertexMother =
RecalculateVertex(primaryVertex,&daughterTracksWithRecalculation,bz);
2507 if(!vertexMother) {
delete vertexMother; vertexMother = NULL;
continue;}
2509 Double_t xdummyDStar=0.,ydummyDStar=0.,dcaDStar,eDStar[2];
2510 Double_t d0z0DStar[2],covd0z0DStar[3],d0DStar[2],d0errDStar[2];
2513 firstTrack.PropagateToDCA(vertexMother,bz,100.,d0z0DStar,covd0z0DStar);
2514 secondTrack.PropagateToDCA(vertexMother,bz,100.,d0z0DStar,covd0z0DStar);
2518 Double_t pxDStar[2],pyDStar[2],pzDStar[2];
2519 pxDStar[0] = firstTrack.Px();
2520 pyDStar[0] = firstTrack.Py();
2521 pzDStar[0] = firstTrack.Pz();
2522 pxDStar[1] = secondTrack.Px();
2523 pyDStar[1] = secondTrack.Py();
2524 pzDStar[1] = secondTrack.Pz();
2527 xyz_track1[0] = firstTrack.GetX();
2528 firstTrack.GetYAt(xyz_track1[0],bz,xyz_track1[1]);
2529 firstTrack.GetZAt(xyz_track1[0],bz,xyz_track1[2]);
2532 xyz_track2[0] = secondTrack.GetX();
2533 secondTrack.GetYAt(xyz_track2[0],bz,xyz_track2[1]);
2534 secondTrack.GetZAt(xyz_track2[0],bz,xyz_track2[2]);
2536 Double_t distanceAtVertex = TMath::Sqrt((xyz_track1[0]-xyz_track2[0])*(xyz_track1[0]-xyz_track2[0]) + (xyz_track1[1]-xyz_track2[1])*(xyz_track1[1]-xyz_track2[1]) + (xyz_track1[2]-xyz_track2[2])*(xyz_track1[2]-xyz_track2[2]));
2538 firstTrack.PropagateToDCA(primaryVertex,bz,100.,d0z0DStar,covd0z0DStar);
2539 d0DStar[0] = d0z0DStar[0];
2540 d0errDStar[0] = TMath::Sqrt(covd0z0DStar[0]);
2541 secondTrack.PropagateToDCA(primaryVertex,bz,100.,d0z0DStar,covd0z0DStar);
2542 d0DStar[1] = d0z0DStar[0];
2543 d0errDStar[1] = TMath::Sqrt(covd0z0DStar[0]);
2546 dcaDStar = secondTrack.GetDCA(&firstTrack,bz,xdummyDStar,ydummyDStar);
2549 Short_t chargeDStar = trackFirstDaughter->Charge() + trackSecondDaughter->Charge();
2550 AliAODVertex * vertexDStar =
new AliAODVertex(*vertexMother);
2554 delete vertexMother; vertexMother = NULL;
2555 delete vertexDStar; vertexDStar = NULL;
2556 delete trackDStar; trackDStar = NULL;
2561 idDStar[0]= trackFirstDaughter->GetID();
2565 prongsDStar[0] = 211;
2566 prongsDStar[1] = 421;
2568 trackDStar->GetSecondaryVtx()->AddDaughter(trackFirstDaughter);
2569 trackDStar->GetSecondaryVtx()->AddDaughter(trackSecondDaughter);
2574 Bool_t isDesiredCandidate = kFALSE;
2575 Int_t mcLabelB0 = 0;
2577 Int_t motherType, histType;
2582 Int_t pdgDgD0toKpi[2]={321,211};
2583 Int_t pdgDgDStartoD0Pi[2]={421,211};
2584 Int_t mcLabelFirstDaughter = trackB0Pion->GetLabel();
2585 Int_t mcLabelSecondDaughter = trackDStar->
MatchToMC(413,421,pdgDgDStartoD0Pi,pdgDgD0toKpi,mcTrackArray);
2586 Int_t mcLabelDStarPion = ((AliAODTrack*)trackDStar->GetDaughter(0))->GetLabel();
2587 if(mcLabelFirstDaughter>=0 && mcLabelSecondDaughter>=0)
2590 Int_t mcLabelMotherFirstTrack = -1;
2591 Int_t mcLabelMotherSecondTrack = -1;
2592 AliAODMCParticle *mcTrackFirstDaughter = (AliAODMCParticle*)mcTrackArray->At(mcLabelFirstDaughter);
2593 AliAODMCParticle *mcTrackSecondDaughter = (AliAODMCParticle*)mcTrackArray->At(mcLabelSecondDaughter);
2594 AliAODMCParticle *mcTrackDStarPion = (AliAODMCParticle*)mcTrackArray->At(mcLabelDStarPion);
2596 if(mcTrackFirstDaughter) mcLabelMotherFirstTrack = mcTrackFirstDaughter->GetMother();
2597 if(mcTrackSecondDaughter) mcLabelMotherSecondTrack = mcTrackSecondDaughter->GetMother();
2599 if(mcLabelMotherFirstTrack>=0 && mcLabelMotherFirstTrack == mcLabelMotherSecondTrack)
2601 TMatrix &particleMatrix = *B0toDStarPiLabelMatrix;
2602 for (
Int_t k = 0; k < B0toDStarPiLabelMatrix->GetNrows(); ++k)
2604 if(mcLabelMotherFirstTrack == (
Int_t)particleMatrix(k,6) && mcLabelSecondDaughter == (
Int_t)particleMatrix(k,5) && mcLabelDStarPion == (
Int_t)particleMatrix(k,1) && mcLabelFirstDaughter == (
Int_t)particleMatrix(k,0))
2607 isDesiredCandidate = kTRUE;
2608 mcLabelB0 = mcLabelMotherFirstTrack;
2629 Bool_t cutDStar = kFALSE;
2631 Bool_t bCutArrayDStar[25] = {0};
2633 if(cutReturnValueDStar == -1) cutDStar = kTRUE;
2634 if(cutReturnValueDStar == 0) cutDStar = kTRUE;
2636 Bool_t bCutArrayD0[35] = {0};
2638 if(cutReturnValueD0 == -1) cutDStar = kTRUE;
2639 if(cutReturnValueD0 == 0) cutDStar = kTRUE;
2645 for (
Int_t n = 0; n < 25; ++n)
2647 if(bCutArrayDStar[n] == kTRUE){
2648 if(isDesiredCandidate){
2655 for (
Int_t n = 0; n < 35; ++n)
2657 if(bCutArrayD0[n] == kTRUE){
2658 if(isDesiredCandidate){
2670 if(isDesiredCandidate)
2674 delete vertexMother; vertexMother = NULL;
2675 delete vertexDStar; vertexDStar = NULL;
2676 delete trackDStar; trackDStar = NULL;
2698 Double_t xdummy=0.,ydummy=0.,dca,e[2];
2699 Double_t d0z0[2],covd0z0[3],d0[2],d0err[2];
2701 AliExternalTrackParam fourthTrack;
2702 fourthTrack.CopyFromVTrack(trackDStar);
2704 thirdTrack.PropagateToDCA(vertexMother,bz,100.,d0z0,covd0z0);
2705 fourthTrack.PropagateToDCA(vertexMother,bz,100.,d0z0,covd0z0);
2709 px[0] = thirdTrack.Px();
2710 py[0] = thirdTrack.Py();
2711 pz[0] = thirdTrack.Pz();
2712 px[1] = fourthTrack.Px();
2713 py[1] = fourthTrack.Py();
2714 pz[1] = fourthTrack.Pz();
2721 id[0]= thirdTrack.GetID();
2724 thirdTrack.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
2726 d0err[0] = TMath::Sqrt(covd0z0[0]);
2727 fourthTrack.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
2729 d0err[1] = TMath::Sqrt(covd0z0[0]);
2731 dca = fourthTrack.GetDCA(&thirdTrack,bz,xdummy,ydummy);
2733 Short_t chargeMother = trackFirstDaughter->Charge() + trackDStar->Charge();
2735 if(!motherCascadeHF)
2737 delete vertexMother; vertexMother = NULL;
2738 delete vertexDStar; vertexDStar = NULL;
2739 delete trackDStar; trackDStar = NULL;
2743 motherCascadeHF->GetSecondaryVtx()->AddDaughter(trackB0Pion);
2744 motherCascadeHF->GetSecondaryVtx()->AddDaughter(trackDStar);
2745 motherCascadeHF->
SetPrimaryVtxRef((AliAODVertex*)aodEvent->GetPrimaryVertex());
2759 if(isDesiredCandidate)
2768 Bool_t cutMother = kFALSE;
2770 Bool_t bCutArray[85] = {0};
2771 Int_t numberOfCuts = 85;
2773 if(cutReturnValue == -1) cutMother = kTRUE;
2774 if(cutReturnValue == 0) cutMother = kTRUE;
2779 Double_t invariantMassMother = motherCascadeHF->InvMass(2,prongs);
2780 Double_t pdgMassMother=TDatabasePDG::Instance()->GetParticle(511)->Mass();
2784 for (
Int_t n = 0; n < 85; ++n)
2786 if(bCutArray[n] == kTRUE){
2787 if(isDesiredCandidate){
2794 if (TMath::Abs(invariantMassMother-pdgMassMother)<massWindow){
2795 for (
Int_t i = 0; i < numberOfCuts; ++i)
2797 if(bCutArray[i] == kFALSE)
continue;
2798 for (
Int_t j = 0; j < numberOfCuts; ++j)
2800 if(bCutArray[j] == kFALSE)
continue;
2801 if(isDesiredCandidate == kFALSE) histName =
"cutEffectBackground";
2802 if(isDesiredCandidate == kTRUE) histName =
"cutEffectSignal";
2803 ((TH2I*)(
fOutputB0MC->FindObject(histName)))->Fill(i,j);
2807 for (
Int_t i = 0; i < numberOfCuts; ++i)
2809 if(bCutArray[i] == kFALSE)
continue;
2811 for (
Int_t j = 0; j < numberOfCuts; ++j)
2814 if(bCutArray[j] == kTRUE)
2823 if(isDesiredCandidate == kFALSE) histName =
"cutEffectUniqueBackground";
2824 if(isDesiredCandidate == kTRUE) histName =
"cutEffectUniqueSignal";
2836 if(isDesiredCandidate)
2840 delete vertexMother; vertexMother = NULL;
2841 delete motherCascadeHF; motherCascadeHF = NULL;
2842 delete vertexDStar; vertexDStar = NULL;
2843 delete trackDStar; trackDStar = NULL;
2866 if (TMath::Abs(invariantMassMother-pdgMassMother)<massWindow)
2871 if(!isDesiredCandidate)
2873 motherType = 0; histType = 4;
FillD0Histograms(selectedD0, primaryVertex, bz, motherType, histType);
2877 if(isDesiredCandidate)
2879 motherType = 0; histType = 5;
FillD0Histograms(selectedD0, primaryVertex, bz, motherType, histType);
2889 ptBinMother +=
"_ptbin_"; ptBinMother +=
fPtBinLimits[ptBin]; ptBinMother +=
"_to_"; ptBinMother +=
fPtBinLimits[ptBin+1];
2890 histType = 6 + 2 * ptBin;
2893 Int_t histTypeD0 = 2 * d0PtBin;
2896 Int_t histTypeD0DStar = 2 * d0DStarPtBin;
2899 Int_t histTypeDStar = 2 * dstarPtBin;
2902 if (TMath::Abs(invariantMassMother-pdgMassMother)<massWindow)
2904 if(!bSameSign && histType > 5)
2906 if(!isDesiredCandidate)
2908 motherType = 0;
FillD0Histograms(selectedD0, primaryVertex, bz, motherType, histType);
2911 motherType = 3;
FillD0Histograms(selectedD0, primaryVertex, bz, motherType, histTypeD0);
2912 motherType = 4;
FillD0Histograms(selectedD0, primaryVertex, bz, motherType, histTypeD0DStar);
2916 if(isDesiredCandidate)
2919 motherType = 0;
FillD0Histograms(selectedD0, primaryVertex, bz, motherType, histType);
2922 motherType = 3;
FillD0Histograms(selectedD0, primaryVertex, bz, motherType, histTypeD0 + 1);
2923 motherType = 4;
FillD0Histograms(selectedD0, primaryVertex, bz, motherType, histTypeD0DStar + 1);
2932 fillthis=
"invariantMassB0";
2933 fillthis +=
"_SameSign";
2934 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother);
2935 fillthis=
"invariantMassB0";
2936 fillthis += ptBinMother +
"_SameSign";
2937 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother);
2938 fillthis=
"invariantMassB0";
2939 fillthis +=
"_SignSum";
2940 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother,-1);
2941 fillthis=
"invariantMassB0";
2942 fillthis += ptBinMother +
"_SignSum";
2943 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother,-1);
2948 fillthis=
"deltaInvMassB0";
2949 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invmassDelta);
2950 fillthis=
"deltaInvMassB0";
2951 fillthis += ptBinMother;
2952 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invmassDelta);
2954 fillthis=
"invariantMassB0";
2955 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother);
2956 fillthis=
"invariantMassB0";
2957 fillthis += ptBinMother;
2958 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother);
2959 fillthis=
"invariantMassB0";
2960 fillthis +=
"_SignSum";
2961 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother,1);
2962 fillthis=
"invariantMassB0";
2963 fillthis += ptBinMother +
"_SignSum";
2964 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother,1);
2967 if(motherCascadeHF->Pt() > 6.0)
2969 ptBinMother =
"_ptbin_6_to_inf";
2972 fillthis=
"invariantMassB0";
2973 fillthis += ptBinMother +
"_SameSign";
2974 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother);
2975 fillthis=
"invariantMassB0";
2976 fillthis += ptBinMother +
"_SignSum";
2977 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother,-1);
2981 fillthis=
"deltaInvMassB0";
2982 fillthis += ptBinMother;
2983 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invmassDelta);
2985 fillthis=
"invariantMassB0";
2986 fillthis += ptBinMother;
2987 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother);
2988 fillthis=
"invariantMassB0";
2989 fillthis += ptBinMother +
"_SignSum";
2990 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother,1);
2995 if(motherCascadeHF->Pt() > 3.0)
2997 ptBinMother =
"_ptbin_3_to_inf";
3000 fillthis=
"invariantMassB0";
3001 fillthis += ptBinMother +
"_SameSign";
3002 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother);
3003 fillthis=
"invariantMassB0";
3004 fillthis += ptBinMother +
"_SignSum";
3005 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother,-1);
3009 fillthis=
"deltaInvMassB0";
3010 fillthis += ptBinMother;
3011 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invmassDelta);
3013 fillthis=
"invariantMassB0";
3014 fillthis += ptBinMother;
3015 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother);
3016 fillthis=
"invariantMassB0";
3017 fillthis += ptBinMother +
"_SignSum";
3018 ((TH1F*)(
fOutputB0MC->FindObject(fillthis)))->Fill(invariantMassMother,1);
3025 delete vertexMother; vertexMother = NULL;
3026 delete motherCascadeHF; motherCascadeHF = NULL;
3027 delete vertexDStar; vertexDStar = NULL;
3028 delete trackDStar; trackDStar = NULL;
3039 AliAODTrack* selectedB0Pion = (AliAODTrack*)selectedB0->GetDaughter(0);
3042 AliAODTrack* selectedDStarPion = (AliAODTrack*)selectedDStar->GetDaughter(0);
3045 AliAODTrack* selectedD0Pion = (AliAODTrack*)selectedD0->GetDaughter(0);
3046 AliAODTrack* selectedD0Kaon = (AliAODTrack*)selectedD0->GetDaughter(1);
3053 Int_t numberOfITS = 0;
3054 Int_t numberOfTPC = 0;
3055 Int_t daughterType, histType;
3056 Int_t totalNumberOfITS = 0;
3057 Int_t totalNumberOfTPC = 0;
3062 Int_t pionPIDnumber = 2;
3063 Int_t kaonPIDnumber = 3;
3070 pt_track = selectedD0Pion->Pt();
3071 momentum_track = selectedD0Pion->P();
3072 energy_track = selectedD0Pion->E(0.13957);
3073 dca_track = selectedD0Pion->DCA();
3074 momentum_dca_track = selectedD0Pion->PAtDCA();
3075 numberOfITS = selectedD0Pion->GetITSNcls();
3076 numberOfTPC = selectedD0Pion->GetTPCNcls();
3077 totalNumberOfITS += numberOfITS;
3078 totalNumberOfTPC += numberOfTPC;
3079 TPCok = trackPIDHF->
GetnSigmaTPC(selectedD0Pion, pionPIDnumber, nSigmaTPC);
3080 TOFok = trackPIDHF->
GetnSigmaTOF(selectedD0Pion, pionPIDnumber, nSigmaTOF);
3081 if(TPCok != -1) nSigmaTPCtotal += nSigmaTPC*nSigmaTPC;
3082 if(TOFok != -1) nSigmaTOFtotal += nSigmaTOF*nSigmaTOF;
3088 if(!isDesiredCandidate)
3097 for (
Int_t i = 0; i < 6; ++i)
3099 if(selectedD0Pion->HasPointOnITSLayer(i)) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][7])->Fill(i);
3103 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
3119 for (
Int_t i = 0; i < 6; ++i)
3121 if(selectedD0Pion->HasPointOnITSLayer(i)) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][7])->Fill(i);
3125 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
3134 Float_t pdgCodeParticleMother = -1;
3135 Int_t mcLabelParticle = -1;
3136 Int_t mcLabelParticleMother = -1;
3137 mcLabelParticle = selectedD0Pion->GetLabel();
3139 if(mcLabelParticle >= 0){
3141 AliAODMCParticle *mcTrackParticle = (AliAODMCParticle*)mcTrackArray->At(mcLabelParticle);
3142 pdgCodeParticle = TMath::Abs(mcTrackParticle->GetPdgCode());
3144 mcLabelParticleMother = mcTrackParticle->GetMother();
3146 if(mcLabelParticleMother >= 0){
3147 AliAODMCParticle *mcTrackParticleMother = (AliAODMCParticle*)mcTrackArray->At(mcLabelParticleMother);
3148 pdgCodeParticleMother = TMath::Abs(mcTrackParticleMother->GetPdgCode());
3149 ((TH1F*)fDaughterHistogramArray2D[0][3])->Fill(pdgCodeParticleMother);
3155 pt_track = selectedD0Kaon->Pt();
3156 momentum_track = selectedD0Kaon->P();
3157 energy_track = selectedD0Kaon->E(0.4937);
3158 dca_track = selectedD0Kaon->DCA();
3159 momentum_dca_track = selectedD0Kaon->PAtDCA();
3160 numberOfITS = selectedD0Kaon->GetITSNcls();
3161 numberOfTPC = selectedD0Kaon->GetTPCNcls();
3162 totalNumberOfITS += numberOfITS;
3163 totalNumberOfTPC += numberOfTPC;
3164 TPCok = trackPIDHF->
GetnSigmaTPC(selectedD0Kaon, kaonPIDnumber, nSigmaTPC);
3165 TOFok = trackPIDHF->
GetnSigmaTOF(selectedD0Kaon, kaonPIDnumber, nSigmaTOF);
3166 if(TPCok != -1) nSigmaTPCtotal += nSigmaTPC*nSigmaTPC;
3167 if(TOFok != -1) nSigmaTOFtotal += nSigmaTOF*nSigmaTOF;
3171 if(!isDesiredCandidate)
3180 for (
Int_t i = 0; i < 6; ++i)
3182 if(selectedD0Kaon->HasPointOnITSLayer(i)) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][7])->Fill(i);
3186 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
3200 for (
Int_t i = 0; i < 6; ++i)
3202 if(selectedD0Kaon->HasPointOnITSLayer(i)) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][7])->Fill(i);
3206 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
3215 Float_t pdgCodeParticleMother = -1;
3216 Int_t mcLabelParticle = -1;
3217 Int_t mcLabelParticleMother = -1;
3218 mcLabelParticle = selectedD0Kaon->GetLabel();
3220 if(mcLabelParticle >= 0){
3222 AliAODMCParticle *mcTrackParticle = (AliAODMCParticle*)mcTrackArray->At(mcLabelParticle);
3223 pdgCodeParticle = TMath::Abs(mcTrackParticle->GetPdgCode());
3225 mcLabelParticleMother = mcTrackParticle->GetMother();
3227 if(mcLabelParticleMother >= 0){
3228 AliAODMCParticle *mcTrackParticleMother = (AliAODMCParticle*)mcTrackArray->At(mcLabelParticleMother);
3229 pdgCodeParticleMother = TMath::Abs(mcTrackParticleMother->GetPdgCode());
3230 ((TH1F*)fDaughterHistogramArray2D[1][3])->Fill(pdgCodeParticleMother);
3236 pt_track = selectedDStarPion->Pt();
3237 momentum_track = selectedDStarPion->P();
3238 energy_track = selectedDStarPion->E(0.13957);
3239 dca_track = selectedDStarPion->DCA();
3240 momentum_dca_track = selectedDStarPion->PAtDCA();
3241 numberOfITS = selectedDStarPion->GetITSNcls();
3242 numberOfTPC = selectedDStarPion->GetTPCNcls();
3243 totalNumberOfITS += numberOfITS;
3244 totalNumberOfTPC += numberOfTPC;
3245 TPCok = trackPIDHF->
GetnSigmaTPC(selectedDStarPion, pionPIDnumber, nSigmaTPC);
3246 TOFok = trackPIDHF->
GetnSigmaTOF(selectedDStarPion, pionPIDnumber, nSigmaTOF);
3247 if(TPCok != -1) nSigmaTPCtotal += nSigmaTPC*nSigmaTPC;
3251 if(!isDesiredCandidate)
3260 for (
Int_t i = 0; i < 6; ++i)
3262 if(selectedDStarPion->HasPointOnITSLayer(i)) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][7])->Fill(i);
3266 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
3280 for (
Int_t i = 0; i < 6; ++i)
3282 if(selectedDStarPion->HasPointOnITSLayer(i)) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][7])->Fill(i);
3286 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
3295 Float_t pdgCodeParticleMother = -1;
3296 Int_t mcLabelParticle = -1;
3297 Int_t mcLabelParticleMother = -1;
3298 mcLabelParticle = selectedDStarPion->GetLabel();
3300 if(mcLabelParticle >= 0){
3302 AliAODMCParticle *mcTrackParticle = (AliAODMCParticle*)mcTrackArray->At(mcLabelParticle);
3303 pdgCodeParticle = TMath::Abs(mcTrackParticle->GetPdgCode());
3305 mcLabelParticleMother = mcTrackParticle->GetMother();
3307 if(mcLabelParticleMother >= 0){
3308 AliAODMCParticle *mcTrackParticleMother = (AliAODMCParticle*)mcTrackArray->At(mcLabelParticleMother);
3309 pdgCodeParticleMother = TMath::Abs(mcTrackParticleMother->GetPdgCode());
3310 ((TH1F*)fDaughterHistogramArray2D[2][3])->Fill(pdgCodeParticleMother);
3316 pt_track = selectedB0Pion->Pt();
3317 momentum_track = selectedB0Pion->P();
3318 energy_track = selectedB0Pion->E(0.13957);
3319 dca_track = selectedB0Pion->DCA();
3320 momentum_dca_track = selectedB0Pion->PAtDCA();
3321 numberOfITS = selectedB0Pion->GetITSNcls();
3322 numberOfTPC = selectedB0Pion->GetTPCNcls();
3323 totalNumberOfITS += numberOfITS;
3324 totalNumberOfTPC += numberOfTPC;
3325 TPCok = trackPIDHF->
GetnSigmaTPC(selectedB0Pion, pionPIDnumber, nSigmaTPC);
3326 TOFok = trackPIDHF->
GetnSigmaTOF(selectedB0Pion, pionPIDnumber, nSigmaTOF);
3327 if(TPCok != -1) nSigmaTPCtotal += nSigmaTPC*nSigmaTPC;
3328 if(TOFok != -1) nSigmaTOFtotal += nSigmaTOF*nSigmaTOF;
3332 if(!isDesiredCandidate)
3341 for (
Int_t i = 0; i < 6; ++i)
3343 if(selectedB0Pion->HasPointOnITSLayer(i)) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][7])->Fill(i);
3347 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
3361 for (
Int_t i = 0; i < 6; ++i)
3363 if(selectedB0Pion->HasPointOnITSLayer(i)) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][7])->Fill(i);
3367 if(TPCok != -1 && TOFok != -1) ((TH1F*)
fDaughterHistogramArray[daughterType][histType][10])->Fill(sqrt(nSigmaTPC*nSigmaTPC + nSigmaTOF*nSigmaTOF));
3376 Float_t pdgCodeParticleMother = -1;
3377 Int_t mcLabelParticle = -1;
3378 Int_t mcLabelParticleMother = -1;
3379 mcLabelParticle = selectedB0Pion->GetLabel();
3381 if(mcLabelParticle >= 0){
3383 AliAODMCParticle *mcTrackParticle = (AliAODMCParticle*)mcTrackArray->At(mcLabelParticle);
3384 pdgCodeParticle = TMath::Abs(mcTrackParticle->GetPdgCode());
3386 mcLabelParticleMother = mcTrackParticle->GetMother();
3388 if(mcLabelParticleMother >= 0){
3389 AliAODMCParticle *mcTrackParticleMother = (AliAODMCParticle*)mcTrackArray->At(mcLabelParticleMother);
3390 pdgCodeParticleMother = TMath::Abs(mcTrackParticleMother->GetPdgCode());
3391 ((TH1F*)fDaughterHistogramArray2D[3][3])->Fill(pdgCodeParticleMother);
3396 if(!isDesiredCandidate)
3398 ((TH1F*)(
fOutputB0MC->FindObject(
"totalITSBackground")))->Fill(totalNumberOfITS);
3399 ((TH1F*)(
fOutputB0MC->FindObject(
"totalTPCBackground")))->Fill(totalNumberOfTPC);
3400 ((TH1F*)(
fOutputB0MC->FindObject(
"totalSigmaPIDBackground")))->Fill(sqrt(nSigmaTPCtotal + nSigmaTOFtotal));
3402 if(isDesiredCandidate)
3404 ((TH1F*)(
fOutputB0MC->FindObject(
"totalITSSignal")))->Fill(totalNumberOfITS);
3405 ((TH1F*)(
fOutputB0MC->FindObject(
"totalTPCSignal")))->Fill(totalNumberOfTPC);
3406 ((TH1F*)(
fOutputB0MC->FindObject(
"totalSigmaPIDSignal")))->Fill(sqrt(nSigmaTPCtotal + nSigmaTOFtotal));
3421 e[2]=DStar->EProng(0,211);
3424 Double_t invMassDStar = TMath::Sqrt(esum*esum-DStar->P()*DStar->P());
3428 return invMassDStar - invMassD0;
3440 e[0]=DStar->EProng(0,211);
3443 e[3]=B0->EProng(0,211);
3445 Double_t esum = e[0]+e[1]+e[2]+e[3];
3446 Double_t invMassB0 = TMath::Sqrt(esum*esum-B0->P()*B0->P());
3454 return invMassB0 - invMassD0;
3459 if(histType<0)
return;
3472 Double_t invariantMassMother = 0.0;
3475 AliAODVertex * vertexMother = 0x0;
3476 AliAODVertex * vertexDaughter = 0x0;
3478 Double_t decayLengthDaughter = 0.0;
3480 Double_t angleMotherFirstDaughter = 0.0;
3481 Double_t angleMotherSecondDaughter = 0.0;
3482 Double_t topomaticFirstDaughter = 0.0;
3483 Double_t topomaticSecondDaughter = 0.0;
3487 Double_t angleBetweenBothDaughters = 0;
3490 Double_t pdgMassMother=TDatabasePDG::Instance()->GetParticle(421)->Mass();
3493 prongs[0] = 211; prongs[1] = 321;
3494 AliAODTrack * firstDaughter = (AliAODTrack*)selectedMother->GetDaughter(0);
3495 AliAODTrack * secondDaughter = (AliAODTrack*)selectedMother->GetDaughter(1);
3496 vertexMother = selectedMother->GetSecondaryVtx();
3497 ptFirstDaughter = firstDaughter->Pt();
3498 ptSecondDaughter = secondDaughter->Pt();
3505 for(
Int_t ipr=0; ipr<2; ipr++)
3510 if(errdiffIP>0.) normdd0=diffIP/errdiffIP;
3511 if(ipr==0) dd0pr1=normdd0;
3512 if(ipr==1) dd0pr2=normdd0;
3516 if(TMath::Abs(dd0pr1)>TMath::Abs(dd0pr2)) {dd0max=dd0pr1; dd0min=dd0pr2;}
3517 else {dd0max=dd0pr2; dd0min=dd0pr1;}
3519 AliExternalTrackParam motherTrack;
3520 motherTrack.CopyFromVTrack(selectedMother);
3522 motherTrack.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
3525 ptMother = selectedMother->Pt();
3526 momentumMother = selectedMother->P();
3527 etaMother = selectedMother->Eta();
3528 phiMother = selectedMother->Phi();
3530 d0Mother = TMath::Abs(d0[0]);
3531 d0firstTrack = TMath::Abs(selectedMother->Getd0Prong(0));
3532 d0secondTrack = TMath::Abs(selectedMother->Getd0Prong(1));
3534 impactProduct = selectedMother->
Prodd0d0();
3535 impactProductXY = TMath::Abs(selectedMother->
ImpParXY());
3536 invariantMassMother = selectedMother->InvMass(2,prongs);
3537 dcaMother = selectedMother->GetDCA();
3538 vertexDistance = vertexMother->DistanceToVertex(primaryVertex);
3539 angleMotherFirstDaughter = (selectedMother->Px() * firstDaughter->Px() + selectedMother->Py() * firstDaughter->Py() + selectedMother->Pz() * firstDaughter->Pz()) /(selectedMother->P() * firstDaughter->P());
3540 angleMotherSecondDaughter = (selectedMother->Px() * secondDaughter->Px() + selectedMother->Py() * secondDaughter->Py() + selectedMother->Pz() * secondDaughter->Pz()) /(selectedMother->P() * secondDaughter->P());
3541 cosThetaStar = selectedMother->CosThetaStar(0,421,211,321);
3542 angleBetweenBothDaughters = (firstDaughter->Px() * secondDaughter->Px() + firstDaughter->Py() * secondDaughter->Py() + firstDaughter->Pz() * secondDaughter->Pz()) /(firstDaughter->P() * secondDaughter->P());
3545 Double_t pseudoProperDecayLength = ((vertexMother->GetX() - primaryVertex->GetX()) * selectedMother->Px() / TMath::Abs(selectedMother->Pt())) + ((vertexMother->GetY() - primaryVertex->GetY()) * selectedMother->Py() / TMath::Abs(selectedMother->Pt()));
3546 Double_t pseudoProperDecayTime = pseudoProperDecayLength * pdgMassMother/ptMother;
3547 decayTime = vertexDistance / (299792458 * TMath::Sqrt(1/((pdgMassMother*pdgMassMother/(momentumMother*momentumMother)) + 1)));
3549 Double_t phi = selectedMother->Phi();
3550 Double_t theta = selectedMother->Theta();
3552 selectedMother->GetCovarianceXYZPxPyPz(covMatrix);
3559 Double_t errorMomentum = covMatrix[9]*cp*cp*ct*ct
3560 +covMatrix[13]*2.*cp*sp*ct*ct
3561 +covMatrix[18]*2.*cp*ct*st
3562 +covMatrix[14]*sp*sp*ct*ct
3563 +covMatrix[19]*2.*sp*ct*st
3564 +covMatrix[20]*st*st;
3565 Double_t normalizedDecayTime = selectedMother->
NormalizedDecayLength() / (299792458 * TMath::Sqrt(1/((pdgMassMother*pdgMassMother*errorMomentum*errorMomentum/(momentumMother*momentumMother)) + 1)));
3567 Double_t eKaon = selectedMother->EProng(1,321);
3568 Double_t invMassKaon = TMath::Sqrt(eKaon*eKaon-secondDaughter->P()*secondDaughter->P());
3570 invmassDelta = invMassD0 - invMassKaon;
3618 if(histType<0)
return;
3631 Double_t invariantMassMother = 0.0;
3634 AliAODVertex * vertexMother = 0x0;
3635 AliAODVertex * vertexDaughter = 0x0;
3639 Double_t angleMotherFirstDaughter = 0.0;
3640 Double_t angleMotherSecondDaughter = 0.0;
3641 Double_t topomaticFirstDaughter = 0.0;
3642 Double_t topomaticSecondDaughter = 0.0;
3647 Double_t angleBetweenBothDaughters = 0;
3651 if(motherType==1 || motherType==5){
3652 prongs[0] = 211; prongs[1] = 421;
3654 AliAODTrack * firstDaughter = (AliAODTrack*)selectedMother->GetDaughter(0);
3657 ptFirstDaughter = firstDaughter->Pt();
3658 ptSecondDaughter = secondDaughter->Pt();
3659 vertexMother = selectedMother->GetSecondaryVtx();
3660 vertexDaughter = secondDaughter->GetSecondaryVtx();
3661 angleMotherFirstDaughter = (selectedMother->Px() * firstDaughter->Px() + selectedMother->Py() * firstDaughter->Py() + selectedMother->Pz() * firstDaughter->Pz()) /(selectedMother->P() * firstDaughter->P());
3662 angleMotherSecondDaughter = (selectedMother->Px() * secondDaughter->Px() + selectedMother->Py() * secondDaughter->Py() + selectedMother->Pz() * secondDaughter->Pz()) /(selectedMother->P() * secondDaughter->P());
3663 angleBetweenBothDaughters = (firstDaughter->Px() * secondDaughter->Px() + firstDaughter->Py() * secondDaughter->Py() + firstDaughter->Pz() * secondDaughter->Pz()) /(firstDaughter->P() * secondDaughter->P());
3664 cosThetaStar = selectedMother->CosThetaStar(0,413,211,421);
3665 pdgMassMother = TDatabasePDG::Instance()->GetParticle(413)->Mass();
3668 prongs[0] = 211; prongs[1] = 413;
3670 AliAODTrack * firstDaughter = (AliAODTrack*)selectedMother->GetDaughter(0);
3673 ptFirstDaughter = firstDaughter->Pt();
3674 ptSecondDaughter = secondDaughter->Pt();
3675 vertexMother = selectedMother->GetSecondaryVtx();
3676 vertexDaughter = secondDaughter->GetSecondaryVtx();
3677 angleMotherFirstDaughter = (selectedMother->Px() * firstDaughter->Px() + selectedMother->Py() * firstDaughter->Py() + selectedMother->Pz() * firstDaughter->Pz()) /(selectedMother->P() * firstDaughter->P());
3678 angleMotherSecondDaughter = (selectedMother->Px() * secondDaughter->Px() + selectedMother->Py() * secondDaughter->Py() + selectedMother->Pz() * secondDaughter->Pz()) /(selectedMother->P() * secondDaughter->P());
3679 angleBetweenBothDaughters = (firstDaughter->Px() * secondDaughter->Px() + firstDaughter->Py() * secondDaughter->Py() + firstDaughter->Pz() * secondDaughter->Pz()) /(firstDaughter->P() * secondDaughter->P());
3680 cosThetaStar = selectedMother->CosThetaStar(0,511,211,413);
3681 pdgMassMother = TDatabasePDG::Instance()->GetParticle(511)->Mass();
3690 for(
Int_t ipr=0; ipr<2; ipr++)
3695 if(errdiffIP>0.) normdd0=diffIP/errdiffIP;
3696 if(ipr==0) dd0pr1=normdd0;
3697 if(ipr==1) dd0pr2=normdd0;
3701 if(TMath::Abs(dd0pr1)>TMath::Abs(dd0pr2)) {dd0max=dd0pr1; dd0min=dd0pr2;}
3702 else {dd0max=dd0pr2; dd0min=dd0pr1;}
3706 AliExternalTrackParam motherTrack;
3707 motherTrack.CopyFromVTrack(selectedMother);
3709 motherTrack.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
3712 ptMother = selectedMother->Pt();
3713 momentumMother = selectedMother->P();
3714 etaMother = selectedMother->Eta();
3715 phiMother = selectedMother->Phi();
3716 d0Mother = TMath::Abs(d0[0]);
3719 impactProduct = selectedMother->
Prodd0d0();
3720 impactProductXY = TMath::Abs(selectedMother->
ImpParXY());
3721 invariantMassMother = selectedMother->InvMass(2,prongs);
3722 dcaMother = selectedMother->GetDCA();
3723 vertexDistance = vertexMother->DistanceToVertex(primaryVertex);
3724 d0firstTrack = TMath::Abs(selectedMother->Getd0Prong(0));
3725 d0secondTrack = TMath::Abs(selectedMother->Getd0Prong(1));
3728 Double_t pseudoProperDecayLength = ((vertexMother->GetX() - primaryVertex->GetX()) * selectedMother->Px() / TMath::Abs(selectedMother->Pt())) + ((vertexMother->GetY() - primaryVertex->GetY()) * selectedMother->Py() / TMath::Abs(selectedMother->Pt()));
3729 Double_t pseudoProperDecayTime = pseudoProperDecayLength * pdgMassMother/ptMother;
3730 decayTime = vertexDistance / (299792458 * TMath::Sqrt(1/((pdgMassMother*pdgMassMother/(momentumMother*momentumMother)) + 1)));
3732 Double_t phi = selectedMother->Phi();
3733 Double_t theta = selectedMother->Theta();
3735 selectedMother->GetCovarianceXYZPxPyPz(covMatrix);
3742 Double_t errorMomentum = covMatrix[9]*cp*cp*ct*ct
3743 +covMatrix[13]*2.*cp*sp*ct*ct
3744 +covMatrix[18]*2.*cp*ct*st
3745 +covMatrix[14]*sp*sp*ct*ct
3746 +covMatrix[19]*2.*sp*ct*st
3747 +covMatrix[20]*st*st;
3748 Double_t normalizedDecayTime = selectedMother->
NormalizedDecayLength() / (299792458 * TMath::Sqrt(1/((pdgMassMother*pdgMassMother*errorMomentum*errorMomentum/(momentumMother*momentumMother)) + 1)));
3789 if(motherType==1 || motherType==5){
3790 motherType = motherType -1;
3792 AliAODRecoDecay* secondDaughter = (AliAODRecoDecay*)selectedMother->GetDaughter(1);
3793 AliAODTrack * pionD0 = (AliAODTrack*)selectedMother->GetDaughter(0);
3794 AliAODTrack * kaonD0 = (AliAODTrack*)selectedMother->GetDaughter(1);
3796 AliAODVertex * vertexDStar = vertexMother;
3797 AliAODVertex * vertexD0 = secondDaughter->GetSecondaryVtx();
3798 pdgMassMother = TDatabasePDG::Instance()->GetParticle(421)->Mass();
3800 AliExternalTrackParam pionD0Track;
3801 AliExternalTrackParam kaonD0Track;
3805 pionD0Track.CopyFromVTrack(pionD0);
3806 pionD0Track.PropagateToDCA(vertexDStar,bz,100.,d0z0,covd0z0);
3809 kaonD0Track.CopyFromVTrack(kaonD0);
3810 kaonD0Track.PropagateToDCA(vertexDStar,bz,100.,d0z0,covd0z0);
3813 AliExternalTrackParam D0Track;
3814 D0Track.CopyFromVTrack(secondDaughter);
3815 Double_t d0z0D0[2],covd0z0D0[3],d0D0;
3816 motherTrack.PropagateToDCA(vertexDStar,bz,100.,d0z0D0,covd0z0D0);
3819 Double_t impactProductToDStar = d0[0]*d0[1];
3822 Double_t momentumMother = secondDaughter->P();
3823 Double_t pointingAngleToDStar = secondDaughter->CosPointingAngle(vertexDStar);
3824 Double_t d0FirstDaughterToDStar = TMath::Abs(d0[0]);
3825 Double_t d0SecondDaughterToDStar = TMath::Abs(d0[1]);
3826 Double_t normDecayLengthToDStar = secondDaughter->NormalizedDecayLength(vertexDStar);
3828 Double_t pseudoProperDecayLength = ((vertexD0->GetX() - vertexDStar->GetX()) * secondDaughter->Px() / TMath::Abs(secondDaughter->Pt())) + ((vertexD0->GetY() - vertexDStar->GetY()) * secondDaughter->Py() / TMath::Abs(secondDaughter->Pt()));
3829 Double_t pseudoProperDecayTimeToDStar = pseudoProperDecayLength * pdgMassMother/ptMother;
3830 Double_t DecayTimeToDStar = vertexDistance / (299792458 * TMath::Sqrt(1/((pdgMassMother*pdgMassMother/(momentumMother*momentumMother)) + 1)));
3832 Double_t phi = secondDaughter->Phi();
3833 Double_t theta = secondDaughter->Theta();
3835 secondDaughter->GetCovarianceXYZPxPyPz(covMatrix);
3842 Double_t errorMomentum = covMatrix[9]*cp*cp*ct*ct
3843 +covMatrix[13]*2.*cp*sp*ct*ct
3844 +covMatrix[18]*2.*cp*ct*st
3845 +covMatrix[14]*sp*sp*ct*ct
3846 +covMatrix[19]*2.*sp*ct*st
3847 +covMatrix[20]*st*st;
3848 Double_t normDecayTimeToDStar = secondDaughter->NormalizedDecayLength(vertexDStar) / (299792458 * TMath::Sqrt(1/((pdgMassMother*pdgMassMother*errorMomentum*errorMomentum/(momentumMother*momentumMother)) + 1)));
Bool_t UseTPCRefitD0Pion()
Double_t DeltaInvMassB0Kpipipi(AliAODRecoCascadeHF *B0) const
Int_t * fMotherHistogramArray2D[6][7]
Double_t NormalizedDecayLength() const
Int_t fnPtBinsD0forD0ptbinLimits
virtual Int_t SelectPID(AliAODTrack *track, Int_t type)
Bool_t UseTPCRefitB0Pion()
Int_t GetMinTPCNclsD0Pion()
TList * fOutput
Use MC info.
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
Int_t fnPtBinsD0forDStarptbin
Int_t GetMinTPCNclsB0Pion()
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
TClonesArray * fDStarTracks
Int_t GetnSigmaTOF(AliAODTrack *track, Int_t species, Double_t &sigma) const
Float_t * fPtBinLimitsD0forDStarptbin
Bool_t UseITSRefitD0Kaon()
Double_t DeltaInvMassDStarKpipi(AliAODRecoCascadeHF *DStar) const
Float_t * fPtBinLimitsDStarforDStarptbin
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray, Bool_t isV0=kFALSE) const
AliAODVertex * RecalculateVertex(const AliVVertex *primary, TObjArray *tracks, Double_t bField, Int_t finderAlgorithm=1)
virtual ~AliAnalysisTaskSEB0toDStarPi()
virtual void Terminate(Option_t *option)
Int_t GetnSigmaTPC(AliAODTrack *track, Int_t species, Double_t &sigma) const
Bool_t UseTPCRefitDStarPion()
void D0Selection(AliAODEvent *aodEvent, AliAODVertex *primaryVertex, Double_t bz, TClonesArray *mcTrackArray, TMatrix *B0toDStarPiLabelMatrix)
Double_t GetMinPtD0Kaon()
Double_t ImpParXY() const
Bool_t fQuickSignalAnalysis
void D0PionSelection(AliAODEvent *aodEvent, TClonesArray *mcTrackArray, TMatrix *B0toDStarPiLabelMatrix)
Int_t * fDaughterHistogramArray2D[4][6]
AliNormalizationCounter * fCounter
!Counter for normalization slot 4
Int_t PtBinDStarforDStarptbin(Double_t pt) const
void FillD0Histograms(AliAODRecoDecayHF2Prong *selectedMother, AliAODVertex *primaryVertex, Double_t bz, Int_t motherType, Int_t histType)
void FillCascadeMotherHistograms(AliAODRecoCascadeHF *selectedMother, AliAODVertex *primaryVertex, Double_t bz, Int_t motherType, Int_t histType)
Int_t * fMotherHistogramArray[6][50][46]
Int_t GetWhyRejection() const
Double_t GetMinPtDStarPion()
Int_t IsD0forD0ptbinSelected(TObject *obj, Int_t selectionLevel, AliAODEvent *aod, Bool_t *bCutArray)
Double_t InvMassD0() const
Double_t Prodd0d0() const
AliAnalysisTaskSEB0toDStarPi()
TList * fOutputDStar_DStarPt
void D0KaonSelection(AliAODEvent *aodEvent, TClonesArray *mcTrackArray, TMatrix *B0toDStarPiLabelMatrix)
virtual void UserCreateOutputObjects()
Implementation of interface methods.
Int_t PtBinD0forDStarptbin(Double_t pt) const
Bool_t fUseMCInfo
n. of events
std::vector< Int_t > * fD0PionTracks
AliAODPidHF * GetPidHF() const
AliRDHFCutsB0toDStarPi * fCuts
Int_t GetMinTPCNclsD0Kaon()
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel, AliAODEvent *aod, Bool_t *bCutArray)
void B0toDStarPiSignalTracksInMC(TClonesArray *mcTrackArray, AliAODEvent *aodevent, TMatrix *B0toDStarPiLabelMatrix, TList *listout)
Int_t fnPtBinsD0forDStarptbinLimits
Int_t IsDStarforDStarptbinSelected(TObject *obj, Int_t selectionLevel, AliAODEvent *aod, Bool_t *bCutArray)
Bool_t UseFilterBitDStarPion()
Float_t * GetPtBinLimitsDStarforDStarptbin() const
Int_t GetNPtBinsD0forD0ptbin() const
Int_t fnPtBinsD0forD0ptbin
Int_t GetFilterBitD0Kaon()
Float_t * GetPtBinLimitsD0forD0ptbin() const
void SetProngIDs(Int_t nIDs, UShort_t *id)
UShort_t GetProngID(Int_t ip) const
virtual void UserExec(Option_t *option)
Bool_t UseTPCRefitD0Kaon()
std::vector< Int_t > * fDStarPionTracks
std::vector< Int_t > * fB0PionTracks
TList * fOutputB0MC
! User output 7
Double_t GetMinPtB0Pion()
void B0PionSelection(AliAODEvent *aodEvent, TClonesArray *mcTrackArray, TMatrix *B0toDStarPiLabelMatrix)
void SetPrimaryVtxRef(TObject *vtx)
primary vertex
Int_t GetMinITSNclsDStarPion()
Int_t GetMinITSNclsD0Kaon()
Int_t GetMinTPCNclsDStarPion()
Bool_t UseFilterBitB0Pion()
Double_t GetMinPtD0Pion()
Int_t GetFilterBitDStarPion()
Bool_t IsEventSelected(AliVEvent *event)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
void FillFinalTrackHistograms(AliAODRecoCascadeHF *motherCascadeHF, Bool_t isDesiredCandidate, TClonesArray *mcTrackArray)
std::vector< Int_t > * fD0KaonTracks
Int_t PtBinD0forD0ptbin(Double_t pt) const
TList * fOutputD0_DStarPt
TH1F * fCEvents
Cuts - sent to output slot 3.
Float_t * GetPtBinLimits() const
Int_t GetMinITSNclsB0Pion()
void DStarPionSelection(AliAODEvent *aodEvent, TClonesArray *mcTrackArray, TMatrix *B0toDStarPiLabelMatrix)
Int_t GetNPtBinsDStarforDStarptbin() const
Int_t * fDaughterHistogramArray[4][5][15]
Bool_t UseITSRefitB0Pion()
Int_t GetFilterBitD0Pion()
void DStarAndB0Selection(AliAODEvent *aodEvent, AliAODVertex *primaryVertex, Double_t bz, TClonesArray *mcTrackArray, TMatrix *B0toDStarPiLabelMatrix)
Int_t IsD0forDStarptbinSelected(TObject *obj, Int_t selectionLevel, AliAODEvent *aod, Bool_t *bCutArray)
Float_t * GetPtBinLimitsD0forDStarptbin() const
Int_t GetNPtBinsD0forDStarptbin() const
Int_t fnPtBinsDStarforDStarptbin
Bool_t UseFilterBitD0Kaon()
Bool_t UseFilterBitD0Pion()
Int_t fnPtBinsDStarforDStarptbinLimits
Int_t GetMinITSNclsD0Pion()
Double_t CosPointingAngle() const
Float_t * fPtBinLimitsD0forD0ptbin
AliAODRecoDecayHF2Prong * Get2Prong() const
Bool_t UseITSRefitD0Pion()
Int_t GetFilterBitB0Pion()
Int_t PtBin(Double_t pt) const
Bool_t UseITSRefitDStarPion()