14 #ifndef ICARUS_NO_CONFIGURATION_VALIDATION
15 # include "fhiclcpp/ParameterSet.h"
16 #endif // ICARUS_NO_CONFIGURATION_VALIDATION
27 #ifndef ICARUS_NO_CONFIGURATION_VALIDATION
31 , fWaveformTag{ params().WaveformTag() }
32 , fPedestalTag{ params().PedestalTag() }
33 , fRMSTag{ params().RMSTag().value_or(fPedestalTag) }
36 #else // ICARUS_NO_CONFIGURATION_VALIDATION
38 fhicl::ParameterSet
const& pset,
39 std::string
const& name
41 : pmtana::PMTPedestalBase(name)
42 , fWaveformTag{ pset.get<std::string>(
"WaveformTag") }
47 #endif // ICARUS_NO_CONFIGURATION_VALIDATION
55 throw std::runtime_error{
56 "pmtana::PedAlgoFixed::setParameters(): inconsistent sizes of input: "
63 fInput = std::move(inputSet);
81 auto const [ inputSet, waveformIndex ] =
findWaveform(wf);
84 throw std::logic_error{
85 "pmtana::PedAlgoFixed::ComputePedestal(): input waveform (address="
87 +
") not registered in any input (ID: "
92 std::size_t
const nSamples = inputSet->
waveforms[waveformIndex]->size();
94 mean_v.resize(nSamples);
97 sigma_v.resize(nSamples);
98 std::fill(sigma_v.begin(), sigma_v.end(), inputSet->
RMSs[waveformIndex]);
108 -> std::pair<InputSet_t const*, std::size_t>
111 auto const wbegin = inputSet->
waveforms.begin();
112 auto const wend = inputSet->
waveforms.end();
113 if (
auto it = std::find(wbegin, wend, &waveform); it == wend)
114 return {
nullptr, std::numeric_limits<std::size_t>::max() };
void setParameters(InputSet_t inputSet)
Records the current pedestals and RMS per channel.
std::vector< double > PedestalSigma_t
std::string fPedestalTag
Name of the data source for pedestals.
void clearParameters()
Removes the pedestal and RMS records.
fhicl::Table< Config > Parameters
std::pair< InputSet_t const *, std::size_t > findWaveform(pmtana::Waveform_t const &waveform) const
Returns the input set and index of the specified waveform.
Pedestal "algorithm" reading the pedestals from somewhere else.
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
virtual bool ComputePedestal(pmtana::Waveform_t const &waveform, pmtana::PedestalMean_t &mean_v, pmtana::PedestalSigma_t &sigma_v) override
Computes the pedestal of the specified waveform.
std::vector< short > Waveform_t
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
std::string to_string(WindowPattern const &pattern)
std::string fRMSTag
Name of the data source for RMS.
PedAlgoFixed(Parameters const ¶ms, std::string const &name="PedFixed")
std::vector< double > PedestalMean_t
InputSet_t fInput
The set of input waveforms currently registered.