19#include "BDSEventGeneratorFileType.hh"
21#include "BDSException.hh"
22#include "BDSUtilities.hh"
33 new std::map<BDSEventGeneratorFileType, std::string> ({
34 {BDSEventGeneratorFileType::hepmc2,
"hepmc2"},
35 {BDSEventGeneratorFileType::hepmc3,
"hepmc3"},
36 {BDSEventGeneratorFileType::hpe,
"hpe"},
37 {BDSEventGeneratorFileType::root,
"root"},
38 {BDSEventGeneratorFileType::treeroot,
"treeroot"},
39 {BDSEventGeneratorFileType::lhef,
"lhef"},
44 std::map<G4String, BDSEventGeneratorFileType> types;
46 types[
"hepmc2"] = BDSEventGeneratorFileType::hepmc2;
47 types[
"hepmc3"] = BDSEventGeneratorFileType::hepmc3;
48 types[
"hpe"] = BDSEventGeneratorFileType::hpe;
49 types[
"root"] = BDSEventGeneratorFileType::root;
50 types[
"treeroot"] = BDSEventGeneratorFileType::treeroot;
51 types[
"lhef"] = BDSEventGeneratorFileType::lhef;
55 auto result = types.find(distrType);
56 if (result == types.end())
58 G4String msg =
"\"" + distrType +
"\" is not a valid event generator file format\n";
59 msg +=
"Available formats are:\n";
60 for (
const auto& it : types)
61 {msg +=
"\"" + it.first +
"\"\n";}
66 G4cout << __METHOD_NAME__ <<
"determined event generator file format to be " << result->second << G4endl;
68 return result->second;
General exception with possible name of object and message.
static std::map< BDSTypeSafeEnum< eventgeneratorfiletypes_def, int >, std::string > * dictionary
BDSEventGeneratorFileType DetermineEventGeneratorFileType(G4String distrType)
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.