20#include "BDSException.hh"
21#include "BDSModulatorType.hh"
22#include "BDSUtilities.hh"
32 new std::map<BDSModulatorType, std::string> ({
33 {BDSModulatorType::none,
"none"},
34 {BDSModulatorType::sint,
"sint"},
35 {BDSModulatorType::singlobalt,
"singlobalt"},
36 {BDSModulatorType::tophatt,
"tophatt"}
41 std::map<G4String, BDSModulatorType> types;
42 types[
"none"] = BDSModulatorType::none;
43 types[
"sint"] = BDSModulatorType::sint;
44 types[
"singlobalt"] = BDSModulatorType::singlobalt;
45 types[
"tophatt"] = BDSModulatorType::tophatt;
49 auto result = types.find(mType);
50 if (result == types.end())
52 G4String msg =
"\"" + mType +
"\" is not a valid modulator type\n";
53 msg +=
"Available modulator types are:\n";
54 for (
const auto& it : types)
55 {msg +=
"\"" + it.first +
"\"\n";}
60 G4cout << __METHOD_NAME__ <<
"determined modulator type to be " << result->second << G4endl;
62 return result->second;
General exception with possible name of object and message.
static std::map< BDSTypeSafeEnum< modulatortypes_def, int >, std::string > * dictionary
BDSModulatorType DetermineModulatorType(G4String mType)
Function that gives corresponding enum value for string (case-insensitive)
G4String LowerCase(const G4String &str)
Utility function to simplify lots of syntax changes for pedantic g4 changes.