Message: Re: How to Randomize each Run? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: How to Randomize each Run? 

Keywords: randomize
Forum: Event and Track Management
Re: None How to Randomize each Run? (Jeremy)
Re: Idea Re: How to Randomize each Run? (Domingo Granero)
Date: 27 Feb, 2003
From: michel maire <michel maire>

User Domingo Granero wrote:

>>  Try to put this code in your own class RunAction:
>>  HepRandom::setTheEngine(new RanecuEngine); //selection of a random
>>  engine

    I think that it is not necessary to create a new engine at each run.
    The above statement can be done only once, for instance in the main.

>>  G4long seed=time(0); //returns time in seconds as an integer
>>  HepRandom::setTheSeed(seed);//changes the seed of the random engine

    In fact, at least with Ranecu, it is not necessary to force the
    seed at each run. If you run sequencially several runs in the same
    job (as your macro suggest), the state of the engine at the begin
    of a run is egal to the state a the end of the previous run.
    Therefore your runs are automatically differents.

>>  HepRandom::showEngineStatus();//shows the actual seed

    To check what I said, put the showEngineStatus at BeginOfRunAction and
    (see also extended/electromagnetic/TestEm1)

>>  also you have to include the headers
>>  #include "Randomize.hh"
>>  #include <time.h>
>>  for more information see the section "3.2.2 The HEPRandom module in
>>  CLHEP" in the manual

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

 Add Message Add Message
to: "Re: How to Randomize each Run?"

 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 ]