ATLAS Offline Software
Loading...
Searching...
No Matches
FPVMAP.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8#include "GaudiKernel/MsgStream.h"
10
11#include <GaudiKernel/IMessageSvc.h>
12#include <iostream>
13#include <utility>
14
15namespace MuonGM {
16
17 GeoVPhysVol *FPVMAP::GetDetector(const std::string& name) {
18 if (m_Detectors.find(name) != m_Detectors.end()) {
19 m_nreused++;
20 // std::cout<<"FPVMAP:: the pointer to "<<name
21 // <<" is already stored; saving memory "<<m_nreused<<std::endl;
22 return m_Detectors[name];
23 } else
24 return nullptr;
25 }
26
27 void FPVMAP::StoreDetector(GeoVPhysVol *s, const std::string& name) {
28 // std::cout<<"FPVMAP:: store the pointer to "<<name<<std::endl;
29 m_Detectors[name] = s;
30 }
31
33 MsgStream log(Athena::getMessageSvc(), "MuonGM::FPVMAP");
34
35 for (const auto& p : m_Detectors) {
36 log << MSG::INFO << "---> A PhysVol corresponds to " << p.first << endmsg;
37 }
38 }
39
40} // namespace MuonGM
#define endmsg
int m_nreused
Definition FPVMAP.h:32
void PrintAllDetectors()
Definition FPVMAP.cxx:32
GeoVPhysVol * GetDetector(const std::string &name)
Definition FPVMAP.cxx:17
void StoreDetector(GeoVPhysVol *s, const std::string &name)
Definition FPVMAP.cxx:27
std::map< std::string, GeoVPhysVol * > m_Detectors
Definition FPVMAP.h:31
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27