39 using namespace G4Analysis;
47 fCreateP1Cmd(nullptr),
49 fSetP1TitleCmd(nullptr),
50 fSetP1XAxisCmd(nullptr),
51 fSetP1YAxisCmd(nullptr),
54 fHelper = G4Analysis::make_unique<G4AnalysisMessengerHelper>(
"p1");
83 p1Name->SetGuidance(
"Profile name (label)");
86 p1Title->SetGuidance(
"Profile title");
89 p1xNbins0->SetGuidance(
"Number of x-bins (default = 100)");
90 p1xNbins0->SetGuidance(
"Can be reset with /analysis/p1/set command");
91 p1xNbins0->SetDefaultValue(100);
94 p1xValMin0->SetGuidance(
"Minimum x-value, expressed in unit (default = 0.)");
95 p1xValMin0->SetGuidance(
"Can be reset with /analysis/p1/set command");
96 p1xValMin0->SetDefaultValue(0.);
99 p1xValMax0->SetGuidance(
"Maximum x-value, expressed in unit (default = 1.)");
100 p1xValMax0->SetGuidance(
"Can be reset with /analysis/p1/set command");
101 p1xValMax0->SetDefaultValue(1.);
103 auto p1xValUnit0 =
new G4UIparameter(
"xvalUnit0",
's',
true);
104 p1xValUnit0->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
105 p1xValUnit0->SetDefaultValue(
"none");
108 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).\n";
109 fcnxGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
110 fcnxGuidance +=
"but none value should be used instead.";
111 p1xValFcn0->SetGuidance(fcnxGuidance);
112 p1xValFcn0->SetParameterCandidates(
"log log10 exp none");
113 p1xValFcn0->SetDefaultValue(
"none");
115 auto p1xValBinScheme0 =
new G4UIparameter(
"xvalBinScheme0",
's',
true);
116 G4String binSchemeGuidance =
"The binning scheme (linear, log).\n";
117 p1xValBinScheme0->SetParameterCandidates(
"linear log");
119 +=
"Note that the unit and fcn parameters cannot be omitted in this case,\n";
120 binSchemeGuidance +=
"but none value should be used instead.";
121 p1xValBinScheme0->SetGuidance(binSchemeGuidance);
122 p1xValBinScheme0->SetDefaultValue(
"linear");
125 p1yValMin0->SetGuidance(
"Minimum y-value, expressed in unit (default = 0.)");
126 p1yValMin0->SetGuidance(
"Can be reset with /analysis/p1/set command");
127 p1yValMin0->SetDefaultValue(0.);
130 p1yValMax0->SetGuidance(
"Maximum y-value, expressed in unit (default = 1.)");
131 p1yValMax0->SetGuidance(
"Can be reset with /analysis/p1/set command");
132 p1yValMax0->SetDefaultValue(1.);
134 auto p1yValUnit0 =
new G4UIparameter(
"yvalUnit0",
's',
true);
135 p1yValUnit0->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
136 p1yValUnit0->SetDefaultValue(
"none");
139 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).\n";
140 fcnyGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
141 fcnyGuidance +=
"but none value should be used instead.";
142 p1yValFcn0->SetGuidance(fcnyGuidance);
143 p1yValFcn0->SetParameterCandidates(
"log log10 exp none");
144 p1yValFcn0->SetDefaultValue(
"none");
146 fCreateP1Cmd = G4Analysis::make_unique<G4UIcommand>(
"/analysis/p1/create",
this);
168 p1Id->SetGuidance(
"Profile id");
169 p1Id->SetParameterRange(
"id>=0");
172 p1xNbins->SetGuidance(
"Number of x-bins");
175 p1xValMin->SetGuidance(
"Minimum x-value, expressed in unit");
178 p1xValMax->SetGuidance(
"Maximum x-value, expressed in unit");
181 p1xValUnit->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
182 p1xValUnit->SetDefaultValue(
"none");
185 p1xValFcn->SetParameterCandidates(
"log log10 exp none");
186 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).\n";
187 fcnxGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
188 fcnxGuidance +=
"but none value should be used instead.";
189 p1xValFcn->SetGuidance(fcnxGuidance);
190 p1xValFcn->SetDefaultValue(
"none");
192 auto p1xValBinScheme =
new G4UIparameter(
"xvalBinScheme",
's',
true);
193 G4String binSchemeGuidance =
"The binning scheme (linear, log).\n";
194 p1xValBinScheme->SetParameterCandidates(
"linear log");
196 +=
"Note that the unit and fcn parameters cannot be omitted in this case,\n";
197 binSchemeGuidance +=
"but none value should be used instead.";
198 p1xValBinScheme->SetGuidance(binSchemeGuidance);
199 p1xValBinScheme->SetDefaultValue(
"linear");
202 p1yValMin->SetGuidance(
"Minimum y-value, expressed in unit");
205 p1yValMax->SetGuidance(
"Maximum y-value, expressed in unit");
208 p1yValUnit->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
209 p1yValUnit->SetDefaultValue(
"none");
212 p1yValFcn->SetParameterCandidates(
"log log10 exp none");
213 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).\n";
214 fcnyGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
215 fcnyGuidance +=
"but none value should be used instead.";
216 p1yValFcn->SetGuidance(fcnyGuidance);
217 p1yValFcn->SetDefaultValue(
"none");
219 fSetP1Cmd = G4Analysis::make_unique<G4UIcommand>(
"/analysis/p1/set",
this);
220 fSetP1Cmd->SetGuidance(
"Set parameters for the 1D profile of given id:");
221 fSetP1Cmd->SetGuidance(
" nbins; xvalMin; xvalMax; xunit; xfunction; xbinScheme");
222 fSetP1Cmd->SetGuidance(
" yvalMin; yvalMax; yunit; yfunction");
229 fSetP1Cmd->SetParameter(p1xValBinScheme);
250 fHelper->WarnAboutParameters(command, parameters.size());
256 auto name = parameters[counter++];
257 auto title = parameters[counter++];
259 fHelper->GetBinData(xdata, parameters, counter);
262 fHelper->GetValueData(ydata, parameters, counter);
275 fHelper->GetBinData(xdata, parameters, counter);
278 fHelper->GetValueData(ydata, parameters, counter);
307 fHelper->WarnAboutSetCommands();
312 fHelper->GetValueData(ydata, parameters, counter);
325 auto title = parameters[counter++];
331 auto xaxis = parameters[counter++];
337 auto yaxis = parameters[counter++];