46 using namespace G4Analysis;
54 fCreateH1Cmd(nullptr),
56 fSetH1TitleCmd(nullptr),
57 fSetH1XAxisCmd(nullptr),
58 fSetH1YAxisCmd(nullptr)
60 fHelper = G4Analysis::make_unique<G4AnalysisMessengerHelper>(
"h1");
89 h1Name->SetGuidance(
"Histogram name (label)");
92 h1Title->SetGuidance(
"Histogram title");
95 h1Nbins0->SetGuidance(
"Number of bins (default = 100)");
96 h1Nbins0->SetGuidance(
"Can be reset with /analysis/h1/set command");
97 h1Nbins0->SetDefaultValue(100);
100 h1ValMin0->SetGuidance(
"Minimum value, expressed in unit (default = 0.)");
101 h1ValMin0->SetGuidance(
"Can be reset with /analysis/h1/set command");
102 h1ValMin0->SetDefaultValue(0.);
105 h1ValMax0->SetGuidance(
"Maximum value, expressed in unit (default = 1.)");
106 h1ValMax0->SetGuidance(
"Can be reset with /analysis/h1/set command");
107 h1ValMax0->SetDefaultValue(1.);
110 h1ValUnit0->SetGuidance(
"The unit applied to filled values and valMin0, valMax0");
111 h1ValUnit0->SetDefaultValue(
"none");
114 G4String fcnGuidance =
"The function applied to filled values (log, log10, exp).\n";
115 fcnGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
116 fcnGuidance +=
"but none value should be used instead.";
117 h1ValFcn0->SetGuidance(fcnGuidance);
118 h1ValFcn0->SetParameterCandidates(
"log log10 exp none");
119 h1ValFcn0->SetDefaultValue(
"none");
121 auto h1ValBinScheme0 =
new G4UIparameter(
"valBinScheme0",
's',
true);
122 G4String binSchemeGuidance =
"The binning scheme (linear, log).\n";
123 h1ValBinScheme0->SetParameterCandidates(
"linear log");
125 +=
"Note that the unit and fcn parameters cannot be omitted in this case,\n";
126 binSchemeGuidance +=
"but none value should be used instead.";
127 h1ValBinScheme0->SetGuidance(binSchemeGuidance);
128 h1ValBinScheme0->SetDefaultValue(
"linear");
130 fCreateH1Cmd = G4Analysis::make_unique<G4UIcommand>(
"/analysis/h1/create",
this);
148 h1Id->SetGuidance(
"Histogram id");
149 h1Id->SetParameterRange(
"id>=0");
152 h1Nbins->SetGuidance(
"Number of bins");
155 h1ValMin->SetGuidance(
"Minimum value, expressed in unit");
158 h1ValMax->SetGuidance(
"Maximum value, expressed in unit");
161 h1ValUnit->SetGuidance(
"The unit applied to filled values and valMin, valMax");
162 h1ValUnit->SetDefaultValue(
"none");
165 h1ValFcn->SetParameterCandidates(
"log log10 exp none");
166 G4String fcnGuidance =
"The function applied to filled values (log, log10, exp, none).\n";
167 fcnGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
168 fcnGuidance +=
"but none value should be used instead.";
169 h1ValFcn->SetGuidance(fcnGuidance);
170 h1ValFcn->SetDefaultValue(
"none");
172 auto h1ValBinScheme =
new G4UIparameter(
"valBinScheme",
's',
true);
173 h1ValBinScheme->SetParameterCandidates(
"linear log");
174 G4String binSchemeGuidance =
"The binning scheme (linear, log).\n";
176 +=
"Note that the unit and fcn parameters cannot be omitted in this case,\n";
177 binSchemeGuidance +=
"but none value should be used instead.";
178 h1ValBinScheme->SetGuidance(binSchemeGuidance);
179 h1ValBinScheme->SetDefaultValue(
"linear");
181 fSetH1Cmd = G4Analysis::make_unique<G4UIcommand>(
"/analysis/h1/set",
this);
182 fSetH1Cmd->SetGuidance(
"Set parameters for the 1D histogram of given id:");
183 fSetH1Cmd->SetGuidance(
" nbins; valMin; valMax; unit; function; binScheme");
207 fHelper->WarnAboutParameters(command, parameters.size());
213 auto name = parameters[counter++];
214 auto title = parameters[counter++];
216 fHelper->GetBinData(xdata, parameters, counter);
226 fHelper->GetBinData(xdata, parameters, counter);
236 fHelper->GetBinData(xdata, parameters, counter);
245 auto title = parameters[counter++];
251 auto xaxis = parameters[counter++];
257 auto yaxis = parameters[counter++];