MaCh3 2.2.1
Reference Guide
Loading...
Searching...
No Matches
MaCh3Modes.h
Go to the documentation of this file.
1#pragma once
2
3// C++ Includes
4#include <cmath>
5#include <map>
6#include <string>
7
8//MaCh3 includes
10#include "Manager/Monitor.h"
12
14using MaCh3Modes_t = int;
15
19 std::string Name;
21 std::string FancyName;
25 std::vector<int> GeneratorMaping;
27 bool IsNC;
29 std::string SplineSuffix;
31 inline bool IsMode(const int GenMode) {
32 bool exists = std::find(GeneratorMaping.begin(), GeneratorMaping.end(), GenMode) != GeneratorMaping.end();
33 return exists;
34 }
35};
36
42 public:
44 MaCh3Modes(std::string const &filename);
46 virtual ~MaCh3Modes(){};
47
49 void Print();
50
52 inline int GetNModes() const {return NModes;}
54 MaCh3Modes_t GetMode(const std::string& name);
56 std::string GetMaCh3ModeName(const int Index);
58 int GetMaCh3ModePlotColor(const int Index);
60 std::string GetMaCh3ModeFancyName(const int Index);
62 bool IsMaCh3ModeNC(const int Index);
64 std::string GetSplineSuffixFromMaCh3Mode(const int Index);
66 MaCh3Modes_t GetModeFromGenerator(const int Index);
68 inline std::string GetName() const {return "MaCh3Modes";};
70 inline int GetNCCModes() const {return nCCModes;};
71
72 private:
74 inline MaCh3Modes_t EnsureModeNameRegistered(std::string const &name);
75
77 inline void DeclareNewMode(std::string const &name,
78 std::string const &fancyname,
79 int PlotColor,
80 std::vector<int> const &GenMap,
81 bool IsNC,
82 std::string SplineSuffix);
83
85 inline void PrepareMap();
86
88 std::map<std::string, MaCh3Modes_t> Mode;
90 std::map<MaCh3Modes_t, MaCh3ModeInfo> fMode;
92 std::vector<int> ModeMap;
93
95 std::string Title;
97 std::string Generator;
99 int NModes;
102};
Color_t PlotColor[]
int MaCh3Modes_t
Enumerator of MaCh3Mode.
Definition: MaCh3Modes.h:14
System and monitoring utilities for printing system information and status updates.
Utility functions for handling YAML nodes.
KS: Class describing MaCh3 modes used in the analysis, it is being initialised from config.
Definition: MaCh3Modes.h:41
std::map< std::string, MaCh3Modes_t > Mode
KS: Handy map which helps find mode number based on string.
Definition: MaCh3Modes.h:88
int nCCModes
DB: Number of CC modes.
Definition: MaCh3Modes.h:101
void DeclareNewMode(std::string const &name, std::string const &fancyname, int PlotColor, std::vector< int > const &GenMap, bool IsNC, std::string SplineSuffix)
KS: Add new mode.
Definition: MaCh3Modes.cpp:89
int GetNModes() const
KS: Get number of modes, keep in mind actual number is +1 greater due to unknown category.
Definition: MaCh3Modes.h:52
std::string GetMaCh3ModeFancyName(const int Index)
KS: Get fancy name of mode, if mode not known you will get UNKNOWN_BAD.
Definition: MaCh3Modes.cpp:169
MaCh3Modes_t GetMode(const std::string &name)
KS: Get mode number based on name, if mode not known you will get UNKNOWN_BAD.
Definition: MaCh3Modes.cpp:184
int NModes
KS: Number of modes, keep in mind actual number is +1 greater due to unknown category.
Definition: MaCh3Modes.h:99
std::vector< int > ModeMap
KS: Handy map helping us find MaCh3 mode based on Generator mode value.
Definition: MaCh3Modes.h:92
void Print()
KS: Print info about initialised modes.
Definition: MaCh3Modes.cpp:48
std::string Generator
KS: Name of generator like NEUT, NuWro etc. this is to make stuff fancy.
Definition: MaCh3Modes.h:97
std::string GetSplineSuffixFromMaCh3Mode(const int Index)
DB: Get binned spline mode suffic from MaCh3 Mode.
Definition: MaCh3Modes.cpp:226
std::string Title
KS: Name of loaded modes.
Definition: MaCh3Modes.h:95
MaCh3Modes_t EnsureModeNameRegistered(std::string const &name)
KS: Make sure we don't have two modes with the same name.
Definition: MaCh3Modes.cpp:78
int GetNCCModes() const
Return count of CC modes.
Definition: MaCh3Modes.h:70
int GetMaCh3ModePlotColor(const int Index)
KS: Get normal name of mode, if mode not known you will get UNKNOWN_BAD.
Definition: MaCh3Modes.cpp:211
std::string GetMaCh3ModeName(const int Index)
KS: Get normal name of mode, if mode not known you will get UNKNOWN_BAD.
Definition: MaCh3Modes.cpp:138
bool IsMaCh3ModeNC(const int Index)
DB: Get IsNC (a check whether the given MaCh3 corresponds to a Neutral Current mode)
Definition: MaCh3Modes.cpp:153
std::string GetName() const
Get class name.
Definition: MaCh3Modes.h:68
void PrepareMap()
KS: Fill ModeMap.
Definition: MaCh3Modes.cpp:111
virtual ~MaCh3Modes()
KS: Empty destructor.
Definition: MaCh3Modes.h:46
MaCh3Modes_t GetModeFromGenerator(const int Index)
KS: Get MaCh3 mode from generator mode.
Definition: MaCh3Modes.cpp:196
std::map< MaCh3Modes_t, MaCh3ModeInfo > fMode
KS: Main map storing info about used modes.
Definition: MaCh3Modes.h:90
KS: Class containing information for a single MaCh3Mode.
Definition: MaCh3Modes.h:17
std::vector< int > GeneratorMaping
Mapping between mode and generator integers.
Definition: MaCh3Modes.h:25
std::string SplineSuffix
Spline suffix.
Definition: MaCh3Modes.h:29
std::string FancyName
Mode fancy name.
Definition: MaCh3Modes.h:21
std::string Name
Mode name.
Definition: MaCh3Modes.h:19
bool IsMode(const int GenMode)
KS: Checks MaCh3 modes is associated with a given generator mode.
Definition: MaCh3Modes.h:31
bool IsNC
IsNC check.
Definition: MaCh3Modes.h:27
int PlotColor
Mode color for plotting purposes.
Definition: MaCh3Modes.h:23