All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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()`).
30  std::string ParticleStatusName(int code);
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.
46  std::string TruthOriginName(simb::Origin_t 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).
53  std::string TruthReactionMode(int mode);
54 
55  /// Returns a string representing the specified interaction type as in
56  /// `simb::MCTruth` convention.
57  std::string TruthInteractionTypeName(int type);
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  */
71  std::string RescatteringName
73 
74  /// Description of a rescattering code from GENIE `INukeFateHA_t`.
75  std::string GENIE_INukeFateHA_RescatteringName(int code);
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 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 &quot;mode&quot; of the reaction (a lesser version of interaction type).
const char mode
Definition: noise_ana.cxx:20
std::string ParticleName(int pigid)
Returns a string with the name of particle the specified with PDG ID.
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