46 using namespace G4Analysis;
56 }
else if (first ==
"p") {
65 void Replace(std::string& str,
const std::string& from,
const std::string& to) {
67 if (from.empty())
return;
69 while ((start_pos = str.find(from, start_pos)) != std::string::npos) {
70 str.
replace(start_pos, from.length(), to);
71 start_pos += to.length();
98 Replace(newStr,
"UHNTYPE_", upperHnType);
101 Replace(newStr,
"HNTYPE_",
fHnType);
105 Replace(newStr,
"NDIM_", second);
110 Replace(newStr,
"LOBJECT", lowerObjectType);
113 Replace(newStr,
"OBJECT", ObjectType(
fHnType));
118 Replace(newStr,
"UAXIS", upperAxis);
121 Replace(newStr,
"AXIS", axis);
132 std::unique_ptr<G4UIdirectory>
141 std::unique_ptr<G4UIcommand>
145 parId->SetGuidance(
Update(
"OBJECT id"));
146 parId->SetParameterRange(
"id>=0");
149 parTitle->SetGuidance(
Update(
"OBJECT title"));
150 parTitle->SetDefaultValue(
"none");
152 std::unique_ptr<G4UIcommand> command(
164 std::unique_ptr<G4UIcommand>
169 parId->SetGuidance(
Update(
"OBJECT id"));
170 parId->SetParameterRange(
"id>=0");
173 parNbins->SetGuidance(
"Number of bins");
176 parValMin->SetGuidance(
"Minimum value, expressed in unit");
179 parValMax->SetGuidance(
"Maximum value, expressed in unit");
182 parValUnit->SetGuidance(
"The unit applied to filled values and valMin, valMax");
183 parValUnit->SetDefaultValue(
"none");
186 parValFcn->SetParameterCandidates(
"log log10 exp none");
187 G4String fcnGuidance =
"The function applied to filled values (log, log10, exp, none).\n";
188 fcnGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
189 fcnGuidance +=
"but none value should be used instead.";
190 parValFcn->SetGuidance(fcnGuidance);
191 parValFcn->SetDefaultValue(
"none");
193 auto parValBinScheme =
new G4UIparameter(
"valBinScheme",
's',
true);
194 parValBinScheme->SetParameterCandidates(
"linear log");
195 G4String binSchemeGuidance =
"The binning scheme (linear, log).\n";
197 +=
"Note that the unit and fcn parameters cannot be omitted in this case,\n";
198 binSchemeGuidance +=
"but none value should be used instead.";
199 parValBinScheme->SetGuidance(binSchemeGuidance);
200 parValBinScheme->SetDefaultValue(
"linear");
202 auto commandName =
Update(
"/analysis/HNTYPE_/setUAXIS", axis);
203 std::unique_ptr<G4UIcommand> command(
205 command->
SetGuidance(
Update(
"Set parameters for the NDIM_D LOBJECT of given id:"));
207 Update(
" nAXISbins; AXISvalMin; AXISvalMax; AXISunit; AXISfunction; AXISbinScheme", axis));
221 std::unique_ptr<G4UIcommand>
226 parId->SetGuidance(
Update(
"OBJECT id"));
227 parId->SetParameterRange(
"id>=0");
230 parValMin->SetGuidance(
Update(
"Minimum AXIS-value expressed in unit", axis));
233 parValMax->SetGuidance(
Update(
"Maximum AXIS-value expressed in unit", axis));
236 parValUnit->SetGuidance(
"The unit applied to filled values and valMin, valMax");
237 parValUnit->SetDefaultValue(
"none");
240 parValFcn->SetParameterCandidates(
"log log10 exp none");
241 G4String fcnGuidance =
"The function applied to filled values (log, log10, exp, none).\n";
242 fcnGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
243 fcnGuidance +=
"but none value should be used instead.";
244 parValFcn->SetGuidance(fcnGuidance);
245 parValFcn->SetDefaultValue(
"none");
247 std::unique_ptr<G4UIcommand> command(
251 Update(
" AXISvalMin; AXISvalMax; AXISunit; AXISfunction", axis));
263 std::unique_ptr<G4UIcommand>
268 parId->SetGuidance(
Update(
"OBJECT id"));
269 parId->SetParameterRange(
"id>=0");
272 parAxis->SetGuidance(
Update(
"Histogram AXIS-axis title", axis));
274 std::unique_ptr<G4UIcommand> command(
276 command->
SetGuidance(
Update(
"Set AXIS-axis title for the NDIM_D LOBJECT of given id", axis));
285 std::unique_ptr<G4UIcommand>
290 parId->SetGuidance(
Update(
"OBJECT id"));
291 parId->SetParameterRange(
"id>=0");
294 parAxisLog->SetGuidance(
Update(
"Histogram AXIS-axis log scale", axis));
296 std::unique_ptr<G4UIcommand> command(
299 Update(
"Activate AXIS-axis log scale for plotting of the NDIM_D LOBJECT of given id", axis));
310 G4int& counter)
const
315 data.
fSunit = parameters[counter++];
316 data.
fSfcn = parameters[counter++];
323 G4int& counter)
const
327 data.
fSunit = parameters[counter++];
328 data.
fSfcn = parameters[counter++];
333 G4int nofParameters)
const
338 <<
"\" parameters: " << nofParameters
351 <<
"Command setX, setY, setZ must be called sucessively in this order. " <<
G4endl
352 <<
"Command was ignored." <<
G4endl;