10 {
"Theta12",
"sin2th_12"},
11 {
"Theta13",
"sin2th_13"},
12 {
"Theta23",
"sin2th_23"},
13 {
"DeltaCP",
"delta_cp"},
14 {
"Deltam2_21",
"delm2_12"},
15 {
"Deltam2_32",
"delm2_23"},
20 {
"sin2th_12",
"Theta12"},
21 {
"sin2th_13",
"Theta13"},
22 {
"sin2th_23",
"Theta23"},
23 {
"delta_cp",
"DeltaCP"},
24 {
"delm2_12",
"Deltam2_21"},
25 {
"delm2_23",
"Deltam2_32"},
30 {
"LOCALHOST", CommunicationType::LOCALHOST},
31 {
"UNIX_DOMAIN_SOCKET", CommunicationType::UNIX_DOMAIN_SOCKET},
32 {
"TCP", CommunicationType::TCP}
37 {
"DEBUG", VerbosityLevel::DEBUG},
38 {
"INFO", VerbosityLevel::INFO},
39 {
"WARNING", VerbosityLevel::WARNING},
40 {
"ERROR", VerbosityLevel::ERROR}
44 std::unique_ptr<NuDock> &nudock_ptr) {
48 MACH3LOG_INFO(
"NuDock object has already been created so I am not "
49 "re-initialising the object");
52 std::string nudock_conf_name =
"NuDock";
53 if (!man->
raw()[
"NuDock"]) {
54 if (!man->
raw()[
"NuDockClient"]) {
56 "No NuDock configuration found in the provided manager object");
60 nudock_conf_name =
"NuDockClient";
67 std::string schemaLocation = GetFromManager<std::string>(
68 man->
raw()[nudock_conf_name][
"SchemaLocation"],
"");
69 std::string commTypeStr = GetFromManager<std::string>(
70 man->
raw()[nudock_conf_name][
"CommunicationType"],
"LOCALHOST");
71 int port = GetFromManager<int>(man->
raw()[nudock_conf_name][
"Port"], 1234);
72 std::string verbosity =
73 GetFromManager<std::string>(man->
raw()[nudock_conf_name][
"NuDockVerbosity"],
"INFO");
75 CommunicationType commType;
80 "Unsupported communication type for NuDock: {}. Supported types "
81 "are LOCALHOST, UNIX_DOMAIN_SOCKET, and TCP.",
86 VerbosityLevel verbLevel;
91 "Unsupported verbosity level for NuDock: {}. Supported levels are "
92 "DEBUG, INFO, WARN, and ERROR.",
98 std::make_unique<NuDock>(useDebug, schemaLocation, commType, port, verbLevel);
99 MACH3LOG_INFO(
"NuDock object created with communication type: {} on port: {}", commTypeStr, port);
106 if (param_name ==
"Theta12" || param_name ==
"Theta13" || param_name ==
"Theta23") {
107 param_value = std::asin(std::sqrt(param_value));
112 if (param_name ==
"Theta12" || param_name ==
"Theta13" || param_name ==
"Theta23") {
113 param_value = std::sin(param_value) * std::sin(param_value);
const std::unordered_map< std::string, std::string > NuDockOscNameMap_r
Mapping from MaCh3 oscillation parameter names to NuDock names.
const std::unordered_map< std::string, std::string > NuDockOscNameMap
Mapping from NuDock oscillation parameter names to MaCh3 names.
const std::unordered_map< std::string, CommunicationType > CommunicationTypeMap
Lookup table mapping strings to NuDock CommunicationType enum values.
void FormatOscParsForMaCh3(const std::string ¶m_name, double ¶m_value)
Convert an oscillation parameter value from NuDock convention to MaCh3 convention.
void FormatOscParsForNuDock(const std::string ¶m_name, double ¶m_value)
Convert an oscillation parameter value from MaCh3 convention to NuDock convention.
void InitialiseNuDockObj(Manager *man, std::unique_ptr< NuDock > &nudock_ptr)
Initialise a NuDock communication object from a manager configuration.
const std::unordered_map< std::string, VerbosityLevel > VerbosityLevelMap
Lookup table mapping strings to NuDock VerbosityLevel enum values.
Factory utilities for creating and configuring NuDock communication objects.
Type GetFromManager(const YAML::Node &node, const Type defval, const std::string File="", const int Line=1)
Get content of config file if node is not found take default value specified.
Custom exception class used throughout MaCh3.
The manager class is responsible for managing configurations and settings.
YAML::Node const & raw() const
Return config.