Message: Changing initial seed in GRAS Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Changing initial seed in GRAS 

Forum: Space Applications
Date: 07 Mar, 2016
From: Leonardo Ghizoni <Leonardo Ghizoni>

Hello,

I wander what is the best way of changing the initial seed in GRAS.

I see that I could add in the main file (assuming I'm using GRAS as an external application):

#include "Randomize.hh"
#include "time.h"

CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine());

G4long seed = time(NULL);

CLHEP::HepRandom::setTheSeed(seed);

But I would like to know if there's a way of changing this via macro, as that's the GRAS "way".

My initial seed is always the same:

Initial seed = 9876
 u[] = 0.174685 0.883674 0.958512 0.690013 0.0250537 0.142294 0.783649 0.356081

0.214774 0.69287 0.700302 0.465109 0.22215 0.768752 0.461089 0.397602 0.522215

0.121546 0.960227 0.510892 0.0116568 0.0286447 0.238777 0.585219 0.780612

0.709182 0.082106 0.828601 0.61446 0.0798209 0.688002 0.00978529 0.370831

0.376435 0.710184 0.864017 0.167338 0.21114 0.349235 0.522479 0.943713

0.0702708 0.778742 0.639458 0.506555 0.151751 0.990123 0.564688 0.430497

0.889832 0.995398 0.725368 0.710512 0.0550886 0.0540335 0.0159176 0.728379

0.947141 0.34922 0.20551 0.351029 0.672539 0.118976 0.655784 0.195375 0.0380308

0.293556 0.237497 0.79723 0.158375 0.029761 0.602215 0.616657 0.995638 0.734827

0.943425 0.130007 0.277064 0.306344 0.973337 0.183926 0.547536 0.914344

0.666572 0.210074 0.300351 0.83602 0.267525 0.248549 0.533332 0.1754 0.299529

0.538308 0.555472 0.283894 0.485254 0.222273

c = 0.0216029, cd = 0.456233, cm = 1

i97 = 96, u[i97] = 0.222273

j97 = 32, u[j97] = 0.370831

As a consequence, I always get exactly the same results.

Thank a lot. Leonardo.

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

1 None: Re: Changing initial seed in GRAS   (Hugh Evans - 07 Mar, 2016)
(_ None: Re: Changing initial seed in GRAS   (Leonardo Ghizoni - 07 Mar, 2016)
 Add Message Add Message
to: "Changing initial seed in GRAS"

 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 ]