From 5f6477da98dba24218b91be360f283059ed4d65b Mon Sep 17 00:00:00 2001
From: Nicolas Koehler <nicolas.koehler@cern.ch>
Date: Mon, 10 Aug 2020 22:20:02 +0000
Subject: [PATCH] Use Eigen instead of CLHEP in AGDD

---
 .../AGDDControl/ExpressionEvaluator.h         | 10 ++---
 .../AGDD/AGDDControl/CMakeLists.txt           |  5 +--
 .../AGDDControl/src/AGDD2GeoModelBuilder.cxx  | 45 +++++++++----------
 .../AGDD/AGDDControl/src/AGDDController.cxx   |  5 ++-
 .../AGDDControl/src/ExpressionEvaluator.cxx   | 30 +------------
 .../AGDDHandlers/snake_pointHandler.h         |  8 ++--
 .../AGDD/AGDDHandlers/CMakeLists.txt          |  7 ---
 .../src/chamberPositionerHandler.cxx          |  5 +--
 .../AGDD/AGDDHandlers/src/mposPhiHandler.cxx  |  3 +-
 .../AGDDHandlers/src/mposWedgeHandler.cxx     |  3 +-
 .../AGDD/AGDDHandlers/src/posRPhiZHandler.cxx |  3 +-
 .../AGDD/AGDDHandlers/src/posXYZHandler.cxx   |  3 +-
 .../AGDD/AGDDHandlers/src/snakeHandler.cxx    | 13 +++---
 .../AGDDHandlers/src/snake_pointHandler.cxx   | 13 ++----
 .../AGDDKernel/AGDDDetectorPositioner.h       |  8 ++--
 .../AGDDKernel/AGDDKernel/AGDDPositioner.h    | 17 +++----
 .../AGDD/AGDDKernel/CMakeLists.txt            |  6 +--
 .../AGDDKernel/src/AGDDDetectorPositioner.cxx | 14 +++---
 .../AGDD/AGDDKernel/src/AGDDPositioner.cxx    | 23 +++++-----
 .../AGDD/AGDDModel/AGDDModel/AGDDSnake.h      | 11 +++--
 .../AGDD/AGDDModel/CMakeLists.txt             |  7 +--
 .../MuonCnv/MuonEventTPCnv/test/make_dd.icc   |  2 +-
 .../MuonAGDDDescription/CMakeLists.txt        |  7 ++-
 MuonSpectrometer/MuonGeoModel/CMakeLists.txt  |  5 +--
 24 files changed, 94 insertions(+), 159 deletions(-)

diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/ExpressionEvaluator.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/ExpressionEvaluator.h
index 31afdb6b982..e3be9284eed 100644
--- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/ExpressionEvaluator.h
+++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/ExpressionEvaluator.h
@@ -1,9 +1,9 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef EXPRESSION_EVALUATOR_H
-#define EXPRESSION_EVALUATOR_H 1
+#define EXPRESSION_EVALUATOR_H
 
 #include "CLHEP/Evaluator/Evaluator.h"
 
@@ -11,9 +11,9 @@
 #include <vector>
 #include <map>
 
-typedef std::map< std::string, double >         ConstantsTable;
-typedef std::map< std::string, double >         PhysicalConstantsTable;
-typedef std::map< std::string, std::string >       ExpressionsTable;
+typedef std::map< std::string, double> ConstantsTable;
+typedef std::map< std::string, double> PhysicalConstantsTable;
+typedef std::map< std::string, std::string> ExpressionsTable;
 
 class ExpressionEvaluator
 {
diff --git a/DetectorDescription/AGDD/AGDDControl/CMakeLists.txt b/DetectorDescription/AGDD/AGDDControl/CMakeLists.txt
index c8986c02c8f..75c8c51915f 100644
--- a/DetectorDescription/AGDD/AGDDControl/CMakeLists.txt
+++ b/DetectorDescription/AGDD/AGDDControl/CMakeLists.txt
@@ -14,7 +14,6 @@ atlas_depends_on_subdirs( PUBLIC
                           DetectorDescription/AGDD/AGDDModel
                           DetectorDescription/GeoModel/GeoModelInterfaces
                           DetectorDescription/GeoModel/GeoModelUtilities
-			              DetectorDescription/GeoPrimitives
                           GaudiKernel
                           Tools/PathResolver )
 
@@ -28,8 +27,8 @@ find_package( GeoModelCore )
 atlas_add_library( AGDDControl
                    src/*.cxx
                    PUBLIC_HEADERS AGDDControl
-                   INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIR}
+                   INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
                    DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps AGDDKernel StoreGateLib SGtests
+                   LINK_LIBRARIES ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AGDDKernel StoreGateLib SGtests
                    PRIVATE_LINK_LIBRARIES AGDDModel GeoModelUtilities GaudiKernel PathResolver )
 
diff --git a/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx b/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx
index f218cb84dca..e5b6a83a1ae 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx
@@ -58,7 +58,6 @@
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/getMessageSvc.h"
 #include "GeoModelInterfaces/StoredMaterialManager.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 #include <iostream>
 #include <sstream>
@@ -226,20 +225,20 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 	static GeoShape *s2=new GeoShapeShift(box1,ttt2);
 	
 	double radius=v->Radius();
-	CLHEP::Hep3Vector axis0(v->GetPoint(0)-v->GetPoint(1));
-	CLHEP::Hep3Vector axis(v->GetPoint(1)-v->GetPoint(0));
-	CLHEP::Hep3Vector axis1;
-	CLHEP::Hep3Vector axis2(v->GetPoint(2)-v->GetPoint(1));
-	double length=axis.mag();
+	GeoTrf::Vector3D axis0(v->GetPoint(0)-v->GetPoint(1));
+	GeoTrf::Vector3D axis(v->GetPoint(1)-v->GetPoint(0));
+	GeoTrf::Vector3D axis1 = GeoTrf::Vector3D::Identity();
+	GeoTrf::Vector3D axis2(v->GetPoint(2)-v->GetPoint(1));
+	double length=axis.norm();
 	double angle1=0;
-	double angle2=std::abs(axis.angle(axis2))/2;
+	double angle2=std::abs(std::atan2(axis.cross(axis2).norm(), axis.dot(axis2)))/2;
 	double delta_l1=0;
 	double delta_l2=radius*std::tan(angle2);
 	double lengthnew=length+delta_l2;
 	GeoShape* solid=new GeoTubs(0.,radius,lengthnew/2.,0.,4*std::asin(1.));
 	
 	const GeoTrf::Vector3D vt(0.,0.,-lengthnew/2.+delta_l2+2.);
-	GeoTrf::Transform3D rrr = GeoTrf::RotateY3D(angle2)*GeoTrf::RotateZ3D(axis2.phi());
+	GeoTrf::Transform3D rrr = GeoTrf::RotateY3D(angle2)*GeoTrf::RotateZ3D(phi(axis2));
 	GeoShape *ssnew=new GeoShapeShift(s1,GeoTrf::Translation3D(vt)*rrr);
 	
 	solid = new GeoShapeSubtraction(solid,ssnew);
@@ -247,7 +246,7 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 	GeoTrf::Vector3D vref(0.,0.,-lengthnew/2.);
 	GeoTrf::Transform3D tref = GeoTrf::Transform3D::Identity()*GeoTrf::Translation3D(vref);
 	solid=new GeoShapeShift(solid,tref);
-	GeoTrf::Transform3D r1 = GeoTrf::RotateZ3D(axis0.phi())*GeoTrf::RotateY3D(axis0.theta());
+	GeoTrf::Transform3D r1 = GeoTrf::RotateZ3D(phi(axis0))*GeoTrf::RotateY3D(theta(axis0));
 	GeoTrf::Vector3D vtt(v->GetPoint(0).x(),v->GetPoint(0).y(),v->GetPoint(0).z());
 	solid=new GeoShapeShift(solid,GeoTrf::Translation3D(vtt)*r1);
 	
@@ -257,17 +256,17 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 		axis=v->GetPoint(i+1)-v->GetPoint(i);
 		axis1=v->GetPoint(i)-v->GetPoint(i-1);
 
-		length=axis.mag();
-		angle1=std::abs(axis.angle(axis1))/2;
+		length=axis.norm();
+		angle1=std::abs(std::atan2(axis.cross(axis1).norm(), axis.dot(axis1)))/2;
 		delta_l1=radius*std::tan(angle1);
 		delta_l2=0;
 		if (i<(v->NrOfPoints()-2)) 
 		{
 			axis2=v->GetPoint(i+2)-v->GetPoint(i+1);
-			angle2=std::abs(axis.angle(axis2))/2;
+			angle2=std::abs(std::atan2(axis.cross(axis2).norm(), axis.dot(axis2)))/2;
 			delta_l2=radius*std::tan(angle2);
 		}
-		length=axis.mag();
+		length=axis.norm();
 		lengthnew=length+delta_l1+delta_l2;
 
 		GeoTrf::Vector3D vvref(0.,0.,-lengthnew/2+delta_l1);
@@ -277,8 +276,8 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 
 		const GeoTrf::Vector3D vt1(0.,0.,+lengthnew/2.-delta_l1-2.);
 		const GeoTrf::Vector3D vt2(0.,0.,-lengthnew/2.+delta_l2+2.);
-		GeoTrf::Transform3D rrr1 = GeoTrf::RotateZ3D(-axis1.phi())*GeoTrf::RotateY3D(angle1);
-		GeoTrf::Transform3D rrr2 = GeoTrf::RotateZ3D(axis2.phi())*GeoTrf::RotateY3D(-angle2);
+		GeoTrf::Transform3D rrr1 = GeoTrf::RotateZ3D(-phi(axis1))*GeoTrf::RotateY3D(angle1);
+		GeoTrf::Transform3D rrr2 = GeoTrf::RotateZ3D(phi(axis2))*GeoTrf::RotateY3D(-angle2);
 		GeoTrf::Transform3D ttt1 = rrr1*GeoTrf::Translation3D(vt1);
 		GeoTrf::Transform3D ttt2 = rrr2*GeoTrf::Translation3D(vt2);
 		GeoShape *ssnew1=new GeoShapeShift(s2,ttt1);
@@ -291,7 +290,7 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 
 		ss=new GeoShapeShift(ss,ttref);
 		
-		GeoTrf::Transform3D rr1 = GeoTrf::RotateZ3D(axis0.phi())*GeoTrf::RotateY3D(axis0.theta());
+		GeoTrf::Transform3D rr1 = GeoTrf::RotateZ3D(phi(axis0))*GeoTrf::RotateY3D(theta(axis0));
 		const GeoTrf::Vector3D vv(v->GetPoint(i).x(),v->GetPoint(i).y(),v->GetPoint(i).z());
 		ss=new GeoShapeShift(ss,GeoTrf::Translation3D(vv)*rr1);
 		solid=new GeoShapeUnion(solid,ss);
@@ -364,14 +363,14 @@ void AGDD2GeoModelBuilder::CreateUnion(AGDDUnion* v)
 	AGDDVolume *vol=pos->GetVolume();
 	vol->CreateSolid();
 	GeoShape *sV=(GeoShape*)(vol->GetSolid());
-	sV=new GeoShapeShift(sV,Amg::CLHEPTransformToEigen(pos->Transform()));
+	sV=new GeoShapeShift(sV,pos->Transform());
  	for (int i=1;i<nPos;i++)
  	{
  		AGDDPositioner* pp=v->GetDaughter(i);
  		AGDDVolume *vv=pp->GetVolume();
  		vv->CreateSolid();
  		GeoShape *nsV=(GeoShape*)(vv->GetSolid());
-		nsV=new GeoShapeShift(nsV,Amg::CLHEPTransformToEigen(pp->Transform()));
+		nsV=new GeoShapeShift(nsV,pp->Transform());
  		sV=new GeoShapeUnion(sV,nsV);
  	}
 	v->SetMaterial(vol->GetMaterial());
@@ -385,14 +384,14 @@ void AGDD2GeoModelBuilder::CreateIntersection(AGDDIntersection* v)
 	AGDDVolume *vol=pos->GetVolume();
 	vol->CreateSolid();
 	GeoShape *sV=(GeoShape*)(vol->GetSolid());
-	sV=new GeoShapeShift(sV,Amg::CLHEPTransformToEigen(pos->Transform()));
+	sV=new GeoShapeShift(sV,pos->Transform());
  	for (int i=1;i<nPos;i++)
  	{
  		AGDDPositioner* pp=v->GetDaughter(i);
  		AGDDVolume *vv=pp->GetVolume();
  		vv->CreateSolid();
  		GeoShape *nsV=(GeoShape*)(vv->GetSolid());
-		nsV=new GeoShapeShift(nsV,Amg::CLHEPTransformToEigen(pp->Transform()));
+		nsV=new GeoShapeShift(nsV,pp->Transform());
  		sV=new GeoShapeIntersection(sV,nsV);
  	}
 	v->SetMaterial(vol->GetMaterial());
@@ -405,14 +404,14 @@ void AGDD2GeoModelBuilder::CreateSubtraction(AGDDSubtraction* v)
 	AGDDVolume *vol=pos->GetVolume();
 	vol->CreateSolid();
 	GeoShape *sV=(GeoShape*)(vol->GetSolid());
-	sV=new GeoShapeShift(sV,Amg::CLHEPTransformToEigen(pos->Transform()));
+	sV=new GeoShapeShift(sV,pos->Transform());
  	for (int i=1;i<nPos;i++)
  	{
  		AGDDPositioner* pp=v->GetDaughter(i);
  		AGDDVolume *vv=pp->GetVolume();
  		vv->CreateSolid();
  		GeoShape *nsV=(GeoShape*)(vv->GetSolid());
-		nsV=new GeoShapeShift(nsV,Amg::CLHEPTransformToEigen(pp->Transform()));
+		nsV=new GeoShapeShift(nsV,pp->Transform());
  		sV=new GeoShapeSubtraction(sV,nsV);
  	}
 	v->SetMaterial(vol->GetMaterial());
@@ -499,7 +498,7 @@ void AGDD2GeoModelBuilder::CreateComposition(AGDDComposition *v)
 					log<<MSG::WARNING<<"CreateComposition() - AGDDDetectorPositioner is nullptr"<<endmsg;
 				}
 			}
-			GeoTrf::Transform3D trf=Amg::CLHEPTransformToEigen(pos->Transform());
+			GeoTrf::Transform3D trf=pos->Transform();
 			GeoTransform *geotrf=new GeoTransform(trf);
 			void *temp=vol->GetVolume();
 			
diff --git a/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx b/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
index 236a138742e..307f982b2ee 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
@@ -3,6 +3,7 @@
 */
 
 #include "AGDDControl/AGDDController.h"
+
 #include "AGDDKernel/AGDDBuilder.h"
 #include "AGDDControl/IAGDDParser.h"
 #include "AGDDControl/XercesParser.h"
@@ -12,21 +13,21 @@
 #include "AGDDKernel/AGDDVolume.h"
 #include "AGDDKernel/AGDDPositioner.h"
 #include "AGDDKernel/AliasStore.h"
-
 #include "GeoModelInterfaces/IGeoModelSvc.h"
 #include "GeoModelUtilities/GeoModelExperiment.h"
 #include "GeoModelKernel/GeoVDetectorManager.h"
 #include "GeoModelKernel/GeoPhysVol.h"
 #include "GeoModelKernel/GeoVPhysVol.h"
 #include "GeoModelKernel/GeoPVConstLink.h"
-
 #include "StoreGate/StoreGateSvc.h"
+
 #include <map>
 #include <vector>
 #include <string>
 #include <fstream>
 #include <ctime>
 #include <TString.h> // for Form
+#include <iostream>
 
 std::vector<const GeoLogVol*> volumeMap;
 
diff --git a/DetectorDescription/AGDD/AGDDControl/src/ExpressionEvaluator.cxx b/DetectorDescription/AGDD/AGDDControl/src/ExpressionEvaluator.cxx
index 7b32e816368..7b9d4bcaec4 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/ExpressionEvaluator.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/ExpressionEvaluator.cxx
@@ -1,13 +1,10 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
-//
 #include "AGDDControl/ExpressionEvaluator.h"
 #include "AGDDControl/AGDDTokenizer.h"
-#include "CLHEP/Units/PhysicalConstants.h"
-#include <string>
-#include <vector>
+
 #include <cstdlib>
 #include <cctype>
 #include <cstring>
@@ -15,14 +12,10 @@
 #include <sstream>
 #include <algorithm>
 
-namespace CLHEP {}
-using namespace CLHEP;
-
 ExpressionEvaluator::ExpressionEvaluator()
 {
   m_calc.clear();
   m_calc.setStdMath();                 // set standard constants and functions
-  //m_calc.setSystemOfUnits();           // set SI units
   // Set Geant4 system of units
   m_calc.setSystemOfUnits(1.e+3, 1./1.60217733e-25, 1.e+9, 1./1.60217733e-10,1.0, 1.0, 1.0);
   m_fileCurrentlyParsed = "";
@@ -47,7 +40,6 @@ bool ExpressionEvaluator::RegisterConstant( std::string& c, double v )
     return false;
   }
 
-  //RegisterVariable( c->get_name(), c->get_value() );
   RegisterVariable( c, value );
   return true;
 }
@@ -61,7 +53,6 @@ bool ExpressionEvaluator::RegisterArray( std::string& c, std::vector<double> v)
     ss << i;
     ss >> index;
     std::string name = c+"_"+index+"_";
-//    std::cout << "setting variable: " << name << " with value: " << value << std::endl;
     RegisterVariable( name, value );       
    }
    return true;
@@ -102,8 +93,6 @@ bool ExpressionEvaluator::is_delimiter(char c)
 double ExpressionEvaluator::EvaluateString(const std::string& str)
 {
  std::string str_mod = str;
-// if(m_fileCurrentlyParsed != "")
-// {
   const char* c_str_mod = str.c_str(); //string to be modified with file namespace! 
   std::vector<int> variable_ends;  //variable names to be changed
   int cur_variable_end = 0;
@@ -139,7 +128,6 @@ double ExpressionEvaluator::EvaluateString(const std::string& str)
     c_str_mod++;
     cur_variable_end++;
    }
-//  }// variable ends stored in vector
   std::string::size_type shift = 0;
   std::string::size_type ns_length = m_fileCurrentlyParsed.size();
   for(unsigned int i=0; i<variable_ends.size(); i++)
@@ -164,10 +152,7 @@ bool ExpressionEvaluator::RegisterPhysConstant( std::string& c, std::string valu
   expr += unit;
   expr += ")";
 
-  //std::cout << "Expression evaluator:: evaluating string: " << expr << std::endl;
-
   double dvalue      = EvaluateString( expr );
-//  double unit_value = EvaluateString( unit );
 
   if( m_calc.status() != HepTool::Evaluator::OK )
   {
@@ -178,7 +163,6 @@ bool ExpressionEvaluator::RegisterPhysConstant( std::string& c, std::string valu
     return false;
   }
 
-  //RegisterVariable( physc->get_name(), expr );
   RegisterVariable( c, dvalue );
   return true;
 }
@@ -198,7 +182,6 @@ bool ExpressionEvaluator::RegisterExpression( std::string& name, std::string tex
     return false;
   }
 
-  //RegisterVariable( e->get_name(), e->get_text() );
   RegisterVariable( name, value );
   return true;
 }
@@ -217,9 +200,7 @@ double ExpressionEvaluator::Eval( const char* expr_mod )
   while(true)
   {
    start_index = expr.find('[', start_index); 
-//   std::cout<<"*** start_index "<<start_index<<" "<<expr<<std::endl;  
    if(start_index == std::string::npos) break;
-//   std::cout << " start index "<<start_index<<std::endl;
    std::string::size_type boundary_index = expr.find(']', start_index);
    expr.replace(start_index,1,1,'_');
    end_index = expr.find(',', start_index);
@@ -228,7 +209,6 @@ double ExpressionEvaluator::Eval( const char* expr_mod )
     start_index++;
     std::string var1 = expr.substr(start_index, end_index-start_index);
     double eval1 = EvaluateString( var1 );
-    //std::cout<<"Evaluated "<<var1<<" to: "<<eval1<<std::endl;
     std::stringstream ss1;
     std::string str1;
     ss1 << eval1;
@@ -238,19 +218,16 @@ double ExpressionEvaluator::Eval( const char* expr_mod )
    else
    {
     end_index = boundary_index;
-//    std::cout << " end index "<<end_index<<std::endl;
     if(end_index != std::string::npos)
     {
      start_index++;
      std::string var1 = expr.substr(start_index, end_index-start_index);
      double eval1 = EvaluateString( var1 );
-     //std::cout<<"Evaluated "<<var1<<" to: "<<eval1<<std::endl;
      std::stringstream ss1;
      std::string str1;
      ss1 << eval1;
      ss1 >> str1;
      expr.replace(start_index, end_index-start_index, str1, 0, str1.size());
-//     std::cout <<" str1 "<<str1<<std::endl;
     }
    }
   }
@@ -265,7 +242,6 @@ double ExpressionEvaluator::Eval( const char* expr_mod )
    start_index++;
    std::string var2 = expr.substr(start_index, end_index-start_index);
    double eval2 = EvaluateString( var2 );
-   //std::cout<<"Evaluated "<<var2<<" to: "<<eval2<<std::endl;
    std::stringstream ss2;
    std::string str2;
    ss2 << eval2;
@@ -280,12 +256,10 @@ double ExpressionEvaluator::Eval( const char* expr_mod )
    if(start_index == std::string::npos) break;
    expr.replace(start_index,1,1,'_');
   }
-//  std::cout<<"***************** "<<expr<<std::endl;
   double result = EvaluateString( expr );
   if( m_calc.status() != HepTool::Evaluator::OK )
   {
     std::cerr << expr << std::endl;
-    //std::cerr << "------";
     for (int i=0; i<m_calc.error_position(); i++)
     {
       std::cerr << "-";
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.h
index 121054a6b1a..d80b989c691 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef snake_pointHandler_H
@@ -7,7 +7,7 @@
 
 #include "AGDDControl/XMLHandler.h"
 
-#include "CLHEP/Vector/ThreeVector.h"
+#include "GeoModelKernel/GeoDefinitions.h"
 
 #include <string>
 
@@ -15,9 +15,9 @@ class snake_pointHandler:public XMLHandler {
 public:
 	snake_pointHandler(std::string);
 	void ElementHandle();
-	static CLHEP::Hep3Vector CurrentPoint() {return s_point;}
+	static GeoTrf::Vector3D CurrentPoint() {return s_point;}
 private:
-	static CLHEP::Hep3Vector s_point;
+	static GeoTrf::Vector3D s_point;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/CMakeLists.txt b/DetectorDescription/AGDD/AGDDHandlers/CMakeLists.txt
index a4093c7bf8e..616d8db2eb9 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/CMakeLists.txt
+++ b/DetectorDescription/AGDD/AGDDHandlers/CMakeLists.txt
@@ -5,13 +5,6 @@
 # Declare the package name:
 atlas_subdir( AGDDHandlers )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          DetectorDescription/AGDD/AGDDControl
-                          DetectorDescription/AGDD/AGDDKernel
-                          PRIVATE
-                          DetectorDescription/AGDD/AGDDModel )
-
 # External dependencies:
 find_package( CLHEP )
 
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx
index 235a65b70dc..50ec56b22bc 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx
@@ -9,7 +9,6 @@
 #include "GeoModelKernel/Units.h"
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/getMessageSvc.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 #include <iostream>
 
@@ -66,7 +65,7 @@ void chamberPositionerHandler::ElementHandle()
  			double zpos=zPos;
  			GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos);
  			AGDDDetectorPositioner *p __attribute__((__unused__));
- 			p=new AGDDDetectorPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot));
+ 			p=new AGDDDetectorPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 			p->SensitiveDetector(true);
 			p->ID.phiIndex=i;
 			p->ID.sideIndex=1;
@@ -96,7 +95,7 @@ void chamberPositionerHandler::ElementHandle()
             double zpos=zPos;
             GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,-zpos);
             AGDDDetectorPositioner *p __attribute__((__unused__));
-            p=new AGDDDetectorPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot));
+            p=new AGDDDetectorPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 			p->SensitiveDetector(true);
 			p->ID.phiIndex=i;
 			p->ID.sideIndex=-1;
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx
index bd7d0c3f0d1..2df718c0606 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx
@@ -7,7 +7,6 @@
 #include "GeoModelKernel/Units.h"
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/getMessageSvc.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 #include <iostream>
 
@@ -72,6 +71,6 @@ void mposPhiHandler::ElementHandle()
 		if (s!="false"&&i>0) crot = GeoTrf::RotateZ3D(dphi*GeoModelKernelUnits::degree)*crot;
 		else if (s!="false"&&i==0) crot = GeoTrf::RotateZ3D(phi0*GeoModelKernelUnits::degree)*crot;
 
-		p=new AGDDPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot));
+		p=new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 	}
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx
index 4808379f990..e6ebb99cdaa 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx
@@ -5,7 +5,6 @@
 #include "AGDDHandlers/mposWedgeHandler.h"
 #include "AGDDKernel/AGDDPositioner.h"
 #include "GeoModelKernel/Units.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 #include <iostream>
 #include <vector>
@@ -34,6 +33,6 @@ void mposWedgeHandler::ElementHandle()
 		double zpos=0;
 		GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos);
 
-		p=new AGDDPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot));
+		p=new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 	}
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx
index 10986c214e1..2e76c3b625c 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx
@@ -5,7 +5,6 @@
 #include "AGDDHandlers/posRPhiZHandler.h"
 #include "AGDDKernel/AGDDPositioner.h"
 #include "GeoModelKernel/Units.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 #include <iostream>
 #include <vector>
@@ -35,5 +34,5 @@ void posRPhiZHandler::ElementHandle()
 	double y=radius*std::sin(phi*GeoModelKernelUnits::degree);
 	GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos);
 
-	p=new AGDDPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot));
+	p=new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx
index 58c2172ddea..6b2a8afd7b4 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx
@@ -12,6 +12,7 @@
 #include "CLHEP/Vector/Rotation.h"
 #include "CLHEP/Vector/ThreeVector.h"
 #include "CLHEP/Geometry/Transform3D.h"
+#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 posXYZHandler::posXYZHandler(std::string s):XMLHandler(s)
 {
@@ -45,6 +46,6 @@ void posXYZHandler::ElementHandle()
 		if (rotRet) std::cout<<" rot= ("<<rot[0]<<";"<<rot[1]<<";"<<rot[2]<<")";
 		std::cout<<std::endl;
 	}
-	AGDDPositioner *p=new AGDDPositioner(volume,HepGeom::Transform3D(crot,cvec));
+	AGDDPositioner *p=new AGDDPositioner(volume,Amg::CLHEPTransformToEigen(HepGeom::Transform3D(crot,cvec)));
 	globals::currentPositioner=p;
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx
index 29d19f4da30..1be4ced7c70 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx
@@ -1,32 +1,29 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AGDDHandlers/snakeHandler.h"
 #include "AGDDControl/XercesParser.h"
 #include "AGDDHandlers/snake_pointHandler.h"
 #include "AGDDModel/AGDDSnake.h"
-#include <iostream>
-
-#include "CLHEP/Vector/ThreeVector.h"
 
+#include <iostream>
 #include <vector>
 
 using namespace xercesc;
 
 snakeHandler::snakeHandler(std::string s):XMLHandler(s)
 {
-//	std::cout<<"Creating handler for snake"<<std::endl;
 }
 
 void snakeHandler::ElementHandle()
 {
-	bool res;
+	bool res=false;
 	std::string name=getAttributeAsString("name",res);
 	std::string material=getAttributeAsString("material",res);
 	double radius=getAttributeAsDouble("radius",res);
 	
-	std::vector<CLHEP::Hep3Vector> points;
+	std::vector<GeoTrf::Vector3D> points;
 	
 	AGDDSnake *vol=new AGDDSnake(name);
  	vol->SetMaterial(material);
@@ -40,7 +37,7 @@ void snakeHandler::ElementHandle()
     {
         if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
         XercesParser::elementLoop(child);
-		CLHEP::Hep3Vector p=snake_pointHandler::CurrentPoint();
+		GeoTrf::Vector3D p=snake_pointHandler::CurrentPoint();
 		points.push_back(p);
        }
     }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx
index e3856df0ce3..b452eda67f8 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx
@@ -1,25 +1,20 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AGDDHandlers/snake_pointHandler.h"
 
-#include "CLHEP/Vector/ThreeVector.h"
-
 #include <iostream>
 
-CLHEP::Hep3Vector snake_pointHandler::s_point(0.,0.);
+GeoTrf::Vector3D snake_pointHandler::s_point(GeoTrf::Vector3D::Identity());
 
 snake_pointHandler::snake_pointHandler(std::string s):XMLHandler(s)
 {
-//	std::cout<<"Creating handler for snake_point"<<std::endl;
 }
 
 void snake_pointHandler::ElementHandle()
 {
-	bool res;
+	bool res=false;
 	std::vector<double> vvv=getAttributeAsVector("X_Y_Z",res);
-	s_point.setX(vvv[0]);
-	s_point.setY(vvv[1]);
-	s_point.setZ(vvv[2]);
+	s_point = GeoTrf::Vector3D(vvv[0], vvv[1], vvv[2]);
 }
diff --git a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h
index f5b5739717d..e97ec996234 100644
--- a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h
+++ b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef AGDDDetectorPositioner_H
@@ -7,9 +7,6 @@
 
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "GeoModelKernel/GeoFullPhysVol.h"
-#include "CLHEP/Geometry/Transform3D.h"
-#include "CLHEP/Vector/ThreeVector.h"
-#include "CLHEP/Vector/Rotation.h"
 
 #include "AGDDKernel/AGDDPositioner.h"
 
@@ -41,7 +38,8 @@ struct DetectorPositionParameters {
 
 class AGDDDetectorPositioner:public AGDDPositioner {
 public:
-	AGDDDetectorPositioner(std::string n,HepGeom::Transform3D t);
+	AGDDDetectorPositioner(const std::string& n, GeoTrf::Transform3D t);
+    virtual ~AGDDDetectorPositioner()=default;
 
 	Identifiers ID;
 
diff --git a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h
index ed08246b939..2f7148df96a 100644
--- a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h
+++ b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h
@@ -5,9 +5,6 @@
 #ifndef AGDDPositioner_H
 #define AGDDPositioner_H
 
-#include "CLHEP/Geometry/Transform3D.h"
-#include "CLHEP/Vector/ThreeVector.h"
-#include "CLHEP/Vector/Rotation.h"
 #include "GeoModelKernel/GeoDefinitions.h"
 
 #include <string>
@@ -16,20 +13,20 @@ class AGDDVolume;
 
 class AGDDPositioner {
 public:
-	AGDDPositioner(std::string n,HepGeom::Transform3D t);
-	virtual ~AGDDPositioner() {;}
-	std::string Volume();
-	AGDDVolume *GetVolume();
-	const HepGeom::Transform3D& Transform();
+    AGDDPositioner(const std::string& n, GeoTrf::Transform3D t);
+    virtual ~AGDDPositioner()=default;
+    std::string Volume();
+    AGDDVolume *GetVolume();
+    const GeoTrf::Transform3D& Transform();
     bool IsSensitiveDetector() {return m_isSensitiveDetector;}
-	void SensitiveDetector(bool a) {m_isSensitiveDetector=a;}
+    void SensitiveDetector(bool a) {m_isSensitiveDetector=a;}
 	
 private:
 
 	bool m_isSensitiveDetector;
 	std::string m_volume;
 	AGDDVolume *m_theVolume;
-	HepGeom::Transform3D m_transform;
+	GeoTrf::Transform3D m_transform;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDKernel/CMakeLists.txt b/DetectorDescription/AGDD/AGDDKernel/CMakeLists.txt
index b0c239c9813..56c8ad846fd 100644
--- a/DetectorDescription/AGDD/AGDDKernel/CMakeLists.txt
+++ b/DetectorDescription/AGDD/AGDDKernel/CMakeLists.txt
@@ -9,7 +9,6 @@ atlas_depends_on_subdirs( PUBLIC
                           DetectorDescription/GeoPrimitives )
 
 # External dependencies:
-find_package( CLHEP )
 find_package( Eigen )
 find_package( GeoModelCore )
 
@@ -17,7 +16,6 @@ find_package( GeoModelCore )
 atlas_add_library( AGDDKernel
                    src/*.cxx
                    PUBLIC_HEADERS AGDDKernel
-                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
-                   DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES GeoPrimitives ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} )
+                   INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
+                   LINK_LIBRARIES GeoPrimitives ${GEOMODELCORE_LIBRARIES} )
 
diff --git a/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx b/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx
index f929ef033b6..41e44625389 100644
--- a/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx
+++ b/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AGDDKernel/AGDDDetectorPositioner.h"
@@ -7,10 +7,8 @@
 #include "AGDDKernel/AGDDVolume.h"
 #include "AGDDKernel/AGDDVolumeStore.h"
 
-#include "CLHEP/Geometry/Transform3D.h"
-#include "CLHEP/Vector/ThreeVector.h"
-#include "CLHEP/Vector/Rotation.h"
-
-AGDDDetectorPositioner::AGDDDetectorPositioner(std::string n,HepGeom::Transform3D t):AGDDPositioner(n,t),theDetector(0),theVolume(0)
-{
-}
\ No newline at end of file
+AGDDDetectorPositioner::AGDDDetectorPositioner(const std::string& n, GeoTrf::Transform3D t) :
+  AGDDPositioner(n,t),
+  theDetector(nullptr),
+  theVolume(nullptr) {
+}
diff --git a/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx b/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx
index 6257e84ec34..c06ad59ea68 100644
--- a/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx
+++ b/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AGDDKernel/AGDDPositioner.h"
@@ -7,26 +7,23 @@
 #include "AGDDKernel/AGDDVolume.h"
 #include "AGDDKernel/AGDDVolumeStore.h"
 
-#include "CLHEP/Geometry/Transform3D.h"
-#include "CLHEP/Vector/ThreeVector.h"
-#include "CLHEP/Vector/Rotation.h"
-
-AGDDPositioner::AGDDPositioner(std::string n,HepGeom::Transform3D t):m_isSensitiveDetector(false),m_volume(n),m_transform(t)
-{
+AGDDPositioner::AGDDPositioner(const std::string& n, GeoTrf::Transform3D t) :
+  m_isSensitiveDetector(false),
+  m_volume(n),
+  m_transform(t) {
 	AGDDPositionerStore::GetPositionerStore()->RegisterPositioner(this);
 	m_theVolume=AGDDVolumeStore::GetVolumeStore()->GetVolume(Volume());
 }
-std::string AGDDPositioner::Volume() 
-{
+
+std::string AGDDPositioner::Volume() {
 	return m_volume;
 }
-const HepGeom::Transform3D& AGDDPositioner::Transform() 
-{
+
+const GeoTrf::Transform3D& AGDDPositioner::Transform() {
 	return m_transform;
 } 
 
-AGDDVolume* AGDDPositioner::GetVolume() 
-{
+AGDDVolume* AGDDPositioner::GetVolume() {
 	return m_theVolume;
 } 
 
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h
index 84a7677c3c2..803f0fbc3fd 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h
@@ -1,33 +1,32 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef AGDDSnake_H
 #define AGDDSnake_H
 
 #include "AGDDKernel/AGDDVolume.h"
+
 #include <string>
 #include <vector>
 #include <iostream>
 
-#include "CLHEP/Vector/ThreeVector.h"
-
 class AGDDSnake: public AGDDVolume {
 public:
 	AGDDSnake(std::string s):AGDDVolume(s),m_radius(0) {}
-	void SetPoint(CLHEP::Hep3Vector p)
+	void SetPoint(GeoTrf::Vector3D p)
 	{
 		m_points.push_back(p);
 	}
 	int NrOfPoints() {return m_points.size();}
 	double Radius() {return m_radius;}
 	void Radius(double d) {m_radius=d;}
-	CLHEP::Hep3Vector GetPoint(int i) {return m_points[i];}
+	GeoTrf::Vector3D GetPoint(int i) {return m_points[i];}
 	void CreateVolume();
 	void CreateSolid();
 private:
 	double m_radius;
-	std::vector<CLHEP::Hep3Vector> m_points;
+	std::vector<GeoTrf::Vector3D> m_points;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/CMakeLists.txt b/DetectorDescription/AGDD/AGDDModel/CMakeLists.txt
index bcae1501378..ae6002f6569 100644
--- a/DetectorDescription/AGDD/AGDDModel/CMakeLists.txt
+++ b/DetectorDescription/AGDD/AGDDModel/CMakeLists.txt
@@ -9,14 +9,9 @@ atlas_subdir( AGDDModel )
 atlas_depends_on_subdirs( PUBLIC
                           DetectorDescription/AGDD/AGDDKernel )
 
-# External dependencies:
-find_package( CLHEP )
-
 # Component(s) in the package:
 atlas_add_library( AGDDModel
                    src/*.cxx
                    PUBLIC_HEADERS AGDDModel
-                   INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
-                   DEFINITIONS ${CLHEP_DEFINITIONS}
-                   LINK_LIBRARIES ${CLHEP_LIBRARIES} AGDDKernel )
+                   LINK_LIBRARIES AGDDKernel )
 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/make_dd.icc b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/make_dd.icc
index 644ac83701a..03a94f19864 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/make_dd.icc
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/make_dd.icc
@@ -320,7 +320,7 @@ const MuonGM::MuonDetectorManager& make_dd()
   ddsdet.roParameters.nWireGroups.push_back(0);
   ddsdet.roParameters.wireCutout.push_back(0);
 
-  HepGeom::Transform3D xform;
+  GeoTrf::Transform3D xform = GeoTrf::Transform3D::Identity();
   AGDDDetectorPositioner* spos2 = new AGDDDetectorPositioner ("psdum2", xform);
   deleter.add (spos2);
   spos2->theDetector = &ddsdet;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/CMakeLists.txt b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/CMakeLists.txt
index 3d00f656c93..3fe96c40d10 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/CMakeLists.txt
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/CMakeLists.txt
@@ -8,13 +8,12 @@ atlas_subdir( MuonAGDDDescription )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           DetectorDescription/AGDD/AGDDKernel
-                          PRIVATE
-                          DetectorDescription/AGDD/AGDDModel )
+                          DetectorDescription/AGDD/AGDDModel
+                        )
 
 # Component(s) in the package:
 atlas_add_library( MuonAGDDDescription
                    src/*.cxx
                    PUBLIC_HEADERS MuonAGDDDescription
-                   LINK_LIBRARIES AGDDKernel
-                   PRIVATE_LINK_LIBRARIES AGDDModel )
+                   LINK_LIBRARIES AGDDKernel AGDDModel )
 
diff --git a/MuonSpectrometer/MuonGeoModel/CMakeLists.txt b/MuonSpectrometer/MuonGeoModel/CMakeLists.txt
index 38fab36fef7..9686f3767c2 100644
--- a/MuonSpectrometer/MuonGeoModel/CMakeLists.txt
+++ b/MuonSpectrometer/MuonGeoModel/CMakeLists.txt
@@ -5,7 +5,6 @@
 # Declare the package name:
 atlas_subdir( MuonGeoModel )
 
-
 # External dependencies:
 find_package( Boost COMPONENTS filesystem thread system )
 find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
@@ -17,8 +16,8 @@ atlas_add_library( MuonGeoModelLib
                    src/*.cxx
                    PUBLIC_HEADERS MuonGeoModel
                    PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel MuonCondInterface MuonReadoutGeometry MuonGMdbObjects StoreGateLib SGtests MuonIdHelpersLib AmdcDbLib
-                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaPoolUtilities AGDDKernel IdDictDetDescr MuonAGDDDescription MuonDetDescrUtils )
+                   LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaKernel GeoModelUtilities GaudiKernel MuonCondInterface MuonReadoutGeometry MuonGMdbObjects StoreGateLib SGtests MuonIdHelpersLib MuonAGDDDescription AGDDKernel AmdcDbLib
+                   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaPoolUtilities IdDictDetDescr MuonDetDescrUtils )
 
 atlas_add_component( MuonGeoModel
                      src/components/*.cxx
-- 
GitLab