diff --git a/Detectors/Base/src/GeometryManager.cxx b/Detectors/Base/src/GeometryManager.cxx index 3b1dc38f1ac2c..5d6a8def8e7c3 100644 --- a/Detectors/Base/src/GeometryManager.cxx +++ b/Detectors/Base/src/GeometryManager.cxx @@ -586,8 +586,11 @@ void ensureVecGeomWorldBuilt() tgeo2vecgeom::RootGeoManager::Instance().LoadRootGeometry(); // Acceleration structures must be built before the navigators/locators reference them. +#if VECGEOM_VERSION < 0x020000 + // VecGeom 2 has no ABBoxManager: the BVH below is built directly. vecgeom::ABBoxManager::Instance().InitABBoxesForCompleteGeometry(); - // Builds a BVH per logical volume from the ABBoxes computed above. +#endif + // Builds a BVH per logical volume. vecgeom::BVHManager::Init(); // For each logical volume, set both a navigator (used for ComputeStep) and a matched @@ -752,9 +755,15 @@ bool GeometryManager::vecGeomLocate(double x, double y, double z, std::vector= 0x020000 + thread_local vecgeom::NavigationState stateStorage; + thread_local vecgeom::NavigationState* state = &stateStorage; +#else thread_local vecgeom::NavigationState* state = vecgeom::NavigationState::MakeInstance(vecgeom::GeoManager::Instance().getMaxDepth()); +#endif state->Clear(); const vecgeom::Vector3D point(x, y, z); if (vecgeom::GlobalLocator::LocateGlobalPoint(vecgeom::GeoManager::Instance().GetWorld(), point, *state, true) ==