From 1a0d5ef04cfcfa27ef09b5cda37b0ce9a2fd4f0c Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 25 Apr 2018 14:24:18 +0200
Subject: [PATCH] AthenaPython: Change beginRun/endRun hooks to start/stop.

beginRun and endRun are no longer supported by Gaudi.
Fixes test failures.
---
 .../AthenaPython/AthenaPython/PyAthenaAlg.h   | 22 +++++++++----------
 Control/AthenaPython/python/PyAthenaComps.py  | 12 +++++-----
 Control/AthenaPython/src/PyAthenaAlg.cxx      |  8 +++----
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/Control/AthenaPython/AthenaPython/PyAthenaAlg.h b/Control/AthenaPython/AthenaPython/PyAthenaAlg.h
index 4079c2f492f..0d1ddeec4ff 100644
--- a/Control/AthenaPython/AthenaPython/PyAthenaAlg.h
+++ b/Control/AthenaPython/AthenaPython/PyAthenaAlg.h
@@ -42,16 +42,16 @@ class Alg : virtual public ::IPyComponent,
   virtual ~Alg(); 
 
   // Framework's Hooks
-  virtual StatusCode initialize();
-  virtual StatusCode reinitialize();
-  virtual StatusCode beginRun();
-  virtual StatusCode execute();
-  virtual StatusCode endRun();
-  virtual StatusCode finalize();
+  virtual StatusCode initialize() override;
+  virtual StatusCode reinitialize() override;
+  virtual StatusCode start() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode stop() override;
+  virtual StatusCode finalize() override;
 
-  virtual StatusCode sysInitialize();
+  virtual StatusCode sysInitialize() override;
 
-  virtual void resetExecuted();
+  virtual void resetExecuted() override;
 
   /////////////////////////////////////////////////////////////////// 
   // Const methods: 
@@ -61,7 +61,7 @@ class Alg : virtual public ::IPyComponent,
    *  This is used by concrete implementations to connect a python
    *  component to its C++ counter-part
    */
-  virtual const char* typeName() const;
+  virtual const char* typeName() const override;
 
   /////////////////////////////////////////////////////////////////// 
   // Non-const methods: 
@@ -69,7 +69,7 @@ class Alg : virtual public ::IPyComponent,
 
   /** @brief return associated python object. BORROWED reference.
    */ 
-  virtual PyObject* self() { return m_self; }
+  virtual PyObject* self() override { return m_self; }
 
   /////////////////////////////////////////////////////////////////// 
   // Protected methods: 
@@ -78,7 +78,7 @@ class Alg : virtual public ::IPyComponent,
 
   /** attach the C++ component to its python cousin
    */
-  virtual bool setPyAttr( PyObject* pyobj );
+  virtual bool setPyAttr( PyObject* pyobj ) override;
 
   /////////////////////////////////////////////////////////////////// 
   // Private data: 
diff --git a/Control/AthenaPython/python/PyAthenaComps.py b/Control/AthenaPython/python/PyAthenaComps.py
index c0424db16d1..e4efef9a384 100644
--- a/Control/AthenaPython/python/PyAthenaComps.py
+++ b/Control/AthenaPython/python/PyAthenaComps.py
@@ -126,16 +126,16 @@ class Alg( CfgPyAlgorithm ):
     def finalize(self):
         return StatusCode.Success
 
-    def sysBeginRun(self):
-        return self.beginRun()
+    def sysStart(self):
+        return self.start()
     
-    def beginRun(self):
+    def start(self):
         return StatusCode.Success
 
-    def sysEndRun(self):
-        return self.endRun()
+    def sysStop(self):
+        return self.stop()
     
-    def endRun(self):
+    def stop(self):
         return StatusCode.Success
 
     def filterPassed(self):
diff --git a/Control/AthenaPython/src/PyAthenaAlg.cxx b/Control/AthenaPython/src/PyAthenaAlg.cxx
index b5c8a6e2dcb..32ec5019107 100644
--- a/Control/AthenaPython/src/PyAthenaAlg.cxx
+++ b/Control/AthenaPython/src/PyAthenaAlg.cxx
@@ -71,15 +71,15 @@ Alg::reinitialize()
 }
 
 StatusCode 
-Alg::beginRun()
+Alg::start()
 { 
-  return PyAthena::callPyMethod( m_self, "sysBeginRun" );
+  return PyAthena::callPyMethod( m_self, "sysStart" );
 }
 
 StatusCode 
-Alg::endRun()
+Alg::stop()
 {
-  return PyAthena::callPyMethod( m_self, "sysEndRun" );
+  return PyAthena::callPyMethod( m_self, "sysStop" );
 }
 
 StatusCode 
-- 
GitLab