18#include "BDSBLMType.hh"
20#include "BDSException.hh"
21#include "BDSUtilities.hh"
32 new std::map<BDSBLMType, std::string> ({
33 {BDSBLMType::cylinder,
"cylinder"},
34 {BDSBLMType::cube,
"cube"},
35 {BDSBLMType::sphere,
"sphere"}
40 std::map<G4String, BDSBLMType> types;
41 types[
"cylinder"] = BDSBLMType::cylinder;
42 types[
"cube"] = BDSBLMType::cube;
43 types[
"sphere"] = BDSBLMType::sphere;
47 auto result = types.find(blmType);
48 if (result == types.end())
50 G4String msg =
"\"" + blmType +
"\" is not a valid blmType\n";
51 msg +=
"Available geometry types are:\n";
52 for (
const auto& it : types)
53 {msg +=
"\"" + it.first +
"\"\n";}
58 G4cout << __METHOD_NAME__ <<
"determined blm type to be " << result->second << G4endl;
60 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)