39 using namespace G4Analysis;
47 fCreateH2Cmd(nullptr),
51 fSetH2TitleCmd(nullptr),
52 fSetH2XAxisCmd(nullptr),
53 fSetH2YAxisCmd(nullptr),
57 fHelper = G4Analysis::make_unique<G4AnalysisMessengerHelper>(
"h2");
88 h2Name->SetGuidance(
"Histogram name (label)");
91 h2Title->SetGuidance(
"Histogram title");
94 h2xNbins0->SetGuidance(
"Number of x-bins (default = 100)");
95 h2xNbins0->SetGuidance(
"Can be reset with /analysis/h2/set command");
96 h2xNbins0->SetDefaultValue(100);
99 h2xValMin0->SetGuidance(
"Minimum x-value, expressed in unit (default = 0.)");
100 h2xValMin0->SetGuidance(
"Can be reset with /analysis/h2/set command");
101 h2xValMin0->SetDefaultValue(0.);
104 h2xValMax0->SetGuidance(
"Maximum x-value, expressed in unit (default = 1.)");
105 h2xValMax0->SetGuidance(
"Can be reset with /analysis/h2/set command");
106 h2xValMax0->SetDefaultValue(1.);
108 auto h2xValUnit0 =
new G4UIparameter(
"xvalUnit0",
's',
true);
109 h2xValUnit0->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
110 h2xValUnit0->SetDefaultValue(
"none");
113 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).";
114 h2xValFcn0->SetGuidance(fcnxGuidance);
115 h2xValFcn0->SetParameterCandidates(
"log log10 exp none");
116 h2xValFcn0->SetDefaultValue(
"none");
118 auto h2xValBinScheme0 =
new G4UIparameter(
"xvalBinScheme0",
's',
true);
119 G4String xbinSchemeGuidance =
"The binning scheme (linear, log).";
120 h2xValBinScheme0->SetParameterCandidates(
"linear log");
121 h2xValBinScheme0->SetGuidance(xbinSchemeGuidance);
122 h2xValBinScheme0->SetDefaultValue(
"linear");
125 h2yNbins0->SetGuidance(
"Number of y-bins (default = 100)");
126 h2yNbins0->SetGuidance(
"Can be reset with /analysis/h2/set command");
127 h2yNbins0->SetDefaultValue(100);
130 h2yValMin0->SetGuidance(
"Minimum y-value, expressed in unit (default = 0.)");
131 h2yValMin0->SetGuidance(
"Can be reset with /analysis/h2/set command");
132 h2yValMin0->SetDefaultValue(0.);
135 h2yValMax0->SetGuidance(
"Maximum y-value, expressed in unit (default = 1.)");
136 h2yValMax0->SetGuidance(
"Can be reset with /analysis/h2/set command");
137 h2yValMax0->SetDefaultValue(1.);
139 auto h2yValUnit0 =
new G4UIparameter(
"yvalUnit0",
's',
true);
140 h2yValUnit0->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
141 h2yValUnit0->SetDefaultValue(
"none");
144 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).";
145 h2yValFcn0->SetGuidance(fcnyGuidance);
146 h2yValFcn0->SetParameterCandidates(
"log log10 exp none");
147 h2yValFcn0->SetDefaultValue(
"none");
149 auto h2yValBinScheme0 =
new G4UIparameter(
"yvalBinScheme0",
's',
true);
150 G4String ybinSchemeGuidance =
"The binning scheme (linear, log).";
151 h2yValBinScheme0->SetParameterCandidates(
"linear log");
152 h2yValBinScheme0->SetGuidance(ybinSchemeGuidance);
153 h2yValBinScheme0->SetDefaultValue(
"linear");
155 fCreateH2Cmd = G4Analysis::make_unique<G4UIcommand>(
"/analysis/h2/create",
this);
179 h2Id->SetGuidance(
"Histogram id");
180 h2Id->SetParameterRange(
"id>=0");
183 h2xNbins->SetGuidance(
"Number of x-bins");
186 h2xValMin->SetGuidance(
"Minimum x-value, expressed in unit");
189 h2xValMax->SetGuidance(
"Maximum x-value, expressed in unit");
192 h2xValUnit->SetGuidance(
"The unit applied to filled x-values and xvalMin, xvalMax");
193 h2xValUnit->SetDefaultValue(
"none");
196 h2xValFcn->SetParameterCandidates(
"log log10 exp none");
197 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).";
198 h2xValFcn->SetGuidance(fcnxGuidance);
199 h2xValFcn->SetDefaultValue(
"none");
201 auto h2xValBinScheme =
new G4UIparameter(
"xvalBinScheme",
's',
true);
202 G4String xbinSchemeGuidance =
"The binning scheme (linear, log).";
203 h2xValBinScheme->SetParameterCandidates(
"linear log");
204 h2xValBinScheme->SetGuidance(xbinSchemeGuidance);
205 h2xValBinScheme->SetDefaultValue(
"linear");
208 h2yNbins->SetGuidance(
"Number of y-bins");
211 h2yValMin->SetGuidance(
"Minimum y-value, expressed in unit");
214 h2yValMax->SetGuidance(
"Maximum y-value, expressed in unit");
217 h2yValUnit->SetGuidance(
"The unit applied to filled y-values and yvalMin, yvalMax");
218 h2yValUnit->SetDefaultValue(
"none");
221 h2yValFcn->SetParameterCandidates(
"log log10 exp none");
222 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).";
223 h2yValFcn->SetGuidance(fcnyGuidance);
224 h2yValFcn->SetDefaultValue(
"none");
226 auto h2yValBinScheme =
new G4UIparameter(
"yvalBinScheme",
's',
true);
227 G4String ybinSchemeGuidance =
"The binning scheme (linear, log).";
228 h2yValBinScheme->SetParameterCandidates(
"linear log");
229 h2yValBinScheme->SetGuidance(ybinSchemeGuidance);
230 h2yValBinScheme->SetDefaultValue(
"linear");
232 fSetH2Cmd = G4Analysis::make_unique<G4UIcommand>(
"/analysis/h2/set",
this);
233 fSetH2Cmd->SetGuidance(
"Set parameters for the 2D histogram of given id:");
234 fSetH2Cmd->SetGuidance(
" nxbins; xvalMin; xvalMax; xunit; xfunction; xbinScheme");
235 fSetH2Cmd->SetGuidance(
" nybins; yvalMin; yvalMax; yunit; yfunction; ybinScheme");
242 fSetH2Cmd->SetParameter(h2xValBinScheme);
248 fSetH2Cmd->SetParameter(h2yValBinScheme);
266 fHelper->WarnAboutParameters(command, parameters.size());
272 auto name = parameters[counter++];
273 auto title = parameters[counter++];
275 fHelper->GetBinData(xdata, parameters, counter);
278 fHelper->GetBinData(ydata, parameters, counter);
291 fHelper->GetBinData(xdata, parameters, counter);
294 fHelper->GetBinData(ydata, parameters, counter);
314 fHelper->WarnAboutSetCommands();
319 fHelper->GetBinData(ydata, parameters, counter);
332 auto title = parameters[counter++];
338 auto xaxis = parameters[counter++];
344 auto yaxis = parameters[counter++];
350 auto zaxis = parameters[counter++];