11#include "GeoModelKernel/GeoPerfUtils.h"
12#include "GeoModelKernel/GeoPhysVol.h"
33 declareInterface<IGeoModelTool>(
this);
40 return StatusCode::SUCCESS;
48 std::ofstream geoModelStats;
50 float cpu{0.f}, ucpu{0.f};
54 ATH_CHECK(detStore()->retrieve(theExpt,
"ATLAS"));
55 GeoIntrusivePtr<GeoPhysVol> world{theExpt->
getPhysVol()};
58 ATH_CHECK(detStore()->record(mgr,mgr->getName()));
64 umem = GeoPerfUtils::getMem();
65 ucpu = float(GeoPerfUtils::getCpu() / 100.);
66 geoModelStats <<
"At MuonDetectorTool::everything done \t SZ= " << umem <<
" Kb \t Time = " << ucpu <<
" seconds ---- \t DeltaM = " << umem - mem
67 <<
" \t Delta T =" << ucpu - cpu << std::endl;
68 geoModelStats.close();
74 unsigned int tgcHashMax =
m_manager->tgcIdHelper()->detectorElement_hash_max();
75 std::vector<int> *sectorHashVec =
new std::vector<int>(tgcHashMax, 0);
76 for (
unsigned int i = 0; i < tgcHashMax; ++i) {
79 (*sectorHashVec)[i] = mapping.getSector(detEl->
center().phi());
81 if (detStore()->record(sectorHashVec,
"TGC_SectorMapping").isFailure()) {
85 return StatusCode::SUCCESS;
90 std::ofstream geoModelStats;
92 float cpu{0.f}, ucpu{0.f};
95 geoModelStats.open(
"MuonGeoModelStatistics_MuonDetectorTool");
96 mem = GeoPerfUtils::getMem();
97 cpu = float(GeoPerfUtils::getCpu() / 100.);
98 geoModelStats <<
"At MuonDetectorTool::create entry point: \t SZ= " << mem <<
" Kb \t Time = " << cpu <<
" seconds " << std::endl;
100 umem = GeoPerfUtils::getMem();
101 ucpu = float(GeoPerfUtils::getCpu() / 100.);
102 geoModelStats <<
"At MuonDetectorTool::resetting to 0: \t SZ= " << umem - mem <<
" Kb \t Time = " << ucpu - cpu <<
" seconds " << std::endl;
107 ATH_MSG_VERBOSE(
" Show properties (user sett.s or default): LayoutName "
110 <<
" Show properties (user sett.s or default): IncludeCtbBis " <<
m_includeCtbBis);
113 SmartIF<IGeoModelSvc> geoModel{Gaudi::svcLocator()->service(
"GeoModelSvc")};
116 std::string AtlasVersion = geoModel->atlasVersion();
117 std::string MuonVersion = geoModel->muonVersionOverride();
120 ATH_MSG_INFO(
"(from GeoModelSvc) AtlasVersion = <" << AtlasVersion <<
"> MuonVersion = <" << MuonVersion <<
">");
125 std::string detectorKey = MuonVersion.empty() ? AtlasVersion : MuonVersion;
126 std::string detectorNode = MuonVersion.empty() ?
"ATLAS" :
"MuonSpectrometer";
127 ATH_MSG_INFO(
"Keys for Muon Switches are (key) " << detectorKey <<
" (node) " << detectorNode);
130 std::map<std::string, std::string> altAsciiDBMap{};
138 GeoModelIO::ReadGeoModel* sqliteReader = geoDbTag->getSqliteReader();
142 ATH_MSG_INFO(
"New DD Activated; Muon detector description input from SQLITE file");
151 mgr->setGeometryVersion(tempLayout);
154 return StatusCode::SUCCESS;
168 ATH_MSG_DEBUG(
"Detector Information coming from the database (job options IGNORED)");
170 IRDBRecordset_ptr switchSet = accessSvc->getRecordsetPtr(
"MuonSwitches", detectorKey, detectorNode);
171 if (switchSet->
size() == 0) {
172 ATH_MSG_ERROR(
"Failed to retrieve MuonSwitches from the database!");
173 return StatusCode::FAILURE;
177 tempLayout = switches->
getString(
"LAYOUTNAME");
178 if (MuonVersion.empty()) {
179 MuonVersion = accessSvc->getChildTag(
"MuonSpectrometer", detectorKey, detectorNode);
180 ATH_MSG_INFO(
"(from GeoModelSvc) in AtlasVersion = <" << AtlasVersion <<
"> default MuonVersion is <" << MuonVersion <<
">");
194 <<
" LayoutName " << tempLayout.substr(0, 1) <<
endmsg
207 return (StatusCode::FAILURE);
222 umem = GeoPerfUtils::getMem();
223 ucpu = float(GeoPerfUtils::getCpu() / 100.);
224 geoModelStats <<
"At MuonDetectorTool::material mgr done \t SZ= " << umem <<
" Kb \t Time = " << ucpu <<
" seconds ---- \t DeltaM = " << umem - mem
225 <<
" \t Delta T =" << ucpu - cpu << std::endl;
253 umem = GeoPerfUtils::getMem();
254 ucpu = float(GeoPerfUtils::getCpu() / 100.);
255 geoModelStats <<
"At MuonDetectorTool::factory created \t SZ= " << umem <<
" Kb \t Time = " << ucpu <<
" seconds ---- \t DeltaM = " << umem - mem
256 <<
" \t Delta T =" << ucpu - cpu << std::endl;
263 return StatusCode::SUCCESS;
272 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
Definition of the abstract IRDBAccessSvc interface.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition of the abstract IRDBRecord interface.
Definition of the abstract IRDBRecordset interface.
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)
IRDBRecord is one record in the IRDBRecordset object.
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
virtual unsigned int size() const =0
virtual const Amg::Vector3D & center() const override
Return the center of the element.
void setDumpMemoryBreakDown(bool value)
void setFineClashFixingFlag(int value)
void setCutoutsBogFlag(int)
void setAltAsciiDBMap(const AltAsciiDBMap &asciidbmap)
void setDBMuonVersion(const std::string &v)
void setMinimalGeoFlag(int minimalGeo)
virtual void create(GeoPhysVol *world) override
void setDBnode(const std::string &v)
void setSelection(const std::vector< std::string > &, const std::vector< int > &, const std::vector< int > &)
void setRDBAccess(IRDBAccessSvc *access)
virtual const MuonDetectorManager * getDetectorManager() const override
void setDBkey(const std::string &v)
void disableBEEShift(bool flag)
void setDBAtlasVersion(const std::string &v)
void setLayout(const std::string &str)
virtual void create(GeoPhysVol *world) override
void setRDBAccess(IRDBAccessSvc *access)
virtual const MuonDetectorManager * getDetectorManager() const override
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
static void SetSelectionType(int t)
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Ensure that the Athena extensions are properly loaded.
static constexpr CLID ID()