From b434e4d15a2692b3ffe01199acba5e32c3aa739a Mon Sep 17 00:00:00 2001 From: Markus Frank <Markus.Frank@cern.ch> Date: Thu, 20 Oct 2016 13:10:42 +0200 Subject: [PATCH] Seperate internal/external implementation of segmentations. Remove some ID tags - do no longer make sense in git. --- DDCore/CMakeLists.txt | 9 +- DDCore/include/DD4hep/AlignmentData.h | 1 - DDCore/include/DD4hep/AlignmentTools.h | 1 - DDCore/include/DD4hep/Alignments.h | 1 - DDCore/include/DD4hep/BasicGrammar.h | 1 - DDCore/include/DD4hep/BasicGrammar_inl.h | 1 - DDCore/include/DD4hep/Callback.h | 5 +- DDCore/include/DD4hep/CartesianGridXY.h | 6 +- DDCore/include/DD4hep/CartesianGridXYZ.h | 4 +- DDCore/include/DD4hep/CartesianGridXZ.h | 4 +- DDCore/include/DD4hep/CartesianGridYZ.h | 4 +- DDCore/include/DD4hep/ComponentProperties.h | 1 - .../include/DD4hep/ComponentProperties_inl.h | 1 - DDCore/include/DD4hep/ConditionDerived.h | 1 - DDCore/include/DD4hep/ConditionTypes.h | 1 - DDCore/include/DD4hep/Conditions.h | 1 - DDCore/include/DD4hep/ConditionsData.h | 1 - DDCore/include/DD4hep/DD4hepRootPersistency.h | 1 - DDCore/include/DD4hep/DD4hepUnits.h | 1 - DDCore/include/DD4hep/DetAlign.h | 1 - DDCore/include/DD4hep/DetConditions.h | 1 - DDCore/include/DD4hep/DetFactoryHelper.h | 2 +- DDCore/include/DD4hep/DetType.h | 1 - DDCore/include/DD4hep/Detector.h | 1 - DDCore/include/DD4hep/DetectorSelector.h | 1 - DDCore/include/DD4hep/DetectorTools.h | 1 - DDCore/include/DD4hep/Dictionary.h | 4 +- DDCore/include/DD4hep/Errors.h | 2 +- DDCore/include/DD4hep/Exceptions.h | 1 - DDCore/include/DD4hep/Factories.h | 3 +- DDCore/include/DD4hep/FieldTypes.h | 1 - DDCore/include/DD4hep/Fields.h | 1 - DDCore/include/DD4hep/GeoHandler.h | 1 - DDCore/include/DD4hep/GlobalAlignment.h | 1 - DDCore/include/DD4hep/Handle.h | 1 - DDCore/include/DD4hep/Handle.inl | 1 - DDCore/include/DD4hep/IDDescriptor.h | 11 +- DDCore/include/DD4hep/IOV.h | 1 - DDCore/include/DD4hep/InstanceCount.h | 1 - DDCore/include/DD4hep/LCDD.h | 1 - DDCore/include/DD4hep/LCDDData.h | 1 - DDCore/include/DD4hep/LCDDHelper.h | 1 - DDCore/include/DD4hep/LCDDLoad.h | 1 - DDCore/include/DD4hep/MatrixHelpers.h | 41 +++-- DDCore/include/DD4hep/Memory.h | 1 - DDCore/include/DD4hep/Mutex.h | 1 - DDCore/include/DD4hep/NamedObject.h | 1 - DDCore/include/DD4hep/ObjectExtensions.h | 1 - DDCore/include/DD4hep/Objects.h | 2 - DDCore/include/DD4hep/OpaqueData.h | 1 - DDCore/include/DD4hep/Operators.h | 1 - DDCore/include/DD4hep/Parsers.h | 1 - DDCore/include/DD4hep/Path.h | 1 - DDCore/include/DD4hep/PluginCreators.h | 2 +- DDCore/include/DD4hep/Plugins.h | 1 - DDCore/include/DD4hep/Plugins.inl | 1 - DDCore/include/DD4hep/PolarGridRPhi.h | 3 +- DDCore/include/DD4hep/PolarGridRPhi2.h | 3 +- DDCore/include/DD4hep/Printout.h | 1 - DDCore/include/DD4hep/Readout.h | 1 - DDCore/include/DD4hep/Segmentations.h | 114 ++------------ DDCore/include/DD4hep/Shapes.h | 1 - DDCore/include/DD4hep/SurfaceInstaller.h | 1 - DDCore/include/DD4hep/ToStream.h | 1 - DDCore/include/DD4hep/VolumeManager.h | 1 - DDCore/include/DD4hep/Volumes.h | 1 - DDCore/include/DD4hep/WaferGridXY.h | 3 +- DDCore/include/DD4hep/config.h | 1 - .../DD4hep/objects/AlignmentsInterna.h | 1 - .../DD4hep/objects/ConditionsInterna.h | 1 - .../include/DD4hep/objects/DetectorInterna.h | 1 - .../include/DD4hep/objects/ObjectsInterna.h | 4 +- .../include/DD4hep/objects/OpaqueData_inl.h | 1 - .../DD4hep/objects/VolumeManagerInterna.h | 1 - DDCore/src/CartesianGridXY.cpp | 2 +- DDCore/src/CartesianGridXYZ.cpp | 2 +- DDCore/src/CartesianGridXZ.cpp | 2 +- DDCore/src/CartesianGridYZ.cpp | 2 +- DDCore/src/ObjectsInterna.cpp | 1 + DDCore/src/PolarGridRPhi.cpp | 2 +- DDCore/src/PolarGridRPhi2.cpp | 2 +- DDCore/src/Readout.cpp | 1 + DDCore/src/Segmentations.cpp | 147 ++++-------------- DDCore/src/WaferGridXY.cpp | 2 +- DDCore/src/World.cpp | 1 - DDCore/src/plugins/Compact2Objects.cpp | 1 + DDCore/src/plugins/LCDDSegmentations.cpp | 53 +++---- DDRec/src/IDDecoder.cpp | 6 +- .../DDSegmentation/MultiSegmentation.h | 46 +++--- .../include/DDSegmentation/Segmentation.h | 3 - DDSegmentation/src/Segmentation.cpp | 4 +- 91 files changed, 158 insertions(+), 400 deletions(-) diff --git a/DDCore/CMakeLists.txt b/DDCore/CMakeLists.txt index c5796fffa..5d4e85b3d 100644 --- a/DDCore/CMakeLists.txt +++ b/DDCore/CMakeLists.txt @@ -33,13 +33,18 @@ dd4hep_add_dictionary( G__DD4hep include/XML/tinystring.h LINKDEF include/ROOT/LinkDef.h ) +dd4hep_add_package_library ( DDParsers + INCLUDE_DIRS + LINK_LIBRARIES + OPTIONAL [BOOST SOURCES src/parsers/*.cpp] + ) + #---Generate DDCore Library------------------------------------------------------- dd4hep_add_package_library ( DDCore SOURCES src/*.cpp src/Evaluator/*.cpp src/XML/*.cpp GENERATED G__DD4hep.cxx INCLUDE_DIRS ${GaudiPluginService_INCLUDE_DIRS} - LINK_LIBRARIES ${GaudiPluginService_LIBRARIES} - OPTIONAL [BOOST SOURCES src/parsers/*.cpp] + LINK_LIBRARIES DDParsers ${GaudiPluginService_LIBRARIES} ) # Generate DDCore plugins--------------------------------------------------------- diff --git a/DDCore/include/DD4hep/AlignmentData.h b/DDCore/include/DD4hep/AlignmentData.h index a8e762fce..c1d131b4a 100644 --- a/DDCore/include/DD4hep/AlignmentData.h +++ b/DDCore/include/DD4hep/AlignmentData.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/AlignmentTools.h b/DDCore/include/DD4hep/AlignmentTools.h index 84eb94a9b..729bf2700 100644 --- a/DDCore/include/DD4hep/AlignmentTools.h +++ b/DDCore/include/DD4hep/AlignmentTools.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Alignments.h b/DDCore/include/DD4hep/Alignments.h index 13950dea1..e1c4f4f88 100644 --- a/DDCore/include/DD4hep/Alignments.h +++ b/DDCore/include/DD4hep/Alignments.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/BasicGrammar.h b/DDCore/include/DD4hep/BasicGrammar.h index 20bec995c..5bb5ce101 100644 --- a/DDCore/include/DD4hep/BasicGrammar.h +++ b/DDCore/include/DD4hep/BasicGrammar.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/BasicGrammar_inl.h b/DDCore/include/DD4hep/BasicGrammar_inl.h index e6d2fd580..2080a968c 100644 --- a/DDCore/include/DD4hep/BasicGrammar_inl.h +++ b/DDCore/include/DD4hep/BasicGrammar_inl.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Callback.h b/DDCore/include/DD4hep/Callback.h index eba5ad3db..299c3f572 100644 --- a/DDCore/include/DD4hep/Callback.h +++ b/DDCore/include/DD4hep/Callback.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -19,9 +18,7 @@ #include <typeinfo> #include <vector> -/* - * DD4hep namespace declaration - */ +/// Namespace for the AIDA detector description toolkit namespace DD4hep { diff --git a/DDCore/include/DD4hep/CartesianGridXY.h b/DDCore/include/DD4hep/CartesianGridXY.h index c29e507b9..1efcffea4 100644 --- a/DDCore/include/DD4hep/CartesianGridXY.h +++ b/DDCore/include/DD4hep/CartesianGridXY.h @@ -1,3 +1,4 @@ +//========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) @@ -15,7 +16,7 @@ #define DD4HEP_DDCORE_CARTESIANGRIDXY_H 1 // Framework include files -#include "DD4hep/Objects.h" +#include "DD4hep/Segmentations.h" /// Namespace for the AIDA detector description toolkit namespace DD4hep { @@ -28,7 +29,8 @@ namespace DD4hep { // Forward declarations class Segmentation; - + template <typename T> class SegmentationWrapper; + /// We need some abbreviation to make the code more readable. typedef Handle<SegmentationWrapper<DDSegmentation::CartesianGridXY> > CartesianGridXYHandle; diff --git a/DDCore/include/DD4hep/CartesianGridXYZ.h b/DDCore/include/DD4hep/CartesianGridXYZ.h index 1d53c9e46..695318416 100644 --- a/DDCore/include/DD4hep/CartesianGridXYZ.h +++ b/DDCore/include/DD4hep/CartesianGridXYZ.h @@ -1,3 +1,4 @@ +//========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) @@ -15,7 +16,7 @@ #define DD4HEP_DDCORE_CARTESIANGRIDXYZ_H 1 // Framework include files -#include "DD4hep/Objects.h" +#include "DD4hep/Segmentations.h" /// Namespace for the AIDA detector description toolkit namespace DD4hep { @@ -28,6 +29,7 @@ namespace DD4hep { // Forward declarations class Segmentation; + template <typename T> class SegmentationWrapper; /// We need some abbreviation to make the code more readable. typedef Handle<SegmentationWrapper<DDSegmentation::CartesianGridXYZ> > CartesianGridXYZHandle; diff --git a/DDCore/include/DD4hep/CartesianGridXZ.h b/DDCore/include/DD4hep/CartesianGridXZ.h index e86f5828e..df9de6813 100644 --- a/DDCore/include/DD4hep/CartesianGridXZ.h +++ b/DDCore/include/DD4hep/CartesianGridXZ.h @@ -1,3 +1,4 @@ +//========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) @@ -15,7 +16,7 @@ #define DD4HEP_DDCORE_CARTESIANGRIDXZ_H 1 // Framework include files -#include "DD4hep/Objects.h" +#include "DD4hep/Segmentations.h" /// Namespace for the AIDA detector description toolkit namespace DD4hep { @@ -28,6 +29,7 @@ namespace DD4hep { // Forward declarations class Segmentation; + template <typename T> class SegmentationWrapper; /// We need some abbreviation to make the code more readable. typedef Handle<SegmentationWrapper<DDSegmentation::CartesianGridXZ> > CartesianGridXZHandle; diff --git a/DDCore/include/DD4hep/CartesianGridYZ.h b/DDCore/include/DD4hep/CartesianGridYZ.h index 04f46915e..61c4727fd 100644 --- a/DDCore/include/DD4hep/CartesianGridYZ.h +++ b/DDCore/include/DD4hep/CartesianGridYZ.h @@ -1,3 +1,4 @@ +//========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) @@ -15,7 +16,7 @@ #define DD4HEP_DDCORE_CARTESIANGRIDYZ_H 1 // Framework include files -#include "DD4hep/Objects.h" +#include "DD4hep/Segmentations.h" /// Namespace for the AIDA detector description toolkit namespace DD4hep { @@ -28,6 +29,7 @@ namespace DD4hep { // Forward declarations class Segmentation; + template <typename T> class SegmentationWrapper; /// We need some abbreviation to make the code more readable. typedef Handle<SegmentationWrapper<DDSegmentation::CartesianGridYZ> > CartesianGridYZHandle; diff --git a/DDCore/include/DD4hep/ComponentProperties.h b/DDCore/include/DD4hep/ComponentProperties.h index 8640787ac..054550672 100644 --- a/DDCore/include/DD4hep/ComponentProperties.h +++ b/DDCore/include/DD4hep/ComponentProperties.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/ComponentProperties_inl.h b/DDCore/include/DD4hep/ComponentProperties_inl.h index c918c5842..2a55b02de 100644 --- a/DDCore/include/DD4hep/ComponentProperties_inl.h +++ b/DDCore/include/DD4hep/ComponentProperties_inl.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/ConditionDerived.h b/DDCore/include/DD4hep/ConditionDerived.h index fb47115a3..e640f24d9 100644 --- a/DDCore/include/DD4hep/ConditionDerived.h +++ b/DDCore/include/DD4hep/ConditionDerived.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/ConditionTypes.h b/DDCore/include/DD4hep/ConditionTypes.h index e67a7a0f9..22118b2f0 100644 --- a/DDCore/include/DD4hep/ConditionTypes.h +++ b/DDCore/include/DD4hep/ConditionTypes.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Conditions.h b/DDCore/include/DD4hep/Conditions.h index 1f9ce3e55..74d962fc5 100644 --- a/DDCore/include/DD4hep/Conditions.h +++ b/DDCore/include/DD4hep/Conditions.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/ConditionsData.h b/DDCore/include/DD4hep/ConditionsData.h index 9d626f795..720409964 100644 --- a/DDCore/include/DD4hep/ConditionsData.h +++ b/DDCore/include/DD4hep/ConditionsData.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/DD4hepRootPersistency.h b/DDCore/include/DD4hep/DD4hepRootPersistency.h index 7467bcfa3..a0907e3fc 100644 --- a/DDCore/include/DD4hep/DD4hepRootPersistency.h +++ b/DDCore/include/DD4hep/DD4hepRootPersistency.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/DD4hepUnits.h b/DDCore/include/DD4hep/DD4hepUnits.h index e78e70f51..d6b8a2503 100644 --- a/DDCore/include/DD4hep/DD4hepUnits.h +++ b/DDCore/include/DD4hep/DD4hepUnits.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/DetAlign.h b/DDCore/include/DD4hep/DetAlign.h index 3a3b6ccd7..3bec3f220 100644 --- a/DDCore/include/DD4hep/DetAlign.h +++ b/DDCore/include/DD4hep/DetAlign.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/DetConditions.h b/DDCore/include/DD4hep/DetConditions.h index 3184e9ce0..9f0d40ddf 100644 --- a/DDCore/include/DD4hep/DetConditions.h +++ b/DDCore/include/DD4hep/DetConditions.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/DetFactoryHelper.h b/DDCore/include/DD4hep/DetFactoryHelper.h index 08b2c771a..f08a3c199 100644 --- a/DDCore/include/DD4hep/DetFactoryHelper.h +++ b/DDCore/include/DD4hep/DetFactoryHelper.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -14,6 +13,7 @@ #ifndef DD4hep_DETECTOR_DETFACTORYHELPER_H #define DD4hep_DETECTOR_DETFACTORYHELPER_H +// Framework include files #include "XML/XMLDetector.h" #include "XML/XMLChildValue.h" #include "DD4hep/LCDD.h" diff --git a/DDCore/include/DD4hep/DetType.h b/DDCore/include/DD4hep/DetType.h index 8304c15ca..fae95081c 100644 --- a/DDCore/include/DD4hep/DetType.h +++ b/DDCore/include/DD4hep/DetType.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Detector.h b/DDCore/include/DD4hep/Detector.h index b718484c1..b2208a652 100644 --- a/DDCore/include/DD4hep/Detector.h +++ b/DDCore/include/DD4hep/Detector.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/DetectorSelector.h b/DDCore/include/DD4hep/DetectorSelector.h index e8d9221d0..221838f04 100644 --- a/DDCore/include/DD4hep/DetectorSelector.h +++ b/DDCore/include/DD4hep/DetectorSelector.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/DetectorTools.h b/DDCore/include/DD4hep/DetectorTools.h index 9de15fe7d..ef78b4893 100644 --- a/DDCore/include/DD4hep/DetectorTools.h +++ b/DDCore/include/DD4hep/DetectorTools.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Dictionary.h b/DDCore/include/DD4hep/Dictionary.h index 1317d3878..4bdb71898 100644 --- a/DDCore/include/DD4hep/Dictionary.h +++ b/DDCore/include/DD4hep/Dictionary.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -25,7 +24,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated" #pragma GCC diagnostic ignored "-Wunused" #endif - +// Framework include files #include "XML/Evaluator.h" #include "DD4hep/DetAlign.h" #include "DD4hep/DD4hepRootPersistency.h" @@ -41,6 +40,7 @@ #include "DD4hep/Conditions.h" #include "DD4hep/FieldTypes.h" +// C/C++ include files #include <vector> #include <map> #include <string> diff --git a/DDCore/include/DD4hep/Errors.h b/DDCore/include/DD4hep/Errors.h index c5efa43d7..13db5aac9 100644 --- a/DDCore/include/DD4hep/Errors.h +++ b/DDCore/include/DD4hep/Errors.h @@ -1,3 +1,4 @@ +//========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) @@ -11,7 +12,6 @@ // \version 1.0 // //========================================================================== -// $Id$ #ifndef DD4HEP_ERRORS_H #define DD4HEP_ERRORS_H 1 diff --git a/DDCore/include/DD4hep/Exceptions.h b/DDCore/include/DD4hep/Exceptions.h index c11b61d91..3911efad4 100644 --- a/DDCore/include/DD4hep/Exceptions.h +++ b/DDCore/include/DD4hep/Exceptions.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Factories.h b/DDCore/include/DD4hep/Factories.h index 6f07541da..6a252c1c1 100644 --- a/DDCore/include/DD4hep/Factories.h +++ b/DDCore/include/DD4hep/Factories.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -19,6 +18,8 @@ #include "DD4hep/Detector.h" #include "DD4hep/NamedObject.h" #include "XML/XMLElements.h" + +// C/C++ include files #include <cstdarg> /// Namespace for the AIDA detector description toolkit diff --git a/DDCore/include/DD4hep/FieldTypes.h b/DDCore/include/DD4hep/FieldTypes.h index 5dfd65be3..da332ce22 100644 --- a/DDCore/include/DD4hep/FieldTypes.h +++ b/DDCore/include/DD4hep/FieldTypes.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Fields.h b/DDCore/include/DD4hep/Fields.h index 6caeb5524..e247210db 100644 --- a/DDCore/include/DD4hep/Fields.h +++ b/DDCore/include/DD4hep/Fields.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/GeoHandler.h b/DDCore/include/DD4hep/GeoHandler.h index 41b157832..e9223297b 100644 --- a/DDCore/include/DD4hep/GeoHandler.h +++ b/DDCore/include/DD4hep/GeoHandler.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/GlobalAlignment.h b/DDCore/include/DD4hep/GlobalAlignment.h index 95f065ca8..7bbf7fb80 100644 --- a/DDCore/include/DD4hep/GlobalAlignment.h +++ b/DDCore/include/DD4hep/GlobalAlignment.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Handle.h b/DDCore/include/DD4hep/Handle.h index 4dde5bd30..b346b27e3 100644 --- a/DDCore/include/DD4hep/Handle.h +++ b/DDCore/include/DD4hep/Handle.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Handle.inl b/DDCore/include/DD4hep/Handle.inl index 023fcebd4..1e2cdf238 100644 --- a/DDCore/include/DD4hep/Handle.inl +++ b/DDCore/include/DD4hep/Handle.inl @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/IDDescriptor.h b/DDCore/include/DD4hep/IDDescriptor.h index 6fd8fd8d9..db785ad49 100644 --- a/DDCore/include/DD4hep/IDDescriptor.h +++ b/DDCore/include/DD4hep/IDDescriptor.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -16,21 +15,17 @@ // Framework include files #include "DD4hep/Handle.h" -#include "DDSegmentation/BitField64.h" +#include "DD4hep/BitField64.h" // C++ include files #include <string> #include <vector> #include <map> -/* - * DD4hep namespace declaration - */ +/// Namespace for the AIDA detector description toolkit namespace DD4hep { - /* - * Geometry sub-namespace declaration - */ + /// Namespace for the geometry part of the AIDA detector description toolkit namespace Geometry { class IDDescriptorObject; diff --git a/DDCore/include/DD4hep/IOV.h b/DDCore/include/DD4hep/IOV.h index 58e80fe96..7a91ec24e 100644 --- a/DDCore/include/DD4hep/IOV.h +++ b/DDCore/include/DD4hep/IOV.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/InstanceCount.h b/DDCore/include/DD4hep/InstanceCount.h index 9fda7e87e..874c48462 100644 --- a/DDCore/include/DD4hep/InstanceCount.h +++ b/DDCore/include/DD4hep/InstanceCount.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/LCDD.h b/DDCore/include/DD4hep/LCDD.h index 2abdc39da..4aa8676dc 100644 --- a/DDCore/include/DD4hep/LCDD.h +++ b/DDCore/include/DD4hep/LCDD.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/LCDDData.h b/DDCore/include/DD4hep/LCDDData.h index 518f1ded6..e5336e778 100644 --- a/DDCore/include/DD4hep/LCDDData.h +++ b/DDCore/include/DD4hep/LCDDData.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/LCDDHelper.h b/DDCore/include/DD4hep/LCDDHelper.h index f150d2cca..0a50cfe4a 100644 --- a/DDCore/include/DD4hep/LCDDHelper.h +++ b/DDCore/include/DD4hep/LCDDHelper.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/LCDDLoad.h b/DDCore/include/DD4hep/LCDDLoad.h index ba0fdbb97..56faed602 100644 --- a/DDCore/include/DD4hep/LCDDLoad.h +++ b/DDCore/include/DD4hep/LCDDLoad.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/MatrixHelpers.h b/DDCore/include/DD4hep/MatrixHelpers.h index d03d7a738..dc9da135e 100644 --- a/DDCore/include/DD4hep/MatrixHelpers.h +++ b/DDCore/include/DD4hep/MatrixHelpers.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -31,51 +30,51 @@ namespace DD4hep { typedef Position XYZAngles; - /// Access the TGeo identity transformation \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Access the TGeo identity transformation \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoIdentity* identityTransform(); - /// Convert a Position object to a TGeoTranslation \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a Position object to a TGeoTranslation \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoTranslation* _translation(const Geometry::Position& pos); - /// Convert a RotationZYX object to a TGeoRotation \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a RotationZYX object to a TGeoRotation \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoRotation* _rotationZYX(const Geometry::RotationZYX& rot); - /// Convert a Rotation3D object to a TGeoRotation \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a Rotation3D object to a TGeoRotation \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoRotation* _rotation3D(const Geometry::Rotation3D& rot); - /// Convert a Transform3D object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a Transform3D object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoHMatrix* _transform(const Geometry::Transform3D& trans); - /// Convert a Position object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a Position object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoHMatrix* _transform(const Geometry::Position& pos); - /// Convert a RotationZYX object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a RotationZYX object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoHMatrix* _transform(const Geometry::RotationZYX& rot); - /// Convert a Rotation3D object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a Rotation3D object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoHMatrix* _transform(const Geometry::Rotation3D& rot3D); - /// Convert a Position followed by a RotationZYX to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a Position followed by a RotationZYX to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoHMatrix* _transform(const Geometry::Position& pos, const Geometry::RotationZYX& rot); - /// Set a Transform3D object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Set a Transform3D object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoHMatrix& _transform(TGeoHMatrix& mat, const Geometry::Transform3D& trans); - /// Set a Position object (translation) to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Set a Position object (translation) to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoHMatrix& _transform(TGeoHMatrix& mat, const Geometry::Position& pos); - /// Set a RotationZYX object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Set a RotationZYX object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoHMatrix& _transform(TGeoHMatrix& mat, const Geometry::RotationZYX& rot); - /// Set a Rotation3D object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Set a Rotation3D object to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoHMatrix& _transform(TGeoHMatrix& mat, const Geometry::Rotation3D& rot3D); - /// Set a Position followed by a RotationZYX to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Set a Position followed by a RotationZYX to a TGeoHMatrix \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY TGeoHMatrix& _transform(TGeoHMatrix& mat, const Geometry::Position& pos, const Geometry::RotationZYX& rot); - /// Convert a TGeoMatrix object to a generic Transform3D \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a TGeoMatrix object to a generic Transform3D \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY Geometry::Transform3D _transform(const TGeoMatrix* matrix); - /// Decompose a generic Transform3D into a translation (Position) and a RotationZYX \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Decompose a generic Transform3D into a translation (Position) and a RotationZYX \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY void _decompose(const Geometry::Transform3D& trafo, Geometry::Position& pos, Geometry::RotationZYX& rot); /// Decompose a generic Transform3D into a translation (Geometry::Position) and XYZAngles \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY void _decompose(const Geometry::Transform3D& trafo, Geometry::Position& pos, XYZAngles& rot); - /// Decompose a generic Transform3D into a translation (Translation3D) and a RotationZYX \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Decompose a generic Transform3D into a translation (Translation3D) and a RotationZYX \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY void _decompose(const Geometry::Transform3D& trafo, Geometry::Translation3D& pos, Geometry::RotationZYX& rot); - /// Decompose a generic Transform3D into a translation (Translation3D) and XYZAngles \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Decompose a generic Transform3D into a translation (Translation3D) and XYZAngles \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY void _decompose(const Geometry::Transform3D& trafo, Geometry::Translation3D& pos, XYZAngles& rot); - /// Convert a 3x3 rotation matrix to XYZAngles \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a 3x3 rotation matrix to XYZAngles \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY XYZAngles _XYZangles(const double* matrix); - /// Convert a the rotation part of a TGeoMatrix to XYZAngles \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY + /// Convert a the rotation part of a TGeoMatrix to XYZAngles \ingroup DD4HEP \ingroup DD4HEP_GEOMETRY XYZAngles _XYZangles(const TGeoMatrix* matrix); } /* End namespace Geometry */ diff --git a/DDCore/include/DD4hep/Memory.h b/DDCore/include/DD4hep/Memory.h index 076724308..b9a3b293e 100644 --- a/DDCore/include/DD4hep/Memory.h +++ b/DDCore/include/DD4hep/Memory.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Mutex.h b/DDCore/include/DD4hep/Mutex.h index 28c05eed9..366d8b0e8 100644 --- a/DDCore/include/DD4hep/Mutex.h +++ b/DDCore/include/DD4hep/Mutex.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/NamedObject.h b/DDCore/include/DD4hep/NamedObject.h index 43e88d473..790cf2d0c 100644 --- a/DDCore/include/DD4hep/NamedObject.h +++ b/DDCore/include/DD4hep/NamedObject.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/ObjectExtensions.h b/DDCore/include/DD4hep/ObjectExtensions.h index e7bbc1c13..4936b8d53 100644 --- a/DDCore/include/DD4hep/ObjectExtensions.h +++ b/DDCore/include/DD4hep/ObjectExtensions.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Objects.h b/DDCore/include/DD4hep/Objects.h index da5fa5c3d..c340516c6 100644 --- a/DDCore/include/DD4hep/Objects.h +++ b/DDCore/include/DD4hep/Objects.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -11,7 +10,6 @@ // Author : M.Frank // //========================================================================== - #ifndef DD4HEP_GEOMETRY_OBJECTS_H #define DD4HEP_GEOMETRY_OBJECTS_H diff --git a/DDCore/include/DD4hep/OpaqueData.h b/DDCore/include/DD4hep/OpaqueData.h index aa5680057..980341dd6 100644 --- a/DDCore/include/DD4hep/OpaqueData.h +++ b/DDCore/include/DD4hep/OpaqueData.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Operators.h b/DDCore/include/DD4hep/Operators.h index ee4185097..67e8b05c3 100644 --- a/DDCore/include/DD4hep/Operators.h +++ b/DDCore/include/DD4hep/Operators.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Parsers.h b/DDCore/include/DD4hep/Parsers.h index b8b4213a4..e50b45b92 100644 --- a/DDCore/include/DD4hep/Parsers.h +++ b/DDCore/include/DD4hep/Parsers.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Path.h b/DDCore/include/DD4hep/Path.h index 2a919e7b8..a89c8aee0 100644 --- a/DDCore/include/DD4hep/Path.h +++ b/DDCore/include/DD4hep/Path.h @@ -12,7 +12,6 @@ // \version 1.0 // //========================================================================== -// $Id$ #ifndef DD4HEP_DDCORE_PATH_H #define DD4HEP_DDCORE_PATH_H diff --git a/DDCore/include/DD4hep/PluginCreators.h b/DDCore/include/DD4hep/PluginCreators.h index a925ebc4b..0ed1af10f 100644 --- a/DDCore/include/DD4hep/PluginCreators.h +++ b/DDCore/include/DD4hep/PluginCreators.h @@ -1,3 +1,4 @@ +//========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) @@ -11,7 +12,6 @@ // \version 1.0 // //========================================================================== -// $Id$ #ifndef DD4HEP_PLUGINCREATORS_H #define DD4HEP_PLUGINCREATORS_H 1 diff --git a/DDCore/include/DD4hep/Plugins.h b/DDCore/include/DD4hep/Plugins.h index 02173cf27..4da6f87b3 100644 --- a/DDCore/include/DD4hep/Plugins.h +++ b/DDCore/include/DD4hep/Plugins.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Plugins.inl b/DDCore/include/DD4hep/Plugins.inl index 8b442ec27..f23e8a3c5 100644 --- a/DDCore/include/DD4hep/Plugins.inl +++ b/DDCore/include/DD4hep/Plugins.inl @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/PolarGridRPhi.h b/DDCore/include/DD4hep/PolarGridRPhi.h index 45a438cea..caf9a0f7e 100644 --- a/DDCore/include/DD4hep/PolarGridRPhi.h +++ b/DDCore/include/DD4hep/PolarGridRPhi.h @@ -15,7 +15,7 @@ #define DD4HEP_DDCORE_POLARGRIDRPHI_H 1 // Framework include files -#include "DD4hep/Objects.h" +#include "DD4hep/Segmentations.h" /// Namespace for the AIDA detector description toolkit namespace DD4hep { @@ -28,6 +28,7 @@ namespace DD4hep { // Forward declarations class Segmentation; + template <typename T> class SegmentationWrapper; /// We need some abbreviation to make the code more readable. typedef Handle<SegmentationWrapper<DDSegmentation::PolarGridRPhi> > PolarGridRPhiHandle; diff --git a/DDCore/include/DD4hep/PolarGridRPhi2.h b/DDCore/include/DD4hep/PolarGridRPhi2.h index fa18d8e19..5eaa808f0 100644 --- a/DDCore/include/DD4hep/PolarGridRPhi2.h +++ b/DDCore/include/DD4hep/PolarGridRPhi2.h @@ -15,7 +15,7 @@ #define DD4HEP_DDCORE_POLARGRIDRPHI2_H 1 // Framework include files -#include "DD4hep/Objects.h" +#include "DD4hep/Segmentations.h" /// Namespace for the AIDA detector description toolkit namespace DD4hep { @@ -28,6 +28,7 @@ namespace DD4hep { // Forward declarations class Segmentation; + template <typename T> class SegmentationWrapper; /// We need some abbreviation to make the code more readable. typedef Handle<SegmentationWrapper<DDSegmentation::PolarGridRPhi2> > PolarGridRPhi2Handle; diff --git a/DDCore/include/DD4hep/Printout.h b/DDCore/include/DD4hep/Printout.h index f1d03e19a..d7aee3e41 100644 --- a/DDCore/include/DD4hep/Printout.h +++ b/DDCore/include/DD4hep/Printout.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Readout.h b/DDCore/include/DD4hep/Readout.h index 376de3da3..9d18ab142 100644 --- a/DDCore/include/DD4hep/Readout.h +++ b/DDCore/include/DD4hep/Readout.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Segmentations.h b/DDCore/include/DD4hep/Segmentations.h index 11012e377..395415df7 100644 --- a/DDCore/include/DD4hep/Segmentations.h +++ b/DDCore/include/DD4hep/Segmentations.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -15,13 +14,13 @@ #define DD4HEP_GEOMETRY_SEGMENTATIONS_H // Framework include files -#include "DD4hep/Objects.h" #include "DD4hep/Handle.h" +#include "DD4hep/Objects.h" +#include "DD4hep/BitField64.h" #include "DDSegmentation/Segmentation.h" // C/C++ include files -#include <cmath> -#include <vector> + /// Namespace for the AIDA detector description toolkit namespace DD4hep { @@ -29,101 +28,10 @@ namespace DD4hep { /// Namespace for the geometry part of the AIDA detector description toolkit namespace Geometry { - // Forward declarations + /// Forward declarations class DetElementObject; + class SegmentationObject; class SensitiveDetectorObject; - - /// Implementation class supporting generic Segmentation of sensitive detectors - /** - * The SegmentationObject wraps the functionality of the DDSegmentation base class. - * - * \author M.Frank - * \version 1.0 - * \ingroup DD4HEP_GEOMETRY - */ - class SegmentationObject { - public: - typedef DDSegmentation::Segmentation BaseSegmentation; - typedef DDSegmentation::Parameters Parameters; - typedef DDSegmentation::Parameter Parameter; - - public: - /// Standard constructor - SegmentationObject(BaseSegmentation* s = 0); - /// Default destructor - virtual ~SegmentationObject(); - /// Access the encoding string - std::string fieldDescription() const; - /// Access the segmentation name - const std::string& name() const; - /// Set the segmentation name - void setName(const std::string& value); - /// Access the segmentation type - const std::string& type() const; - /// Access the description of the segmentation - const std::string& description() const; - /// Access the underlying decoder - BitField64* decoder() const; - /// Set the underlying decoder - void setDecoder(BitField64* decoder) const; - /// Access to parameter by name - Parameter parameter(const std::string& parameterName) const; - /// Access to all parameters - Parameters parameters() const; - /// Set all parameters from an existing set of parameters - void setParameters(const Parameters& parameters); - - /** Segmentation interface */ - /// Determine the local position based on the cell ID - Position position(const CellID& cellID) const; - /// Determine the cell ID based on the position - CellID cellID(const Position& localPosition, - const Position& globalPosition, - const VolumeID& volumeID) const; - /// Determine the volume ID from the full cell ID by removing all local fields - VolumeID volumeID(const CellID& cellID) const; - /// Calculates the neighbours of the given cell ID and adds them to the list of neighbours - void neighbours(const CellID& cellID, std::set<CellID>& neighbours) const; - - /// Magic word to check object integrity - unsigned long magic; - /// Flag to use segmentation for hit positioning - unsigned char useForHitPosition; - /// Reference to hosting top level DetElement structure - Handle<DetElementObject> detector; - /// Reference to hosting top level sensitve detector structure - Handle<SensitiveDetectorObject> sensitive; - /// Reference to base segmentation - BaseSegmentation* segmentation; - }; - - /// Concrete wrapper class for segmentation implementation based on DDSegmentation objects - /** - * \author M.Frank - * \version 1.0 - * \ingroup DD4HEP_GEOMETRY - */ - template <typename IMP> class SegmentationWrapper : public SegmentationObject { - public: - /// DDSegmentation aggregate - IMP* implementation; - public: - /// Standard constructor - SegmentationWrapper(DDSegmentation::BitField64* decoder); - /// Default destructor - virtual ~SegmentationWrapper(); - }; - - /// Standard constructor - template <typename IMP> inline - SegmentationWrapper<IMP>::SegmentationWrapper(DDSegmentation::BitField64* decode) - : SegmentationObject(implementation=new IMP(decode)) - { - } - - /// Default destructor - template <typename IMP> inline SegmentationWrapper<IMP>::~SegmentationWrapper() { - } /// Handle class supporting generic Segmentation of sensitive detectors /** @@ -134,7 +42,7 @@ namespace DD4hep { */ class Segmentation: public Handle<SegmentationObject> { public: - typedef SegmentationObject Object; + typedef SegmentationObject Object; typedef DDSegmentation::Segmentation BaseSegmentation; typedef DDSegmentation::Parameter Parameter; typedef DDSegmentation::Parameters Parameters; @@ -161,6 +69,10 @@ namespace DD4hep { std::string type() const; /// Access to the parameters Parameters parameters() const; + /// Access the main detector element using this segmetnation object + Handle<DetElementObject> detector() const; + /// Access the sensitive detector using this segmetnation object + Handle<SensitiveDetectorObject> sensitive() const; /// Access the underlying decoder BitField64* decoder() const; /// Set the underlying decoder @@ -169,8 +81,10 @@ namespace DD4hep { Position position(const long64& cellID) const; /// determine the cell ID based on the local position long64 cellID(const Position& localPosition, const Position& globalPosition, const long64& volumeID) const; - /// Access the concrete underlying segmentation implementation from DDSegmentation - template <typename T> static T* get(const Object* object); + /// Determine the volume ID from the full cell ID by removing all local fields + VolumeID volumeID(const CellID& cellID) const; + /// Calculates the neighbours of the given cell ID and adds them to the list of neighbours + void neighbours(const CellID& cellID, std::set<CellID>& neighbours) const; }; } /* End namespace Geometry */ diff --git a/DDCore/include/DD4hep/Shapes.h b/DDCore/include/DD4hep/Shapes.h index 0e0f14aed..da1752ebd 100644 --- a/DDCore/include/DD4hep/Shapes.h +++ b/DDCore/include/DD4hep/Shapes.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/SurfaceInstaller.h b/DDCore/include/DD4hep/SurfaceInstaller.h index 7c967f304..4cdc1c897 100644 --- a/DDCore/include/DD4hep/SurfaceInstaller.h +++ b/DDCore/include/DD4hep/SurfaceInstaller.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/ToStream.h b/DDCore/include/DD4hep/ToStream.h index 67410f891..46d52d4c0 100644 --- a/DDCore/include/DD4hep/ToStream.h +++ b/DDCore/include/DD4hep/ToStream.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/VolumeManager.h b/DDCore/include/DD4hep/VolumeManager.h index a1b9c187e..25be5c340 100644 --- a/DDCore/include/DD4hep/VolumeManager.h +++ b/DDCore/include/DD4hep/VolumeManager.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/Volumes.h b/DDCore/include/DD4hep/Volumes.h index 33414d7bd..fc7139d7d 100644 --- a/DDCore/include/DD4hep/Volumes.h +++ b/DDCore/include/DD4hep/Volumes.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/WaferGridXY.h b/DDCore/include/DD4hep/WaferGridXY.h index e189a5233..52322ddbf 100644 --- a/DDCore/include/DD4hep/WaferGridXY.h +++ b/DDCore/include/DD4hep/WaferGridXY.h @@ -15,7 +15,7 @@ #define DD4HEP_DDCORE_WAFERGRIDZY_H 1 // Framework include files -#include "DD4hep/Objects.h" +#include "DD4hep/Segmentations.h" /// Namespace for the AIDA detector description toolkit namespace DD4hep { @@ -28,6 +28,7 @@ namespace DD4hep { // Forward declarations class Segmentation; + template <typename T> class SegmentationWrapper; /// We need some abbreviation to make the code more readable. typedef Handle<SegmentationWrapper<DDSegmentation::WaferGridXY> > WaferGridXYHandle; diff --git a/DDCore/include/DD4hep/config.h b/DDCore/include/DD4hep/config.h index 9c26f44ac..8355de9fd 100644 --- a/DDCore/include/DD4hep/config.h +++ b/DDCore/include/DD4hep/config.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/objects/AlignmentsInterna.h b/DDCore/include/DD4hep/objects/AlignmentsInterna.h index 64ec5eb98..3ff64ed82 100644 --- a/DDCore/include/DD4hep/objects/AlignmentsInterna.h +++ b/DDCore/include/DD4hep/objects/AlignmentsInterna.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/objects/ConditionsInterna.h b/DDCore/include/DD4hep/objects/ConditionsInterna.h index 03df33e5c..628d37b40 100644 --- a/DDCore/include/DD4hep/objects/ConditionsInterna.h +++ b/DDCore/include/DD4hep/objects/ConditionsInterna.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/objects/DetectorInterna.h b/DDCore/include/DD4hep/objects/DetectorInterna.h index 35a36bbaa..c5ca4c793 100644 --- a/DDCore/include/DD4hep/objects/DetectorInterna.h +++ b/DDCore/include/DD4hep/objects/DetectorInterna.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/objects/ObjectsInterna.h b/DDCore/include/DD4hep/objects/ObjectsInterna.h index f106e9838..d8e900ba3 100644 --- a/DDCore/include/DD4hep/objects/ObjectsInterna.h +++ b/DDCore/include/DD4hep/objects/ObjectsInterna.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -11,7 +10,6 @@ // Author : M.Frank // //========================================================================== - #ifndef DD4HEP_GEOMETRY_OBJECTSINTERNA_H #define DD4HEP_GEOMETRY_OBJECTSINTERNA_H @@ -20,7 +18,7 @@ #include "DD4hep/NamedObject.h" #include "DD4hep/IDDescriptor.h" #include "DD4hep/Segmentations.h" -#include "DDSegmentation/BitField64.h" +#include "DD4hep/BitField64.h" // C/C++ include files #include <set> diff --git a/DDCore/include/DD4hep/objects/OpaqueData_inl.h b/DDCore/include/DD4hep/objects/OpaqueData_inl.h index bf985da78..2c76a4aec 100644 --- a/DDCore/include/DD4hep/objects/OpaqueData_inl.h +++ b/DDCore/include/DD4hep/objects/OpaqueData_inl.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/include/DD4hep/objects/VolumeManagerInterna.h b/DDCore/include/DD4hep/objects/VolumeManagerInterna.h index 83fdbeab2..7ca1a1c83 100644 --- a/DDCore/include/DD4hep/objects/VolumeManagerInterna.h +++ b/DDCore/include/DD4hep/objects/VolumeManagerInterna.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/src/CartesianGridXY.cpp b/DDCore/src/CartesianGridXY.cpp index b72996f09..7f75342d2 100644 --- a/DDCore/src/CartesianGridXY.cpp +++ b/DDCore/src/CartesianGridXY.cpp @@ -12,8 +12,8 @@ //========================================================================== // Framework include files -#include "DD4hep/Segmentations.h" #include "DD4hep/CartesianGridXY.h" +#include "DD4hep/objects/SegmentationsInterna.h" #include "DDSegmentation/CartesianGridXY.h" // C/C++ include files diff --git a/DDCore/src/CartesianGridXYZ.cpp b/DDCore/src/CartesianGridXYZ.cpp index 396864c41..50b9ccb19 100644 --- a/DDCore/src/CartesianGridXYZ.cpp +++ b/DDCore/src/CartesianGridXYZ.cpp @@ -12,8 +12,8 @@ //========================================================================== // Framework include files -#include "DD4hep/Segmentations.h" #include "DD4hep/CartesianGridXYZ.h" +#include "DD4hep/objects/SegmentationsInterna.h" #include "DDSegmentation/CartesianGridXYZ.h" // C/C++ include files diff --git a/DDCore/src/CartesianGridXZ.cpp b/DDCore/src/CartesianGridXZ.cpp index 0d4ee904e..f28a75c0a 100644 --- a/DDCore/src/CartesianGridXZ.cpp +++ b/DDCore/src/CartesianGridXZ.cpp @@ -12,8 +12,8 @@ //========================================================================== // Framework include files -#include "DD4hep/Segmentations.h" #include "DD4hep/CartesianGridXZ.h" +#include "DD4hep/objects/SegmentationsInterna.h" #include "DDSegmentation/CartesianGridXZ.h" // C/C++ include files diff --git a/DDCore/src/CartesianGridYZ.cpp b/DDCore/src/CartesianGridYZ.cpp index 2b1176e10..7e9a59058 100644 --- a/DDCore/src/CartesianGridYZ.cpp +++ b/DDCore/src/CartesianGridYZ.cpp @@ -12,8 +12,8 @@ //========================================================================== // Framework include files -#include "DD4hep/Segmentations.h" #include "DD4hep/CartesianGridYZ.h" +#include "DD4hep/objects/SegmentationsInterna.h" #include "DDSegmentation/CartesianGridYZ.h" // C/C++ include files diff --git a/DDCore/src/ObjectsInterna.cpp b/DDCore/src/ObjectsInterna.cpp index dc2d3ff2f..f20e5babd 100644 --- a/DDCore/src/ObjectsInterna.cpp +++ b/DDCore/src/ObjectsInterna.cpp @@ -16,6 +16,7 @@ #include "DD4hep/InstanceCount.h" #include "DD4hep/Objects.h" #include "DD4hep/objects/ObjectsInterna.h" +#include "DD4hep/objects/SegmentationsInterna.h" using namespace std; using namespace DD4hep; diff --git a/DDCore/src/PolarGridRPhi.cpp b/DDCore/src/PolarGridRPhi.cpp index 56498a0c6..416e372b4 100644 --- a/DDCore/src/PolarGridRPhi.cpp +++ b/DDCore/src/PolarGridRPhi.cpp @@ -12,8 +12,8 @@ //========================================================================== // Framework include files -#include "DD4hep/Segmentations.h" #include "DD4hep/PolarGridRPhi.h" +#include "DD4hep/objects/SegmentationsInterna.h" #include "DDSegmentation/PolarGridRPhi.h" // C/C++ include files diff --git a/DDCore/src/PolarGridRPhi2.cpp b/DDCore/src/PolarGridRPhi2.cpp index 839f739c3..47e18d1de 100644 --- a/DDCore/src/PolarGridRPhi2.cpp +++ b/DDCore/src/PolarGridRPhi2.cpp @@ -12,8 +12,8 @@ //========================================================================== // Framework include files -#include "DD4hep/Segmentations.h" #include "DD4hep/PolarGridRPhi2.h" +#include "DD4hep/objects/SegmentationsInterna.h" #include "DDSegmentation/PolarGridRPhi2.h" // C/C++ include files diff --git a/DDCore/src/Readout.cpp b/DDCore/src/Readout.cpp index 8297bae80..4b487831c 100644 --- a/DDCore/src/Readout.cpp +++ b/DDCore/src/Readout.cpp @@ -14,6 +14,7 @@ // Framework include files #include "DD4hep/Readout.h" +#include "DD4hep/objects/SegmentationsInterna.h" #include "DD4hep/objects/ObjectsInterna.h" #include "DD4hep/InstanceCount.h" #include "DD4hep/DD4hepUnits.h" diff --git a/DDCore/src/Segmentations.cpp b/DDCore/src/Segmentations.cpp index 1e8c625cc..7e2c5ed4c 100644 --- a/DDCore/src/Segmentations.cpp +++ b/DDCore/src/Segmentations.cpp @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -18,6 +17,7 @@ #include "DD4hep/Printout.h" #include "DD4hep/Plugins.h" #include "DD4hep/Handle.inl" +#include "DD4hep/objects/SegmentationsInterna.h" // C/C++ include files #include <iostream> @@ -32,95 +32,6 @@ using DD4hep::DDSegmentation::SegmentationParameter; DD4HEP_INSTANTIATE_HANDLE_UNNAMED(SegmentationObject); -/// Standard constructor -SegmentationObject::SegmentationObject(BaseSegmentation* s) - : magic(magic_word()), useForHitPosition(0), - detector(0), sensitive(0), segmentation(s) -{ - //s->backLink = this; - //this->backLink = this; - InstanceCount::increment(this); -} - -/// Default destructor -SegmentationObject::~SegmentationObject() { - InstanceCount::decrement(this); - if (segmentation) { - delete segmentation; - } -} - -/// Access the encoding string -string SegmentationObject::fieldDescription() const { - return segmentation->fieldDescription(); -} - -/// Access the segmentation name -const string& SegmentationObject::name() const { - return segmentation->name(); -} -/// Set the segmentation name -void SegmentationObject::setName(const string& value) { - segmentation->setName(value); -} - -/// Access the segmentation type -const string& SegmentationObject::type() const { - return segmentation->type(); -} - -/// Access the description of the segmentation -const string& SegmentationObject::description() const { - return segmentation->description(); -} - -/// Access the underlying decoder -BitField64* SegmentationObject::decoder() const { - return segmentation->decoder(); -} - -/// Set the underlying decoder -void SegmentationObject::setDecoder(BitField64* ptr_decoder) const { - segmentation->setDecoder(ptr_decoder); -} - -/// Access to parameter by name -Parameter SegmentationObject::parameter(const string& parameterName) const { - return segmentation->parameter(parameterName); -} - -/// Access to all parameters -Parameters SegmentationObject::parameters() const { - return segmentation->parameters(); -} - -/// Set all parameters from an existing set of parameters -void SegmentationObject::setParameters(const Parameters& params) { - segmentation->setParameters(params); -} - -/// Determine the local position based on the cell ID -Position SegmentationObject::position(const CellID& cell) const { - return Position(segmentation->position(cell)); -} - -/// Determine the cell ID based on the position -CellID SegmentationObject::cellID(const Position& local, - const Position& global, - const VolumeID& volID) const { - return segmentation->cellID(local, global, volID); -} - -/// Determine the volume ID from the full cell ID by removing all local fields -VolumeID SegmentationObject::volumeID(const CellID& cell) const { - return segmentation->volumeID(cell); -} - -/// Calculates the neighbours of the given cell ID and adds them to the list of neighbours -void SegmentationObject::neighbours(const CellID& cell, std::set<CellID>& nb) const { - segmentation->neighbours(cell, nb); -} - /// Constructor to used when creating a new object Segmentation::Segmentation(const string& typ, const string& nam, BitField64* dec) : Handle<Object>() { @@ -149,11 +60,6 @@ Parameters Segmentation::parameters() const { return data<Object>()->parameters(); } -/// Access segmentation object -//DDSegmentation::Segmentation* Segmentation::segmentation() const { -// return data<Object>()->segmentation; -//} - /// determine the local position based on the cell ID Position Segmentation::position(const long64& cell) const { return Position(data<Object>()->segmentation->position(cell)); @@ -164,6 +70,16 @@ long64 Segmentation::cellID(const Position& localPosition, const Position& globa return data<Object>()->segmentation->cellID(localPosition, globalPosition, volID); } +/// Determine the volume ID from the full cell ID by removing all local fields +VolumeID Segmentation::volumeID(const CellID& cell) const { + return data<Object>()->segmentation->volumeID(cell); +} + +/// Calculates the neighbours of the given cell ID and adds them to the list of neighbours +void Segmentation::neighbours(const CellID& cell, std::set<CellID>& nb) const { + data<Object>()->segmentation->neighbours(cell, nb); +} + /// Access the underlying decoder BitField64* Segmentation::decoder() const { return data<Object>()->segmentation->decoder(); @@ -174,34 +90,21 @@ void Segmentation::setDecoder(BitField64* decode) const { data<Object>()->segmentation->setDecoder(decode); } -/// Namespace for the AIDA detector description toolkit -namespace DD4hep { - /// Namespace for the geometry part of the AIDA detector description toolkit - namespace Geometry { - - /// Access the concrete underlying segmentation implementation from DDSegmentation - template <typename T> T* - Segmentation::get(const Object* obj) { - if ( obj ) { - DDSegmentation::Segmentation* seg = obj->segmentation; - T* dd_seg = dynamic_cast<T*>(seg); - if ( dd_seg ) { - return dd_seg; - } - except("CartesianGridXY", - "Cannot convert segmentation:%s to CartesianGridXY.", - obj->name().c_str()); - } - return 0; - } - } /* End namespace Geometry */ -} /* End namespace DD4hep */ +/// Access the main detector element using this segmetnation object +Handle<DetElementObject> Segmentation::detector() const { + return data<Object>()->detector; +} + +/// Access the sensitive detector using this segmetnation object +Handle<SensitiveDetectorObject> Segmentation::sensitive() const { + return data<Object>()->sensitive; +} #define IMPLEMENT_SEGMENTATION_HANDLE(X) \ - DD4HEP_INSTANTIATE_HANDLE_UNNAMED(SegmentationWrapper<DDSegmentation::X>); \ - namespace DD4hep { namespace Geometry { \ - template DDSegmentation::X* \ - Segmentation::get<DDSegmentation::X>(const Object* obj); }} + DD4HEP_INSTANTIATE_HANDLE_UNNAMED(SegmentationWrapper<DDSegmentation::X>); + +#include "DDSegmentation/CartesianGrid.h" +IMPLEMENT_SEGMENTATION_HANDLE(CartesianGrid) #include "DDSegmentation/CartesianGridXY.h" IMPLEMENT_SEGMENTATION_HANDLE(CartesianGridXY) @@ -233,3 +136,5 @@ IMPLEMENT_SEGMENTATION_HANDLE(PolarGridRPhi2) #include "DDSegmentation/ProjectiveCylinder.h" IMPLEMENT_SEGMENTATION_HANDLE(ProjectiveCylinder) +#include "DDSegmentation/MultiSegmentation.h" +IMPLEMENT_SEGMENTATION_HANDLE(MultiSegmentation) diff --git a/DDCore/src/WaferGridXY.cpp b/DDCore/src/WaferGridXY.cpp index 45aaa4c4d..8d73b711a 100644 --- a/DDCore/src/WaferGridXY.cpp +++ b/DDCore/src/WaferGridXY.cpp @@ -12,8 +12,8 @@ //========================================================================== // Framework include files -#include "DD4hep/Segmentations.h" #include "DD4hep/WaferGridXY.h" +#include "DD4hep/objects/SegmentationsInterna.h" #include "DDSegmentation/WaferGridXY.h" // C/C++ include files diff --git a/DDCore/src/World.cpp b/DDCore/src/World.cpp index f0e42fa8b..064774816 100644 --- a/DDCore/src/World.cpp +++ b/DDCore/src/World.cpp @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDCore/src/plugins/Compact2Objects.cpp b/DDCore/src/plugins/Compact2Objects.cpp index 21425c6d3..424e13be3 100644 --- a/DDCore/src/plugins/Compact2Objects.cpp +++ b/DDCore/src/plugins/Compact2Objects.cpp @@ -19,6 +19,7 @@ #include "DD4hep/FieldTypes.h" #include "DD4hep/Printout.h" #include "DD4hep/Plugins.h" +#include "DD4hep/objects/SegmentationsInterna.h" #include "DD4hep/objects/DetectorInterna.h" #include "DD4hep/objects/ObjectsInterna.h" diff --git a/DDCore/src/plugins/LCDDSegmentations.cpp b/DDCore/src/plugins/LCDDSegmentations.cpp index d14536987..0a60bc95c 100644 --- a/DDCore/src/plugins/LCDDSegmentations.cpp +++ b/DDCore/src/plugins/LCDDSegmentations.cpp @@ -13,63 +13,48 @@ //========================================================================== // Framework includes -#include "DD4hep/Segmentations.h" +#include "DD4hep/objects/SegmentationsInterna.h" #include "DD4hep/Factories.h" using namespace DD4hep::Geometry; using namespace DD4hep::DDSegmentation; +namespace { + template<typename T> DD4hep::Geometry::SegmentationObject* + create_segmentation(DD4hep::Geometry::BitField64* decoder) { + return new DD4hep::Geometry::SegmentationWrapper<T>(decoder); + } +} + #include "DDSegmentation/CartesianGridXY.h" -static SegmentationObject* create_CartesianGridXY(BitField64* decoder) -{ return new SegmentationWrapper<CartesianGridXY>(decoder); } -DECLARE_SEGMENTATION(CartesianGridXY,create_CartesianGridXY) +DECLARE_SEGMENTATION(CartesianGridXY,create_segmentation<DD4hep::DDSegmentation::CartesianGridXY>) #include "DDSegmentation/CartesianGridXZ.h" -static SegmentationObject* create_CartesianGridXZ(BitField64* decoder) -{ return new SegmentationWrapper<CartesianGridXZ>(decoder); } -DECLARE_SEGMENTATION(CartesianGridXZ,create_CartesianGridXZ) +DECLARE_SEGMENTATION(CartesianGridXZ,create_segmentation<DD4hep::DDSegmentation::CartesianGridXZ>) #include "DDSegmentation/CartesianGridYZ.h" -static SegmentationObject* create_CartesianGridYZ(BitField64* decoder) -{ return new SegmentationWrapper<CartesianGridYZ>(decoder); } -DECLARE_SEGMENTATION(CartesianGridYZ,create_CartesianGridYZ) +DECLARE_SEGMENTATION(CartesianGridYZ,create_segmentation<DD4hep::DDSegmentation::CartesianGridYZ>) #include "DDSegmentation/CartesianGridXYZ.h" -static SegmentationObject* create_CartesianGridXYZ(BitField64* decoder) -{ return new SegmentationWrapper<CartesianGridXYZ>(decoder); } -DECLARE_SEGMENTATION(CartesianGridXYZ,create_CartesianGridXYZ) +DECLARE_SEGMENTATION(CartesianGridXYZ,create_segmentation<DD4hep::DDSegmentation::CartesianGridXYZ>) #include "DDSegmentation/TiledLayerGridXY.h" -static SegmentationObject* create_TiledLayerGridXY(BitField64* decoder) -{ return new SegmentationWrapper<TiledLayerGridXY>(decoder); } -DECLARE_SEGMENTATION(TiledLayerGridXY,create_TiledLayerGridXY) +DECLARE_SEGMENTATION(TiledLayerGridXY,create_segmentation<DD4hep::DDSegmentation::TiledLayerGridXY>) #include "DDSegmentation/MegatileLayerGridXY.h" -static SegmentationObject* create_MegatileLayerGridXY(BitField64* decoder) -{ return new SegmentationWrapper<MegatileLayerGridXY>(decoder); } -DECLARE_SEGMENTATION(MegatileLayerGridXY,create_MegatileLayerGridXY) +DECLARE_SEGMENTATION(MegatileLayerGridXY,create_segmentation<DD4hep::DDSegmentation::MegatileLayerGridXY>) #include "DDSegmentation/WaferGridXY.h" -static SegmentationObject* create_WaferGridXY(BitField64* decoder) -{ return new SegmentationWrapper<WaferGridXY>(decoder); } -DECLARE_SEGMENTATION(WaferGridXY,create_WaferGridXY) +DECLARE_SEGMENTATION(WaferGridXY,create_segmentation<DD4hep::DDSegmentation::WaferGridXY>) #include "DDSegmentation/PolarGridRPhi.h" -static SegmentationObject* create_PolarGridRPhi(BitField64* decoder) -{ return new SegmentationWrapper<PolarGridRPhi>(decoder); } -DECLARE_SEGMENTATION(PolarGridRPhi,create_PolarGridRPhi) +DECLARE_SEGMENTATION(PolarGridRPhi,create_segmentation<DD4hep::DDSegmentation::PolarGridRPhi>) #include "DDSegmentation/PolarGridRPhi2.h" -static SegmentationObject* create_PolarGridRPhi2(BitField64* decoder) -{ return new SegmentationWrapper<PolarGridRPhi2>(decoder); } -DECLARE_SEGMENTATION(PolarGridRPhi2,create_PolarGridRPhi2) +DECLARE_SEGMENTATION(PolarGridRPhi2,create_segmentation<DD4hep::DDSegmentation::PolarGridRPhi2>) #include "DDSegmentation/ProjectiveCylinder.h" -static SegmentationObject* create_ProjectiveCylinder(BitField64* decoder) -{ return new SegmentationWrapper<ProjectiveCylinder>(decoder); } -DECLARE_SEGMENTATION(ProjectiveCylinder,create_ProjectiveCylinder) +DECLARE_SEGMENTATION(ProjectiveCylinder,create_segmentation<DD4hep::DDSegmentation::ProjectiveCylinder>) #include "DDSegmentation/MultiSegmentation.h" -static SegmentationObject* create_MultiSegmentation(BitField64* decoder) -{ return new SegmentationWrapper<MultiSegmentation>(decoder); } -DECLARE_SEGMENTATION(MultiSegmentation,create_MultiSegmentation) +DECLARE_SEGMENTATION(MultiSegmentation,create_segmentation<DD4hep::DDSegmentation::MultiSegmentation>) diff --git a/DDRec/src/IDDecoder.cpp b/DDRec/src/IDDecoder.cpp index 4ce1186d7..ef872386a 100644 --- a/DDRec/src/IDDecoder.cpp +++ b/DDRec/src/IDDecoder.cpp @@ -101,7 +101,7 @@ Position IDDecoder::localPosition(const CellID& cell) const { */ VolumeID IDDecoder::volumeID(const CellID& cell) const { DetElement det = this->detectorElement(cell); - return this->findReadout(det).segmentation()->volumeID(cell); + return this->findReadout(det).segmentation().volumeID(cell); } /* @@ -177,7 +177,7 @@ Geometry::Readout IDDecoder::readout(const Position& global) const { */ void IDDecoder::neighbours(const CellID& cell, set<CellID>& neighbour_cells) const { DetElement det = this->detectorElement(cell); - this->findReadout(det).segmentation()->neighbours(cell, neighbour_cells); + this->findReadout(det).segmentation().neighbours(cell, neighbour_cells); } /* @@ -186,7 +186,7 @@ void IDDecoder::neighbours(const CellID& cell, set<CellID>& neighbour_cells) con bool IDDecoder::areNeighbours(const CellID& cell, const CellID& otherCellID) const { set<CellID> neighbour_cells; DetElement det = this->detectorElement(cell); - this->findReadout(det).segmentation()->neighbours(cell, neighbour_cells); + this->findReadout(det).segmentation().neighbours(cell, neighbour_cells); return neighbour_cells.count(otherCellID) != 0; } diff --git a/DDSegmentation/include/DDSegmentation/MultiSegmentation.h b/DDSegmentation/include/DDSegmentation/MultiSegmentation.h index 24a9f46c4..8ac8bf874 100644 --- a/DDSegmentation/include/DDSegmentation/MultiSegmentation.h +++ b/DDSegmentation/include/DDSegmentation/MultiSegmentation.h @@ -28,6 +28,27 @@ namespace DD4hep { * \ingroup DD4HEP_DDSEGMENTATION */ class MultiSegmentation : public Segmentation { + public: + + struct Entry { + long key_min, key_max; + Segmentation* segmentation; + }; + typedef std::vector<Entry> Segmentations; + + protected: + /// Sub-segmentaion container + Segmentations m_segmentations; + + /// the field name used to discriminate sub-segmentations + std::string m_discriminatorId; + + /// Bitfield corresponding to dicriminator identifier + BitFieldValue* m_discriminator; + + /// Debug flags + int m_debug; + public: /// Default constructor passing the encoding string MultiSegmentation(const std::string& cellEncoding = ""); @@ -41,6 +62,9 @@ namespace DD4hep { /// Add subsegmentation. virtual void addSubsegmentation(long key_min, long key_max, Segmentation* entry); + /// Access subsegmentation by cell identifier + const Segmentation& subsegmentation(const CellID& cellID) const; + /// determine the position based on the cell ID virtual Vector3D position(const CellID& cellID) const; @@ -64,27 +88,9 @@ namespace DD4hep { /// Set the underlying decoder virtual void setDecoder(BitField64* decoder); - protected: - struct Entry { - long key_min, key_max; - Segmentation* segmentation; - }; - typedef std::vector<Entry> Segmentations; + /// The underlying sub-segementations + const Segmentations& subSegmentations() const { return m_segmentations; } - /// Access subsegmentation by cell identifier - const Segmentation& subsegmentation(const CellID& cellID) const; - - /// Sub-segmentaion container - Segmentations m_segmentations; - - /// the field name used to discriminate sub-segmentations - std::string m_discriminatorId; - - /// Bitfield corresponding to dicriminator identifier - BitFieldValue* m_discriminator; - - /// Debug flags - int m_debug; }; } /* namespace DDSegmentation */ diff --git a/DDSegmentation/include/DDSegmentation/Segmentation.h b/DDSegmentation/include/DDSegmentation/Segmentation.h index 89323900f..494201584 100644 --- a/DDSegmentation/include/DDSegmentation/Segmentation.h +++ b/DDSegmentation/include/DDSegmentation/Segmentation.h @@ -161,9 +161,6 @@ protected: mutable BitField64* _decoder; /// Keeps track of the decoder ownership bool _ownsDecoder; -public: - /// DD4hep usage ONLY. Backlink to DD4hep segmentation - Segmentation* backLink; private: /// No copy constructor allowed Segmentation(const Segmentation&); diff --git a/DDSegmentation/src/Segmentation.cpp b/DDSegmentation/src/Segmentation.cpp index ad8b2fd05..77b3086d2 100644 --- a/DDSegmentation/src/Segmentation.cpp +++ b/DDSegmentation/src/Segmentation.cpp @@ -26,13 +26,13 @@ namespace DD4hep { /// Default constructor used by derived classes passing the encoding string Segmentation::Segmentation(const std::string& cellEncoding) : - _name("Segmentation"), _type("Segmentation"), _decoder(new BitField64(cellEncoding)), _ownsDecoder(true), backLink(0) { + _name("Segmentation"), _type("Segmentation"), _decoder(new BitField64(cellEncoding)), _ownsDecoder(true) { } /// Default constructor used by derived classes passing an existing decoder Segmentation::Segmentation(BitField64* newDecoder) : - _name("Segmentation"), _type("Segmentation"), _decoder(newDecoder), _ownsDecoder(false), backLink(0) { + _name("Segmentation"), _type("Segmentation"), _decoder(newDecoder), _ownsDecoder(false) { } /// Destructor -- GitLab