Initial Gamma is always 1 GeV

Howdy,

I’ve notice that the first particle I get in my macro runs regardless of Generator.cc settings is 1 GeV.

generator.cc

// Define Particle Energy
	fParticleGun->SetParticleMomentum(G4RandGauss::shoot(3.0 * MeV, 1.5 * MeV));

results in:

 G4ParticleGun::gamma
 was defined in terms of KineticEnergy: 1GeV
 is now defined in terms Momentum: 0.00280377GeV/c

This was happening before when using 10.7.4 but the effects on the particle transport was no different than subsequent particles. Now it appears as a massive particle shower that is consuming resources for a scenario I do not want. I wish to preserve the Gaussian distribution till I impliment an explicit spectrum as it’s close enough but don’t understand why I have a 1 GeV initial particle.

Thanks

_Geant4 Version: 11.2.2
_Operating System: Cluster Linux
_Compiler/Version: UNKNOWN, CLUSTER
_CMake Version: UNKNOWN, CLUSTER


If you are wanting to set the kinetic energy of the primary particle to some value could you instead use the G4ParticleGun function SetParticleEnergy? Since you are not specifying the particle’s kinetic energy I think Geant4 is defaulting to 1 GeV.

That seems to have worked for the first particle from the first few minutes of sim. I’ll let it run overnight and check it in the morning to see if it cleaned it all up and mark the solution if it works. Thanks!

Verified that this did resolve the initial energy of the first particle being 1 GeV and greatly reduced a related issue and since it didn’t eliminate it I was able to track that one down too. Thanks Keith

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