9 #include <boost/test/unit_test.hpp>
22 using namespace ActsExamples;
23 using namespace Acts::Test;
28 std::uniform_int_distribution<uint64_t> distIds(
29 1, std::numeric_limits<uint64_t>::max());
30 std::uniform_int_distribution<int32_t> distIndex(1, 20);
33 for (
auto i = 0ul;
i < nSimHits; ++
i) {
43 simhits.insert(
SimHit(geoid, pid, pos4, before4, after4,
index));
49 BOOST_AUTO_TEST_SUITE(RootSimHitReaderWriter)
63 writerConfig.
filePath =
"./testhits.root";
71 readWriteTool.write(writer, 11);
73 std::get<0>(readWriteTool.tuple) = simhits2;
74 readWriteTool.write(writer, 22);
83 readerConfig.
filePath =
"./testhits.root";
87 const auto [hitsRead2] = readWriteTool.read(reader, 22);
88 const auto [hitsRead1] = readWriteTool.read(reader, 11);
95 auto check = [](
const auto &testhits,
const auto &refhits,
auto tol) {
96 BOOST_CHECK(testhits.size() == refhits.size());
103 BOOST_CHECK(
ref.geometryId() ==
test.geometryId());
104 BOOST_CHECK(
ref.particleId() ==
test.particleId());
105 BOOST_CHECK(
ref.index() ==
test.index());
109 check(hitsRead1, simhits1, 1.
e-6);
110 check(hitsRead2, simhits2, 1.
e-6);
113 BOOST_AUTO_TEST_SUITE_END()