![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "GaudiKernel/ISvcLocator.h"
15 #include "GaudiKernel/Bootstrap.h"
26 ISvcLocator* svcLocator = Gaudi::svcLocator();
31 return StatusCode::FAILURE;
36 sc = svcLocator->service(
"DetectorStore",
detStore);
39 return StatusCode::FAILURE;
48 return StatusCode::FAILURE;
55 return StatusCode::FAILURE;
59 return StatusCode::SUCCESS;
63 if (!cnv_tool)
return nullptr;
93 TRANS::const_iterator it_Coll = transCont->
begin();
94 TRANS::const_iterator it_CollEnd = transCont->
end();
95 unsigned int pcollIndex = 0;
96 unsigned int pcollBegin = 0;
97 unsigned int pcollEnd = 0;
103 for (pcollIndex = 0; it_Coll != it_CollEnd; ++pcollIndex, ++it_Coll) {
110 pcollBegin = pcollEnd;
111 pcollEnd += collection.
size();
118 persCont->
m_prds.resize(pcollEnd);
121 unsigned int lastPRDIdHash = 0;
122 for (
unsigned int i = 0;
i < collection.
size(); ++
i) {
123 unsigned int pchanIndex=
i+pcollBegin;
128 unsigned int clusIdCompact =
chan->identify().get_identifier32().get_compact();
131 persCont->
m_prdDeltaId[pchanIndex]=clusIdCompact - collIdCompact;
136 if (temp!=
chan->identify() )
137 log << MSG::WARNING <<
"PRD ids differ! Transient:"<<
chan->identify()<<
", From persistent:"<<temp<<
" diff = "<<
chan->identify().get_compact()-temp.
get_compact()<<
endmsg;
140 if (lastPRDIdHash && lastPRDIdHash !=
chan->collectionHash() )
log << MSG::WARNING <<
"Collection Identifier hashes differ!"<<
endmsg;
141 lastPRDIdHash =
chan->collectionHash();
143 if (
chan->collectionHash()!= collection.
identifyHash() )
log << MSG::WARNING <<
"Collection's idHash does not match PRD collection hash!"<<
endmsg;
144 if (
chan->detectorElement() !=getReadOutElement(
chan->identify()))
145 log << MSG::WARNING <<
"Getting de from identity didn't work!"<<
endmsg;
148 if (
chan->detectorElement() !=getReadOutElement(temp))
log << MSG::WARNING <<
"Getting de from reconstructed identity didn't work!"<<
endmsg;
177 unsigned int pchanIndex(0);
181 for (
unsigned int pcollIndex = 0; pcollIndex < pCollEnd; ++pcollIndex) {
191 unsigned int pchanEnd = pchanIndex+pcoll.
m_size;
192 unsigned int chanIndex = 0;
196 for (; pchanIndex < pchanEnd; ++ pchanIndex, ++chanIndex) {
203 int result = m_RpcId->get_detectorElement_hash(clusId, deIDHash);
205 log << MSG::WARNING<<
" Muon::RpcPrepDataContainerCnv_p3::persToTrans: problem converting Identifier to DE hash "<<
endmsg;
208 auto chan = std::make_unique<RpcPrepData>
215 chan->setHashAndIndex(collIDHash, chanIndex);
221 if (
sc.isFailure()) {
222 throw std::runtime_error(
"Failed to add collection to Identifiable Container");
225 log <<
MSG::DEBUG <<
"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " << (
int) collIDHash <<
" / " <<
241 if(!m_isInitialized) {
248 persToTrans(persObj, trans.get(),
log);
249 return(trans.release());
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
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,...
std::vector< PRD > m_prds
MuonPrepDataCollection< RpcPrepData > RpcPrepDataCollection
StoreGateSvc * m_storeGate
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
virtual void setIdentifier(Identifier id)
void transToPers(const Muon::RpcPrepData *transObj, Muon::RpcPrepData_p3 *persObj, MsgStream &log)
We don't write out (from Trk::PrepRawData) m_indexAndHash (can be recomputed), m_clusId (can be recom...
const MuonGM::RpcReadoutElement * getReadOutElement(const Identifier &id) const
The Athena Transient Store API.
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.
value_type get_compact(void) const
Get the compact id.
Class to represent RPC measurements.
virtual Muon::RpcPrepDataContainer * createTransient(const Muon::RpcPrepDataContainer_p3 *persObj, MsgStream &log)
::StatusCode StatusCode
StatusCode definition for legacy code.
Class to hold the persistent representation of MuonPRD_Collection.
virtual Identifier identify() const override final
StatusCode initialize(MsgStream &log)
const_iterator end() const
return const_iterator for end of container
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.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const RpcIdHelper * m_RpcId
unsigned int m_hashId
Hash Identifier of this collection.
std::vector< unsigned short > m_prdDeltaId
The delta identifiers of the PRD i.e.
value_type get_compact(void) const
Get the compact id.
static Muon::RpcPrepData createRpcPrepData(const Muon::RpcPrepData_p3 *persObj, const Identifier &id, const MuonGM::RpcReadoutElement *detEl, MsgStream &log)
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual void persToTrans(const Muon::RpcPrepDataContainer_p3 *persCont, Muon::RpcPrepDataContainer *transCont, MsgStream &log)
virtual void transToPers(const Muon::RpcPrepDataContainer *transCont, Muon::RpcPrepDataContainer_p3 *persCont, MsgStream &log)
unsigned int m_id
Identifier of this collection.