Phase Space

Example of use of TGenPhaseSpace

Author: Valerio Filippini
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Monday, November 18, 2019 at 12:27 AM.

In [1]:
TLorentzVector target(0.0, 0.0, 0.0, 0.938);
TLorentzVector beam(0.0, 0.0, .65, .65);
TLorentzVector W = beam + target;

(momentum, energy units are gev/c, gev)

In [2]:
Double_t masses[3] = { 0.938, 0.139, 0.139} ;

TGenPhaseSpace event;
event.SetDecay(W, 3, masses);

TH2F *h2 = new TH2F("h2","h2", 50,1.1,1.8, 50,1.1,1.8);

for (Int_t n=0;n<100000;n++) {
   Double_t weight = event.Generate();

   TLorentzVector *pProton = event.GetDecay(0);

   TLorentzVector *pPip    = event.GetDecay(1);
   TLorentzVector *pPim    = event.GetDecay(2);

   TLorentzVector pPPip = *pProton + *pPip;
   TLorentzVector pPPim = *pProton + *pPim;

   h2->Fill(pPPip.M2() ,pPPim.M2() ,weight);
}
h2->Draw();
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1

Draw all canvases

In [3]:
%jsroot on
gROOT->GetListOfCanvases()->Draw()