|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "GaudiKernel/ISvcLocator.h"
16 #include "GaudiKernel/Bootstrap.h"
28 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
37 return StatusCode::SUCCESS;
42 if (!cnv_tool)
return nullptr;
67 TRANS::const_iterator it_Coll = transCont->
begin();
68 TRANS::const_iterator it_CollEnd = transCont->
end();
69 unsigned int pcollIndex =0;
70 unsigned int pcollBegin = 0;
71 unsigned int pcollEnd = 0;
77 for (pcollIndex = 0; it_Coll != it_CollEnd; ++pcollIndex, ++it_Coll) {
84 pcollBegin = pcollEnd;
85 pcollEnd += collection.
size();
92 persCont->
m_prds.resize(pcollEnd);
95 for (
unsigned int i = 0;
i < collection.
size(); ++
i) {
96 unsigned int pchanIndex=
i+pcollBegin;
128 unsigned int pchanIndex(0);
132 for (
unsigned int pcollIndex = 0; pcollIndex < pCollEnd; ++pcollIndex) {
142 unsigned int pchanEnd = pchanIndex+pcoll.
m_size;
143 unsigned int chanIndex = 0;
147 for (; pchanIndex < pchanEnd; ++ pchanIndex, ++chanIndex) {
154 int result = m_MdtId->get_detectorElement_hash(clusId, deIDHash);
156 log << MSG::WARNING<<
" Muon::MdtPrepDataContainerCnv_p2::persToTrans: problem converting Identifier to DE hash "<<
endmsg;
159 auto chan = std::make_unique<MdtPrepData>
165 chan->setHashAndIndex(collIDHash, chanIndex);
171 if (
sc.isFailure()) {
172 throw std::runtime_error(
"Failed to add collection to Identifiable Container");
175 log <<
MSG::DEBUG <<
"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " << (
int) collIDHash <<
" / " <<
189 if(!m_isInitialized) {
190 if (this->
initialize(log) != StatusCode::SUCCESS) {
196 persToTrans(persObj, trans.get(),
log);
197 return(trans.release());
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
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,...
StatusCode initialize(MsgStream &log)
std::vector< PRD > m_prds
MuonPrepDataCollection< MdtPrepData > MdtPrepDataCollection
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
value_type get_compact() const
Get the compact id.
virtual void setIdentifier(Identifier id)
value_type get_compact() const
Get the compact id.
const MdtIdHelper * m_MdtId
virtual IdentifierHash identifyHash() const override final
virtual size_t numberOfCollections() const override final
return number of collections
unsigned short m_size
Collection size into master collection Note I use a short.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class to hold the persistent representation of MuonPRD_Collection.
Persistent representation of the transient Muon::MdtPrepData class.
static Muon::MdtPrepData createMdtPrepData(const Muon::MdtPrepData_p2 *persObj, const Identifier &id, const MuonGM::MdtReadoutElement *detEl, MsgStream &log)
virtual Identifier identify() const override final
const_iterator end() const
return const_iterator for end of container
#define CHECK(...)
Evaluate an expression and check for errors.
const MuonGM::MdtReadoutElement * getReadOutElement(const Identifier &id) const
const_iterator begin() const
return const_iterator for first entry
std::vector< MuonPRD_Collection_p2 > m_collections
Template to hold collections of MuonPrepRawData objects.
Class to contain the Muon Prep Raw Data.
Helpers for checking error return status codes and reporting errors.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Class to represent measurements from the Monitored Drift Tubes.
unsigned int m_hashId
Hash Identifier of this collection.
virtual Muon::MdtPrepDataContainer * createTransient(const Muon::MdtPrepDataContainer_p2 *persObj, MsgStream &log)
void transToPers(const Muon::MdtPrepData *transObj, Muon::MdtPrepData_p2 *persObj, MsgStream &log)
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
std::vector< unsigned short > m_prdDeltaId
The delta identifiers of the PRD i.e.
virtual void transToPers(const Muon::MdtPrepDataContainer *transCont, Muon::MdtPrepDataContainer_p2 *persCont, MsgStream &log)
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
virtual void persToTrans(const Muon::MdtPrepDataContainer_p2 *persCont, Muon::MdtPrepDataContainer *transCont, MsgStream &log)
size_type size() const noexcept
Returns the number of elements in the collection.
unsigned int m_id
Identifier of this collection.