Get invariant mass

Hello…I can’t find how to get the invariant mass…
double InvMass = step->GetTrack()->GetDynamicParticle()->GetInvariantMass();
it says that GetInvariantMass(); isnt’ a memeber of GetDynamicParticle()- and I can’t find the member of what function it is…
Thank you

Ok I did it by calculating it getting the total energy and the total momentum

From G4DynamicParticle.hh line 159:

inline G4double GetMass() const;

The work “invariant” is redundant. Mass is an intrinsic property of a particle and is necessarily an invariant scalar. In G4DynamicParticle, the mass returned may include such things as orbital electrons, excited state, etc. For resonances such as hyperons, the G4DynamicParticle mass may also be chosen for a specific instance from the Breit-Wigner distribution. You may use G4ParticleDefinition::GetPDGMass() to get the “bare” or “minimal” mass of a particle or resonance.

Thank you @mkelsey and merry christmas