16#include "GaudiKernel/ISvcLocator.h"
17#include "GaudiKernel/Bootstrap.h"
18#include "GaudiKernel/StatusCode.h"
19#include "GaudiKernel/Service.h"
20#include "GaudiKernel/MsgStream.h"
33 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
34 CHECK( detStore.isValid() );
41 log << MSG::DEBUG <<
"Converter initialized." <<
endmsg;
42 return StatusCode::SUCCESS;
69 unsigned int collIndex;
70 unsigned int chanBegin = 0;
71 unsigned int chanEnd = 0;
81 for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
83 log << MSG::DEBUG <<
" New collection" <<
endmsg;
86 chanEnd += collection.
size();
90 pcollection.
m_begin = chanBegin;
91 pcollection.
m_end = chanEnd;
94 for (
unsigned int i = 0; i < collection.
size(); ++i) {
99 log << MSG::DEBUG <<
" *** Writing TgcCoinDataContainer ***" <<
endmsg;
125 log << MSG::DEBUG <<
" Reading " << persCont->
m_collections.size() <<
"Collections" <<
endmsg;
126 for (
unsigned int icoll = 0; icoll < persCont->
m_collections.size(); ++icoll) {
139 for (
unsigned int ichan = 0; ichan < nchans; ++ ichan) {
144 chan->m_detElOut = deOut;
149 chan->m_detElIn = deIn;
152 chan->m_detElIn =
nullptr;
154 (*coll)[ichan] = chan;
159 if (
sc.isFailure()) {
160 throw std::runtime_error(
"Failed to add collection to ID Container");
162 if (log.level() <= MSG::DEBUG) {
163 log << MSG::DEBUG <<
"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " << (int) collIDHash <<
" / " <<
168 log << MSG::DEBUG <<
" *** Reading TgcCoinDataContainer" <<
endmsg;
177 if (this->
initialize(log) != StatusCode::SUCCESS) {
178 log << MSG::FATAL <<
"Could not initialize TgcCoinDataContainerCnv_p2 " <<
endmsg;
184 return(trans.release());
189 if (!cnv_tool)
return nullptr;
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.
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
unsigned int m_id
Identifier of this collection.
unsigned int m_begin
Begin index into master collection.
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)
IdentifierHash identifyHash() const
Identifier identify() const
void setIdentifier(Identifier id)
std::vector< TPObjRef > m_CoinData
std::vector< Muon::MuonCoinDataCollection_p1 > m_collections
const MuonGM::TgcReadoutElement * getReadOutElement(const Identifier &id) const
virtual void persToTrans(const PERS *persCont, TRANS *transCont, MsgStream &log)
virtual void transToPers(const TRANS *transCont, PERS *persCont, MsgStream &log)
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
const TgcIdHelper * m_TgcId
virtual Muon::TgcCoinDataContainer * createTransient(const Muon::MuonCoinDataContainer_p1 *persObj, MsgStream &log)
Muon::TgcCoinDataContainer TRANS
StatusCode initialize(MsgStream &log)
This class is an object reference used in Athena persistent data model.
MuonCoinDataCollection< TgcCoinData > TgcCoinDataCollection
MuonCoinDataContainer< TgcCoinDataCollection > TgcCoinDataContainer