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());
64 auto tvTrf = std::make_shared<Transform3D>(Transform3D::Identity());
66 std::make_shared<CuboidVolumeBounds>(hl * 1.1, hl * 1.1, hl * 1.1);
69 TrackingVolume::create(tvTrf, tvBounds, std::move(boxStore),
70 std::move(volumes), top,
nullptr,
"TheVolume");
72 auto tg = std::make_shared<TrackingGeometry>(tv);
74 return {std::move(volumeCopy), tg};
82 bdata::distribution = std::uniform_real_distribution<>(-5,
86 std::uniform_real_distribution<>(-
M_PI,
M_PI))) ^
89 std::uniform_real_distribution<>(-100, 100))) ^
92 std::uniform_real_distribution<>(-100, 100))) ^
95 std::uniform_real_distribution<>(-100, 100))) ^
98 using namespace Acts::UnitLiterals;
102 double theta = 2 * std::atan(std::exp(-
eta));
109 std::vector<SurfaceIntersection>
hits;
110 for (
const auto& vol : volumes) {
111 const auto& absVol =
dynamic_cast<const AbstractVolume&
>(*vol);
112 auto bndSurfaces = absVol.boundarySurfaces();
114 for (
const auto& bndSrf : bndSurfaces) {
115 const auto& srf = bndSrf->surfaceRepresentation();
116 auto sri = srf.intersect(
tgContext, ray.origin(), ray.dir(),
true);
119 hits.push_back(std::move(sri));
125 std::sort(
hits.begin(),
hits.end());
126 std::vector<const Surface*> expHits;
127 expHits.reserve(
hits.size());
128 for (
const auto& hit :
hits) {
129 expHits.push_back(hit.object);
134 using Stepper = StraightLineStepper;
135 using PropagatorType = Propagator<Stepper, Navigator>;
139 PropagatorType propagator(std::move(
stepper), navigator);
148 options.
debug =
false;
155 ray.dir() *
mom, +1, 0.);
157 const auto result = propagator.propagate(startPar, options).value();
159 const auto debugString =
160 result.template get<DebugOutput::result_type>().debugString;
163 std::cout << debugString << std::endl;
167 std::vector<const Surface*> actHits;
168 auto steppingResults =
169 result.template get<SteppingLogger::result_type>().
steps;
170 for (
const auto&
step : steppingResults) {
175 auto sensitiveID =
step.surface->geoID().sensitive();
176 if (sensitiveID != 0) {
177 actHits.push_back(
step.surface.get());
181 BOOST_CHECK_EQUAL(expHits.size(), actHits.size());
182 for (
size_t i = 0; i < expHits.size(); i++) {
183 const Surface* exp = expHits[i];
184 const Surface* act = actHits[i];
186 BOOST_CHECK_EQUAL(exp, act);
187 BOOST_CHECK_EQUAL(exp->geoID(), act->geoID());