ATLAS Offline Software
MbtsDetDescrManager.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "CaloDetDescr/CaloDetDescrElement.h"
7 
8 #include "GaudiKernel/Bootstrap.h"
9 #include "GaudiKernel/ISvcLocator.h"
10 #include "GaudiKernel/IMessageSvc.h"
11 #include "GaudiKernel/MsgStream.h"
12 
14  m_msgSvc(nullptr)
15 {
16  ISvcLocator* svcLoc = Gaudi::svcLocator();
17  StatusCode status = svcLoc->service( "MessageSvc", m_msgSvc);
18  if(status.isFailure() || m_msgSvc==nullptr)
19  std::cerr << "CaloDetDescrManager: Could not locate the MessageSvc!\n";
20 }
21 
23 {
24  for (auto& p : m_elements) {
25  delete p.second;
26  }
27 }
28 
30 {
31  MbtsElements::const_iterator it = m_elements.find(elementId);
32  if(it==m_elements.end())
33  return nullptr;
34  else
35  return it->second;
36 }
37 
39 {
40  MbtsElements::iterator it = m_elements.find(element->identify());
41  if(it==m_elements.end())
42  m_elements[element->identify()] = element;
43  else {
44  // Issue warning message and don't update map entry
45  if(m_msgSvc) {
46  MsgStream log(m_msgSvc, "MbtsDetDescrManager::add");
47  log << MSG::DEBUG << "Attempt to update map entry for ID=" << element->identify().getString() << ". Skipping" << endmsg;
48  }
49  }
50 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
skel.it
it
Definition: skel.GENtoEVGEN.py:423
MbtsDetDescrManager::~MbtsDetDescrManager
~MbtsDetDescrManager()
Definition: MbtsDetDescrManager.cxx:22
MbtsDetDescrManager.h
MbtsDetDescrManager::add
void add(CaloDetDescrElement *element)
Definition: MbtsDetDescrManager.cxx:38
CaloDetDescrElement::identify
Identifier identify() const override final
cell identifier
Definition: CaloDetDescrElement.cxx:64
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MbtsDetDescrManager::get_element
CaloDetDescrElement * get_element(const Identifier &elementId) const
Definition: MbtsDetDescrManager.cxx:29
MbtsDetDescrManager::m_elements
MbtsElements m_elements
Definition: MbtsDetDescrManager.h:27
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
DEBUG
#define DEBUG
Definition: page_access.h:11
MbtsDetDescrManager::MbtsDetDescrManager
MbtsDetDescrManager()
Definition: MbtsDetDescrManager.cxx:13
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
merge.status
status
Definition: merge.py:17
MbtsDetDescrManager::m_msgSvc
IMessageSvc * m_msgSvc
Definition: MbtsDetDescrManager.h:29