ATLAS Offline Software
Loading...
Searching...
No Matches
MbtsDetDescrManager.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "CaloDetDescr/CaloDetDescrElement.h"
7
9#include "GaudiKernel/MsgStream.h"
10
14
16{
17 for (auto& p : m_elements) {
18 delete p.second;
19 }
20}
21
23{
24 MbtsElements::const_iterator it = m_elements.find(elementId);
25 if(it==m_elements.end())
26 return nullptr;
27 else
28 return it->second;
29}
30
32{
33 MbtsElements::iterator it = m_elements.find(element->identify());
34 if(it==m_elements.end())
35 m_elements[element->identify()] = element;
36 else {
37 // Issue warning message and don't update map entry
38 MsgStream log(Athena::getMessageSvc(), "MbtsDetDescrManager");
39 if (log.level() <= MSG::DEBUG) {
40 log << MSG::DEBUG << "Attempt to update map entry for ID=" << element->identify().getString() << ". Skipping" << endmsg;
41 }
42 }
43}
#define endmsg
This class groups all DetDescr information related to a CaloCell.
Identifier identify() const override final
cell identifier
std::string getString() const
Provide a string form of the identifier - hexadecimal.
void add(CaloDetDescrElement *element)
CaloDetDescrElement * get_element(const Identifier &elementId) const
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)