Event decay problem using TGenPhaseSpace

hi ,
can anyone help me with this problem,
To develop an algorithm to generate a D0 meson of mass 1864.84±0.17 MeV assuming an exponential pT distribution and flat pseudo-rapidity distribution between -1 to 1. Allow the particle to decay to pi+ pi-. Generate 10^7 events, with each event containing D0 distributed with poison distribution of mean 4.

to make it simple: generate random events with 4D^o on an avg decaying into pi+pi- following poison distribution .
I’ve uploaded my code ,it doesn’t work properly.

Thanks in advance.

ChargedKStar8.C (9.0 KB)

Please read tips for efficient and successful posting and posting code

ROOT Version: 5
Platform: Not Provided
Compiler: Not Provided

The code seems not doing what you describe.
You need for each event generate a Poisson number with mean 4, using gRandom->Poisson(4), loop on this number and generate a D0 vector using:

  • pT from an exponential distribution : pt = gRandom->Exp(mean). What is the mean value ?
  • eta = gRandom->Uniform(-1,1)
  • phi = gRandom->>Uniform(-TMath::Pi()I,TMath::Pi())
  • mass = 1…86484 (fixed)

Then you create a LorentxVector with these generated values:

TLorentzVector D0;

and afterwards you generate the decaying particle using as in your code:

TGenPhaseSpace event; 
weight= event.Generate();


hi Lorenzo,
thanks, it really helped a lot.
can you tell me how to get the charge of the decay daughters?



You will have to deal with the charge separately. TGenPhaseSpace is only kinematics and it does not deal with charges of mother and daughter particles.


~thank you


Hi Lorenzo,

(a) can we find Experimental mass resolution with this?
(b) If the momentum resolution of electrons is 3%, find out the invariant mass distribution of D0?

how do we do this?
can you help.


Sorry for my late answer. Your question is not clear and I don’t see the relation with TGenPhaseSpace. This seems to me not a ROOT question but a physics analysis question that you should ask your supervisor or your colleagues.

Kind regards