40 using namespace G4Analysis;
48 fCreateH2Cmd(nullptr),
52 fSetH2TitleCmd(nullptr),
53 fSetH2XAxisCmd(nullptr),
54 fSetH2YAxisCmd(nullptr),
58 fHelper = G4Analysis::make_unique<G4AnalysisMessengerHelper>(
"h2");
86 h2Name->SetGuidance(
"Histogram name (label)");
89 h2Title->SetGuidance(
"Histogram title");
92 h2xNbins0->SetGuidance(
"Number of x-bins (default = 100)");
93 h2xNbins0->SetGuidance(
"Can be reset with /analysis/h2/set command");
94 h2xNbins0->SetDefaultValue(100);
97 h2xValMin0->SetGuidance(
"Minimum x-value, expressed in unit (default = 0.)");
98 h2xValMin0->SetGuidance(
"Can be reset with /analysis/h2/set command");
99 h2xValMin0->SetDefaultValue(0.);
102 h2xValMax0->SetGuidance(
"Maximum x-value, expressed in unit (default = 1.)");
103 h2xValMax0->SetGuidance(
"Can be reset with /analysis/h2/set command");
104 h2xValMax0->SetDefaultValue(1.);
106 auto h2xValUnit0 =
new G4UIparameter(
"xvalUnit0",
's',
true);
107 h2xValUnit0->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
108 h2xValUnit0->SetDefaultValue(
"none");
111 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).";
112 h2xValFcn0->SetGuidance(fcnxGuidance);
113 h2xValFcn0->SetParameterCandidates(
"log log10 exp none");
114 h2xValFcn0->SetDefaultValue(
"none");
116 auto h2xValBinScheme0 =
new G4UIparameter(
"xvalBinScheme0",
's',
true);
117 G4String xbinSchemeGuidance =
"The binning scheme (linear, log).";
118 h2xValBinScheme0->SetParameterCandidates(
"linear log");
119 h2xValBinScheme0->SetGuidance(xbinSchemeGuidance);
120 h2xValBinScheme0->SetDefaultValue(
"linear");
123 h2yNbins0->SetGuidance(
"Number of y-bins (default = 100)");
124 h2yNbins0->SetGuidance(
"Can be reset with /analysis/h2/set command");
125 h2yNbins0->SetDefaultValue(100);
128 h2yValMin0->SetGuidance(
"Minimum y-value, expressed in unit (default = 0.)");
129 h2yValMin0->SetGuidance(
"Can be reset with /analysis/h2/set command");
130 h2yValMin0->SetDefaultValue(0.);
133 h2yValMax0->SetGuidance(
"Maximum y-value, expressed in unit (default = 1.)");
134 h2yValMax0->SetGuidance(
"Can be reset with /analysis/h2/set command");
135 h2yValMax0->SetDefaultValue(1.);
137 auto h2yValUnit0 =
new G4UIparameter(
"yvalUnit0",
's',
true);
138 h2yValUnit0->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
139 h2yValUnit0->SetDefaultValue(
"none");
142 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).";
143 h2yValFcn0->SetGuidance(fcnyGuidance);
144 h2yValFcn0->SetParameterCandidates(
"log log10 exp none");
145 h2yValFcn0->SetDefaultValue(
"none");
147 auto h2yValBinScheme0 =
new G4UIparameter(
"yvalBinScheme0",
's',
true);
148 G4String ybinSchemeGuidance =
"The binning scheme (linear, log).";
149 h2yValBinScheme0->SetParameterCandidates(
"linear log");
150 h2yValBinScheme0->SetGuidance(ybinSchemeGuidance);
151 h2yValBinScheme0->SetDefaultValue(
"linear");
153 fCreateH2Cmd = G4Analysis::make_unique<G4UIcommand>(
"/analysis/h2/create",
this);
177 h2Id->SetGuidance(
"Histogram id");
178 h2Id->SetParameterRange(
"id>=0");
181 h2xNbins->SetGuidance(
"Number of x-bins");
184 h2xValMin->SetGuidance(
"Minimum x-value, expressed in unit");
187 h2xValMax->SetGuidance(
"Maximum x-value, expressed in unit");
190 h2xValUnit->SetGuidance(
"The unit applied to filled x-values and xvalMin, xvalMax");
191 h2xValUnit->SetDefaultValue(
"none");
194 h2xValFcn->SetParameterCandidates(
"log log10 exp none");
195 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).";
196 h2xValFcn->SetGuidance(fcnxGuidance);
197 h2xValFcn->SetDefaultValue(
"none");
199 auto h2xValBinScheme =
new G4UIparameter(
"xvalBinScheme",
's',
true);
200 G4String xbinSchemeGuidance =
"The binning scheme (linear, log).";
201 h2xValBinScheme->SetParameterCandidates(
"linear log");
202 h2xValBinScheme->SetGuidance(xbinSchemeGuidance);
203 h2xValBinScheme->SetDefaultValue(
"linear");
206 h2yNbins->SetGuidance(
"Number of y-bins");
209 h2yValMin->SetGuidance(
"Minimum y-value, expressed in unit");
212 h2yValMax->SetGuidance(
"Maximum y-value, expressed in unit");
215 h2yValUnit->SetGuidance(
"The unit applied to filled y-values and yvalMin, yvalMax");
216 h2yValUnit->SetDefaultValue(
"none");
219 h2yValFcn->SetParameterCandidates(
"log log10 exp none");
220 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).";
221 h2yValFcn->SetGuidance(fcnyGuidance);
222 h2yValFcn->SetDefaultValue(
"none");
224 auto h2yValBinScheme =
new G4UIparameter(
"yvalBinScheme",
's',
true);
225 G4String ybinSchemeGuidance =
"The binning scheme (linear, log).";
226 h2yValBinScheme->SetParameterCandidates(
"linear log");
227 h2yValBinScheme->SetGuidance(ybinSchemeGuidance);
228 h2yValBinScheme->SetDefaultValue(
"linear");
230 fSetH2Cmd = G4Analysis::make_unique<G4UIcommand>(
"/analysis/h2/set",
this);
231 fSetH2Cmd->SetGuidance(
"Set parameters for the 2D histogram of given id:");
232 fSetH2Cmd->SetGuidance(
" nxbins; xvalMin; xvalMax; xunit; xfunction; xbinScheme");
233 fSetH2Cmd->SetGuidance(
" nybins; yvalMin; yvalMax; yunit; yfunction; ybinScheme");
240 fSetH2Cmd->SetParameter(h2xValBinScheme);
246 fSetH2Cmd->SetParameter(h2yValBinScheme);
259 std::vector<G4String> parameters;
264 fHelper->WarnAboutParameters(command, parameters.size());
270 auto name = parameters[counter++];
271 auto title = parameters[counter++];
273 fHelper->GetBinData(xdata, parameters, counter);
276 fHelper->GetBinData(ydata, parameters, counter);
289 fHelper->GetBinData(xdata, parameters, counter);
292 fHelper->GetBinData(ydata, parameters, counter);
312 fHelper->WarnAboutSetCommands();
317 fHelper->GetBinData(ydata, parameters, counter);
330 auto title = parameters[counter++];
336 auto xaxis = parameters[counter++];
342 auto yaxis = parameters[counter++];
348 auto zaxis = parameters[counter++];
std::unique_ptr< G4UIcommand > fSetH2TitleCmd
std::unique_ptr< G4UIcommand > fSetH2XCmd
std::unique_ptr< G4UIcommand > fSetH2YAxisCmd
G4bool SetH2(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
virtual void SetNewValue(G4UIcommand *command, G4String value) final
G4int CreateH2(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
std::unique_ptr< G4UIcommand > fSetH2YCmd
G4double GetUnitValue(const G4String &unit)
std::unique_ptr< G4AnalysisMessengerHelper > fHelper
static G4int ConvertToInt(const char *st)
G4VAnalysisManager * fManager
Associated class.
G4bool SetH2Title(G4int id, const G4String &title)
G4H2Messenger(G4VAnalysisManager *manager)
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
std::unique_ptr< G4UIcommand > fSetH2ZAxisCmd
G4AnalysisMessengerHelper::BinData fXData
G4bool SetH2XAxisTitle(G4int id, const G4String &title)
G4bool SetH2YAxisTitle(G4int id, const G4String &title)
std::unique_ptr< G4UIcommand > fCreateH2Cmd
std::unique_ptr< G4UIcommand > fSetH2Cmd
std::unique_ptr< G4UIdirectory > fDirectory
G4int GetParameterEntries() const
std::unique_ptr< G4UIcommand > fSetH2XAxisCmd
G4bool SetH2ZAxisTitle(G4int id, const G4String &title)