From d652d8d20802678d87d4c48637860358164a6551 Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Tue, 7 May 2019 17:37:06 +0200
Subject: [PATCH] Finalize  surface integration in DD4hep with recent ROOT
 updates

---
 DDCore/include/DD4hep/Objects.h | 10 ++++++++--
 DDCore/src/Objects.cpp          |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/DDCore/include/DD4hep/Objects.h b/DDCore/include/DD4hep/Objects.h
index ebe6ac9fc..ffb6e9086 100644
--- a/DDCore/include/DD4hep/Objects.h
+++ b/DDCore/include/DD4hep/Objects.h
@@ -33,8 +33,6 @@ class TGeoIdentity;
 #pragma GCC diagnostic ignored "-Wdeprecated" // Code that causes warning goes here
 #endif
 // ROOT include files
-#include "TGeoPhysicalNode.h"
-#include "TGDMLMatrix.h"
 #include "Math/Vector3D.h"
 #include "Math/Transform3D.h"
 #include "Math/Translation3D.h"
@@ -45,6 +43,10 @@ class TGeoIdentity;
 #include "Math/RotationZYX.h"
 #include "Math/EulerAngles.h"
 #include "Math/VectorUtil.h"
+#include "TGeoPhysicalNode.h"
+#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0)
+#include "TGDMLMatrix.h"
+#endif
 #ifdef __GNUC__
 #pragma GCC diagnostic pop
 #endif
@@ -262,7 +264,9 @@ namespace dd4hep {
    */
   class Material: public Handle<TGeoMedium> {
   public:
+#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0)
     typedef const TGDMLMatrix* Property;
+#endif
   public:
     /// Default constructor
     Material() = default;
@@ -292,10 +296,12 @@ namespace dd4hep {
     double intLength() const;
     /// Access the fraction of an element within the material
     double fraction(Atom atom) const;
+#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0)
     /// Access to tabular properties of the material
     Property property(const char* name)  const;
     /// Access to tabular properties of the material
     Property property(const std::string& name)  const;
+#endif
   };
 
   /// Handle class describing visualization attributes
diff --git a/DDCore/src/Objects.cpp b/DDCore/src/Objects.cpp
index a7363cda2..c115f074e 100644
--- a/DDCore/src/Objects.cpp
+++ b/DDCore/src/Objects.cpp
@@ -256,6 +256,7 @@ double Material::fraction(Atom atom) const    {
   return tot>1e-20 ? frac/tot : 0.0;
 }
 
+#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0)
 /// Access to tabular properties of the optical surface
 Material::Property Material::property(const char* nam)  const    {
   return access()->GetMaterial()->GetProperty(nam);
@@ -265,6 +266,7 @@ Material::Property Material::property(const char* nam)  const    {
 Material::Property Material::property(const std::string& nam)  const   {
   return access()->GetMaterial()->GetProperty(nam.c_str());
 }
+#endif
 
 /// String representation of this object
 string Material::toString() const {
-- 
GitLab