22 #include "art/Utilities/ToolConfigTable.h"
23 #include "art/Utilities/ToolMacros.h"
26 #include "messagefacility/MessageLogger/MessageLogger.h"
27 #include "fhiclcpp/types/OptionalDelegatedParameter.h"
28 #include "fhiclcpp/types/Atom.h"
29 #include "fhiclcpp/ParameterSet.h"
37 namespace icarus::opdet {
struct CustomPulseFunctionTool; }
89 Comment(
"formuls for the pulse shape, in ROOT TFormula format")
94 Comment(
"time at which the pulse peaks [ns]")
99 Comment(
"collection of parameter names and their numerical values")
139 (
Config const& config) -> std::unique_ptr<PulseFunction_t>
147 fhicl::ParameterSet configuredParameters;
148 config.
Parameters.get_if_present(configuredParameters);
149 MyFunction_t::PulseParameters_t parameters;
150 for (
auto const& parName: configuredParameters.get_names())
151 parameters.emplace_back(parName, configuredParameters.get<
double>(parName));
153 std::string
const& peakTimeStr = config.
PeakTime();
157 return std::make_unique<MyFunction_t>(
160 util::quantities::makeQuantity<nanoseconds>(peakTimeStr,
true)
166 mf::LogDebug(
"CustomPulseFunctionTool")
167 <<
"Parameter PeakTime ('" << peakTimeStr
168 <<
"') does not seem to be a nanosecond quantity; will try as formula."
171 return std::make_unique<MyFunction_t>(expression, parameters, peakTimeStr);
Dimensioned variables representing electromagnetic quantities.
Pulse from one photoelectron fully defined by the configuration.
Utilities to read and write quantities in FHiCL configuration.
BEGIN_PROLOG vertical distance to the surface Name
Describes the waveform from a single photoelectron.
String representing a quantity has an invalid number.