ROOT Version: 6.12/04
Platform: macOS Mojave 10.14.1
Compiler:
Hi ROOTers,
I tried to write a code to simulate invariant mass of a specific particle. The code is:
void massa_invariante() {
TLorentzVector rho(0.0, 0.0, 0.0, 0.770);
Double_t masses[2] = {0.139, 0.139} ;
TGenPhaseSpace event;
event.SetDecay(rho, 2, masses);
TH1F mass_inv("Note","Distribuzione in massa invariante del processo #rho#rightarrow#pi^{+}#pi^{-}", 1000,0,2);
for (Int_t n=0;n<1000000;n++) {
Double_t weight = event.Generate();
TLorentzVector *pmeno = event.GetDecay(0);
TLorentzVector *ppiu = event.GetDecay(1);
mass_inv.Fill((pmeno+ppiu).Mag() ,weight);
}
TCanvas *c1=new TCanvas();
mass_inv.SetXTitle("M_{#pi^{+}#pi^{-}} GeV");
mass_inv.SetYTitle("N");
mass_inv.DrawCopy();
c1->SaveAs("mass_inv.pdf");
}
the output generate a fake rho(770) invariant mass. Why this happened?
mass_inv.pdf (17.8 KB)
Someone could help me?
Thanks.