14#include "GaudiKernel/ISvcLocator.h"
15#include "GaudiKernel/Bootstrap.h"
16#include "GaudiKernel/StatusCode.h"
17#include "GaudiKernel/Service.h"
18#include "GaudiKernel/MsgStream.h"
33 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
34 CHECK( detStore.isValid() );
41 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG <<
"Converter initialized." <<
endmsg;
42 return StatusCode::SUCCESS;
46 if (!cnv_tool)
return nullptr;
73 unsigned int collIndex = 0;
74 unsigned int chanBegin = 0;
75 unsigned int chanEnd = 0;
80 for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
82 log << MSG::DEBUG <<
" New collection" <<
endmsg;
85 chanEnd += collection.
size();
89 pcollection.
m_begin = chanBegin;
90 pcollection.
m_end = chanEnd;
92 persCont->
m_PRD.resize(chanEnd);
93 for (
unsigned int i = 0; i < collection.
size(); ++i) {
98 log << MSG::DEBUG <<
" *** Writing RpcPrepDataContainer ***" <<
endmsg;
124 log << MSG::DEBUG <<
" Reading " << persCont->
m_collections.size() <<
"Collections" <<
endmsg;
125 for (
unsigned int icoll = 0; icoll < persCont->
m_collections.size(); ++icoll) {
137 for (
unsigned int ichan = 0; ichan < nchans; ++ ichan) {
141 log << MSG::ERROR <<
"AthenaPoolTPCnvIDCont::persToTrans: Cannot get RpcPrepData!" <<
endmsg;
146 (*coll)[ichan] = chan;
151 if (
sc.isFailure()) {
152 throw std::runtime_error(
"Failed to add collection to ID Container");
154 if (log.level() <= MSG::DEBUG) {
155 log << MSG::DEBUG <<
"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " << (int) collIDHash <<
" / " <<
160 log << MSG::DEBUG <<
" *** Reading RpcPrepDataContainer" <<
endmsg;
169 if (this->
initialize(log) != StatusCode::SUCCESS) {
170 log << MSG::FATAL <<
"Could not initialize RpcPrepDataContainerCnv_p2 " <<
endmsg;
176 return(trans.release());
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
void resize(size_type sz)
size_type size() const noexcept
Common base class for all TP converters, specialized for a given transient type.
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
const_iterator end() const
return const_iterator for end of container
virtual size_t numberOfCollections() const override final
return number of collections
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
value_type get_compact() const
Get the compact id.
This is a "hash" representation of an Identifier.
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
unsigned int m_end
End index into master collection.
unsigned int m_hashId
Hash Identifier of this collection (write this one as well, so we don't rely on the IdHelper for it)
unsigned int m_begin
Begin index into master collection.
unsigned int m_id
Identifier of this collection.
std::vector< Muon::MuonPRD_Collection_p1 > m_collections
std::vector< TPObjRef > m_PRD
virtual Identifier identify() const override final
virtual void setIdentifier(Identifier id)
virtual IdentifierHash identifyHash() const override final
virtual void persToTrans(const PERS *persCont, TRANS *transCont, MsgStream &log)
const RpcIdHelper * m_RpcId
Muon::RpcPrepDataContainer TRANS
const MuonGM::RpcReadoutElement * getReadOutElement(const Identifier &id) const
StatusCode initialize(MsgStream &log)
virtual void transToPers(const TRANS *transCont, PERS *persCont, MsgStream &log)
virtual Muon::RpcPrepDataContainer * createTransient(const Muon::MuonPRD_Container_p1 *persObj, MsgStream &log)
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
Class to represent RPC measurements.
This class is an object reference used in Athena persistent data model.
MuonPrepDataContainerT< RpcPrepData > RpcPrepDataContainer
MuonPrepDataCollection< RpcPrepData > RpcPrepDataCollection