Performs the actual test.
121 auto const& expectedSpacePoints
122 = *(
event.getValidHandle<std::vector<recob::SpacePoint>>(
pointsTag));
124 auto const& expectedCharges
125 = *(
event.getValidHandle<std::vector<recob::PointCharge>>(
pointsTag));
127 mf::LogInfo(
"ProxyTest")
128 <<
"Starting test on " << expectedSpacePoints.size() <<
" points and "
129 << expectedCharges.size() <<
" charges from '"
133 assert(expectedSpacePoints.size() == expectedCharges.size());
139 BOOST_TEST(points.empty() == expectedSpacePoints.empty());
140 BOOST_TEST(points.size() == expectedSpacePoints.size());
142 decltype(
auto) spacePoints = points.spacePoints();
144 (
std::addressof(spacePoints) ==
std::addressof(expectedSpacePoints));
145 BOOST_TEST(spacePoints.
size() == expectedSpacePoints.
size());
147 decltype(auto) charges = points.charges();
148 BOOST_TEST(
std::addressof(charges) ==
std::addressof(expectedCharges));
149 BOOST_TEST(charges.size() == expectedCharges.size());
151 std::
size_t iExpectedPoint = 0;
152 for (auto pointProxy: points) {
153 auto const& expectedSpacePoint = expectedSpacePoints[iExpectedPoint];
154 auto const& expectedChargeInfo = expectedCharges[iExpectedPoint];
159 (std::addressof(spacePointRef) == std::addressof(expectedSpacePoint));
161 (std::addressof(pointProxy.point()) == std::addressof(expectedSpacePoint));
163 BOOST_TEST(pointProxy.ID() == expectedSpacePoint.ID());
164 BOOST_TEST(pointProxy.hasCharge() == expectedChargeInfo.hasCharge());
165 BOOST_TEST(pointProxy.charge() == expectedChargeInfo.charge());
167 decltype(
auto) chargeInfo = pointProxy.
get<recob::PointCharge>();
169 std::is_lvalue_reference<decltype(chargeInfo)>(),
170 "Copy of parallel data
element!"
173 (
std::addressof(chargeInfo) ==
std::addressof(expectedChargeInfo));
177 BOOST_TEST(iExpectedPoint == expectedSpacePoints.size());
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
auto getChargedSpacePoints(Event const &event, art::InputTag inputTag, Args &&...withArgs)
Creates and returns a proxy to space points with associated charge.
std::size_t size(FixedBins< T, C > const &) noexcept
art::InputTag pointsTag
Tag for the input.
for($it=0;$it< $RaceTrack_number;$it++)
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
Charge reconstructed in the active volume.