88 {
89
90 std::ofstream geoModelStats;
91 int mem{0}, umem{0};
92 float cpu{0.f}, ucpu{0.f};
93
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;
99
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;
103 mem = umem;
104 cpu = ucpu;
105 }
106
107 ATH_MSG_VERBOSE(
" Show properties (user sett.s or default): LayoutName "
110 <<
" Show properties (user sett.s or default): IncludeCtbBis " <<
m_includeCtbBis);
111
112
113 SmartIF<IGeoModelSvc> geoModel{Gaudi::svcLocator()->service("GeoModelSvc")};
115
117 std::string MuonVersion = geoModel->muonVersionOverride();
118
120 ATH_MSG_INFO(
"(from GeoModelSvc) AtlasVersion = <" << AtlasVersion <<
"> MuonVersion = <" << MuonVersion <<
">");
121
122
123
124
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);
128
130 std::map<std::string, std::string> altAsciiDBMap{};
131
132
133
134 ServiceHandle<IGeoDbTagSvc> geoDbTag(
"GeoDbTagSvc",
name());
136 ServiceHandle<IRDBAccessSvc> accessSvc(geoDbTag->getParamSvcName(),
name());
138 GeoModelIO::ReadGeoModel* sqliteReader = geoDbTag->getSqliteReader();
139
140 if (sqliteReader) {
141
142 ATH_MSG_INFO(
"New DD Activated; Muon detector description input from SQLITE file");
143
144 MuonDetectorFactoryLite theFactory(detStore().operator->(),sqliteReader);
145 theFactory.setRDBAccess(accessSvc.get());
146 theFactory.create(world);
147
148
149 mgr=theFactory.getDetectorManager();
151 mgr->setGeometryVersion(tempLayout);
153
154 return StatusCode::SUCCESS;
155 }
156
157
158
159
160
161
162
163
164 MuonDetectorFactory001 theFactory(detStore().operator->());
166
167
168 ATH_MSG_DEBUG(
"Detector Information coming from the database (job options IGNORED)");
169
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;
174 }
175 const IRDBRecord *switches = (*switchSet)[0];
176
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 <<
">");
181 }
182
184
189
190
191
192
194 <<
" LayoutName " << tempLayout.substr(0, 1) <<
endmsg
200
207 return (StatusCode::FAILURE);
208 }
211 }
212
215 }
218 }
219 }
220
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;
226 mem = umem;
227 cpu = ucpu;
228 }
229
230 theFactory.setDBAtlasVersion(AtlasVersion);
231 theFactory.setDBMuonVersion(MuonVersion);
232 theFactory.setDBkey(detectorKey);
233 theFactory.setDBnode(detectorNode);
234 theFactory.setLayout(tempLayout);
246
247 theFactory.setRDBAccess(accessSvc.get());
248 theFactory.setAltAsciiDBMap(altAsciiDBMap);
249
250 theFactory.create(world);
251
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;
257 mem = umem;
258 cpu = ucpu;
259 }
260
261 mgr=theFactory.getDetectorManager();
263 return StatusCode::SUCCESS;
264}
#define ATH_MSG_VERBOSE(x)
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
virtual unsigned int size() const =0
static void SetSelectionType(int t)