35 #include "HGCal/TBStandaloneSimulator/interface/HepMCG4AsciiReaderMessenger.hh"
36 #include "HGCal/TBStandaloneSimulator/interface/HepMCG4AsciiReader.hh"
38 #include "G4UIdirectory.hh"
39 #include "G4UIcmdWithoutParameter.hh"
40 #include "G4UIcmdWithAString.hh"
41 #include "G4UIcmdWithAnInteger.hh"
44 HepMCG4AsciiReaderMessenger::HepMCG4AsciiReaderMessenger
45 (HepMCG4AsciiReader* agen)
49 dir =
new G4UIdirectory(
"/generator/hepmcAscii/");
50 dir-> SetGuidance(
"Reading HepMC event from an Ascii file");
53 new G4UIcmdWithAnInteger(
"/generator/hepmcAscii/verbose",
this);
54 verbose-> SetGuidance(
"Set verbose level");
55 verbose-> SetParameterName(
"verboseLevel",
false,
false);
56 verbose-> SetRange(
"verboseLevel>=0 && verboseLevel<=1");
58 open =
new G4UIcmdWithAString(
"/generator/hepmcAscii/open",
this);
59 open-> SetGuidance(
"(re)open data file (HepMC Ascii format)");
60 open-> SetParameterName(
"input ascii file",
true,
true);
64 HepMCG4AsciiReaderMessenger::~HepMCG4AsciiReaderMessenger()
74 void HepMCG4AsciiReaderMessenger::SetNewValue(G4UIcommand* command,
78 if (command == verbose) {
79 int level = verbose-> GetNewIntValue(newValues);
80 gen-> SetVerboseLevel(level);
81 }
else if (command == open) {
82 gen-> SetFileName(newValues);
83 G4cout <<
"HepMC Ascii inputfile: "
84 << gen-> GetFileName() << G4endl;
91 G4String HepMCG4AsciiReaderMessenger::GetCurrentValue(G4UIcommand* command)
96 if (command == verbose) {
97 cv = verbose-> ConvertToString(gen-> GetVerboseLevel());
98 }
else if (command == open) {
99 cv = gen-> GetFileName();