From e4a2627910408bc638f44ed75a9548cf4ad643c8 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Fri, 24 Apr 2020 17:12:20 +0200
Subject: [PATCH] Remove ROOT version checks from AthenaRootComps

---
 .../AthenaRootComps/src/LeafCnv.cxx           | 12 ------------
 .../src/RootDataBucketBranch.cxx              | 19 -------------------
 .../AthenaRootComps/src/xAODCnv.cxx           | 12 ------------
 3 files changed, 43 deletions(-)

diff --git a/Database/AthenaRoot/AthenaRootComps/src/LeafCnv.cxx b/Database/AthenaRoot/AthenaRootComps/src/LeafCnv.cxx
index 31b3a984cdb..dd1852188f9 100644
--- a/Database/AthenaRoot/AthenaRootComps/src/LeafCnv.cxx
+++ b/Database/AthenaRoot/AthenaRootComps/src/LeafCnv.cxx
@@ -110,21 +110,9 @@ StatusCode LeafCnv::initialize()
   }
 
   RootType ty = dictSvc->load_type(this->objType());
-#if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
-  if (!ty.Id()) {
-    ATH_MSG_ERROR("could not load the dictionary for clid ["
-                  << this->objType() << "]!");
-    return StatusCode::FAILURE;
-  } else {
-    ATH_MSG_VERBOSE("loaded dictionary for clid ["
-                    << this->objType() << "]: name=["
-                    << ty.Name() << "]");
-  }
-#else
   ATH_MSG_VERBOSE("loaded dictionary for clid ["
                   << this->objType() << "]: name=["
                   << ty.Name() << "]");
-#endif
   m_type = ty;
 
   ATH_MSG_DEBUG("converter correctly initialized - clid=[" << objType() << "]");
diff --git a/Database/AthenaRoot/AthenaRootComps/src/RootDataBucketBranch.cxx b/Database/AthenaRoot/AthenaRootComps/src/RootDataBucketBranch.cxx
index 063a7169cce..efeef4a1ee4 100644
--- a/Database/AthenaRoot/AthenaRootComps/src/RootDataBucketBranch.cxx
+++ b/Database/AthenaRoot/AthenaRootComps/src/RootDataBucketBranch.cxx
@@ -44,30 +44,11 @@ DataBucketBranch::cast(CLID clid, SG::IRegisterTransient* /*itr*/,
 }
 
 void*
-#if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
-DataBucketBranch::cast(const std::type_info& tinfo,
-#else
 DataBucketBranch::cast(const std::type_info& /*tinfo*/,
-#endif
                        SG::IRegisterTransient* /*itr*/,
                        bool /*isConst*/)
 {
-#if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
-  // no conversion needed
-  if (tinfo == m_type.TypeInfo()) {
-    return m_ptr;
-  } else {
-    std::ostringstream err;
-    err << "cannot convert from type-info [" 
-        << System::typeinfoName(m_type.TypeInfo())
-        << "] to requested ["
-        << System::typeinfoName(tinfo)
-        << "]";
-    throw std::runtime_error(err.str());
-  }
-#else
   return m_ptr;
-#endif
 }
 
 } //> namespace Athena
diff --git a/Database/AthenaRoot/AthenaRootComps/src/xAODCnv.cxx b/Database/AthenaRoot/AthenaRootComps/src/xAODCnv.cxx
index 41b678e8022..3051d12caaa 100644
--- a/Database/AthenaRoot/AthenaRootComps/src/xAODCnv.cxx
+++ b/Database/AthenaRoot/AthenaRootComps/src/xAODCnv.cxx
@@ -111,21 +111,9 @@ StatusCode xAODCnv::initialize()
   }
 
   RootType ty = dictSvc->load_type(this->objType());
-#if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
-  if (!ty.Id()) {
-    ATH_MSG_ERROR("could not load the dictionary for clid ["
-                  << this->objType() << "]!");
-    return StatusCode::FAILURE;
-  } else {
-    ATH_MSG_VERBOSE("loaded dictionary for clid ["
-                    << this->objType() << "]: name=["
-                    << ty.Name() << "]");
-  }
-#else
   ATH_MSG_VERBOSE("loaded dictionary for clid ["
                   << this->objType() << "]: name=["
                   << ty.Name() << "]");
-#endif
   m_type = ty;
 
   ATH_MSG_DEBUG("converter correctly initialized - clid=[" << objType() << "]");
-- 
GitLab