TGenPhaseSpace in PyROOT

Hello,
I need TGenPhaseSpace in my PyROOT code. I wrote:

event1 = TGenPhaseSpace
event1.SetDecay(rho, 2, mass_pi)

but I have given errors:

Traceback (most recent call last):
  File "/home/pogodin/chfit.py", line 23, in <module>
    event1.SetDecay(rho, 2, mass_pi)
TypeError: bool TGenPhaseSpace::SetDecay(TLorentzVector& P, int nt, const double* mass, const char* opt = "") =>
    TypeError: unbound method TGenPhaseSpace::SetDecay must be called with a TGenPhaseSpace instance as first argument

What I must do?


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.22/08
Platform: Linux
Compiler: gcc


Hello,

In the line:

event1 = TGenPhaseSpace

You are assigning the class TGenPhaseSpace itself to event1, you are not constructing an object of class TGenPhaseSpace. So you need to do event1 = TGenPhaseSpace(...) where ... are the constructor arguments.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.