![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "GaudiKernel/Bootstrap.h"
16 #include "GaudiKernel/ISvcLocator.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;
68 if (!m_isInitialized) {
69 if (this->
initialize(log) != StatusCode::SUCCESS) {
90 unsigned int pcollEnd = 0;
95 for (
unsigned int pcollIndex = 0; it_Coll != it_CollEnd; ++pcollIndex, ++it_Coll) {
103 pcollEnd += collection.
size();
109 persCont->
m_prds.reserve(pcollEnd);
112 for (
unsigned int i = 0;
i < collection.
size(); ++
i) {
120 int multilayer = (m_MMId->multilayer(chan_id) - 1);
121 int gasGap = (m_MMId->gasGap(chan_id) - 1);
134 if (
log.level() <= MSG::WARNING &&
chan->detectorElement()->identify() != ele_from_mgr->
identify()) {
135 log << MSG::WARNING <<
"DE from det manager (" << m_MMId->print_to_string(ele_from_mgr->
identify())
136 <<
") does not match that from PRD (" << m_MMId->print_to_string(
chan->detectorElement()->identify()) <<
") for PRD "
137 << m_MMId->print_to_string(chan_id) <<
endmsg;
139 persCont->
m_prds.emplace_back(std::move(pchan));
164 unsigned int pchanIndex(0);
167 for (
unsigned int pcollIndex = 0; pcollIndex < pCollEnd; ++pcollIndex) {
175 unsigned int pchanEnd = pchanIndex + pcoll.
m_size;
176 unsigned int chanIndex = 0;
180 for (; pchanIndex < pchanEnd; ++pchanIndex, ++chanIndex) {
188 int multilayer = (1 &
diff);
191 log <<
MSG::DEBUG <<
"Diff of " <<
diff <<
" translated into multilayer=" << multilayer <<
", gasGap=" <<
gasGap
197 if (
log.level() <= MSG::WARNING) {
198 log << MSG::WARNING <<
"Muon::MMPrepDataContainerCnv_p2::persToTrans: could not get valid det element for PRD with id="
199 << m_MMId->show_to_string(clusId) <<
". Skipping." <<
endmsg;
206 if (!m_MMId->valid(
chan->identify())) {
207 log << MSG::WARNING <<
"MM PRD has invalid Identifier of " <<
chan->identify().get_compact()
208 <<
" - are you sure you have the correct geometry loaded, and NSW enabled?" <<
endmsg;
214 chan->setHashAndIndex(collIDHash, chanIndex);
220 if (
sc.isFailure()) {
throw std::runtime_error(
"Failed to add collection to Identifiable Container"); }
222 log <<
MSG::DEBUG <<
"AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id/coll id = " << (
int)collIDHash <<
" / "
230 if (!m_isInitialized) {
231 if (this->
initialize(log) != StatusCode::SUCCESS) {
236 std::unique_ptr<Muon::MMPrepDataContainer> trans = std::make_unique<Muon::MMPrepDataContainer>(m_MMId->module_hash_max());
237 persToTrans(persObj, trans.get(),
log);
238 return (trans.release());
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
virtual Muon::MMPrepDataContainer * createTransient(const Muon::MMPrepDataContainer_p2 *persObj, MsgStream &log)
StatusCode initialize(MsgStream &log)
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Class to represent MM measurements.
StoreGateSvc * m_storeGate
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
static Muon::MMPrepData createMMPrepData(const Muon::MMPrepData_p2 *persObj, Identifier clusId, const MuonGM::MMReadoutElement *detEl, MsgStream &log)
function used to create an MMPrepDataObject when converting Pers to trans
virtual void transToPers(const Muon::MMPrepDataContainer *transCont, Muon::MMPrepDataContainer_p2 *persCont, MsgStream &log)
void transToPers(const Muon::MMPrepData *transObj, Muon::MMPrepData_p2 *persObj, MsgStream &log)
virtual void setIdentifier(Identifier id)
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.
const MuonGM::MMReadoutElement * getReadOutElement(const Identifier &id) const
value_type get_compact(void) const
Get the compact id.
::StatusCode StatusCode
StatusCode definition for legacy code.
We don't write out (from Trk::PrepRawData) m_indexAndHash (can be recomputed), m_clusId (can be recom...
Class to hold the persistent representation of MuonPRD_Collection.
virtual Identifier identify() const override final
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 MmIdHelper * m_MMId
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.
value_type get_compact(void) const
Get the compact id.
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
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
virtual void persToTrans(const Muon::MMPrepDataContainer_p2 *persCont, Muon::MMPrepDataContainer *transCont, MsgStream &log)
size_type size() const noexcept
Returns the number of elements in the collection.
unsigned int m_id
Identifier of this collection.