MCDumperUtils.h
Go to the documentation of this file.
1 /**
2  * @file lardataalg/MCDumpers/MCDumperUtils.h
3  * @brief Utility functions to print MC truth information.
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date November 2, 2017
6  *
7  * Utilities for dumping on screen of Monte Carlo data.
8  *
9  */
10 
11 #ifndef LARDATAALG_MCDUMPERS_MCDUMPERUTILS_H
12 #define LARDATAALG_MCDUMPERS_MCDUMPERUTILS_H
13 
14 // nusimdata libraries
15 #include "nusimdata/SimulationBase/MCTruth.h" // simb::Origin_t
16 
17 // C/C++ standard libraries
18 #include <string>
19 
20 
21 namespace sim {
22 
23  /// @{
24  /// @name Function to name `simb::MCParticle` enumerators and codes.
25 
26  /// Returns a string with the name of particle the specified with PDG ID.
27  std::string ParticleName(int pigid);
28 
29  /// Describes the status of a particle (`simb::MCParticle::StatusCode()`).
31 
32  /// @}
33 
34 
35  /// @{
36  /// @name Functions to name `simb::MCTruth` enumerators and codes.
37 
38  /// Possible sources of rescattering code (which is generator-dependent).
39  enum class RescatterCategory {
40  GENIE_INukeFateHA, ///< GENIE `genie::EINukeFateHA_t`
42  };
43 
44 
45  /// Returns a string representing the specified process origin.
47 
48  /// Returns a string representing the specified process from `simb::MCTruth`
49  /// (CC or NC, nothing fancy).
50  std::string TruthCCNCname(int ccnc);
51 
52  /// Returns the "mode" of the reaction (a lesser version of interaction type).
54 
55  /// Returns a string representing the specified interaction type as in
56  /// `simb::MCTruth` convention.
58 
59  /**
60  * @brief The name of the specified rescattering code.
61  * @param code the rescattering code
62  * @param type the category of rescattering `code` belongs to
63  * @return a string describing the rescattering code
64  *
65  * The meaning of the rescattering code is generator-dependent, and also
66  * within a generator it may be algorithm-dependent. The category pins down
67  * which set of possible meaning the `code` belongs to. In LArSoft, if the
68  * code is unassigned by the generator, it will default to
69  * `simb::MCParticle::s_uninitialized`.
70  */
73 
74  /// Description of a rescattering code from GENIE `INukeFateHA_t`.
76 
77  /// @}
78 
79 
80 } // namespace sim
81 
82 
83 #endif // LARDATAALG_MCDUMPERS_MCDUMPERUTILS_H
GENIE genie::EINukeFateHA_t
RescatterCategory
Possible sources of rescattering code (which is generator-dependent).
Definition: MCDumperUtils.h:39
std::string TruthInteractionTypeName(int type)
std::string string
Definition: nybbler.cc:12
enum simb::_ev_origin Origin_t
event origin types
std::string TruthCCNCname(int ccnc)
std::string RescatteringName(int code, RescatterCategory cat=RescatterCategory::LArSoftDefault)
The name of the specified rescattering code.
std::string TruthReactionMode(int mode)
Returns the "mode" of the reaction (a lesser version of interaction type).
std::string ParticleName(int pigid)
Returns a string with the name of particle the specified with PDG ID.
CodeOutputInterface * code
Code to link reconstructed objects back to the MC truth information.
std::string TruthOriginName(simb::Origin_t origin)
Returns a string representing the specified process origin.
std::string GENIE_INukeFateHA_RescatteringName(int code)
Description of a rescattering code from GENIE INukeFateHA_t.
std::string ParticleStatusName(int code)
Describes the status of a particle (simb::MCParticle::StatusCode()).
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227