15#include "GaudiKernel/ISvcLocator.h"
16#include "GaudiKernel/Bootstrap.h"
17#include "GaudiKernel/StatusCode.h"
18#include "GaudiKernel/Service.h"
19#include "GaudiKernel/MsgStream.h"
32 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
33 CHECK( detStore.isValid() );
39 log << MSG::DEBUG <<
"Converter initialized." <<
endmsg;
40 return StatusCode::SUCCESS;
67 unsigned int collIndex;
68 unsigned int chanBegin = 0;
69 unsigned int chanEnd = 0;
79 for (collIndex = 0; it_Coll != it_CollEnd; ++collIndex, ++it_Coll) {
81 log << MSG::DEBUG <<
" New collection" <<
endmsg;
84 chanEnd += collection.
size();
88 pcollection.
m_begin = chanBegin;
89 pcollection.
m_end = chanEnd;
92 for (
unsigned int i = 0; i < collection.
size(); ++i) {
97 log << MSG::DEBUG <<
" *** Writing TgcCoinDataContainer ***" <<
endmsg;
123 log << MSG::DEBUG <<
" Reading " << persCont->
m_collections.size() <<
"Collections" <<
endmsg;
124 for (
unsigned int icoll = 0; icoll < persCont->
m_collections.size(); ++icoll) {
137 for (
unsigned int ichan = 0; ichan < nchans; ++ ichan) {
142 chan->m_detElOut = deOut;
147 chan->m_detElIn = deIn;
150 chan->m_detElIn =
nullptr;
152 (*coll)[ichan] = chan;
157 if (
sc.isFailure()) {
158 throw std::runtime_error(
"Failed to add collection to ID Container");
160 if (log.level() <= MSG::DEBUG) {
161 log << MSG::DEBUG <<
"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " << (int) collIDHash <<
" / " <<
166 log << MSG::DEBUG <<
" *** Reading TgcCoinDataContainer" <<
endmsg;
175 if (this->
initialize(log) != StatusCode::SUCCESS) {
176 log << MSG::FATAL <<
"Could not initialize TgcCoinDataContainerCnv_p3 " <<
endmsg;
182 return(trans.release());
188 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
StatusCode initialize(MsgStream &log)
const TgcIdHelper * m_TgcId
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
Muon::TgcCoinDataContainer TRANS
virtual void persToTrans(const PERS *persCont, TRANS *transCont, MsgStream &log)
virtual Muon::TgcCoinDataContainer * createTransient(const Muon::MuonCoinDataContainer_p1 *persObj, MsgStream &log)
const MuonGM::TgcReadoutElement * getReadOutElement(const Identifier &id) const
virtual void transToPers(const TRANS *transCont, PERS *persCont, MsgStream &log)
This class is an object reference used in Athena persistent data model.
MuonCoinDataCollection< TgcCoinData > TgcCoinDataCollection
MuonCoinDataContainer< TgcCoinDataCollection > TgcCoinDataContainer