Message: Re: 2 differents particle types as primaries Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: 2 differents particle types as primaries 

Forum: Event and Track Management
Re: None 2 differents particle types as primaries (Olivier Dadoun)
Date: 08 Oct, 2010
From: michel maire <michel maire>

On Tue, 05 Oct 2010 15:22:15 GMT, Olivier Dadoun wrote:
> Dear All,
> 
> I would like to define 2 different particle type as a primary event.
> Does the following lines are correct ?  
> void PPSPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
> {
> ....
> //gamma event 
> G4ParticleDefinition* particle = G4ParticleTable::GetParticleTable()->FindParticle("gamma");
> particleGun->SetParticleDefinition(particle);
> particleGun->SetParticlePosition(position_emission_gamma);
> particleGun->SetParticleMomentum(momentum_emission_gamma);
> particleGun->GeneratePrimaryVertex(anEvent);
> 
> //e- event
> particle = G4ParticleTable::GetParticleTable()->FindParticle("e-");
> particleGun->SetParticleDefinition(particle);
> particleGun->SetParticlePosition(position_emission_e);
> particleGun->SetParticleMomentum(momentum_emission_e);
> particleGun->GeneratePrimaryVertex(anEvent);
> }
> 
> by advance thank you
> Olivier
> PS: It seems that under my mac is working but not under linux (but I not really sure that the problem is this one)...
> 

  Your code is correct and should work on any machine

     Cheers,  Michel

 Add Message Add Message
to: "Re: 2 differents particle types as primaries"

 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 ]