Message: G4ParticleGun and G4GeneralParticleSource Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question G4ParticleGun and G4GeneralParticleSource 

Forum: Documentation and Examples
Date: 21 Apr, 2017
From: tibor koroknai <tibor koroknai>

Hi,

In the documentation here: https://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch02s07.html#ftn.idp60579152

It says: "In existing applications one can simply change your PrimaryGeneratorAction by globally replacing G4ParticleGun with G4GeneralParticleSource."

But G4GeneralParticleSource does not have the same member methods as G4ParticleGun. So I can not replace G4ParticleGun with G4GeneralParticleSource because ‘class G4GeneralParticleSource’ has no member named ‘SetParticleEnergy’ or ‘class G4GeneralParticleSource’ has no member named ‘SetParticleMomentumDirection’

Why are these member methods missing for the G4GeneralParticleSource?

The macro commands set the energy of the particle like this: /gps/ene/mono 1.33 MeV

I am trying to use the GPS to generate primaries from calculated phase space. Is that possible?

Thank you!

Tibor

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: G4ParticleGun and G4GeneralParticleSource   (Tim Fulcher - 21 Apr, 2017)
2 Question: Re: G4ParticleGun and G4GeneralParticleSource   (tibor koroknai - 22 Apr, 2017)
1 None: Re: G4ParticleGun and G4GeneralParticleSource   (Tim Fulcher - 22 Apr, 2017)
(_ Ok: Re: G4ParticleGun and G4GeneralParticleSource   (tibor koroknai - 23 Apr, 2017)
 Add Message Add Message
to: "G4ParticleGun and G4GeneralParticleSource"

 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 ]