11#include "GeoModelKernel/GeoPerfUtils.h"
12#include "GeoModelKernel/GeoPhysVol.h"
33 declareInterface<IGeoModelTool>(
this);
38 return StatusCode::SUCCESS;
52 std::ofstream geoModelStats;
54 float cpu{0.f}, ucpu{0.f};
58 ATH_CHECK(detStore()->retrieve(theExpt,
"ATLAS"));
59 GeoIntrusivePtr<GeoPhysVol> world{theExpt->
getPhysVol()};
63 ATH_CHECK(detStore()->record(mgr,mgr->getName()));
70 umem = GeoPerfUtils::getMem();
71 ucpu = float(GeoPerfUtils::getCpu() / 100.);
72 geoModelStats <<
"At MuonDetectorTool::everything done \t SZ= " << umem <<
" Kb \t Time = " << ucpu <<
" seconds ---- \t DeltaM = " << umem - mem
73 <<
" \t Delta T =" << ucpu - cpu << std::endl;
74 geoModelStats.close();
80 unsigned int tgcHashMax =
m_manager->tgcIdHelper()->detectorElement_hash_max();
81 std::vector<int> *sectorHashVec =
new std::vector<int>(tgcHashMax, 0);
82 for (
unsigned int i = 0; i < tgcHashMax; ++i) {
85 (*sectorHashVec)[i] = mapping.getSector(detEl->
center().phi());
87 if (detStore()->record(sectorHashVec,
"TGC_SectorMapping").isFailure()) {
91 return StatusCode::SUCCESS;
96 std::ofstream geoModelStats;
98 float cpu{0.f}, ucpu{0.f};
102 geoModelStats.open(
"MuonGeoModelStatistics_MuonDetectorTool");
103 mem = GeoPerfUtils::getMem();
104 cpu = float(GeoPerfUtils::getCpu() / 100.);
105 geoModelStats <<
"At MuonDetectorTool::create entry point: \t SZ= " << mem <<
" Kb \t Time = " << cpu <<
" seconds " << std::endl;
107 umem = GeoPerfUtils::getMem();
108 ucpu = float(GeoPerfUtils::getCpu() / 100.);
109 geoModelStats <<
"At MuonDetectorTool::resetting to 0: \t SZ= " << umem - mem <<
" Kb \t Time = " << ucpu - cpu <<
" seconds " << std::endl;
114 ATH_MSG_VERBOSE(
" Show properties (user sett.s or default): LayoutName "
117 <<
" Show properties (user sett.s or default): IncludeCtbBis " <<
m_includeCtbBis);
120 SmartIF<IGeoModelSvc> geoModel{Gaudi::svcLocator()->service(
"GeoModelSvc")};
123 std::string AtlasVersion = geoModel->atlasVersion();
124 std::string MuonVersion = geoModel->muonVersionOverride();
127 ATH_MSG_INFO(
"(from GeoModelSvc) AtlasVersion = <" << AtlasVersion <<
"> MuonVersion = <" << MuonVersion <<
">");
132 std::string detectorKey = MuonVersion.empty() ? AtlasVersion : MuonVersion;
133 std::string detectorNode = MuonVersion.empty() ?
"ATLAS" :
"MuonSpectrometer";
134 ATH_MSG_INFO(
"Keys for Muon Switches are (key) " << detectorKey <<
" (node) " << detectorNode);
137 std::map<std::string, std::string> altAsciiDBMap{};
145 GeoModelIO::ReadGeoModel* sqliteReader = geoDbTag->getSqliteReader();
149 ATH_MSG_INFO(
"New DD Activated; Muon detector description input from SQLITE file");
158 mgr->setGeometryVersion(tempLayout);
161 return StatusCode::SUCCESS;
175 if (MuonVersion ==
"CUSTOM")
176 ATH_MSG_WARNING(
"Detector Information coming from a custom configuration !!");
179 ATH_MSG_DEBUG(
"Detector Information coming from the database (job options IGNORED)");
181 IRDBRecordset_ptr switchSet = accessSvc->getRecordsetPtr(
"MuonSwitches", detectorKey, detectorNode);
182 if ((*switchSet).size() == 0)
183 return StatusCode::FAILURE;
187 tempLayout = switches->
getString(
"LAYOUTNAME");
190 if (MuonVersion.empty()) {
191 MuonVersion = accessSvc->getChildTag(
"MuonSpectrometer", detectorKey, detectorNode);
192 ATH_MSG_INFO(
"(from GeoModelSvc) in AtlasVersion = <" << AtlasVersion <<
"> default MuonVersion is <" << MuonVersion <<
">");
209 <<
" LayoutName " << tempLayout.substr(0, 1) <<
endmsg
222 return (StatusCode::FAILURE);
239 umem = GeoPerfUtils::getMem();
240 ucpu = float(GeoPerfUtils::getCpu() / 100.);
241 geoModelStats <<
"At MuonDetectorTool::material mgr done \t SZ= " << umem <<
" Kb \t Time = " << ucpu <<
" seconds ---- \t DeltaM = " << umem - mem
242 <<
" \t Delta T =" << ucpu - cpu << std::endl;
275 }
catch (
const std::bad_alloc &) {
277 return StatusCode::FAILURE;
281 umem = GeoPerfUtils::getMem();
282 ucpu = float(GeoPerfUtils::getCpu() / 100.);
283 geoModelStats <<
"At MuonDetectorTool::factory created \t SZ= " << umem <<
" Kb \t Time = " << ucpu <<
" seconds ---- \t DeltaM = " << umem - mem
284 <<
" \t Delta T =" << ucpu - cpu << std::endl;
290 umem = GeoPerfUtils::getMem();
291 ucpu = float(GeoPerfUtils::getCpu() / 100.);
292 geoModelStats <<
"At MuonDetectorTool::trk cache done \t SZ= " << umem <<
" Kb \t Time = " << ucpu <<
" seconds ---- \t DeltaM = " << umem - mem
293 <<
" \t Delta T =" << ucpu - cpu << std::endl;
300 return StatusCode::SUCCESS;
309 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 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.