From f94d984b21fad893d34c03544863cdef8ea320ea Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Sun, 20 Sep 2026 14:59:18 +0200 Subject: [PATCH] More VecGeom v2.x compatibility --- Detectors/Base/src/GeometryManager.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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) ==