22 #include "art/Utilities/ToolConfigTable.h"
23 #include "art/Utilities/ToolMacros.h"
24 #include "canvas/Utilities/Exception.h"
27 #include "fhiclcpp/types/OptionalAtom.h"
28 #include "fhiclcpp/types/Atom.h"
37 namespace icarus::opdet {
struct AsymExpPulseFunctionTool; }
78 Comment(
"peak time from the beginning of the waveform [ns]")
84 Comment(
"measured charge current at peak [mA]")
86 fhicl::OptionalAtom<float>
Gain {
88 Comment(
"PMT amplification gain factor")
92 Name(
"RaiseTimeConstant"),
93 Comment(
"raise time constant (exponential raise) [ns]")
97 Name(
"FallTimeConstant"),
98 Comment(
"fall time constant (exponential fall) [ns]")
103 Comment(
"Current-to-ADC conversion factor [ADC counts/mA]")
147 (
Config const& config) -> std::unique_ptr<PulseFunction_t>
151 using ADCcount = MyFunction_t::ADCcount;
155 if (config.
Gain().has_value()) {
157 throw art::Exception(art::errors::Configuration)
158 <<
"AsymExpPulseFunctionTool: Only one configuration parameter out of '"
160 <<
") and '" << config.
Gain.name() <<
"' (set as " << (*config.
Gain())
161 <<
") can be specified at once!\n";
163 peakCurrent = peakCurrentFromGain(
171 throw art::Exception(art::errors::Configuration)
172 <<
"AsymExpPulseFunctionTool: either configuration parameter '"
174 <<
"' must be specified!\n";
179 return std::make_unique<MyFunction_t>(
183 ADCcount(config.
ADC() * peakCurrent),
196 static constexpr
double electronCharge = -1.602176634e-7;
199 float const tauRatioLog = std::log(raiseTau / fallTau);
201 return gain * electronCharge / dTau.
value() * (
202 std::exp(raiseTau / dTau * tauRatioLog)
203 -
std::exp(fallTau / dTau * tauRatioLog)
Dimensioned variables representing electromagnetic quantities.
constexpr value_t value() const
Returns the value of the quantity.
Utilities to read and write quantities in FHiCL configuration.
A value measured in the specified unit.
Pulse from one photoelectron as sum of two exponential functions.
BEGIN_PROLOG vertical distance to the surface Name
Describes the waveform from a single photoelectron.