30 #define BOOST_TEST_MODULE ( hit_test ) 31 #include "boost/test/unit_test.hpp" 52 float sigma_peak_time,
55 float sigma_peak_amplitude,
58 float hit_sigma_integral,
59 short int multiplicity,
60 short int local_index,
61 float goodness_of_fit,
73 BOOST_TEST(hit.
View() == view);
79 BOOST_TEST(hit.
StartTick() == start_tick);
80 BOOST_TEST(hit.
EndTick() == end_tick);
83 BOOST_TEST(hit.
PeakTime() == peak_time);
92 for (
float shift: { 0.0, 0.5, 1.0, 1.5, 2.0, 2.2 }) {
94 const float time_up = peak_time + shift*
rms;
95 const float time_down = peak_time - shift*
rms;
106 if (time_down == 0.) {
129 BOOST_TEST(hit.
RMS() ==
rms);
132 BOOST_TEST(hit.
SummedADC() == summedADC);
133 BOOST_TEST(hit.
Integral() == hit_integral);
147 BOOST_TEST(hit.
WireID() == wireID);
161 float peak_time = 0.0;
162 float sigma_peak_time = -1.0;
164 float peak_amplitude = 0.0;
165 float sigma_peak_amplitude = -1.0;
166 float summedADC = 0.0;
167 float hit_integral = 0.0;
168 float hit_sigma_integral = -1.0;
169 short int multiplicity = 0;
170 short int local_index = -1;
171 float goodness_of_fit = 0.0;
192 sigma_peak_amplitude,
215 std::vector<float> signal({
216 0.2, 1.2, 1.5, 2.0, 4.7,
217 12.8, 30.7, 85.2, 132.1, 154.7,
218 147.4, 127.0, 86.7, 29.3, 11.8,
219 4.5, 2.2, 1.5, 1.0, 0.3,
223 float peak_time = start_tick + signal.size()/2 + 0.7;
224 float sigma_peak_time = 1.3;
225 float rms = signal.size() / 2.7;
226 float peak_amplitude = signal[signal.size()/2] - 0.3;
227 float sigma_peak_amplitude = 2.3;
229 = std::accumulate(signal.begin(), signal.end(), 0.0);
230 float hit_integral = summedADC * 0.97;
231 float hit_sigma_integral = peak_amplitude / 10.;
232 short int multiplicity = 2;
233 short int local_index = 1;
234 float goodness_of_fit = 0.95;
235 int dof = signal.size() - 3;
253 sigma_peak_amplitude,
275 sigma_peak_amplitude,
short int LocalIndex() const
How well do we believe we know this hit?
geo::SigType_t SignalType() const
Signal type for the plane of the hit.
void CheckHit(recob::Hit const &hit, raw::ChannelID_t channel, raw::TDCtick_t start_tick, raw::TDCtick_t end_tick, float peak_time, float sigma_peak_time, float rms, float peak_amplitude, float sigma_peak_amplitude, float summedADC, float hit_integral, float hit_sigma_integral, short int multiplicity, short int local_index, float goodness_of_fit, int dof, geo::View_t view, geo::SigType_t signal_type, geo::WireID wireID)
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
geo::WireID WireID() const
float RMS() const
RMS of the hit shape, in tick units.
float SigmaPeakAmplitude() const
Uncertainty on estimated amplitude of the hit at its peak, in ADC units.
BOOST_AUTO_TEST_CASE(HitDefaultConstructor)
float SigmaIntegral() const
int DegreesOfFreedom() const
void HitTestCustomConstructors()
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
geo::View_t View() const
View for the plane of the hit.
float GoodnessOfFit() const
Degrees of freedom in the determination of the hit signal shape (-1 by default)
short int Multiplicity() const
How many hits could this one be shared with.
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
int TDCtick_t
Type representing a TDC tick.
float TimeDistanceAsRMS(float time) const
Returns the distance of the specified time from peak, in RMS units.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
enum geo::_plane_sigtype SigType_t
raw::TDCtick_t StartTick() const
Initial tdc tick for hit.
Definition of data types for geometry description.
float PeakTimeMinusRMS(float sigmas=+1.) const
Detector simulation of raw signals on wires.
raw::TDCtick_t EndTick() const
Final tdc tick for hit.
float PeakTime() const
Time of the signal peak, in tick units.
Declaration of signal hit object.
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
2D representation of charge deposited in the TDC/wire plane
float PeakTimePlusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
void HitTestDefaultConstructor()
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Signal from collection planes.