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 ///
8 /// Coding note: Never put `#include "sim.h"` in your code. It would
9 /// force a dependency in your class on every other class in the
10 /// Simulation directory; e.g., if I changed the MCTruth code, your
11 /// code that generates Electrons would re-compile. This class exists
12 /// solely as a bookkeeping tool.
13 
14 #ifndef LARDATAOBJ_SIMULATION_SIM_H
15 #define LARDATAOBJ_SIMULATION_SIM_H
16 
17 #include <limits>
18 #include "TRandom3.h"
19 
20 ///Monte Carlo Simulation
21 namespace sim{
22 
23  unsigned int GetRandomNumberSeed();
24 
25  // any track id method returns sim::Particle:NoParticleId, it means the
26  // associated particle was too low-energy to be written by the
27  // detector Monte Carlo.
29 
30 }
31 
32 inline unsigned int sim::GetRandomNumberSeed(){
33 
34  // the maximum allowed seed for the art::RandomNumberGenerator
35  // is 900000000. Use TRandom3 to get the seed value in that range.
36  // Instantiating TRandom3 with a 0 means that its seed is set based
37  // on the TUUID and should always be random, even for jobs running on the
38  // same machine
39  TRandom3 rand(0);
40  return rand.Integer(900000000);
41 }
42 
43 
44 #endif// LARDATAOBJ_SIMULATION_SIM_H
static const int NoParticleId
Definition: sim.h:28
Code to link reconstructed objects back to the MC truth information.
unsigned int GetRandomNumberSeed()
Definition: sim.h:32
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55