diff --git a/DDCore/include/DD4hep/CartesianGridXY.h b/DDCore/include/DD4hep/CartesianGridXY.h index 7f4854278634944b17f72f5f74b3193990061740..34b2b59b9efce185e017b1a92fbca4d82a270e97 100644 --- a/DDCore/include/DD4hep/CartesianGridXY.h +++ b/DDCore/include/DD4hep/CartesianGridXY.h @@ -15,7 +15,7 @@ #define DD4HEP_DDCORE_CARTESIANGRIDXY_H 1 // Framework include files -#include "DD4hep/Segmentations.h" +#include "DD4hep/Objects.h" /// Namespace for the AIDA detector description toolkit namespace DD4hep { @@ -26,6 +26,9 @@ namespace DD4hep { /// Namespace for the geometry part of the AIDA detector description toolkit namespace Geometry { + // Forward declarations + class Segmentation; + /// Implementation class for the grid XY segmentation. /** * \author M.Frank diff --git a/DDCore/src/CartesianGridXY.cpp b/DDCore/src/CartesianGridXY.cpp index cf9ade5ef3625a33927426df47aefafd19658822..0222d229ed86dc1a8a9936b6758e9635a827f390 100644 --- a/DDCore/src/CartesianGridXY.cpp +++ b/DDCore/src/CartesianGridXY.cpp @@ -12,7 +12,6 @@ //========================================================================== // Framework include files -#include "DD4hep/Handle.inl" #include "DD4hep/Segmentations.h" #include "DD4hep/CartesianGridXY.h" #include "DDSegmentation/CartesianGridXY.h" @@ -20,12 +19,8 @@ // C/C++ include files using namespace std; -using namespace DD4hep; using namespace DD4hep::Geometry; -/// Instantiate handle functions -DD4HEP_INSTANTIATE_HANDLE_UNNAMED(CartesianGridXY::Object); - /// Copy Constructor from segmentation base object CartesianGridXY::CartesianGridXY(const Segmentation& e) : Handle<Object>() { @@ -38,9 +33,9 @@ Position CartesianGridXY::position(const CellID& id) const { } /// determine the cell ID based on the position -CellID CartesianGridXY::cellID(const Position& local, - const Position& global, - const VolumeID& volID) const +DD4hep::CellID CartesianGridXY::cellID(const Position& local, + const Position& global, + const VolumeID& volID) const { return access()->cellID(local, global, volID); } diff --git a/DDCore/src/Segmentations.cpp b/DDCore/src/Segmentations.cpp index dc2525f286b516d66486b0cc35bf6e43e51492b5..2398c75e69cb7378d936c8558bfa1b3eb0849988 100644 --- a/DDCore/src/Segmentations.cpp +++ b/DDCore/src/Segmentations.cpp @@ -15,8 +15,8 @@ // Framework include files #include "DD4hep/Segmentations.h" #include "DD4hep/InstanceCount.h" -#include "DD4hep/Handle.inl" #include "DD4hep/Printout.h" +#include "DD4hep/Handle.inl" // C/C++ include files #include <iostream> @@ -172,6 +172,7 @@ namespace DD4hep { } /* End namespace DD4hep */ #define IMPLEMENT_SEGMENTATION_HANDLE(X) \ + DD4HEP_INSTANTIATE_HANDLE_UNNAMED(DDSegmentation::X); \ namespace DD4hep { namespace Geometry { \ template DDSegmentation::X* \ Segmentation::get<DDSegmentation::X>(const Object* obj); }}