|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "GaudiKernel/Bootstrap.h"
16 #include "GaudiKernel/ISvcLocator.h"
27 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
36 return StatusCode::SUCCESS;
40 if (!cnv_tool)
return nullptr;
45 if (!m_isInitialized) {
46 if (this->
initialize(log) != StatusCode::SUCCESS) {
67 unsigned int pcollEnd = 0;
72 for (
unsigned int pcollIndex = 0; it_Coll != it_CollEnd; ++pcollIndex, ++it_Coll) {
80 pcollEnd += collection.
size();
86 persCont->
m_prds.reserve(pcollEnd);
89 for (
unsigned int i = 0;
i < collection.
size(); ++
i) {
97 int multilayer = (m_MMId->multilayer(chan_id) - 1);
98 int gasGap = (m_MMId->gasGap(chan_id) - 1);
111 if (
log.level() <= MSG::WARNING &&
chan->detectorElement()->identify() != ele_from_mgr->
identify()) {
112 log << MSG::WARNING <<
"DE from det manager (" << m_MMId->print_to_string(ele_from_mgr->
identify())
113 <<
") does not match that from PRD (" << m_MMId->print_to_string(
chan->detectorElement()->identify()) <<
") for PRD "
114 << m_MMId->print_to_string(chan_id) <<
endmsg;
116 persCont->
m_prds.emplace_back(std::move(pchan));
141 unsigned int pchanIndex(0);
144 for (
unsigned int pcollIndex = 0; pcollIndex < pCollEnd; ++pcollIndex) {
152 unsigned int pchanEnd = pchanIndex + pcoll.
m_size;
153 unsigned int chanIndex = 0;
157 for (; pchanIndex < pchanEnd; ++pchanIndex, ++chanIndex) {
165 int multilayer = (1 &
diff);
168 log <<
MSG::DEBUG <<
"Diff of " <<
diff <<
" translated into multilayer=" << multilayer <<
", gasGap=" <<
gasGap
174 if (
log.level() <= MSG::WARNING) {
175 log << MSG::WARNING <<
"Muon::MMPrepDataContainerCnv_p1::persToTrans: could not get valid det element for PRD with id="
176 << m_MMId->show_to_string(clusId) <<
". Skipping." <<
endmsg;
183 if (!m_MMId->valid(
chan->identify())) {
184 log << MSG::WARNING <<
"MM PRD has invalid Identifier of " <<
chan->identify().get_compact()
185 <<
" - are you sure you have the correct geometry loaded, and NSW enabled?" <<
endmsg;
191 chan->setHashAndIndex(collIDHash, chanIndex);
197 if (
sc.isFailure()) {
throw std::runtime_error(
"Failed to add collection to Identifiable Container"); }
199 log <<
MSG::DEBUG <<
"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " << (
int)collIDHash <<
" / "
207 if (!m_isInitialized) {
208 if (this->
initialize(log) != StatusCode::SUCCESS) {
213 std::unique_ptr<Muon::MMPrepDataContainer> trans = std::make_unique<Muon::MMPrepDataContainer>(m_MMId->module_hash_max());
214 persToTrans(persObj, trans.get(),
log);
215 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).
Class to represent MM measurements.
const MmIdHelper * m_MMId
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
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 Muon::MMPrepDataContainer * createTransient(const Muon::MMPrepDataContainer_p1 *persObj, MsgStream &log)
static Muon::MMPrepData createMMPrepData(const Muon::MMPrepData_p1 *persObj, Identifier clusId, const MuonGM::MMReadoutElement *detEl, MsgStream &log)
function used to create an MMPrepDataObject when converting Pers to trans
virtual void setIdentifier(Identifier id)
value_type get_compact() const
Get the compact id.
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.
StatusCode initialize(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_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.
We don't write out (from Trk::PrepRawData) m_indexAndHash (can be recomputed), m_clusId (can be recom...
unsigned int m_hashId
Hash Identifier of this collection.
MuonPrepDataCollection< MMPrepData > MMPrepDataCollection
std::vector< unsigned short > m_prdDeltaId
The delta identifiers of the PRD i.e.
virtual void transToPers(const Muon::MMPrepDataContainer *transCont, Muon::MMPrepDataContainer_p1 *persCont, MsgStream &log)
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
virtual void persToTrans(const Muon::MMPrepDataContainer_p1 *persCont, Muon::MMPrepDataContainer *transCont, MsgStream &log)
void transToPers(const Muon::MMPrepData *transObj, Muon::MMPrepData_p1 *persObj, MsgStream &log)
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
size_type size() const noexcept
Returns the number of elements in the collection.
const MuonGM::MMReadoutElement * getReadOutElement(const Identifier &id) const
unsigned int m_id
Identifier of this collection.