12#include "GaudiKernel/StatusCode.h"
13#include "GaudiKernel/MsgStream.h"
29 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
30 CHECK( detStore.isValid() );
33 return StatusCode::SUCCESS;
44 unsigned int collIndex;
47 persCont->
m_pads.resize(numColl); log << MSG::DEBUG <<
" Preparing " << persCont->
m_pads.size() <<
"Collections" <<
endmsg;
49 for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
53 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG <<
" *** Writing RpcPadContainer ***" <<
endmsg;
60 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG <<
" Reading " << persCont->
m_pads.size() <<
"Collections" <<
endmsg;
61 for (
unsigned int icoll = 0; icoll < persCont->
m_pads.size(); ++icoll) {
68 log << MSG::WARNING<<
"Collection with hash="<<coll->
identifyHash()<<
" already exists in container (with "<<ptr->size()<<
" elements). "
69 <<
"Will therefore DISCARD this collection which has "<<coll->
size()<<
" elements)!"<<
endmsg;
74 log << MSG::WARNING<<
"Could not add collection with hash="<<coll->
identifyHash()
75 <<
" to IDC which has hash max of "<<transCont->
size()<<
" (PadHashFunction gives "<<
m_rpcIdHelper->module_hash_max()<<
endmsg;
76 throw std::runtime_error(
"Failed to add collection to ID Container. Hash = "+std::to_string(coll->
identifyHash()));
81 log << MSG::DEBUG <<
" *** Reading RpcPadContainer" <<
endmsg;
90 if (this->
initialize(log) != StatusCode::SUCCESS) {
91 log << MSG::FATAL <<
"Could not initialize RpcPadContainerCnv_p2 " <<
endmsg;
98 return(trans.release());
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current RpcPadContainer
size_type size() const noexcept
Returns the number of elements in the collection.
const_iterator end() const
return const_iterator for end of container
virtual size_t numberOfCollections() const override final
return number of collections
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
size_t size() const
Duplicate of fullSize for backwards compatability.
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
const_iterator begin() const
return const_iterator for first entry
virtual void persToTrans(const RpcPad_p1 *persColl, RpcPad *transColl, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
virtual void transToPers(const RpcPad *transColl, RpcPad_p1 *persColl, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
const RpcIdHelper * m_rpcIdHelper
virtual RpcPadContainer * createTransient(const RpcPadContainer_p2 *persObj, MsgStream &log)
virtual void persToTrans(const PERS *persCont, TRANS *transCont, MsgStream &log)
StatusCode initialize(MsgStream &log)
virtual void transToPers(const TRANS *transCont, PERS *persCont, MsgStream &log)
std::vector< RpcPad_p1 > m_pads
Use IdentifiableContainer with RpcPad.
IdentifierHash identifyHash() const
Returns the OFFLINE identifier hash for this collection.