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