52 fHelper = std::make_unique<G4AnalysisMessengerHelper>(
"h1");
80 h1Name->SetGuidance(
"Histogram name (label)");
83 h1Title->SetGuidance(
"Histogram title");
86 h1Nbins0->SetGuidance(
"Number of bins (default = 100)");
87 h1Nbins0->SetGuidance(
"Can be reset with /analysis/h1/set command");
88 h1Nbins0->SetDefaultValue(100);
91 h1ValMin0->SetGuidance(
"Minimum value, expressed in unit (default = 0.)");
92 h1ValMin0->SetGuidance(
"Can be reset with /analysis/h1/set command");
93 h1ValMin0->SetDefaultValue(0.);
96 h1ValMax0->SetGuidance(
"Maximum value, expressed in unit (default = 1.)");
97 h1ValMax0->SetGuidance(
"Can be reset with /analysis/h1/set command");
98 h1ValMax0->SetDefaultValue(1.);
101 h1ValUnit0->SetGuidance(
"The unit applied to filled values and valMin0, valMax0");
102 h1ValUnit0->SetDefaultValue(
"none");
105 G4String fcnGuidance =
"The function applied to filled values (log, log10, exp).\n";
106 fcnGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
107 fcnGuidance +=
"but none value should be used instead.";
108 h1ValFcn0->SetGuidance(fcnGuidance);
109 h1ValFcn0->SetParameterCandidates(
"log log10 exp none");
110 h1ValFcn0->SetDefaultValue(
"none");
112 auto h1ValBinScheme0 =
new G4UIparameter(
"valBinScheme0",
's',
true);
113 G4String binSchemeGuidance =
"The binning scheme (linear, log).\n";
114 h1ValBinScheme0->SetParameterCandidates(
"linear log");
116 +=
"Note that the unit and fcn parameters cannot be omitted in this case,\n";
117 binSchemeGuidance +=
"but none value should be used instead.";
118 h1ValBinScheme0->SetGuidance(binSchemeGuidance);
119 h1ValBinScheme0->SetDefaultValue(
"linear");
121 fCreateH1Cmd = std::make_unique<G4UIcommand>(
"/analysis/h1/create",
this);
139 h1Id->SetGuidance(
"Histogram id");
140 h1Id->SetParameterRange(
"id>=0");
143 h1Nbins->SetGuidance(
"Number of bins");
146 h1ValMin->SetGuidance(
"Minimum value, expressed in unit");
149 h1ValMax->SetGuidance(
"Maximum value, expressed in unit");
152 h1ValUnit->SetGuidance(
"The unit applied to filled values and valMin, valMax");
153 h1ValUnit->SetDefaultValue(
"none");
156 h1ValFcn->SetParameterCandidates(
"log log10 exp none");
157 G4String fcnGuidance =
"The function applied to filled values (log, log10, exp, none).\n";
158 fcnGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
159 fcnGuidance +=
"but none value should be used instead.";
160 h1ValFcn->SetGuidance(fcnGuidance);
161 h1ValFcn->SetDefaultValue(
"none");
163 auto h1ValBinScheme =
new G4UIparameter(
"valBinScheme",
's',
true);
164 h1ValBinScheme->SetParameterCandidates(
"linear log");
165 G4String binSchemeGuidance =
"The binning scheme (linear, log).\n";
167 +=
"Note that the unit and fcn parameters cannot be omitted in this case,\n";
168 binSchemeGuidance +=
"but none value should be used instead.";
169 h1ValBinScheme->SetGuidance(binSchemeGuidance);
170 h1ValBinScheme->SetDefaultValue(
"linear");
172 fSetH1Cmd = std::make_unique<G4UIcommand>(
"/analysis/h1/set",
this);
173 fSetH1Cmd->SetGuidance(
"Set parameters for the 1D histogram of given id:");
174 fSetH1Cmd->SetGuidance(
" nbins; valMin; valMax; unit; function; binScheme");
193 std::vector<G4String> parameters;
198 fHelper->WarnAboutParameters(command, parameters.size());
204 auto name = parameters[counter++];
205 auto title = parameters[counter++];
207 fHelper->GetBinData(xdata, parameters, counter);
217 fHelper->GetBinData(xdata, parameters, counter);
227 fHelper->GetBinData(xdata, parameters, counter);
236 auto title = parameters[counter++];
242 auto xaxis = parameters[counter++];
248 auto yaxis = parameters[counter++];
std::unique_ptr< G4UIcommand > fCreateH1Cmd
std::unique_ptr< G4UIdirectory > fDirectory
std::unique_ptr< G4UIcommand > fSetH1Cmd
std::unique_ptr< G4UIcommand > fSetH1TitleCmd
std::unique_ptr< G4UIcommand > fSetH1YAxisCmd
std::unique_ptr< G4UIcommand > fSetH1YAxisLogCmd
G4VAnalysisManager * fManager
Associated class.
std::unique_ptr< G4AnalysisMessengerHelper > fHelper
std::unique_ptr< G4UIcommand > fSetH1XCmd
std::unique_ptr< G4UIcommand > fSetH1XAxisLogCmd
std::unique_ptr< G4UIcommand > fSetH1XAxisCmd
virtual void SetNewValue(G4UIcommand *command, G4String value) final
std::size_t GetParameterEntries() const
static G4int ConvertToInt(const char *st)
static G4bool ConvertToBool(const char *st)
G4int CreateH1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
G4bool SetH1YAxisIsLog(G4int id, G4bool isLog)
G4bool SetH1Title(G4int id, const G4String &title)
G4bool SetH1XAxisTitle(G4int id, const G4String &title)
G4bool SetH1XAxisIsLog(G4int id, G4bool isLog)
G4bool SetH1(G4int id, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
G4bool SetH1YAxisTitle(G4int id, const G4String &title)
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
G4double GetUnitValue(const G4String &unit)
const char * name(G4int ptype)