diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.cxx index 2a15a702a685c7780460eabe9e77c8c51ccfa134..438c43c7e5730db20617e606e3fb70bbacf8a020 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.cxx @@ -31,8 +31,7 @@ namespace LVL1BS { CpByteStreamCnv::CpByteStreamCnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("CpByteStreamCnv"), + : AthConstConverter( storageType(), classID(), svcloc, "CpByteStreamCnv" ), m_tool("LVL1BS::CpByteStreamTool/CpByteStreamTool") { } @@ -66,12 +65,12 @@ StatusCode CpByteStreamCnv::initialize() // createRep should create the bytestream from RDOs. -StatusCode CpByteStreamCnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode CpByteStreamCnv::createRepConst( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { LVL1::CPBSCollection* cp = 0; if( !SG::fromStorable( pObj, cp ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to CPBSCollection"; + ATH_MSG_ERROR( " Cannot cast to CPBSCollection" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.h index 3552b649bfdc3d466a771904e4a7f8cb539d4e66..c0c87886438cb6c469e86e6cdfbd3cf545c7a609 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamCnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -31,7 +30,7 @@ class CpByteStreamTool; * @author Peter Faulkner */ -class CpByteStreamCnv: public Converter { +class CpByteStreamCnv: public AthConstConverter { friend class CnvFactory<CpByteStreamCnv>; @@ -41,22 +40,18 @@ protected: public: - ~CpByteStreamCnv(); + virtual ~CpByteStreamCnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create ByteStream from Cp Container - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::CpByteStreamTool> m_tool; }; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.cxx index 5ebacd113ad9e4864661681ea5a1d248c1fd9197..361e0ca32debcc556427700fcb53408a629b900d 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.cxx @@ -31,8 +31,7 @@ namespace LVL1BS { CpByteStreamV1Cnv::CpByteStreamV1Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("CpByteStreamV1Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "CpByteStreamV1Cnv" ), m_tool("LVL1BS::CpByteStreamV1Tool/CpByteStreamV1Tool") { } @@ -66,12 +65,12 @@ StatusCode CpByteStreamV1Cnv::initialize() // createRep should create the bytestream from RDOs. -StatusCode CpByteStreamV1Cnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode CpByteStreamV1Cnv::createRepConst( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { LVL1::CPBSCollectionV1* cp = 0; if( !SG::fromStorable( pObj, cp ) ) { - REPORT_ERROR (StatusCode::FAILURE) << "Cannot cast to CPBSCollectionV1"; + ATH_MSG_ERROR( "Cannot cast to CPBSCollectionV1" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.h index c1806828a515022313042bdd6f6d49fcd9b78068..d9d426b1f38c65401f658bad42f468c92de26d4d 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV1Cnv.h @@ -7,8 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -30,26 +30,22 @@ class CpByteStreamV1Tool; * @author Peter Faulkner */ -class CpByteStreamV1Cnv: public Converter { +class CpByteStreamV1Cnv: public AthConstConverter { public: CpByteStreamV1Cnv(ISvcLocator* svcloc); - ~CpByteStreamV1Cnv(); + virtual ~CpByteStreamV1Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create ByteStream from Cp Container - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::CpByteStreamV1Tool> m_tool; }; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.cxx index 397f75c8e627eb55b43c068c2fdd75e746779a06..a96e47dd71a2afbde837ce96c4e317dc47ba55a3 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.cxx @@ -31,8 +31,7 @@ namespace LVL1BS { CpByteStreamV2Cnv::CpByteStreamV2Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("CpByteStreamV2Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "CpByteStreamV2Cnv" ), m_tool("LVL1BS::CpByteStreamV2Tool/CpByteStreamV2Tool") { } @@ -67,12 +66,12 @@ StatusCode CpByteStreamV2Cnv::initialize() // createRep should create the bytestream from RDOs. -StatusCode CpByteStreamV2Cnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode CpByteStreamV2Cnv::createRepConst ( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { LVL1::CPBSCollectionV2* cp = 0; if( !SG::fromStorable( pObj, cp ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to CPBSCollectionV2"; + ATH_MSG_ERROR( " Cannot cast to CPBSCollectionV2" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.h index 32d30a799defd1f10f1695ad4f11e6de3433e120..bba45f19c153a12011fa52f5694cf8bb764cb6fb 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpByteStreamV2Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -31,26 +30,22 @@ class CpByteStreamV2Tool; * @author Peter Faulkner */ -class CpByteStreamV2Cnv: public Converter { +class CpByteStreamV2Cnv: public AthConstConverter { public: CpByteStreamV2Cnv(ISvcLocator* svcloc); - ~CpByteStreamV2Cnv(); + virtual ~CpByteStreamV2Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create ByteStream from Cp Container - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst (DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::CpByteStreamV2Tool> m_tool; }; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1Cnv.h index 8f3598b39740839c08402e62c460892f4e1a74db..d5c3b28f732f7dc65ff6e1009ebff651695678fe 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1Cnv.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGT1CALOBYTESTREAM_CPREADBYTESTREAMV1CNV_H @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -32,34 +31,27 @@ class CpByteStreamV1Tool; */ template <typename Container> -class CpReadByteStreamV1Cnv: public Converter { +class CpReadByteStreamV1Cnv: public AthConstConverter { public: CpReadByteStreamV1Cnv(ISvcLocator* svcloc); - ~CpReadByteStreamV1Cnv(); + virtual ~CpReadByteStreamV1Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create Container from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::CpByteStreamV1Tool> m_tool; /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1Cnv.icc b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1Cnv.icc index ff4203ca93e128f96d168b4317a7a61557ba1b4f..5b25635ee662f8d0df580f167ae5a2155e90dfb3 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1Cnv.icc +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1Cnv.icc @@ -28,10 +28,9 @@ namespace LVL1BS { template <typename Container> CpReadByteStreamV1Cnv<Container>::CpReadByteStreamV1Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("CpReadByteStreamV1Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "CpReadByteStreamV1Cnv" ), m_tool("LVL1BS::CpByteStreamV1Tool/CpByteStreamV1Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -60,8 +59,6 @@ long CpReadByteStreamV1Cnv<Container>::storageType() template <typename Container> StatusCode CpReadByteStreamV1Cnv<Container>::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool.retrieve() ); ATH_CHECK( m_robDataProvider.retrieve() ); @@ -72,21 +69,19 @@ StatusCode CpReadByteStreamV1Cnv<Container>::initialize() // createObj should create the RDO from bytestream. template <typename Container> -StatusCode CpReadByteStreamV1Cnv<Container>::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode CpReadByteStreamV1Cnv<Container>::createObjConst ( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID(m_tool->sourceIDs()); @@ -97,9 +92,8 @@ StatusCode CpReadByteStreamV1Cnv<Container>::createObj( IOpaqueAddress* pAddr, // size check auto collection = std::make_unique<Container>(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags.size() ); + if (robFrags.size() == 0) { pObj = SG::asStorable(std::move(collection)) ; return StatusCode::SUCCESS; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.cxx index f3215f902495cd6f8f1b854266e14a56ff253aee..b6199998767947fc4d81834a0f0ab59bdabf2c1d 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.cxx @@ -34,12 +34,10 @@ namespace LVL1BS { CpReadByteStreamV1V2Cnv::CpReadByteStreamV1V2Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("CpReadByteStreamV1V2Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "CpReadByteStreamV1V2Cnv" ), m_tool1("LVL1BS::CpByteStreamV1Tool/CpByteStreamV1Tool"), m_tool2("LVL1BS::CpByteStreamV2Tool/CpByteStreamV2Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -64,8 +62,6 @@ long CpReadByteStreamV1V2Cnv::storageType() StatusCode CpReadByteStreamV1V2Cnv::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool1.retrieve() ); ATH_CHECK( m_tool2.retrieve() ); @@ -76,21 +72,19 @@ StatusCode CpReadByteStreamV1V2Cnv::initialize() // createObj should create the RDO from bytestream. -StatusCode CpReadByteStreamV1V2Cnv::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode CpReadByteStreamV1V2Cnv::createObjConst( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID1(m_tool1->sourceIDs()); @@ -104,10 +98,9 @@ StatusCode CpReadByteStreamV1V2Cnv::createObj( IOpaqueAddress* pAddr, // size check auto towerCollection = std::make_unique<DataVector<LVL1::CPMTower> >(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags1.size() - << ", " << robFrags2.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags1.size() + << ", " << robFrags2.size() ); + if (robFrags1.size() == 0 && robFrags2.size() == 0) { pObj = SG::asStorable(std::move(towerCollection)) ; return StatusCode::SUCCESS; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.h index 7b8a4308ff8cc48df19713db4c55f5ec740850c3..cd251041b12da2624f894e89afc85475203b2c2e 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV1V2Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -35,27 +34,23 @@ class CpByteStreamV2Tool; * @author Peter Faulkner */ -class CpReadByteStreamV1V2Cnv: public Converter { +class CpReadByteStreamV1V2Cnv: public AthConstConverter { public: CpReadByteStreamV1V2Cnv(ISvcLocator* svcloc); - ~CpReadByteStreamV1V2Cnv(); + virtual ~CpReadByteStreamV1V2Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create CPM Towers from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst (IOpaqueAddress* pAddr, DataObject*& pObj) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work pre-LS1 ToolHandle<LVL1BS::CpByteStreamV1Tool> m_tool1; /// Tool that does the actual work post-LS1 @@ -63,9 +58,6 @@ private: /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV2Cnv.h index d5307350bb0d6fd8a99a2e53ae74f45cade8b316..2f2e6ff421e6a4bddf2e879f175d77a08ebf197d 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV2Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV2Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -32,34 +31,27 @@ class CpByteStreamV2Tool; */ template <typename Container> -class CpReadByteStreamV2Cnv: public Converter { +class CpReadByteStreamV2Cnv: public AthConstConverter { public: CpReadByteStreamV2Cnv(ISvcLocator* svcloc); - ~CpReadByteStreamV2Cnv(); + virtual ~CpReadByteStreamV2Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create Container from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::CpByteStreamV2Tool> m_tool; /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV2Cnv.icc b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV2Cnv.icc index 9a0076c579e0b53ba1342ad3be01cc0841263b62..eb7b096ce2b99afeedf254df6c7d3166f9635865 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV2Cnv.icc +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpReadByteStreamV2Cnv.icc @@ -28,11 +28,9 @@ namespace LVL1BS { template <typename Container> CpReadByteStreamV2Cnv<Container>::CpReadByteStreamV2Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("CpReadByteStreamV2Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "CpReadByteStreamV2Cnv" ), m_tool("LVL1BS::CpByteStreamV2Tool/CpByteStreamV2Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -61,8 +59,6 @@ long CpReadByteStreamV2Cnv<Container>::storageType() template <typename Container> StatusCode CpReadByteStreamV2Cnv<Container>::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool.retrieve() ); ATH_CHEKC( m_robDataProvider.retrieve() ); @@ -73,13 +69,13 @@ StatusCode CpReadByteStreamV2Cnv<Container>::initialize() // createObj should create the RDO from bytestream. template <typename Container> -StatusCode CpReadByteStreamV2Cnv<Container>::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode CpReadByteStreamV2Cnv<Container>::createObjConst ( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } @@ -94,9 +90,8 @@ StatusCode CpReadByteStreamV2Cnv<Container>::createObj( IOpaqueAddress* pAddr, // size check auto collection = std::make_unique<Container>(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags.size() ); + if (robFrags.size() == 0) { pObj = SG::asStorable(std::move(collection)) ; return StatusCode::SUCCESS; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.cxx index ea8b129c2c7a981867647b1c50e64e68388a54e7..2a1ba5735ac7b668124239e875cad58681ab4f37 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.cxx @@ -33,11 +33,9 @@ namespace LVL1BS { CpmRoiByteStreamCnv::CpmRoiByteStreamCnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("CpmRoiByteStreamCnv"), + : AthConstConverter( storageType(), classID(), svcloc, "CpmRoiByteStreamCnv" ), m_tool("LVL1BS::CpmRoiByteStreamTool/CpmRoiByteStreamTool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -62,16 +60,13 @@ long CpmRoiByteStreamCnv::storageType() StatusCode CpmRoiByteStreamCnv::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool.retrieve() ); // Get ROBDataProvider StatusCode sc = m_robDataProvider.retrieve(); if ( sc.isFailure() ) { - REPORT_MESSAGE (MSG::WARNING) << "Failed to retrieve service " - << m_robDataProvider; + ATH_MSG_WARNING( "Failed to retrieve service " << m_robDataProvider ); // return is disabled for Write BS which does not require ROBDataProviderSvc // return sc ; } @@ -81,21 +76,19 @@ StatusCode CpmRoiByteStreamCnv::initialize() // createObj should create the RDO from bytestream. -StatusCode CpmRoiByteStreamCnv::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode CpmRoiByteStreamCnv::createObjConst( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID(m_tool->sourceIDs(nm)); @@ -106,9 +99,8 @@ StatusCode CpmRoiByteStreamCnv::createObj( IOpaqueAddress* pAddr, // size check auto roiCollection = std::make_unique<DataVector<LVL1::CPMRoI> >(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags.size() ); + if (robFrags.size() == 0) { pObj = SG::asStorable(std::move(roiCollection)) ; return StatusCode::SUCCESS; @@ -123,12 +115,12 @@ StatusCode CpmRoiByteStreamCnv::createObj( IOpaqueAddress* pAddr, // createRep should create the bytestream from RDOs. -StatusCode CpmRoiByteStreamCnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode CpmRoiByteStreamCnv::createRepConst( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { DataVector<LVL1::CPMRoI>* roiCollection = 0; if( !SG::fromStorable( pObj, roiCollection ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to DataVector<CPMRoI>"; + ATH_MSG_ERROR( " Cannot cast to DataVector<CPMRoI>" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.h index 9cca5c66fb50ba6ff87be34fcc1f96fc6e7865c7..58b21b9cbbd3afeb665d94d2e247962d3bdc498c 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamCnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -32,7 +31,7 @@ class CpmRoiByteStreamTool; * @author Peter Faulkner */ -class CpmRoiByteStreamCnv: public Converter { +class CpmRoiByteStreamCnv: public AthConstConverter { friend class CnvFactory<CpmRoiByteStreamCnv>; @@ -42,32 +41,25 @@ protected: public: - ~CpmRoiByteStreamCnv(); + virtual ~CpmRoiByteStreamCnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create CPM RoIs from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; /// Create ByteStream from CPM RoIs - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::CpmRoiByteStreamTool> m_tool; /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.cxx index f85f3e17c1af28b24a2be120339ac6cc9022f82d..ecfcc7b7412f0862a3e06ccc1358a93cd98c6f88 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.cxx @@ -33,11 +33,9 @@ namespace LVL1BS { CpmRoiByteStreamV1Cnv::CpmRoiByteStreamV1Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("CpmRoiByteStreamV1Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "CpmRoiByteStreamV1Cnv" ), m_tool("LVL1BS::CpmRoiByteStreamV1Tool/CpmRoiByteStreamV1Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -62,16 +60,13 @@ long CpmRoiByteStreamV1Cnv::storageType() StatusCode CpmRoiByteStreamV1Cnv::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool.retrieve() ); // Get ROBDataProvider StatusCode sc = m_robDataProvider.retrieve(); if ( sc.isFailure() ) { - REPORT_MESSAGE (MSG::WARNING) << "Failed to retrieve service " - << m_robDataProvider; + ATH_MSG_WARNING ("Failed to retrieve service " << m_robDataProvider ); // return is disabled for Write BS which does not require ROBDataProviderSvc // return sc ; } @@ -81,21 +76,19 @@ StatusCode CpmRoiByteStreamV1Cnv::initialize() // createObj should create the RDO from bytestream. -StatusCode CpmRoiByteStreamV1Cnv::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode CpmRoiByteStreamV1Cnv::createObjConst( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID(m_tool->sourceIDs(nm)); @@ -106,9 +99,7 @@ StatusCode CpmRoiByteStreamV1Cnv::createObj( IOpaqueAddress* pAddr, // size check auto roiCollection = std::make_unique<DataVector<LVL1::CPMRoI> >(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags.size() ); if (robFrags.size() == 0) { pObj = SG::asStorable(std::move(roiCollection)) ; return StatusCode::SUCCESS; @@ -123,8 +114,8 @@ StatusCode CpmRoiByteStreamV1Cnv::createObj( IOpaqueAddress* pAddr, // createRep should create the bytestream from RDOs. -StatusCode CpmRoiByteStreamV1Cnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode CpmRoiByteStreamV1Cnv::createRepConst( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { DataVector<LVL1::CPMRoI>* roiCollection = 0; if( !SG::fromStorable( pObj, roiCollection ) ) { diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.h index ec52c70eed68e91097c54d4a7785e9a578f74670..926292301b329b6f05b733ef8e86b416aa9ca7cb 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV1Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -32,36 +31,29 @@ class CpmRoiByteStreamV1Tool; * @author Peter Faulkner */ -class CpmRoiByteStreamV1Cnv: public Converter { +class CpmRoiByteStreamV1Cnv: public AthConstConverter { public: CpmRoiByteStreamV1Cnv(ISvcLocator* svcloc); - ~CpmRoiByteStreamV1Cnv(); + virtual ~CpmRoiByteStreamV1Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create CPM RoIs from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; /// Create ByteStream from CPM RoIs - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override ; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::CpmRoiByteStreamV1Tool> m_tool; /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.cxx index 07a86c82fee2cf1f0cf42899f64cc8703789bf44..fd18396eb47c029ef922ba9a51c16c831ffe4f9c 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.cxx @@ -33,11 +33,9 @@ namespace LVL1BS { CpmRoiByteStreamV2Cnv::CpmRoiByteStreamV2Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("CpmRoiByteStreamV2Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "CpmRoiByteStreamV2Cnv" ), m_tool("LVL1BS::CpmRoiByteStreamV2Tool/CpmRoiByteStreamV2Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -62,16 +60,13 @@ long CpmRoiByteStreamV2Cnv::storageType() StatusCode CpmRoiByteStreamV2Cnv::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool.retrieve() ); // Get ROBDataProvider StatusCode sc = m_robDataProvider.retrieve(); if ( sc.isFailure() ) { - REPORT_MESSAGE (MSG::WARNING) << "Failed to retrieve service " - << m_robDataProvider; + ATH_MSG_WARNING( "Failed to retrieve service " << m_robDataProvider ); // return is disabled for Write BS which does not require ROBDataProviderSvc // return sc ; } @@ -81,21 +76,19 @@ StatusCode CpmRoiByteStreamV2Cnv::initialize() // createObj should create the RDO from bytestream. -StatusCode CpmRoiByteStreamV2Cnv::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode CpmRoiByteStreamV2Cnv::createObjConst ( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID(m_tool->sourceIDs(nm)); @@ -106,9 +99,8 @@ StatusCode CpmRoiByteStreamV2Cnv::createObj( IOpaqueAddress* pAddr, // size check auto roiCollection = std::make_unique<DataVector<LVL1::CPMTobRoI> >(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) <<" Number of ROB fragments is " << robFrags.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags.size() ); + if (robFrags.size() == 0) { pObj = SG::asStorable(std::move(roiCollection)) ; return StatusCode::SUCCESS; @@ -123,12 +115,12 @@ StatusCode CpmRoiByteStreamV2Cnv::createObj( IOpaqueAddress* pAddr, // createRep should create the bytestream from RDOs. -StatusCode CpmRoiByteStreamV2Cnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode CpmRoiByteStreamV2Cnv::createRepConst( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { DataVector<LVL1::CPMTobRoI>* roiCollection = 0; if( !SG::fromStorable( pObj, roiCollection ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to DataVector<CPMTobRoI>"; + ATH_MSG_ERROR( " Cannot cast to DataVector<CPMTobRoI>" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.h index de63a402130564d95529e2f887942e44f7a2cdc6..d0f32b591bbe2e426ec553d958f38dba2395b481 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/CpmRoiByteStreamV2Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -32,36 +31,29 @@ class CpmRoiByteStreamV2Tool; * @author Peter Faulkner */ -class CpmRoiByteStreamV2Cnv: public Converter { +class CpmRoiByteStreamV2Cnv: public AthConstConverter { public: CpmRoiByteStreamV2Cnv(ISvcLocator* svcloc); - ~CpmRoiByteStreamV2Cnv(); + virtual ~CpmRoiByteStreamV2Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create CPM RoIs from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; /// Create ByteStream from CPM RoIs - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::CpmRoiByteStreamV2Tool> m_tool; /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.cxx index ec28c455b79f2808be74964e961d6f32c7b1160a..2ce45aa28f59b3767d5a71424e516545f98e4cdc 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.cxx @@ -31,8 +31,7 @@ namespace LVL1BS { JepByteStreamCnv::JepByteStreamCnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepByteStreamCnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepByteStreamCnv" ), m_tool("LVL1BS::JepByteStreamTool/JepByteStreamTool") { } @@ -66,12 +65,12 @@ StatusCode JepByteStreamCnv::initialize() // createRep should create the bytestream from RDOs. -StatusCode JepByteStreamCnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode JepByteStreamCnv::createRepConst ( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { LVL1::JEPBSCollection* jep = 0; if( !SG::fromStorable( pObj, jep ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPBSCollection"; + ATH_MSG_ERROR( " Cannot cast to JEPBSCollection" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.h index 946dd91c08a1bbed87e0f98cadec9f1c3ce4ba50..de9ddde9d0ee44ffb01d9ca729d68fad463b2d20 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamCnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -31,7 +30,7 @@ class JepByteStreamTool; * @author Peter Faulkner */ -class JepByteStreamCnv: public Converter { +class JepByteStreamCnv: public AthConstConverter { friend class CnvFactory<JepByteStreamCnv>; @@ -41,22 +40,18 @@ protected: public: - ~JepByteStreamCnv(); + virtual ~JepByteStreamCnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create ByteStream from JEP Container - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst (DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::JepByteStreamTool> m_tool; }; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.cxx index 081abbf6a9c35d51ecc33f15c6f1d158e4150c7e..92c70c07a306fb18a63a9c250c262ac7a4827dfb 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.cxx @@ -31,8 +31,7 @@ namespace LVL1BS { JepByteStreamV1Cnv::JepByteStreamV1Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepByteStreamV1Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepByteStreamV1Cnv" ), m_tool("LVL1BS::JepByteStreamV1Tool/JepByteStreamV1Tool") { } @@ -66,12 +65,12 @@ StatusCode JepByteStreamV1Cnv::initialize() // createRep should create the bytestream from RDOs. -StatusCode JepByteStreamV1Cnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode JepByteStreamV1Cnv::createRepConst( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { LVL1::JEPBSCollectionV1* jep = 0; if( !SG::fromStorable( pObj, jep ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPBSCollectionV1"; + ATH_MSG_ERROR( " Cannot cast to JEPBSCollectionV1" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.h index c11fe07d750e04294d45c69d91980638fc1742fb..a0e9408bb40bee18b0b8fa483a47f55678ed9358 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV1Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -31,26 +30,22 @@ class JepByteStreamV1Tool; * @author Peter Faulkner */ -class JepByteStreamV1Cnv: public Converter { +class JepByteStreamV1Cnv: public AthConstConverter { public: JepByteStreamV1Cnv(ISvcLocator* svcloc); - ~JepByteStreamV1Cnv(); + virtual ~JepByteStreamV1Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create ByteStream from JEP Container - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst (DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::JepByteStreamV1Tool> m_tool; }; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.cxx index 105167a80de55b71ae179d63c2961c1002f8177f..f70e4b6dfdd1ce52f8404f780f58e6cea0b2e917 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.cxx @@ -31,8 +31,7 @@ namespace LVL1BS { JepByteStreamV2Cnv::JepByteStreamV2Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepByteStreamV2Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepByteStreamV2Cnv" ), m_tool("LVL1BS::JepByteStreamV2Tool/JepByteStreamV2Tool") { } @@ -66,12 +65,12 @@ StatusCode JepByteStreamV2Cnv::initialize() // createRep should create the bytestream from RDOs. -StatusCode JepByteStreamV2Cnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode JepByteStreamV2Cnv::createRepConst ( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { LVL1::JEPBSCollectionV2* jep = 0; if( !SG::fromStorable( pObj, jep ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPBSCollectionV2"; + ATH_MSG_ERROR( " Cannot cast to JEPBSCollectionV2" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.h index 350f1fcf62b24c8aeed79483b940b91883f6bb21..ab04701f0853b3829beb154d8e6bb32134dfe858 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepByteStreamV2Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -31,26 +30,22 @@ class JepByteStreamV2Tool; * @author Peter Faulkner */ -class JepByteStreamV2Cnv: public Converter { +class JepByteStreamV2Cnv: public AthConstConverter { public: JepByteStreamV2Cnv(ISvcLocator* svcloc); - ~JepByteStreamV2Cnv(); + virtual ~JepByteStreamV2Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create ByteStream from JEP Container - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::JepByteStreamV2Tool> m_tool; }; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1Cnv.h index 6f905cb06d6daa5a82eca7a83c6be79cc0a8a983..08267ff3b4d6e0785fc3a0b7edb2dd4638fe9fcd 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -32,35 +31,28 @@ class JepByteStreamV1Tool; */ template <typename Container> -class JepReadByteStreamV1Cnv: public Converter { +class JepReadByteStreamV1Cnv: public AthConstConverter { public: JepReadByteStreamV1Cnv(ISvcLocator* svcloc); - ~JepReadByteStreamV1Cnv(); + virtual ~JepReadByteStreamV1Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create Container from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst (IOpaqueAddress* pAddr, DataObject*& pObj) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<JepByteStreamV1Tool> m_tool; /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1Cnv.icc b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1Cnv.icc index ac6ea86a60b886b8a25737eed2ce86e59ad519fc..d5b3fc6202f1bd44029c879ebe25e48f9186e036 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1Cnv.icc +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1Cnv.icc @@ -28,11 +28,9 @@ namespace LVL1BS { template <typename Container> JepReadByteStreamV1Cnv<Container>::JepReadByteStreamV1Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepReadByteStreamV1Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepReadByteStreamV1Cnv" ), m_tool("LVL1BS::JepByteStreamV1Tool/JepByteStreamV1Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -61,8 +59,6 @@ long JepReadByteStreamV1Cnv<Container>::storageType() template <typename Container> StatusCode JepReadByteStreamV1Cnv<Container>::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool.retrieve() ); ATH_CHECK( m_robDataProvider.retrieve() ); @@ -73,21 +69,19 @@ StatusCode JepReadByteStreamV1Cnv<Container>::initialize() // createObj should create the RDO from bytestream. template <typename Container> -StatusCode JepReadByteStreamV1Cnv<Container>::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode JepReadByteStreamV1Cnv<Container>::createObjConst( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID(m_tool->sourceIDs()); @@ -98,9 +92,8 @@ StatusCode JepReadByteStreamV1Cnv<Container>::createObj( IOpaqueAddress* pAddr, // size check auto collection = std::make_unique<Container>(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags.size() ); + if (robFrags.size() == 0) { pObj = SG::asStorable(std::move(collection)) ; return StatusCode::SUCCESS; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1V2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1V2Cnv.h index ac3746194a050a60aef687c387a0336023abe657..68ac11b38d73a98fd80a353320ea16efbb8e022c 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1V2Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1V2Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -36,27 +35,23 @@ class JepByteStreamV2Tool; */ template <typename Container> -class JepReadByteStreamV1V2Cnv: public Converter { +class JepReadByteStreamV1V2Cnv: public AthConstConverter { public: JepReadByteStreamV1V2Cnv(ISvcLocator* svcloc); - ~JepReadByteStreamV1V2Cnv(); + virtual ~JepReadByteStreamV1V2Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create Container from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst (IOpaqueAddress* pAddr, DataObject*& pObj) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work pre-LS1 ToolHandle<LVL1BS::JepByteStreamV1Tool> m_tool1; /// Tool that does the actual work post-LS1 @@ -64,9 +59,6 @@ private: /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1V2Cnv.icc b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1V2Cnv.icc index 069c4810f6897805960da4ccb6957813dacf95e0..da0e33034e42878a08d98fcdccdb779dcf52c886 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1V2Cnv.icc +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV1V2Cnv.icc @@ -32,12 +32,10 @@ namespace LVL1BS { template <typename Container> JepReadByteStreamV1V2Cnv<Container>::JepReadByteStreamV1V2Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepReadByteStreamV1V2Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepReadByteStreamV1V2Cnv" ), m_tool1("LVL1BS::JepByteStreamV1Tool/JepByteStreamV1Tool"), m_tool2("LVL1BS::JepByteStreamV2Tool/JepByteStreamV2Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -66,8 +64,6 @@ long JepReadByteStreamV1V2Cnv<Container>::storageType() template <typename Container> StatusCode JepReadByteStreamV1V2Cnv<Container>::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool1.retrieve() ); ATH_CHECK( m_tool2.retrieve() ); @@ -79,21 +75,19 @@ StatusCode JepReadByteStreamV1V2Cnv<Container>::initialize() // createObj should create the RDO from bytestream. template <typename Container> -StatusCode JepReadByteStreamV1V2Cnv<Container>::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode JepReadByteStreamV1V2Cnv<Container>::createObjConst ( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID1(m_tool1->sourceIDs()); @@ -107,10 +101,9 @@ StatusCode JepReadByteStreamV1V2Cnv<Container>::createObj( IOpaqueAddress* pAddr // size check auto collection = std::make_unique<Container>(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags1.size() - << ", " << robFrags2.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags1.size() + << ", " << robFrags2.size() ); + if (robFrags1.size() == 0 && robFrags2.size() == 0) { pObj = SG::asStorable(std::move(collection)) ; return StatusCode::SUCCESS; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV2Cnv.h index bf9ccab5e24c5ebf0bc4d0bc8c9b18181d241336..d13a6d17250bac8e39e7a95d344f46ae184142d4 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV2Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV2Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -32,34 +31,27 @@ class JepByteStreamV2Tool; */ template <typename Container> -class JepReadByteStreamV2Cnv: public Converter { +class JepReadByteStreamV2Cnv: public AthConstConverter { public: JepReadByteStreamV2Cnv(ISvcLocator* svcloc); - ~JepReadByteStreamV2Cnv(); + virtual ~JepReadByteStreamV2Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create Container from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst (IOpaqueAddress* pAddr, DataObject*& pObj) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<JepByteStreamV2Tool> m_tool; /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV2Cnv.icc b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV2Cnv.icc index fdcdaa758d56e886cf7dec8036b7d9705f2ce669..30a3ee5b027933a5dd1f4d171af9b44bcd2b0791 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV2Cnv.icc +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepReadByteStreamV2Cnv.icc @@ -28,11 +28,9 @@ namespace LVL1BS { template <typename Container> JepReadByteStreamV2Cnv<Container>::JepReadByteStreamV2Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepReadByteStreamV2Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepReadByteStreamV2Cnv" ), m_tool("LVL1BS::JepByteStreamV2Tool/JepByteStreamV2Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -60,8 +58,6 @@ long JepReadByteStreamV2Cnv<Container>::storageType() template <typename Container> StatusCode JepReadByteStreamV2Cnv<Container>::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool.retrieve() ); ATH_CHECK( m_robDataProvider.retrieve() ); @@ -72,21 +68,19 @@ StatusCode JepReadByteStreamV2Cnv<Container>::initialize() // createObj should create the RDO from bytestream. template <typename Container> -StatusCode JepReadByteStreamV2Cnv<Container>::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode JepReadByteStreamV2Cnv<Container>::createObjConst( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID(m_tool->sourceIDs(nm)); @@ -97,9 +91,8 @@ StatusCode JepReadByteStreamV2Cnv<Container>::createObj( IOpaqueAddress* pAddr, // size check auto collection = std::make_unique<Container>(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags.size() ); + if (robFrags.size() == 0) { pObj = SG::asStorable(std::move(collection)) ; return StatusCode::SUCCESS; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.cxx index 49e4a67388df51f0c73be05204417618d4f4ee61..79c7ce6e89451e9b156cc97695ee0ed76150b352 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.cxx @@ -31,8 +31,7 @@ namespace LVL1BS { JepRoiByteStreamCnv::JepRoiByteStreamCnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepRoiByteStreamCnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepRoiByteStreamCnv" ), m_tool("LVL1BS::JepRoiByteStreamTool/JepRoiByteStreamTool") { } @@ -66,12 +65,12 @@ StatusCode JepRoiByteStreamCnv::initialize() // createRep should create the bytestream from RDOs. -StatusCode JepRoiByteStreamCnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode JepRoiByteStreamCnv::createRepConst( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { LVL1::JEPRoIBSCollection* jep = 0; if( !SG::fromStorable( pObj, jep ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPRoIBSCollection"; + ATH_MSG_ERROR( " Cannot cast to JEPRoIBSCollection" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.h index bfaa7086bbb35b44dae9886b2a9c93a337bbd820..b394a43e742372278c566048920881f34e970d72 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamCnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -31,7 +30,7 @@ class JepRoiByteStreamTool; * @author Peter Faulkner */ -class JepRoiByteStreamCnv: public Converter { +class JepRoiByteStreamCnv: public AthConstConverter { friend class CnvFactory<JepRoiByteStreamCnv>; @@ -41,22 +40,18 @@ protected: public: - ~JepRoiByteStreamCnv(); + virtual ~JepRoiByteStreamCnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create ByteStream from JEP Container - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst (DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::JepRoiByteStreamTool> m_tool; }; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.cxx index 1d332a01bd6f68dd3e87daf728d0710a19557da3..edf6d58f39bd004978c2c14524d7e1f9fc090829 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.cxx @@ -31,8 +31,7 @@ namespace LVL1BS { JepRoiByteStreamV1Cnv::JepRoiByteStreamV1Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepRoiByteStreamV1Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepRoiByteStreamV1Cnv" ), m_tool("LVL1BS::JepRoiByteStreamV1Tool/JepRoiByteStreamV1Tool") { } @@ -66,12 +65,12 @@ StatusCode JepRoiByteStreamV1Cnv::initialize() // createRep should create the bytestream from RDOs. -StatusCode JepRoiByteStreamV1Cnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode JepRoiByteStreamV1Cnv::createRepConst ( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { LVL1::JEPRoIBSCollectionV1* jep = 0; if( !SG::fromStorable( pObj, jep ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPRoIBSCollectionV1"; + ATH_MSG_ERROR( " Cannot cast to JEPRoIBSCollectionV1" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.h index 4cf2f15c113af5e404ff774d8aebeddd91f8a5de..c6efb39d78bda6571d865e95e928d5c745cfea54 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV1Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -31,27 +30,23 @@ class JepRoiByteStreamV1Tool; * @author Peter Faulkner */ -class JepRoiByteStreamV1Cnv: public Converter { +class JepRoiByteStreamV1Cnv: public AthConstConverter { public: JepRoiByteStreamV1Cnv(ISvcLocator* svcloc); - ~JepRoiByteStreamV1Cnv(); + virtual ~JepRoiByteStreamV1Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create ByteStream from JEP Container - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst (DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::JepRoiByteStreamV1Tool> m_tool; }; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.cxx index c9cc45eb597228be09fd1bf053fd41006b9ee2c9..1780a839127ff6e5b8a38bb202ea5a475b238a1c 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.cxx @@ -31,8 +31,7 @@ namespace LVL1BS { JepRoiByteStreamV2Cnv::JepRoiByteStreamV2Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepRoiByteStreamV2Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepRoiByteStreamV2Cnv" ), m_tool("LVL1BS::JepRoiByteStreamV2Tool/JepRoiByteStreamV2Tool") { } @@ -66,12 +65,12 @@ StatusCode JepRoiByteStreamV2Cnv::initialize() // createRep should create the bytestream from RDOs. -StatusCode JepRoiByteStreamV2Cnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode JepRoiByteStreamV2Cnv::createRepConst ( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { LVL1::JEPRoIBSCollectionV2* jep = 0; if( !SG::fromStorable( pObj, jep ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to JEPRoIBSCollectionV2"; + ATH_MSG_ERROR( " Cannot cast to JEPRoIBSCollectionV2" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.h index 2cefd9e839660b0e55d3ea54bb9a85e6f948386c..b5e56ab608b760ac4bdbe8152a2b3a260c2d873b 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiByteStreamV2Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -31,26 +30,22 @@ class JepRoiByteStreamV2Tool; * @author Peter Faulkner */ -class JepRoiByteStreamV2Cnv: public Converter { +class JepRoiByteStreamV2Cnv: public AthConstConverter { public: JepRoiByteStreamV2Cnv(ISvcLocator* svcloc); - ~JepRoiByteStreamV2Cnv(); + virtual ~JepRoiByteStreamV2Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create ByteStream from JEP Container - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst (DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::JepRoiByteStreamV2Tool> m_tool; }; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV1Cnv.h index c0586aef79eb25e2a81d116f85449fcef418d58a..583d065ba31d77ac1236ae6c8d302e073bb8001c 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV1Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV1Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -32,35 +31,28 @@ class JepRoiByteStreamV1Tool; */ template <typename Container> -class JepRoiReadByteStreamV1Cnv: public Converter { +class JepRoiReadByteStreamV1Cnv: public AthConstConverter { public: JepRoiReadByteStreamV1Cnv(ISvcLocator* svcloc); - ~JepRoiReadByteStreamV1Cnv(); + virtual ~JepRoiReadByteStreamV1Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create Container from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::JepRoiByteStreamV1Tool> m_tool; /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV1Cnv.icc b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV1Cnv.icc index 2f77a7089b2c71ca4c4ec9722abe1fb77d707834..6a5c59bc248d469c638a163858d4d85c7a3cc1c4 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV1Cnv.icc +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV1Cnv.icc @@ -29,11 +29,9 @@ namespace LVL1BS { template <typename Container> JepRoiReadByteStreamV1Cnv<Container>::JepRoiReadByteStreamV1Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepRoiReadByteStreamV1Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepRoiReadByteStreamV1Cnv" ), m_tool("LVL1BS::JepRoiByteStreamV1Tool/JepRoiByteStreamV1Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -62,8 +60,6 @@ long JepRoiReadByteStreamV1Cnv<Container>::storageType() template <typename Container> StatusCode JepRoiReadByteStreamV1Cnv<Container>::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool.retrieve() ); ATH_CHECK( m_robDataProvider.retrieve() ); @@ -74,21 +70,19 @@ StatusCode JepRoiReadByteStreamV1Cnv<Container>::initialize() // createObj should create the RDO from bytestream. template <typename Container> -StatusCode JepRoiReadByteStreamV1Cnv<Container>::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode JepRoiReadByteStreamV1Cnv<Container>::createObjConst ( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Cannot cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID(m_tool->sourceIDs(nm)); @@ -99,9 +93,8 @@ StatusCode JepRoiReadByteStreamV1Cnv<Container>::createObj( IOpaqueAddress* pAdd // size check auto collection = std::make_unique<Container>(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags.size() ); + if (robFrags.size() == 0) { pObj = SG::asStorable(std::move(collection)) ; return StatusCode::SUCCESS; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV2Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV2Cnv.h index 135b2e0a17f20c07665489ce2651dc424f43e8f3..de32e1650bebd2c5811e697641fc7bc2ca3f73b3 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV2Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV2Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -32,34 +31,27 @@ class JepRoiByteStreamV2Tool; */ template <typename Container> -class JepRoiReadByteStreamV2Cnv: public Converter { +class JepRoiReadByteStreamV2Cnv: public AthConstConverter { public: JepRoiReadByteStreamV2Cnv(ISvcLocator* svcloc); - ~JepRoiReadByteStreamV2Cnv(); + virtual ~JepRoiReadByteStreamV2Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create Container from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst (IOpaqueAddress* pAddr, DataObject*& pObj) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::JepRoiByteStreamV2Tool> m_tool; /// Service for reading bytestream ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV2Cnv.icc b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV2Cnv.icc index 5f881e0ad974460ce00590c358d2cfb59b06e8bc..1cdbdf17cd9eaf8f4f0a6cae144bbdaa8886a521 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV2Cnv.icc +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/JepRoiReadByteStreamV2Cnv.icc @@ -29,11 +29,9 @@ namespace LVL1BS { template <typename Container> JepRoiReadByteStreamV2Cnv<Container>::JepRoiReadByteStreamV2Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("JepRoiReadByteStreamV2Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "JepRoiReadByteStreamV2Cnv" ), m_tool("LVL1BS::JepRoiByteStreamV2Tool/JepRoiByteStreamV2Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()) { } @@ -62,8 +60,6 @@ long JepRoiReadByteStreamV2Cnv<Container>::storageType() template <typename Container> StatusCode JepRoiReadByteStreamV2Cnv<Container>::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool.retrieve() ); ATH_CHECK( m_robDataProvider.retrieve() ); @@ -74,21 +70,19 @@ StatusCode JepRoiReadByteStreamV2Cnv<Container>::initialize() // createObj should create the RDO from bytestream. template <typename Container> -StatusCode JepRoiReadByteStreamV2Cnv<Container>::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode JepRoiReadByteStreamV2Cnv<Container>::createObjConst( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Cannot cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID(m_tool->sourceIDs(nm)); @@ -99,9 +93,8 @@ StatusCode JepRoiReadByteStreamV2Cnv<Container>::createObj( IOpaqueAddress* pAdd // size check auto collection = std::make_unique<Container>(); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags.size() ); + if (robFrags.size() == 0) { pObj = SG::asStorable(std::move(collection)) ; return StatusCode::SUCCESS; diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamCnv.cxx index 3caae1aa87ab9c611ea178f618f7498d93431631..5d47df46d90b2a58295081eeabe0fe7dc38d7bc3 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamCnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamCnv.cxx @@ -24,10 +24,8 @@ namespace LVL1BS { L1CaloErrorByteStreamCnv::L1CaloErrorByteStreamCnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("L1CaloErrorByteStreamCnv"), - m_tool("LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"), - m_debug(false) + : AthConstConverter( storageType(), classID(), svcloc, "L1CaloErrorByteStreamCnv" ), + m_tool("LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool") { } @@ -52,8 +50,6 @@ long L1CaloErrorByteStreamCnv::storageType() StatusCode L1CaloErrorByteStreamCnv::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_tool.retrieve() ); @@ -62,21 +58,19 @@ StatusCode L1CaloErrorByteStreamCnv::initialize() // createObj should create the RDO from bytestream. -StatusCode L1CaloErrorByteStreamCnv::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode L1CaloErrorByteStreamCnv::createObjConst ( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); auto errCollection = std::make_unique<std::vector<unsigned int> >(); diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamCnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamCnv.h index e5bd2983637f7eaedad98449b684dbacdbb33d79..422b1e8e72ee19050dd6b369592135d6b6a91f13 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamCnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamCnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ToolHandle.h" class DataObject; @@ -29,32 +28,25 @@ class L1CaloErrorByteStreamTool; * @author Peter Faulkner */ -class L1CaloErrorByteStreamCnv: public Converter { +class L1CaloErrorByteStreamCnv: public AthConstConverter { public: L1CaloErrorByteStreamCnv(ISvcLocator* svcloc); - ~L1CaloErrorByteStreamCnv(); + virtual ~L1CaloErrorByteStreamCnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create error vector from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst (IOpaqueAddress* pAddr, DataObject*& pObj) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::L1CaloErrorByteStreamTool> m_tool; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.cxx index caac9a69428facdeda4280c992a29e474fcb2b71..4be54aa54ed44a0750aff723570b9e32abe4f4c4 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -86,7 +86,7 @@ void L1CaloErrorByteStreamTool::rodError(const uint32_t robid, // Fill vector with accumulated errors and reset StatusCode L1CaloErrorByteStreamTool::errors(std::vector<unsigned int>* - const errColl) + const errColl) const { ErrorMaps& maps = *m_maps; std::scoped_lock lock (maps.m_mutex); diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.h index 934e9556c0943cc7f738c371fc6930eae3c86f1c..95cbf9e4c567386952c2958c7d8d60e1c21b66c5 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloErrorByteStreamTool.h @@ -44,7 +44,7 @@ class L1CaloErrorByteStreamTool : public AthAlgTool { /// Set ROD unpacking error void rodError(uint32_t robid, unsigned int err) const; /// Fill vector with accumulated errors and reset - StatusCode errors(std::vector<unsigned int>* errColl); + StatusCode errors(std::vector<unsigned int>* errColl) const; private: diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSubBlock.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSubBlock.h index 3b3a34f04a0dd266b824a38787dd9633a6638224..1724d517886c56bf2d90111f94c564bd6611acc1 100755 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSubBlock.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/L1CaloSubBlock.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGT1CALOBYTESTREAM_L1CALOSUBBLOCK_H diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmByteStreamV1Cnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmByteStreamV1Cnv.cxx index 1a24f5bfc258e6a859be41e8717e92151b5e3a6e..0d399f1aacdc09e787922543fec53010138e6996 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmByteStreamV1Cnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmByteStreamV1Cnv.cxx @@ -33,12 +33,10 @@ namespace LVL1BS { PpmByteStreamV1Cnv::PpmByteStreamV1Cnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("PpmByteStreamV1Cnv"), + : AthConstConverter( storageType(), classID(), svcloc, "PpmByteStreamV1Cnv" ), m_tool("LVL1BS::PpmByteStreamV1Tool/PpmByteStreamV1Tool"), - m_robDataProvider("ROBDataProviderSvc", m_name), - m_ByteStreamEventAccess("ByteStreamCnvSvc", m_name), - m_debug(false) + m_robDataProvider("ROBDataProviderSvc", name()), + m_ByteStreamEventAccess("ByteStreamCnvSvc", name()) { } @@ -63,8 +61,6 @@ long PpmByteStreamV1Cnv::storageType() StatusCode PpmByteStreamV1Cnv::initialize() { - m_debug = msgSvc()->outputLevel(m_name) <= MSG::DEBUG; - ATH_CHECK( Converter::initialize() ); ATH_CHECK( m_ByteStreamEventAccess.retrieve() ); ATH_CHECK( m_tool.retrieve() ); @@ -72,8 +68,7 @@ StatusCode PpmByteStreamV1Cnv::initialize() // Get ROBDataProvider StatusCode sc = m_robDataProvider.retrieve(); if ( sc.isFailure() ) { - REPORT_MESSAGE (MSG::WARNING) << "Failed to retrieve service " - << m_robDataProvider; + ATH_MSG_WARNING( "Failed to retrieve service " << m_robDataProvider ); // return is disabled for Write BS which does not require ROBDataProviderSvc // return sc ; } @@ -82,21 +77,19 @@ StatusCode PpmByteStreamV1Cnv::initialize() // createObj should create the RDO from bytestream. -StatusCode PpmByteStreamV1Cnv::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode PpmByteStreamV1Cnv::createObjConst ( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } const std::string nm = *( pBS_Addr->par() ); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Creating Objects " << nm; - } + ATH_MSG_DEBUG( " Creating Objects " << nm ); // get SourceIDs const std::vector<uint32_t>& vID(m_tool->sourceIDs(nm)); @@ -107,9 +100,8 @@ StatusCode PpmByteStreamV1Cnv::createObj( IOpaqueAddress* pAddr, // size check auto ttCollection = std::make_unique<DataVector<LVL1::TriggerTower> >(SG::VIEW_ELEMENTS); - if (m_debug) { - REPORT_MESSAGE (MSG::DEBUG) << " Number of ROB fragments is " << robFrags.size(); - } + ATH_MSG_DEBUG( " Number of ROB fragments is " << robFrags.size() ); + if (robFrags.size() == 0) { pObj = SG::asStorable(std::move(ttCollection)) ; return StatusCode::SUCCESS; @@ -124,14 +116,14 @@ StatusCode PpmByteStreamV1Cnv::createObj( IOpaqueAddress* pAddr, // createRep should create the bytestream from RDOs. -StatusCode PpmByteStreamV1Cnv::createRep( DataObject* pObj, - IOpaqueAddress*& pAddr ) +StatusCode PpmByteStreamV1Cnv::createRepConst ( DataObject* pObj, + IOpaqueAddress*& pAddr ) const { RawEventWrite* re = m_ByteStreamEventAccess->getRawEvent(); DataVector<LVL1::TriggerTower>* ttCollection = 0; if( !SG::fromStorable( pObj, ttCollection ) ) { - REPORT_ERROR (StatusCode::FAILURE) << " Cannot cast to DataVector<TriggerTower>"; + ATH_MSG_ERROR( " Cannot cast to DataVector<TriggerTower>" ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmByteStreamV1Cnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmByteStreamV1Cnv.h index 555d8e3b201736b74ae48795bfdff139ef8d1a45..88967d13e6d93f23ec5c93a5789801cfd5f7a22a 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmByteStreamV1Cnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmByteStreamV1Cnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -32,29 +31,25 @@ class PpmByteStreamV1Tool; * @author Peter Faulkner */ -class PpmByteStreamV1Cnv: public Converter { +class PpmByteStreamV1Cnv: public AthConstConverter { public: PpmByteStreamV1Cnv(ISvcLocator* svcloc); - ~PpmByteStreamV1Cnv(); + virtual ~PpmByteStreamV1Cnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create TriggerTowers from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst (IOpaqueAddress* pAddr, DataObject*& pObj) const override; /// Create ByteStream from TriggerTowers - virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr); + virtual StatusCode createRepConst (DataObject* pObj, IOpaqueAddress*& pAddr) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::PpmByteStreamV1Tool> m_tool; @@ -62,9 +57,6 @@ private: ServiceHandle<IROBDataProviderSvc> m_robDataProvider; /// Service for writing bytestream ServiceHandle<IByteStreamEventAccess> m_ByteStreamEventAccess; - - /// Message log - bool m_debug; }; } // end namespace diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmSubBlockV1.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmSubBlockV1.h index c6ee67cd389fdfd2b50c5439948181c57a688814..02fe4371ddab5293467e36cd73637b96460af310 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmSubBlockV1.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/PpmSubBlockV1.h @@ -24,6 +24,7 @@ class PpmSubBlockV1 : public L1CaloSubBlock { ~PpmSubBlockV1(); /// Clear all data + // cppcheck-suppress duplInheritedMember void clear(); /// Store PPM header diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/RodHeaderByteStreamCnv.cxx b/Trigger/TrigT1/TrigT1CaloByteStream/src/RodHeaderByteStreamCnv.cxx index 298dfe7f01f81e6ac84063cd26c36e2b4d5e2685..52772e6b805f37f026c9f935e2ab7fad72d8a258 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/RodHeaderByteStreamCnv.cxx +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/RodHeaderByteStreamCnv.cxx @@ -32,8 +32,7 @@ namespace LVL1BS { RodHeaderByteStreamCnv::RodHeaderByteStreamCnv( ISvcLocator* svcloc ) - : Converter( storageType(), classID(), svcloc ), - m_name("RodHeaderByteStreamCnv"), + : AthConstConverter( storageType(), classID(), svcloc, "RodHeaderByteStreamCnv" ), m_tool("LVL1BS::RodHeaderByteStreamTool/RodHeaderByteStreamTool") { } @@ -67,13 +66,13 @@ StatusCode RodHeaderByteStreamCnv::initialize() // createObj should create the RDO from bytestream. -StatusCode RodHeaderByteStreamCnv::createObj( IOpaqueAddress* pAddr, - DataObject*& pObj ) +StatusCode RodHeaderByteStreamCnv::createObjConst( IOpaqueAddress* pAddr, + DataObject*& pObj ) const { ByteStreamAddress *pBS_Addr; pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr ); if ( !pBS_Addr ) { - REPORT_ERROR (StatusCode::FAILURE) << " Can not cast to ByteStreamAddress "; + ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " ); return StatusCode::FAILURE; } diff --git a/Trigger/TrigT1/TrigT1CaloByteStream/src/RodHeaderByteStreamCnv.h b/Trigger/TrigT1/TrigT1CaloByteStream/src/RodHeaderByteStreamCnv.h index ccb2345159d64e2114b2802470d4b349f9fc1d24..1d476a9545ec6a211665a8420da4a17f4e009109 100644 --- a/Trigger/TrigT1/TrigT1CaloByteStream/src/RodHeaderByteStreamCnv.h +++ b/Trigger/TrigT1/TrigT1CaloByteStream/src/RodHeaderByteStreamCnv.h @@ -7,9 +7,8 @@ #include <string> +#include "AthenaBaseComps/AthConstConverter.h" #include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -30,27 +29,23 @@ class RodHeaderByteStreamTool; * @author Peter Faulkner */ -class RodHeaderByteStreamCnv: public Converter { +class RodHeaderByteStreamCnv: public AthConstConverter { public: RodHeaderByteStreamCnv(ISvcLocator* svcloc); - ~RodHeaderByteStreamCnv(); + virtual ~RodHeaderByteStreamCnv(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /// Create RodHeaders from ByteStream - virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj); + virtual StatusCode createObjConst (IOpaqueAddress* pAddr, DataObject*& pObj) const override; // Storage type and class ID - virtual long repSvcType() const { return i_repSvcType(); } + virtual long repSvcType() const override { return i_repSvcType(); } static long storageType(); static const CLID& classID(); private: - - /// Converter name - std::string m_name; - /// Tool that does the actual work ToolHandle<LVL1BS::RodHeaderByteStreamTool> m_tool; };