40 using namespace G4Analysis;
48 fSetHnAsciiCmd(nullptr),
49 fSetHnActivationCmd(nullptr),
50 fSetHnActivationAllCmd(nullptr),
51 fSetHnPlottingCmd(nullptr),
52 fSetHnPlottingAllCmd(nullptr)
56 fHelper = G4Analysis::make_unique<G4AnalysisMessengerHelper>(hnType);
60 SetHnActivationToAllCmd();
62 SetHnPlottingToAllCmd();
74 void G4HnMessenger::SetHnAsciiCmd()
77 = G4Analysis::make_unique<G4UIcmdWithAnInteger>(fHelper->Update(
"/analysis/HNTYPE_/setAscii"),
this);
78 fSetHnAsciiCmd->SetGuidance(
79 fHelper->Update(
"Print NDIM_D LOBJECT of given id on ascii file."));
81 fSetHnAsciiCmd->SetParameterName(
"id",
false);
82 fSetHnAsciiCmd->SetRange(
"id>=0");
87 void G4HnMessenger::SetHnActivationCmd()
90 hnId->SetGuidance(fHelper->Update(
"OBJECT id"));
91 hnId->SetParameterRange(
"id>=0");
93 auto hnActivation =
new G4UIparameter(
"hnActivation",
's',
true);
94 hnActivation->SetGuidance(fHelper->Update(
"OBJECT activation"));
95 hnActivation->SetDefaultValue(
"none");
98 = G4Analysis::make_unique<G4UIcommand>(fHelper->Update(
"/analysis/HNTYPE_/setActivation"),
this);
99 fSetHnActivationCmd->SetGuidance(
100 fHelper->Update(
"Set activation for the NDIM_D LOBJECT of given id"));
101 fSetHnActivationCmd->SetParameter(hnId);
102 fSetHnActivationCmd->SetParameter(hnActivation);
107 void G4HnMessenger::SetHnActivationToAllCmd()
109 fSetHnActivationAllCmd
110 = G4Analysis::make_unique<G4UIcmdWithABool>(fHelper->Update(
"/analysis/HNTYPE_/setActivationToAll"),
this);
111 fSetHnActivationAllCmd->SetGuidance(
112 fHelper->Update(
"Set activation to all NDIM_D LOBJECTs"));
113 fSetHnActivationAllCmd->SetParameterName(
"Activation",
false);
117 void G4HnMessenger::SetHnPlottingCmd()
120 hnId->SetGuidance(fHelper->Update(
"OBJECT id"));
121 hnId->SetParameterRange(
"id>=0");
123 auto hnPlotting =
new G4UIparameter(
"hnPlotting",
's',
true);
124 hnPlotting->SetGuidance(fHelper->Update(
"(In)Activate OBJECT plotting"));
125 hnPlotting->SetDefaultValue(
"none");
128 = G4Analysis::make_unique<G4UIcommand>(fHelper->Update(
"/analysis/HNTYPE_/setPlotting"),
this);
129 fSetHnPlottingCmd->SetGuidance(
130 fHelper->Update(
"(In)Activate batch plotting of the NDIM_D LOBJECT of given id"));
131 fSetHnPlottingCmd->SetParameter(hnId);
132 fSetHnPlottingCmd->SetParameter(hnPlotting);
137 void G4HnMessenger::SetHnPlottingToAllCmd()
140 = G4Analysis::make_unique<G4UIcmdWithABool>(fHelper->Update(
"/analysis/HNTYPE_/setPlottingToAll"),
this);
141 fSetHnPlottingAllCmd->SetGuidance(
142 fHelper->Update(
"(In)Activate batch plotting of all NDIM_D LOBJECTs"));
143 fSetHnPlottingAllCmd->SetParameterName(
"Plotting",
false);
153 if ( command == fSetHnAsciiCmd.get() ) {
154 auto id = fSetHnAsciiCmd->GetNewIntValue(newValues);
157 else if ( command == fSetHnActivationCmd.get() ) {
159 std::vector<G4String> parameters;
170 fHelper->WarnAboutParameters(command, parameters.size());
173 else if ( command == fSetHnActivationAllCmd.get() ) {
174 auto activation = fSetHnActivationAllCmd->GetNewBoolValue(newValues);
177 else if ( command == fSetHnPlottingCmd.get() ) {
179 std::vector<G4String> parameters;
190 fHelper->WarnAboutParameters(command, parameters.size());
193 else if ( command == fSetHnPlottingAllCmd.get() ) {
194 auto activation = fSetHnPlottingAllCmd->GetNewBoolValue(newValues);
G4String GetHnType() const
virtual void SetNewValue(G4UIcommand *command, G4String value) final
void SetPlotting(G4bool plotting)
static G4bool ConvertToBool(const char *st)
void SetAscii(G4int id, G4bool ascii)
static G4int ConvertToInt(const char *st)
G4HnMessenger(G4HnManager &manager)
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
G4int GetParameterEntries() const
void SetActivation(G4bool activation)