diff --git a/Control/AthToolSupport/AsgExampleTools/test/gt_AnaCheck.cxx b/Control/AthToolSupport/AsgExampleTools/test/gt_AnaCheck.cxx
index 6847f5a4f8b241500f3f63e461ab487d3429a131..7e4e40b43f7a00ae7145d7d2823d842ca95a6350 100644
--- a/Control/AthToolSupport/AsgExampleTools/test/gt_AnaCheck.cxx
+++ b/Control/AthToolSupport/AsgExampleTools/test/gt_AnaCheck.cxx
@@ -64,7 +64,7 @@ namespace asg
   {
     checkType<StatusCode> (StatusCode::SUCCESS, StatusCode::FAILURE, StatusCode::FAILURE, [] (const StatusCode& sc) -> bool {return sc.isSuccess();});
 #ifdef ROOTCORE
-    checkType<xAOD::TReturnCode> (xAOD::TReturnCode::kSuccess, xAOD::TReturnCode::kFailure, xAOD::TReturnCode::kRecoverable, [] (const xAOD::TReturnCode& sc) -> bool {return sc.isSuccess();});
+    checkType<StatusCode> (StatusCode::SUCCESS, StatusCode::FAILURE, StatusCode::RECOVERABLE, [] (const StatusCode& sc) -> bool {return sc.isSuccess();});
 #endif
     checkType<bool> (true, false, false, [] (const bool& sc) -> bool {return sc;});
   }
diff --git a/Control/AthToolSupport/AsgMessaging/AsgMessaging/StatusCode.h b/Control/AthToolSupport/AsgMessaging/AsgMessaging/StatusCode.h
index 7c40c952be0ede007cbcf26bb37be4056238e120..6843fb9c2c50c25486eb84ce115a7e15e341da26 100644
--- a/Control/AthToolSupport/AsgMessaging/AsgMessaging/StatusCode.h
+++ b/Control/AthToolSupport/AsgMessaging/AsgMessaging/StatusCode.h
@@ -25,13 +25,24 @@
 /// $Revision: 612639 $
 /// $Date: 2014-08-20 14:26:10 +0200 (Wed, 20 Aug 2014) $
 ///
-class [[nodiscard]] StatusCode {
+class
+#ifndef __CLING__
+// cppyy will generate wrappers both for functions returning a value
+// and the value being discarded.  If we have [[nodiscard]] on,
+// then we'll get warnings when cling compiles these wrappers.
+// Since these wrappers are automatically generated by cppyy,
+// we can't really avoid these other than by disabling them
+// for the cling case.
+[[nodiscard]]
+#endif
+StatusCode {
 
 public:
    /// Convenience StatusCode types
    enum {
       FAILURE = 0,
-      SUCCESS = 1
+      SUCCESS = 1,
+      RECOVERABLE = 2
    };
 
    /// Constructor from an integer status code
@@ -50,6 +61,8 @@ public:
    bool isSuccess() const;
    /// Check if the operation was a failure
    bool isFailure() const;
+   /// Check if the operation produced a recoverable issue
+   bool isRecoverable() const;
 
    /// Automatic conversion operator
    operator unsigned long() const;
@@ -61,8 +74,10 @@ public:
 
    /// Enable failure (with a backtrace) on an unchecked status code
    static void enableFailure();
+   static void enableChecking() {enableFailure();};
    /// Disable failure (no backtrace) on an unchecked status code
    static void disableFailure();
+   static void disableChecking() {disableFailure();};
 
 private:
    /// Code returned by some function
diff --git a/Control/AthToolSupport/AsgMessaging/Root/StatusCode.cxx b/Control/AthToolSupport/AsgMessaging/Root/StatusCode.cxx
index 6e0ffa6f91a587350a3817ca9ce4b162f030a2f9..0872d8351946c63d4a93b613a15715ec1eec46a1 100644
--- a/Control/AthToolSupport/AsgMessaging/Root/StatusCode.cxx
+++ b/Control/AthToolSupport/AsgMessaging/Root/StatusCode.cxx
@@ -148,6 +148,12 @@ StatusCode::operator unsigned long() const {
    return m_code;
 }
 
+bool StatusCode::isRecoverable() const {
+
+  m_checked = true;
+  return ( m_code == RECOVERABLE );
+}
+
 void StatusCode::enableFailure() {
 
    s_failure = true;
diff --git a/Control/AthToolSupport/AsgMessaging/test/ut_MessageCheck.cxx b/Control/AthToolSupport/AsgMessaging/test/ut_MessageCheck.cxx
index 067aba0fedfc5ac00590304987d4cf53e5e1916e..ad9402ece23e1bbe39005fae703f98b386637f1b 100644
--- a/Control/AthToolSupport/AsgMessaging/test/ut_MessageCheck.cxx
+++ b/Control/AthToolSupport/AsgMessaging/test/ut_MessageCheck.cxx
@@ -49,10 +49,9 @@ void checkType (const T2& scSuccess, const T2& scFailure1, const T2& scFailure2,
 int main ()
 {
   StatusCode::enableFailure ();
-  xAOD::TReturnCode::enableFailure ();
 
   // checkType<StatusCode> (StatusCode::SUCCESS, StatusCode::FAILURE, StatusCode::FAILURE, [] (const StatusCode& sc) -> bool {return sc.isSuccess();});
-  // checkType<xAOD::TReturnCode> (xAOD::TReturnCode::kSuccess, xAOD::TReturnCode::kFailure, xAOD::TReturnCode::kRecoverable, [] (const xAOD::TReturnCode& sc) -> bool {return sc.isSuccess();});
+  // checkType<StatusCode> (StatusCode::SUCCESS, StatusCode::FAILURE, StatusCode::RECOVERABLE, [] (const StatusCode& sc) -> bool {return sc.isSuccess();});
   checkType<bool> (true, false, false, [] (const bool& sc) -> bool {return sc;});
 
   return 0;
diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODRootTest.py b/Control/DataModelTest/DataModelRunTests/share/xAODRootTest.py
index a972ef8b86c40c07b0498064ff5cdc6377de0e2c..a80c0cb9bdc2ab8888cf23de5a92463c25c6984b 100644
--- a/Control/DataModelTest/DataModelRunTests/share/xAODRootTest.py
+++ b/Control/DataModelTest/DataModelRunTests/share/xAODRootTest.py
@@ -8,7 +8,7 @@ cppyy.load_library("libDataModelTestDataReadDict")
 
 def CHECK(sc):
     if not sc.isSuccess():
-        raise Exception ('bad TReturnCode')
+        raise Exception ('bad StatusCode')
     return
 
 
diff --git a/Control/DataModelTest/DataModelRunTests/share/xAODRootTestRead_t.py b/Control/DataModelTest/DataModelRunTests/share/xAODRootTestRead_t.py
index 871162c44e078e259291a9049851d2e1c31bf6ac..252f8b2d7a607ac6af0ccb4feaca451f13bf908c 100644
--- a/Control/DataModelTest/DataModelRunTests/share/xAODRootTestRead_t.py
+++ b/Control/DataModelTest/DataModelRunTests/share/xAODRootTestRead_t.py
@@ -12,7 +12,7 @@ import ROOT
 import cppyy
 
 ROOT.xAOD.TEvent
-ROOT.xAOD.TReturnCode.enableFailure()
+ROOT.StatusCode.enableChecking()
 
 
 from AthenaCommon.Include import Include
diff --git a/Control/xAODDataSource/test/dataFrameElementLink_test.cxx b/Control/xAODDataSource/test/dataFrameElementLink_test.cxx
index e8fe53d735b04bf549c873a6d0064996a9ad3b98..9423ad6a560488cf89274736d9c59c1ddee0c0a2 100644
--- a/Control/xAODDataSource/test/dataFrameElementLink_test.cxx
+++ b/Control/xAODDataSource/test/dataFrameElementLink_test.cxx
@@ -8,6 +8,7 @@
 
 // Framework include(s).
 #include "xAODRootAccess/Init.h"
+#include "AsgMessaging/MessageCheck.h"
 
 // EDM include(s).
 #include "AthContainers/ConstDataVector.h"
@@ -18,12 +19,16 @@
 #include <TInterpreter.h>
 
 int main() {
+
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // Suppress ubsan warning.
    CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); });
 
    // Set up the runtime environment.
    ROOT::EnableImplicitMT();
-   CHECK( xAOD::Init() );
+   ANA_CHECK( xAOD::Init() );
 
    // Create a data frame object.
    auto df = xAOD::MakeDataFrame( "${ASG_TEST_FILE_DATA}" );
diff --git a/Control/xAODDataSource/test/dataFrameTypeConversion_test.cxx b/Control/xAODDataSource/test/dataFrameTypeConversion_test.cxx
index 93db9c91ea75df0f8229401a73d3c9148b872a30..3f16a9b6c1f83182ac83cbb107d09037f4d6f7f0 100644
--- a/Control/xAODDataSource/test/dataFrameTypeConversion_test.cxx
+++ b/Control/xAODDataSource/test/dataFrameTypeConversion_test.cxx
@@ -9,6 +9,7 @@
 // Framework include(s).
 #include "xAODRootAccess/Init.h"
 #include "CxxUtils/ubsan_suppress.h"
+#include "AsgMessaging/MessageCheck.h"
 
 // EDM include(s).
 #include "xAODBase/IParticleContainer.h"
@@ -20,12 +21,16 @@
 #include <iostream>
 
 int main() {
+
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // Suppress ubsan warning.
    CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); });
 
    // Set up the runtime environment.
    ROOT::EnableImplicitMT();
-   CHECK( xAOD::Init() );
+   ANA_CHECK( xAOD::Init() );
 
    // Create a data frame object.
    auto df = xAOD::MakeDataFrame( "${ASG_TEST_FILE_DATA}" );
diff --git a/Control/xAODDataSource/test/dataFrame_test.cxx b/Control/xAODDataSource/test/dataFrame_test.cxx
index 66370720d9a9e095df707d9944f97fa1d051eb79..61cae27170256d1078b36590729024ab8d58d2cf 100644
--- a/Control/xAODDataSource/test/dataFrame_test.cxx
+++ b/Control/xAODDataSource/test/dataFrame_test.cxx
@@ -11,6 +11,7 @@
 #include "xAODRootAccess/tools/Message.h"
 #include "xAODBase/IParticleContainer.h"
 #include "CxxUtils/ubsan_suppress.h"
+#include "AsgMessaging/MessageCheck.h"
 
 // ROOT include(s).
 #include <ROOT/RDataFrame.hxx>
@@ -21,11 +22,15 @@
 #include <iostream>
 
 int main() {
+
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // Suppress ubsan warning.
    CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); });
 
    // Set up the runtime environment.
-   CHECK( xAOD::Init() );
+   ANA_CHECK( xAOD::Init() );
 
    // Create a data frame object.
    auto df = xAOD::MakeDataFrame( "${ASG_TEST_FILE_DATA}" );
diff --git a/Control/xAODDataSource/test/dataSourceEvent_test.cxx b/Control/xAODDataSource/test/dataSourceEvent_test.cxx
index dcc83dc3200e5689410c6bda83c1467de0cc1d44..301b27dd736584c2739d6fb1e8106dc9c1c17ff7 100644
--- a/Control/xAODDataSource/test/dataSourceEvent_test.cxx
+++ b/Control/xAODDataSource/test/dataSourceEvent_test.cxx
@@ -9,6 +9,7 @@
 // xAOD include(s).
 #include "xAODRootAccess/Init.h"
 #include "xAODRootAccess/tools/Message.h"
+#include "AsgMessaging/MessageCheck.h"
 
 // ROOT include(s).
 #include <TFile.h>
@@ -20,8 +21,11 @@
 
 int main() {
 
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // Set up the runtime environment.
-   CHECK( xAOD::Init() );
+   ANA_CHECK( xAOD::Init() );
 
    // Open the input file.
    std::unique_ptr< TFile > ifile( TFile::Open( "${ASG_TEST_FILE_DATA}",
@@ -34,7 +38,7 @@ int main() {
 
    // Set up the event object.
    xAOD::RDataSourceEvent event;
-   CHECK( event.readFrom( ifile.get() ) );
+   ANA_CHECK( event.readFrom( ifile.get() ) );
    if( event.getEntry( 0 ) < 0 ) {
       Error( "dataSourceEvent_test",
              XAOD_MESSAGE( "Couldn't load the first event of the input "
diff --git a/Control/xAODDataSource/test/dataSource_test.cxx b/Control/xAODDataSource/test/dataSource_test.cxx
index 31e44cb02c53cf498646117ff6437d654123e2dd..ea474da8f67f7d29be27636cd74f41d3a6f35fb8 100644
--- a/Control/xAODDataSource/test/dataSource_test.cxx
+++ b/Control/xAODDataSource/test/dataSource_test.cxx
@@ -10,6 +10,8 @@
 #include "xAODRootAccess/Init.h"
 #include "xAODRootAccess/tools/Message.h"
 
+#include "AsgMessaging/MessageCheck.h"
+
 // ROOT include(s).
 #include <TError.h>
 
@@ -18,8 +20,11 @@
 
 int main() {
 
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // Set up the runtime environment.
-   CHECK( xAOD::Init() );
+   ANA_CHECK( xAOD::Init() );
 
    // Set up the data source.
    xAOD::RDataSource ds( "${ASG_TEST_FILE_DATA}" );
diff --git a/Control/xAODDataSource/test/helpers.h b/Control/xAODDataSource/test/helpers.h
index 50140534c452158e8f3f992092e05834963b598d..a7692a7d2b067c2ea12e859960043c227e1eee41 100644
--- a/Control/xAODDataSource/test/helpers.h
+++ b/Control/xAODDataSource/test/helpers.h
@@ -12,17 +12,6 @@
 #include <iostream>
 #include <vector>
 
-/// Helper macro for checking return values
-#define CHECK( EXP )                                                    \
-   do {                                                                 \
-      auto ret = EXP;                                                   \
-      if( ! ret.isSuccess() ) {                                         \
-         Error( "dataSource_test",                                      \
-                XAOD_MESSAGE( "Failed to execute: %s" ), #EXP );        \
-         return 1;                                                      \
-      }                                                                 \
-   } while( false )
-
 /// Helper print operator
 template< typename FIRST, typename SECOND >
 std::ostream& operator<< ( std::ostream& out,
diff --git a/Control/xAODRootAccess/CMakeLists.txt b/Control/xAODRootAccess/CMakeLists.txt
index 199630bf896aa88d76706f3ce8ebfac100dd249f..5ae966d7330a4de696d7ad07d3debfea2ca0d20a 100644
--- a/Control/xAODRootAccess/CMakeLists.txt
+++ b/Control/xAODRootAccess/CMakeLists.txt
@@ -29,7 +29,7 @@ atlas_add_library( xAODRootAccess
    PUBLIC_HEADERS xAODRootAccess
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
    LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers xAODCore xAODEventFormat
-   xAODRootAccessInterfaces ${extra_libs} )
+   xAODRootAccessInterfaces AsgMessagingLib ${extra_libs} )
 
 # Build a (Reflex) dictionary library:
 atlas_add_dictionary( xAODRootAccessDict
@@ -69,16 +69,14 @@ endmacro( _add_test )
 if( NOT SIMULATIONBASE AND NOT GENERATIONBASE )
    _add_test( ut_xaodrootaccess_metadata_test )
    _add_test( ut_xaodrootaccess_athenaMode_test )
-endif()
-if( NOT GENERATIONBASE )
    _add_test( ut_xaodrootaccess_remap_test )
+   _add_test( ut_xaodrootaccess_slimming_test )
+   _add_test( ut_xaodrootaccess_stats_test )
+   _add_test( ut_xaodrootaccess_tchain_test )
 endif()
-_add_test( ut_xaodrootaccess_slimming_test )
-_add_test( ut_xaodrootaccess_stats_test )
 _add_test( ut_xaodrootaccess_tauxvector_test )
 _add_test( ut_xaodrootaccess_tauxstore_test )
 _add_test( ut_xaodrootaccess_tauxstore_insertmove_test )
-_add_test( ut_xaodrootaccess_tchain_test )
 _add_test( ut_xaodrootaccess_tfileaccesstracer_test )
 _add_test( ut_xaodrootaccess_tfilemerger_test )
 _add_test( ut_xaodrootaccess_tstore_test )
diff --git a/Control/xAODRootAccess/Root/Init.cxx b/Control/xAODRootAccess/Root/Init.cxx
index e41f2cfb0c9fba1d30b0ce1699f923d5bd4a5175..2b0f02b4374b66cdf588af0ed0e83978701c3f55 100644
--- a/Control/xAODRootAccess/Root/Init.cxx
+++ b/Control/xAODRootAccess/Root/Init.cxx
@@ -31,22 +31,22 @@ namespace xAOD {
    /// Width of the message source strings
    static size_t sMessageSourceWidth = 25;
 
-   TReturnCode Init( const char* appname ) {
+   StatusCode Init( const char* appname ) {
 
       return Init( appname, 0, 0 );
    }
 
-   TReturnCode Init( const char* appname, int* argc, char** argv ) {
+   StatusCode Init( const char* appname, int* argc, char** argv ) {
 
       // Check if we need to do anything:
-      if( sInitialised ) return TReturnCode::kSuccess;
+      if( sInitialised ) return StatusCode::SUCCESS;
 
       // Set up our own error handler function:
       sErrorHandler = ::SetErrorHandler( ErrorHandler );
       if( ! sErrorHandler ) {
          std::cerr << "<xAOD::Init> ERROR Couldn't set up ROOT message "
                    << "filtering" << std::endl;
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Create an application. This is needed to ensure the auto-loading
@@ -87,7 +87,7 @@ namespace xAOD {
 
       // Return gracefully:
       sInitialised = true;
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    void SetMessageSourceWidth( size_t value ) {
diff --git a/Control/xAODRootAccess/Root/LinkDef.h b/Control/xAODRootAccess/Root/LinkDef.h
index 956a510802c929d34167b91cc17b844fdb84ab5b..4e64ade5cf5861495cd0d4ffb5557d643ba50983 100644
--- a/Control/xAODRootAccess/Root/LinkDef.h
+++ b/Control/xAODRootAccess/Root/LinkDef.h
@@ -11,7 +11,6 @@
 #include "xAODRootAccess/tools/xAODTMetaBranch.h"
 #include "xAODRootAccess/tools/xAODTMetaTree.h"
 #include "xAODRootAccess/tools/TTransTrees.h"
-#include "xAODRootAccess/tools/TReturnCode.h"
 #include "xAODRootAccess/tools/TFileMerger.h"
 #include "xAODRootAccess/tools/TFileChecker.h"
 #include "xAODRootAccess/MakeTransientTree.h"
@@ -31,7 +30,6 @@
 #pragma link C++ class xAODTMetaBranch;
 #pragma link C++ class xAODTMetaTree;
 #pragma link C++ class xAOD::TTransTrees;
-#pragma link C++ class xAOD::TReturnCode;
 #pragma link C++ class xAOD::TFileMerger;
 #pragma link C++ class xAOD::TFileChecker;
 #pragma link C++ function xAOD::MakeTransientTrees(TFile*,const char*);
diff --git a/Control/xAODRootAccess/Root/TAuxStore.cxx b/Control/xAODRootAccess/Root/TAuxStore.cxx
index c28951eec915a0abec3aba2c3c06a181ca2dacaf..ca7754eb5a3d3331a4e87b910ab38fdeeeb7ddce 100644
--- a/Control/xAODRootAccess/Root/TAuxStore.cxx
+++ b/Control/xAODRootAccess/Root/TAuxStore.cxx
@@ -90,21 +90,21 @@ namespace xAOD {
    /// But user code should probably not fiddle with this function.
    ///
    /// @param mode The structure mode to set
-   /// @returns The usual TReturnCode values
+   /// @returns The usual StatusCode values
    ///
-   TReturnCode TAuxStore::setStructMode( EStructMode mode ) {
+   StatusCode TAuxStore::setStructMode( EStructMode mode ) {
 
       // Only allow this on an uninitialised object:
       if( m_branches.size() || ( m_structMode != kUndefinedStore ) ) {
          ::Error( "xAOD::TAuxStore::setStructMode",
                   XAOD_MESSAGE( "Trying to change the structure mode of an "
                                 "initialised object" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Make the change:
       m_structMode = mode;
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    const char* TAuxStore::prefix() const {
@@ -159,7 +159,7 @@ namespace xAOD {
    ///
    /// @param tree Pointer to the TTree that is being read from
    ///
-   TReturnCode TAuxStore::readFrom( ::TTree* tree, ::Bool_t printWarnings ) {
+   StatusCode TAuxStore::readFrom( ::TTree* tree, ::Bool_t printWarnings ) {
 
       // Make sure that everything will be re-read after this:
       reset();
@@ -179,7 +179,7 @@ namespace xAOD {
       if( ! br ) {
          // We might not even have static branches, so this is not an error
          // by itself...
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
       // In order to read complex objects, like smart pointers from an
       // auxiliary container variable-by-variable, the split level of the
@@ -192,7 +192,7 @@ namespace xAOD {
                     "The reading of complex variables from it may/will fail!" );
       }
 
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function is called by the infrastructure to connect the object
@@ -200,7 +200,7 @@ namespace xAOD {
    ///
    /// @param tree Pointer to the TTree that is being written to
    ///
-   TReturnCode TAuxStore::writeTo( ::TTree* tree ) {
+   StatusCode TAuxStore::writeTo( ::TTree* tree ) {
 
       // Look for any auxiliary branches that have not been connected to yet:
       RETURN_CHECK( "xAOD::TAuxStore::writeTo", scanInputTree() );
@@ -216,7 +216,7 @@ namespace xAOD {
          RETURN_CHECK( "xAOD::TAuxStore::writeTo", setupOutputData( id ) );
       }
 
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    ::Int_t TAuxStore::getEntry( ::Long64_t entry, ::Int_t getall ) {
@@ -810,10 +810,10 @@ namespace xAOD {
    /// TEvent when connecting to new input files/chains.
    ///
    /// @param tree The tree to collect the information from
-   /// @returns <code>TReturnCode::kSuccess</code> if the function was
+   /// @returns <code>StatusCode::SUCCESS</code> if the function was
    ///          successful, something else otherwise
    ///
-   TReturnCode TAuxStore::initStats( ::TTree* tree ) {
+   StatusCode TAuxStore::initStats( ::TTree* tree ) {
 
       // Connect the object to this input tree:
       RETURN_CHECK( "initStats", readFrom( tree, kFALSE ) );
@@ -832,7 +832,7 @@ namespace xAOD {
       stats.setBranchNum( stats.branchNum() + nbranch );
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This internal function takes care of connecting to an individual
@@ -843,11 +843,11 @@ namespace xAOD {
    /// @returns <code>kTRUE</code> if the operation was successful,
    ///          <code>kFALSE</code> if not
    ///
-   TReturnCode TAuxStore::setupInputData( auxid_t auxid ) const {
+   StatusCode TAuxStore::setupInputData( auxid_t auxid ) const {
 
       // Return right away if we already know that the branch is missing:
       if( ( auxid < m_missingBranches.size() ) && m_missingBranches[ auxid ] ) {
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Make sure the internal storage is large enough:
@@ -860,14 +860,14 @@ namespace xAOD {
 
       // Check if we need to do anything:
       if( m_vecs[ auxid ] && m_branches[ auxid ] ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // A little sanity check:
       if( ! m_inTree ) {
          ::Error( "xAOD::TAuxStore::setupInputData",
                   XAOD_MESSAGE( "No input TTree set up!" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Another sanity check:
@@ -875,7 +875,7 @@ namespace xAOD {
          ::Error( "xAOD::TAuxStore::setupInputData",
                   XAOD_MESSAGE( "The internal variables of the object got "
                                 "messed up?!?" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Get the property name:
@@ -899,7 +899,7 @@ namespace xAOD {
             m_missingBranches[ auxid ] = true;
             // The branch doesn't exist, but this is not an error per se.
             // The user may just be calling isAvailable(...) on the variable.
-            return TReturnCode::kRecoverable;
+            return StatusCode::RECOVERABLE;
          }
          // We have a dynamic branch:
          staticBranch = kFALSE;
@@ -924,7 +924,7 @@ namespace xAOD {
                   XAOD_MESSAGE( "Branch type and requested structure mode "
                                 "differ for branch: %s" ),
                   brName.Data() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check what variable it is:
@@ -934,7 +934,7 @@ namespace xAOD {
          ::Error( "xAOD::TAuxStore::setupInputData",
                   XAOD_MESSAGE( "Couldn't determine the type of branch "
                                 "\"%s\"" ), brName.Data() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Get the property type:
@@ -954,7 +954,7 @@ namespace xAOD {
          ::Error( "xAOD::TAuxStore::setupInputData",
                   XAOD_MESSAGE( "Can't read/copy variable %s (%s)" ),
                   brName.Data(), clDummy->GetName() );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
       const TString brTypeName = Utils::getTypeName( *brType ).c_str();
 
@@ -970,7 +970,7 @@ namespace xAOD {
             ::Error( "xAOD::TAuxStore::setupInputData",
                      XAOD_MESSAGE( "No dictionary available for class \"%s\"" ),
                      brTypeName.Data() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
       }
 
@@ -992,7 +992,7 @@ namespace xAOD {
                                 "variable %s (%i)" ),
                   brName.Data(),
                   static_cast< int >( auxid ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Create a new branch handle:
@@ -1045,7 +1045,7 @@ namespace xAOD {
          m_vecs[ auxid ] = 0;
          delete m_branches[ auxid ];
          m_branches[ auxid ] = 0;
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Get the current entry:
@@ -1084,7 +1084,7 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function is used internally to create a "simple" output branch
@@ -1094,13 +1094,13 @@ namespace xAOD {
    /// @returns <code>kTRUE</code> if the operation was successful,
    ///          <code>kFALSE</code> if not
    ///
-   TReturnCode TAuxStore::setupOutputData( auxid_t auxid ) const {
+   StatusCode TAuxStore::setupOutputData( auxid_t auxid ) const {
 
       // Check whether we need to do anything:
-      if( ! m_outTree ) return TReturnCode::kSuccess;
+      if( ! m_outTree ) return StatusCode::SUCCESS;
 
       // Check if the variable needs to be written out:
-      if( ! isAuxIDSelected( auxid ) ) return TReturnCode::kSuccess;
+      if( ! isAuxIDSelected( auxid ) ) return StatusCode::SUCCESS;
 
       // Make sure that containers are large enough:
       if( m_vecs.size() <= auxid ) {
@@ -1114,7 +1114,7 @@ namespace xAOD {
       }
 
       // Check if this auxiliary variable is already in the output:
-      if( m_branchesWritten[ auxid ] ) return TReturnCode::kSuccess;
+      if( m_branchesWritten[ auxid ] ) return StatusCode::SUCCESS;
 
       // Check if the variable was put into the transient store as a
       // decoration, and now needs to be put into the output file:
@@ -1126,7 +1126,7 @@ namespace xAOD {
          if( ! pptr ) {
             ::Fatal( "xAOD::TAuxStore::setupOutputData",
                      XAOD_MESSAGE( "Internal logic error detected" ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // The registry:
@@ -1139,7 +1139,7 @@ namespace xAOD {
             ::Error( "xAOD::TAuxStore::setupOutputData",
                      XAOD_MESSAGE( "Couldn't create decoration in memory "
                                    "for writing" ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Get the type of this variable:
@@ -1149,7 +1149,7 @@ namespace xAOD {
                      XAOD_MESSAGE( "Couldn't get the type of transient "
                                    "variable %i" ),
                      static_cast< int >( auxid ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          // Now get the factory for this variable:
          const SG::IAuxTypeVectorFactory* factory =
@@ -1158,7 +1158,7 @@ namespace xAOD {
             ::Error( "xAOD::TAuxStore::setupOutputData",
                      XAOD_MESSAGE( "No factory found for transient variable "
                                    "%i" ), static_cast< int >( auxid ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Finally, do the copy:
@@ -1187,7 +1187,7 @@ namespace xAOD {
          ::Error( "xAOD::TAuxStore::setupOutputData",
                   XAOD_MESSAGE( "Structure mode unknown for variable %s" ),
                   SG::AuxTypeRegistry::instance().getName( auxid ).c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check if the variable exists already in memory:
@@ -1236,7 +1236,7 @@ namespace xAOD {
          // variable will not be accessed in a typeless way anymore.
          m_branchesWritten[ auxid ] = true;
          // Return gracefully:
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Check that we know the type of the branch:
@@ -1245,7 +1245,7 @@ namespace xAOD {
          ::Error( "xAOD::TAuxStore::setupOutputData",
                   XAOD_MESSAGE( "There's an internal logic error in the "
                                 "code" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
       const std::string brTypeName = Utils::getTypeName( *brType );
 
@@ -1262,7 +1262,7 @@ namespace xAOD {
                      XAOD_MESSAGE( "Type not known for variable \"%s\" "
                                    "of type \"%s\"" ),
                      brName.Data(), brTypeName.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Construct the type description:
@@ -1285,13 +1285,13 @@ namespace xAOD {
             ::Error( "xAOD::TAuxStore::setupOutputData",
                      XAOD_MESSAGE( "Couldn't find dictionary for type: %s" ),
                      brTypeName.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          if( ! cl->GetStreamerInfo() ) {
             ::Error( "xAOD::TAuxStore::setupOutputData",
                      XAOD_MESSAGE( "No streamer info available for type %s" ),
                      cl->GetName() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Create the branch:
@@ -1306,7 +1306,7 @@ namespace xAOD {
                   XAOD_MESSAGE( "Failed creating branch \"%s\" of type "
                                 "\"%s\"" ),
                   brName.Data(), brTypeName.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // If this is not the first event, fill up the branch with dummy
@@ -1322,7 +1322,7 @@ namespace xAOD {
       m_auxIDs.insert( auxid );
 
       // We were successful:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// When writing an output tree, while reading information from an input
@@ -1340,17 +1340,17 @@ namespace xAOD {
    /// @returns <code>kTRUE</code> if the operation was successful,
    ///          <code>kFALSE</code> if not
    ///
-   TReturnCode TAuxStore::scanInputTree() {
+   StatusCode TAuxStore::scanInputTree() {
 
       // Check if an input tree is even available:
       if( ! m_inTree ) {
          // It's not an error if it isn't.
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Check if the input was already scanned:
       if( m_inputScanned ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Get a list of all branches in the tree:
@@ -1438,7 +1438,7 @@ namespace xAOD {
       m_inputScanned = kTRUE;
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function takes care of assigning an auxiliary ID to a given branch.
@@ -1456,7 +1456,7 @@ namespace xAOD {
    ///                     <code>kFALSE</code> if it's a dynamic one
    /// @returns <code>kTRUE</code> if successful, <code>kFALSE</code> if not
    ///
-   TReturnCode TAuxStore::setupAuxBranch( ::TBranch* br, const char* auxName,
+   StatusCode TAuxStore::setupAuxBranch( ::TBranch* br, const char* auxName,
                                           ::Bool_t staticBranch ) {
 
       // Get the branch's type:
@@ -1527,12 +1527,12 @@ namespace xAOD {
       const auxid_t regAuxid = registry.findAuxID( auxName );
       if( regAuxid != SG::null_auxid ) {
          m_auxIDs.insert( regAuxid );
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // If we didn't find a type_info for the branch, give up now...
       if( ! ti ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Check for an auxiliary ID for this branch:
@@ -1601,12 +1601,12 @@ namespace xAOD {
                   XAOD_MESSAGE( "Couldn't assign auxiliary ID to branch "
                                 "\"%s\"" ),
                   br->GetName() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Remember the auxiliary ID:
       m_auxIDs.insert( auxid );
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This is a tricky one. The function can't just rely on getSelectedAuxIDs,
diff --git a/Control/xAODRootAccess/Root/TEvent.cxx b/Control/xAODRootAccess/Root/TEvent.cxx
index 9d2dc0b7b889845a0668fe37aeb8380c7d851bcc..71b4b7090f09757a3aaee0ba38a41eaf45245995 100644
--- a/Control/xAODRootAccess/Root/TEvent.cxx
+++ b/Control/xAODRootAccess/Root/TEvent.cxx
@@ -359,11 +359,11 @@ namespace xAOD {
    /// @param treeName Name of the input tree
    /// @returns <code>kTRUE</code> if successful, <code>kFALSE</code> otherwise
    ///
-   TReturnCode TEvent::readFrom( ::TFile* file, Bool_t useTreeCache,
+   StatusCode TEvent::readFrom( ::TFile* file, Bool_t useTreeCache,
                                  const char* treeName ) {
 
       // If no file was specified, return gracefully:
-      if( ! file ) return TReturnCode::kSuccess;
+      if( ! file ) return StatusCode::SUCCESS;
 
       // Clear the cached input objects:
       Object_t::iterator itr = m_inputObjects.begin();
@@ -400,7 +400,7 @@ namespace xAOD {
          ::Error( "xAOD::TEvent::readFrom",
                   XAOD_MESSAGE( "Couldn't find metadata tree on input. Object "
                                 "unusable!" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // A sanity check:
@@ -434,7 +434,7 @@ namespace xAOD {
                  "metadata" );
          m_inTree = 0;
          m_inTreeMissing = kTRUE;
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Read in the event format object:
@@ -445,7 +445,7 @@ namespace xAOD {
       if( status < 0 ) {
          ::Error( "xAOD::TEvent::readFrom",
                   XAOD_MESSAGE( "Failed to connect to EventFormat object" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Read in the object to our private member:
@@ -497,7 +497,7 @@ namespace xAOD {
       }
 
       // The initialisation was successful:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This version of the function sets up the object to readin information
@@ -508,7 +508,7 @@ namespace xAOD {
    /// @param useTreeCache Flag for switching TTreeCache usage on/off
    /// @returns <code>kTRUE</code> if successful, <code>kFALSE</code> when not
    ///
-   TReturnCode TEvent::readFrom( ::TTree* tree, Bool_t useTreeCache ) {
+   StatusCode TEvent::readFrom( ::TTree* tree, Bool_t useTreeCache ) {
 
       // Remember the info:
       m_inTree = 0;
@@ -533,27 +533,27 @@ namespace xAOD {
             ::Error( "xAOD::TEvent::readFrom",
                      XAOD_MESSAGE( "Couldn't get the list of files from the "
                                    "input TChain" ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          if( ! files->GetEntries() ) {
             ::Error( "xAOD::TEvent::readFrom",
                      XAOD_MESSAGE( "No files are present in the received "
                                    "TChain" ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          const ::TChainElement* chEl =
               dynamic_cast< const ::TChainElement* >( files->At( 0 ) );
          if( ! chEl ) {
             ::Error( "xAOD::TEvent::readFrom",
                      XAOD_MESSAGE( "Couldn't cast object to TChainElement" ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          ::TFile* dummyFile = ::TFile::Open( chEl->GetTitle() );
          if( ! dummyFile ) {
             ::Error( "xAOD::TEvent::readFrom",
                      XAOD_MESSAGE( "Couldn't open file %s" ),
                                    chEl->GetTitle() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          delete dummyFile;
 
@@ -568,7 +568,7 @@ namespace xAOD {
          // asks for the first event. Otherwise we open the first file of the
          // chain multiple times.
          m_inTreeNumber = -1;
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
 
       } else {
 
@@ -593,14 +593,14 @@ namespace xAOD {
    /// @param treeName Name of the output event tree
    /// @returns <code>kTRUE</code> if successful, <code>kFALSE</code> otherwise
    ///
-   TReturnCode TEvent::writeTo( ::TFile* file, Int_t autoFlush,
+   StatusCode TEvent::writeTo( ::TFile* file, Int_t autoFlush,
                                 const char* treeName ) {
 
       // Just a simple security check:
       if( ! file ) {
          ::Error( "xAOD::TEvent::writeTo",
                   XAOD_MESSAGE( "Null pointer given to the function!" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check that the object is in the "right state":
@@ -608,7 +608,7 @@ namespace xAOD {
          ::Error( "xAOD::TEvent::writeTo",
                   XAOD_MESSAGE( "Object already writing to a file. Close that "
                                 "file first!" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Make sure we return to the current directory:
@@ -626,7 +626,7 @@ namespace xAOD {
          &( TEventFormatRegistry::instance().getEventFormat( file ) );
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function needs to be called when the user is done writing events
@@ -635,14 +635,14 @@ namespace xAOD {
    /// @param file The file that the event data is written to
    /// @returns <code>kTRUE</code> if successful, <code>kFALSE</code> otherwise
    ///
-   TReturnCode TEvent::finishWritingTo( ::TFile* file ) {
+   StatusCode TEvent::finishWritingTo( ::TFile* file ) {
 
       // A small sanity check:
       if( ! m_outTree ) {
          ::Error( "xAOD::TEvent::finishWritingTo",
                   XAOD_MESSAGE( "The object doesn't seem to be connected to an "
                                 "output file!" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Make sure we return to the current directory:
@@ -669,7 +669,7 @@ namespace xAOD {
       // Check if there's already a metadata tree in the output:
       if( file->Get( METADATA_TREE_NAME ) ) {
          // Let's assume that the metadata is complete in the file already.
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Create the metadata tree:
@@ -698,7 +698,7 @@ namespace xAOD {
          if( ! mgr ) {
             ::Error( "xAOD::TEvent::finishWritingTo",
                      XAOD_MESSAGE( "Internal logic error detected" ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          // Select a split level depending on whether this is an interface or an
          // auxiliary object:
@@ -715,7 +715,7 @@ namespace xAOD {
                                    "\"%s/%s\"" ),
                      mgr->holder()->getClass()->GetName(),
                      object.first.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          // Set up the saving of all the dynamic auxiliary properties
          // of the object if it has any:
@@ -731,7 +731,7 @@ namespace xAOD {
                                 "the output" ) );
          metatree->SetDirectory( 0 );
          delete metatree;
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Now clean up:
@@ -753,7 +753,7 @@ namespace xAOD {
       m_outputMetaObjects.clear();
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// Setting TEvent objects happens automatically when reading a file, but
@@ -809,15 +809,15 @@ namespace xAOD {
    /// incidents" happen, a given object should be notified about it.
    ///
    /// @param listener Pointer to the object that should be notified
-   /// @returns The usual TReturnCode types
+   /// @returns The usual StatusCode types
    ///
-   TReturnCode TEvent::addListener( TVirtualIncidentListener* listener ) {
+   StatusCode TEvent::addListener( TVirtualIncidentListener* listener ) {
 
       // Check that we received a valid pointer:
       if( ! listener ) {
          ::Error( "xAOD::TEvent::addListener",
                   XAOD_MESSAGE( "Received a null pointer for the listener" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check if this listener is already in our list:
@@ -838,16 +838,16 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function allows us to remove a listener when for instance a
    /// metadata tool is deleted during a job.
    ///
    /// @param listener Pointer to the listener that should be removed
-   /// @returns The usual TReturnCode types
+   /// @returns The usual StatusCode types
    ///
-   TReturnCode TEvent::removeListener( TVirtualIncidentListener* listener ) {
+   StatusCode TEvent::removeListener( TVirtualIncidentListener* listener ) {
 
       // Find the pointer if we can...
       Listener_t::iterator itr = std::find( m_listeners.begin(),
@@ -858,14 +858,14 @@ namespace xAOD {
          ::Error( "xAOD::TEvent::removeListener",
                   XAOD_MESSAGE( "Listener %p not known" ),
                   static_cast< void* >( listener ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Remove it:
       m_listeners.erase( itr );
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function can be used to remove all the listeners from the internal
@@ -889,9 +889,9 @@ namespace xAOD {
    ///               file
    /// @param newName The alias with which the object/container should be
    ///                accessible
-   /// @returns The usual TReturnCode types
+   /// @returns The usual StatusCode types
    ///
-   TReturnCode TEvent::addNameRemap( const std::string& onfile,
+   StatusCode TEvent::addNameRemap( const std::string& onfile,
                                      const std::string& newName ) {
 
       // Check if this name is known on the input or output already. As that's
@@ -901,7 +901,7 @@ namespace xAOD {
                   XAOD_MESSAGE( "Can't use \"%s\" as the target name in the"
                                 "\"%s\" -> \"%s\" remapping" ),
                   newName.c_str(), onfile.c_str(), newName.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check if this name was remapped to something already:
@@ -918,7 +918,7 @@ namespace xAOD {
       m_nameRemapping[ newName ] = onfile;
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function simply clears out any existing name remapping declarations.
@@ -1044,7 +1044,7 @@ namespace xAOD {
    ///                   output branch
    /// @param splitLevel Optional split level of the output branch
    ///
-   TReturnCode TEvent::copy( const std::string& key,
+   StatusCode TEvent::copy( const std::string& key,
                              ::Int_t basketSize, ::Int_t splitLevel ) {
 
       // Check if a name re-mapping should be applied or not:
@@ -1064,20 +1064,20 @@ namespace xAOD {
       if( vobjMgr == m_inputObjects.end() ) {
          ::Error( "xAOD::TEvent::copy",
                   XAOD_MESSAGE( "Internal logic error detected" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
       const TObjectManager* objMgr =
          dynamic_cast< const TObjectManager* >( vobjMgr->second );
       if( ! objMgr ) {
          ::Error( "xAOD::TEvent::copy",
                   XAOD_MESSAGE( "Internal logic error detected" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
       if( ! getInputObject( key,
                        *( objMgr->holder()->getClass()->GetTypeInfo() ) ) ) {
          ::Error( "xAOD::TEvent::copy",
                   XAOD_MESSAGE( "Internal logic error detected" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Put the interface object into the output:
@@ -1099,7 +1099,7 @@ namespace xAOD {
       if( vauxMgr == m_inputObjects.end() ) {
          // If there is no auxiliary store for this object/container, we're
          // done already:
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
       // Check what type of auxiliary store this is:
       if( m_auxMode == kClassAccess || m_auxMode == kAthenaAccess ) {
@@ -1108,7 +1108,7 @@ namespace xAOD {
          if( ! auxMgr ) {
             ::Error( "xAOD::TEvent::copy",
                      XAOD_MESSAGE( "Internal logic error detected" ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          RETURN_CHECK( "xAOD::TEvent::copy",
                        record( auxMgr->object(),
@@ -1120,7 +1120,7 @@ namespace xAOD {
          if( ! auxMgr ) {
             ::Error( "xAOD::TEvent::copy",
                      XAOD_MESSAGE( "Internal logic error detected" ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          // Set up the filtering:
          if( filter ) {
@@ -1135,7 +1135,7 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function is here to make it easy to write code that skims an input
@@ -1144,16 +1144,16 @@ namespace xAOD {
    /// @param basketSize Optional size for the basket associated with the
    ///                   output branch
    /// @param splitLevel Optional split level of the output branch
-   /// @returns <code>xAOD::TReturnCode::kSuccess</code> if the copy was
-   ///          successful, or <code>xAOD::TReturnCode::kFailure</code> if not
+   /// @returns <code>StatusCode::SUCCESS</code> if the copy was
+   ///          successful, or <code>StatusCode::FAILURE</code> if not
    ///
-   TReturnCode TEvent::copy( ::Int_t basketSize, ::Int_t splitLevel ) {
+   StatusCode TEvent::copy( ::Int_t basketSize, ::Int_t splitLevel ) {
 
       // Make sure that an input TTree is available:
       if( ! m_inTree ) {
          ::Error( "xAOD::TEvent::copy",
                   XAOD_MESSAGE( "No input TTree is open" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Loop over the known input containers:
@@ -1189,7 +1189,7 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// @returns The number of events in the input file(s)
@@ -1704,14 +1704,14 @@ namespace xAOD {
    /// file. It prepares the "monitoring information" in memory that gets filled
    /// while the code is running, with information about xAOD I/O.
    ///
-   /// @returns <code>TReturnCode::kSuccess</code> if the function is
-   ///          successful, or <code>TReturnCode::kFaulure</code> if not
+   /// @returns <code>StatusCode::SUCCESS</code> if the function is
+   ///          successful, or <code>StatusCode::kFaulure</code> if not
    ///
-   TReturnCode TEvent::initStats() {
+   StatusCode TEvent::initStats() {
 
       // If we're dealing with an empty input file, stop here:
       if( m_inTreeMissing ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // A little sanity check:
@@ -1719,7 +1719,7 @@ namespace xAOD {
          ::Error( "xAOD::TEvent::initStats",
                   XAOD_MESSAGE( "Function called on an uninitialised "
                                 "object" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Reset the number of input branches information:
@@ -1791,7 +1791,7 @@ namespace xAOD {
                ::Error( "xAOD::TEvent::initStats",
                         XAOD_MESSAGE( "Couldn't get dictionary for type "
                                       "\"%s\"" ), baseName.c_str() );
-               return TReturnCode::kFailure;
+               return StatusCode::FAILURE;
             }
 
             // The type of the auxiliary store is finally deduced from the
@@ -1818,7 +1818,7 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function does the heavy lifting of retrieving object from the list
@@ -2028,7 +2028,7 @@ namespace xAOD {
    /// @returns <code>kTRUE</code> if the operation was successful, or
    ///          <code>kFALSE</code> if it was not
    ///
-   TReturnCode TEvent::record( void* obj, const std::string& typeName,
+   StatusCode TEvent::record( void* obj, const std::string& typeName,
                                const std::string& key,
                                ::Int_t basketSize, ::Int_t splitLevel,
                                ::Bool_t overwrite, ::Bool_t metadata,
@@ -2039,7 +2039,7 @@ namespace xAOD {
          ::Error( "xAOD::TEvent::record",
                   XAOD_MESSAGE( "No output tree defined. Did you forget to "
                                 "call writeTo(...)?" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
       assert( m_outputEventFormat != 0 );
 
@@ -2053,7 +2053,7 @@ namespace xAOD {
             ::Error( "xAOD::TEvent::record",
                      XAOD_MESSAGE( "Meta-object %s/%s already recorded" ),
                      typeName.c_str(), key.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          // Check if we have a dictionary for this object:
          TClass* cl = TClass::GetClass( typeName.c_str() );
@@ -2061,7 +2061,7 @@ namespace xAOD {
             ::Error( "xAOD::TEvent::record",
                      XAOD_MESSAGE( "Didn't find dictionary for type: %s" ),
                      typeName.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          // Let's create a holder for the object:
          THolder* hldr = new THolder( obj, cl, isOwner );
@@ -2069,7 +2069,7 @@ namespace xAOD {
             new TObjectManager( 0, hldr, m_auxMode == kAthenaAccess );
          m_outputMetaObjects[ key ] = mgr;
          // We're done. The rest will be done later on.
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Check if we accessed this object on the input. If yes, then this
@@ -2080,7 +2080,7 @@ namespace xAOD {
                   XAOD_MESSAGE( "Object %s/%s already accessed from the input, "
                                 "can't be overwritten in memory" ),
                   typeName.c_str(), key.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Override the default 0 split level with a split level of 1 for
@@ -2100,7 +2100,7 @@ namespace xAOD {
             ::Error( "xAOD::TEvent::record",
                      XAOD_MESSAGE( "Didn't find dictionary for type: %s" ),
                      typeName.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Check if this is a new object "type" or not:
@@ -2127,7 +2127,7 @@ namespace xAOD {
             // Clean up:
             hldr->setOwner( kFALSE );
             delete mgr;
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Set up the saving of all the dynamic auxiliary properties
@@ -2138,7 +2138,7 @@ namespace xAOD {
 
          // Return at this point, as we don't want to run the rest of
          // the function's code:
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Access the object manager:
@@ -2147,7 +2147,7 @@ namespace xAOD {
          ::Error( "xAOD::TEvent::record",
                   XAOD_MESSAGE( "Manager object of the wrong type "
                                 "encountered" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check that the type of the object matches that of the previous
@@ -2165,7 +2165,7 @@ namespace xAOD {
                                    "\"%s\"" ),
                      key.c_str(), omgr->holder()->getClass()->GetName(),
                      typeName.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
       }
 
@@ -2191,7 +2191,7 @@ namespace xAOD {
    /// @returns <code>kTRUE</code> if the operation was successful, or
    ///          <code>kFALSE</code> if it was not
    ///
-   TReturnCode TEvent::record( TAuxStore* store, const std::string& key,
+   StatusCode TEvent::record( TAuxStore* store, const std::string& key,
                                ::Int_t /*basketSize*/, ::Int_t /*splitLevel*/,
                                ::Bool_t ownsStore ) {
 
@@ -2200,7 +2200,7 @@ namespace xAOD {
          ::Error( "xAOD::TEvent::record",
                   XAOD_MESSAGE( "No output tree defined. Did you forget to "
                                 "call writeTo(...)?" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check if we have a filtering rule for this key:
@@ -2225,13 +2225,13 @@ namespace xAOD {
          m_outputObjects[ key ] = mgr;
 
          // We're done:
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Check if the output has the right store:
       if( vitr->second->object() == store ) {
          // We're done already:
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // If not, update the output manager. This can happen when we copy
@@ -2245,7 +2245,7 @@ namespace xAOD {
                   XAOD_MESSAGE( "Output object with key %s already exists, "
                                 "and is not of type TAuxStore" ),
                   key.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Configure the object for variable filtering:
@@ -2260,7 +2260,7 @@ namespace xAOD {
       mgr->setObject( store );
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This is one of the more important functions of the class. It connects the
@@ -2281,14 +2281,14 @@ namespace xAOD {
    /// @return <code>kTRUE</code> if the connection was successful, or
    ///         <code>kFALSE</code> if it was not
    ///
-   TReturnCode TEvent::connectBranch( const std::string& key,
+   StatusCode TEvent::connectBranch( const std::string& key,
                                       ::Bool_t silent ) {
 
       // A little sanity check:
       if( ! m_inTree ) {
          ::Error( "xAOD::TEvent::connectBranch",
                   XAOD_MESSAGE( "Function called on un-initialised object" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Increment the access counter on this container:
@@ -2296,7 +2296,7 @@ namespace xAOD {
 
       // Check if the branch is already connected:
       if( m_inputObjects.find( key ) != m_inputObjects.end() ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Check if we have metadata about this branch:
@@ -2319,7 +2319,7 @@ namespace xAOD {
                        "Branch \"%s\" not available on input",
                        key.c_str() );
          }
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Make sure that it's not in "MakeClass mode":
@@ -2338,7 +2338,7 @@ namespace xAOD {
                      XAOD_MESSAGE( "Couldn't find an appropriate type with a "
                                    "dictionary for branch \"%s\"" ),
                      key.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
       }
       ::TClass* realClass = ::TClass::GetClass( className.c_str() );
@@ -2355,7 +2355,7 @@ namespace xAOD {
                   XAOD_MESSAGE( "Couldn't find an appropriate type with a "
                                 "dictionary for branch \"%s\"" ),
                   key.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Make sure that the current object is the "active event":
@@ -2378,7 +2378,7 @@ namespace xAOD {
             ::Error( "xAOD::TEvent::connectBranch",
                      XAOD_MESSAGE( "Couldn't access output manager for: %s" ),
                      key.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          // Get the pointer out of it:
          ptr = mgr->holder()->get();
@@ -2411,7 +2411,7 @@ namespace xAOD {
          *( hldr->getPtr() ) = 0;
          delete mgr;
          m_inputObjects.erase( key );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Now try to connect to the branch:
@@ -2429,7 +2429,7 @@ namespace xAOD {
          *( hldr->getPtr() ) = 0;
          delete mgr;
          m_inputObjects.erase( key );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // If it's an auxiliary store object, set it up correctly:
@@ -2439,7 +2439,7 @@ namespace xAOD {
       }
 
       // Return here if the object can't have an auxiliary store:
-      if( ! hasAuxStore( *mgr ) ) return TReturnCode::kSuccess;
+      if( ! hasAuxStore( *mgr ) ) return StatusCode::SUCCESS;
 
       // If there may be an auxiliary object connected to this one,
       // connect that as well:
@@ -2452,21 +2452,21 @@ namespace xAOD {
    /// @param key The key (branch name) of the metadata object to retrieve
    /// @param silent Set to <code>kTRUE</code> to make the code fail silently
    ///               in case the branch can't be connected to
-   /// @returns The usual TReturnCode types
+   /// @returns The usual StatusCode types
    ///
-   TReturnCode TEvent::connectMetaBranch( const std::string& key,
+   StatusCode TEvent::connectMetaBranch( const std::string& key,
                                           ::Bool_t silent ) {
 
       // A little sanity check:
       if( ! m_inMetaTree ) {
          ::Error( "xAOD::TEvent::connectMetaBranch",
                   XAOD_MESSAGE( "Function called on un-initialised object" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check if the branch is already connected:
       if( m_inputMetaObjects.find( key ) != m_inputMetaObjects.end() ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Check if the branch exists in our metadata tree:
@@ -2477,7 +2477,7 @@ namespace xAOD {
                        "Branch \"%s\" not available on input",
                        key.c_str() );
          }
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Check that we have an entry in the branch:
@@ -2487,7 +2487,7 @@ namespace xAOD {
                        "Branch \"%s\" doesn't hold any data",
                        key.c_str() );
          }
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Make sure that it's not in "MakeClass mode":
@@ -2500,7 +2500,7 @@ namespace xAOD {
          ::Error( "xAOD::TEvent::connectMetaBranch",
                   XAOD_MESSAGE( "Couldn't get the type for metadata "
                                 "branch %s" ), key.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Create the object, and all of the managers around it:
@@ -2525,7 +2525,7 @@ namespace xAOD {
          *( hldr->getPtr() ) = 0;
          delete mgr;
          m_inputMetaObjects.erase( key );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Read in the object:
@@ -2533,7 +2533,7 @@ namespace xAOD {
          ::Error( "xAOD::TEvent::connectMetaBranch",
                   XAOD_MESSAGE( "Couldn't read in metadata object with key "
                                 "\"%s\"" ), key.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // If it's an auxiliary store object, set it up correctly:
@@ -2543,7 +2543,7 @@ namespace xAOD {
       }
 
       // Return here if the object can't have an auxiliary store:
-      if( ! hasAuxStore( *mgr ) ) return TReturnCode::kSuccess;
+      if( ! hasAuxStore( *mgr ) ) return StatusCode::SUCCESS;
 
       // If there may be an auxiliary object connected to this one,
       // connect that as well:
@@ -2555,7 +2555,7 @@ namespace xAOD {
                     setAuxStore( *mgr, kTRUE ) );
 
       // We succeeded:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function is used internally to connect an auxiliary object to
@@ -2568,14 +2568,14 @@ namespace xAOD {
    /// @return <code>kTRUE</code> if the connection was successful, or
    ///         <code>kFALSE</code> if it was not
    ///
-   TReturnCode TEvent::connectAux( const std::string& prefix,
+   StatusCode TEvent::connectAux( const std::string& prefix,
                                    ::Bool_t standalone ) {
 
       // A simple test...
       if( ! m_inTree ) {
          ::Error( "xAOD::TEvent::connectAux",
                   XAOD_MESSAGE( "No input tree is available" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check if we know anything about this auxiliary object:
@@ -2583,12 +2583,12 @@ namespace xAOD {
           ( m_auxMode == kClassAccess || m_auxMode == kAthenaAccess ) ) {
          // If not, then let's just return right away. Not having
          // an auxiliary object with this name is not an error per se.
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Check if the branch is already connected:
       if( m_inputObjects.find( prefix ) != m_inputObjects.end() ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Do different things based on the "auxiliary mode" we are in:
@@ -2616,7 +2616,7 @@ namespace xAOD {
             TClass::GetClass( typeid( SG::IAuxStoreHolder ) );
          if( ! omgr->holder()->getClass()->InheritsFrom( holderClass ) ) {
             // Nope... So let's just end the journey here.
-            return TReturnCode::kSuccess;
+            return StatusCode::SUCCESS;
          }
 
          // Try to get the object as an IAuxStoreHolder:
@@ -2642,11 +2642,11 @@ namespace xAOD {
                      XAOD_MESSAGE( "standalone = %s, getStoreType() = %i" ),
                      ( standalone ? "kTRUE" : "kFALSE" ),
                      static_cast< int >( storeHolder->getStoreType() ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Return gracefully:
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
 
       } else if( m_auxMode == kBranchAccess ) {
 
@@ -2667,14 +2667,14 @@ namespace xAOD {
                        store->readFrom( m_inTree ) );
 
          // Return gracefully:
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // There was some problem:
       ::Error( "xAOD::TEvent::connectAux",
                XAOD_MESSAGE( "Unknown auxiliary access mode set (%i)" ),
                static_cast< int >( m_auxMode ) );
-      return TReturnCode::kFailure;
+      return StatusCode::FAILURE;
    }
 
    /// This function is used internally to connect an auxiliary metadata object
@@ -2684,21 +2684,21 @@ namespace xAOD {
    ///
    /// @param prefix The prefix (main branch name) of the auxiliary data
    /// @param standalone Type of the auxiliary store that should be created
-   /// @return The usual TReturnCode types
+   /// @return The usual StatusCode types
    ///
-   TReturnCode TEvent::connectMetaAux( const std::string& prefix,
+   StatusCode TEvent::connectMetaAux( const std::string& prefix,
                                        ::Bool_t standalone ) {
 
       // Check if the branch is already connected:
       if( m_inputMetaObjects.find( prefix ) != m_inputMetaObjects.end() ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // A sanity check:
       if( ! m_inMetaTree ) {
          ::Fatal( "xAOD::TEvent::connectMetaAux",
                   XAOD_MESSAGE( "Internal logic error detected" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Do different things based on the "auxiliary mode" we are in:
@@ -2727,7 +2727,7 @@ namespace xAOD {
             TClass::GetClass( typeid( SG::IAuxStoreHolder ) );
          if( ! omgr->holder()->getClass()->InheritsFrom( holderClass ) ) {
             // Nope... So let's just end the journey here.
-            return TReturnCode::kSuccess;
+            return StatusCode::SUCCESS;
          }
 
          // Try to get the object as an IAuxStoreHolder:
@@ -2752,11 +2752,11 @@ namespace xAOD {
                      XAOD_MESSAGE( "standalone = %s, getStoreType() = %i" ),
                      ( standalone ? "kTRUE" : "kFALSE" ),
                      static_cast< int >( storeHolder->getStoreType() ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Return gracefully:
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
 
       } else if( m_auxMode == kBranchAccess ) {
 
@@ -2780,14 +2780,14 @@ namespace xAOD {
          store->getEntry( 0 );
 
          // Return gracefully:
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // There was some problem:
       ::Error( "xAOD::TEvent::connectMetaAux",
                XAOD_MESSAGE( "Unknown auxiliary access mode set (%i)" ),
                static_cast< int >( m_auxMode ) );
-      return TReturnCode::kFailure;
+      return StatusCode::FAILURE;
    }
 
    /// This function is used by connectBranch(...) and connectMetaBranch(...)
@@ -2796,9 +2796,9 @@ namespace xAOD {
    ///
    /// @param mgr  The object manager of the auxiliary store object
    /// @param tree The tree to read dynamic variables from
-   /// @returns The usual <code>TReturnCode</code> types
+   /// @returns The usual <code>StatusCode</code> types
    ///
-   TReturnCode TEvent::setUpDynamicStore( TObjectManager& mgr, ::TTree* tree ) {
+   StatusCode TEvent::setUpDynamicStore( TObjectManager& mgr, ::TTree* tree ) {
 
       // Check if we can call setName(...) on the object:
       ::TMethodCall setNameCall;
@@ -2829,7 +2829,7 @@ namespace xAOD {
          TClass::GetClass( typeid( SG::IAuxStoreHolder ) );
       if( ! mgr.holder()->getClass()->InheritsFrom( holderClass ) ) {
          // Nope... So let's just end the journey here.
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Try to get the object as an IAuxStoreHolder:
@@ -2868,7 +2868,7 @@ namespace xAOD {
       storeHolder->setStore( store );
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// Every time a DataVector is read in from the input for a new TTree
@@ -2881,12 +2881,12 @@ namespace xAOD {
    /// @return <code>kTRUE</code> if the setup was successful, or
    ///         <code>kFALSE</code> if it was not
    ///
-   TReturnCode TEvent::setAuxStore( TObjectManager& mgr,
+   StatusCode TEvent::setAuxStore( TObjectManager& mgr,
                                     ::Bool_t metadata ) {
 
       // Check if we need to do anything:
       if( ( ! hasAuxStore( mgr ) ) && ( ! isAuxStore( mgr ) ) ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Get the branch name of the object in question:
@@ -2908,7 +2908,7 @@ namespace xAOD {
          if( itr == objects.end() ) {
             // Apparently there's no auxiliary object for this DV, so let's
             // give up:
-            return TReturnCode::kSuccess;
+            return StatusCode::SUCCESS;
          }
          auxMgr = itr->second;
          auxKey = key + "Aux.";
@@ -2948,7 +2948,7 @@ namespace xAOD {
                if( dynAuxMgr == objects.end() ) {
                   ::Error( "xAOD::TEvent::setAuxStore",
                            XAOD_MESSAGE( "Internal logic error detected" ) );
-                  return TReturnCode::kFailure;
+                  return StatusCode::FAILURE;
                }
                dynAuxMgr->second->getEntry( m_entry );
             }
@@ -2957,7 +2957,7 @@ namespace xAOD {
 
       // Stop here if we've set up an auxiliary store.
       if( auxMgr == &mgr ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Access the auxiliary base class of the object/vector:
@@ -3041,7 +3041,7 @@ namespace xAOD {
       }
 
       // We succeeded:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function is used internally to set up the writing of the auxiliary
@@ -3057,7 +3057,7 @@ namespace xAOD {
    /// @returns <code>kTRUE</code> if the setup was successful, or
    ///         <code>kFALSE</code> if it was not
    ///
-   TReturnCode TEvent::putAux( ::TTree& outTree, TVirtualManager& vmgr,
+   StatusCode TEvent::putAux( ::TTree& outTree, TVirtualManager& vmgr,
                                ::Int_t basketSize, ::Int_t splitLevel,
                                ::Bool_t metadata ) {
 
@@ -3068,12 +3068,12 @@ namespace xAOD {
       TObjectManager* mgr = dynamic_cast< TObjectManager* >( &vmgr );
       if( ! mgr ) {
          // It's not an error any more when we don't get a TObjectManager.
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Check if we need to do anything here:
       if( ! mgr->holder()->getClass()->InheritsFrom( "SG::IAuxStoreIO" ) ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Get a pointer to the auxiliary store I/O interface:
@@ -3102,7 +3102,7 @@ namespace xAOD {
       // If there are no dynamic auxiliary variables in the object, return
       // right away:
       if( auxids.empty() ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Decide what should be the prefix of all the dynamic branches:
@@ -3144,7 +3144,7 @@ namespace xAOD {
                ::Error( "xAOD::TEvent::putAux",
                         XAOD_MESSAGE( "No I/O type found for variable %s" ),
                         brName.c_str() );
-               return TReturnCode::kFailure;
+               return StatusCode::FAILURE;
             }
             const std::string brTypeName =
                Utils::getTypeName( *brType );
@@ -3166,7 +3166,7 @@ namespace xAOD {
                            XAOD_MESSAGE( "Type not known for variable \"%s\" "
                                          "of type \"%s\"" ),
                            brName.c_str(), brTypeName.c_str() );
-                  return TReturnCode::kFailure;
+                  return StatusCode::FAILURE;
                }
 
                // Create the full description of the variable for ROOT:
@@ -3194,7 +3194,7 @@ namespace xAOD {
                   *( auxmgr->holder()->getPtr() ) = 0;
                   delete auxmgr;
                   objects.erase( brName );
-                  return TReturnCode::kFailure;
+                  return StatusCode::FAILURE;
                }
                br = auxmgr->branch();
 
@@ -3212,7 +3212,7 @@ namespace xAOD {
                               XAOD_MESSAGE( "Dictionary not available for "
                                             "variable \"%s\" of type \"%s\"" ),
                               brName.c_str(), brTypeName.c_str() );
-                     return TReturnCode::kFailure;
+                     return StatusCode::FAILURE;
                   }
                }
 
@@ -3243,7 +3243,7 @@ namespace xAOD {
                   *( auxmgr->holder()->getPtr() ) = 0;
                   delete auxmgr;
                   objects.erase( brName );
-                  return TReturnCode::kFailure;
+                  return StatusCode::FAILURE;
                }
                br = auxmgr->branch();
 
@@ -3287,7 +3287,7 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// Since the code needs to check in a few places whether a given object
diff --git a/Control/xAODRootAccess/Root/TEventProxyDict.cxx b/Control/xAODRootAccess/Root/TEventProxyDict.cxx
index b203ae355b2ed998c9a5521501ccee7452e00229..d6d4b93369c570c2851e0329ab52c5090d85eec0 100644
--- a/Control/xAODRootAccess/Root/TEventProxyDict.cxx
+++ b/Control/xAODRootAccess/Root/TEventProxyDict.cxx
@@ -190,17 +190,6 @@ namespace xAODPrivate {
 
 namespace xAOD {
 
-#ifdef XAOD_STANDALONE
-   /// Helper typedef when building the code standalone
-   typedef TReturnCode StatusCode;
-   /// Helper variable for returning a successful status code
-   static const TReturnCode::EReturnCode STATUSCODE_SUCCESS =
-      TReturnCode::kSuccess;
-#else
-   /// Helper variable for returning a successful status code
-   static const StatusCode STATUSCODE_SUCCESS = StatusCode::SUCCESS;
-#endif // XAOD_STANDALONE
-
    SG::DataProxy* TEvent::proxy( const void* const pTransient ) const {
 
       // Look up the name of this object
@@ -383,7 +372,7 @@ namespace xAOD {
                                          std::move( bi ) ) );
 
       // Return gracefully:
-      return STATUSCODE_SUCCESS;
+      return StatusCode::SUCCESS;
    }
 
    std::vector< const SG::DataProxy* > TEvent::proxies() const {
@@ -444,7 +433,7 @@ namespace xAOD {
    StatusCode TEvent::queryInterface( const InterfaceID&, void** ) {
 
       // Return without doing anything:
-      return STATUSCODE_SUCCESS;
+      return StatusCode::SUCCESS;
    }
 
 } // namespace xAOD
diff --git a/Control/xAODRootAccess/Root/TFileChecker.cxx b/Control/xAODRootAccess/Root/TFileChecker.cxx
index 20c0e124f28de76f99dc8b715a795afc6ed5a9e7..cdc46b6c477151b6c8beb0fb8ce30b68dc099664 100644
--- a/Control/xAODRootAccess/Root/TFileChecker.cxx
+++ b/Control/xAODRootAccess/Root/TFileChecker.cxx
@@ -39,21 +39,21 @@ namespace xAOD {
 
    }
 
-   TReturnCode TFileChecker::check( TEvent& event ) {
+   StatusCode TFileChecker::check( TEvent& event ) {
 
       // Reset the internal cache(es):
       m_orpannedContainers.clear();
 
       // Bail right away if there are no events in the file:
       if( ! event.getEntries() ) {
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // Load the first event:
       if( event.getEntry( 0 ) < 0 ) {
          Error( "check",
                 XAOD_MESSAGE( "Couldn't load event 0 from the input" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Get the list of containers in the file:
@@ -89,7 +89,7 @@ namespace xAOD {
             Error( "check",
                    XAOD_MESSAGE( "Failed to load event %i from the input" ),
                    static_cast< int >( entry ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Print a progress message:
@@ -122,7 +122,7 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    void TFileChecker::setStopOnError( ::Bool_t value ) {
@@ -154,7 +154,7 @@ namespace xAOD {
       return m_ignoredVariables;
    }
 
-   TReturnCode TFileChecker::checkContainer( const SG::AuxVectorBase& vec,
+   StatusCode TFileChecker::checkContainer( const SG::AuxVectorBase& vec,
                                              const std::string& name ) {
 
       // Access the auxiliary store of the container:
@@ -172,16 +172,16 @@ namespace xAOD {
                                     "container: %s" ),
                       name.c_str() );
                m_orpannedContainers.insert( name );
-               return TReturnCode::kFailure;
+               return StatusCode::FAILURE;
             }
-            return TReturnCode::kSuccess;
+            return StatusCode::SUCCESS;
          } else {
             // This can happen when the auxiliary store doesn't implement the
             // I/O interface. This is the case for types inheriting from
             // xAOD::ByteStreamAuxContainer for instance. Since all issues that
             // we check for in here are tied to the I/O happening through this
             // interface, let's not bother with such objects.
-            return TReturnCode::kSuccess;
+            return StatusCode::SUCCESS;
          }
       }
 
@@ -202,7 +202,7 @@ namespace xAOD {
             Error( "checkContainer",
                    XAOD_MESSAGE( "Couldn't load variable %s.%s" ),
                    name.c_str(), reg.getName( auxid ).c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Find a dictionary for this type:
@@ -217,7 +217,7 @@ namespace xAOD {
                       XAOD_MESSAGE( "Couldn't get std::type_info for "
                                     "variable %s" ),
                       reg.getName( auxid ).c_str() );
-               return TReturnCode::kFailure;
+               return StatusCode::FAILURE;
             }
             cl = ::TClass::GetClass( *typeId );
             s_dictCache[ auxid ] = cl;
@@ -226,7 +226,7 @@ namespace xAOD {
             Error( "checkContainer",
                    XAOD_MESSAGE( "Couldn't get dictionary for variable %s" ),
                    reg.getName( auxid ).c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Make sure that the type has a collection proxy:
@@ -236,7 +236,7 @@ namespace xAOD {
                    XAOD_MESSAGE( "Couldn't get collection proxy for "
                                  "variable %s" ),
                    reg.getName( auxid ).c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Get the size of the vector using the collection proxy:
@@ -253,12 +253,12 @@ namespace xAOD {
                    name.c_str(), static_cast< int >( size ),
                    name.c_str(), reg.getName( auxid ).c_str(),
                    static_cast< int >( varSize ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
 } // namespace xAOD
diff --git a/Control/xAODRootAccess/Root/TFileMerger.cxx b/Control/xAODRootAccess/Root/TFileMerger.cxx
index c011e5530e7325ff3d00fdfd5b03a9e16871ecea..18a286236dd582ccba42fa902f7edb97f97bb0ac 100644
--- a/Control/xAODRootAccess/Root/TFileMerger.cxx
+++ b/Control/xAODRootAccess/Root/TFileMerger.cxx
@@ -58,7 +58,7 @@ namespace xAOD {
       closeFiles().ignore();
    }
 
-   TReturnCode TFileMerger::setOutputFileName( const std::string& name,
+   StatusCode TFileMerger::setOutputFileName( const std::string& name,
                                                const std::string& mode ) {
 
       // Try to open the file:
@@ -68,7 +68,7 @@ namespace xAOD {
                 XAOD_MESSAGE( "Couldn't open output file \"%s\" in mode "
                               "\"%s\"" ),
                 name.c_str(), mode.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Tell the user what happened:
@@ -79,10 +79,10 @@ namespace xAOD {
       gROOT->cd();
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
-   TReturnCode TFileMerger::addFile( const std::string& name,
+   StatusCode TFileMerger::addFile( const std::string& name,
                                      bool copyLocally ) {
 
       // Decide whether to use the file from its current location, or to make
@@ -101,7 +101,7 @@ namespace xAOD {
                    XAOD_MESSAGE( "Couldn't create local copy of \"%s\" under "
                                  "\"%s\"" ),
                    name.c_str(), localName.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          // Tell the user what happened:
          Info( "addFile", "Made a local copy of: %s", name.c_str() );
@@ -112,7 +112,7 @@ namespace xAOD {
       if( ! ifile ) {
          Error( "addFile", XAOD_MESSAGE( "Couldn't open file \"%s\"" ),
                 localName.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Add it to our list:
@@ -124,7 +124,7 @@ namespace xAOD {
       gROOT->cd();
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// In order to merge various kinds of metadata from the input files
@@ -134,19 +134,19 @@ namespace xAOD {
    /// type in the background.
    ///
    /// @param typeName The type name of the tool to create
-   /// @returns <code>TReturnCode::kSuccess</code> if the tool was successfully
-   ///          created, <code>TReturnCode::kFailure</code> if the tool could
-   ///          not be created, and <code>TReturnCode::kRecoverable</code> if
+   /// @returns <code>StatusCode::SUCCESS</code> if the tool was successfully
+   ///          created, <code>StatusCode::FAILURE</code> if the tool could
+   ///          not be created, and <code>StatusCode::RECOVERABLE</code> if
    ///          a tool of this type is already held by the object
    ///
-   TReturnCode TFileMerger::addMetaDataTool( const std::string& typeName ) {
+   StatusCode TFileMerger::addMetaDataTool( const std::string& typeName ) {
 
       // Check if we already have a tool of this type:
       if( m_metaDataToolNames.find( typeName ) != m_metaDataToolNames.end() ) {
          Warning( "addMetaDataTool",
                   "Tool of type \"%s\" is already specified",
                   typeName.c_str() );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Try to create an instance of the tool:
@@ -155,7 +155,7 @@ namespace xAOD {
          Error( "addMetaDataTool",
                 XAOD_MESSAGE( "Tool of type \"%s\" not found" ),
                 typeName.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Remember the type:
@@ -168,7 +168,7 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This is the main function of the class. It executes the merging of the
@@ -177,21 +177,21 @@ namespace xAOD {
    /// @param mode The merging mode to be used
    /// @param entries Entries to be merged into the output file. Only effective
    ///                in slow merging mode.
-   /// @return <code>TReturnCode::kSuccess</code> if the merging was successful,
-   ///         or <code>TReturnCode::kFailure</code> if it wasn't
+   /// @return <code>StatusCode::SUCCESS</code> if the merging was successful,
+   ///         or <code>StatusCode::FAILURE</code> if it wasn't
    ///
-   TReturnCode TFileMerger::merge( EMergeMode mode, ::Long64_t entries ) {
+   StatusCode TFileMerger::merge( EMergeMode mode, ::Long64_t entries ) {
 
       // Check that we have an output file:
       if( ! m_output ) {
          Error( "merge", XAOD_MESSAGE( "No output file specified" ) );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check that we have input files:
       if( ! m_input.size() ) {
          Warning( "merge", "No input files were specified" );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Check that we received consistent parameters:
@@ -217,7 +217,7 @@ namespace xAOD {
       RETURN_CHECK( "xAOD::TFileMerger::merge", closeFiles() );
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    TEvent::EAuxMode TFileMerger::accessMode() const {
@@ -253,7 +253,7 @@ namespace xAOD {
       return;
    }
 
-   TReturnCode TFileMerger::closeFiles() {
+   StatusCode TFileMerger::closeFiles() {
 
       if( m_verbosity >= 1 ) {
          Info( "closeFiles", "Closing all open files" );
@@ -288,7 +288,7 @@ namespace xAOD {
                Error( "closeFiles",
                       XAOD_MESSAGE( "Couldn't remove local file: %s" ),
                       p.Data() );
-               return TReturnCode::kFailure;
+               return StatusCode::FAILURE;
             }
             if( m_verbosity >= 2 ) {
                Info( "closeFiles", "Deleted: %s", m_input[ i ]->GetName() );
@@ -319,7 +319,7 @@ namespace xAOD {
       m_helperFiles.clear();
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function does most of the heavy-lifting in the code. It recursively
@@ -330,10 +330,10 @@ namespace xAOD {
    /// @param output The corresponding directory in the output file
    /// @param mode The merging mode for the xAOD trees
    /// @param topLevelDir Flag whether this is the top directory in the file(s)
-   /// @return <code>TReturnCode::kSuccess</code> if the merging succeeded, or
-   ///         <code>TReturnCode::kFailure</code> if it didn't
+   /// @return <code>StatusCode::SUCCESS</code> if the merging succeeded, or
+   ///         <code>StatusCode::FAILURE</code> if it didn't
    ///
-   TReturnCode TFileMerger::mergeDirectory( ::TDirectory& input,
+   StatusCode TFileMerger::mergeDirectory( ::TDirectory& input,
                                             ::TDirectory& output,
                                             EMergeMode mode,
                                             bool topLevelDir ) {
@@ -350,7 +350,7 @@ namespace xAOD {
          Error( "mergeDirectory",
                 XAOD_MESSAGE( "Couldn't get list of keys from input directory "
                               "\"%s\"" ), input.GetName() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       //
@@ -368,7 +368,7 @@ namespace xAOD {
             Error( "mergeDirectory",
                    XAOD_MESSAGE( "Couldn't case object to TKey. No idea "
                                  "why..." ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          if( m_verbosity >= 3 ) {
             Info( "mergeDirectory", "Evaluating key \"%s;%hi\" with type "
@@ -384,7 +384,7 @@ namespace xAOD {
                    XAOD_MESSAGE( "Couldn't access object with name "
                                  "\"%s;%hi\"" ),
                    key->GetName(), key->GetCycle() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          //
@@ -401,7 +401,7 @@ namespace xAOD {
             if( ! indir ) {
                Error( "mergeDirectory",
                       XAOD_MESSAGE( "Couldn't cast to object to TDirectory" ) );
-               return TReturnCode::kFailure;
+               return StatusCode::FAILURE;
             }
 
             // Check if such a directory already exists in the output:
@@ -415,7 +415,7 @@ namespace xAOD {
                          XAOD_MESSAGE( "Failed creating subdirectory with "
                                        "name: %s" ),
                          key->GetName() );
-                  return TReturnCode::kFailure;
+                  return StatusCode::FAILURE;
                }
             }
 
@@ -471,7 +471,7 @@ namespace xAOD {
                       XAOD_MESSAGE( "Couldn't access \"%s\" with a TTree "
                                     "pointer" ),
                       treeObj->GetName() );
-               return TReturnCode::kFailure;
+               return StatusCode::FAILURE;
             }
 
             // Skip trees that have friends. Those don't play nicely with
@@ -546,7 +546,7 @@ namespace xAOD {
                             XAOD_MESSAGE( "ief = %p, oef = %p" ),
                             static_cast< const void* >( ief ),
                             static_cast< void* >( oef ) );
-                     return TReturnCode::kFailure;
+                     return StatusCode::FAILURE;
                   }
                   auto itr = ief->begin();
                   auto end = ief->end();
@@ -617,7 +617,7 @@ namespace xAOD {
                         Error( "mergeDirectory",
                                XAOD_MESSAGE( "Internal logic error "
                                              "detected" ) );
-                        return TReturnCode::kFailure;
+                        return StatusCode::FAILURE;
                      }
                      auxIndices[ index ] = br;
                      obranches->RemoveAt( index );
@@ -647,7 +647,7 @@ namespace xAOD {
                         Error( "mergeDirectory",
                                XAOD_MESSAGE( "Invalid TTreeCloner (%s)" ),
                                cloner.GetWarning() );
-                        return TReturnCode::kFailure;
+                        return StatusCode::FAILURE;
                      }
                   }
 
@@ -657,7 +657,7 @@ namespace xAOD {
                   if( ! cloner.Exec() ) {
                      Error( "mergeDirectory",
                             XAOD_MESSAGE( "Failed to execute TTreeCloner" ) );
-                     return TReturnCode::kFailure;
+                     return StatusCode::FAILURE;
                   }
 
                   // Put back the branches that have no counterpart in the input
@@ -685,7 +685,7 @@ namespace xAOD {
                                   XAOD_MESSAGE( "Failed to fill branch \"%s\" "
                                                 "with default content" ),
                                   br->GetName() );
-                           return TReturnCode::kFailure;
+                           return StatusCode::FAILURE;
                         }
                      }
                   }
@@ -728,7 +728,7 @@ namespace xAOD {
                             XAOD_MESSAGE( "TTree \"%s\" couldn't be cloned "
                                           "into the output" ),
                             itree->GetName() );
-                     return TReturnCode::kFailure;
+                     return StatusCode::FAILURE;
                   }
                   otree->SetDirectory( &output );
                   otree->AutoSave();
@@ -753,7 +753,7 @@ namespace xAOD {
                   if( ! ofile ) {
                      Error( "mergeDirectory",
                             XAOD_MESSAGE( "Internal logic error found" ) );
-                     return TReturnCode::kFailure;
+                     return StatusCode::FAILURE;
                   }
                   RETURN_CHECK( "xAOD::TFileMerger::mergeDirectory",
                                 event->writeTo( ofile, 200, key->GetName() ) );
@@ -780,7 +780,7 @@ namespace xAOD {
                             XAOD_MESSAGE( "Couldn't get entry %i from tree "
                                           "%s" ),
                            static_cast< int >( entry ), key->GetName() );
-                     return TReturnCode::kFailure;
+                     return StatusCode::FAILURE;
                   }
 
                   // Give the user feedback about the processing status:
@@ -803,7 +803,7 @@ namespace xAOD {
                             XAOD_MESSAGE( "There was an error in writing entry "
                                           "%i from tree %s" ),
                             static_cast< int >( entry ), key->GetName() );
-                     return TReturnCode::kFailure;
+                     return StatusCode::FAILURE;
                   } else if( bytes == 0 ) {
                      Warning( "mergeDirectory",
                               "No payload was written for entry %i",
@@ -843,7 +843,7 @@ namespace xAOD {
             // If the output object already exists, and we can merge this input
             // object into it, then that's all that we need to do:
             if( oobj ) {
-               const TReturnCode ret = mergeObject( *obj, *oobj );
+               const StatusCode ret = mergeObject( *obj, *oobj );
                if( ret.isSuccess() ) {
                   // Make sure that the output object is updated in the output
                   // file:
@@ -854,7 +854,7 @@ namespace xAOD {
                   Error( "mergeDirectory",
                          XAOD_MESSAGE( "Error detected while merging object "
                                        "\"%s\"" ), obj->GetName() );
-                  return TReturnCode::kFailure;
+                  return StatusCode::FAILURE;
                }
             }
 
@@ -870,26 +870,26 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function is used internally to merge two generic ROOT objects in
    /// the file together. It's not the most trivial, since TObject doesn't have
    /// a merge function itself.
    ///
-   /// The function fails with <code>TReturnCode::kRecoverable</code> when
+   /// The function fails with <code>StatusCode::RECOVERABLE</code> when
    /// encountering types that don't have a Merge(...) function defined. In this
    /// case we need to save both objects, with different versions, into the
    /// output.
    ///
    /// @param input The input object
    /// @param output The output object
-   /// @return <code>TReturnCode::Success</code> if the merging succeeded,
-   ///         <code>TReturnCode::kFailure</code> if there was a technical
-   ///         issue, and <code>TReturnCode::kRecoverable</code> if the objects
+   /// @return <code>StatusCode::Success</code> if the merging succeeded,
+   ///         <code>StatusCode::FAILURE</code> if there was a technical
+   ///         issue, and <code>StatusCode::RECOVERABLE</code> if the objects
    ///         don't define a merging function.
    ///
-   TReturnCode TFileMerger::mergeObject( ::TObject& input, ::TObject& output ) {
+   StatusCode TFileMerger::mergeObject( ::TObject& input, ::TObject& output ) {
 
       if( m_verbosity >= 3 ) {
          Info( "mergeObject", "Called mergeObject( %s, %s )",
@@ -904,7 +904,7 @@ namespace xAOD {
                 XAOD_MESSAGE( "input = %s" ), input.IsA()->GetName() );
          Error( "mergeObject",
                 XAOD_MESSAGE( "output = %s" ), output.IsA()->GetName() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Check if there is a merge function defined for these objects:
@@ -915,7 +915,7 @@ namespace xAOD {
          if( m_verbosity >= 3 ) {
             Info( "mergeObject", "Type doesn't have a Merge function" );
          }
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Put the input object into a list, since that's what we need to give
@@ -932,10 +932,10 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
-   TReturnCode TFileMerger::createMetaDataTools() {
+   StatusCode TFileMerger::createMetaDataTools() {
 
       // Create all the specified tool types:
       for( const std::string& typeName : m_metaDataToolNames ) {
@@ -951,14 +951,14 @@ namespace xAOD {
             Error( "createMetaDataTools",
                    XAOD_MESSAGE( "Tool of type \"%s\" not found" ),
                    typeName.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          void* ptr = cl->New();
          if( ! ptr ) {
             Error( "createMetaDataTools",
                    XAOD_MESSAGE( "Failed to create an instance of tool "
                                  "\"%s\"" ), typeName.c_str() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
 
          // Try to call the tool's initialize() function:
@@ -1009,7 +1009,7 @@ namespace xAOD {
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function finds branches that appear in the first tree, but don't
@@ -1106,9 +1106,9 @@ namespace xAOD {
    ///
    /// @param otree The output tree to create the branch in
    /// @param ibranch Pointer to the branch in the input tree
-   /// @returns The usual <code>TReturnCode</code> types
+   /// @returns The usual <code>StatusCode</code> types
    ///
-   TReturnCode TFileMerger::addAuxBranch( ::TTree* otree,
+   StatusCode TFileMerger::addAuxBranch( ::TTree* otree,
                                           ::TBranch* ibranch ) const {
 
       // Get the type of the branch:
@@ -1118,7 +1118,7 @@ namespace xAOD {
          Error( "addAuxBranch",
                 XAOD_MESSAGE( "Type could not be extracted for branch \"%s\"" ),
                 ibranch->GetName() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Pointer to the output branch:
@@ -1136,7 +1136,7 @@ namespace xAOD {
                    XAOD_MESSAGE( "Couldn't create auxiliary branch \"%s\" with "
                                  "type: %s" ),
                    ibranch->GetName(), cl->GetName() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
       } else if( dt != kOther_t ) {
          // It's a primitive type:
@@ -1146,7 +1146,7 @@ namespace xAOD {
             Error( "addAuxBranch",
                     XAOD_MESSAGE( "Type can't be extracted for EDataType = %i"),
                     static_cast< int >( dt ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
          std::ostringstream leaflist;
          leaflist << ibranch->GetName() << "/" << rootType;
@@ -1159,13 +1159,13 @@ namespace xAOD {
                    XAOD_MESSAGE( "Couldn't create auxiliary branch \"%s\" with "
                                  "data type: %i" ),
                    ibranch->GetName(), static_cast< int >( dt ) );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
       } else {
          Error( "addAuxBranch",
                 XAOD_MESSAGE( "Couldn't figure out the type of branch \"%s\"" ),
                 ibranch->GetName() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Fill up the branch with dummy entries:
@@ -1175,12 +1175,12 @@ namespace xAOD {
             Error( "addAuxBranch",
                   XAOD_MESSAGE( "Failed to fill branch \"%s\" with dummy "
                                "data" ), obranch->GetName() );
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
 } // namespace xAOD
diff --git a/Control/xAODRootAccess/Root/TPyEvent.cxx b/Control/xAODRootAccess/Root/TPyEvent.cxx
index 224215389884e7dc282348799599927827ae45f3..64a5e4bd7ceedbe2fc123e9e3cad2b307a04f419 100644
--- a/Control/xAODRootAccess/Root/TPyEvent.cxx
+++ b/Control/xAODRootAccess/Root/TPyEvent.cxx
@@ -74,9 +74,9 @@ namespace xAOD {
    /// @param type The type name of the object being recorded
    /// @param basketSize The size of the baskets used to write the payload
    /// @param splitLevel The split level of the branch created
-   /// @returns The usual xAOD::TReturnCode types
+   /// @returns The usual StatusCode types
    ///
-   TReturnCode TPyEvent::record( int /*dummy*/, void* obj,
+   StatusCode TPyEvent::record( int /*dummy*/, void* obj,
                                  const std::string& key,
                                  const std::string& type,
                                  ::Int_t basketSize, ::Int_t splitLevel ) {
@@ -86,7 +86,7 @@ namespace xAOD {
                     TEvent::record( obj, type, key, basketSize, splitLevel,
                                     kFALSE, kFALSE, kFALSE ) );
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
 } // namespace xAOD
diff --git a/Control/xAODRootAccess/Root/TPyStore.cxx b/Control/xAODRootAccess/Root/TPyStore.cxx
index 82fc6f1c3aa13324f8f770fee8f4c64197eff221..84bf6d653d40defdd697ffdd372ffec347281a31 100644
--- a/Control/xAODRootAccess/Root/TPyStore.cxx
+++ b/Control/xAODRootAccess/Root/TPyStore.cxx
@@ -99,9 +99,9 @@ namespace xAOD {
    /// @param obj  Pointer to the object to be put into the store
    /// @param key  Key of the object in the store
    /// @param type The type name of the object we are inserting
-   /// @returns The usual xAOD::TReturnCode types
+   /// @returns The usual StatusCode types
    ///
-   TReturnCode TPyStore::record( void* obj, const std::string& key,
+   StatusCode TPyStore::record( void* obj, const std::string& key,
                                  const std::string& type ) {
 
       // Simply forward the call to the appropriate function from the base
@@ -110,7 +110,7 @@ namespace xAOD {
                     TStore::record( obj, key, type, kFALSE ) );
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This is just a convenience function, to make it easier to print the
diff --git a/Control/xAODRootAccess/Root/TReturnCode.cxx b/Control/xAODRootAccess/Root/TReturnCode.cxx
deleted file mode 100644
index baa84e2ad5d081e6b6c0aaca9f6cc6c43d8d2729..0000000000000000000000000000000000000000
--- a/Control/xAODRootAccess/Root/TReturnCode.cxx
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-// System include(s):
-#include <iostream>
-
-// ROOT include(s):
-#include <TError.h>
-
-// Local include(s):
-#include "xAODRootAccess/tools/TReturnCode.h"
-#include "xAODRootAccess/tools/Message.h"
-
-namespace {
-
-   /// Class used behind the scenes to keep track of the unchecked return codes
-   ///
-   /// One object of this type is created, just in case there are unchecked
-   /// return codes encountered during the job. This single object is finally
-   /// deleted at the end of the job, printing some complaints for the user.
-   ///
-   class TUncheckedCounter {
-
-   public:
-      /// Default constructor
-      TUncheckedCounter() :
-        m_uncheckedSuccess( 0 ),
-        m_uncheckedFailure( 0 ),
-        m_uncheckedRecoverable( 0 )
-     {}
-      /// Destructor
-      ~TUncheckedCounter() {
-         // If we need to destruct the object, then there must have been
-         // some unchecked return codes. Notice that we can't use the ROOT
-         // print functions here, as by the time this object gets deleted, the
-         // ROOT infrastructure may already be offline...
-         std::cerr << "Warning in <xAOD::TReturnCode>:" << std::endl;
-         std::cerr << "Warning in <xAOD::TReturnCode>: "
-                   << "Unchecked return codes encountered during the job"
-                   << std::endl;
-         if( m_uncheckedSuccess ) {
-            std::cerr << "Warning in <xAOD::TReturnCode>: "
-                      << "Number of unchecked successes: "
-                      << m_uncheckedSuccess << std::endl;
-         }
-         if( m_uncheckedFailure ) {
-            std::cerr << "Error in   <xAOD::TReturnCode>: "
-                      << "Number of unchecked failures: "
-                      << m_uncheckedFailure << std::endl;
-         }
-         if( m_uncheckedRecoverable ) {
-            std::cerr << "Warning in <xAOD::TReturnCode>: "
-                      << "Number of unchecked recoverables: "
-                      << m_uncheckedRecoverable << std::endl;
-         }
-         // Let him/her know how to look up the unchecked codes in the easiest
-         // way:
-         std::cerr << "Warning in <xAOD::TReturnCode>: "
-                   << "To fail on an unchecked code, call "
-                   << "xAOD::TReturnCode::enableFailure() at the job's start"
-                   << std::endl;
-         std::cerr << "Warning in <xAOD::TReturnCode>:" << std::endl;
-      }
-
-      /// Number of unchecked successful return codes
-      int m_uncheckedSuccess;
-      /// Number of unchecked failure return codes
-      int m_uncheckedFailure;
-      /// Number of unchecked recoverable return codes
-      int m_uncheckedRecoverable;
-   };
-
-} // private namespace
-
-namespace xAOD {
-
-   /// Application-wide setup of whether to fail on unchecked return codes.
-   ///
-   /// By default applications will not fail on an uncecked return code, they
-   /// will just keep track of how many return codes were left unchecked by
-   /// the user.
-   ///
-   static bool s_failure = false;
-
-   /// This constructor is called implicitly in 99% of all the use cases,
-   /// by the code just returning an enumeration value from a function.
-   /// Which gets converted into an xAOD::TReturnCode object automatically
-   /// by the compiler.
-   ///
-   /// @param code The return code of the function
-   ///
-   TReturnCode::TReturnCode( EReturnCode code )
-      : m_code( code ), m_checked( false ) {
-
-   }
-
-   /// The copy constructor makes sure that when we pass around
-   /// return codes by value, it would be enough to just check the
-   /// value of the last object in the chain. The objects that get
-   /// copied can get destructed without them complaining that they
-   /// were not checked.
-   ///
-   /// Even if the parent object was checked, the copied object will
-   /// need to be checked as well. This is how we make sure that an expression
-   /// like:
-   ///
-   /// <code>
-   ///    xAOD::TReturnCode rc = bla();<br/>
-   ///    if( rc.isFailure() ) {<br/>
-   ///       std::cout << "Error" << std::endl;<br/>
-   ///       return rc;<br/>
-   ///    }
-   /// </code>
-   ///
-   /// would work as expected.
-   ///
-   /// @param parent The parent object that needs to be copied
-   ///
-   TReturnCode::TReturnCode( const TReturnCode& parent )
-      : m_code( parent.m_code ), m_checked( false ) {
-
-      // The parent doesn't have to be checked anymore, whatever
-      // its status was:
-      parent.m_checked = true;
-   }
-
-   /// The destructor does the heavy lifting of the class. If the object
-   /// is still unchecked at the time that it's destructed, it will either
-   /// crash the application, or just register the missing check in the
-   /// global registry.
-   ///
-   TReturnCode::~TReturnCode() {
-
-      if( ! m_checked ) {
-         // If we are supposed to fail, let's fail right away:
-         if( s_failure ) {
-            ::Fatal( "xAOD::TReturnCode::~TReturnCode",
-                     XAOD_MESSAGE( "Unchecked return code encountered" ) );
-         }
-         // Global variable for keeping track of unchecked return codes.
-         // It gets deleted only at the end of the process.
-         static ::TUncheckedCounter s_counter;
-         if( m_code == kSuccess ) {
-            s_counter.m_uncheckedSuccess += 1;
-         } else if( m_code == kFailure ) {
-            s_counter.m_uncheckedFailure += 1;
-         } else if( m_code == kRecoverable ) {
-            s_counter.m_uncheckedRecoverable += 1;
-         } else {
-            ::Fatal( "xAOD::TReturnCode::~TReturnCode",
-                     XAOD_MESSAGE( "Unknown return code encountered" ) );
-         }
-      }
-   }
-
-   TReturnCode& TReturnCode::operator= ( const TReturnCode& rhs ) {
-
-      // Check if anything needs to be done:
-      if( this == &rhs ) return *this;
-
-      // Do the deed:
-      m_code = rhs.m_code;
-      m_checked = false;
-
-      // The copied object doesn't have to be checked anymore, whatever
-      // its status was:
-      rhs.m_checked = true;
-
-      // Return this object:
-      return *this;
-   }
-
-   TReturnCode::EReturnCode TReturnCode::code() const {
-
-      m_checked = true;
-      return m_code;
-   }
-
-   bool TReturnCode::isSuccess() const {
-
-      m_checked = true;
-      return ( m_code == kSuccess );
-   }
-
-   bool TReturnCode::isFailure() const {
-
-      m_checked = true;
-      return ( m_code == kFailure );
-   }
-
-   bool TReturnCode::isRecoverable() const {
-
-      m_checked = true;
-      return ( m_code == kRecoverable );
-   }
-
-   void TReturnCode::enableFailure() {
-
-      s_failure = true;
-      return;
-   }
-
-   void TReturnCode::disableFailure() {
-
-      s_failure = false;
-      return;
-   }
-
-} // namespace xAOD
diff --git a/Control/xAODRootAccess/Root/TSocket.cxx b/Control/xAODRootAccess/Root/TSocket.cxx
index 417968d94ad0f7d116434150e9ad45c2db3dcad4..f8ee9d08e0bcd1b6a0c1b44deaf36a03f8ec70cb 100644
--- a/Control/xAODRootAccess/Root/TSocket.cxx
+++ b/Control/xAODRootAccess/Root/TSocket.cxx
@@ -46,11 +46,11 @@ namespace xAOD {
    /// @param port The port number to connect to
    /// #returns The usual return codes...
    ///
-   TReturnCode TSocket::connect( const TInetAddress& address, int port ) {
+   StatusCode TSocket::connect( const TInetAddress& address, int port ) {
 
       // If the address is invalid, give up now:
       if( ! address.IsValid() ) {
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // If not, translate it to a network address:
@@ -68,7 +68,7 @@ namespace xAOD {
       // Create a socket:
       m_socket = ::socket( AF_INET, SOCK_STREAM, 0 );
       if( m_socket < 0 ) {
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Create the address that we want to connect to:
@@ -82,28 +82,28 @@ namespace xAOD {
       if( ::connect( m_socket, ( struct sockaddr* ) &server,
                      sizeof( server ) ) < 0 ) {
          m_socket = -1;
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
-   TReturnCode TSocket::close() {
+   StatusCode TSocket::close() {
 
       // Check if anything needs to be done:
       if( ! isConnected() ) {
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Close the socket:
       if( ::close( m_socket ) != 0 ) {
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Return gracefully:
       m_socket = -1;
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    bool TSocket::isConnected() const {
@@ -117,11 +117,11 @@ namespace xAOD {
    /// @param payload The HTML style payload to send to the server
    /// @returns The usual return codes...
    ///
-   TReturnCode TSocket::send( const TString& payload ) {
+   StatusCode TSocket::send( const TString& payload ) {
 
       // Check if we're connected:
       if( ! isConnected() ) {
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // The buffer we are sending from:
@@ -135,14 +135,14 @@ namespace xAOD {
       for( int i = 0; i < length; i += sent ) {
          sent = ::send( m_socket, buffer + i, length - i, 0 );
          if( sent < 0 ) {
-            return TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          } else if( sent == 0 ) {
             break;
          }
       }
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
    
 } // namespace xAOD
diff --git a/Control/xAODRootAccess/Root/TStore.cxx b/Control/xAODRootAccess/Root/TStore.cxx
index ca87dd71f953a679972a9a2889913f531e6ba82a..7f7f70abc275bc3558fa91c92b9b65e1f7daa7fc 100644
--- a/Control/xAODRootAccess/Root/TStore.cxx
+++ b/Control/xAODRootAccess/Root/TStore.cxx
@@ -41,7 +41,7 @@ namespace xAOD {
       return;
    }
 
-   TReturnCode TStore::remove( const std::string& key ) {
+   StatusCode TStore::remove( const std::string& key ) {
 
       // Look up this object:
       Objects_t::iterator itr = m_objects.find( key );
@@ -49,7 +49,7 @@ namespace xAOD {
          ::Warning( "xAOD::TStore::remove",
                     "Couldn't find object with key \"%s\"",
                     key.c_str() );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Delete the hoder object:
@@ -60,10 +60,10 @@ namespace xAOD {
       m_keys.erase( Utils::hash( key ) );
 
       // We were successful:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
-   TReturnCode TStore::remove( void* ptr ) {
+   StatusCode TStore::remove( void* ptr ) {
 
       // Look for this object:
       Objects_t::iterator itr = m_objects.begin();
@@ -79,14 +79,14 @@ namespace xAOD {
          delete itr->second;
          m_objects.erase( itr );
          m_keys.erase( Utils::hash( itr->first ) );
-         return TReturnCode::kSuccess;
+         return StatusCode::SUCCESS;
       }
 
       // We didn't find the object in the store:
       ::Warning( "xAOD::TStore::remove",
                  "Couldn't find object with pointer %p",
                  ptr );
-      return TReturnCode::kRecoverable;
+      return StatusCode::RECOVERABLE;
    }
 
    void TStore::clear() {
@@ -207,9 +207,9 @@ namespace xAOD {
    /// @param classname The type name of the object being recorded
    /// @param isOwner   If <code>kTRUE</code>, the store takes ownership of the
    ///                  object, otherwise it doesn't
-   /// @returns The usual xAOD::TReturnCode types
+   /// @returns The usual StatusCode types
    ///
-   TReturnCode TStore::record( void* obj, const std::string& key,
+   StatusCode TStore::record( void* obj, const std::string& key,
                                const std::string& classname,
                                ::Bool_t isOwner ) {
 
@@ -220,7 +220,7 @@ namespace xAOD {
       if( clItr != clMap.end() ) {
          // If the cached value doesn't work, then bail now:
          if( ( ! clItr->second ) || ( ! clItr->second->IsLoaded() ) ) {
-            return TReturnCode::kRecoverable;
+            return StatusCode::RECOVERABLE;
          }
          // Otherwise we're done:
          cl = clItr->second;
@@ -232,7 +232,7 @@ namespace xAOD {
          clMap[ classname ] = cl;
       }
       if( ( ! cl ) || ( ! cl->IsLoaded() ) ) {
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Make sure that the key is not yet taken:
@@ -240,16 +240,16 @@ namespace xAOD {
          ::Error( "xAOD::TStore::record",
                   XAOD_MESSAGE( "Trying to overwrite object with key \"%s\"" ),
                   key.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Register the new object:
       m_objects[ key ] = new THolder( obj, cl, isOwner );
       m_keys[ Utils::hash( key ) ] = key;
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
-   TReturnCode TStore::record( void* obj, const std::string& key,
+   StatusCode TStore::record( void* obj, const std::string& key,
                                const std::type_info& ti ) {
 
       // Make sure that the key is not yet taken:
@@ -257,16 +257,16 @@ namespace xAOD {
          ::Error( "xAOD::TStore::record",
                   XAOD_MESSAGE( "Trying to overwrite object with key \"%s\"" ),
                   key.c_str() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Register the new object:
       m_objects[ key ] = new THolder( obj, ti );
       m_keys[ Utils::hash( key ) ] = key;
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
-   TReturnCode TStore::record( THolder* hldr, const std::string& key ) {
+   StatusCode TStore::record( THolder* hldr, const std::string& key ) {
 
       // Make sure that the key is not yet taken:
       if( m_objects.find( key ) != m_objects.end() ) {
@@ -277,13 +277,13 @@ namespace xAOD {
          // of code readibility, but it results in fewer characters in the
          // template code...
          delete hldr;
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Register the new object:
       m_objects[ key ] = hldr;
       m_keys[ Utils::hash( key ) ] = key;
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This is a reasonably fast function. It checks whether an object with the
diff --git a/Control/xAODRootAccess/Root/TTreeMgr.cxx b/Control/xAODRootAccess/Root/TTreeMgr.cxx
index c0809062af501686c113e24e99be6229020cb1ec..90c9dadd432c5ebdd3da494996a64f0379416a5c 100644
--- a/Control/xAODRootAccess/Root/TTreeMgr.cxx
+++ b/Control/xAODRootAccess/Root/TTreeMgr.cxx
@@ -29,7 +29,7 @@ namespace xAOD {
 
    }
 
-   TReturnCode TTreeMgr::readFrom( ::TFile* file, ::Bool_t useTreeCache,
+   StatusCode TTreeMgr::readFrom( ::TFile* file, ::Bool_t useTreeCache,
                                    const char* treeName ) {
 
       // Delete the current transient tree(s):
@@ -44,17 +44,17 @@ namespace xAOD {
          ::Error( "xAOD::TTreeMgr::readFrom",
                   "Couldn't load the first event from file \"%s\"",
                   file->GetName() );
-         return TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Remember the event tree name:
       m_eventTreeName = treeName;
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
-   TReturnCode
+   StatusCode
    TTreeMgr::enableEventObj( const std::vector< std::string >& names ) {
 
       // If the event tree already exists, this call will have no effect:
@@ -62,17 +62,17 @@ namespace xAOD {
          ::Warning( "xAOD::TTreeMgr::enableEventObj",
                     "Event tree already created, can't filter its contents "
                     "anymore" );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Remember the selection:
       m_enableEventObj = names;
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
-   TReturnCode
+   StatusCode
    TTreeMgr::suppressEventObj( const std::vector< std::string >& names ) {
 
       // If the event tree already exists, this call will have no effect:
@@ -80,17 +80,17 @@ namespace xAOD {
          ::Warning( "xAOD::TTreeMgr::suppressEventObj",
                     "Event tree already created, can't filter its contents "
                     "anymore" );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Remember the selection:
       m_suppressEventObj = names;
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
-   TReturnCode
+   StatusCode
    TTreeMgr::enableMetaObj( const std::vector< std::string >& names ) {
 
       // If the metadata tree already exists, this call will have no effect:
@@ -98,17 +98,17 @@ namespace xAOD {
          ::Warning( "xAOD::TTreeMgr::enableMetaObj",
                     "Metadata tree already created, can't filter its contents "
                     "anymore" );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Remember the selection:
       m_enableMetaObj = names;
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
-   TReturnCode
+   StatusCode
    TTreeMgr::suppressMetaObj( const std::vector< std::string >& names ) {
 
       // If the metadata tree already exists, this call will have no effect:
@@ -116,14 +116,14 @@ namespace xAOD {
          ::Warning( "xAOD::TTreeMgr::suppressMetaObj",
                     "Metadata tree already created, can't filter its contents "
                     "anymore" );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // Remember the selection:
       m_suppressMetaObj = names;
 
       // Return gracefully:
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    ::TTree* TTreeMgr::eventTree() {
diff --git a/Control/xAODRootAccess/python/TPyEvent.py b/Control/xAODRootAccess/python/TPyEvent.py
index e1a4f0d63cc1eec26cc6148cae7ea5072907e6d2..1091db8fce285e2b99605052ba694920d0bac675 100644
--- a/Control/xAODRootAccess/python/TPyEvent.py
+++ b/Control/xAODRootAccess/python/TPyEvent.py
@@ -85,8 +85,8 @@ class TPyEvent( ROOT.xAOD.TPyEvent ):
     # @param key The key (branch name) for the object
     # @param basketSize The (optional) size of the basket for the output branch
     # @param splitLevel The (optional) split level for the output branch
-    # @returns <code>xAOD::TReturnCode::kSuccess</code> if all was successful,
-    #          or <code>xAOD::TReturnCode::kFailure</code> if not
+    # @returns <code>StatusCode::SUCCESS</code> if all was successful,
+    #          or <code>StatusCode::FAILURE</code> if not
     #
     def record( self, obj, key, basketSize = 32000, splitLevel = 0 ):
         # Determine the class name:
diff --git a/Control/xAODRootAccess/python/TPyStore.py b/Control/xAODRootAccess/python/TPyStore.py
index 46c6d7914934a9cef75226ee83aef9a96973fc76..f70e44427ccb7eee0aaf12e9dd236abefc0f8094 100644
--- a/Control/xAODRootAccess/python/TPyStore.py
+++ b/Control/xAODRootAccess/python/TPyStore.py
@@ -81,8 +81,8 @@ class TPyStore( ROOT.xAOD.TPyStore ):
     #
     # @param obj The object to be recorded into the output file
     # @param key The key (branch name) for the object
-    # @returns <code>xAOD::TReturnCode::kSuccess</code> if all was successful,
-    #          or <code>xAOD::TReturnCode::kFailure</code> if not
+    # @returns <code>StatusCode::SUCCESS</code> if all was successful,
+    #          or <code>StatusCode::FAILURE</code> if not
     #
     def record( self, obj, key ):
         # Determine the class name:
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_athenaMode_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_athenaMode_test.cxx
index 09d849af55dcac48fc2c4723fbdec15118783f0b..7e3ab148149e1859f81de228cd5f23bf15f2515b 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_athenaMode_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_athenaMode_test.cxx
@@ -22,7 +22,7 @@
 /// Helper macro
 #define RETURN_CHECK( CONTEXT, EXP )                                 \
    do {                                                              \
-      const xAOD::TReturnCode result = EXP;                          \
+      const StatusCode result = EXP;                          \
       if( ! result.isSuccess() ) {                                   \
          ::Error( CONTEXT, XAOD_MESSAGE( "Failed to execute: %s" ),  \
                   #EXP );                                            \
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_metadata_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_metadata_test.cxx
index ac0cba72b74d7dd12e517efc4fdbe61fc04ecbb7..4ddaaeecde2568a93b42afb45ff8220d92e3dec5 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_metadata_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_metadata_test.cxx
@@ -25,7 +25,7 @@
 /// Helper macro
 #define RETURN_CHECK( CONTEXT, EXP )                                 \
    do {                                                              \
-      const xAOD::TReturnCode result = EXP;                          \
+      const StatusCode result = EXP;                          \
       if( ! result.isSuccess() ) {                                   \
          ::Error( CONTEXT, XAOD_MESSAGE( "Failed to execute: %s" ),  \
                   #EXP );                                            \
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_proxydict_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_proxydict_test.cxx
index 2dcef4f2c2f78eecc7cc3a8e494a18f3107ee118..d4ef762974ab781fcf14da27aff25297a2f932ea 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_proxydict_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_proxydict_test.cxx
@@ -23,7 +23,7 @@
 /// Helper macro
 #define RETURN_CHECK( CONTEXT, EXP )                                 \
    do {                                                              \
-      const xAOD::TReturnCode result = EXP;                          \
+      const StatusCode result = EXP;                          \
       if( ! result.isSuccess() ) {                                   \
          ::Error( CONTEXT, XAOD_MESSAGE( "Failed to execute: %s" ),  \
                   #EXP );                                            \
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_remap_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_remap_test.cxx
index 23d2dac5c3d75ef1857e0884cd94194d28539fa4..dbaba2e2a53dcc3f9bfd459d788f738fb6afb52d 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_remap_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_remap_test.cxx
@@ -16,6 +16,8 @@
 // EDM include(s):
 #include "AthContainers/AuxVectorBase.h"
 
+#include "AsgMessaging/MessageCheck.h"
+
 // Local include(s):
 #include "xAODRootAccess/Init.h"
 #include "xAODRootAccess/TEvent.h"
@@ -23,19 +25,22 @@
 
 int main() {
 
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // The application's name:
    static const char* APP_NAME = "ut_xaodrootaccess_remap_test";
 
    // Initialise the environment:
-   RETURN_CHECK( APP_NAME, xAOD::Init( APP_NAME ) );
+   ANA_CHECK( xAOD::Init( APP_NAME ) );
 
    // Create the object(s) used for the testing:
    xAOD::TEvent event;
 
    // Declare some name remappings:
-   RETURN_CHECK( APP_NAME, event.addNameRemap( "Muons",
+   ANA_CHECK( event.addNameRemap( "Muons",
                                                "MyMuons" ) );
-   RETURN_CHECK( APP_NAME, event.addNameRemap( "Taus", "MyTaus" ) );
+   ANA_CHECK( event.addNameRemap( "Taus", "MyTaus" ) );
 
    // Print the definitions:
    event.printNameRemap();
@@ -47,7 +52,7 @@ int main() {
       ::Error( APP_NAME, XAOD_MESSAGE( "Couldn't open file %s" ), FNAME );
       return 1;
    }
-   RETURN_CHECK( APP_NAME, event.readFrom( ifile.get() ) );
+   ANA_CHECK( event.readFrom( ifile.get() ) );
 
    // Load the first event:
    if( event.getEntry( 0 ) < 0 ) {
@@ -58,8 +63,8 @@ int main() {
 
    // Retrieve a DataVector using an alias, and the actual name:
    const SG::AuxVectorBase* vec = 0;
-   RETURN_CHECK( APP_NAME, event.retrieve( vec, "Muons" ) );
-   RETURN_CHECK( APP_NAME, event.retrieve( vec, "MyMuons" ) );
+   ANA_CHECK( event.retrieve( vec, "Muons" ) );
+   ANA_CHECK( event.retrieve( vec, "MyMuons" ) );
 
    // Create a dummy, temporary file to test the object copying:
    TUUID uuid;
@@ -72,10 +77,10 @@ int main() {
                tempFName.Data() );
       return 1;
    }
-   RETURN_CHECK( APP_NAME, event.writeTo( ofile.get() ) );
+   ANA_CHECK( event.writeTo( ofile.get() ) );
 
    // Copy the electrons to the output:
-   RETURN_CHECK( APP_NAME, event.copy( "MyMuons" ) );
+   ANA_CHECK( event.copy( "MyMuons" ) );
 
    // Write the event:
    if( event.fill() < 0 ) {
@@ -85,7 +90,7 @@ int main() {
    }
 
    // Finish writing to the file:
-   RETURN_CHECK( APP_NAME, event.finishWritingTo( ofile.get() ) );
+   ANA_CHECK( event.finishWritingTo( ofile.get() ) );
 
    ::TTree* otree = dynamic_cast< ::TTree* >( ofile->Get( "CollectionTree" ) );
    if( ! otree ) {
@@ -96,7 +101,7 @@ int main() {
    otree->Print();
 
    // Now start reading from this temporary file to test its health:
-   RETURN_CHECK( APP_NAME, event.readFrom( ofile.get() ) );
+   ANA_CHECK( event.readFrom( ofile.get() ) );
 
    // Load the first, and only event:
    if( event.getEntry( 0 ) < 0 ) {
@@ -106,7 +111,7 @@ int main() {
    }
 
    // Retrieve a DataVector using the actual name this time:
-   RETURN_CHECK( APP_NAME, event.retrieve( vec, "MyMuons" ) );
+   ANA_CHECK( event.retrieve( vec, "MyMuons" ) );
 
    // And this should fail:
    if( event.retrieve( vec, "Muons" ).isSuccess() ) {
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_slimming_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_slimming_test.cxx
index 952163160f9349f138954f1d6a2f382d6bd9d2f1..25246388709f64a96ea57fc83229b7dfb40a0cf2 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_slimming_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_slimming_test.cxx
@@ -17,6 +17,7 @@
 #include "AthContainers/DataVector.h"
 
 // Local include(s):
+#include "AsgMessaging/MessageCheck.h"
 #include "xAODRootAccess/Init.h"
 #include "xAODRootAccess/TEvent.h"
 #include "xAODRootAccess/tools/ReturnCheck.h"
@@ -33,11 +34,14 @@
 
 int main() {
 
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // Get the name of the application:
    const char* APP_NAME = "ut_xaodrootaccess_slimming_test";
 
    // Initialise the environment:
-   RETURN_CHECK( APP_NAME, xAOD::Init( APP_NAME ) );
+   ANA_CHECK( xAOD::Init( APP_NAME ) );
 
    // Create the first tested object(s):
    xAOD::TEvent event1( xAOD::TEvent::kBranchAccess );
@@ -54,7 +58,7 @@ int main() {
                FNAME );
       return 1;
    }
-   RETURN_CHECK( APP_NAME, event1.readFrom( ifile.get() ) );
+   ANA_CHECK( event1.readFrom( ifile.get() ) );
 
    // Open a dummy output file, used in the slimming test:
    static const char* OFNAME = "dummy1.root";
@@ -64,7 +68,7 @@ int main() {
                OFNAME );
       return 1;
    }
-   RETURN_CHECK( APP_NAME, event1.writeTo( ofile1.get() ) );
+   ANA_CHECK( event1.writeTo( ofile1.get() ) );
 
    // Read in the first event:
    if( event1.getEntry( 0 ) < 0 ) {
@@ -74,8 +78,8 @@ int main() {
    }
 
    // Copy over the containers:
-   RETURN_CHECK( APP_NAME, event1.copy( "Electrons" ) );
-   RETURN_CHECK( APP_NAME, event1.copy( "Muons" ) );
+   ANA_CHECK( event1.copy( "Electrons" ) );
+   ANA_CHECK( event1.copy( "Muons" ) );
 
    // Write out this first event:
    if( event1.fill() <= 0 ) {
@@ -84,7 +88,7 @@ int main() {
    }
 
    // Close the output file:
-   RETURN_CHECK( APP_NAME, event1.finishWritingTo( ofile1.get() ) );
+   ANA_CHECK( event1.finishWritingTo( ofile1.get() ) );
    ofile1->Close();
 
    // Now check that it has exactly the branches that it should:
@@ -143,7 +147,7 @@ int main() {
               OFNAME );
       return 1;
    }
-   RETURN_CHECK( APP_NAME, event2.writeTo( ofile2.get() ) );
+   ANA_CHECK( event2.writeTo( ofile2.get() ) );
 
    // Create a generic container in the output. Notice that we only record the
    // auxiliary store, and not the DV. That's mainly because we don't have a
@@ -172,7 +176,7 @@ int main() {
    SIMPLE_ASSERT( el->auxdataConst< unsigned char >( "dummy2" ) == 6 );
 
    // Close the output file:
-   RETURN_CHECK( APP_NAME, event2.finishWritingTo( ofile2.get() ) );
+   ANA_CHECK( event2.finishWritingTo( ofile2.get() ) );
    ofile2->Close();
 
    // Check the contents of the produced file:
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_stats_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_stats_test.cxx
index 8b2bd29e758459daf4b97bde0901c14dffc022ab..f6fa6e61a79f682a852481400f0d96e6610b515d 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_stats_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_stats_test.cxx
@@ -18,6 +18,8 @@
 #include "xAODCore/tools/ReadStats.h"
 #include "xAODCore/tools/IOStats.h"
 
+#include "AsgMessaging/MessageCheck.h"
+
 // Local include(s):
 #include "xAODRootAccess/Init.h"
 #include "xAODRootAccess/TEvent.h"
@@ -25,11 +27,14 @@
 
 int main() {
 
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // Get the name of the application:
    const char* APP_NAME = "ut_xaodrootaccess_stats_test";
 
    // Initialise the environment:
-   RETURN_CHECK( APP_NAME, xAOD::Init( APP_NAME ) );
+   ANA_CHECK( xAOD::Init( APP_NAME ) );
 
    // Create the tested object(s):
    xAOD::TEvent event( xAOD::TEvent::kClassAccess );
@@ -41,7 +46,7 @@ int main() {
       ::Error( APP_NAME, "File %s couldn't be opened...", FNAME );
       return 1;
    }
-   RETURN_CHECK( APP_NAME, event.readFrom( ifile.get() ) );
+   ANA_CHECK( event.readFrom( ifile.get() ) );
 
    // Get the auxiliary ID of the "pt" variable:
    const SG::auxid_t auxidPt =
@@ -67,23 +72,23 @@ int main() {
       // Retrieve some interface containers, to trigger the setup of the
       // auxiliary containers:
       const SG::AuxVectorBase* vb = 0;
-      RETURN_CHECK( APP_NAME, event.retrieve( vb, "ElectronCollection" ) );
-      RETURN_CHECK( APP_NAME, event.retrieve( vb, "Muons" ) );
+      ANA_CHECK( event.retrieve( vb, "Electrons" ) );
+      ANA_CHECK( event.retrieve( vb, "Muons" ) );
 
       // Load some containers from it and access their "pt" property:
       const xAOD::AuxContainerBase* dummy = 0;
-      RETURN_CHECK( APP_NAME, event.retrieve( dummy,
-                                              "ElectronCollectionAux." ) );
-      if( strcmp( dummy->name(), "ElectronCollectionAux." ) ) {
+      ANA_CHECK( event.retrieve( dummy,
+                                              "ElectronsAux." ) );
+      if( strcmp( dummy->name(), "ElectronsAux." ) ) {
          ::Error( APP_NAME,
-                  "The name of ElectronCollectionAux. was not set correctly" );
+                  "The name of ElectronsAux. was not set correctly" );
          return 1;
       }
       dummy->getData( auxidPt );
-      RETURN_CHECK( APP_NAME, event.retrieve( dummy, "MuonsAux." ) );
+      ANA_CHECK( event.retrieve( dummy, "MuonsAux." ) );
       if( strcmp( dummy->name(), "MuonsAux." ) ) {
          ::Error( APP_NAME,
-                  "The name of ElectronCollectionAux. was not set correctly" );
+                  "The name of ElectronsAux. was not set correctly" );
          return 1;
       }
       dummy->getData( auxidPt );
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tauxstore_insertmove_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_tauxstore_insertmove_test.cxx
index 4f2f2683acb41f25a84c8bdd78a5d8e114e20004..c07853bc0949185daf85cf7d82b4b0721a7a0877 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tauxstore_insertmove_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tauxstore_insertmove_test.cxx
@@ -46,7 +46,7 @@ struct MoveTest
 bool wasMoved (const MoveTest& x) { return x.m_v.empty(); }
 
 
-int test1()
+StatusCode test1()
 {
   std::cout << "test1\n";
 
@@ -157,12 +157,12 @@ int test1()
     assert (wasMoved (m1_2[i]));
   }
 
-  return 0;
+  return StatusCode::SUCCESS;
 }
 
 
 int main()
 {
-  test1();
+  test1().ignore();
   return 0;
 }
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tauxstore_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_tauxstore_test.cxx
index 412ab0fe1b665692a715cb2528bfbcb16af71e5b..fcb1afa9762e32d2feca908b347c81cb2372221e 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tauxstore_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tauxstore_test.cxx
@@ -12,6 +12,8 @@
 #include "AthContainers/AuxTypeRegistry.h"
 #include "AthContainers/exceptions.h"
 
+#include "AsgMessaging/MessageCheck.h"
+
 // Local include(s):
 #include "xAODRootAccess/Init.h"
 #include "xAODRootAccess/TAuxStore.h"
@@ -30,11 +32,14 @@
 
 int main() {
 
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // The name of the application:
    const char* APP_NAME = "ut_xaodrootaccess_tauxstore_test";
 
    // Initialise the environment:
-   RETURN_CHECK( APP_NAME, xAOD::Init( APP_NAME ) );
+   ANA_CHECK( xAOD::Init( APP_NAME ) );
 
    // Reference to the auxiliary type registry:
    SG::AuxTypeRegistry& reg = SG::AuxTypeRegistry::instance();
@@ -67,7 +72,7 @@ int main() {
    store.lock();
 
    // Connect it to this transient input tree:
-   RETURN_CHECK( APP_NAME, store.readFrom( itree.get() ) );
+   ANA_CHECK( store.readFrom( itree.get() ) );
 
    // Check that it found the two variables that it needed to:
    ::Info( APP_NAME, "Auxiliary variables found on the input:" );
@@ -124,7 +129,7 @@ int main() {
    otree->SetDirectory( 0 );
 
    // Connect the store object to the tree:
-   RETURN_CHECK( APP_NAME, store.writeTo( otree.get() ) );
+   ANA_CHECK( store.writeTo( otree.get() ) );
 
    // Create the decoration again:
    SIMPLE_ASSERT( store.getDecoration( decId, 5, 5 ) != 0 );
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tchain_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_tchain_test.cxx
index e223d3e7c027f969e3022adff5fb65b35892d363..6ef7144626a15aac65f61f4a6d1d8275491fa765 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tchain_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tchain_test.cxx
@@ -10,6 +10,8 @@
 #include "AthContainers/AuxVectorBase.h"
 #include "xAODCore/AuxContainerBase.h"
 
+#include "AsgMessaging/MessageCheck.h"
+
 // Local include(s):
 #include "xAODRootAccess/Init.h"
 #include "xAODRootAccess/TEvent.h"
@@ -36,15 +38,18 @@ public:
 }; // class ClassB
 
 /// Helper function, "processing" a TChain
-xAOD::TReturnCode process( xAOD::TEvent& event, xAOD::TStore& store );
+StatusCode process( xAOD::TEvent& event, xAOD::TStore& store );
 
 int main() {
 
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // Get the name of the application:
    const char* APP_NAME = "ut_xaodrootaccess_tchain_test";
 
    // Initialise the environment:
-   RETURN_CHECK( APP_NAME, xAOD::Init( APP_NAME ) );
+   ANA_CHECK( xAOD::Init( APP_NAME ) );
 
    // Create the tested object(s):
    xAOD::TEvent event( xAOD::TEvent::kClassAccess );
@@ -66,11 +71,11 @@ int main() {
    chain1.Add( FNAME2.c_str() );
 
    // Connect the TEvent object to it:
-   RETURN_CHECK( APP_NAME, event.readFrom( &chain1 ) );
+   ANA_CHECK( event.readFrom( &chain1 ) );
 
    // Run the processing:
    ::Info( APP_NAME, "Processing mc14_8TeV chain..." );
-   RETURN_CHECK( APP_NAME, process( event, store ) );
+   ANA_CHECK( process( event, store ) );
 
    // Set up a TChain with some mc14_8TeV input files:
    ::TChain chain2( "CollectionTree" );
@@ -86,17 +91,17 @@ int main() {
    chain2.Add( FNAME4.c_str() );
 
    // Connect the TEvent object to it:
-   RETURN_CHECK( APP_NAME, event.readFrom( &chain2 ) );
+   ANA_CHECK( event.readFrom( &chain2 ) );
 
    // Run the processing:
    ::Info( APP_NAME, "Processing mc14_13TeV chain..." );
-   RETURN_CHECK( APP_NAME, process( event, store ) );
+   ANA_CHECK( process( event, store ) );
 
    // Return gracefully:
    return 0;
 }
 
-xAOD::TReturnCode process( xAOD::TEvent& event, xAOD::TStore& store ) {
+StatusCode process( xAOD::TEvent& event, xAOD::TStore& store ) {
 
    // Loop over all events:
    const ::Long64_t entries = event.getEntries();
@@ -109,7 +114,7 @@ xAOD::TReturnCode process( xAOD::TEvent& event, xAOD::TStore& store ) {
       if( event.getEntry( entry ) < 0 ) {
          ::Error( "process", "Couldn't load entry %i",
                   static_cast< int >( entry ) );
-         return xAOD::TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
       if( ! ( entry % 100 ) ) {
          ::Info( "process", "Processed %i / %i events",
@@ -139,5 +144,5 @@ xAOD::TReturnCode process( xAOD::TEvent& event, xAOD::TStore& store ) {
    }
 
    // Return gracefully:
-   return xAOD::TReturnCode::kSuccess;
+   return StatusCode::SUCCESS;
 }
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_copy_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_copy_test.cxx
index ee5569624eb9ecb0999f7d45cdfbdae7d8c9acac..176b00d2264aad33110541804e79f81adcda6375 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_copy_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_copy_test.cxx
@@ -19,7 +19,7 @@
 /// Helper macro
 #define CHECK( CONTEXT, EXP )                                        \
    do {                                                              \
-      const xAOD::TReturnCode result = EXP;                          \
+      const StatusCode result = EXP;                          \
       if( ! result.isSuccess() ) {                                   \
          ::Error( CONTEXT, XAOD_MESSAGE( "Failed to execute: %s" ),  \
                   #EXP );                                            \
@@ -28,7 +28,7 @@
    } while( false )
 
 /// Function testing the copying of a few objects
-xAOD::TReturnCode copyObjects( xAOD::TEvent::EAuxMode mode );
+StatusCode copyObjects( xAOD::TEvent::EAuxMode mode );
 
 int main() {
 
@@ -47,7 +47,7 @@ int main() {
    return 0;
 }
 
-xAOD::TReturnCode copyObjects( xAOD::TEvent::EAuxMode mode ) {
+StatusCode copyObjects( xAOD::TEvent::EAuxMode mode ) {
 
    // Construct a "mode name" for the printed messages:
    TString modeName;
@@ -75,7 +75,7 @@ xAOD::TReturnCode copyObjects( xAOD::TEvent::EAuxMode mode ) {
    if( ! ifile ) {
       Error( "copyObjects", XAOD_MESSAGE( "Couldn't open input file: %s" ),
              gSystem->Getenv( "ASG_TEST_FILE_DATA" ) );
-      return xAOD::TReturnCode::kFailure;
+      return StatusCode::FAILURE;
    }
    RETURN_CHECK( "copyObjects", event.readFrom( ifile.get() ) );
    Info( "copyObjects", "Opened input file %s in mode %s",
@@ -86,7 +86,7 @@ xAOD::TReturnCode copyObjects( xAOD::TEvent::EAuxMode mode ) {
                                                 "RECREATE" ) );
    if( ! ofile.get() ) {
       Error( "copyObjects", XAOD_MESSAGE( "Couldn't open the output file" ) );
-      return xAOD::TReturnCode::kFailure;
+      return StatusCode::FAILURE;
    }
    RETURN_CHECK( "copyObjects", event.writeTo( ofile.get() ) );
    Info( "copyObjects", "Opened the output file" );
@@ -100,7 +100,7 @@ xAOD::TReturnCode copyObjects( xAOD::TEvent::EAuxMode mode ) {
          Error( "copyObjects",
                 XAOD_MESSAGE( "Couldn't load entry %i from the input file" ),
                 static_cast< int >( entry ) );
-         return xAOD::TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
 
       // Copy a standalone object:
@@ -112,7 +112,7 @@ xAOD::TReturnCode copyObjects( xAOD::TEvent::EAuxMode mode ) {
       if( event.fill() <= 0 ) {
          Error( "copyObjects", XAOD_MESSAGE( "Failed to write event %i" ),
                 static_cast< int >( entry ) );
-         return xAOD::TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
    }
 
@@ -121,5 +121,5 @@ xAOD::TReturnCode copyObjects( xAOD::TEvent::EAuxMode mode ) {
          static_cast< int >( entries ), modeName.Data() );
 
    // Return gracefully:
-   return xAOD::TReturnCode::kSuccess;
+   return StatusCode::SUCCESS;
 }
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_test.cxx
index d5f2d7cd688e65f35a13368fd5a51bc1d6afe9bb..420fa5745046991f8214695494bb8041898c5037 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_test.cxx
@@ -31,7 +31,7 @@
 /// Helper macro
 #define RETURN_CHECK( CONTEXT, EXP )                                 \
    do {                                                              \
-      const xAOD::TReturnCode result = EXP;                          \
+      const StatusCode result = EXP;                          \
       if( ! result.isSuccess() ) {                                   \
          ::Error( CONTEXT, XAOD_MESSAGE( "Failed to execute: %s" ),  \
                   #EXP );                                            \
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tfilemerger_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_tfilemerger_test.cxx
index 73a10e01fd18a083c32af4113fc8f0a8bbd15ca7..5e00d1c5dc1cde62eb5860a858c4bbc0c042a6c0 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tfilemerger_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tfilemerger_test.cxx
@@ -31,7 +31,7 @@
 /// Helper macro
 #define R_CHECK( CONTEXT, EXP )                                 \
    do {                                                              \
-      const xAOD::TReturnCode result = EXP;                          \
+      const StatusCode result = EXP;                          \
       if( ! result.isSuccess() ) {                                   \
          ::Error( CONTEXT, XAOD_MESSAGE( "Failed to execute: %s" ),  \
                   #EXP );                                            \
@@ -40,10 +40,10 @@
    } while( false )
 
 /// Function checking the payload of the merged file
-xAOD::TReturnCode checkMergedFile( const std::string& fileName,
+StatusCode checkMergedFile( const std::string& fileName,
                                    xAOD::TFileMerger::EMergeMode mode );
 /// Function checking just one auxiliary branch in the merged file
-xAOD::TReturnCode checkMergedBranch( ::TTree& tree, const std::string& name );
+StatusCode checkMergedBranch( ::TTree& tree, const std::string& name );
 
 int main() {
 
@@ -221,9 +221,9 @@ int main() {
 ///
 /// @param fileName The merged file's name to test
 /// @param mode The mode with which the file was merged
-/// @returns The usual <code>xAOD::TReturnCode</code> types
+/// @returns The usual <code>StatusCode</code> types
 ///
-xAOD::TReturnCode checkMergedFile( const std::string& fileName,
+StatusCode checkMergedFile( const std::string& fileName,
                                    xAOD::TFileMerger::EMergeMode mode ) {
 
    // Open the file:
@@ -232,7 +232,7 @@ xAOD::TReturnCode checkMergedFile( const std::string& fileName,
    if( ! merged.get() ) {
       ::Error( "checkMergedFile", XAOD_MESSAGE( "Couldn't open %s" ),
                fileName.c_str() );
-      return xAOD::TReturnCode::kFailure;
+      return StatusCode::FAILURE;
    }
 
    // Access the TTree in it:
@@ -241,7 +241,7 @@ xAOD::TReturnCode checkMergedFile( const std::string& fileName,
       ::Error( "checkMergedFile",
                XAOD_MESSAGE( "Couldn't file \"CollectionTree\" in merged "
                              "file" ) );
-      return xAOD::TReturnCode::kFailure;
+      return StatusCode::FAILURE;
    }
 
    // Check the "InfoAux." branches:
@@ -258,7 +258,7 @@ xAOD::TReturnCode checkMergedFile( const std::string& fileName,
 
    // In slow merging mode those are the only ones to check...
    if( mode == xAOD::TFileMerger::kSlowMerge ) {
-      return xAOD::TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    // Check the "ContainerAux." branches:
@@ -272,10 +272,10 @@ xAOD::TReturnCode checkMergedFile( const std::string& fileName,
                  checkMergedBranch( *tree, "ContainerAuxDyn.FloatVar" ) );
 
    // Return gracefully:
-   return xAOD::TReturnCode::kSuccess;
+   return StatusCode::SUCCESS;
 }
 
-xAOD::TReturnCode checkMergedBranch( ::TTree& tree, const std::string& name ) {
+StatusCode checkMergedBranch( ::TTree& tree, const std::string& name ) {
 
    // Try to access the branch:
    ::TBranch* br = tree.GetBranch( name.c_str() );
@@ -283,7 +283,7 @@ xAOD::TReturnCode checkMergedBranch( ::TTree& tree, const std::string& name ) {
       ::Error( "checkedMergedBranch",
                XAOD_MESSAGE( "Couldn't find branch \"%s\" in output file" ),
                name.c_str() );
-      return xAOD::TReturnCode::kFailure;
+      return StatusCode::FAILURE;
    }
 
    // Make sure that it has the right number of entries:
@@ -292,9 +292,9 @@ xAOD::TReturnCode checkMergedBranch( ::TTree& tree, const std::string& name ) {
                XAOD_MESSAGE( "Number of entries in branch \"%s\" is: %i "
                              "(!=20)" ),
                name.c_str(), static_cast< int >( br->GetEntries() ) );
-      return xAOD::TReturnCode::kFailure;
+      return StatusCode::FAILURE;
    }
 
    // Return gracefully:
-   return xAOD::TReturnCode::kSuccess;
+   return StatusCode::SUCCESS;
 }
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tstore_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_tstore_test.cxx
index cb7f6f215cd76359b8adb9208a61d90e5756f5f9..946393a106158a2a2a5839d1b820ffb2ea981ff9 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tstore_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tstore_test.cxx
@@ -26,7 +26,7 @@
 /// Helper macro
 #define RETURN_CHECK( CONTEXT, EXP )                                 \
    do {                                                              \
-      const xAOD::TReturnCode result = EXP;                          \
+      const StatusCode result = EXP;                          \
       if( ! result.isSuccess() ) {                                   \
          ::Error( CONTEXT, XAOD_MESSAGE( "Failed to execute: %s" ),  \
                   #EXP );                                            \
diff --git a/Control/xAODRootAccess/util/xAODChecker.cxx b/Control/xAODRootAccess/util/xAODChecker.cxx
index 436382d1c66fc97efb5c785d5cfa8cbc2eab8485..29b645cac42f86e3f30d5dedc88a7d186e34bdf6 100644
--- a/Control/xAODRootAccess/util/xAODChecker.cxx
+++ b/Control/xAODRootAccess/util/xAODChecker.cxx
@@ -12,6 +12,8 @@
 #include <TFile.h>
 #include <TError.h>
 
+#include "AsgMessaging/MessageCheck.h"
+
 // Local include(s):
 #include "xAODRootAccess/Init.h"
 #include "xAODRootAccess/TEvent.h"
@@ -20,6 +22,9 @@
 
 int main( int argc, char* argv[] ) {
 
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
    // The application's name:
    const char* APP_NAME = argv[ 0 ];
 
@@ -31,7 +36,7 @@ int main( int argc, char* argv[] ) {
    }
 
    // Initialise the application's environment:
-   RETURN_CHECK( APP_NAME, xAOD::Init() );
+   ANA_CHECK( xAOD::Init() );
 
    // The object used in the checks:
    xAOD::TFileChecker checker;
@@ -59,10 +64,10 @@ int main( int argc, char* argv[] ) {
 
       // Set up reading from the file:
       xAOD::TEvent event;
-      RETURN_CHECK( APP_NAME, event.readFrom( ifile.get() ) );
+      ANA_CHECK( event.readFrom( ifile.get() ) );
 
       // Run the sanity checks:
-      RETURN_CHECK( APP_NAME, checker.check( event ) );
+      ANA_CHECK( checker.check( event ) );
    }
 
    // Return gracefully:
diff --git a/Control/xAODRootAccess/util/xAODFileReadTest.cxx b/Control/xAODRootAccess/util/xAODFileReadTest.cxx
index 81394044739418cb6997ff2f5a3d77ed76127741..6f0ea60f2c3b453d9c9d6582173ae0fdd12f4506 100644
--- a/Control/xAODRootAccess/util/xAODFileReadTest.cxx
+++ b/Control/xAODRootAccess/util/xAODFileReadTest.cxx
@@ -40,11 +40,11 @@ public:
    TEventClass( xAOD::TEvent::EAuxMode mode ) : xAOD::TEvent( mode ) {}
 
    /// Function loading all interface objects of the event
-   xAOD::TReturnCode loadInputObjects() {
+   StatusCode loadInputObjects() {
       // Get the event format object:
       const xAOD::EventFormat* ef = this->inputEventFormat();
       if( ! ef ) {
-         return xAOD::TReturnCode::kFailure;
+         return StatusCode::FAILURE;
       }
       // Loop over the objects of the file:
       for( auto ef_itr : *ef ) {
@@ -83,11 +83,11 @@ public:
             Error( "TEventClass::loadInputObjects",
                    XAOD_MESSAGE( "Couldnt load object: %s" ),
                    efe.branchName().c_str() );
-            return xAOD::TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
       }
       // Return gracefully:
-      return xAOD::TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 }; // class TEventClass
 
diff --git a/Control/xAODRootAccess/xAODRootAccess/Init.h b/Control/xAODRootAccess/xAODRootAccess/Init.h
index 9f07d138351f61797d0c9503c633a8e86c0360f8..0f0e6ab98f0bd4557af9598c9b77b7324db973a9 100644
--- a/Control/xAODRootAccess/xAODRootAccess/Init.h
+++ b/Control/xAODRootAccess/xAODRootAccess/Init.h
@@ -9,7 +9,7 @@
 #include <cstddef>
 
 // Local include(s):
-#include "xAODRootAccess/tools/TReturnCode.h"
+#include "AsgMessaging/StatusCode.h"
 
 /// Namespace holding all the xAOD EDM/tool classes
 namespace xAOD {
@@ -24,10 +24,10 @@ namespace xAOD {
    /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
    ///
    /// @param appname Name of the application/script [optional]
-   /// @returns <code>TReturnCode::kSuccess</code> if successful,
-   ///          <code>TReturnCode::kFailure</code> if not
+   /// @returns <code>StatusCode::SUCCESS</code> if successful,
+   ///          <code>StatusCode::FAILURE</code> if not
    ///
-   TReturnCode Init( const char* appname = "xAOD::Init" );
+   StatusCode Init( const char* appname = "xAOD::Init" );
 
    /// Function initialising an application for using the ATLAS EDM
    ///
@@ -43,10 +43,10 @@ namespace xAOD {
    /// @param appname Name of the application
    /// @param argc The argc argument from main(...)
    /// @param argv The argv argument from main(...)
-   /// @returns <code>TReturnCode::kSuccess</code> if successful,
-   ///          <code>TReturnCode::kFailure</code> if not
+   /// @returns <code>StatusCode::SUCCESS</code> if successful,
+   ///          <code>StatusCode::FAILURE</code> if not
    ///
-   TReturnCode Init( const char* appname, int* argc, char** argv );
+   StatusCode Init( const char* appname, int* argc, char** argv );
 
    /// Set the width of the source strings for the printed messages
    ///
diff --git a/Control/xAODRootAccess/xAODRootAccess/TAuxStore.h b/Control/xAODRootAccess/xAODRootAccess/TAuxStore.h
index 21f42479ddb5211c8cd661ac98f0cb146d0ace6e..54fa939120886a2ecd2e824e1c8f0cde3481b103 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TAuxStore.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TAuxStore.h
@@ -16,7 +16,7 @@
 #include "xAODCore/AuxSelection.h"
 
 // Local include(s):
-#include "xAODRootAccess/tools/TReturnCode.h"
+#include "AsgMessaging/StatusCode.h"
 
 #include "Rtypes.h"
 
@@ -70,7 +70,7 @@ namespace xAOD {
       /// Get what structure mode the object was constructed with
       EStructMode structMode() const;
       /// Set the structure mode of the object to a new value
-      TReturnCode setStructMode( EStructMode mode );
+      StatusCode setStructMode( EStructMode mode );
 
       /// Get the currently configured branch name prefix
       const char* prefix() const;
@@ -93,9 +93,9 @@ namespace xAOD {
       void setSplitLevel( Int_t value );
 
       /// Connect the object to an input TTree
-      TReturnCode readFrom( ::TTree* tree, ::Bool_t printWarnings = kTRUE );
+      StatusCode readFrom( ::TTree* tree, ::Bool_t printWarnings = kTRUE );
       /// Connect the object to an output TTree
-      TReturnCode writeTo( ::TTree* tree );
+      StatusCode writeTo( ::TTree* tree );
 
       /// Read the values from the specified TTree entry
       Int_t getEntry( Long64_t entry, Int_t getall = 0 );
@@ -180,15 +180,15 @@ namespace xAOD {
    private:
       /// Function used for setting up the statistics info about the managed
       /// branches
-      TReturnCode initStats( ::TTree* tree );
+      StatusCode initStats( ::TTree* tree );
       /// Connect a variable to the input tree
-      TReturnCode setupInputData( auxid_t auxid ) const;
+      StatusCode setupInputData( auxid_t auxid ) const;
       /// Connect a variable to the output tree
-      TReturnCode setupOutputData( auxid_t auxid ) const;
+      StatusCode setupOutputData( auxid_t auxid ) const;
       /// Scan the input TTree for auxiliary branches
-      TReturnCode scanInputTree();
+      StatusCode scanInputTree();
       /// Register one input branch as an available auxiliary variable
-      TReturnCode setupAuxBranch( ::TBranch* br, const char* auxName,
+      StatusCode setupAuxBranch( ::TBranch* br, const char* auxName,
                                   ::Bool_t staticBranch );
       /// Check if this auxiliary variable needs to go to the output
       ::Bool_t isAuxIDSelected( auxid_t auxid ) const;
diff --git a/Control/xAODRootAccess/xAODRootAccess/TEvent.h b/Control/xAODRootAccess/xAODRootAccess/TEvent.h
index 763a44d58725abe898c1f6ba5b8c48d8e2c3693d..0a7ff0c7c637592b735ae0173e12000cba757dff 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TEvent.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TEvent.h
@@ -24,7 +24,7 @@
 #include "xAODRootAccessInterfaces/TVirtualEvent.h"
 
 // Local include(s):
-#include "xAODRootAccess/tools/TReturnCode.h"
+#include "AsgMessaging/StatusCode.h"
 #include "xAODRootAccess/tools/IProxyDict.h"
 
 // Forward declaration(s):
@@ -122,15 +122,15 @@ namespace xAOD {
       /// @{
 
       /// Connect the object to a new input file
-      TReturnCode readFrom( ::TFile* file, Bool_t useTreeCache = kTRUE,
+      StatusCode readFrom( ::TFile* file, Bool_t useTreeCache = kTRUE,
                             const char* treeName = EVENT_TREE_NAME );
       /// Connect the object to a new input tree/chain
-      TReturnCode readFrom( ::TTree* tree, Bool_t useTreeCache = kTRUE );
+      StatusCode readFrom( ::TTree* tree, Bool_t useTreeCache = kTRUE );
       /// Connect the object to an output file
-      TReturnCode writeTo( ::TFile* file, Int_t autoFlush = 200,
+      StatusCode writeTo( ::TFile* file, Int_t autoFlush = 200,
                            const char* treeName = EVENT_TREE_NAME );
       /// Finish writing to an output file
-      TReturnCode finishWritingTo( ::TFile* file );
+      StatusCode finishWritingTo( ::TFile* file );
 
       /// Set this event object as the currently active one
       void setActive() const;
@@ -140,14 +140,14 @@ namespace xAOD {
                            const std::string& itemList );
 
       /// Register an incident listener object
-      TReturnCode addListener( TVirtualIncidentListener* listener );
+      StatusCode addListener( TVirtualIncidentListener* listener );
       /// Remove an incident listener object
-      TReturnCode removeListener( TVirtualIncidentListener* listener );
+      StatusCode removeListener( TVirtualIncidentListener* listener );
       /// Remove all listeners from the object
       void clearListeners();
 
       /// Add a name re-mapping rule
-      TReturnCode addNameRemap( const std::string& onfile,
+      StatusCode addNameRemap( const std::string& onfile,
                                 const std::string& newName );
       /// Clear the current name re-mapping
       void clearNameRemap();
@@ -168,18 +168,18 @@ namespace xAOD {
 
       /// Retrieve either an input or an output object from the event
       template< typename T >
-      TReturnCode retrieve( const T*& obj, const std::string& key );
+      StatusCode retrieve( const T*& obj, const std::string& key );
       /// Retrieve an output object from the event
       template< typename T >
-      TReturnCode retrieve( T*& obj, const std::string& key );
+      StatusCode retrieve( T*& obj, const std::string& key );
 
       /// Add an output object to the event
       template< typename T >
-      TReturnCode record( T* obj, const std::string& key,
+      StatusCode record( T* obj, const std::string& key,
                           ::Int_t basketSize = 32000, ::Int_t splitLevel = 0 );
       /// Add an output object to the event, explicitly taking ownership of it
       template< typename T >
-      TReturnCode record( std::unique_ptr< T > obj, const std::string& key,
+      StatusCode record( std::unique_ptr< T > obj, const std::string& key,
                           ::Int_t basketSize = 32000, ::Int_t splitLevel = 0 );
 
       /// Add an auxiliary store object to the output
@@ -190,10 +190,10 @@ namespace xAOD {
                                 Int_t splitLevel = 0 );
 
       /// Copy an object directly from the input to the output
-      TReturnCode copy( const std::string& key,
+      StatusCode copy( const std::string& key,
                         ::Int_t basketSize = 32000, ::Int_t splitLevel = 0 );
       /// Copy all (ROOT readable) objects directly from the input to the output
-      TReturnCode copy( ::Int_t basketSize = 32000, ::Int_t splitLevel = 0 );
+      StatusCode copy( ::Int_t basketSize = 32000, ::Int_t splitLevel = 0 );
 
       /// @}
 
@@ -209,24 +209,24 @@ namespace xAOD {
 
       /// Retrieve an input metadata object
       template< typename T >
-      TReturnCode retrieveMetaInput( const T*& obj, const std::string& key );
+      StatusCode retrieveMetaInput( const T*& obj, const std::string& key );
 
       /// Retrieve an output metadata object
       template< typename T >
-      TReturnCode retrieveMetaOutput( const T*& obj, const std::string& key );
+      StatusCode retrieveMetaOutput( const T*& obj, const std::string& key );
       /// Retrieve an output metadata object
       template< typename T >
-      TReturnCode retrieveMetaOutput( T*& obj, const std::string& key );
+      StatusCode retrieveMetaOutput( T*& obj, const std::string& key );
 
       /// Add an object to the output file's metadata
       template< typename T >
-      TReturnCode recordMeta( T* obj, const std::string& key,
+      StatusCode recordMeta( T* obj, const std::string& key,
                               ::Int_t basketSize = 32000,
                               ::Int_t splitLevel = 1 );
       /// Add an object to the output file's metadata, explicitly taking
       /// ownership of it
       template< typename T >
-      TReturnCode recordMeta( std::unique_ptr< T > obj, const std::string& key,
+      StatusCode recordMeta( std::unique_ptr< T > obj, const std::string& key,
                               ::Int_t basketSize = 32000,
                               ::Int_t splitLevel = 1 );
 
@@ -269,7 +269,7 @@ namespace xAOD {
 
       /// Internal function for recording an object into the output
       // Declared public so we can call it from python.
-      TReturnCode record( void* obj, const std::string& typeName,
+      StatusCode record( void* obj, const std::string& typeName,
                           const std::string& key,
                           ::Int_t basketSize, ::Int_t splitLevel,
                           ::Bool_t overwrite = kFALSE,
@@ -342,7 +342,7 @@ namespace xAOD {
       /// @}
 
       /// Function to initialise the statistics for all Tree content
-      TReturnCode initStats();
+      StatusCode initStats();
       /// Function for retrieving an output object in a non-template way
       void* getOutputObject( const std::string& key,
                              const std::type_info& ti,
@@ -353,29 +353,29 @@ namespace xAOD {
                                   ::Bool_t silent = kFALSE,
                                   ::Bool_t metadata = kFALSE );
       /// Internal function for adding an auxiliary store object to the output
-      TReturnCode record( TAuxStore* store, const std::string& key,
+      StatusCode record( TAuxStore* store, const std::string& key,
                           ::Int_t basketSize, ::Int_t splitLevel,
                           ::Bool_t ownsStore = kFALSE );
       /// Function setting up access to a particular branch
-      TReturnCode connectBranch( const std::string& key,
+      StatusCode connectBranch( const std::string& key,
                                  ::Bool_t silent = kFALSE );
       /// Function setting up access to a branch in the metadata tree
-      TReturnCode connectMetaBranch( const std::string& key,
+      StatusCode connectMetaBranch( const std::string& key,
                                      ::Bool_t silent = kFALSE );
       /// Function setting up access to a set of auxiliary branches
-      TReturnCode connectAux( const std::string& prefix, ::Bool_t standalone );
+      StatusCode connectAux( const std::string& prefix, ::Bool_t standalone );
       /// Function setting up access to a set of auxiliary branches for a
       /// metadata object
-      TReturnCode connectMetaAux( const std::string& prefix,
+      StatusCode connectMetaAux( const std::string& prefix,
                                   ::Bool_t standalone );
       /// Function adding dynamic variable reading capabilities to an auxiliary
       /// store object
-      TReturnCode setUpDynamicStore( TObjectManager& mgr, ::TTree* tree );
+      StatusCode setUpDynamicStore( TObjectManager& mgr, ::TTree* tree );
       /// Function connecting a DV object to its auxiliary store
-      TReturnCode setAuxStore( TObjectManager& mgr,
+      StatusCode setAuxStore( TObjectManager& mgr,
                                ::Bool_t metadata = kFALSE );
       /// Function saving the dynamically created auxiliary properties
-      TReturnCode putAux( ::TTree& outTree, TVirtualManager& mgr,
+      StatusCode putAux( ::TTree& outTree, TVirtualManager& mgr,
                           ::Int_t basketSize = 32000, ::Int_t splitLevel = 0,
                           ::Bool_t metadata = kFALSE );
       /// Function checking if a given object may have an auxiliary store
diff --git a/Control/xAODRootAccess/xAODRootAccess/TEvent.icc b/Control/xAODRootAccess/xAODRootAccess/TEvent.icc
index 6c58657855da68e0225a1c8b97c0bc44b213621e..cefc3ff60f505826bc0857de6d68e880e7874ef3 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TEvent.icc
+++ b/Control/xAODRootAccess/xAODRootAccess/TEvent.icc
@@ -52,7 +52,7 @@ namespace xAOD {
    ///          <code>kFALSE</code> if it wasn't
    ///
    template< typename T >
-   TReturnCode TEvent::retrieve( const T*& obj, const std::string& key ) {
+   StatusCode TEvent::retrieve( const T*& obj, const std::string& key ) {
 
       // Look among the output objects first:
       const void* result = getOutputObject( key, typeid( T ) );
@@ -65,7 +65,7 @@ namespace xAOD {
                        "Couldn't (const) retrieve \"%s/%s\"",
                        SG::normalizedTypeinfoName( typeid( T ) ).c_str(),
                        key.c_str() );
-            return TReturnCode::kRecoverable;
+            return StatusCode::RECOVERABLE;
          }
       } else {
          // Even if there is an output object with this key, it may
@@ -78,7 +78,7 @@ namespace xAOD {
 
       // If we were successful:
       obj = reinterpret_cast< const T* >( result );
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function can be used to retrieve an object from the output list.
@@ -92,7 +92,7 @@ namespace xAOD {
    ///          <code>kFALSE</code> if it wasn't
    ///
    template< typename T >
-   TReturnCode TEvent::retrieve( T*& obj, const std::string& key ) {
+   StatusCode TEvent::retrieve( T*& obj, const std::string& key ) {
 
       // Only look among the output objects in this case:
       void* result = getOutputObject( key, typeid( T ) );
@@ -102,12 +102,12 @@ namespace xAOD {
                     "Couldn't (non-const) retrieve \"%s/%s\"",
                     SG::normalizedTypeinfoName( typeid( T ) ).c_str(),
                     key.c_str() );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // If we were successful:
       obj = reinterpret_cast< T* >( result );
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function can be used to add an object to the output. The function
@@ -122,7 +122,7 @@ namespace xAOD {
    ///          <code>kFALSE</code> if it wasn't
    ///
    template< typename T >
-   TReturnCode TEvent::record( T* obj, const std::string& key,
+   StatusCode TEvent::record( T* obj, const std::string& key,
                                ::Int_t basketSize, ::Int_t splitLevel ) {
 
       // Just call the non-templated implementation:
@@ -144,11 +144,11 @@ namespace xAOD {
    ///          <code>kFALSE</code> if it wasn't
    ///
    template< typename T >
-   TReturnCode TEvent::record( std::unique_ptr< T > obj, const std::string& key,
+   StatusCode TEvent::record( std::unique_ptr< T > obj, const std::string& key,
                                ::Int_t basketSize, ::Int_t splitLevel ) {
 
       // Just call the non-templated implementation:
-      const TReturnCode rc =
+      const StatusCode rc =
          record( obj.get(), SG::normalizedTypeinfoName( typeid( T ) ), key,
                  basketSize, splitLevel );
       if( ! rc.isSuccess() ) {
@@ -158,7 +158,7 @@ namespace xAOD {
       // If the record was successful, let's release the object from the unique
       // pointer:
       obj.release();
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function works pretty much like StoreGateSvc::contains for metadata
@@ -196,10 +196,10 @@ namespace xAOD {
    ///
    /// @param obj The pointer that will be set to the object requested
    /// @param key The key (branch name) of the object
-   /// @returns The usual TReturnCode values
+   /// @returns The usual StatusCode values
    ///
    template< typename T >
-   TReturnCode TEvent::retrieveMetaInput( const T*& obj,
+   StatusCode TEvent::retrieveMetaInput( const T*& obj,
                                           const std::string& key ) {
 
       // Only look among the output objects in this case:
@@ -210,12 +210,12 @@ namespace xAOD {
                     "Couldn't (const) retrieve \"%s/%s\"",
                     SG::normalizedTypeinfoName( typeid( T ) ).c_str(),
                     key.c_str() );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // If we were successful:
       obj = reinterpret_cast< const T* >( result );
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function can be used to retrieve an object from the output metadata
@@ -223,10 +223,10 @@ namespace xAOD {
    ///
    /// @param obj The pointer that will be set to the object requested
    /// @param key The key (branch name) of the object
-   /// @returns The usual TReturnCode values
+   /// @returns The usual StatusCode values
    ///
    template< typename T >
-   TReturnCode TEvent::retrieveMetaOutput( const T*& obj,
+   StatusCode TEvent::retrieveMetaOutput( const T*& obj,
                                            const std::string& key ) {
 
       // Only look among the output objects in this case:
@@ -237,12 +237,12 @@ namespace xAOD {
                     "Couldn't (const) retrieve \"%s/%s\"",
                     SG::normalizedTypeinfoName( typeid( T ) ).c_str(),
                     key.c_str() );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // If we were successful:
       obj = reinterpret_cast< const T* >( result );
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function can be used to retrieve an object from the output metadata
@@ -250,10 +250,10 @@ namespace xAOD {
    ///
    /// @param obj The pointer that will be set to the object requested
    /// @param key The key (branch name) of the object
-   /// @returns The usual TReturnCode values
+   /// @returns The usual StatusCode values
    ///
    template< typename T >
-   TReturnCode TEvent::retrieveMetaOutput( T*& obj, const std::string& key ) {
+   StatusCode TEvent::retrieveMetaOutput( T*& obj, const std::string& key ) {
 
       // Only look among the output objects in this case:
       void* result = getOutputObject( key, typeid( T ), kTRUE );
@@ -263,12 +263,12 @@ namespace xAOD {
                     "Couldn't (non-const) retrieve \"%s/%s\"",
                     SG::normalizedTypeinfoName( typeid( T ) ).c_str(),
                     key.c_str() );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // If we were successful:
       obj = reinterpret_cast< T* >( result );
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    /// This function can be used to add a metadata object to the output.
@@ -283,7 +283,7 @@ namespace xAOD {
    ///          <code>kFALSE</code> if it wasn't
    ///
    template< typename T >
-   TReturnCode TEvent::recordMeta( T* obj, const std::string& key,
+   StatusCode TEvent::recordMeta( T* obj, const std::string& key,
                                    ::Int_t basketSize, ::Int_t splitLevel ) {
 
       // Just call the non-templated implementation:
@@ -304,12 +304,12 @@ namespace xAOD {
    ///          <code>kFALSE</code> if it wasn't
    ///
    template< typename T >
-   TReturnCode TEvent::recordMeta( std::unique_ptr< T > obj,
+   StatusCode TEvent::recordMeta( std::unique_ptr< T > obj,
                                    const std::string& key,
                                    ::Int_t basketSize, ::Int_t splitLevel ) {
 
       // Just call the non-templated implementation:
-      const TReturnCode rc =
+      const StatusCode rc =
          record( obj.get(), SG::normalizedTypeinfoName( typeid( T ) ), key,
                  basketSize, splitLevel, kFALSE, kTRUE );
       if( ! rc.isSuccess() ) {
@@ -319,7 +319,7 @@ namespace xAOD {
       // If the record was successful, let's release the object from the unique
       // pointer:
       obj.release();
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
 } // namespace xAOD
diff --git a/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h b/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h
index 670e44c85d61ff3fe32efa39c75fb3b72856911a..07b0762f1dde4dfdbc564afcfa9b9a0df660e503 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TPyEvent.h
@@ -39,7 +39,7 @@ namespace xAOD {
                                   const std::string& type ) const;
 
       /// Add an output object to the event
-      TReturnCode record( int dummy, void* obj, const std::string& key,
+      StatusCode record( int dummy, void* obj, const std::string& key,
                           const std::string& type,
                           ::Int_t basketSize = 32000, ::Int_t splitLevel = 0 );
 
diff --git a/Control/xAODRootAccess/xAODRootAccess/TPyStore.h b/Control/xAODRootAccess/xAODRootAccess/TPyStore.h
index 442e10b116b3f919f285bc8fcd3915fd9331ea2a..e7ff9a5d18d737c996187d603b129f25ed6a838b 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TPyStore.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TPyStore.h
@@ -40,7 +40,7 @@ namespace xAOD {
       ::Bool_t isConst( const std::string& key, const std::string& type ) const;
 
       /// Record an object into the store in a typeless way
-      TReturnCode record( void* obj, const std::string& key,
+      StatusCode record( void* obj, const std::string& key,
                           const std::string& type );
 
       /// Print the contents of the store using a Python friendly function
diff --git a/Control/xAODRootAccess/xAODRootAccess/TStore.h b/Control/xAODRootAccess/xAODRootAccess/TStore.h
index 9652657ad1ccb5d4c71bf4d0e8a45d868e2f8229..f1496279606b331f8e70c8e00f11ada136676ef1 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TStore.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TStore.h
@@ -17,7 +17,7 @@
 #include "AthContainers/ConstDataVector.h"
 
 // Local include(s):
-#include "xAODRootAccess/tools/TReturnCode.h"
+#include "AsgMessaging/StatusCode.h"
 
 namespace xAOD {
 
@@ -71,22 +71,22 @@ namespace xAOD {
 
       /// Retrieve either a constant or non-constant object from the store
       template< typename T >
-      TReturnCode retrieve( const T*& obj, const std::string& key ) const;
+      StatusCode retrieve( const T*& obj, const std::string& key ) const;
       /// Retrieve a non-constant object from the store
       template< typename T >
-      TReturnCode retrieve( T*& obj, const std::string& key ) const;
+      StatusCode retrieve( T*& obj, const std::string& key ) const;
 
       /// Add an object to the store
       template< typename T >
-      TReturnCode record( T* obj, const std::string& key );
+      StatusCode record( T* obj, const std::string& key );
       /// Add an object othe store, explicitly taking ownership of it
       template< typename T >
-      TReturnCode record( std::unique_ptr< T > obj, const std::string& key );
+      StatusCode record( std::unique_ptr< T > obj, const std::string& key );
 
       /// Remove an object from the store by name
-      TReturnCode remove( const std::string& key );
+      StatusCode remove( const std::string& key );
       /// Remove an object from the store by pointer
-      TReturnCode remove( void* ptr );
+      StatusCode remove( void* ptr );
 
       /// Clear the store of all of its contents
       void clear();
@@ -109,18 +109,18 @@ namespace xAOD {
       const void* getConstObject( const std::string& key,
                                   const std::type_info& ti ) const;
       /// Function recording an object that has a dictionary available
-      TReturnCode record( void* obj, const std::string& key,
+      StatusCode record( void* obj, const std::string& key,
                           const std::string& classname,
                           ::Bool_t isOwner = kTRUE );
       /// Function recording an object that has no dictionary
-      TReturnCode record( void* obj, const std::string& key,
+      StatusCode record( void* obj, const std::string& key,
                           const std::type_info& ti );
       /// Function doing the first step of recording a ConstDataVector object
       template< class T >
-      TReturnCode record( ConstDataVector< T >* obj, const std::string& key,
+      StatusCode record( ConstDataVector< T >* obj, const std::string& key,
                           const std::type_info& ti );
       /// Function doing the second step of recording a ConstDataVector object
-      TReturnCode record( THolder* hldr, const std::string& key );
+      StatusCode record( THolder* hldr, const std::string& key );
 
       /// @name Functions mostly used by TEvent in the TVirtualEvent functions
       /// @{
diff --git a/Control/xAODRootAccess/xAODRootAccess/TStore.icc b/Control/xAODRootAccess/xAODRootAccess/TStore.icc
index 1efce12e3c0e5377a84a5d18933bdb3b138196ad..bcfaffff8fb752e2c2213c3788e18c33dc1ec8a4 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TStore.icc
+++ b/Control/xAODRootAccess/xAODRootAccess/TStore.icc
@@ -32,7 +32,7 @@ namespace xAOD {
    }
 
    template< typename T >
-   TReturnCode TStore::retrieve( const T*& obj, const std::string& key ) const {
+   StatusCode TStore::retrieve( const T*& obj, const std::string& key ) const {
 
       // Try to find the object:
       const void* ptr = getConstObject( key, typeid( T ) );
@@ -41,16 +41,16 @@ namespace xAOD {
          ::Warning( "xAOD::TStore::retrieve",
                     "Couldn't (const) retrieve \"%s/%s\"",
                     typeName.c_str(), key.c_str() );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // If we were successful:
       obj = reinterpret_cast< const T* >( ptr );
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    template< typename T >
-   TReturnCode TStore::retrieve( T*& obj, const std::string& key ) const {
+   StatusCode TStore::retrieve( T*& obj, const std::string& key ) const {
 
       // Try to find the object:
       void* ptr = getObject( key, typeid( T ) );
@@ -59,19 +59,19 @@ namespace xAOD {
          ::Warning( "xAOD::TStore::retrieve",
                     "Couldn't (non-const) retrieve \"%s/%s\"",
                     typeName.c_str(), key.c_str() );
-         return TReturnCode::kRecoverable;
+         return StatusCode::RECOVERABLE;
       }
 
       // If we were successful:
       obj = reinterpret_cast< T* >( ptr );
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    template< typename T >
-   TReturnCode TStore::record( T* obj, const std::string& key ) {
+   StatusCode TStore::record( T* obj, const std::string& key ) {
 
       // Check if it's possible to record the object with a dictionary:
-      TReturnCode result = record( obj, key,
+      StatusCode result = record( obj, key,
                                    SG::normalizedTypeinfoName( typeid( T ) ) );
       // If it's a success or a failure, let's stop here. Only go on for a
       // recoverable error:
@@ -90,11 +90,11 @@ namespace xAOD {
    }
 
    template< typename T >
-   TReturnCode TStore::record( std::unique_ptr< T > obj,
+   StatusCode TStore::record( std::unique_ptr< T > obj,
                                const std::string& key ) {
 
       // Check if it's possible to record the object with a dictionary:
-      TReturnCode result = record( obj.get(), key,
+      StatusCode result = record( obj.get(), key,
                                    SG::normalizedTypeinfoName( typeid( T ) ) );
       // If it's a success or a failure, let's stop here. Only go on for a
       // recoverable error:
@@ -122,11 +122,11 @@ namespace xAOD {
       // In case of success, make the smart pointer give up ownership of
       // the object:
       obj.release();
-      return TReturnCode::kSuccess;
+      return StatusCode::SUCCESS;
    }
 
    template< class T >
-   TReturnCode TStore::record( ConstDataVector< T >* obj,
+   StatusCode TStore::record( ConstDataVector< T >* obj,
                                const std::string& key,
                                const std::type_info& ti ) {
 
diff --git a/Control/xAODRootAccess/xAODRootAccess/TTreeMgr.h b/Control/xAODRootAccess/xAODRootAccess/TTreeMgr.h
index aeb4fe619e38b7db79dfb69a844ae555d79fa8e7..86f2f2e9ab1065ce3afcf70ba668de98509d9cfb 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TTreeMgr.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TTreeMgr.h
@@ -12,7 +12,7 @@
 
 // Local include(s):
 #include "xAODRootAccess/TEvent.h"
-#include "xAODRootAccess/tools/TReturnCode.h"
+#include "AsgMessaging/StatusCode.h"
 #include "xAODRootAccess/tools/xAODTEventTree.h"
 #include "xAODRootAccess/tools/xAODTMetaTree.h"
 
@@ -41,7 +41,7 @@ namespace xAOD {
       /// @{
 
       /// Read from the file given to the function
-      TReturnCode readFrom( ::TFile* file, ::Bool_t useTreeCache = kTRUE,
+      StatusCode readFrom( ::TFile* file, ::Bool_t useTreeCache = kTRUE,
                             const char* treeName = "CollectionTree" );
 
       /// @}
@@ -50,14 +50,14 @@ namespace xAOD {
       /// @{
 
       /// Object/container names that should be used in the event tree
-      TReturnCode enableEventObj( const std::vector< std::string >& names );
+      StatusCode enableEventObj( const std::vector< std::string >& names );
       /// Object/container names that should be vetoed from the event tree
-      TReturnCode suppressEventObj( const std::vector< std::string >& names );
+      StatusCode suppressEventObj( const std::vector< std::string >& names );
 
       /// Object/container names that should be used in the metadata tree
-      TReturnCode enableMetaObj( const std::vector< std::string >& names );
+      StatusCode enableMetaObj( const std::vector< std::string >& names );
       /// Object/container names that should be suppressed in the metadata tree
-      TReturnCode suppressMetaObj( const std::vector< std::string >& names );
+      StatusCode suppressMetaObj( const std::vector< std::string >& names );
 
       /// @}
 
diff --git a/Control/xAODRootAccess/xAODRootAccess/tools/IProxyDict.h b/Control/xAODRootAccess/xAODRootAccess/tools/IProxyDict.h
index 5047e08d3ceeabd0b2241ca69f3003b161f2c201..a0647cf06d81c83bdcedb58a5235f49d22c43212 100644
--- a/Control/xAODRootAccess/xAODRootAccess/tools/IProxyDict.h
+++ b/Control/xAODRootAccess/xAODRootAccess/tools/IProxyDict.h
@@ -47,9 +47,6 @@ public:
    /// Virtual destructor
    virtual ~IProxyDict() {}
 
-   /// In order not to clash with the standalone version of StatusCode
-   typedef xAOD::TReturnCode StatusCode;
-
    /// get proxy for a given data object address in memory
    virtual SG::DataProxy* proxy( const void* const pTransient ) const = 0;
 
diff --git a/Control/xAODRootAccess/xAODRootAccess/tools/ReturnCheck.h b/Control/xAODRootAccess/xAODRootAccess/tools/ReturnCheck.h
index e729388fb114b8fee023094f086ca115d7ba82ba..a19a683320212b143582882ca3ebf192dfa31c03 100644
--- a/Control/xAODRootAccess/xAODRootAccess/tools/ReturnCheck.h
+++ b/Control/xAODRootAccess/xAODRootAccess/tools/ReturnCheck.h
@@ -11,14 +11,14 @@
 #include <TError.h>
 
 // Local include(s):
-#include "xAODRootAccess/tools/TReturnCode.h"
+#include "AsgMessaging/StatusCode.h"
 #include "xAODRootAccess/tools/Message.h"
 
 /// Helper macro for checking return codes in a compact form in the code
 ///
 /// This is pretty much a rip-off of the (ATH_)CHECK macros of the offline
-/// code. It is used in the package in functions that return a TReturnCode,
-/// and themselves call functions returning TReturnCode.
+/// code. It is used in the package in functions that return a StatusCode,
+/// and themselves call functions returning StatusCode.
 ///
 /// @param CONTEXT A context string to print an error message on failure
 /// @param EXP The expression to execute in a checked manner
diff --git a/Control/xAODRootAccess/xAODRootAccess/tools/TFileChecker.h b/Control/xAODRootAccess/xAODRootAccess/tools/TFileChecker.h
index d90fd609d5ebfb7f277f6bbdc7387116390404b6..bf96d08ca1a9cb86b3a15d475839167732f562e4 100644
--- a/Control/xAODRootAccess/xAODRootAccess/tools/TFileChecker.h
+++ b/Control/xAODRootAccess/xAODRootAccess/tools/TFileChecker.h
@@ -16,7 +16,7 @@
 #include <TObject.h>
 
 // Local include(s):
-#include "xAODRootAccess/tools/TReturnCode.h"
+#include "AsgMessaging/StatusCode.h"
 
 // Forward declaration(s):
 namespace SG {
@@ -46,7 +46,7 @@ namespace xAOD {
       TFileChecker();
 
       /// Execute all sanity checks on a given file
-      TReturnCode check( TEvent& event );
+      StatusCode check( TEvent& event );
 
       /// Set whether the validation should stop when an error is found
       void setStopOnError( ::Bool_t value );
@@ -62,7 +62,7 @@ namespace xAOD {
 
    private:
       /// Check the health of a container
-      TReturnCode checkContainer( const SG::AuxVectorBase& vec,
+      StatusCode checkContainer( const SG::AuxVectorBase& vec,
                                   const std::string& name );
 
       /// Stop the validation when an issue is found?
diff --git a/Control/xAODRootAccess/xAODRootAccess/tools/TFileMerger.h b/Control/xAODRootAccess/xAODRootAccess/tools/TFileMerger.h
index d08736f5093b60b94e937e81d938406d35013477..23de5ed13a07267fcffc047af8b146ac3daf4ade 100644
--- a/Control/xAODRootAccess/xAODRootAccess/tools/TFileMerger.h
+++ b/Control/xAODRootAccess/xAODRootAccess/tools/TFileMerger.h
@@ -20,7 +20,7 @@
 
 // Local include(s):
 #include "xAODRootAccess/TEvent.h"
-#include "xAODRootAccess/tools/TReturnCode.h"
+#include "AsgMessaging/StatusCode.h"
 #include "xAODRootAccess/tools/THolder.h"
 
 // Forward declaration(s):
@@ -53,15 +53,15 @@ namespace xAOD {
       ~TFileMerger();
 
       /// Set the name of the output file that should be created
-      TReturnCode setOutputFileName( const std::string& name,
+      StatusCode setOutputFileName( const std::string& name,
                                      const std::string& mode = "RECREATE" );
 
       /// Add a file to the list to be merged, by name
-      TReturnCode addFile( const std::string& name,
+      StatusCode addFile( const std::string& name,
                            bool copyLocally = false );
 
       /// Add a metadata tool to be used during the merging
-      TReturnCode addMetaDataTool( const std::string& typeName );
+      StatusCode addMetaDataTool( const std::string& typeName );
 
       /// Types of merging that can be done
       ///
@@ -77,7 +77,7 @@ namespace xAOD {
       static const ::Long64_t kBigNumber = 1234567890;
 
       /// Execute the file merge itself
-      TReturnCode merge( EMergeMode mode = kFastMerge,
+      StatusCode merge( EMergeMode mode = kFastMerge,
                          ::Long64_t entries = kBigNumber );
 
       /// The access mode used for slow and metadata merging
@@ -97,21 +97,21 @@ namespace xAOD {
 
    private:
       /// Close all the open files
-      TReturnCode closeFiles();
+      StatusCode closeFiles();
       /// Merge the contents of one directory from the input files
-      TReturnCode mergeDirectory( ::TDirectory& input, ::TDirectory& output,
+      StatusCode mergeDirectory( ::TDirectory& input, ::TDirectory& output,
                                   EMergeMode mode, bool topLevelDir );
       /// Merge two top level objects that were found in the inputs
-      TReturnCode mergeObject( ::TObject& input, ::TObject& output );
+      StatusCode mergeObject( ::TObject& input, ::TObject& output );
       /// Instantiate the metadata handling tools
-      TReturnCode createMetaDataTools();
+      StatusCode createMetaDataTools();
       /// Get the auxiliary branches missing in one of the trees
       std::vector< ::TBranch* > getMissingBranches( ::TTree* first,
                                                     ::TTree* second ) const;
       /// Get the branches that should be skipped from merging
       std::vector< ::TBranch* > getSkippedBranches( ::TTree* tree ) const;
       /// Duplicate an auxiliary branch from the input into the output
-      TReturnCode addAuxBranch( ::TTree* otree, ::TBranch* ibranch ) const;
+      StatusCode addAuxBranch( ::TTree* otree, ::TBranch* ibranch ) const;
 
       /// The list of input files to be merged
       std::vector< ::TFile* > m_input;
diff --git a/Control/xAODRootAccess/xAODRootAccess/tools/TReturnCode.h b/Control/xAODRootAccess/xAODRootAccess/tools/TReturnCode.h
deleted file mode 100644
index eda9d6a535dcdd5141698bb59fbd88ede294ba50..0000000000000000000000000000000000000000
--- a/Control/xAODRootAccess/xAODRootAccess/tools/TReturnCode.h
+++ /dev/null
@@ -1,119 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: TReturnCode.h 598368 2014-05-22 10:23:54Z krasznaa $
-#ifndef XAODROOTACCESS_TOOLS_TRETURNCODE_H
-#define XAODROOTACCESS_TOOLS_TRETURNCODE_H
-
-
-namespace xAOD {
-
-   /// A light-weight version of StatusCode for the xAODRootAccess package
-   ///
-   /// In order to force users to check return codes from the classes of
-   /// xAODRootAccess (especially xAOD::TEvent), the functions now return
-   /// such objects instead of booleans. The user must check the value of
-   /// the returned object in all cases, using one of the member functions
-   /// of the class.
-   ///
-   /// The code then keeps track internally of unchecked return codes, and
-   /// complains at the end of the job about them.
-   ///
-   /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-   ///
-   /// $Revision: 598368 $
-   /// $Date: 2014-05-22 12:23:54 +0200 (Thu, 22 May 2014) $
-   ///
-   class
-#ifndef __CLING__
-   // cppyy will generate wrappers both for functions returning a value
-   // and the value being discarded.  If we have [[nodiscard]] on,
-   // then we'll get warnings when cling compiles these wrappers.
-   // Since these wrappers are automatically generated by cppyy,
-   // we can't really avoid these other than by disabling them
-   // for the cling case.
-   [[nodiscard]]
-#endif
-   TReturnCode {
-
-   public:
-      /// Enumeration listing the possible return codes
-      enum EReturnCode {
-         kFailure     = 0, ///< The function call failed
-         kSuccess     = 1, ///< The function call succeeded
-         /// The function call didn't succeed, but there's no fatal failure
-         /// either
-         kRecoverable = 2
-      };
-
-      /// Default constructor
-      TReturnCode() : TReturnCode(kSuccess) {}
-      /// Constructor with a return code value
-      TReturnCode( EReturnCode code );
-      /// Copy constructor
-      TReturnCode( const TReturnCode& parent );
-      /// Destructor
-      ~TReturnCode();
-
-      /// Assignment operator
-      TReturnCode& operator= ( const TReturnCode& rhs );
-
-      /// The code stored internally
-      EReturnCode code() const;
-
-      /// Function checking if the function call succeeded
-      bool isSuccess() const;
-      /// Function checking if the function call failed
-      bool isFailure() const;
-      /// Function checking if the function call produced a recoverable issue
-      bool isRecoverable() const;
-
-      /// Automatic conversion operator to a boolean
-      operator bool() const { return isSuccess(); }
-
-      /// Mark the return code as checked, ignoring it thereby
-      void setChecked() const { m_checked = true; }
-      /// Ignore the return code, marking it as checked
-      void ignore() const { setChecked(); }
-
-      /// Enable failure (with a backtrace) on an unchecked return code
-      static void enableFailure();
-      /// Disable failure (no backtrace) on an unchecked return code
-      static void disableFailure();
-
-   private:
-      /// The code returned by a function
-      EReturnCode m_code;
-      /// Internal status flag of whether the code was checked by the user
-      mutable bool m_checked;
-
-   }; // class TReturnCode
-
-} // namespace xAOD
-
-namespace asg
-{
-  /// \brief this is an internal traits class for status codes used by
-  /// the ANA_CHECK* macros
-  template<typename T> struct CheckHelper;
-
-  template<> struct CheckHelper<xAOD::TReturnCode>
-  {
-    /// \brief whether the status code reports a success
-    static inline bool isSuccess (const xAOD::TReturnCode& sc) {
-      return sc.isSuccess(); }
-
-    /// \brief produce a status code to report success
-    static inline decltype (xAOD::TReturnCode::kSuccess) successCode () {
-      return xAOD::TReturnCode::kSuccess;}
-
-    /// \brief produce a status code to report failure
-    static inline decltype (xAOD::TReturnCode::kFailure) failureCode () {
-      return xAOD::TReturnCode::kFailure;}
-  };
-}
-
-#endif // XAODROOTACCESS_TOOLS_TRETURNCODE_H
diff --git a/Control/xAODRootAccess/xAODRootAccess/tools/TSocket.h b/Control/xAODRootAccess/xAODRootAccess/tools/TSocket.h
index ea771fc02dd22d19a5053d172cb1fb6ea8c1d328..2f62e0fb45481b7fd228721b9fbacb9700ee257e 100644
--- a/Control/xAODRootAccess/xAODRootAccess/tools/TSocket.h
+++ b/Control/xAODRootAccess/xAODRootAccess/tools/TSocket.h
@@ -6,7 +6,7 @@
 #define XAODROOTACCESS_TOOLS_TSOCKET_H
 
 // Local include(s):
-#include "xAODRootAccess/tools/TReturnCode.h"
+#include "AsgMessaging/StatusCode.h"
 
 // Forward declaration(s):
 class TString;
@@ -40,15 +40,15 @@ namespace xAOD {
       TSocket& operator=( const TSocket& ) = delete;
 
       /// Function connecting to the specified address
-      TReturnCode connect( const TInetAddress& address, int port );
+      StatusCode connect( const TInetAddress& address, int port );
       /// Close the current connection
-      TReturnCode close();
+      StatusCode close();
 
       /// Check if the socket is connected to some address at the moment
       bool isConnected() const;
 
       /// Function sending a message to the connected address
-      TReturnCode send( const TString& payload );
+      StatusCode send( const TString& payload );
 
    private:
       /// The underlying socket
diff --git a/Event/xAOD/xAODTriggerCnv/test/ut_xaodtriggercnv_triggermenumetadatatool_test.cxx b/Event/xAOD/xAODTriggerCnv/test/ut_xaodtriggercnv_triggermenumetadatatool_test.cxx
index 304871c72b8404eed5e0e7b85b53f75304deceee..987bcb617c2eecbdd833697d98ee98699cda11c4 100644
--- a/Event/xAOD/xAODTriggerCnv/test/ut_xaodtriggercnv_triggermenumetadatatool_test.cxx
+++ b/Event/xAOD/xAODTriggerCnv/test/ut_xaodtriggercnv_triggermenumetadatatool_test.cxx
@@ -50,7 +50,7 @@
       const bool result = EXP;                                               \
       if( ! result ) {                                                       \
          ::Error( CONTEXT, XAOD_MESSAGE( "Failed to evaluate: %s" ), #EXP ); \
-         return xAOD::TReturnCode::kFailure;                                 \
+         return StatusCode::FAILURE;                                 \
       }                                                                      \
    } while( 0 )
 
@@ -60,9 +60,9 @@
 /// @param smks    The super master keys to put into the file
 /// @param l1psks  The LVL1 prescale keys to put into the file
 /// @param hltpsks The HLT prescale keys to put into the file
-/// @returns The usual <code>xAOD::TReturnCode</code> types
+/// @returns The usual <code>StatusCode</code> types
 ///
-xAOD::TReturnCode writeTestFile( const std::string& fname,
+StatusCode writeTestFile( const std::string& fname,
                                  const std::vector< uint32_t >& smks,
                                  const std::vector< uint32_t >& l1psks,
                                  const std::vector< uint32_t >& hltpsks ) {
@@ -79,7 +79,7 @@ xAOD::TReturnCode writeTestFile( const std::string& fname,
    if( ! ofile.get() ) {
       ::Error( "writeTestFile", XAOD_MESSAGE( "Couldn't open output file: %s" ),
                fname.c_str() );
-      return xAOD::TReturnCode::kFailure;
+      return StatusCode::FAILURE;
    }
    RETURN_CHECK( "writeTestFile", event.writeTo( ofile.get() ) );
 
@@ -97,7 +97,7 @@ xAOD::TReturnCode writeTestFile( const std::string& fname,
             ::Error( "writeTestFile",
                      XAOD_MESSAGE( "Write error for i = %i, j = %i" ),
                      i, j );
-            return xAOD::TReturnCode::kFailure;
+            return StatusCode::FAILURE;
          }
       }
    }
@@ -126,7 +126,7 @@ xAOD::TReturnCode writeTestFile( const std::string& fname,
    RETURN_CHECK( "writeTestFile", event.finishWritingTo( ofile.get() ) );
 
    // Return gracefully:
-   return xAOD::TReturnCode::kSuccess;
+   return StatusCode::SUCCESS;
 }
 
 /// Type for a trigger key object that can be used in the checks
@@ -141,9 +141,9 @@ TrigKey_t makeKey( uint32_t smk, uint32_t l1psk, uint32_t hltpsk ) {
 /// Function used to check the content of the merged file
 ///
 /// @param fname The name of the file to test
-/// @returns The usual <code>xAOD::TReturnCode</code> types
+/// @returns The usual <code>StatusCode</code> types
 ///
-xAOD::TReturnCode checkMergedFile( const std::string& fname ) {
+StatusCode checkMergedFile( const std::string& fname ) {
 
    // Set up the reading of the file:
    xAOD::TEvent event;
@@ -151,7 +151,7 @@ xAOD::TReturnCode checkMergedFile( const std::string& fname ) {
    if( ! ifile.get() ) {
       ::Error( "checkMergedFile", XAOD_MESSAGE( "Couldn't open file: %s" ),
                fname.c_str() );
-      return xAOD::TReturnCode::kFailure;
+      return StatusCode::FAILURE;
    }
    RETURN_CHECK( "checkMergedFile", event.readFrom( ifile.get() ) );
 
@@ -172,7 +172,7 @@ xAOD::TReturnCode checkMergedFile( const std::string& fname ) {
    R_ASSERT( "checkMergedFile", reference == inFile );
 
    // Return gracefully:
-   return xAOD::TReturnCode::kSuccess;
+   return StatusCode::SUCCESS;
 }
 
 int main() {
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopAlgs/test/gt_DuplicateChecker.cxx b/PhysicsAnalysis/D3PDTools/EventLoopAlgs/test/gt_DuplicateChecker.cxx
index f8a03eb14289bb19b6010e078785a7c1e3b4d2a7..2c1d5213f46ef55194726a14db8d3fd96436fd8e 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopAlgs/test/gt_DuplicateChecker.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopAlgs/test/gt_DuplicateChecker.cxx
@@ -146,7 +146,7 @@ void checkHistograms (const std::string& submitdir,
 
 TEST (DuplicateCheckerTest, all_tests)
 {
-  xAOD::TReturnCode::enableFailure();
+  StatusCode::enableFailure();
   xAOD::Init ().ignore();
 
   std::string prefix = "DuplicateCheckerSubmit";
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_UnitTestAlgXAOD.cxx b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_UnitTestAlgXAOD.cxx
index a0110a2c15f174872ecaaa9c7f7a0a9877b01932..0c9022184c1a616e1aacca31e23b0c58b71e7efb 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_UnitTestAlgXAOD.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopTest/test/gt_UnitTestAlgXAOD.cxx
@@ -36,7 +36,7 @@ using namespace EL;
 
 TEST (UnitTestAlgXAODTest, all_tests)
 {
-  xAOD::TReturnCode::enableFailure();
+  StatusCode::enableFailure();
   xAOD::Init ().ignore();
 
   std::string prefix = "UnitTestAlgXAODSubmit";
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-btagging.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-btagging.cxx
index aeda1774b7d4fbb4d70e48f2d644d57daa43f876..94e61455384a4e461ad2c7ea9e33f9343ffe4e52 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-btagging.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-btagging.cxx
@@ -4,12 +4,16 @@
 #include "xAODJet/JetContainer.h"
 #include "xAODBTagging/BTaggingContainer.h"
 #include "xAODBTagging/BTaggingUtilities.h"
+#include "AsgMessaging/MessageCheck.h"
 
 #include "TFile.h"
 #include "TTree.h"
 
 int main (int argc, char *argv[]) {
 
+   ANA_CHECK_SET_TYPE (int);
+   using namespace asg::msgUserCode;
+
   if (argc != 3) {
     std::cerr << "usage: " << argv[0] << ": <DAOD> <jet collection>"
               << std::endl;
@@ -22,7 +26,7 @@ int main (int argc, char *argv[]) {
   const char *const APP_NAME = "BTagTestDumper";
 
   // Set up the environment:
-  RETURN_CHECK( APP_NAME, xAOD::Init() );
+  ANA_CHECK( xAOD::Init() );
 
   // Set up the event object:
   xAOD::TEvent event(xAOD::TEvent::kClassAccess);
@@ -36,7 +40,7 @@ int main (int argc, char *argv[]) {
   Info( APP_NAME, "Opened file: %s", file.c_str() );
 
   // Connect the event object to it:
-  RETURN_CHECK( APP_NAME, event.readFrom(ifile.get()) );
+  ANA_CHECK( event.readFrom(ifile.get()) );
 
   unsigned long long nbad = 0;
   unsigned long long ngood = 0;
@@ -49,7 +53,7 @@ int main (int argc, char *argv[]) {
       return 1;
     }
     const xAOD::JetContainer *jets = nullptr;
-    RETURN_CHECK( APP_NAME, event.retrieve(jets, jets_name) );
+    ANA_CHECK( event.retrieve(jets, jets_name) );
     for (const xAOD::Jet *const jet : *jets) {
       const xAOD::BTagging *btag = xAOD::BTaggingUtilities::getBTagging( *jet );
       if (!btag) {
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-jet-links.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-jet-links.cxx
index c5be0b288a193fc43c171a7bcedc9e4fbfa5863b..71ccf48ebc46f15c2330a4914740dc30874fa927 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-jet-links.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-jet-links.cxx
@@ -5,11 +5,16 @@
 #include "xAODRootAccess/TEvent.h"
 #include "xAODJet/JetContainer.h"
 
+#include "AsgMessaging/MessageCheck.h"
+
 #include "TFile.h"
 #include "TTree.h"
 
 int main (int argc, char *argv[]) {
 
+  ANA_CHECK_SET_TYPE (int);
+  using namespace asg::msgUserCode;
+
   if (argc != 4) {
     std::cerr << "usage: " << argv[0] << ": <DAOD> <parent jet collection> <associated collection>"
               << std::endl;
@@ -23,7 +28,7 @@ int main (int argc, char *argv[]) {
   const char *const APP_NAME = "JetLinksTestDumper";
 
   // Set up the environment:
-  RETURN_CHECK( APP_NAME, xAOD::Init() );
+  ANA_CHECK( xAOD::Init() );
 
   // Set up the event object:
   xAOD::TEvent event(xAOD::TEvent::kClassAccess);
@@ -37,7 +42,7 @@ int main (int argc, char *argv[]) {
   Info( APP_NAME, "Opened file: %s", file.c_str() );
 
   // Connect the event object to it:
-  RETURN_CHECK( APP_NAME, event.readFrom(ifile.get()) );
+  ANA_CHECK( event.readFrom(ifile.get()) );
 
   unsigned long long nbad = 0;
   unsigned long long ngood = 0;
@@ -50,7 +55,7 @@ int main (int argc, char *argv[]) {
       return 1;
     }
     const xAOD::JetContainer *jets = nullptr;
-    RETURN_CHECK( APP_NAME, event.retrieve(jets, jets_name) );
+    ANA_CHECK( event.retrieve(jets, jets_name) );
     for (const xAOD::Jet *const jet : *jets) {
       std::vector<const xAOD::Jet*> linked_jets;
       if (!jet->getAssociatedObjects<xAOD::Jet>(linked_jets_name, linked_jets)){
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorrWithoutFile.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorrWithoutFile.cxx
index 0c78b065bb4cc2f194d8cb8838f758ac361f97ea..d75c18c15f16e746a93a885b94031a8fab8830e7 100644
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorrWithoutFile.cxx
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronEfficiencyCorrection/util/testEgEfficiencyCorrWithoutFile.cxx
@@ -24,7 +24,7 @@
 #include <boost/program_options.hpp>
 
 int main( int argc, char* argv[] ) {
-    xAOD::TReturnCode::enableFailure();
+    StatusCode::enableFailure();
     MSGHELPERS::getMsgStream().msg().setLevel(MSG::INFO); 
     /*
      * Parse the input from the command line
diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test.py b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test.py
index b8681943e0a5f71ed7c24d8b66cfec4ae1c27233..ff7f8a591d6a26f3913eb64d51434d115a8ef0af 100755
--- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test.py
+++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection/test/ut_test.py
@@ -728,5 +728,5 @@ if __name__ == '__main__':
     ROOT.gROOT.ProcessLine(".x $ROOTCOREDIR/scripts/load_packages.C")
 #    from ROOT import EgammaCalibPeriodRunNumbersExample
 
-    #ROOT.xAOD.TReturnCode.enableFailure()
+    #ROOT.StatusCode.enableChecking()
     unittest.main()
diff --git a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsSFFileTester.cxx b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsSFFileTester.cxx
index a0f19d6653655316317501679c1a0aef01dcc8dd..5511b133672d53305c401a1f3fbd58210617cdb1 100644
--- a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsSFFileTester.cxx
+++ b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsSFFileTester.cxx
@@ -68,7 +68,6 @@ int main(int argc, char* argv[]) {
 
     // force strict checking of return codes
     CP::SystematicCode::enableFailure();
-    xAOD::TReturnCode::enableFailure();
     StatusCode::enableFailure();
 
     // The application's name:
diff --git a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsTest.cxx b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsTest.cxx
index f832caa314b0a78e92cbe2d88799575e887188d5..a8876626059a8e26979d8f0e678aa3b7c48f25c3 100644
--- a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsTest.cxx
+++ b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/util/MuonEfficiencyScaleFactorsTest.cxx
@@ -73,7 +73,6 @@ int main(int argc, char* argv[]) {
 
     // force strict checking of return codes
     CP::SystematicCode::enableFailure();
-    xAOD::TReturnCode::enableFailure();
     StatusCode::enableFailure();
 
     // The application's name:
diff --git a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections/util/MCAST_Tester.cxx b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections/util/MCAST_Tester.cxx
index 863372fbd7e0674e3c507159efbbbb89fcbb80c6..d57fba124b29d409f6aeb76dbf27175769065629 100644
--- a/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections/util/MCAST_Tester.cxx
+++ b/PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections/util/MCAST_Tester.cxx
@@ -97,7 +97,7 @@ int main( int argc, char* argv[] ) {
   //:::  initialize the application and get the event
   ////////////////////////////////////////////////////
   ANA_CHECK (xAOD::Init( APP_NAME ));
-  xAOD::TReturnCode::enableFailure();
+  StatusCode::enableChecking();
 
   //::: Open the input file:
   std::string fileName = argv[1];
diff --git a/PhysicsAnalysis/SUSYPhys/SUSYTools/test/ut_SUSYTools_wp_checker.py b/PhysicsAnalysis/SUSYPhys/SUSYTools/test/ut_SUSYTools_wp_checker.py
index 76de2a07c7315feb2f4614bccb1cfe597c7ae228..c70b0ef090215177b3e12ba3793e8e991adb3963 100755
--- a/PhysicsAnalysis/SUSYPhys/SUSYTools/test/ut_SUSYTools_wp_checker.py
+++ b/PhysicsAnalysis/SUSYPhys/SUSYTools/test/ut_SUSYTools_wp_checker.py
@@ -312,7 +312,7 @@ if __name__ == '__main__':
 
     ## Load pkgs
     ROOT.gROOT.ProcessLine(".x $ROOTCOREDIR/scripts/load_packages.C")
-    #ROOT.xAOD.TReturnCode.enableFailure()
+    #ROOT.StatusCode.enableChecking()
 
 
     ## Call the tests
diff --git a/PhysicsAnalysis/TauID/TauAnalysisTools/util/TauAnalysisToolsExample.cxx b/PhysicsAnalysis/TauID/TauAnalysisTools/util/TauAnalysisToolsExample.cxx
index 3bfe9af4e9e103647638674b13bc970811e32afd..6c825220f8bea646b047b51f10addb8bcc37412d 100644
--- a/PhysicsAnalysis/TauID/TauAnalysisTools/util/TauAnalysisToolsExample.cxx
+++ b/PhysicsAnalysis/TauID/TauAnalysisTools/util/TauAnalysisToolsExample.cxx
@@ -65,7 +65,7 @@ int main( int argc, char* argv[] )
 {
   CP::SystematicCode::enableFailure();
 
-  xAOD::TReturnCode::enableFailure();
+  StatusCode::enableFailure();
 
   // Check if we received a file name:
   if( argc < 2 )
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/Tools.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/Tools.cxx
index d8942ca71a37060924f06a17d31b09ff5b24d915..abea04fd497b8806c27c61cc367e0462477368ab 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/Tools.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/Tools.cxx
@@ -54,7 +54,7 @@ namespace top {
 
     //fail on unchecked error codes
     if (failOnUnchecked) {
-      xAOD::TReturnCode::enableFailure();
+      StatusCode::enableFailure();
       CP::SystematicCode::enableFailure();
       CP::CorrectionCode::enableFailure();
       //StatusCode::enableFailure();
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopEvent/Root/TopEventMaker.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopEvent/Root/TopEventMaker.cxx
index 631731bcd9c80eef7668e9280bab06b33c03eec0..d43f6814f9cb65764aa5e970082c5de9479cff75 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopEvent/Root/TopEventMaker.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopEvent/Root/TopEventMaker.cxx
@@ -129,8 +129,8 @@ namespace top {
         std::pair< xAOD::ElectronContainer*,
                    xAOD::ShallowAuxContainer* > shallow_electrons = xAOD::shallowCopyContainer(*calibratedElectrons);
 
-        xAOD::TReturnCode save = evtStore()->tds()->record(shallow_electrons.first, m_config->sgKeyElectronsTDS(hash));
-        xAOD::TReturnCode saveAux =
+        StatusCode save = evtStore()->tds()->record(shallow_electrons.first, m_config->sgKeyElectronsTDS(hash));
+        StatusCode saveAux =
           evtStore()->tds()->record(shallow_electrons.second, m_config->sgKeyElectronsTDSAux(hash));
         top::check((save && saveAux), "Failed to store object in TStore");
       }
@@ -175,9 +175,9 @@ namespace top {
                    xAOD::ShallowAuxContainer* > shallow_fwdelectrons = xAOD::shallowCopyContainer(
           *calibratedFwdElectrons);
 
-        xAOD::TReturnCode save =
+        StatusCode save =
           evtStore()->tds()->record(shallow_fwdelectrons.first, m_config->sgKeyFwdElectronsTDS(hash));
-        xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_fwdelectrons.second, m_config->sgKeyFwdElectronsTDSAux(
+        StatusCode saveAux = evtStore()->tds()->record(shallow_fwdelectrons.second, m_config->sgKeyFwdElectronsTDSAux(
                                                                 hash));
         top::check((save && saveAux), "Failed to store object in TStore");
       }
@@ -208,8 +208,8 @@ namespace top {
         std::pair< xAOD::PhotonContainer*, xAOD::ShallowAuxContainer* > shallow_photons = xAOD::shallowCopyContainer(
           *calibratedPhotons);
 
-        xAOD::TReturnCode save = evtStore()->tds()->record(shallow_photons.first, m_config->sgKeyPhotonsTDS(hash));
-        xAOD::TReturnCode saveAux =
+        StatusCode save = evtStore()->tds()->record(shallow_photons.first, m_config->sgKeyPhotonsTDS(hash));
+        StatusCode saveAux =
           evtStore()->tds()->record(shallow_photons.second, m_config->sgKeyPhotonsTDSAux(hash));
         top::check((save && saveAux), "Failed to store object in TStore");
       }
@@ -238,8 +238,8 @@ namespace top {
         std::pair< xAOD::MuonContainer*, xAOD::ShallowAuxContainer* > shallow_muons = xAOD::shallowCopyContainer(
           *calibratedMuons);
 
-        xAOD::TReturnCode save = evtStore()->tds()->record(shallow_muons.first, m_config->sgKeyMuonsTDS(hash));
-        xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_muons.second, m_config->sgKeyMuonsTDSAux(hash));
+        StatusCode save = evtStore()->tds()->record(shallow_muons.first, m_config->sgKeyMuonsTDS(hash));
+        StatusCode saveAux = evtStore()->tds()->record(shallow_muons.second, m_config->sgKeyMuonsTDSAux(hash));
         top::check((save && saveAux), "Failed to store object in TStore");
       }
 
@@ -282,8 +282,8 @@ namespace top {
         std::pair< xAOD::MuonContainer*, xAOD::ShallowAuxContainer* > shallow_softmuons = xAOD::shallowCopyContainer(
           *calibratedSoftMuons);
 
-        xAOD::TReturnCode save = evtStore()->tds()->record(shallow_softmuons.first, m_config->sgKeySoftMuonsTDS(hash));
-        xAOD::TReturnCode saveAux =
+        StatusCode save = evtStore()->tds()->record(shallow_softmuons.first, m_config->sgKeySoftMuonsTDS(hash));
+        StatusCode saveAux =
           evtStore()->tds()->record(shallow_softmuons.second, m_config->sgKeySoftMuonsTDSAux(hash));
         top::check((save && saveAux), "Failed to store object in TStore");
       }
@@ -315,8 +315,8 @@ namespace top {
         std::pair< xAOD::TauJetContainer*, xAOD::ShallowAuxContainer* > shallow_taus = xAOD::shallowCopyContainer(
           *calibratedTaus);
 
-        xAOD::TReturnCode save = evtStore()->tds()->record(shallow_taus.first, m_config->sgKeyTausTDS(hash));
-        xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_taus.second, m_config->sgKeyTausTDSAux(hash));
+        StatusCode save = evtStore()->tds()->record(shallow_taus.first, m_config->sgKeyTausTDS(hash));
+        StatusCode saveAux = evtStore()->tds()->record(shallow_taus.second, m_config->sgKeyTausTDSAux(hash));
         top::check((save && saveAux), "Failed to store object in TStore");
       }
 
@@ -357,8 +357,8 @@ namespace top {
         std::pair< xAOD::JetContainer*, xAOD::ShallowAuxContainer* > shallow_jets = xAOD::shallowCopyContainer(
           *calibratedJets);
 
-        xAOD::TReturnCode save = evtStore()->tds()->record(shallow_jets.first, m_config->sgKeyJetsTDS(hash, looseJets));
-        xAOD::TReturnCode saveAux =
+        StatusCode save = evtStore()->tds()->record(shallow_jets.first, m_config->sgKeyJetsTDS(hash, looseJets));
+        StatusCode saveAux =
           evtStore()->tds()->record(shallow_jets.second, m_config->sgKeyJetsTDSAux(hash, looseJets));
         top::check((save && saveAux), "Failed to store object in TStore");
       }
@@ -494,8 +494,8 @@ namespace top {
         std::pair< xAOD::JetContainer*, xAOD::ShallowAuxContainer* > shallow_jets = xAOD::shallowCopyContainer(
           *calibratedJets);
 
-        xAOD::TReturnCode save = evtStore()->tds()->record(shallow_jets.first, m_config->sgKeyLargeRJetsTDS(hash));
-        xAOD::TReturnCode saveAux =
+        StatusCode save = evtStore()->tds()->record(shallow_jets.first, m_config->sgKeyLargeRJetsTDS(hash));
+        StatusCode saveAux =
           evtStore()->tds()->record(shallow_jets.second, m_config->sgKeyLargeRJetsTDSAux(hash));
         top::check((save && saveAux), "Failed to store object in TStore");
       }
@@ -525,8 +525,8 @@ namespace top {
         std::pair< xAOD::JetContainer*, xAOD::ShallowAuxContainer* > shallow_jets = xAOD::shallowCopyContainer(
           *calibratedJets);
 
-        xAOD::TReturnCode save = evtStore()->tds()->record(shallow_jets.first, m_config->sgKeyTrackJetsTDS(hash));
-        xAOD::TReturnCode saveAux =
+        StatusCode save = evtStore()->tds()->record(shallow_jets.first, m_config->sgKeyTrackJetsTDS(hash));
+        StatusCode saveAux =
           evtStore()->tds()->record(shallow_jets.second, m_config->sgKeyTrackJetsTDSAux(hash));
         top::check((save && saveAux), "Failed to store object in TStore");
       }
@@ -556,8 +556,8 @@ namespace top {
 
 	std::pair< xAOD::TrackParticleContainer*, xAOD::ShallowAuxContainer* > shallow_tracks = xAOD::shallowCopyContainer(*calibratedTracks);
 
-	xAOD::TReturnCode save = evtStore()->tds()->record(shallow_tracks.first, m_config->sgKeyTracksTDS(hash));
-	xAOD::TReturnCode saveAux =
+	StatusCode save = evtStore()->tds()->record(shallow_tracks.first, m_config->sgKeyTracksTDS(hash));
+	StatusCode saveAux =
           evtStore()->tds()->record(shallow_tracks.second, m_config->sgKeyTracksTDSAux(hash));
 	top::check((save && saveAux), "Failed to store object in TStore");
       }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopEventReconstructionTools/Root/PseudoTopReco.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopEventReconstructionTools/Root/PseudoTopReco.cxx
index 3e22c01e05da8e6e0349f90817374160776f38ca..4b91ee70166353917c59356c14be7db5f713a1d7 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopEventReconstructionTools/Root/PseudoTopReco.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopEventReconstructionTools/Root/PseudoTopReco.cxx
@@ -118,8 +118,8 @@ namespace top {
     }
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(pseudoTop, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(pseudoTopAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(pseudoTop, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(pseudoTopAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
@@ -182,8 +182,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyPseudoTop(0);
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(pseudoTop, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(pseudoTopAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(pseudoTop, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(pseudoTopAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/TopObjectSelection.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/TopObjectSelection.cxx
index bd8121eda75253b004b4d82ed9ea00acade8623c..2430e825e7a9119a554b1dcb0bfec77f6652e589 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/TopObjectSelection.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/TopObjectSelection.cxx
@@ -771,8 +771,8 @@ void TopObjectSelection::applySelectionPreOverlapRemovalJetGhostTracks() {
       // Save to StoreGate / TStore
       std::string outputSGKeyNominalAux = sgKeyNominal + "Aux.";
 
-      xAOD::TReturnCode save = evtStore()->tds()->record(systEventCont, sgKeyNominal);
-      xAOD::TReturnCode saveAux = evtStore()->tds()->record(systEventAuxCont, outputSGKeyNominalAux);
+      StatusCode save = evtStore()->tds()->record(systEventCont, sgKeyNominal);
+      StatusCode saveAux = evtStore()->tds()->record(systEventAuxCont, outputSGKeyNominalAux);
       if (!save || !saveAux) {
         return StatusCode::FAILURE;
       }
@@ -790,8 +790,8 @@ void TopObjectSelection::applySelectionPreOverlapRemovalJetGhostTracks() {
       // Save to StoreGate / TStore
       std::string outputSGKeyAux = sgKey + "Aux.";
 
-      xAOD::TReturnCode save = evtStore()->tds()->record(systEventCont, sgKey);
-      xAOD::TReturnCode saveAux = evtStore()->tds()->record(systEventAuxCont, outputSGKeyAux);
+      StatusCode save = evtStore()->tds()->record(systEventCont, sgKey);
+      StatusCode saveAux = evtStore()->tds()->record(systEventAuxCont, outputSGKeyAux);
       if (!save || !saveAux) {
         return StatusCode::FAILURE;
       }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTTZPartonHistory.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTTZPartonHistory.cxx
index 744ce9d35cd6ccda41d54d0732017cd177d04be7..be9fca578a57f03d4773e1fd21b2950b14baba2c 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTTZPartonHistory.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTTZPartonHistory.cxx
@@ -186,8 +186,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTopPartonHistory();
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(partonCont, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(partonCont, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTbbarPartonHistory.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTbbarPartonHistory.cxx
index ea3121d9b2f797fd35348515e8359e2a66137399..bcecfd2d98648b5a7e0120bfa0fa07234db796f8 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTbbarPartonHistory.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTbbarPartonHistory.cxx
@@ -103,8 +103,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTopPartonHistory();
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(partonCont, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(partonCont, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcThqPartonHistory.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcThqPartonHistory.cxx
index 9b1a51ce9b1445464b4970bf537fa0a8de6fdbc0..eda4e7abb68c3f8e125c8cacb34465a597fdfd24 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcThqPartonHistory.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcThqPartonHistory.cxx
@@ -185,8 +185,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTopPartonHistory();
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(partonCont, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(partonCont, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTopPartonHistory.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTopPartonHistory.cxx
index 5b5b738f314a09d3fd4d611e88f657dff1c1c09b..50dedfd5f245b16406af1084e77957c7b62a77c4 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTopPartonHistory.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTopPartonHistory.cxx
@@ -29,7 +29,7 @@ namespace top {
     }
     
     //we give control of the container to the store, because in this way we are able to retrieve it as a const data vector, see https://twiki.cern.ch/twiki/bin/view/AtlasComputing/DataVector#ConstDataVector
-    xAOD::TReturnCode save = evtStore()->tds()->record(out_cont,out_contName);
+    StatusCode save = evtStore()->tds()->record(out_cont,out_contName);
     if (!save) return StatusCode::FAILURE;
 
     return StatusCode::SUCCESS;
@@ -663,8 +663,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTopPartonHistory();
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(partonCont, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(partonCont, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarGammaPartonHistory.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarGammaPartonHistory.cxx
index dd36186154b3892ab65ec56a6b00c6179a5e6017..c9d6e045ae7d10ea43fc643a8c7872327766d64a 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarGammaPartonHistory.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarGammaPartonHistory.cxx
@@ -389,8 +389,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTopPartonHistory();
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(partonCont.release(), outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont.release(), outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(partonCont.release(), outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(partonAuxCont.release(), outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarLightPartonHistory.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarLightPartonHistory.cxx
index 5cb8f5e5ed755d80bb8bcaef3472899e385b0fb5..b6d427e8842bfe9b4930d931c7dd8a7e0ea8e669 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarLightPartonHistory.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarLightPartonHistory.cxx
@@ -154,8 +154,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTopPartonHistory();
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(partonCont, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(partonCont, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarPartonHistory.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarPartonHistory.cxx
index c2a2272abe6fcf553cae0421b30eafbaff4f3f0a..ac2b582bcc07b39fabad49f11ba8f81e4d1c5937 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarPartonHistory.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTtbarPartonHistory.cxx
@@ -173,8 +173,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTopPartonHistory();
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(partonCont, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(partonCont, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTzqPartonHistory.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTzqPartonHistory.cxx
index f5e8b8ca6582398119e2b0997622bd50d63fe81f..3cf116936da73344ac09ac892c0babb3204d71cd 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTzqPartonHistory.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcTzqPartonHistory.cxx
@@ -197,8 +197,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTopPartonHistory();
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(partonCont, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(partonCont, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcWlvPartonHistory.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcWlvPartonHistory.cxx
index ba9ee65c9fe8189697408a3c18b787ab28f2441a..419a96b177d04c78ec277d7916643f6122776117 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcWlvPartonHistory.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcWlvPartonHistory.cxx
@@ -62,8 +62,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTopPartonHistory();
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(partonCont, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(partonCont, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcWtbPartonHistory.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcWtbPartonHistory.cxx
index 2b87b3cbf03ced2a101e9ff31a103f35b60dc4fd..db1df4f395d1fb5204751b1a96d304682d06e3e0 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcWtbPartonHistory.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopPartons/Root/CalcWtbPartonHistory.cxx
@@ -173,8 +173,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTopPartonHistory();
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(partonCont, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(partonCont, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(partonAuxCont, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/EgammaObjectCollectionMaker.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/EgammaObjectCollectionMaker.cxx
index d681bd8f1597e5a5b92bb4481535f555c603e875..099a6a7450cf93b3e7efce2665c2308b333921df 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/EgammaObjectCollectionMaker.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/EgammaObjectCollectionMaker.cxx
@@ -276,8 +276,8 @@ namespace top {
       std::string outputSGKey = m_config->sgKeyPhotons(systematic.hash());
       std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-      xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-      xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+      StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+      StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
 
       if (!save || !saveAux) {
         return StatusCode::FAILURE;
@@ -435,8 +435,8 @@ namespace top {
       std::string outputSGKey = m_config->sgKeyElectronsStandAlone(systematic.hash());
       std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-      xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-      xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+      StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+      StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
 
       if (!save || !saveAux) {
         return StatusCode::FAILURE;
@@ -487,8 +487,8 @@ namespace top {
       std::string outputSGKey = m_config->sgKeyFwdElectronsStandAlone(systematic.hash());
       std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-      xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-      xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+      StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+      StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
 
       if (!save || !saveAux) {
         return StatusCode::FAILURE;
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/ElectronInJetSubtractionCollectionMaker.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/ElectronInJetSubtractionCollectionMaker.cxx
index 4eb0fdae80ecb6188dd40bae76f76d6e2d9b77ad..8de2ec5c33d035704b7727757c1bda9503c17a96 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/ElectronInJetSubtractionCollectionMaker.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/ElectronInJetSubtractionCollectionMaker.cxx
@@ -69,8 +69,8 @@ namespace top {
       std::string outputElectronsSGKey = m_config->sgKeyElectrons(currentSystematic);
       std::string outputElectronsSGKeyAux = outputElectronsSGKey + "Aux.";
 
-      xAOD::TReturnCode saveElectrons = evtStore()->tds()->record(shallow_electrons.first, outputElectronsSGKey);
-      xAOD::TReturnCode saveElectronsAux = evtStore()->tds()->record(shallow_electrons.second, outputElectronsSGKeyAux);
+      StatusCode saveElectrons = evtStore()->tds()->record(shallow_electrons.first, outputElectronsSGKey);
+      StatusCode saveElectronsAux = evtStore()->tds()->record(shallow_electrons.second, outputElectronsSGKeyAux);
       if (!saveElectrons || !saveElectronsAux) {
         return StatusCode::FAILURE;
       }
@@ -79,8 +79,8 @@ namespace top {
       std::string outputJetsSGKey = m_config->sgKeyJets(currentSystematic, false);
       std::string outputJetsSGKeyAux = outputJetsSGKey + "Aux.";
 
-      xAOD::TReturnCode saveJets = evtStore()->tds()->record(shallow_jets.first, outputJetsSGKey);
-      xAOD::TReturnCode saveJetsAux = evtStore()->tds()->record(shallow_jets.second, outputJetsSGKeyAux);
+      StatusCode saveJets = evtStore()->tds()->record(shallow_jets.first, outputJetsSGKey);
+      StatusCode saveJetsAux = evtStore()->tds()->record(shallow_jets.second, outputJetsSGKeyAux);
       if (!saveJets || !saveJetsAux) {
         return StatusCode::FAILURE;
       }
@@ -103,8 +103,8 @@ namespace top {
         std::string outputJetsLooseSGKey = m_config->sgKeyJets(currentSystematic, m_doLooseCuts);
         std::string outputJetsLooseSGKeyAux = outputJetsLooseSGKey + "Aux.";
 
-        xAOD::TReturnCode saveJetsLoose = evtStore()->tds()->record(shallow_jetsLoose.first, outputJetsLooseSGKey);
-        xAOD::TReturnCode saveJetsLooseAux =
+        StatusCode saveJetsLoose = evtStore()->tds()->record(shallow_jetsLoose.first, outputJetsLooseSGKey);
+        StatusCode saveJetsLooseAux =
           evtStore()->tds()->record(shallow_jetsLoose.second, outputJetsLooseSGKeyAux);
         if (!saveJetsLoose || !saveJetsLooseAux) {
           return StatusCode::FAILURE;
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/JetObjectCollectionMaker.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/JetObjectCollectionMaker.cxx
index c2463554f53d6db2c4ceb2d5cefffe96a627ced7..811c9eca48b7aa891ec06d6ea142b4bf452c736f 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/JetObjectCollectionMaker.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/JetObjectCollectionMaker.cxx
@@ -510,8 +510,8 @@ namespace top {
 
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
@@ -624,8 +624,8 @@ namespace top {
         }
         std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-        xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-        xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+        StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+        StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
         if (!save || !saveAux) {
           return StatusCode::FAILURE;
         }
@@ -659,8 +659,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTrackJets(m_config->nominalHashValue());
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/MissingETObjectCollectionMaker.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/MissingETObjectCollectionMaker.cxx
index 0848b83ad5762a367066868328f5072f2a3c9eb7..fbd0bd1ee91543c98e45c4e998afd1dbe921557f 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/MissingETObjectCollectionMaker.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/MissingETObjectCollectionMaker.cxx
@@ -312,10 +312,10 @@ namespace top {
     outputSGKey+=outputContainerSuffix;
     const std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(new_met_container, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(new_met_aux_container, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(new_met_container, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(new_met_aux_container, outputSGKeyAux);
 
-    if (!save || !saveAux) {
+    if (save.isFailure() || saveAux.isFailure()) {
       return StatusCode::FAILURE;
     }
 
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/MuonObjectCollectionMaker.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/MuonObjectCollectionMaker.cxx
index 54744c284b2040661b4d2a7e99cb9050bd806a52..896cdc2cce1556a0a5aa184e347f81f8b3609eb0 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/MuonObjectCollectionMaker.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/MuonObjectCollectionMaker.cxx
@@ -332,8 +332,8 @@ namespace top {
       std::string outputSGKey = m_config->sgKeyMuons(systematic.hash());
       std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-      xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-      xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+      StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+      StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
       if (!save || !saveAux) {
         return StatusCode::FAILURE;
       }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/SoftMuonObjectCollectionMaker.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/SoftMuonObjectCollectionMaker.cxx
index c9c3ff5a70fa0fc9813c0171149955f8a63f7522..75774cc353effb05cdfac56469415220aa8f3530 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/SoftMuonObjectCollectionMaker.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/SoftMuonObjectCollectionMaker.cxx
@@ -130,8 +130,8 @@ namespace top {
       std::string outputSGKey = m_config->sgKeySoftMuons(systematic.hash());
       std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-      xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-      xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+      StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+      StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
       if (!save || !saveAux) {
         return StatusCode::FAILURE;
       }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/TauObjectCollectionMaker.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/TauObjectCollectionMaker.cxx
index d1407b95d542f0bb43e62c117ea0f691fc4acef2..04796dc8f4c8b788fcb8391b669183a8e13f5327 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/TauObjectCollectionMaker.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/TauObjectCollectionMaker.cxx
@@ -96,8 +96,8 @@ namespace top {
       std::string outputSGKey = m_config->sgKeyTaus(systematic.hash());
       std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-      xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-      xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+      StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+      StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
       if (!save || !saveAux) {
         return StatusCode::FAILURE;
       }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/TrackSystematicsMaker.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/TrackSystematicsMaker.cxx
index 57f7e33281aea284d42f5cefc1f6676cc7b2f756..02b4b00d84f4e3eae006e395c952a307074d0ae4 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/TrackSystematicsMaker.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopSystematicObjectMaker/Root/TrackSystematicsMaker.cxx
@@ -132,8 +132,8 @@ namespace top {
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
 
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
@@ -171,8 +171,8 @@ namespace top {
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
  
-    xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
     
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
@@ -208,8 +208,8 @@ namespace top {
     std::string outputSGKey = m_config->sgKeyTracks(syst.hash());
     std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-    xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-    xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+    StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+    StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
 
     if (!save || !saveAux) {
       return StatusCode::FAILURE;
@@ -234,8 +234,8 @@ namespace top {
       std::string outputSGKey = m_config->sgKeyTracks(m_nominalSystematicSet.hash());
       std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-      xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-      xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+      StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+      StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
 
       if (!save || !saveAux) {
 	return StatusCode::FAILURE;
@@ -262,8 +262,8 @@ namespace top {
       std::string outputSGKey = m_config->sgKeyTracks(m_nominalSystematicSet.hash());
       std::string outputSGKeyAux = outputSGKey + "Aux.";
 
-      xAOD::TReturnCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
-      xAOD::TReturnCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
+      StatusCode save = evtStore()->tds()->record(shallow_xaod_copy.first, outputSGKey);
+      StatusCode saveAux = evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
 
       if (!save || !saveAux) {
 	return StatusCode::FAILURE;
diff --git a/Reconstruction/MET/METReconstruction/test/ut_METAssociator.cxx b/Reconstruction/MET/METReconstruction/test/ut_METAssociator.cxx
index 84483e846e7ed100baa474981ba9de660cd606e3..86959dad63838863a26fe9ac81fa311404dc2aed 100644
--- a/Reconstruction/MET/METReconstruction/test/ut_METAssociator.cxx
+++ b/Reconstruction/MET/METReconstruction/test/ut_METAssociator.cxx
@@ -33,8 +33,8 @@ struct globalxAODSetup
   globalxAODSetup() {
     xAOD::Init() ;
     // CP::CorrectionCode::enableFailure();
-    // StatusCode::enableFailure();                                                                                                                      // CP::SystematicCode::enableFailure();
-    // xAOD::TReturnCode::enableFailure();
+    // StatusCode::enableFailure();
+    // CP::SystematicCode::enableFailure();
 
     TString const fileName = "/afs/cern.ch/work/m/maklein/public/mc14_13TeV.110401.PowhegPythia_P2012_ttbar_nonallhad.merge.AOD.e2928_s1982_s2008_r6114_r6104_tid04859512_00/AOD.04859512._000001.pool.root";
 
diff --git a/Reconstruction/MET/METReconstruction/test/ut_METElectronAssociator.cxx b/Reconstruction/MET/METReconstruction/test/ut_METElectronAssociator.cxx
index 1c2971c31897f81cb99efb7c455c941d4a98b19b..e44d02136480032d8e44bc100cafa93ae411f03c 100644
--- a/Reconstruction/MET/METReconstruction/test/ut_METElectronAssociator.cxx
+++ b/Reconstruction/MET/METReconstruction/test/ut_METElectronAssociator.cxx
@@ -41,8 +41,8 @@ struct globalxAODSetup
   globalxAODSetup() {
     xAOD::Init() ;
     // CP::CorrectionCode::enableFailure();
-    // StatusCode::enableFailure();                                                                                                                      // CP::SystematicCode::enableFailure();
-    // xAOD::TReturnCode::enableFailure();
+    // StatusCode::enableFailure();
+    // CP::SystematicCode::enableFailure();
 
     TString const fileName = "/afs/cern.ch/work/m/maklein/public/mc14_13TeV.110401.PowhegPythia_P2012_ttbar_nonallhad.merge.AOD.e2928_s1982_s2008_r6114_r6104_tid04859512_00/AOD.04859512._000001.pool.root";
 //"/afs/cern.ch/work/r/rsmith/public/METUtilities_testfiles/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.AOD.e3099_s1982_s1964_r6006_tid04628718_00/AOD.04628718._000158.pool.root.1";
diff --git a/Reconstruction/MET/METUtilities/test/gt_metMaker.cxx b/Reconstruction/MET/METUtilities/test/gt_metMaker.cxx
index 5c27af98941c8afc10ac07bc2a83a51734801ca1..2d8c3db24a581fbfcb2013e21c628ea442d66deb 100644
--- a/Reconstruction/MET/METUtilities/test/gt_metMaker.cxx
+++ b/Reconstruction/MET/METUtilities/test/gt_metMaker.cxx
@@ -128,7 +128,6 @@ namespace met {
 //       CP::CorrectionCode::enableFailure();
 //       CP::SystematicCode::enableFailure();
 //       StatusCode::enableFailure();
-//       TReturnCode::enableFailure();
 // #else
 //       app = POOL::Init(); //important to do this first!
 // #endif
diff --git a/Reconstruction/MET/METUtilities/test/gt_metSystematicsTool.cxx b/Reconstruction/MET/METUtilities/test/gt_metSystematicsTool.cxx
index f0fcfaabf67056e28cd8ebcabb48565b5a3cdac3..928ddf3952c09488a42805e90cbbf050289cef18 100644
--- a/Reconstruction/MET/METUtilities/test/gt_metSystematicsTool.cxx
+++ b/Reconstruction/MET/METUtilities/test/gt_metSystematicsTool.cxx
@@ -436,7 +436,6 @@ namespace met {
 //       CP::CorrectionCode::enableFailure();
 //       CP::SystematicCode::enableFailure();
 //       StatusCode::enableFailure();
-//       TReturnCode::enableFailure();
 // #else
 //       app = POOL::Init(); //important to do this first!
 // #endif
diff --git a/Reconstruction/MET/METUtilities/util/example_METMaker_METSystematicsTool.cxx b/Reconstruction/MET/METUtilities/util/example_METMaker_METSystematicsTool.cxx
index d0f753c3d7c2ad8174936becfe64ffb9acc56558..67f2cf00043250b24726870c8b9fe78f79c19b23 100644
--- a/Reconstruction/MET/METUtilities/util/example_METMaker_METSystematicsTool.cxx
+++ b/Reconstruction/MET/METUtilities/util/example_METMaker_METSystematicsTool.cxx
@@ -67,7 +67,6 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl
   CP::CorrectionCode::enableFailure();
   CP::SystematicCode::enableFailure();
   StatusCode::enableFailure();
-  xAOD::TReturnCode::enableFailure();
 #else
   IAppMgrUI* app = POOL::Init(); //important to do this first!
 #endif
diff --git a/Reconstruction/MET/METUtilities/util/example_METMaker_advanced.cxx b/Reconstruction/MET/METUtilities/util/example_METMaker_advanced.cxx
index 33e2574eb49abb839039de762ed53fc35efef930..a8894f91094d1c7f7f2eea156d57d793a6cb5a92 100644
--- a/Reconstruction/MET/METUtilities/util/example_METMaker_advanced.cxx
+++ b/Reconstruction/MET/METUtilities/util/example_METMaker_advanced.cxx
@@ -61,7 +61,6 @@ int main( int argc, char* argv[] ){std::cout << __PRETTY_FUNCTION__ << std::endl
   //  CP::CorrectionCode::enableFailure();
   //  CP::SystematicCode::enableFailure();
   StatusCode::enableFailure();
-  xAOD::TReturnCode::enableFailure();
   xAOD::Init() ;
 #else
   IAppMgrUI* app = POOL::Init(); //important to do this first!
diff --git a/Reconstruction/MET/METUtilities/util/example_rebuildTrackMET.cxx b/Reconstruction/MET/METUtilities/util/example_rebuildTrackMET.cxx
index 78d20550210c2d9e4f67b8821118cb939d211d83..f07353acff7c90fb23647fe6b24eedab554418f4 100644
--- a/Reconstruction/MET/METUtilities/util/example_rebuildTrackMET.cxx
+++ b/Reconstruction/MET/METUtilities/util/example_rebuildTrackMET.cxx
@@ -68,7 +68,6 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl
   CP::CorrectionCode::enableFailure();
   CP::SystematicCode::enableFailure();
   StatusCode::enableFailure();
-  xAOD::TReturnCode::enableFailure();
 #else
   IAppMgrUI* app = POOL::Init(); //important to do this first!
 #endif