43 fHelper = std::make_unique<G4AnalysisMessengerHelper>(
"h2");
73 h2Name->SetGuidance(
"Histogram name (label)");
76 h2Title->SetGuidance(
"Histogram title");
79 h2xNbins0->SetGuidance(
"Number of x-bins (default = 100)");
80 h2xNbins0->SetGuidance(
"Can be reset with /analysis/h2/set command");
81 h2xNbins0->SetDefaultValue(100);
84 h2xValMin0->SetGuidance(
"Minimum x-value, expressed in unit (default = 0.)");
85 h2xValMin0->SetGuidance(
"Can be reset with /analysis/h2/set command");
86 h2xValMin0->SetDefaultValue(0.);
89 h2xValMax0->SetGuidance(
"Maximum x-value, expressed in unit (default = 1.)");
90 h2xValMax0->SetGuidance(
"Can be reset with /analysis/h2/set command");
91 h2xValMax0->SetDefaultValue(1.);
94 h2xValUnit0->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
95 h2xValUnit0->SetDefaultValue(
"none");
98 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).";
99 h2xValFcn0->SetGuidance(fcnxGuidance);
100 h2xValFcn0->SetParameterCandidates(
"log log10 exp none");
101 h2xValFcn0->SetDefaultValue(
"none");
103 auto h2xValBinScheme0 =
new G4UIparameter(
"xvalBinScheme0",
's',
true);
104 G4String xbinSchemeGuidance =
"The binning scheme (linear, log).";
105 h2xValBinScheme0->SetParameterCandidates(
"linear log");
106 h2xValBinScheme0->SetGuidance(xbinSchemeGuidance);
107 h2xValBinScheme0->SetDefaultValue(
"linear");
110 h2yNbins0->SetGuidance(
"Number of y-bins (default = 100)");
111 h2yNbins0->SetGuidance(
"Can be reset with /analysis/h2/set command");
112 h2yNbins0->SetDefaultValue(100);
115 h2yValMin0->SetGuidance(
"Minimum y-value, expressed in unit (default = 0.)");
116 h2yValMin0->SetGuidance(
"Can be reset with /analysis/h2/set command");
117 h2yValMin0->SetDefaultValue(0.);
120 h2yValMax0->SetGuidance(
"Maximum y-value, expressed in unit (default = 1.)");
121 h2yValMax0->SetGuidance(
"Can be reset with /analysis/h2/set command");
122 h2yValMax0->SetDefaultValue(1.);
124 auto h2yValUnit0 =
new G4UIparameter(
"yvalUnit0",
's',
true);
125 h2yValUnit0->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
126 h2yValUnit0->SetDefaultValue(
"none");
129 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).";
130 h2yValFcn0->SetGuidance(fcnyGuidance);
131 h2yValFcn0->SetParameterCandidates(
"log log10 exp none");
132 h2yValFcn0->SetDefaultValue(
"none");
134 auto h2yValBinScheme0 =
new G4UIparameter(
"yvalBinScheme0",
's',
true);
135 G4String ybinSchemeGuidance =
"The binning scheme (linear, log).";
136 h2yValBinScheme0->SetParameterCandidates(
"linear log");
137 h2yValBinScheme0->SetGuidance(ybinSchemeGuidance);
138 h2yValBinScheme0->SetDefaultValue(
"linear");
140 fCreateH2Cmd = std::make_unique<G4UIcommand>(
"/analysis/h2/create",
this);
164 h2Id->SetGuidance(
"Histogram id");
165 h2Id->SetParameterRange(
"id>=0");
168 h2xNbins->SetGuidance(
"Number of x-bins");
171 h2xValMin->SetGuidance(
"Minimum x-value, expressed in unit");
174 h2xValMax->SetGuidance(
"Maximum x-value, expressed in unit");
177 h2xValUnit->SetGuidance(
"The unit applied to filled x-values and xvalMin, xvalMax");
178 h2xValUnit->SetDefaultValue(
"none");
181 h2xValFcn->SetParameterCandidates(
"log log10 exp none");
182 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).";
183 h2xValFcn->SetGuidance(fcnxGuidance);
184 h2xValFcn->SetDefaultValue(
"none");
186 auto h2xValBinScheme =
new G4UIparameter(
"xvalBinScheme",
's',
true);
187 G4String xbinSchemeGuidance =
"The binning scheme (linear, log).";
188 h2xValBinScheme->SetParameterCandidates(
"linear log");
189 h2xValBinScheme->SetGuidance(xbinSchemeGuidance);
190 h2xValBinScheme->SetDefaultValue(
"linear");
193 h2yNbins->SetGuidance(
"Number of y-bins");
196 h2yValMin->SetGuidance(
"Minimum y-value, expressed in unit");
199 h2yValMax->SetGuidance(
"Maximum y-value, expressed in unit");
202 h2yValUnit->SetGuidance(
"The unit applied to filled y-values and yvalMin, yvalMax");
203 h2yValUnit->SetDefaultValue(
"none");
206 h2yValFcn->SetParameterCandidates(
"log log10 exp none");
207 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).";
208 h2yValFcn->SetGuidance(fcnyGuidance);
209 h2yValFcn->SetDefaultValue(
"none");
211 auto h2yValBinScheme =
new G4UIparameter(
"yvalBinScheme",
's',
true);
212 G4String ybinSchemeGuidance =
"The binning scheme (linear, log).";
213 h2yValBinScheme->SetParameterCandidates(
"linear log");
214 h2yValBinScheme->SetGuidance(ybinSchemeGuidance);
215 h2yValBinScheme->SetDefaultValue(
"linear");
217 fSetH2Cmd = std::make_unique<G4UIcommand>(
"/analysis/h2/set",
this);
218 fSetH2Cmd->SetGuidance(
"Set parameters for the 2D histogram of given id:");
219 fSetH2Cmd->SetGuidance(
" nxbins; xvalMin; xvalMax; xunit; xfunction; xbinScheme");
220 fSetH2Cmd->SetGuidance(
" nybins; yvalMin; yvalMax; yunit; yfunction; ybinScheme");
227 fSetH2Cmd->SetParameter(h2xValBinScheme);
233 fSetH2Cmd->SetParameter(h2yValBinScheme);
246 std::vector<G4String> parameters;
251 fHelper->WarnAboutParameters(command, parameters.size());
257 auto name = parameters[counter++];
258 auto title = parameters[counter++];
260 fHelper->GetBinData(xdata, parameters, counter);
263 fHelper->GetBinData(ydata, parameters, counter);
276 fHelper->GetBinData(xdata, parameters, counter);
279 fHelper->GetBinData(ydata, parameters, counter);
299 fHelper->WarnAboutSetCommands();
304 fHelper->GetBinData(ydata, parameters, counter);
317 auto title = parameters[counter++];
323 auto xaxis = parameters[counter++];
329 auto yaxis = parameters[counter++];
335 auto zaxis = parameters[counter++];
std::unique_ptr< G4UIcommand > fSetH2Cmd
std::unique_ptr< G4UIcommand > fSetH2XAxisCmd
std::unique_ptr< G4UIcommand > fSetH2XAxisLogCmd
std::unique_ptr< G4UIcommand > fSetH2ZAxisCmd
std::unique_ptr< G4UIdirectory > fDirectory
std::unique_ptr< G4UIcommand > fSetH2XCmd
std::unique_ptr< G4UIcommand > fSetH2YAxisCmd
std::unique_ptr< G4UIcommand > fSetH2YAxisLogCmd
std::unique_ptr< G4UIcommand > fCreateH2Cmd
G4VAnalysisManager * fManager
Associated class.
std::unique_ptr< G4UIcommand > fSetH2YCmd
std::unique_ptr< G4UIcommand > fSetH2ZAxisLogCmd
G4AnalysisMessengerHelper::BinData fXData
std::unique_ptr< G4UIcommand > fSetH2TitleCmd
virtual void SetNewValue(G4UIcommand *command, G4String value) final
std::unique_ptr< G4AnalysisMessengerHelper > fHelper
std::size_t GetParameterEntries() const
static G4int ConvertToInt(const char *st)
static G4bool ConvertToBool(const char *st)
G4bool SetH2XAxisIsLog(G4int id, G4bool isLog)
G4bool SetH2Title(G4int id, const G4String &title)
G4bool SetH2YAxisIsLog(G4int id, G4bool isLog)
G4bool SetH2XAxisTitle(G4int id, const G4String &title)
G4bool SetH2YAxisTitle(G4int id, const G4String &title)
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")
G4bool SetH2ZAxisIsLog(G4int id, G4bool isLog)
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")
G4bool SetH2ZAxisTitle(G4int id, const G4String &title)
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
G4double GetUnitValue(const G4String &unit)
const char * name(G4int ptype)