23 #include "messagefacility/MessageLogger/MessageLogger.h"
30 RunHitFinder(std::vector<raw::OpDetWaveform>
const& opDetWaveformVector,
31 std::vector<recob::OpHit>& hitVector,
41 for (
auto const& waveform : opDetWaveformVector) {
43 const int channel =
static_cast<int>(waveform.ChannelNumber());
46 mf::LogError(
"OpHitFinder")
47 <<
"Error! unrecognized channel number " << channel <<
". Ignoring pulse";
54 auto const& pulses = threshAlg.
GetPulses();
56 const double timeStamp = waveform.TimeStamp();
58 for (
auto const& pulse : pulses)
59 ConstructHit(hitThreshold, channel, timeStamp, pulse, hitVector, clocksData, calibrator, use_start_time);
69 std::vector<recob::OpHit>& hitVector,
75 if (pulse.
peak < hitThreshold)
return;
79 double relTime = absTime - clocksData.
TriggerTime();
89 PE = calibrator.
PE(pulse.
area, channel);
91 PE = calibrator.
PE(pulse.
peak, channel);
95 hitVector.emplace_back(channel, relTime, absTime, startTime, riseTime, frame, width, pulse.
area, pulse.
peak, PE, 0.0);
virtual bool UseArea() const =0
const geo::GeometryCore * geometry
virtual double PE(double adcs, int opchannel) const =0
constexpr int Frame() const noexcept
Returns the number of the frame containing the clock current time.
pure virtual base interface for detector clocks
constexpr double TickPeriod() const noexcept
A single tick period in microseconds.
Access the description of detector geometry.
const pulse_param_array & GetPulses() const
A getter for the whole array of pulse_param struct object.
bool Reconstruct(const pmtana::Waveform_t &) const
Implementation of ana_base::analyze method.
Description of geometry of one entire detector.
double TriggerTime() const
Trigger electronics clock time in [us].
ElecClock const & OpticalClock() const noexcept
Borrow a const Optical clock with time set to Trigger time [us].
void ConstructHit(float hitThreshold, int channel, double timeStamp, pmtana::pulse_param const &pulse, std::vector< recob::OpHit > &hitVector, detinfo::DetectorClocksData const &clocksData, calib::IPhotonCalibrator const &calibrator, bool use_start_time)
Contains all timing reference information for the detector.
void RunHitFinder(std::vector< raw::OpDetWaveform > const &opDetWaveformVector, std::vector< recob::OpHit > &hitVector, pmtana::PulseRecoManager const &pulseRecoMgr, pmtana::PMTPulseRecoBase const &threshAlg, geo::GeometryCore const &geometry, float hitThreshold, detinfo::DetectorClocksData const &clocksData, calib::IPhotonCalibrator const &calibrator, bool use_start_time)
Class def header for a class ElecClock.
bool IsValidOpChannel(int opChannel) const
Is this a valid OpChannel number?
Class definition file of PulseRecoManager.