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

None 2 differents particle types as primaries 

Forum: Event and Track Management
Date: 05 Oct, 2010
From: Olivier Dadoun <Olivier Dadoun>

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)...

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

1 None: Re: 2 differents particle types as primaries   (michel maire - 08 Oct, 2010)
 Add Message Add Message
to: "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 ]