Re: source particle distributed by Gaussian

From: Anna Ferrari <>
Date: Thu, 26 Feb 2009 01:52:14 +0100 (CET)

Dear Vitaliy,

  some observations about your source_test.f routine.

 1) Concerning your method
    If you want to use a pre-generated external file, the correct way to do
    this is:

     (a) read the primaries at the initialitation time;
     (b) do a random sampling between the particles in memory.

     You can find useful to read the observations of Alfredo in:

     about the importance of using a random selection in a pre-generated

     In order to do the step (a) in your source routine, you have to open
     and read your external file in the IF(LFIRST) block.... you DO NOT DO
     this. You open your external file and read your arrays out of the
     initialitation block.
     In this way:

       - you OPEN your external file each time you go in the
         source.f routine (at each new event!!).... you will crash the
         second time;
       - you try to read your arrays each time you go in the
         source.f routine: this doesn't make sense.

  Other details:
   - the dimension of your arrays is 1000000 but
     you loop:
       DO N_PART=1,1000000000
     You will have problems at the 1000000+1 particle...
   - TAKE CARE about the cosine normalization: you did not
     change the TZFLK default value (that is 1, because the beam is
     directed by default along the z axis), you have to use the normalized

   2) I would like to suggest a different approach to solve your problem.
      You can use the generator, available in FLUKA:


     that performs the sampling of two independent Gaussian distributed
     By default the sigma of the distribution is 1; to obtain the two
     gaussian distributions with the desired sigma values, you have to
     multiply RGAUS1, RGAUS2 by the correct sigma values.

     Hope it helps,


PS: thanks Alberto for the useful discussion

> Good morning,
> I have a problem. Hopefully, somebody can help me. My task is to create
> a source file in which particles in all three planes should have a
> Gaussian distribution. At the beginning I simplified the task and fixed
> z-coordinate, therefore, only two planes are required. I tried to use an
> external dat-file as a source and even started with random distribution
> of the particles. An idea is to load the particles' coordinates and
> corresponding angles from that external file. That's why I used just a
> template of the source.f with the minor changes (see the attachment). I
> changed the meaning of the cosine and coordinate variables. There are x,
> x', y, y' coordinates (obtained by the external code) in the
> ellipseFLUKA.dat (see the attachment). Unfortunately, it doesn't work
> properly. Maybe there is an easier way to solve this problem.
> Thank you in advance for any assistance.
> Best regards,
> Vitaliy Gostishchev
> --
> Gesellschaft fur Schwerionenforschung mbH
> Planckstrasse 1
> D-64291 Darmstadt
> Gesellschaft mit beschrenkter Haftung
> Sitz der Gesellschaft: Darmstadt
> Handelsregister: Amtsgericht Darmstadt, HRB 1528
> Geschaftsfhrer: Professor Dr. Horst Stocker
> Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph,
> Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt
Received on Thu Feb 26 2009 - 16:18:11 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 26 2009 - 16:18:12 CET