From ac4c041994ce3a5d9bc8d3d517d5ec622761a207 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 25 Feb 2019 11:45:27 +0100
Subject: [PATCH] InDet ByteStreamCnv: Remove usage of "extern"
 ByteStream_StorageType

- add `override`
- remove unused retrieves of `ChronoStatSvc`
---
 .../BCM_RawContByteStreamCnv.h                | 20 ++++------------
 .../src/BCM_RawContByteStreamCnv.cxx          | 21 ++++++++---------
 .../src/PixelRawContByteStreamCnv.cxx         | 23 ++++++++-----------
 .../src/PixelRawContByteStreamCnv.h           | 19 ++++-----------
 .../src/SCTRawContByteStreamCnv.cxx           |  4 ++--
 .../src/SCTRawContByteStreamCnv.h             | 11 ++++-----
 .../src/TRTRawContByteStreamCnv.cxx           |  7 +++---
 .../src/TRTRawContByteStreamCnv.h             | 16 ++++++-------
 8 files changed, 46 insertions(+), 75 deletions(-)

diff --git a/InnerDetector/InDetEventCnv/BCM_RawDataByteStreamCnv/BCM_RawDataByteStreamCnv/BCM_RawContByteStreamCnv.h b/InnerDetector/InDetEventCnv/BCM_RawDataByteStreamCnv/BCM_RawDataByteStreamCnv/BCM_RawContByteStreamCnv.h
index 6d011a9beba..6ada65911d9 100644
--- a/InnerDetector/InDetEventCnv/BCM_RawDataByteStreamCnv/BCM_RawDataByteStreamCnv/BCM_RawContByteStreamCnv.h
+++ b/InnerDetector/InDetEventCnv/BCM_RawDataByteStreamCnv/BCM_RawDataByteStreamCnv/BCM_RawContByteStreamCnv.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -27,10 +27,6 @@
 class BCM_RawContByteStreamTool;
 class IByteStreamEventAccess;
 class StoreGateSvc;
-class IChronoStatSvc;
-
-// Externals 
-extern long ByteStream_StorageType;
 
 class BCM_RawContByteStreamCnv: public Converter {
 
@@ -40,18 +36,14 @@ class BCM_RawContByteStreamCnv: public Converter {
 
   BCM_RawContByteStreamCnv(ISvcLocator* svcloc);
 
-  virtual StatusCode initialize();
+  virtual StatusCode initialize() override;
 
   // create the RawEvent fragments for BCM
-  virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr);
+  virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override;
 
   // Storage type and class ID
-  virtual long repSvcType() const { 
-    return ByteStream_StorageType;
-  }
-  static long storageType() {
-    return ByteStream_StorageType;
-  }
+  virtual long repSvcType() const override { return i_repSvcType(); }
+  static long storageType();
   static const CLID& classID();
 
   //Declaring the Message method for further use
@@ -68,8 +60,6 @@ private:
 
   StoreGateSvc* m_StoreGate;
 
-  IChronoStatSvc* m_ChronoStat;
-
   //Declaring private message stream member.
   mutable Athena::MsgStreamMember m_msg;
 
diff --git a/InnerDetector/InDetEventCnv/BCM_RawDataByteStreamCnv/src/BCM_RawContByteStreamCnv.cxx b/InnerDetector/InDetEventCnv/BCM_RawDataByteStreamCnv/src/BCM_RawContByteStreamCnv.cxx
index 22ee960b07c..5397df6853a 100644
--- a/InnerDetector/InDetEventCnv/BCM_RawDataByteStreamCnv/src/BCM_RawContByteStreamCnv.cxx
+++ b/InnerDetector/InDetEventCnv/BCM_RawDataByteStreamCnv/src/BCM_RawContByteStreamCnv.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -18,7 +18,6 @@
 #include "BCM_RawDataByteStreamCnv/BCM_RawContByteStreamTool.h"
 #include "ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h"
 #include "StoreGate/StoreGate.h"
-#include "GaudiKernel/IChronoStatSvc.h"
 
 #include "ByteStreamCnvSvcBase/ByteStreamAddress.h" 
 #include "InDetBCM_RawData/InDetBCM_RawDataCLASS_DEF.h"
@@ -26,12 +25,11 @@
 ////////////////////////
 // constructor
 ////////////////////////
-BCM_RawContByteStreamCnv::BCM_RawContByteStreamCnv(ISvcLocator* svcloc):Converter(ByteStream_StorageType, classID(),svcloc),
+BCM_RawContByteStreamCnv::BCM_RawContByteStreamCnv(ISvcLocator* svcloc):Converter(storageType(), classID(),svcloc),
   m_BCMRawContBSTool{},
   m_ByteStreamEventAccess{},
-  m_StoreGate{},
-  m_ChronoStat{} {
-  //nop
+  m_StoreGate{}
+{
 }
 
 // ////////////////////////
@@ -70,12 +68,7 @@ StatusCode BCM_RawContByteStreamCnv::initialize() {
     return StatusCode::FAILURE;
   }
 
-  StatusCode scChrono =serviceLocator()->service("ChronoStatSvc",m_ChronoStat );
-  if (!scChrono.isSuccess()) {
-    if (msgLevel(MSG::ERROR)) msg(MSG::ERROR) << "Cannot retrieve ChronoStatSvc" << endmsg;
-  }
-
-  return StatusCode::SUCCESS; 
+  return StatusCode::SUCCESS;
 }
 
 ////////////////////////
@@ -85,6 +78,10 @@ const CLID& BCM_RawContByteStreamCnv::classID() {
   return ClassID_traits<BCM_RDO_Container>::ID();
 }
 
+long BCM_RawContByteStreamCnv::storageType() {
+  return ByteStreamAddress::storageType();
+}
+
 ////////////////////////
 // createRep() - convert BCM_RawData in the container into ByteStream
 ////////////////////////
diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawContByteStreamCnv.cxx b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawContByteStreamCnv.cxx
index fc638f5398b..060f913598d 100644
--- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawContByteStreamCnv.cxx
+++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawContByteStreamCnv.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -22,7 +22,6 @@
 #include "PixelRawContByteStreamTool.h"
 #include "ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h"
 #include "InDetRawData/PixelRDORawData.h"
-#include "GaudiKernel/IChronoStatSvc.h"
 
 //#define PIXEL_DEBUG
 
@@ -31,11 +30,10 @@
 // constructor
 ////////////////////////
 PixelRawContByteStreamCnv::PixelRawContByteStreamCnv(ISvcLocator* svcloc) : 
-  Converter(ByteStream_StorageType, classID(),svcloc),
-  m_PixelRawContBSTool(NULL),
-  m_ByteStreamEventAccess(NULL),
-  m_StoreGate(NULL),
-  m_ChronoStat(NULL),
+  Converter(storageType(), classID(),svcloc),
+  m_PixelRawContBSTool(nullptr),
+  m_ByteStreamEventAccess(nullptr),
+  m_StoreGate(nullptr),
   m_log(msgSvc(), "PixelRawContByteStreamCnv")
 {}
 
@@ -78,12 +76,7 @@ StatusCode PixelRawContByteStreamCnv::initialize() {
     return StatusCode::FAILURE;
   } 
 
-  StatusCode scChrono =serviceLocator()->service("ChronoStatSvc",m_ChronoStat );
-  if (!scChrono.isSuccess()) {
-    m_log << MSG::ERROR << "Cannot retrieve ChronoStatSvc" << endmsg;
-  }
-
-  return StatusCode::SUCCESS; 
+  return StatusCode::SUCCESS;
 }
 
 ////////////////////////
@@ -95,6 +88,10 @@ const CLID& PixelRawContByteStreamCnv::classID() {
 
 }
 
+long PixelRawContByteStreamCnv::storageType()
+{
+  return ByteStreamAddress::storageType();
+}
 
 ////////////////////////
 // createRep() - convert Pixel_RDO in the container into ByteStream
diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawContByteStreamCnv.h b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawContByteStreamCnv.h
index b21373458e2..c186c5ec4ed 100644
--- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawContByteStreamCnv.h
+++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawContByteStreamCnv.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -31,14 +31,10 @@
 #include "GaudiKernel/MsgStream.h"
 #include "StoreGate/StoreGate.h"
 
-// Externals 
-extern long ByteStream_StorageType;
-
 class ByteStreamAddress;
 class PixelRawContByteStreamTool;
 class IByteStreamEventAccess;
 class PixelRDORawData;
-class IChronoStatSvc;
 
 
 class PixelRawContByteStreamCnv: public Converter {
@@ -48,18 +44,14 @@ class PixelRawContByteStreamCnv: public Converter {
 
   PixelRawContByteStreamCnv(ISvcLocator* svcloc);
 
-  virtual StatusCode initialize();
+  virtual StatusCode initialize() override;
 
   //! this creates the RawEvent fragments for Pixel
-  virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr);
+  virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override;
 
   /// Storage type and class ID
-  virtual long repSvcType() const { 
-    return ByteStream_StorageType;
-  }
-  static long storageType() {
-    return ByteStream_StorageType;
-  }
+  virtual long repSvcType() const override { return i_repSvcType(); }
+  static long storageType();
   static const CLID& classID();
 
 private: 
@@ -70,7 +62,6 @@ private:
 
   StoreGateSvc* m_StoreGate;
 
-  IChronoStatSvc * m_ChronoStat;
   MsgStream m_log;
 
 };
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamCnv.cxx b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamCnv.cxx
index 4690f307e95..bfcd264409f 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamCnv.cxx
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamCnv.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "SCTRawContByteStreamCnv.h"
@@ -18,7 +18,7 @@
 // Constructor
 
 SCTRawContByteStreamCnv::SCTRawContByteStreamCnv(ISvcLocator* svcLoc) :
-  Converter(ByteStream_StorageType, classID(),svcLoc),
+  Converter(storageType(), classID(),svcLoc),
   m_rawContByteStreamTool{"SCTRawContByteStreamTool"},
   m_byteStreamEventAccess{"ByteStreamCnvSvc", "SCTRawContByteStreamCnv"},
   m_log{msgSvc(), "SCTRawContByteStreamCnv"}
diff --git a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamCnv.h b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamCnv.h
index ed047e772bc..e76034ace69 100644
--- a/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamCnv.h
+++ b/InnerDetector/InDetEventCnv/SCT_RawDataByteStreamCnv/src/SCTRawContByteStreamCnv.h
@@ -1,11 +1,12 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef SCT_RAWDATABYTESTREAMCNV_SCTRAWCONTBYTESTREAMCNV_H
 #define SCT_RAWDATABYTESTREAMCNV_SCTRAWCONTBYTESTREAMCNV_H
 
 #include "ByteStreamCnvSvcBase/IByteStreamEventAccess.h"
+#include "ByteStreamCnvSvcBase/ByteStreamAddress.h"
 #include "InDetRawData/InDetRawDataCLASS_DEF.h"
 
 #include "GaudiKernel/Converter.h"
@@ -15,9 +16,7 @@ class DataObject;
 class ISCTRawContByteStreamTool;
 class MsgStream;
 
-extern long ByteStream_StorageType;
-
-/** 
+/**
  * @class SCTRawContByteStreamCnv
  *
  * @brief Converter for writing ByteStream from SCT Raw Data
@@ -41,8 +40,8 @@ class SCTRawContByteStreamCnv : public Converter
   virtual StatusCode initialize() override;
   
   /** Storage type and class ID */
-  virtual long repSvcType() const override { return ByteStream_StorageType; }
-  static long storageType() { return ByteStream_StorageType; } 
+  virtual long repSvcType() const override { return i_repSvcType(); }
+  static long storageType() { return ByteStreamAddress::storageType(); }
   static const CLID& classID() { return ClassID_traits<SCT_RDO_Container>::ID(); }
   
   /** createObj method (not used!) */
diff --git a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRTRawContByteStreamCnv.cxx b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRTRawContByteStreamCnv.cxx
index c10f80709c2..76690246552 100644
--- a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRTRawContByteStreamCnv.cxx
+++ b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRTRawContByteStreamCnv.cxx
@@ -1,11 +1,10 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TRTRawContByteStreamCnv.h"
 
-#include "ByteStreamCnvSvcBase/IByteStreamEventAccess.h" 
-#include "ByteStreamCnvSvcBase/ByteStreamAddress.h" 
+#include "ByteStreamCnvSvcBase/IByteStreamEventAccess.h"
 #include "ByteStreamData/RawEvent.h" 
 #include "GaudiKernel/DataObject.h"
 #include "GaudiKernel/MsgStream.h"
@@ -14,7 +13,7 @@
 // constructor
 
 TRTRawContByteStreamCnv::TRTRawContByteStreamCnv(ISvcLocator* svcloc) :
-    Converter(ByteStream_StorageType, classID(),svcloc),
+    Converter(storageType(), classID(),svcloc),
     m_tool                 ("TRTRawContByteStreamTool"),                  // init tool handles
     m_byteStreamEventAccess("ByteStreamCnvSvc","TRTRawContByteStreamCnv") // init service handle
 {}
diff --git a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRTRawContByteStreamCnv.h b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRTRawContByteStreamCnv.h
index 46235c7c4f5..a4e916183b2 100644
--- a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRTRawContByteStreamCnv.h
+++ b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRTRawContByteStreamCnv.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRT_RAWDATABYTESTREAMCNV_TRTRAWCONTRAWEVENTCNV_H
@@ -10,6 +10,7 @@
 #include "GaudiKernel/ServiceHandle.h"
 #include "InDetRawData/InDetRawDataCLASS_DEF.h"
 #include "ByteStreamCnvSvcBase/IByteStreamEventAccess.h" 
+#include "ByteStreamCnvSvcBase/ByteStreamAddress.h"
 
 #include "TRT_RawDataByteStreamCnv/ITRTRawContByteStreamTool.h"
 
@@ -21,9 +22,6 @@ class TRTRawContByteStreamTool ;
 // Abstract factory to create the converter
 template <class TYPE> class CnvFactory;
 
-// Externals 
-extern long ByteStream_StorageType;
-
 // the converter for writing BS from TRT Raw Data
 
 class TRTRawContByteStreamCnv: public Converter {
@@ -33,19 +31,19 @@ class TRTRawContByteStreamCnv: public Converter {
   typedef TRT_RDO_Container       TRTRawContainer; 
 
   //! Storage type and class ID
-  virtual long repSvcType() const { return ByteStream_StorageType;}
-  static  long storageType() { return ByteStream_StorageType; }
+  virtual long repSvcType() const override { return i_repSvcType(); }
+  static  long storageType()      { return ByteStreamAddress::storageType(); }
   static const CLID& classID()    { return ClassID_traits<TRTRawContainer>::ID(); }
   
   //! initialize
-  virtual StatusCode initialize();
+  virtual StatusCode initialize() override;
   
   //! create Obj is not used !
-  virtual StatusCode createObj(IOpaqueAddress* /* pAddr */, DataObject*& /* pObj */)
+  virtual StatusCode createObj(IOpaqueAddress* /* pAddr */, DataObject*& /* pObj */) override
     { return StatusCode::FAILURE;}
 
   //! this creates the RawEvent fragments for the TRT
-  virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr);
+  virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override;
 
 private: 
   // for BS infrastructure
-- 
GitLab