![]() |
MaCh3
2.4.2
Reference Guide
|
KS: Class describing MaCh3 modes used in the analysis, it is being initialised from config. More...
#include <Manager/MaCh3Modes.h>
Public Member Functions | |
| MaCh3Modes (std::string const &filename) | |
| KS: Initialise MaCh3 modes using path to config. More... | |
| MaCh3Modes (const YAML::Node &config) | |
| KS: Initialise MaCh3 modes using config. More... | |
| virtual | ~MaCh3Modes () |
| KS: Empty destructor. More... | |
| void | Print () const |
| KS: Print info about initialised modes. More... | |
| int | GetNModes () const |
| KS: Get number of modes, keep in mind actual number is +1 greater due to unknown category. More... | |
of MaCh3 mode | |
| std::map< std::string, MaCh3Modes_t > | Mode |
| KS: Handy map which helps find mode number based on string. More... | |
| std::map< MaCh3Modes_t, MaCh3ModeInfo > | fMode |
| KS: Main map storing info about used modes. More... | |
| std::vector< int > | ModeMap |
| KS: Handy map helping us find MaCh3 mode based on Generator mode value. More... | |
| std::string | Title |
| KS: Name of loaded modes. More... | |
| std::string | Generator |
| KS: Name of generator like NEUT, NuWro etc. this is to make stuff fancy. More... | |
| int | NModes |
| KS: Number of modes, keep in mind actual number is +1 greater due to unknown category. More... | |
| int | nCCModes |
| DB: Number of CC modes. More... | |
| MaCh3Modes_t | GetMode (const std::string &name) const |
| std::string | GetMaCh3ModeName (const int Index) const |
| KS: Get normal name of mode, if mode not known you will get UNKNOWN_BAD. More... | |
| int | GetMaCh3ModePlotColor (const int Index) const |
| KS: Get normal name of mode, if mode not known you will get UNKNOWN_BAD. More... | |
| std::string | GetMaCh3ModeFancyName (const int Index) const |
| KS: Get fancy name of mode, if mode not known you will get UNKNOWN_BAD. More... | |
| bool | IsMaCh3ModeNC (const int Index) const |
| DB: Get IsNC (a check whether the given MaCh3 corresponds to a Neutral Current mode) More... | |
| std::string | GetSplineSuffixFromMaCh3Mode (const int Index) |
| DB: Get binned spline mode suffic from MaCh3 Mode. More... | |
| MaCh3Modes_t | GetModeFromGenerator (const int Index) const |
| KS: Get MaCh3 mode from generator mode. More... | |
| std::string | GetName () const |
| Get class name. More... | |
| int | GetNCCModes () const |
| Return count of CC modes. More... | |
| void | Initialise (const YAML::Node &config) |
| KS: Initialise MaCh3 modes based on provided config. More... | |
| MaCh3Modes_t | EnsureModeNameRegistered (std::string const &name) |
| void | DeclareNewMode (std::string const &name, std::string const &fancyname, int PlotColor, std::vector< int > const &GenMap, const bool IsNC, const std::string &SplineSuffix) |
| KS: Add new mode. More... | |
| void | PrepareMap () |
| KS: Fill ModeMap. More... | |
KS: Class describing MaCh3 modes used in the analysis, it is being initialised from config.
The class provides a translation layer between generator-specific interaction mode definitions and the analysis-level categories used inside MaCh3.
Different neutrino generators use different numbering and naming conventions. Additionally, an analysis may wish to group or redefine these modes. MaCh3Modes allows the user to define an experiment-specific mapping via a YAML configuration file.
The class builds:
UNKNOWN_BAD) for unmapped valuesExample YAML configuration used to initialise the modes:
After loading the configuration, MaCh3 produces a mapping table like:
Generators such as NEUT define many interaction codes that may not be used in a given analysis. Any generator mode not explicitly mapped is assigned to UNKNOWN_BAD.
This behaviour:
Access a specific mode:
Loop over all defined modes:
UNKNOWN_BAD category instead of throwing.Definition at line 135 of file MaCh3Modes.h.
| MaCh3Modes::MaCh3Modes | ( | std::string const & | filename | ) |
KS: Initialise MaCh3 modes using path to config.
Definition at line 5 of file MaCh3Modes.cpp.
| MaCh3Modes::MaCh3Modes | ( | const YAML::Node & | config | ) |
KS: Initialise MaCh3 modes using config.
Definition at line 13 of file MaCh3Modes.cpp.
|
inlinevirtual |
|
inlineprivate |
KS: Add new mode.
Definition at line 107 of file MaCh3Modes.cpp.
|
inlineprivate |
Definition at line 96 of file MaCh3Modes.cpp.
| std::string MaCh3Modes::GetMaCh3ModeFancyName | ( | const int | Index | ) | const |
KS: Get fancy name of mode, if mode not known you will get UNKNOWN_BAD.
Definition at line 186 of file MaCh3Modes.cpp.
| std::string MaCh3Modes::GetMaCh3ModeName | ( | const int | Index | ) | const |
KS: Get normal name of mode, if mode not known you will get UNKNOWN_BAD.
Definition at line 156 of file MaCh3Modes.cpp.
| int MaCh3Modes::GetMaCh3ModePlotColor | ( | const int | Index | ) | const |
KS: Get normal name of mode, if mode not known you will get UNKNOWN_BAD.
Definition at line 228 of file MaCh3Modes.cpp.
| MaCh3Modes_t MaCh3Modes::GetMode | ( | const std::string & | name | ) | const |
Definition at line 201 of file MaCh3Modes.cpp.
| MaCh3Modes_t MaCh3Modes::GetModeFromGenerator | ( | const int | Index | ) | const |
KS: Get MaCh3 mode from generator mode.
Definition at line 213 of file MaCh3Modes.cpp.
|
inline |
|
inline |
|
inline |
KS: Get number of modes, keep in mind actual number is +1 greater due to unknown category.
Definition at line 148 of file MaCh3Modes.h.
| std::string MaCh3Modes::GetSplineSuffixFromMaCh3Mode | ( | const int | Index | ) |
DB: Get binned spline mode suffic from MaCh3 Mode.
Definition at line 243 of file MaCh3Modes.cpp.
|
inlineprivate |
KS: Initialise MaCh3 modes based on provided config.
| config | YAML-based config used for class initialisation |
Definition at line 19 of file MaCh3Modes.cpp.
| bool MaCh3Modes::IsMaCh3ModeNC | ( | const int | Index | ) | const |
DB: Get IsNC (a check whether the given MaCh3 corresponds to a Neutral Current mode)
Definition at line 171 of file MaCh3Modes.cpp.
|
inlineprivate |
KS: Fill ModeMap.
Definition at line 129 of file MaCh3Modes.cpp.
| void MaCh3Modes::Print | ( | ) | const |
KS: Print info about initialised modes.
Definition at line 58 of file MaCh3Modes.cpp.
|
private |
KS: Main map storing info about used modes.
Definition at line 192 of file MaCh3Modes.h.
|
private |
KS: Name of generator like NEUT, NuWro etc. this is to make stuff fancy.
Definition at line 199 of file MaCh3Modes.h.
|
private |
KS: Handy map which helps find mode number based on string.
Definition at line 190 of file MaCh3Modes.h.
|
private |
KS: Handy map helping us find MaCh3 mode based on Generator mode value.
Definition at line 194 of file MaCh3Modes.h.
|
private |
DB: Number of CC modes.
Definition at line 203 of file MaCh3Modes.h.
|
private |
KS: Number of modes, keep in mind actual number is +1 greater due to unknown category.
Definition at line 201 of file MaCh3Modes.h.
|
private |
KS: Name of loaded modes.
Definition at line 197 of file MaCh3Modes.h.