20#include "BDSDimensionType.hh"
21#include "BDSException.hh"
22#include "BDSUtilities.hh"
32 new std::map<BDSDimensionType,std::string>
34 {BDSDimensionType::x,
"x"},
35 {BDSDimensionType::y,
"y"},
36 {BDSDimensionType::z,
"z"},
37 {BDSDimensionType::t,
"y"}
42 std::map<G4String, BDSDimensionType> types;
43 types[
"x"] = BDSDimensionType::x;
44 types[
"y"] = BDSDimensionType::y;
45 types[
"z"] = BDSDimensionType::z;
46 types[
"t"] = BDSDimensionType::t;
50 auto result = types.find(dimensionType);
51 if (result == types.end())
53 G4String msg =
"\"" + dimensionType +
"\" is not a valid dimension\n";
54 msg +=
"Available dimensions are:\n";
55 for (
const auto& it : types)
56 {msg +=
"\"" + it.first +
"\"\n";}
61 G4cout << __METHOD_NAME__ <<
"determined format \"" << dimensionType <<
"\" to be " << result->first << G4endl;
63 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.