Message: Re: The default energy unit in the point-wise energy spectrum Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Note Re: The default energy unit in the point-wise energy spectrum 

Forum: Particles
Re: Question The default energy unit in the point-wise energy spectrum (Hubert Hu)
Re: Note Re: The default energy unit in the point-wise energy spectrum (Hubert Hu)
Date: 04 Sep, 2016
From: Hubert Hu <Hubert Hu>

[solved]

After exploration,I've found it is a problem from my Geant4 code.
I call the G4PrimaryParticle -> getTotalEnergy() to acquire the primary's energy.
In fact, this getTotalEnergy()function returns both kinetic energy and the mass of the particle.

See its source code:
  213 { 
  214  if (mass<0.) return kinE; 
  215  else return std::sqrt(kinE*(kinE+2.*mass));
  216 }

The energy in the GPS macro actually refers to the kinetic energy.
So the proper function I should call is GetKineticEnergy().

Now the energy show is all correct.

Hope this can benefit other uses encounter similar problem.

Cheers,

Hubert

 Add Message Add Message
to: "Re: The default energy unit in the point-wise energy spectrum"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]