Simulation.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \brief Useful tools for simulation
3 /// \author brebel@fnal.gov
4 /// \date
5 ///////////////////////////////////////////////////////////////////////
7 
8 #include "TRandom3.h"
9 
10 namespace sim
11 {
12  //................................................................
13  unsigned int GetRandomNumberSeed()
14  {
15  // the maximum allowed seed for the art::RandomNumberGenerator
16  // is 900000000. Use TRandom3 to get the seed value in that range.
17  // Instantiating TRandom3 with a 0 means that its seed is set based
18  // on the TUUID and should always be random, even for jobs running on the
19  // same machine
20  TRandom3 *rand = new TRandom3(0);
21 
22  // set gRandom to be our new TRandom3 for cases where we need to pull
23  // random numbers out of ROOT histograms, etc
24  gRandom = rand;
25  return rand->Integer(900000000);
26  }
27 
28 } // end namespace sim
29 ////////////////////////////////////////////////////////////////////////
Example routine for calculating the "ultimate e-m mother" of a particle in a simulated event...
Definition: FillTruth.h:16
unsigned int GetRandomNumberSeed()
Definition: Simulation.cxx:13