simb.h
Go to the documentation of this file.
1 /**
2  * @file nusimdata/SimulationBase/simb.h
3  * @brief Common type definitions for data products (and a bit beyond).
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date April 6, 2018
6  */
7 
8 #ifndef NUSIMDATA_SIMULATIONBASE_SIMB_H
9 #define NUSIMDATA_SIMULATIONBASE_SIMB_H
10 
11 // C++ standard library
12 #include <limits> // std::numeric_limits<>
13 
14 
15 /// Base utilities and modules for event generation and detector simulation.
16 namespace simb {
17 
18  //--- BEGIN Generator index --------------------------------------------------
19  /// @{
20  /**
21  * @name Generated particle index
22  *
23  * This type represents the position of a specific generated particle in the
24  * generator truth record, `simb::MCTruth`.
25  * The particle itself can be accessed from that record via
26  * `simb::MCTruth::GetParticle()`.
27  */
28 
29  /// Type of particle index in the generator truth record (`simb::MCTruth`).
30  using GeneratedParticleIndex_t = std::size_t;
31 
32  /// Constant representing the absence of generator truth information.
35 
36  /// Returns whether the specified one is an acceptable generator index.
38  { return index != NoGeneratedParticleIndex; }
39 
40  /// @}
41  //--- END Generator index ----------------------------------------------------
42 
43 
44 } // namespace simb
45 
46 
47 
48 #endif // NUSIMDATA_SIMULATIONBASE_SIMB_H
constexpr GeneratedParticleIndex_t NoGeneratedParticleIndex
Constant representing the absence of generator truth information.
Definition: simb.h:34
bool isGeneratedParticleIndex(GeneratedParticleIndex_t index)
Returns whether the specified one is an acceptable generator index.
Definition: simb.h:37
This class describes a particle created in the detector Monte Carlo simulation.
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
std::size_t GeneratedParticleIndex_t
Type of particle index in the generator truth record (simb::MCTruth).
Definition: simb.h:30