43 fHelper = std::make_unique<G4AnalysisMessengerHelper>(
"p2");
74 p2Name->SetGuidance(
"Profile name (label)");
77 p2Title->SetGuidance(
"Profile title");
80 p2xNbins0->SetGuidance(
"Number of x-bins (default = 100)");
81 p2xNbins0->SetGuidance(
"Can be reset with /analysis/p2/set command");
82 p2xNbins0->SetDefaultValue(100);
85 p2xValMin0->SetGuidance(
"Minimum x-value, expressed in unit (default = 0.)");
86 p2xValMin0->SetGuidance(
"Can be reset with /analysis/p2/set command");
87 p2xValMin0->SetDefaultValue(0.);
90 p2xValMax0->SetGuidance(
"Maximum x-value, expressed in unit (default = 1.)");
91 p2xValMax0->SetGuidance(
"Can be reset with /analysis/p2/set command");
92 p2xValMax0->SetDefaultValue(1.);
95 p2xValUnit0->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
96 p2xValUnit0->SetDefaultValue(
"none");
99 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).";
100 p2xValFcn0->SetGuidance(fcnxGuidance);
101 p2xValFcn0->SetParameterCandidates(
"log log10 exp none");
102 p2xValFcn0->SetDefaultValue(
"none");
104 auto p2xValBinScheme0 =
new G4UIparameter(
"xvalBinScheme0",
's',
true);
105 G4String binSchemeGuidance =
"The binning scheme (linear, log).";
106 p2xValBinScheme0->SetParameterCandidates(
"linear log");
107 p2xValBinScheme0->SetGuidance(binSchemeGuidance);
108 p2xValBinScheme0->SetDefaultValue(
"linear");
111 p2yNbins0->SetGuidance(
"Number of y-bins (default = 100)");
112 p2yNbins0->SetGuidance(
"Can be reset with /analysis/p2/set command");
113 p2yNbins0->SetDefaultValue(100);
116 p2yValMin0->SetGuidance(
"Minimum y-value, expressed in unit (default = 0.)");
117 p2yValMin0->SetGuidance(
"Can be reset with /analysis/p2/set command");
118 p2yValMin0->SetDefaultValue(0.);
121 p2yValMax0->SetGuidance(
"Maximum y-value, expressed in unit (default = 1.)");
122 p2yValMax0->SetGuidance(
"Can be reset with /analysis/p2/set command");
123 p2yValMax0->SetDefaultValue(1.);
125 auto p2yValUnit0 =
new G4UIparameter(
"yvalUnit0",
's',
true);
126 p2yValUnit0->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
127 p2yValUnit0->SetDefaultValue(
"none");
130 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).";
131 p2yValFcn0->SetGuidance(fcnyGuidance);
132 p2yValFcn0->SetParameterCandidates(
"log log10 exp none");
133 p2yValFcn0->SetDefaultValue(
"none");
135 auto p2yValBinScheme0 =
new G4UIparameter(
"yvalBinScheme0",
's',
true);
136 p2yValBinScheme0->SetParameterCandidates(
"linear log");
137 p2yValBinScheme0->SetGuidance(binSchemeGuidance);
138 p2yValBinScheme0->SetDefaultValue(
"linear");
141 p2zValMin0->SetGuidance(
"Minimum z-value, expressed in unit (default = 0.)");
142 p2zValMin0->SetGuidance(
"Can be reset with /analysis/p2/set command");
143 p2zValMin0->SetDefaultValue(0.);
146 p2zValMax0->SetGuidance(
"Maximum z-value, expressed in unit (default = 1.)");
147 p2zValMax0->SetGuidance(
"Can be reset with /analysis/p2/set command");
148 p2zValMax0->SetDefaultValue(1.);
150 auto p2zValUnit0 =
new G4UIparameter(
"zvalUnit0",
's',
true);
151 p2zValUnit0->SetGuidance(
"The unit applied to filled z-values and zvalMin0, zvalMax0");
152 p2zValUnit0->SetDefaultValue(
"none");
155 G4String fcnzGuidance =
"The function applied to filled z-values (log, log10, exp, none).";
156 p2zValFcn0->SetGuidance(fcnzGuidance);
157 p2zValFcn0->SetParameterCandidates(
"log log10 exp none");
158 p2zValFcn0->SetDefaultValue(
"none");
160 fCreateP2Cmd = std::make_unique<G4UIcommand>(
"/analysis/p2/create",
this);
188 p2Id->SetGuidance(
"Profile id");
189 p2Id->SetParameterRange(
"id>=0");
192 p2xNbins->SetGuidance(
"Number of x-bins");
195 p2xValMin->SetGuidance(
"Minimum x-value, expressed in unit");
198 p2xValMax->SetGuidance(
"Maximum x-value, expressed in unit");
201 p2xValUnit->SetGuidance(
"The unit applied to filled x-values and xvalMin0, xvalMax0");
202 p2xValUnit->SetDefaultValue(
"none");
205 p2xValFcn->SetParameterCandidates(
"log log10 exp none");
206 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).";
207 p2xValFcn->SetGuidance(fcnxGuidance);
208 p2xValFcn->SetDefaultValue(
"none");
210 auto p2xValBinScheme =
new G4UIparameter(
"xvalBinScheme",
's',
true);
211 G4String binSchemeGuidance =
"The binning scheme (linear, log).";
212 p2xValBinScheme->SetParameterCandidates(
"linear log");
213 p2xValBinScheme->SetGuidance(binSchemeGuidance);
214 p2xValBinScheme->SetDefaultValue(
"linear");
217 p2yNbins->SetGuidance(
"Number of y-bins");
220 p2yValMin->SetGuidance(
"Minimum y-value, expressed in unit");
223 p2yValMax->SetGuidance(
"Maximum y-value, expressed in unit");
226 p2yValUnit->SetGuidance(
"The unit applied to filled y-values and yvalMin0, yvalMax0");
227 p2yValUnit->SetDefaultValue(
"none");
230 p2yValFcn->SetParameterCandidates(
"log log10 exp none");
231 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).";
232 p2yValFcn->SetGuidance(fcnyGuidance);
233 p2yValFcn->SetDefaultValue(
"none");
235 auto p2yValBinScheme =
new G4UIparameter(
"yvalBinScheme",
's',
true);
236 p2yValBinScheme->SetParameterCandidates(
"linear log");
237 p2yValBinScheme->SetGuidance(binSchemeGuidance);
238 p2yValBinScheme->SetDefaultValue(
"linear");
241 p2zValMin->SetGuidance(
"Minimum z-value, expressed in unit");
244 p2zValMax->SetGuidance(
"Maximum z-value, expressed in unit");
247 p2zValUnit->SetGuidance(
"The unit applied to filled z-values and zvalMin0, zvalMax0");
248 p2zValUnit->SetDefaultValue(
"none");
251 p2zValFcn->SetParameterCandidates(
"log log10 exp none");
252 G4String fcnzGuidance =
"The function applied to filled z-values (log, log10, exp, none).";
253 p2zValFcn->SetGuidance(fcnzGuidance);
254 p2zValFcn->SetDefaultValue(
"none");
256 fSetP2Cmd = std::make_unique<G4UIcommand>(
"/analysis/p2/set",
this);
257 fSetP2Cmd->SetGuidance(
"Set parameters for the 2D profile of given id:");
258 fSetP2Cmd->SetGuidance(
" nxbins; xvalMin; xvalMax; xunit; xbinScheme");
259 fSetP2Cmd->SetGuidance(
" nybins; yvalMin; yvalMax; yunit; ybinScheme");
260 fSetP2Cmd->SetGuidance(
" zvalMin; zvalMax; zunit; zfunction");
267 fSetP2Cmd->SetParameter(p2xValBinScheme);
273 fSetP2Cmd->SetParameter(p2yValBinScheme);
290 std::vector<G4String> parameters;
295 fHelper->WarnAboutParameters(command, parameters.size());
301 auto name = parameters[counter++];
302 auto title = parameters[counter++];
304 fHelper->GetBinData(xdata, parameters, counter);
307 fHelper->GetBinData(ydata, parameters, counter);
310 fHelper->GetValueData(zdata, parameters, counter);
324 fHelper->GetBinData(xdata, parameters, counter);
327 fHelper->GetBinData(ydata, parameters, counter);
330 fHelper->GetValueData(zdata, parameters, counter);
352 fHelper->WarnAboutSetCommands();
374 fHelper->WarnAboutSetCommands();
380 fHelper->GetValueData(zdata, parameters, counter);
395 auto title = parameters[counter++];
401 auto xaxis = parameters[counter++];
407 auto yaxis = parameters[counter++];
413 auto zaxis = parameters[counter++];
std::unique_ptr< G4UIcommand > fSetP2XAxisLogCmd
std::unique_ptr< G4UIcommand > fSetP2TitleCmd
std::unique_ptr< G4UIdirectory > fDirectory
G4AnalysisMessengerHelper::BinData fXData
std::unique_ptr< G4UIcommand > fSetP2YCmd
std::unique_ptr< G4UIcommand > fSetP2XCmd
virtual void SetNewValue(G4UIcommand *command, G4String value) final
std::unique_ptr< G4UIcommand > fSetP2XAxisCmd
std::unique_ptr< G4UIcommand > fSetP2ZAxisCmd
std::unique_ptr< G4UIcommand > fSetP2ZCmd
G4AnalysisMessengerHelper::BinData fYData
G4VAnalysisManager * fManager
Associated class.
std::unique_ptr< G4UIcommand > fCreateP2Cmd
std::unique_ptr< G4UIcommand > fSetP2YAxisLogCmd
std::unique_ptr< G4UIcommand > fSetP2Cmd
std::unique_ptr< G4UIcommand > fSetP2ZAxisLogCmd
std::unique_ptr< G4AnalysisMessengerHelper > fHelper
std::unique_ptr< G4UIcommand > fSetP2YAxisCmd
std::size_t GetParameterEntries() const
static G4int ConvertToInt(const char *st)
static G4bool ConvertToBool(const char *st)
G4bool SetP2YAxisTitle(G4int id, const G4String &title)
G4int CreateP2(const G4String &name, const G4String &title, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
G4bool SetP2ZAxisIsLog(G4int id, G4bool isLog)
G4bool SetP2(G4int id, G4int nxbins, G4double xmin, G4double xmax, G4int nybins, G4double ymin, G4double ymax, G4double zmin=0, G4double zmax=0, const G4String &xunitName="none", const G4String &yunitName="none", const G4String &zunitName="none", const G4String &xfcnName="none", const G4String &yfcnName="none", const G4String &zfcnName="none", const G4String &xbinSchemeName="linear", const G4String &ybinSchemeName="linear")
G4bool SetP2Title(G4int id, const G4String &title)
G4bool SetP2ZAxisTitle(G4int id, const G4String &title)
G4bool SetP2YAxisIsLog(G4int id, G4bool isLog)
G4bool SetP2XAxisIsLog(G4int id, G4bool isLog)
G4bool SetP2XAxisTitle(G4int id, const G4String &title)
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
G4double GetUnitValue(const G4String &unit)
const char * name(G4int ptype)