From 750a6bf4b9636ab23b61ead8254957792dfa25fc Mon Sep 17 00:00:00 2001
From: Joschka Lingemann <joschka.lingemann@cern.ch>
Date: Wed, 29 Mar 2017 08:30:00 +0200
Subject: [PATCH] Add plugins for Phi-Eta and R-Phi-Eta segmentations

---
 DDCore/include/DD4hep/Dictionary.h       | 12 ++++++++----
 DDCore/src/Segmentations.cpp             |  8 +++++++-
 DDCore/src/plugins/LCDDSegmentations.cpp |  6 ++++++
 3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/DDCore/include/DD4hep/Dictionary.h b/DDCore/include/DD4hep/Dictionary.h
index 93da4678f..8de49be0d 100644
--- a/DDCore/include/DD4hep/Dictionary.h
+++ b/DDCore/include/DD4hep/Dictionary.h
@@ -102,8 +102,8 @@ template class pair<DD4hep::Callback,unsigned long>;
 
 #ifdef R__MACOSX
 // We only need these declarations for the clang compiler
-#pragma link C++ function operator==( const map<string, DD4hep::Handle<DD4hep::NamedObject> >::iterator&,const map<string, DD4hep::Handle<DD4hep::NamedObject> >::iterator& ); 
-#pragma link C++ function operator!=( const map<string, DD4hep::Handle<DD4hep::NamedObject> >::iterator&,const map<string, DD4hep::Handle<DD4hep::NamedObject> >::iterator& ); 
+#pragma link C++ function operator==( const map<string, DD4hep::Handle<DD4hep::NamedObject> >::iterator&,const map<string, DD4hep::Handle<DD4hep::NamedObject> >::iterator& );
+#pragma link C++ function operator!=( const map<string, DD4hep::Handle<DD4hep::NamedObject> >::iterator&,const map<string, DD4hep::Handle<DD4hep::NamedObject> >::iterator& );
 #endif
 
 #pragma link C++ class DD4hep::ObjectExtensions+;
@@ -251,8 +251,8 @@ template class DD4hep::Handle<TNamed>;
 
 #ifdef R__MACOSX
 // We only need these declarations for the clang compiler
-#pragma link C++ function operator==( const map<string, DD4hep::Geometry::DetElement >::iterator&,const map<string, DD4hep::Geometry::DetElement >::iterator& ); 
-#pragma link C++ function operator!=( const map<string, DD4hep::Geometry::DetElement >::iterator&,const map<string, DD4hep::Geometry::DetElement >::iterator& ); 
+#pragma link C++ function operator==( const map<string, DD4hep::Geometry::DetElement >::iterator&,const map<string, DD4hep::Geometry::DetElement >::iterator& );
+#pragma link C++ function operator!=( const map<string, DD4hep::Geometry::DetElement >::iterator&,const map<string, DD4hep::Geometry::DetElement >::iterator& );
 #endif
 
 #pragma link C++ class DD4hep::Geometry::SensitiveDetector+;
@@ -381,6 +381,8 @@ template vector<pair<string, int> >::iterator;
 #ifdef __HAVE_DDSEGMENTATION__
 #include "DDSegmentation/Segmentation.h"
 #include "DDSegmentation/NoSegmentation.h"
+#include "DDSegmentation/GridPhiEta.h"
+#include "DDSegmentation/GridRPhiEta.h"
 #include "DDSegmentation/CartesianGrid.h"
 #include "DDSegmentation/CartesianGridXY.h"
 #include "DDSegmentation/CartesianGridXYZ.h"
@@ -410,6 +412,8 @@ typedef DD4hep::DDSegmentation::CellID CellID;
 
 #pragma link C++ class DD4hep::DDSegmentation::Segmentation+;
 #pragma link C++ class DD4hep::DDSegmentation::NoSegmentation+;
+#pragma link C++ class DD4hep::DDSegmentation::GridPhiEta+;
+#pragma link C++ class DD4hep::DDSegmentation::GridRPhiEta+;
 #pragma link C++ class DD4hep::DDSegmentation::CartesianGrid+;
 #pragma link C++ class DD4hep::DDSegmentation::CartesianGridXY+;
 #pragma link C++ class DD4hep::DDSegmentation::CartesianGridXYZ+;
diff --git a/DDCore/src/Segmentations.cpp b/DDCore/src/Segmentations.cpp
index 28ef42ea4..d9fd6b33e 100644
--- a/DDCore/src/Segmentations.cpp
+++ b/DDCore/src/Segmentations.cpp
@@ -91,7 +91,7 @@ void Segmentation::neighbours(const CellID& cell, std::set<CellID>& nb) const  {
 std::vector<double> Segmentation::cellDimensions(const CellID& cell) const  {
   return data<Object>()->segmentation->cellDimensions(cell);
 }
-      
+
 /// Access to the base DDSegmentation object. WARNING: Deprecated call!
 Segmentation::BaseSegmentation* Segmentation::segmentation() const  {
   return data<Object>()->segmentation;
@@ -153,6 +153,12 @@ IMPLEMENT_SEGMENTATION_HANDLE(PolarGridRPhi)
 #include "DDSegmentation/PolarGridRPhi2.h"
 IMPLEMENT_SEGMENTATION_HANDLE(PolarGridRPhi2)
 
+#include "DDSegmentation/GridPhiEta.h"
+IMPLEMENT_SEGMENTATION_HANDLE(GridPhiEta)
+
+#include "DDSegmentation/GridRPhiEta.h"
+IMPLEMENT_SEGMENTATION_HANDLE(GridRPhiEta)
+
 #include "DDSegmentation/ProjectiveCylinder.h"
 IMPLEMENT_SEGMENTATION_HANDLE(ProjectiveCylinder)
 
diff --git a/DDCore/src/plugins/LCDDSegmentations.cpp b/DDCore/src/plugins/LCDDSegmentations.cpp
index e4d3ee7f3..04aaf6187 100644
--- a/DDCore/src/plugins/LCDDSegmentations.cpp
+++ b/DDCore/src/plugins/LCDDSegmentations.cpp
@@ -52,6 +52,12 @@ DECLARE_SEGMENTATION(WaferGridXY,create_segmentation<DD4hep::DDSegmentation::Waf
 #include "DDSegmentation/PolarGridRPhi.h"
 DECLARE_SEGMENTATION(PolarGridRPhi,create_segmentation<DD4hep::DDSegmentation::PolarGridRPhi>)
 
+#include "DDSegmentation/GridPhiEta.h"
+DECLARE_SEGMENTATION(GridPhiEta,create_segmentation<DD4hep::DDSegmentation::GridPhiEta>)
+
+#include "DDSegmentation/GridRPhiEta.h"
+DECLARE_SEGMENTATION(GridRPhiEta,create_segmentation<DD4hep::DDSegmentation::GridRPhiEta>)
+
 #include "DDSegmentation/PolarGridRPhi2.h"
 DECLARE_SEGMENTATION(PolarGridRPhi2,create_segmentation<DD4hep::DDSegmentation::PolarGridRPhi2>)
 
-- 
GitLab