All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sim.h
Go to the documentation of this file.
1 /// \file lardataobj/Simulation/sim.h
2 ///
3 /// \brief Tools and modules for checking out the basics of the Monte Carlo
4 ///
5 /// \author brebel@fnal.gov
6 
7 #ifndef LARDATAOBJ_SIMULATION_SIM_H
8 #define LARDATAOBJ_SIMULATION_SIM_H
9 
10 #include <limits>
11 #include "TRandom3.h"
12 
13 ///Monte Carlo Simulation
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  // the maximum allowed seed for the art::RandomNumberGenerator
28  // is 900000000. Use TRandom3 to get the seed value in that range.
29  // Instantiating TRandom3 with a 0 means that its seed is set based
30  // on the TUUID and should always be random, even for jobs running on the
31  // same machine
32  TRandom3 rand(0);
33  return rand.Integer(900000000);
34 }
35 
36 
37 #endif// LARDATAOBJ_SIMULATION_SIM_H
static const int NoParticleId
Definition: sim.h:21
unsigned int GetRandomNumberSeed()
Definition: sim.h:25