LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evgenbase.h
Go to the documentation of this file.
1 #ifndef EVGENBASE_H
2 #define EVGENBASE_H
3 
4 #include "TRandom3.h"
5 
7 namespace evgb {
14  enum {
17  };
18 
19  unsigned int GetRandomNumberSeed();
20 }
21 
22 inline unsigned int evgb::GetRandomNumberSeed()
23 {
24 
25  // the maximum allowed seed for the art::RandomNumberGenerator
26  // is 900000000. Use the system random number generator to get a pseudo-random
27  // number for the seed value, and take the modulus of the maximum allowed
28  // seed to ensure we don't ever go over that maximum
29 
30  // Set gRandom to be a TRandom3 based on this state in case we need to pull
31  // random values from histograms, etc
32  TRandom3 *rand = new TRandom3(0);
33  gRandom = rand;
34  return rand->Integer(900000000);
35 }
36 
37 #endif
unsigned int GetRandomNumberSeed()
Definition: evgenbase.h:22
Physics generators for neutrinos, cosmic rays, and others.
Definition: CRYHelper.cxx:33