Message: Memory use when looping GeneratePrimaryVertex Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Memory use when looping GeneratePrimaryVertex 

Forum: Particles
Date: 30 Sep, 2015
From: Christian L <Christian L>

Hello,

I have millions of photons saved in a text file. In my primary generator action class in GeneratePrimaries I read one photon at a time, and then give position, direction and energy like this and then generate primary vertex:

  fParticleGun->SetParticlePosition(position);
  fParticleGun->SetParticleMomentumDirection(direction);
  fParticleGun->SetParticleEnergy(en*MeV);

  fParticleGun->GeneratePrimaryVertex(anEvent);

However, when I loop this millions of times, too much memory is used. The line that uses too much memory is "fParticleGun->GeneratePrimaryVertex(anEvent);".

How can I create a different primary vertex for every particle without using so much memory? I would like to shoot particles once in a while to free memory but I don't see how I could do that since BeamOn() is run somewhere else.

Thanks, Chris

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

1 None: Re: Memory use when looping GeneratePrimaryVertex   (Makoto Asai - 30 Sep, 2015)
(_ Question: Re: Memory use when looping GeneratePrimaryVertex   (Christian L - 30 Sep, 2015)
(_ None: Re: Memory use when looping GeneratePrimaryVertex   (Makoto Asai - 30 Sep, 2015)
(_ Question: Re: Memory use when looping GeneratePrimaryVertex   (Christian L - 05 Oct, 2015)
 Add Message Add Message
to: "Memory use when looping GeneratePrimaryVertex"

 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 ]