19#include "BDSBLMType.hh"
21#include "BDSException.hh"
22#include "BDSUtilities.hh"
33 new std::map<BDSBLMType, std::string> ({
34 {BDSBLMType::cylinder,
"cylinder"},
35 {BDSBLMType::cube,
"cube"},
36 {BDSBLMType::sphere,
"sphere"}
41 std::map<G4String, BDSBLMType> types;
42 types[
"cylinder"] = BDSBLMType::cylinder;
43 types[
"cube"] = BDSBLMType::cube;
44 types[
"sphere"] = BDSBLMType::sphere;
48 auto result = types.find(blmType);
49 if (result == types.end())
51 G4String msg =
"\"" + blmType +
"\" is not a valid blmType\n";
52 msg +=
"Available geometry types are:\n";
53 for (
const auto& it : types)
54 {msg +=
"\"" + it.first +
"\"\n";}
59 G4cout << __METHOD_NAME__ <<
"determined blm type to be " << result->second << G4endl;
61 return result->second;
General exception with possible name of object and message.
Improve type-safety of native enum data type in C++.
static std::map< BDSTypeSafeEnum< def, inner >, std::string > * dictionary
G4String LowerCase(const G4String &str)
Utility function to simplify lots of syntax changes for pedantic g4 changes.
BDSBLMType DetermineBLMType(G4String blmType)
function that gives corresponding enum value for string (case-insensitive)