20#include "BDSException.hh"
21#include "BDSIntegratorSetType.hh"
22#include "BDSUtilities.hh"
32 new std::map<BDSIntegratorSetType, std::string> ({
33 {BDSIntegratorSetType::geant4,
"geant4"},
34 {BDSIntegratorSetType::bdsimone,
"bdsimone"},
35 {BDSIntegratorSetType::bdsimtwo,
"bdsimtwo"},
36 {BDSIntegratorSetType::bdsimmatrix,
"bdsimmatrix"},
37 {BDSIntegratorSetType::bdsimmatrixfringescaling,
"bdsimmatrixfringescaling"}
38#if G4VERSION_NUMBER > 1039
40 {BDSIntegratorSetType::geant4dp,
"geant4dp"}
46 std::map<G4String, BDSIntegratorSetType> types;
47 types[
"bdsim"] = BDSIntegratorSetType::bdsimtwo;
48 types[
"geant4"] = BDSIntegratorSetType::geant4;
49 types[
"bdsimone"] = BDSIntegratorSetType::bdsimone;
50 types[
"bdsimtwo"] = BDSIntegratorSetType::bdsimtwo;
51 types[
"bdsimmatrix"] = BDSIntegratorSetType::bdsimmatrix;
52 types[
"bdsimmatrixfringescaling"] = BDSIntegratorSetType::bdsimmatrixfringescaling;
53#if G4VERSION_NUMBER > 1039
54 types[
"geant4dp"] = BDSIntegratorSetType::geant4dp;
59 auto result = types.find(integratorSet);
60 if (result == types.end())
62 G4String msg =
"\"" + integratorSet +
"\" is not a valid integrator set\n";
63 msg +=
"Available sets are:\n";
64 for (
const auto& it : types)
65 {msg +=
"\"" + it.first +
"\"\n";}
70 G4cout << __METHOD_NAME__ <<
"determined integrator set to be " << result->second << G4endl;
72 return result->second;
General exception with possible name of object and message.
static std::map< BDSTypeSafeEnum< integratorsettype_def, int >, std::string > * dictionary
BDSIntegratorSetType DetermineIntegratorSetType(G4String integratorSet)
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.