16 std::tuple<std::vector<const Volume*>, std::shared_ptr<TrackingGeometry>>
20 std::shared_ptr<CuboidVolumeBounds> vbds =
21 std::make_shared<CuboidVolumeBounds>(10, 10, 10);
26 double step = (max -
min) /
double(
n);
27 std::vector<std::unique_ptr<const Volume>> volumes;
28 std::vector<std::unique_ptr<Box>> boxStore;
29 boxStore.reserve((
n + 1) * (
n + 1) * (
n + 1));
31 std::cout <<
"generating: " << (
n + 1) * (
n + 1) * (
n + 1)
32 <<
" bounding boxes" << std::endl;
34 std::vector<Box*> boxes;
35 boxes.reserve(boxStore.size());
37 for (
size_t i = 0; i <=
n; i++) {
38 for (
size_t j = 0; j <=
n; j++) {
39 for (
size_t k = 0;
k <=
n;
k++) {
40 Vector3D pos(min + i * step, min + j * step, min +
k * step);
43 auto vol = std::make_unique<AbstractVolume>(trf, vbds);
45 volumes.push_back(std::move(vol));
47 std::make_unique<Box>(volumes.back()->boundingBox()));
48 boxes.push_back(boxStore.back().get());
57 std::vector<const Volume*> volumeCopy;
58 volumeCopy.reserve(volumes.size());
59 for (
auto& vol : volumes) {
60 volumeCopy.push_back(vol.get());
65 std::make_shared<CuboidVolumeBounds>(hl * 1.1, hl * 1.1, hl * 1.1);
67 auto tv = TrackingVolume::create(Transform3D::Identity(), tvBounds,
68 std::move(boxStore), std::move(volumes), top,
69 nullptr,
"TheVolume");
71 auto tg = std::make_shared<TrackingGeometry>(tv);
73 return {std::move(volumeCopy), tg};
80 bdata::random((bdata::seed = 7,
bdata::engine = std::mt19937(),
81 bdata::distribution = std::uniform_real_distribution<>(-5,
83 bdata::random((bdata::seed = 2,
bdata::engine = std::mt19937(),
85 std::uniform_real_distribution<>(-
M_PI,
M_PI))) ^
86 bdata::random((bdata::seed = 3,
bdata::engine = std::mt19937(),
88 std::uniform_real_distribution<>(-100, 100))) ^
89 bdata::random((bdata::seed = 4,
bdata::engine = std::mt19937(),
91 std::uniform_real_distribution<>(-100, 100))) ^
92 bdata::random((bdata::seed = 5,
bdata::engine = std::mt19937(),
94 std::uniform_real_distribution<>(-100, 100))) ^
97 using namespace Acts::UnitLiterals;
101 double theta = 2 * std::atan(std::exp(-
eta));
108 std::vector<SurfaceIntersection> hits;
109 for (
const auto& vol : volumes) {
110 const auto& absVol =
dynamic_cast<const AbstractVolume&
>(*vol);
111 auto bndSurfaces = absVol.boundarySurfaces();
113 for (
const auto& bndSrf : bndSurfaces) {
114 const auto& srf = bndSrf->surfaceRepresentation();
115 auto sri = srf.intersect(
tgContext, ray.origin(), ray.dir(),
true);
118 hits.push_back(std::move(sri));
124 std::sort(hits.begin(), hits.end());
125 std::vector<const Surface*> expHits;
126 expHits.reserve(hits.size());
127 for (
const auto& hit : hits) {
128 expHits.push_back(hit.object);
133 using Stepper = StraightLineStepper;
134 using PropagatorType = Propagator<Stepper, Navigator>;
138 PropagatorType propagator(std::move(
stepper), navigator);
153 const auto result = propagator.propagate(startPar, options).value();
156 std::vector<const Surface*> actHits;
157 auto steppingResults =
158 result.template get<SteppingLogger::result_type>().
steps;
159 for (
const auto&
step : steppingResults) {
164 auto sensitiveID =
step.surface->geometryId().sensitive();
165 if (sensitiveID != 0) {
166 actHits.push_back(
step.surface.get());
170 BOOST_CHECK_EQUAL(expHits.size(), actHits.size());
171 for (
size_t i = 0; i < expHits.size(); i++) {
172 const Surface* exp = expHits[i];
173 const Surface* act = actHits[i];
175 BOOST_CHECK_EQUAL(exp, act);
176 BOOST_CHECK_EQUAL(exp->geometryId(), act->geometryId());