40 using namespace G4Analysis;
48 fCreateH3Cmd(nullptr),
53 fSetH3TitleCmd(nullptr),
54 fSetH3XAxisCmd(nullptr),
55 fSetH3YAxisCmd(nullptr),
56 fSetH3ZAxisCmd(nullptr),
62 fHelper = G4Analysis::make_unique<G4AnalysisMessengerHelper>(
"h3");
90 h3Name->SetGuidance(
"Histogram name (label)");
93 h3Title->SetGuidance(
"Histogram title");
96 h3xNbins0->SetGuidance(
"Number of x-bins (default = 100)");
97 h3xNbins0->SetGuidance(
"Can be reset with /analysis/h3/set command");
98 h3xNbins0->SetDefaultValue(100);
101 h3xValMin0->SetGuidance(
"Minimum x-value, expressed in unit (default = 0.)");
102 h3xValMin0->SetGuidance(
"Can be reset with /analysis/h3/set command");
103 h3xValMin0->SetDefaultValue(0.);
106 h3xValMax0->SetGuidance(
"Maximum x-value, expressed in unit (default = 1.)");
107 h3xValMax0->SetGuidance(
"Can be reset with /analysis/h3/set command");
108 h3xValMax0->SetDefaultValue(1.);
110 auto h3xValUnit0 =
new G4UIparameter(
"xvalUnit0",
's',
true);
111 h3xValUnit0->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
112 h3xValUnit0->SetDefaultValue(
"none");
115 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).";
116 h3xValFcn0->SetGuidance(fcnxGuidance);
117 h3xValFcn0->SetParameterCandidates(
"log log10 exp none");
118 h3xValFcn0->SetDefaultValue(
"none");
120 auto h3xValBinScheme0 =
new G4UIparameter(
"xvalBinScheme0",
's',
true);
121 G4String xbinSchemeGuidance =
"The binning scheme (linear, log).";
122 h3xValBinScheme0->SetParameterCandidates(
"linear log");
123 h3xValBinScheme0->SetGuidance(xbinSchemeGuidance);
124 h3xValBinScheme0->SetDefaultValue(
"linear");
127 h3yNbins0->SetGuidance(
"Number of y-bins (default = 100)");
128 h3yNbins0->SetGuidance(
"Can be reset with /analysis/h3/set command");
129 h3yNbins0->SetDefaultValue(100);
132 h3yValMin0->SetGuidance(
"Minimum y-value, expressed in unit (default = 0.)");
133 h3yValMin0->SetGuidance(
"Can be reset with /analysis/h3/set command");
134 h3yValMin0->SetDefaultValue(0.);
137 h3yValMax0->SetGuidance(
"Maximum y-value, expressed in unit (default = 1.)");
138 h3yValMax0->SetGuidance(
"Can be reset with /analysis/h3/set command");
139 h3yValMax0->SetDefaultValue(1.);
141 auto h3yValUnit0 =
new G4UIparameter(
"yvalUnit0",
's',
true);
142 h3yValUnit0->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
143 h3yValUnit0->SetDefaultValue(
"none");
146 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).";
147 h3yValFcn0->SetGuidance(fcnyGuidance);
148 h3yValFcn0->SetParameterCandidates(
"log log10 exp none");
149 h3yValFcn0->SetDefaultValue(
"none");
151 auto h3yValBinScheme0 =
new G4UIparameter(
"yvalBinScheme0",
's',
true);
152 G4String ybinSchemeGuidance =
"The binning scheme (linear, log).";
153 h3yValBinScheme0->SetParameterCandidates(
"linear log");
154 h3yValBinScheme0->SetGuidance(ybinSchemeGuidance);
155 h3yValBinScheme0->SetDefaultValue(
"linear");
158 h3zNbins0->SetGuidance(
"Number of z-bins (default = 100)");
159 h3zNbins0->SetGuidance(
"Can be reset with /analysis/h3/set command");
160 h3zNbins0->SetDefaultValue(100);
163 h3zValMin0->SetGuidance(
"Minimum z-value, expressed in unit (default = 0.)");
164 h3zValMin0->SetGuidance(
"Can be reset with /analysis/h3/set command");
165 h3zValMin0->SetDefaultValue(0.);
168 h3zValMax0->SetGuidance(
"Maximum z-value, expressed in unit (default = 1.)");
169 h3zValMax0->SetGuidance(
"Can be reset with /analysis/h3/set command");
170 h3zValMax0->SetDefaultValue(1.);
172 auto h3zValUnit0 =
new G4UIparameter(
"zvalUnit0",
's',
true);
173 h3zValUnit0->SetGuidance(
"The unit applied to filled z-values and zvalMin0, zvalMax0");
174 h3zValUnit0->SetDefaultValue(
"none");
177 G4String fcnzGuidance =
"The function applied to filled z-values (log, log10, exp, none).";
178 h3zValFcn0->SetGuidance(fcnzGuidance);
179 h3zValFcn0->SetParameterCandidates(
"log log10 exp none");
180 h3zValFcn0->SetDefaultValue(
"none");
182 auto h3zValBinScheme0 =
new G4UIparameter(
"zvalBinScheme0",
's',
true);
183 G4String zbinSchemeGuidance =
"The binning scheme (linear, log).";
184 h3zValBinScheme0->SetParameterCandidates(
"linear log");
185 h3zValBinScheme0->SetGuidance(zbinSchemeGuidance);
186 h3zValBinScheme0->SetDefaultValue(
"linear");
188 fCreateH3Cmd = G4Analysis::make_unique<G4UIcommand>(
"/analysis/h3/create",
this);
218 h3Id->SetGuidance(
"Histogram id");
219 h3Id->SetParameterRange(
"id>=0");
222 h3xNbins->SetGuidance(
"Number of x-bins");
225 h3xValMin->SetGuidance(
"Minimum x-value, expressed in unit");
228 h3xValMax->SetGuidance(
"Maximum x-value, expressed in unit");
231 h3xValUnit->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
232 h3xValUnit->SetDefaultValue(
"none");
235 h3xValFcn->SetParameterCandidates(
"log log10 exp none");
236 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).";
237 h3xValFcn->SetGuidance(fcnxGuidance);
238 h3xValFcn->SetDefaultValue(
"none");
240 auto h3xValBinScheme =
new G4UIparameter(
"xvalBinScheme",
's',
true);
241 G4String xbinSchemeGuidance =
"The binning scheme (linear, log).";
242 h3xValBinScheme->SetParameterCandidates(
"linear log");
243 h3xValBinScheme->SetGuidance(xbinSchemeGuidance);
244 h3xValBinScheme->SetDefaultValue(
"linear");
247 h3yNbins->SetGuidance(
"Number of y-bins");
250 h3yValMin->SetGuidance(
"Minimum y-value, expressed in unit");
253 h3yValMax->SetGuidance(
"Maximum y-value, expressed in unit");
256 h3yValUnit->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
257 h3yValUnit->SetDefaultValue(
"none");
260 h3yValFcn->SetParameterCandidates(
"log log10 exp none");
261 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).";
262 h3yValFcn->SetGuidance(fcnyGuidance);
263 h3yValFcn->SetDefaultValue(
"none");
265 auto h3yValBinScheme =
new G4UIparameter(
"yvalBinScheme",
's',
true);
266 G4String ybinSchemeGuidance =
"The binning scheme (linear, log).";
267 h3yValBinScheme->SetParameterCandidates(
"linear log");
268 h3yValBinScheme->SetGuidance(ybinSchemeGuidance);
269 h3yValBinScheme->SetDefaultValue(
"linear");
272 h3zNbins->SetGuidance(
"Number of z-bins");
275 h3zValMin->SetGuidance(
"Minimum z-value, expressed in unit");
278 h3zValMax->SetGuidance(
"Maximum z-value, expressed in unit");
281 h3zValUnit->SetGuidance(
"The unit applied to filled z-values and zvalMin0, zvalMax0");
282 h3zValUnit->SetDefaultValue(
"none");
285 h3zValFcn->SetParameterCandidates(
"log log10 exp none");
286 G4String fcnzGuidance =
"The function applied to filled z-values (log, log10, exp, none).";
287 h3zValFcn->SetGuidance(fcnzGuidance);
288 h3zValFcn->SetDefaultValue(
"none");
290 auto h3zValBinScheme =
new G4UIparameter(
"zvalBinScheme",
's',
true);
291 G4String zbinSchemeGuidance =
"The binning scheme (linear, log).";
292 h3zValBinScheme->SetParameterCandidates(
"linear log");
293 h3zValBinScheme->SetGuidance(zbinSchemeGuidance);
294 h3zValBinScheme->SetDefaultValue(
"linear");
296 fSetH3Cmd = G4Analysis::make_unique<G4UIcommand>(
"/analysis/h3/set",
this);
297 fSetH3Cmd->SetGuidance(
"Set parameters for the 3D histogram of given id:");
298 fSetH3Cmd->SetGuidance(
" nxbins; xvalMin; xvalMax; xunit; xfunction; xbinScheme");
299 fSetH3Cmd->SetGuidance(
" nybins; yvalMin; yvalMax; yunit; yfunction; ybinScheme");
300 fSetH3Cmd->SetGuidance(
" nzbins; zvalMin; zvalMax; zunit; zfunction; zbinScheme");
307 fSetH3Cmd->SetParameter(h3xValBinScheme);
313 fSetH3Cmd->SetParameter(h3yValBinScheme);
319 fSetH3Cmd->SetParameter(h3zValBinScheme);
332 std::vector<G4String> parameters;
337 fHelper->WarnAboutParameters(command, parameters.size());
343 auto name = parameters[counter++];
344 auto title = parameters[counter++];
346 fHelper->GetBinData(xdata, parameters, counter);
349 fHelper->GetBinData(ydata, parameters, counter);
352 fHelper->GetBinData(zdata, parameters, counter);
366 fHelper->GetBinData(xdata, parameters, counter);
369 fHelper->GetBinData(ydata, parameters, counter);
372 fHelper->GetBinData(zdata, parameters, counter);
400 fHelper->WarnAboutSetCommands();
406 fHelper->GetBinData(zdata, parameters, counter);
421 auto title = parameters[counter++];
427 auto xaxis = parameters[counter++];
433 auto yaxis = parameters[counter++];
439 auto zaxis = parameters[counter++];
G4int CreateH3(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4int nzbins, G4double zmin, G4double zmax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
G4bool SetH3YAxisTitle(G4int id, const G4String &title)
G4AnalysisMessengerHelper::BinData fYData
G4bool SetH3(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nzbins, G4double zmin, G4double zmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear", const G4String &zbinSchemeName="linear")
G4double GetUnitValue(const G4String &unit)
static G4int ConvertToInt(const char *st)
std::unique_ptr< G4UIcommand > fSetH3YCmd
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
std::unique_ptr< G4AnalysisMessengerHelper > fHelper
G4VAnalysisManager * fManager
Associated class.
std::unique_ptr< G4UIcommand > fSetH3Cmd
G4bool SetH3ZAxisTitle(G4int id, const G4String &title)
std::unique_ptr< G4UIcommand > fSetH3ZCmd
G4bool SetH3Title(G4int id, const G4String &title)
std::unique_ptr< G4UIcommand > fSetH3TitleCmd
std::unique_ptr< G4UIcommand > fCreateH3Cmd
G4H3Messenger(G4VAnalysisManager *manager)
G4AnalysisMessengerHelper::BinData fXData
std::unique_ptr< G4UIcommand > fSetH3XAxisCmd
G4int GetParameterEntries() const
virtual void SetNewValue(G4UIcommand *command, G4String value) final
std::unique_ptr< G4UIcommand > fSetH3XCmd
G4bool SetH3XAxisTitle(G4int id, const G4String &title)
std::unique_ptr< G4UIcommand > fSetH3ZAxisCmd
std::unique_ptr< G4UIcommand > fSetH3YAxisCmd
std::unique_ptr< G4UIdirectory > fDirectory