19#include "BDSDimensionType.hh"
20#include "BDSException.hh"
21#include "BDSUtilities.hh"
31 new std::map<BDSDimensionType,std::string>
33 {BDSDimensionType::x,
"x"},
34 {BDSDimensionType::y,
"y"},
35 {BDSDimensionType::z,
"z"},
36 {BDSDimensionType::t,
"y"}
41 std::map<G4String, BDSDimensionType> types;
42 types[
"x"] = BDSDimensionType::x;
43 types[
"y"] = BDSDimensionType::y;
44 types[
"z"] = BDSDimensionType::z;
45 types[
"t"] = BDSDimensionType::t;
49 auto result = types.find(dimensionType);
50 if (result == types.end())
52 G4String msg =
"\"" + dimensionType +
"\" is not a valid dimension\n";
53 msg +=
"Available dimensions are:\n";
54 for (
const auto& it : types)
55 {msg +=
"\"" + it.first +
"\"\n";}
60 G4cout << __METHOD_NAME__ <<
"determined format \"" << dimensionType <<
"\" to be " << result->first << G4endl;
62 return result->second;
General exception with possible name of object and message.
static std::map< BDSTypeSafeEnum< dimensions_def, int >, std::string > * dictionary
BDSDimensionType DetermineDimensionType(G4String dimensionType)
Determine the output format to be used from the input string.
G4String LowerCase(const G4String &str)
Utility function to simplify lots of syntax changes for pedantic g4 changes.