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