ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | List of all members
Muon::MdtRdoToPrepDataToolMT::ConvCache Struct Reference

Helper struct to parse the event data around the tool. More...

#include <MdtRdoToPrepDataToolMT.h>

Collaboration diagram for Muon::MdtRdoToPrepDataToolMT::ConvCache:

Public Types

using PrdCollMap = std::unordered_map< IdentifierHash, std::unique_ptr< MdtPrepDataCollection > >
 

Public Member Functions

 ConvCache (const Muon::IMuonIdHelperSvc *idHelperSvc)
 
MdtPrepDataCollectioncreateCollection (const Identifier &id, MsgStream &msg)
 Creates a new MdtPrepDataCollection, if it's neccessary and also possible. More...
 
StatusCode finalize (MsgStream &msg)
 Copy the non-empty collections into the created prd container. More...
 

Public Attributes

Muon::MdtPrepDataContainerlegacyPrd {nullptr}
 
xAOD::MdtDriftCircleContainerxAODPrd {nullptr}
 
const Muon::IMuonIdHelperSvcm_idHelperSvc {nullptr}
 
const MuonGM::MuonDetectorManagerlegacyDetMgr {nullptr}
 Detector manager from the conditions store. More...
 
const ActsGeometryContextgctx {nullptr}
 Acts Geometry context. More...
 
bool isValid {false}
 Flag set to indicate that the complete validation was successful. More...
 
PrdCollMap addedCols {}
 

Detailed Description

Helper struct to parse the event data around the tool.

Definition at line 65 of file MdtRdoToPrepDataToolMT.h.

Member Typedef Documentation

◆ PrdCollMap

Definition at line 87 of file MdtRdoToPrepDataToolMT.h.

Constructor & Destructor Documentation

◆ ConvCache()

Muon::MdtRdoToPrepDataToolMT::ConvCache::ConvCache ( const Muon::IMuonIdHelperSvc idHelperSvc)
inline

Definition at line 66 of file MdtRdoToPrepDataToolMT.h.

66  :
67  m_idHelperSvc{idHelperSvc}{}

Member Function Documentation

◆ createCollection()

MdtPrepDataCollection * Muon::MdtRdoToPrepDataToolMT::ConvCache::createCollection ( const Identifier id,
MsgStream &  msg 
)

Creates a new MdtPrepDataCollection, if it's neccessary and also possible.

Nullptr is returned if the collection cannot be modified

Definition at line 47 of file MdtRdoToPrepDataToolMT.cxx.

47  {
48 
49  IdentifierHash mdtHashId = m_idHelperSvc->moduleHash(elementId);
50  if (static_cast<int>(mdtHashId) == -1) {
51  msg << MSG::ERROR << "Module hash creation failed. " << m_idHelperSvc->toString(elementId) << endmsg;
52  return nullptr;
53  }
54  PrdCollMap::iterator itr = addedCols.find(mdtHashId);
55  if (itr != addedCols.end()) return itr->second.get();
57  if (lock.alreadyPresent()) {
58  if (msg.level() <= MSG::DEBUG) {
59  msg << MSG::DEBUG << "MdtPrepDataCollection already contained in IDC " << elementId << " " << mdtHashId << endmsg;
60  }
61  return nullptr;
62  }
63  std::unique_ptr<MdtPrepDataCollection> newColl = std::make_unique<MdtPrepDataCollection>(mdtHashId);
64  newColl->setIdentifier(m_idHelperSvc->chamberId(elementId));
65  return addedCols.insert(std::make_pair(mdtHashId, std::move(newColl))).first->second.get();
66  }

◆ finalize()

StatusCode Muon::MdtRdoToPrepDataToolMT::ConvCache::finalize ( MsgStream &  msg)

Copy the non-empty collections into the created prd container.

Definition at line 67 of file MdtRdoToPrepDataToolMT.cxx.

67  {
68  for (auto& to_insert : addedCols) {
69  if (to_insert.second->empty()) continue;
71  if (lock.addOrDelete(std::move(to_insert.second)).isFailure()) {
72  msg << MSG::ERROR << " Failed to add prep data collection " << to_insert.first << endmsg;
73  return StatusCode::FAILURE;
74  }
75  }
76  if (xAODPrd) xAODPrd->lock();
77  return StatusCode::SUCCESS;
78  }

Member Data Documentation

◆ addedCols

PrdCollMap Muon::MdtRdoToPrepDataToolMT::ConvCache::addedCols {}

Definition at line 88 of file MdtRdoToPrepDataToolMT.h.

◆ gctx

const ActsGeometryContext* Muon::MdtRdoToPrepDataToolMT::ConvCache::gctx {nullptr}

Acts Geometry context.

Definition at line 82 of file MdtRdoToPrepDataToolMT.h.

◆ isValid

bool Muon::MdtRdoToPrepDataToolMT::ConvCache::isValid {false}

Flag set to indicate that the complete validation was successful.

Definition at line 85 of file MdtRdoToPrepDataToolMT.h.

◆ legacyDetMgr

const MuonGM::MuonDetectorManager* Muon::MdtRdoToPrepDataToolMT::ConvCache::legacyDetMgr {nullptr}

Detector manager from the conditions store.

Definition at line 80 of file MdtRdoToPrepDataToolMT.h.

◆ legacyPrd

Muon::MdtPrepDataContainer* Muon::MdtRdoToPrepDataToolMT::ConvCache::legacyPrd {nullptr}

Definition at line 75 of file MdtRdoToPrepDataToolMT.h.

◆ m_idHelperSvc

const Muon::IMuonIdHelperSvc* Muon::MdtRdoToPrepDataToolMT::ConvCache::m_idHelperSvc {nullptr}

Definition at line 78 of file MdtRdoToPrepDataToolMT.h.

◆ xAODPrd

xAOD::MdtDriftCircleContainer* Muon::MdtRdoToPrepDataToolMT::ConvCache::xAODPrd {nullptr}

Definition at line 76 of file MdtRdoToPrepDataToolMT.h.


The documentation for this struct was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Muon::MdtRdoToPrepDataToolMT::ConvCache::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: MdtRdoToPrepDataToolMT.h:78
IdentifiableContainerMT::IDC_WriteHandle
friend class IDC_WriteHandle
Definition: IdentifiableContainerMT.h:143
IdentifiableContainerMT::getWriteHandle
IDC_WriteHandle getWriteHandle(IdentifierHash hash)
Definition: IdentifiableContainerMT.h:251
Muon::MdtRdoToPrepDataToolMT::ConvCache::xAODPrd
xAOD::MdtDriftCircleContainer * xAODPrd
Definition: MdtRdoToPrepDataToolMT.h:76
Muon::IMuonIdHelperSvc::moduleHash
virtual IdentifierHash moduleHash(const Identifier &id) const =0
Returns the module hash associated to an Identifier.
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::IMuonIdHelperSvc::chamberId
virtual Identifier chamberId(const Identifier &id) const =0
create a chamber ID
Muon::MdtRdoToPrepDataToolMT::ConvCache::legacyPrd
Muon::MdtPrepDataContainer * legacyPrd
Definition: MdtRdoToPrepDataToolMT.h:75
Muon::IMuonIdHelperSvc::toString
virtual std::string toString(const Identifier &id) const =0
print all fields to string
Muon::MdtRdoToPrepDataToolMT::ConvCache::addedCols
PrdCollMap addedCols
Definition: MdtRdoToPrepDataToolMT.h:88
DEBUG
#define DEBUG
Definition: page_access.h:11
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7