20#include "BDSException.hh"
21#include "BDSSamplerType.hh"
22#include "BDSUtilities.hh"
33 new std::map<BDSSamplerType, std::string> ({
34 {BDSSamplerType::none,
"none"},
35 {BDSSamplerType::plane,
"plane"},
36 {BDSSamplerType::cylinder,
"cylinder"},
37 {BDSSamplerType::cylinderforward,
"cylinderforward"},
38 {BDSSamplerType::sphere,
"sphere"},
39 {BDSSamplerType::sphereforward,
"sphereforward"}
44 std::map<G4String, BDSSamplerType> types;
45 types[
"none"] = BDSSamplerType::none;
46 types[
"plane"] = BDSSamplerType::plane;
47 types[
"cylinder"] = BDSSamplerType::cylinder;
48 types[
"cylinderforward"] = BDSSamplerType::cylinderforward;
49 types[
"sphere"] = BDSSamplerType::sphere;
50 types[
"sphereforward"] = BDSSamplerType::sphereforward;
54 auto result = types.find(samplerType);
55 if (result == types.end())
57 G4String msg =
"\"" + samplerType +
"\" is not a valid sampler type\n";
58 for (
const auto& it : types)
59 {msg +=
"\"" + it.first +
"\"\n";}
64 G4cout << __METHOD_NAME__ <<
"determined sampler type to be " << result->second << G4endl;
66 return result->second;
General exception with possible name of object and message.
static std::map< BDSTypeSafeEnum< samplertypes_def, int >, std::string > * dictionary
G4String LowerCase(const G4String &str)
Utility function to simplify lots of syntax changes for pedantic g4 changes.