Message: Re: Gun more than 1 primary in PrimaryGeneratorAction Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Gun more than 1 primary in PrimaryGeneratorAction 

Forum: Event and Track Management
Re: Question Gun more than 1 primary in PrimaryGeneratorAction (lu luo)
Date: 17 Jul, 2010
From: Rohin <Rohin>

Hi

In the GeneratePrimaries method of your derived class, run a for loop. Set the particle gun properties using set functions of the particle gun object and finally generate the event in the loop itself.

example:
for(int i = 0;i<n_particles;i++)
{
   //Set the positions and momentums within the loop using G4UniformRand()
   particleGun->SetPosition(someposition);
   particleGun->SetMomentum(somemomentum);

   particleGun->generatePrimaryVertex(eventpointer);
}

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

1 None: Re: Gun more than 1 primary in PrimaryGeneratorAction   (lu luo - 18 Jul, 2010)
(_ None: Re: Gun more than 1 primary in PrimaryGeneratorAction   (Rohin - 18 Jul, 2010)
(_ Ok: Re: Gun more than 1 primary in PrimaryGeneratorAction   (lu luo - 18 Jul, 2010)
(_ Feedback: Re: Gun more than 1 primary in PrimaryGeneratorAction   (Gumplinger Peter - 19 Jul, 2010)
(_ None: Re: Gun more than 1 primary in PrimaryGeneratorAction   (lu luo - 19 Jul, 2010)
(_ Feedback: Re: Gun more than 1 primary in PrimaryGeneratorAction   (Gumplinger Peter - 19 Jul, 2010)
 Add Message Add Message
to: "Re: Gun more than 1 primary in PrimaryGeneratorAction"

 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 ]