Message: Non-symetrical distribution of randomly generated particles Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Non-symetrical distribution of randomly generated particles 

Forum: Particles
Date: 22 Sep, 2015
From: A.T. <A.T.>

Hi everyone,

I am a new user of Geant4, I hope I am in the good part of the forum... I have several issues with the generation of random particles. I would like to study the interaction of several millions of gamma with my system in order to calculate a shielding thickness.

The system is mainly composed by: - an isotropic source surrounded by a lead housing in order to collimate the photons in a beam - several elements in the system that interact with the photons - a shield of lead - a measurement cylinder composed of water used to get the dose around the system. it is a tube where I save step position and deposited energy. I then discretize this volume in small elements to get a kind of map of the dose. I am sure there is a better solution but I thought to that first...

After several tries I realised that I have some issues with the random number generator.

I used in the main G4Random::setTheEngine(new CLHEP::HepJamesRandom);

and in PrimaryGeneratorAction:

G4double randTheta = G4UniformRand();

G4double randPhi = G4UniformRand();

G4double cosTheta = 2 * randTheta - 1., phi = twopi*randPhi ;

I looked the given randTheta and randPhi values and observed repeated values: about 6 repeated values for 10 000 event, 330 for 100 000, 40 000 for 1e6...) I read a lot the forum and I saw that many of us had this issue when a big event number is required. But it is mainly linked to a seed and I am not sure that is the problem here( I run only one /run/beamOn XX command)

So I tried something else: Instead of using G4UniformRand(), I used CLHEP:RandFlat::shoot(0.0, 1.0). The repeated values disappear completely (why ?). But I had a weird side effect. When I look the distribution of the dose in my volume I saw a strange non symmetrical distribution. I did the test with a simplified system (only the source, the source housing and the measurement cylinder) and I looked the dose in front of the source. We should expect a spot centred on the beam with a diameter about 75 mm. It is not that I obtain.

The following plot shows the distribution of the dose in front of the source for the two random number generation process. You can see that the G4UniformRand create a centred distribution but not CLHEP:RandFlat::shoot(0.0, 1.0). however the spot diameter is about 100 mm for CLHEP:RandFlat::shoot(0.0, 1.0), and roughly 200 mm for the G4UniformRand(). Nothing changes between the two tests except the way I generate random number.

I don't understand what is happening here. Do you have an idea ?

Thank you very much for your help.

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2015/09/22/04.44-64327-symetry_issue.png
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2015/09/22/04.44-37726-topview.png

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

1 Feedback: Re: Non-symetrical distribution of randomly generated particles   (A.T. - 24 Sep, 2015)
 Add Message Add Message
to: "Non-symetrical distribution of randomly generated particles"

 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 ]