Message: Re: GeneralParticleSource ignoring particle position given in GeneratePrimaries Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: GeneralParticleSource ignoring particle position given in GeneratePrimaries 

Forum: Particles
Re: Question GeneralParticleSource ignoring particle position given in GeneratePrimaries
Re: Feedback Re: GeneralParticleSource ignoring particle position given in GeneratePrimaries
Date: 20 Feb, 2017
From: <php1ic>

So after failing to create my own messenger class by inheriting from G4GeneralParticleSourceMessenger, due to it's private constructor (and my lack of C++ knowledge in this area), I borrowed from:

examples/extended/eventgenerator/particleGun/src/PrimaryGeneratorAction2.cc

and added a method in PrimaryActionGenerator to read a file for the energy distribution then randomly sample it in GeneratePrimaries(). All while using G4ParticleGun rather than G4GeneralParticleSource.

I still don't fully understand why G4GPS does not alter a particle's position via the SetParticlePositon method, so if anyone has any ideas...

Thanks

 Add Message Add Message
to: "Re: GeneralParticleSource ignoring particle position given in GeneratePrimaries"

 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 ]