From b087caef931cb4a0c9aecd3fa9b45f348dfe3737 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 27 Oct 2023 10:54:18 -0400 Subject: [PATCH] Move DECLARE_SEGMENTATIONs for CartesianGridXYStaggered and HexGrid to ReadoutSegmentations This fixes runtime errors like: libc++abi: __cxa_guard_acquire detected recursive initialization --- DDCore/src/plugins/ReadoutSegmentations.cpp | 6 ++++++ DDCore/src/segmentations/CartesianGridXYStaggered.cpp | 4 ---- DDCore/src/segmentations/HexGrid.cpp | 2 -- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DDCore/src/plugins/ReadoutSegmentations.cpp b/DDCore/src/plugins/ReadoutSegmentations.cpp index 7462e7d93..578c3bfbb 100644 --- a/DDCore/src/plugins/ReadoutSegmentations.cpp +++ b/DDCore/src/plugins/ReadoutSegmentations.cpp @@ -40,6 +40,9 @@ DECLARE_SEGMENTATION(CartesianGridYZ,create_segmentation) +#include "DDSegmentation/CartesianGridXYStaggered.h" +DECLARE_SEGMENTATION(CartesianGridXYStaggered,dd4hep::create_segmentation) + #include "DDSegmentation/CartesianStripX.h" DECLARE_SEGMENTATION(CartesianStripX,create_segmentation) @@ -75,3 +78,6 @@ DECLARE_SEGMENTATION(ProjectiveCylinder,create_segmentation) + +#include "DDSegmentation/HexGrid.h" +DECLARE_SEGMENTATION(HexGrid,create_segmentation) diff --git a/DDCore/src/segmentations/CartesianGridXYStaggered.cpp b/DDCore/src/segmentations/CartesianGridXYStaggered.cpp index 871958ffe..69cf77236 100644 --- a/DDCore/src/segmentations/CartesianGridXYStaggered.cpp +++ b/DDCore/src/segmentations/CartesianGridXYStaggered.cpp @@ -96,7 +96,3 @@ std::vector CartesianGridXYStaggered::cellDimensions(const CellID& cellI } /* namespace DDSegmentation */ } /* namespace dd4hep */ - -// This is done DDCore/src/plugins/ReadoutSegmentations.cpp so the plugin is not part of libDDCore -// needs also #include "DD4hep/Factories.h" -// DECLARE_SEGMENTATION(CartesianGridXYStaggered,dd4hep::create_segmentation) diff --git a/DDCore/src/segmentations/HexGrid.cpp b/DDCore/src/segmentations/HexGrid.cpp index f051a8f61..0e9224e52 100644 --- a/DDCore/src/segmentations/HexGrid.cpp +++ b/DDCore/src/segmentations/HexGrid.cpp @@ -145,5 +145,3 @@ namespace dd4hep { } /* namespace DDSegmentation */ } /* namespace dd4hep */ - -DECLARE_SEGMENTATION(HexGrid, create_segmentation)