LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
sim.h
Go to the documentation of this file.
1 
7 #ifndef LARDATAOBJ_SIMULATION_SIM_H
8 #define LARDATAOBJ_SIMULATION_SIM_H
9 
10 #include "TRandom3.h"
11 #include <limits>
12 
14 namespace sim {
15 
16  unsigned int GetRandomNumberSeed();
17 
18  // any track id method returns sim::Particle:NoParticleId, it means the
19  // associated particle was too low-energy to be written by the
20  // detector Monte Carlo.
21  static const int NoParticleId = std::numeric_limits<int>::min();
22 
23 }
24 
25 inline unsigned int sim::GetRandomNumberSeed()
26 {
27 
28  // the maximum allowed seed for the art::RandomNumberGenerator
29  // is 900000000. Use TRandom3 to get the seed value in that range.
30  // Instantiating TRandom3 with a 0 means that its seed is set based
31  // on the TUUID and should always be random, even for jobs running on the
32  // same machine
33  TRandom3 rand(0);
34  return rand.Integer(900000000);
35 }
36 
37 #endif // LARDATAOBJ_SIMULATION_SIM_H
static const int NoParticleId
Definition: sim.h:21
Monte Carlo Simulation.
unsigned int GetRandomNumberSeed()
Definition: sim.h:25