43 fHelper = std::make_unique<G4AnalysisMessengerHelper>(
"p1");
71 p1Name->SetGuidance(
"Profile name (label)");
74 p1Title->SetGuidance(
"Profile title");
77 p1xNbins0->SetGuidance(
"Number of x-bins (default = 100)");
78 p1xNbins0->SetGuidance(
"Can be reset with /analysis/p1/set command");
79 p1xNbins0->SetDefaultValue(100);
82 p1xValMin0->SetGuidance(
"Minimum x-value, expressed in unit (default = 0.)");
83 p1xValMin0->SetGuidance(
"Can be reset with /analysis/p1/set command");
84 p1xValMin0->SetDefaultValue(0.);
87 p1xValMax0->SetGuidance(
"Maximum x-value, expressed in unit (default = 1.)");
88 p1xValMax0->SetGuidance(
"Can be reset with /analysis/p1/set command");
89 p1xValMax0->SetDefaultValue(1.);
92 p1xValUnit0->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
93 p1xValUnit0->SetDefaultValue(
"none");
96 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).\n";
97 fcnxGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
98 fcnxGuidance +=
"but none value should be used instead.";
99 p1xValFcn0->SetGuidance(fcnxGuidance);
100 p1xValFcn0->SetParameterCandidates(
"log log10 exp none");
101 p1xValFcn0->SetDefaultValue(
"none");
103 auto p1xValBinScheme0 =
new G4UIparameter(
"xvalBinScheme0",
's',
true);
104 G4String binSchemeGuidance =
"The binning scheme (linear, log).\n";
105 p1xValBinScheme0->SetParameterCandidates(
"linear log");
107 +=
"Note that the unit and fcn parameters cannot be omitted in this case,\n";
108 binSchemeGuidance +=
"but none value should be used instead.";
109 p1xValBinScheme0->SetGuidance(binSchemeGuidance);
110 p1xValBinScheme0->SetDefaultValue(
"linear");
113 p1yValMin0->SetGuidance(
"Minimum y-value, expressed in unit (default = 0.)");
114 p1yValMin0->SetGuidance(
"Can be reset with /analysis/p1/set command");
115 p1yValMin0->SetDefaultValue(0.);
118 p1yValMax0->SetGuidance(
"Maximum y-value, expressed in unit (default = 1.)");
119 p1yValMax0->SetGuidance(
"Can be reset with /analysis/p1/set command");
120 p1yValMax0->SetDefaultValue(1.);
122 auto p1yValUnit0 =
new G4UIparameter(
"yvalUnit0",
's',
true);
123 p1yValUnit0->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
124 p1yValUnit0->SetDefaultValue(
"none");
127 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).\n";
128 fcnyGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
129 fcnyGuidance +=
"but none value should be used instead.";
130 p1yValFcn0->SetGuidance(fcnyGuidance);
131 p1yValFcn0->SetParameterCandidates(
"log log10 exp none");
132 p1yValFcn0->SetDefaultValue(
"none");
134 fCreateP1Cmd = std::make_unique<G4UIcommand>(
"/analysis/p1/create",
this);
156 p1Id->SetGuidance(
"Profile id");
157 p1Id->SetParameterRange(
"id>=0");
160 p1xNbins->SetGuidance(
"Number of x-bins");
163 p1xValMin->SetGuidance(
"Minimum x-value, expressed in unit");
166 p1xValMax->SetGuidance(
"Maximum x-value, expressed in unit");
169 p1xValUnit->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
170 p1xValUnit->SetDefaultValue(
"none");
173 p1xValFcn->SetParameterCandidates(
"log log10 exp none");
174 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).\n";
175 fcnxGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
176 fcnxGuidance +=
"but none value should be used instead.";
177 p1xValFcn->SetGuidance(fcnxGuidance);
178 p1xValFcn->SetDefaultValue(
"none");
180 auto p1xValBinScheme =
new G4UIparameter(
"xvalBinScheme",
's',
true);
181 G4String binSchemeGuidance =
"The binning scheme (linear, log).\n";
182 p1xValBinScheme->SetParameterCandidates(
"linear log");
184 +=
"Note that the unit and fcn parameters cannot be omitted in this case,\n";
185 binSchemeGuidance +=
"but none value should be used instead.";
186 p1xValBinScheme->SetGuidance(binSchemeGuidance);
187 p1xValBinScheme->SetDefaultValue(
"linear");
190 p1yValMin->SetGuidance(
"Minimum y-value, expressed in unit");
193 p1yValMax->SetGuidance(
"Maximum y-value, expressed in unit");
196 p1yValUnit->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
197 p1yValUnit->SetDefaultValue(
"none");
200 p1yValFcn->SetParameterCandidates(
"log log10 exp none");
201 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).\n";
202 fcnyGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
203 fcnyGuidance +=
"but none value should be used instead.";
204 p1yValFcn->SetGuidance(fcnyGuidance);
205 p1yValFcn->SetDefaultValue(
"none");
207 fSetP1Cmd = std::make_unique<G4UIcommand>(
"/analysis/p1/set",
this);
208 fSetP1Cmd->SetGuidance(
"Set parameters for the 1D profile of given id:");
209 fSetP1Cmd->SetGuidance(
" nbins; xvalMin; xvalMax; xunit; xfunction; xbinScheme");
210 fSetP1Cmd->SetGuidance(
" yvalMin; yvalMax; yunit; yfunction");
217 fSetP1Cmd->SetParameter(p1xValBinScheme);
233 std::vector<G4String> parameters;
238 fHelper->WarnAboutParameters(command, parameters.size());
244 auto name = parameters[counter++];
245 auto title = parameters[counter++];
247 fHelper->GetBinData(xdata, parameters, counter);
250 fHelper->GetValueData(ydata, parameters, counter);
263 fHelper->GetBinData(xdata, parameters, counter);
266 fHelper->GetValueData(ydata, parameters, counter);
295 fHelper->WarnAboutSetCommands();
300 fHelper->GetValueData(ydata, parameters, counter);
313 auto title = parameters[counter++];
319 auto xaxis = parameters[counter++];
325 auto yaxis = parameters[counter++];
std::unique_ptr< G4UIcommand > fSetP1XAxisLogCmd
G4VAnalysisManager * fManager
Associated class.
std::unique_ptr< G4UIcommand > fSetP1YAxisCmd
std::unique_ptr< G4UIcommand > fSetP1YCmd
virtual void SetNewValue(G4UIcommand *command, G4String value) final
std::unique_ptr< G4AnalysisMessengerHelper > fHelper
std::unique_ptr< G4UIcommand > fSetP1TitleCmd
G4AnalysisMessengerHelper::BinData fXData
std::unique_ptr< G4UIcommand > fSetP1YAxisLogCmd
std::unique_ptr< G4UIcommand > fSetP1Cmd
std::unique_ptr< G4UIcommand > fSetP1XAxisCmd
std::unique_ptr< G4UIcommand > fSetP1XCmd
std::unique_ptr< G4UIcommand > fCreateP1Cmd
std::unique_ptr< G4UIdirectory > fDirectory
std::size_t GetParameterEntries() const
static G4int ConvertToInt(const char *st)
static G4bool ConvertToBool(const char *st)
G4int CreateP1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear")
G4bool SetP1XAxisTitle(G4int id, const G4String &title)
G4bool SetP1(G4int id, G4int nbins, G4double xmin, G4double xmax, G4double ymin=0, G4double ymax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &xbinSchemeName="linear")
G4bool SetP1YAxisIsLog(G4int id, G4bool isLog)
G4bool SetP1YAxisTitle(G4int id, const G4String &title)
G4bool SetP1XAxisIsLog(G4int id, G4bool isLog)
G4bool SetP1Title(G4int id, const G4String &title)
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
G4double GetUnitValue(const G4String &unit)
const char * name(G4int ptype)