Message: Re: G4ParticleGun substituted for G4GeneralParticleSource Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: G4ParticleGun substituted for G4GeneralParticleSource 

Forum: Event and Track Management
Re: None G4ParticleGun substituted for G4GeneralParticleSource (Bruce Pierson)
Date: 09 Oct, 2015
From: Makoto Asai <Makoto Asai>


I presume your issue is making the same distribution of primary particles with G4ParticleGun and G4GeneralParticleSource. Since you did not post the macro file you used to control G4GeneralParticleSource, it is not possible to identify what was wrong in your PrimaryGeneratorAction implementation. But one thing I noticed is the following.

> // fParticleGun->SetParticleMomentumDirection(G4ThreeVector(2*G4UniformRand()-1,2*G4UniformRand()-1,2*G4UniformRand()-1));

With this line it seems you intended to shoot primary particles evenly to all 4-pi direction. But you need to shoot particles evenly to all the solid angle.

You may want to refer this example code.

Hope this helps,

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

1 Agree: Re: G4ParticleGun substituted for G4GeneralParticleSource   (Bruce Pierson - 12 Oct, 2015)
 Add Message Add Message
to: "Re: G4ParticleGun substituted for 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 ]