18#include "BDSGeometryType.hh"
20#include "BDSException.hh"
21#include "BDSUtilities.hh"
32 new std::map<BDSGeometryType, std::string> ({
33 {BDSGeometryType::mokka,
"mokka"},
34 {BDSGeometryType::gdml,
"gdml"}
39 std::map<G4String, BDSGeometryType> types;
40 types[
"mokka"] = BDSGeometryType::mokka;
41 types[
"gdml"] = BDSGeometryType::gdml;
45 auto result = types.find(geometryType);
46 if (result == types.end())
48 G4String msg =
"\"" + geometryType +
"\" is not a valid geometry type\n";
49 msg +=
"Available geometry types are:\n";
50 for (
const auto& it : types)
51 {msg +=
"\"" + it.first +
"\"\n";}
56 G4cout << __METHOD_NAME__ <<
"determined geometry type to be " << result->second << G4endl;
58 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
BDSGeometryType DetermineGeometryType(G4String geometryType)
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.