Message: once again about generating multiple particles of different types within an event Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question once again about generating multiple particles of different types within an event 

Forum: Event and Track Management
Date: 08 Oct, 2007
From: Victor_Makarov <Victor_Makarov>

Suppose, I've got an array in a file which contains lots of particles (their type, position, energy). I would like to read the file and generate those ones via PrimaryGeneratorAction within an event. I've read post 388 where Makoto Asai says that one has to invoke G4ParticleGun more than once. I guess I'll have to deal with a loop with a size of particles' number in my file, right? But I'm not quite sure where to put the loop. For example, this is a structure of PrimaryGeneratorAction.cc:

PrimaryGeneratorAction::PrimaryGeneratorAction() { ..... ..... }

PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
  delete particleGun;
}

void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
 .........
.......
  particleGun->GeneratePrimaryVertex(anEvent);
}
Where do I have to put a loop?

Thank you very much.

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

1 None: Re: once again about generating multiple particles of different types within an event   (Liang Zhan - 09 Oct, 2007)
(_ None: Re: once again about generating multiple particles of different types within an event   (Victor_Makarov - 09 Oct, 2007)
 Add Message Add Message
to: "once again about generating multiple particles of different types within an event"

 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 ]