20 std::vector< recob::OpHit >& hitVector,
26 std::vector< double >
const& SPESize,
28 std::vector< double >
const& SPEShiftPerChan ) {
30 for (
auto const& waveform : opDetWaveformVector) {
32 const int channel =
static_cast< int >(waveform.ChannelNumber());
35 mf::LogError(
"OpHitFinder") <<
"Error! unrecognized channel number " 36 << channel <<
". Ignoring pulse";
43 auto const& pulses = threshAlg.
GetPulses();
45 const double timeStamp = waveform.TimeStamp();
48 for (
auto const& pulse : pulses)
57 SPEShiftPerChan.at(channel) );
66 std::vector< recob::OpHit >& hitVector,
72 std::vector< double >
const& SPESize,
76 std::vector< double > noSPEShift(geometry.
NOpChannels() , 0. );
98 std::vector< recob::OpHit >& hitVector,
101 if (pulse.
peak < hitThreshold)
return;
103 double absTime = timeStamp
106 double relTime = absTime - detectorClocks.
TriggerTime();
111 if (areaToPE) PE = pulse.
area/SPESize + SPEShift;
112 else PE = pulse.
peak/SPESize + SPEShift;
117 hitVector.emplace_back(channel,
virtual double TriggerTime() const =0
Harware trigger time (in electronics time frame) [µs].
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int NOpChannels() const
Number of electronics channels for all the optical detectors.
int Frame() const
Returns the number of the frame containing the clock current time.
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.
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::DetectorClocks const &detectorClocks, std::vector< double > const &SPESize, bool areaToPE, std::vector< double > const &SPEShiftPerChan)
Description of geometry of one entire detector.
Conversion of times between different formats and references.
void ConstructHit(float hitThreshold, int channel, double timeStamp, pmtana::pulse_param const &pulse, detinfo::DetectorClocks const &detectorClocks, double SPESize, bool areaToPE, std::vector< recob::OpHit > &hitVector, double SPEShift=0.)
double TickPeriod() const
A single tick period in microseconds.
virtual const detinfo::ElecClock & OpticalClock() const =0
Lends a constant optical clock with time set to trigger time.
bool IsValidOpChannel(int opChannel) const
Is this a valid OpChannel number?