From 2582adf411f7e01f292bfe3328a275d74caec034 Mon Sep 17 00:00:00 2001
From: Johannes Josef Junggeburth <johannes.josef.junggeburth@cern.ch>
Date: Sun, 4 Apr 2021 07:40:42 +0000
Subject: [PATCH] Revert "Remove empty cleanUp method"

This reverts commit 33423960f50170686445230ee0fa536dddae3421
---
 .../IMuonTrackSegmentMatchingTool.h              | 16 +++++++++-------
 .../src/MuonSegmentRegionRecoveryTool.cxx        |  1 +
 .../src/MooCandidateMatchingTool.cxx             | 11 +++++++++++
 .../src/MooCandidateMatchingTool.h               |  9 +++++++--
 4 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonTrackSegmentMatchingTool.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonTrackSegmentMatchingTool.h
index 334a48da4fdb..b18b89b087f6 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonTrackSegmentMatchingTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMuonTrackSegmentMatchingTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MUON_IMUONTRACKSEGMENTMATCHINGTOOL_H
@@ -7,6 +7,7 @@
  
 #include "GaudiKernel/IAlgTool.h"
 
+static const InterfaceID IID_IMuonTrackSegmentMatchingTool("Muon::IMuonTrackSegmentMatchingTool",1,0);
 
 namespace Trk {
   class Track;
@@ -22,10 +23,7 @@ namespace Muon {
   {      
     public:
     /** access to tool interface */
-    static const InterfaceID& interfaceID(){
-        static const InterfaceID IID_IMuonTrackSegmentMatchingTool("Muon::IMuonTrackSegmentMatchingTool",1,0);
-        return IID_IMuonTrackSegmentMatchingTool;
-    }
+    static const InterfaceID& interfaceID();
 
     /** @brief clean a track, returns a pointer to a new track if successfull.
 	If the input track is does not require cleaning a pointer the the initial track is return in which case the 
@@ -34,10 +32,14 @@ namespace Muon {
 	The caller should ensure the track gets deleted. */
     virtual bool match( const Trk::Track& track, const MuonSegment& segment, bool useTightCuts = false ) const = 0;
 
-    virtual ~IMuonTrackSegmentMatchingTool() = default;
+    virtual void cleanUp() const = 0;
   };
   
-  
+  inline const InterfaceID& IMuonTrackSegmentMatchingTool::interfaceID()
+  {
+    return IID_IMuonTrackSegmentMatchingTool;
+  }
+
 } // end of name space
 
 #endif 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx
index 094a8c5ac6fe..dd121418ba00 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonSegmentRegionRecoveryTool.cxx
@@ -1154,6 +1154,7 @@ const Trk::TrackParameters* MuonSegmentRegionRecoveryTool::reachableDetEl( const
 
 
   void MuonSegmentRegionRecoveryTool::cleanUp() const {
+    m_trackSegmentMatchingTool->cleanUp();
   }
 
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.cxx
index d7da5f2da3c8..0533602e9ede 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.cxx
@@ -25,6 +25,13 @@
 #include <sstream>
 
 namespace { // local funcs
+#if 0
+inline double robust_acos(double x) {
+  if ( x >=  1.0 ) return 0.0;
+  if ( x <= -1.0 ) return M_PI;
+  return std::acos(x);
+}
+#endif
 
 // limit angle difference to -pi/2 < x <= pi/2
 inline double theta_diff(double x) {
@@ -1463,4 +1470,8 @@ namespace Muon {
     if ( msgLvl(MSG::VERBOSE) ) msg(MSG::VERBOSE) << " Yes!" << endmsg;
     return true;
   }
+ 
+
+  void MooCandidateMatchingTool::cleanUp() const {
+  }
 }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.h b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.h
index 04a721104c71..ace936628b1f 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MOOCANDIDATEMATCHINGTOOL_H
@@ -75,7 +75,10 @@ namespace Muon {
 
     /** finialize method, method taken from bass-class AlgTool */
     virtual StatusCode finalize() override;
-  
+    
+    /** @brief access to tool interface */
+    static const InterfaceID& interfaceID() { return IID_MooCandidateMatchingTool; }
+ 
     /** @brief match two segment entries */
     bool match( const MuPatSegment& entry1, const MuPatSegment& entry2, bool useTightCuts = false ) const;
 
@@ -149,6 +152,8 @@ namespace Muon {
     /** @brief return whether the 2 segments are in neighbouring chambers */
     bool areInNeighbouringChambers( const MuPatSegment& seg1, const MuPatSegment& seg2 ) const;
 
+    void cleanUp() const override;
+
   private:
 
     double m_minimumSideMatchRadius;
-- 
GitLab