19#include "BDSException.hh"
20#include "BDSModulatorType.hh"
21#include "BDSUtilities.hh"
31 new std::map<BDSModulatorType, std::string> ({
32 {BDSModulatorType::lineart,
"lineart"},
33 {BDSModulatorType::none,
"none"},
34 {BDSModulatorType::sint,
"sint"},
35 {BDSModulatorType::singlobalt,
"singlobalt"},
36 {BDSModulatorType::tophatt,
"tophatt"}
41 std::map<G4String, BDSModulatorType> types;
42 types[
"lineart"] = BDSModulatorType::lineart;
43 types[
"none"] = BDSModulatorType::none;
44 types[
"sint"] = BDSModulatorType::sint;
45 types[
"singlobalt"] = BDSModulatorType::singlobalt;
46 types[
"tophatt"] = BDSModulatorType::tophatt;
50 auto result = types.find(mType);
51 if (result == types.end())
53 G4String msg =
"\"" + mType +
"\" is not a valid modulator type\n";
54 msg +=
"Available modulator types are:\n";
55 for (
const auto& it : types)
56 {msg +=
"\"" + it.first +
"\"\n";}
61 G4cout << __METHOD_NAME__ <<
"determined modulator type to be " << result->second << G4endl;
63 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.