31 #define BOOST_TEST_MODULE ( cluster_test )
32 #include "boost/test/unit_test.hpp"
48 float sigma_start_wire,
50 float sigma_start_tick,
62 float integral_stddev,
64 float summedADC_stddev,
66 float multiple_hit_density,
75 BOOST_TEST(cluster.
NHits() == n_hits);
78 BOOST_TEST(cluster.
StartWire() == start_wire);
84 BOOST_TEST(cluster.
StartTick() == start_tick);
90 BOOST_TEST(cluster.
EndWire() == end_wire);
96 BOOST_TEST(cluster.
EndTick() == end_tick);
113 (cluster.
TickCoord(recob::Cluster::clStart) == start_tick);
115 (cluster.
TickCoord((
unsigned int) recob::Cluster::clStart) == start_tick);
117 (cluster.
TickCoord(recob::Cluster::clEnd) == end_tick);
119 (cluster.
TickCoord((
unsigned int) recob::Cluster::clEnd) == end_tick);
125 BOOST_TEST(cluster.
StartAngle() == start_angle);
131 BOOST_TEST(cluster.
EndCharge() == end_charge);
134 BOOST_TEST(cluster.
EndAngle() == end_angle);
141 (cluster.
EdgeCharge(recob::Cluster::clStart) == start_charge);
143 (cluster.
EdgeCharge((
unsigned int) recob::Cluster::clStart) == start_charge);
145 (cluster.
EdgeCharge(recob::Cluster::clEnd) == end_charge);
147 (cluster.
EdgeCharge((
unsigned int) recob::Cluster::clEnd) == end_charge);
151 (cluster.
Angle(recob::Cluster::clStart) == start_angle);
153 (cluster.
Angle((
unsigned int) recob::Cluster::clStart) == start_angle);
155 (cluster.
Angle(recob::Cluster::clEnd) == end_angle);
157 (cluster.
Angle((
unsigned int) recob::Cluster::clEnd) == end_angle);
161 (cluster.
OpeningAngle(recob::Cluster::clStart) == start_opening);
163 (cluster.
OpeningAngle((
unsigned int) recob::Cluster::clStart) == start_opening);
165 (cluster.
OpeningAngle(recob::Cluster::clEnd) == end_opening);
167 (cluster.
OpeningAngle((
unsigned int) recob::Cluster::clEnd) == end_opening);
170 BOOST_TEST(cluster.
Integral() == integral);
176 const float integral_average = (n_hits != 0)? integral / n_hits: 0.;
180 BOOST_TEST(cluster.
SummedADC() == summedADC);
186 const float summedADC_average = (n_hits != 0)? summedADC / n_hits: 0.;
200 (cluster.
ChargeStdDev(recob::Cluster::cmFit) == integral_stddev);
202 (cluster.
ChargeStdDev((
unsigned int) recob::Cluster::cmFit) == integral_stddev);
204 (cluster.
ChargeStdDev(recob::Cluster::cmADC) == summedADC_stddev);
206 (cluster.
ChargeStdDev((
unsigned int) recob::Cluster::cmADC) == summedADC_stddev);
210 (cluster.
ChargeAverage(recob::Cluster::cmFit) == integral_average);
212 (cluster.
ChargeAverage((
unsigned int) recob::Cluster::cmFit) == integral_average);
214 (cluster.
ChargeAverage(recob::Cluster::cmADC) == summedADC_average);
216 (cluster.
ChargeAverage((
unsigned int) recob::Cluster::cmADC) == summedADC_average);
222 BOOST_TEST(cluster.
Width() == width);
225 BOOST_TEST(cluster.
ID() == ID);
228 BOOST_TEST(cluster.
View() == view);
231 BOOST_TEST(cluster.
Plane() == plane);
243 const float start_wire = 0.0;
244 const float sigma_start_wire = 0.0;
245 const float start_tick = 0.0;
246 const float sigma_start_tick = 0.0;
247 const float start_charge = 0.0;
248 const float start_angle = 0.0;
249 const float start_opening = 0.0;
250 const float end_wire = 0.0;
251 const float sigma_end_wire = 0.0;
252 const float end_tick = 0.0;
253 const float sigma_end_tick = 0.0;
254 const float end_charge = 0.0;
255 const float end_angle = 0.0;
256 const float end_opening = 0.0;
257 const float integral = 0.0;
258 const float integral_stddev = 0.0;
259 const float summedADC = 0.0;
260 const float summedADC_stddev = 0.0;
261 const unsigned int n_hits = 0;
262 const float multiple_hit_density = 0.0;
263 const float width = 0.0;
296 multiple_hit_density,
311 const float start_wire = 12.5;
312 const float sigma_start_wire = 1.0;
313 const float start_tick = 141.3;
314 const float sigma_start_tick = 0.2;
315 const float start_charge = 45.2;
316 const float start_angle = 1.5;
317 const float start_opening = 0.7;
318 const float end_wire = 223.4;
319 const float sigma_end_wire = 1.0;
320 const float end_tick = 563.2;
321 const float sigma_end_tick = 0.3;
322 const float end_charge = 152.1;
323 const float end_angle = 0.6;
324 const float end_opening = 0.1;
325 const float integral = 4856.7;
326 const float integral_stddev = 4.3;
327 const float summedADC = 4702.4;
328 const float summedADC_stddev = 6.2;
329 const unsigned int n_hits = 210;
330 const float multiple_hit_density = 1.0;
331 const float width = 75.2;
360 multiple_hit_density,
390 multiple_hit_density,
407 const float start_wire = 12.5;
408 const float sigma_start_wire = 1.0;
409 const float start_tick = 141.3;
410 const float sigma_start_tick = 0.2;
411 const float start_charge = 45.2;
412 const float start_angle = 1.5;
413 const float start_opening = 0.7;
414 const float end_wire = 223.4;
415 const float sigma_end_wire = 1.0;
416 const float end_tick = 563.2;
417 const float sigma_end_tick = 0.3;
418 const float end_charge = 152.1;
419 const float end_angle = 0.6;
420 const float end_opening = 0.1;
421 const float integral = 4856.7;
422 const float integral_stddev = 4.3;
423 const float summedADC = 4702.4;
424 const float summedADC_stddev = 6.2;
425 const unsigned int n_hits = 210;
426 const float multiple_hit_density = 1.0;
427 const float width = 75.2;
455 multiple_hit_density,
491 multiple_hit_density,
519 multiple_hit_density,
554 multiple_hit_density,
582 multiple_hit_density,
617 multiple_hit_density,
645 multiple_hit_density,
657 cluster_move = std::move(cluster_copy);
680 multiple_hit_density,
708 multiple_hit_density,
Sums from the fitted hit values.
float SigmaEndTick() const
Returns the uncertainty on tick coordinate of the end of the cluster.
static constexpr ID_t InvalidID
Value for an invalid cluster ID.
float SummedADCaverage() const
Returns the average signal ADC counts of the cluster hits.
float IntegralAverage() const
Returns the average charge of the cluster hits.
float Angle(ClusterEnds_t side) const
Returns the angle at either end of the cluster.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
float TickCoord(ClusterEnds_t side) const
Returns the tick coordinate of one of the end sides of the cluster.
The data type to uniquely identify a Plane.
bool isValid
Whether this ID points to a valid element.
float EdgeCharge(ClusterEnds_t side) const
Returns the charge on the first or last wire of the cluster.
float StartWire() const
Returns the wire coordinate of the start of the cluster.
Set of hits with a 2D structure.
float EndTick() const
Returns the tick coordinate of the end of the cluster.
float MultipleHitDensity() const
Density of wires in the cluster with more than one hit.
geo::PlaneID Plane() const
Returns the plane ID this cluster lies on.
float StartAngle() const
Returns the starting angle of the cluster.
void ClusterTestCustomConstructor()
Sums directly from ADC counts.
static const SentryArgument_t Sentry
An instance of the sentry object.
float SummedADCstdDev() const
Returns the standard deviation of the signal ADC counts of the cluster hits.
float EndCharge() const
Returns the charge on the last wire of the cluster.
void ClusterTestDefaultConstructor()
float SummedADC() const
Returns the total charge of the cluster from signal ADC counts.
float ChargeStdDev(ChargeMode_t mode) const
Returns the standard deviation of charge of the cluster hits.
float StartOpeningAngle() const
Returns the opening angle at the start of the cluster.
Represents the most likely start of the cluster.
float Width() const
A measure of the cluster width, in homogenized units.
float SigmaEndWire() const
Returns the uncertainty on wire coordinate of the end of the cluster.
float IntegralStdDev() const
Returns the standard deviation of the charge of the cluster hits.
float SigmaStartWire() const
Returns the uncertainty on wire coordinate of the start of the cluster.
void CheckCluster(recob::Cluster const &cluster, float start_wire, float sigma_start_wire, float start_tick, float sigma_start_tick, float start_charge, float start_angle, float start_opening, float end_wire, float sigma_end_wire, float end_tick, float sigma_end_tick, float end_charge, float end_angle, float end_opening, float integral, float integral_stddev, float summedADC, float summedADC_stddev, unsigned int n_hits, float multiple_hit_density, float width, recob::Cluster::ID_t ID, geo::View_t view, geo::PlaneID const &plane)
void ClusterTestCopyMoveOperations()
Declaration of cluster object.
float WireCoord(ClusterEnds_t side) const
Returns the wire coordinate of one of the end sides of the cluster.
Definition of data types for geometry description.
float EndOpeningAngle() const
Returns the opening angle at the end of the cluster.
float ChargeAverage(ChargeMode_t mode) const
Returns the average charge of the cluster hits.
geo::View_t View() const
Returns the view for this cluster.
float StartCharge() const
Returns the charge on the first wire of the cluster.
ID_t ID() const
Identifier of this cluster.
float SigmaStartTick() const
Returns the uncertainty on tick coordinate of the start of the cluster.
bool hasPlane() const
Returns whether geometry plane is valid.
float Charge(ChargeMode_t mode) const
Returns the total charge of the cluster.
unsigned int NHits() const
Number of hits in the cluster.
float EndAngle() const
Returns the ending angle of the cluster.
float OpeningAngle(ClusterEnds_t side) const
Returns the opening angle at either end of the cluster.
float StartTick() const
Returns the tick coordinate of the start of the cluster.
int ID_t
Type of cluster ID.
Represents the end, or the alternative start, of the cluster.
float Integral() const
Returns the total charge of the cluster from hit shape.
float EndWire() const
Returns the wire coordinate of the end of the cluster.