ATLAS Offline Software
Loading...
Searching...
No Matches
MuonDetectorFactory001.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8#include "GaudiKernel/MsgStream.h"
9#include "GaudiKernel/SystemOfUnits.h"
10#include "GeoGenericFunctions/Variable.h"
12#include "GeoModelKernel/GeoAlignableTransform.h"
13#include "GeoModelKernel/GeoBox.h"
14#include "GeoModelKernel/GeoDefinitions.h"
15#include "GeoModelKernel/GeoFullPhysVol.h"
16#include "GeoModelKernel/GeoIdentifierTag.h"
17#include "GeoModelKernel/GeoLogVol.h"
18#include "GeoModelKernel/GeoMaterial.h"
19#include "GeoModelKernel/GeoNameTag.h"
20#include "GeoModelKernel/GeoPcon.h"
21#include "GeoModelKernel/GeoPerfUtils.h"
22#include "GeoModelKernel/GeoPgon.h"
23#include "GeoModelKernel/GeoPhysVol.h"
24#include "GeoModelKernel/GeoSerialTransformer.h"
25#include "GeoModelKernel/GeoShapeShift.h"
26#include "GeoModelKernel/GeoShapeSubtraction.h"
27#include "GeoModelKernel/GeoShapeUnion.h"
28#include "GeoModelKernel/GeoTransform.h"
29#include "GeoModelKernel/GeoTrap.h"
30#include "GeoModelKernel/GeoTrd.h"
31#include "GeoModelKernel/GeoTube.h"
35#include "MuonGeoModel/FPVMAP.h"
36#include "MuonGeoModel/MYSQL.h"
47
48#include <fstream>
49#include <iomanip>
50#include <sstream>
51#include <stdexcept>
52#include <vector>
53
54using my_sstream = std::stringstream;
55using my_osstream = std::ostringstream;
56
57// The objects for mapping plane indexes in MuonSystem to the record index in RDBRecordset
58using muonsysIndMap = std::map<int, unsigned int, std::less<int>>;
59
60using namespace GeoGenfun;
61using namespace GeoXF;
62
63#define skip_chambers false
64#define skip_toroids false
65#define skip_shielding false
66#define skip_caloSaddle true
67#define useAssemblies false
68
69namespace MuonGM {
70
72 m_muon (std::make_unique< MuonSystemDescription>("MuonSystem")),
73 m_pDetStore{pDetStore} {
74 m_muon->barrelInnerRadius = 4.30 * Gaudi::Units::m;
75 m_muon->innerRadius = 0.07 * Gaudi::Units::m;
76 m_muon->outerRadius = 13.00 * Gaudi::Units::m;
77 m_muon->endcapFrontFace = 6.74 * Gaudi::Units::m;
78 m_muon->length = 22.03 * Gaudi::Units::m;
79 m_muon->barreLength = 6.53 * Gaudi::Units::m;
80 m_muon->barrelInterRadius = 3.83 * Gaudi::Units::m;
81 m_muon->extraZ = 12.9 * Gaudi::Units::m;
82 m_muon->extraR = 12.5 * Gaudi::Units::m;
83
84 MsgStream log(Athena::getMessageSvc(), "MuonGeoModel");
85 log << MSG::INFO << "MuonDetectorFactory - constructor "
86 << " MuonSystem OuterRadius " << m_muon->outerRadius << " Length " << m_muon->length << endmsg;
87 }
88
90
93
94 void MuonDetectorFactory001::create(GeoPhysVol *world) {
95 MsgStream log(Athena::getMessageSvc(), "MuGM:MuonFactory");
96
97 int mem = 0;
98 float cpu = 0;
99 int umem = 0;
100 float ucpu = 0;
101 std::ofstream geoModelStats;
103 geoModelStats.open("MuonGeoModelStatistics_MuonDetectorFactory");
104
105 mem = GeoPerfUtils::getMem();
106 cpu = int(GeoPerfUtils::getCpu() / 100.);
107
108 geoModelStats << "At MuonDetectorFactory::create entry point: \t SZ= " << mem << " Kb \t Time = " << cpu << " seconds " << std::endl;
109
110 umem = GeoPerfUtils::getMem();
111 ucpu = int(GeoPerfUtils::getCpu() / 100.);
112 geoModelStats << "At MuonDetectorFactory::resetting to 0: \t SZ= " << umem - mem << " Kb \t Time = " << ucpu - cpu << " seconds " << std::endl;
113 mem = umem;
114 cpu = ucpu;
115 } // if (m_dumpMemoryBreakDown) {
116
117 if (!m_manager)
119
120 // check consistency of flags coming from the tool
123 log << MSG::INFO << "MuonLayout set to <" << m_layout << "> = Development version for DC3 - infrastructures " << endmsg;
124 log << MSG::INFO << " BOG cutouts are activated " << m_includeCutoutsBog << " , all other cutouts are disabled " << m_includeCutouts << endmsg;
125
126 // set here the flag defining the geometry granularity
127 // minimalgeo = 1 => The geo tree is built up to the Detector Level (Full PhysVol)
128 // no internal structure of the Detector is built
129 // minimalgeo = 0 => The geo tree is built in full details
130 m_manager->setMinimalGeoFlag(m_minimalGeoFlag);
131
132 m_manager->setGeometryVersion(m_layout);
133 m_manager->set_DBMuonVersion(m_DBMuonVersion);
134
135 log << MSG::INFO << "Manager created for geometry version " << m_manager->geometryVersion() << " from DB MuonVersion <" << m_manager->get_DBMuonVersion() << ">" << endmsg;
136
137 // here create the MYSQL singleton and assign to it the geometry version
140 mysql->set_amdb_from_RDB(m_rdb == 1);
141
142
143 StatusCode sc = StatusCode::SUCCESS;
144
145
146 log << MSG::INFO << "MDTIDHELPER retrieved from DetStore" << endmsg;
147 log << MSG::INFO << "RPCIDHELPER retrieved from DetStore" << endmsg;
148 log << MSG::INFO << "TGCIDHELPER retrieved from DetStore" << endmsg;
149
150 if (m_hasCSC) {
151 log << MSG::INFO << "CSCIDHELPER retrieved from DetStore" << endmsg;
152 }
153 if (m_hasSTgc) {
154 log << MSG::INFO << "STGCIDHELPER retrieved from DetStore" << endmsg;
155 }
156 if (m_hasMM) {
157 log << MSG::INFO << "MMIDHELPER retrieved from DetStore" << endmsg;
158 }
159
161 umem = GeoPerfUtils::getMem();
162 ucpu = int(GeoPerfUtils::getCpu() / 100.);
163 geoModelStats << "At MuonDetectorFactory::IdHelpers loaded \t SZ= " << umem << " Kb \t Time = " << ucpu << " seconds ---- \t DeltaM = " << umem - mem
164 << " \t Delta T =" << ucpu - cpu << std::endl;
165 mem = umem;
166 cpu = ucpu;
167 }
168
169 log << MSG::INFO << " **************** MuonDetectorFactory001 ************************" << endmsg;
170 log << " *** Start building the Muon Geometry Tree **********************" << endmsg;
171
172 std::string OracleTag = m_DBkey;
173 std::string OracleNode = m_DBnode;
174
175 if (log.level() <= MSG::DEBUG)
176 log << MSG::DEBUG << "calling RDBReaderAtlas with m_altAsciiDBMap" << endmsg;
177
178 std::unique_ptr<RDBReaderAtlas> dbr =std::make_unique<RDBReaderAtlas>(m_pDetStore, m_pRDBAccess, OracleTag, OracleNode, m_altAsciiDBMap);
179
180
181 // set here the flag deciding whether to include cutouts:
182 // m_includeCutouts = 1 => include cutouts
183 // m_includeCutouts = 0 => no cutouts
184 m_manager->setCutoutsFlag(m_includeCutouts);
185 m_manager->setCutoutsBogFlag(m_includeCutoutsBog);
186
187 dbr->setGeometryVersion(m_layout);
188 dbr->setManager(getDetectorManager());
189 sc = dbr->ProcessDB(*mysql);
190 if (sc != StatusCode::SUCCESS) {
191 log << MSG::ERROR << " FAILURE in DB access; Muon node will not be built" << endmsg;
192 return;
193 }
194
196 umem = GeoPerfUtils::getMem();
197 ucpu = int(GeoPerfUtils::getCpu() / 100.);
198 geoModelStats << "At MuonDetectorFactory::DB read \t SZ= " << umem << " Kb \t Time = " << ucpu << " seconds ---- \t DeltaM = " << umem - mem
199 << " \t Delta T =" << ucpu - cpu << std::endl;
200 mem = umem;
201 cpu = ucpu;
202 }
203
204 StoredMaterialManager *theMaterialManager;
205 if (StatusCode::SUCCESS != m_pDetStore->retrieve(theMaterialManager, "MATERIALS")) {
206 return;
207 } else {
208 log << MSG::INFO << " theMaterialManager retrieven successfully from the DetStore" << endmsg;
209 }
210
211 const GeoMaterial *m4 = theMaterialManager->getMaterial("std::Air");
212 GeoLogVol *l4;
213 GeoPcon *c4 = new GeoPcon(0, 360 * Gaudi::Units::deg);
214
215
216 //--- --- --- CREATE ENVELOPE --- --- ---
217 // First try to get data from the GeomDB
218 IRDBRecordset_ptr muonSysRec = m_pRDBAccess->getRecordsetPtr("MuonSystem", OracleTag, OracleNode);
219
220 // -- Next two lines allow to use MuonSystem-00 by default instead of hardwired numbers
221 // even for geometry tags where MuonSystem was not collected
222 if (muonSysRec->size() == 0) {
223 muonSysRec = m_pRDBAccess->getRecordsetPtr("MuonSystem", "MuonSystem-00");
224 log << MSG::INFO << "MuonSystem description from default node in GeomDB, i.e. MuonSystem-00" << endmsg;
225 } else {
226 log << MSG::INFO << "MuonSystem description from OracleTag=<" << OracleTag << "> and node=<" << OracleNode << ">" << endmsg;
227 }
228
229 // --- Envelope from DB ....
230 if (muonSysRec->size() != 0) {
231 // Data retrieved
232 muonsysIndMap indmap;
233 muonsysIndMap::const_iterator iter;
234 const IRDBRecord *currentRecord;
235
236 // First fill the contents of muonsysIndMap
237 for (unsigned int ind = 0; ind < muonSysRec->size(); ind++) {
238 int key = (*muonSysRec)[ind]->getInt("PLANE_ID");
239 indmap[key] = ind;
240 }
241
242 // Create the polycone
243 for (unsigned int ind = 0; ind < indmap.size(); ind++) {
244 iter = indmap.find(ind);
245
246 if (iter == indmap.end()) {
247 throw std::runtime_error("Error in MuonDetectorFactory, missing plane in MuonSystem");
248 } else {
249 currentRecord = (*muonSysRec)[(*iter).second];
250 c4->addPlane(currentRecord->getDouble("ZPLANE"), currentRecord->getDouble("RMIN"), currentRecord->getDouble("RMAX"));
251 }
252 }
253 } else { // ... end if Envelope from DB ---
254 // Muon System node is not present, go for handcoded version
255 log << MSG::INFO << "MuonSystem description not available in GeomDB - using hard-wired description" << endmsg;
256
257 double ir = m_muon->barrelInnerRadius;
258 double pir = m_muon->innerRadius;
259 double orad = m_muon->outerRadius;
260 double l = m_muon->length;
261 double eff = m_muon->endcapFrontFace;
262
263 double extraR = m_muon->extraR;
264 double extraZ = m_muon->extraZ;
265
266 c4->addPlane(-l, pir, extraR);
267 c4->addPlane(-extraZ, pir, extraR);
268 c4->addPlane(-extraZ, pir, orad);
269
270 c4->addPlane(-eff, pir, orad);
271 c4->addPlane(-eff, ir, orad);
272 c4->addPlane(+eff, ir, orad);
273 c4->addPlane(+eff, pir, orad);
274
275 c4->addPlane(extraZ, pir, orad);
276 c4->addPlane(extraZ, pir, extraR);
277 c4->addPlane(l, pir, extraR);
278 } // ... end if Envelope from DB ---
279
280
281 l4 = new GeoLogVol("MuonSys", c4, m4);
282
283 GeoPhysVol *p4 = new GeoPhysVol(l4);
284
285 // Cannot (yet) cope with this:
286 // G4UserLimits *ul=new G4UserLimits;
287 // ul->SetMaxAllowedStep(5*Gaudi::Units::cm);
288 // lv->GetLogicalVolume()->SetUserLimits(ul);
289
290 m_manager->addTreeTop(p4); // This is the top!
291 log << MSG::INFO << " TreeTop added to the Manager" << endmsg;
292 log << MSG::INFO << " Muon Layout " << m_layout << endmsg;
293
294 std::vector<std::string> slist;
295 if (m_selectedStations.empty())
296 slist.emplace_back("*");
297 else
298 slist = m_selectedStations;
299
300 // create the fullphysvol map to allow cloning and save memory
301 std::unique_ptr<FPVMAP> savemem = std::make_unique< FPVMAP>();
302
303 int nstat_ss = 0;
304 int ntpos_ss = 0;
305 int npos_ss = 0;
306 int nAssemblies = 0;
307 if (m_enableFineClashFixing > 0) {
308 log << MSG::INFO << "Fine Clash Fixing enabled: (should be ON/OFF for Simulation/Reconstruction)" << endmsg;
309 } else {
310 log << MSG::INFO << "Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction)" << endmsg;
311 }
312
313 StationSelector sel(*mysql, slist);
315
316 for (it = sel.begin(); it != sel.end(); ++it) {
317 Station *station = (*it).second;
318 std::string stname(station->GetName(), 0, 3);
319 if (m_selectedStations.empty()) {
320 if (log.level() <= MSG::VERBOSE) {
321 log << MSG::VERBOSE << "Processing Stations named <" << station->GetName() << "> " << nstat_ss << " built until now" << endmsg;
322 }
323 }
324
325 if ((skip_chambers) && (stname.substr(0, 1) != "X"))
326 continue;
327
328 bool isAssembly = false;
329 if (station->GetNrOfCutouts() > 0 && stname.substr(0, 1) != "T")
330 isAssembly = true;
331
332 // BIR have multilayers of diff. length and overall station volume clashes with toroids
333 if (stname == "BIR")
334 isAssembly = true;
335
336 MuonChamber l(*mysql, station); // here is where we start to create a MuonChamber with all readoutelements
337 l.setFPVMAP(savemem.get());
338 l.setFineClashFixingFlag(m_enableFineClashFixing);
339
341 AlignPosIterator apit;
342 AlignPos ap;
343 npos_ss = 0;
344 for (pit = station->begin(); pit != station->end(); ++pit) {
345 int zi = (*pit).second.zindex;
346 int fi = (*pit).second.phiindex;
347 int sign = 1;
348 if (zi)
349 sign = zi / abs(zi);
350
351 // if there's a selection of eta location, check if this chamber is selected
352 if (!m_selectedStEta.empty()) {
353 bool selectedEta = false;
354 for (auto i = m_selectedStEta.begin(); i < m_selectedStEta.end(); i++) {
355 if (zi == *i) {
356 selectedEta = true;
357 break;
358 }
359 }
360
361 if (!selectedEta)
362 continue;
363 }
364
365 // if there's a selection of phi location, check if this chamber is selected
366 if (!m_selectedStPhi.empty()) {
367 bool selectedPhi = false;
368 for (auto i = m_selectedStPhi.begin(); i < m_selectedStPhi.end(); i++) {
369 if ((fi + 1) == *i) {
370 selectedPhi = true;
371 break;
372 }
373 }
374
375 if (!selectedPhi)
376 continue;
377 }
378
379 // total number of stations positioned in the layout
380 ntpos_ss++;
381 // total number of locations for this chamber
382 npos_ss++;
383
384 if ((m_selectedStPhi.size() + m_selectedStEta.size()) > 0) {
385 log << MSG::INFO << "Build selected Station <" << station->GetName() << "> at Jzz = " << zi << " Jff = " << fi + 1 << " ******* " << nstat_ss
386 << " stat.types built until now" << endmsg;
387 }
388
389 // here define GeoNameTag
390 GeoNameTag *nm = new GeoNameTag(station->GetName() + "_station");
391 // here build the physical volume (tree) associated to the chamber
392 bool is_mirrored = ((*pit).second).isMirrored;
393 int mirsign = 0;
394 if (zi < 0 && !is_mirrored)
395 mirsign = 1;
396 if (stname == "CSL")
397 isAssembly = true;
398
399 // CSL because coffin shape of the station mother volume
400 GeoVPhysVol *pv = l.build(*theMaterialManager, *mysql, getDetectorManager(), zi, fi, is_mirrored, isAssembly);
401 if (isAssembly)
402 nAssemblies++;
403
404 // here define GeoIdentifierTag
405 if (useAssemblies || isAssembly) {
406 int sideC = 0;
407 if (zi < 0)
408 sideC = 1;
409 int geoid = (sideC * 10000 + mirsign * 1000 + abs(zi) * 100 + fi + 1) * 100000;
410 if (log.level() <= MSG::DEBUG) {
411 log << MSG::DEBUG << "Adding Station with nameTag=<" << station->GetName() + "_station"
412 << "> and geoId " << geoid << endmsg;
413 }
414 p4->add(new GeoIdentifierTag(geoid));
415 } else {
416 int geoid = (mirsign * 1000 + abs(zi) * 100 + fi + 1) * sign;
417 p4->add(new GeoIdentifierTag(geoid));
418 if (log.level() <= MSG::DEBUG) {
419 log << MSG::DEBUG << "Adding Station with nameTag=<" << station->GetName() + "_station"
420 << "> and geoId " << geoid << " for zi/fi = " << zi << "/" << fi << endmsg;
421 }
422 }
423
424 // alignment issues and readout geometry for station
425 MuonStation *mst = m_manager->getMuonStation(station->GetName(), zi, fi + 1);
426 if (!mst) {
427 log << MSG::WARNING << "For Station with nameTag=<" << station->GetName() << "> at zi/fi = " << zi << "/" << fi
428 << " no MuonStation found => no possibility to align" << endmsg;
429 continue;
430 }
431
432 GeoTrf::Transform3D tsz_to_szt = GeoTrf::RotateZ3D(-90 * Gaudi::Units::degree) * GeoTrf::RotateY3D(-90 * Gaudi::Units::degree);
433 GeoTrf::Transform3D nativeToAmdbLRS=tsz_to_szt * station->native_to_tsz_frame(*mysql, (*pit).second);
434
435 mst->setNativeToAmdbLRS(nativeToAmdbLRS);
436 mst->setNominalAmdbLRSToGlobal(station->tsz_to_global_frame(*mysql, (*pit).second) * tsz_to_szt.inverse());
437
438 // find correct alignment information for this position
439 // xf->setDelta(DummyAline); // just in case we don't find one
440
441 // apit = station->FindAlignPos(zi,fi);
442 // number of A-lines for this station
443
444 int nAlines = station->CountAlignPos(zi, fi);
445 // nAlines=-1;
446 if (nAlines == 0 || BEEShiftDisabled() ) {
447
448 // here define the GeoAlignableTransform associated to the chamber
449 // nominal transform first
450 GeoAlignableTransform *xf = new GeoAlignableTransform(station->getNominalTransform(*mysql, (*pit).second));
451
452 // add tag, transform and physicalvolume associated to the chamber to the mother-volume
453 p4->add(nm);
454 p4->add(xf);
455 p4->add(pv);
456
457
458 mst->setTransform(xf);
459 GeoTrf::Transform3D tsz_to_szt = GeoTrf::RotateZ3D(-90 * Gaudi::Units::degree) * GeoTrf::RotateY3D(-90 * Gaudi::Units::degree);
460
461 mst->setNativeToAmdbLRS(tsz_to_szt * station->native_to_tsz_frame(*mysql, (*pit).second));
462 mst->setNominalAmdbLRSToGlobal(station->tsz_to_global_frame(*mysql, (*pit).second) * tsz_to_szt.inverse());
463
464 mst->setDeltaAmdbLRS(GeoTrf::Transform3D::Identity());
465
466 } else if (nAlines ==1) {
467 AlignPosIterator alast;
468 AlignPosIterator afirst = station->getFirstAlignPosInRange(zi, fi, alast);
469
470 for (AlignPosIterator acurrent = afirst; acurrent != alast; ++acurrent) {
471 ap = acurrent->second;
472
473 if (ap.phiindex != fi || ap.zindex != zi) {
474 log << MSG::ERROR << "Inconsistent AlignedPosition found in the static Geometry DB: aligPos.fi, zi = " << ap.phiindex << ", " << ap.zindex
475 << " for station " << station->GetName() << " at fi/zi = " << fi << "/" << zi << " AlignPos indices fi/zi " << fi << "/" << zi << endmsg;
476 }
477
478 if (ap.jobindex == 0) {
479 // station
480 if (log.level() <= MSG::DEBUG) {
481 log << MSG::DEBUG << "Going to set delta from A-line for station" << stname << " at zi/fi " << zi << "/" << fi << endmsg;
482 log << MSG::DEBUG << "A-line is: " << ap.tras << " " << ap.traz << " " << ap.trat << " " << ap.rots << " " << ap.rotz << " " << ap.rott << endmsg;
483 }
484 // compute the delta transform in the local AMDB frame
485 // here define the GeoAlignableTransform associated to the chamber
486 // nominal transform first
487 GeoTrf::Transform3D delta_amdb =
488 GeoTrf::TranslateX3D(ap.tras) * GeoTrf::TranslateY3D(ap.traz) * GeoTrf::TranslateZ3D(ap.trat) *
489 GeoTrf::RotateX3D(ap.rots) * GeoTrf::RotateY3D(ap.rotz) * GeoTrf::RotateZ3D(ap.rott);
490
491 GeoTrf::Transform3D tsz_to_szt = GeoTrf::RotateZ3D(-90 * Gaudi::Units::degree) * GeoTrf::RotateY3D(-90 * Gaudi::Units::degree);
492 GeoTrf::Transform3D nominalTransform=station->getNominalTransform(*mysql, (*pit).second);
493 GeoTrf::Transform3D native_to_amdbl=tsz_to_szt * station->native_to_tsz_frame(*mysql, (*pit).second);
494 GeoAlignableTransform *xf = new GeoAlignableTransform(nominalTransform*native_to_amdbl.inverse()*delta_amdb*native_to_amdbl);
495
496 // add tag, transform and physicalvolume associated to the chamber to the mother-volume
497 p4->add(nm);
498 p4->add(xf);
499 p4->add(pv);
500
501
502
503 mst->setTransform(xf);
504 mst->setNativeToAmdbLRS(tsz_to_szt * station->native_to_tsz_frame(*mysql, (*pit).second));
505 mst->setNominalAmdbLRSToGlobal(station->tsz_to_global_frame(*mysql, (*pit).second) * tsz_to_szt.inverse());
506 mst->setDeltaAmdbLRS(GeoTrf::Transform3D::Identity());
507
508
509 }
510 }
511 }
512 else {
513 }
514 } // end loop on positions
515
516 // number of stations realised in the layout
517 if (npos_ss > 0)
518 nstat_ss++;
519 } // for ( it = sel.begin(); it != sel.end(); it++ ) {
520
521 log << MSG::INFO << " **************** MuonDetectorFactory001 ****************************" << endmsg << " *** The Muon Chamber Geometry Tree is built with " << endmsg
522 << " *** " << p4->getNChildVols() << " child volumes " << endmsg << " *** " << savemem->NDetectors() << " independent elements and " << endmsg << " *** "
523 << savemem->NDetectorsReused() << " elements cloned or shared " << endmsg << " *** " << nstat_ss << " kinds of stations" << endmsg << " *** " << ntpos_ss
524 << " stations with alignable transforms" << endmsg << " *** " << nAssemblies << " stations are described as Assemblies" << endmsg << " *** "
525 << m_manager->nMuonStation() << " MuonStations " << endmsg << " *** \t " << m_manager->nMdtRE() << " MDT Readout Elements \t " << m_manager->nMdtDE()
526 << " MDT Detector Elements " << endmsg << " *** \t " << m_manager->nCscRE() << " CSC Readout Elements \t " << m_manager->nCscDE() << " CSC Detector Elements " << endmsg
527 << " *** \t " << m_manager->nRpcRE() << " RPC Readout Elements \t " << m_manager->nRpcDE() << " RPC Detector Elements " << endmsg << " *** \t " << m_manager->nTgcRE()
528 << " TGC Readout Elements \t " << m_manager->nTgcDE() << " TGC Detector Elements " << endmsg << " ********************************************************************"
529 << endmsg;
530
532 umem = GeoPerfUtils::getMem();
533 ucpu = int(GeoPerfUtils::getCpu() / 100.);
534 geoModelStats << "At MuonDetectorFactory::active geo done \t SZ= " << umem << " Kb \t Time = " << ucpu << " seconds ---- \t DeltaM = " << umem - mem
535 << " \t Delta T =" << ucpu - cpu << std::endl;
536 mem = umem;
537 cpu = ucpu;
538 }
539
540
541 // delete the station and technology map
542 delete mysql.get();
543
545 umem = GeoPerfUtils::getMem();
546 ucpu = int(GeoPerfUtils::getCpu() / 100.);
547 geoModelStats << "At MuonDetectorFactory::released access.mem \t SZ= " << umem << " Kb \t Time = " << ucpu << " seconds ---- \t DeltaM = " << umem - mem
548 << " \t Delta T =" << ucpu - cpu << std::endl;
549 mem = umem;
550 cpu = ucpu;
551 }
552
553 GeoNameTag *ntg = new GeoNameTag("Muon");
554 world->add(ntg);
555 world->add(p4);
556
557 log << MSG::INFO << " *** Inert Material built according to DB switches and config. ****** " << endmsg;
558 log << MSG::INFO << " *** The Muon Geometry Tree has " << p4->getNChildVols() << " child vol.s in total ********" << endmsg
559 << " ********************************************************************\n"
560 << endmsg;
561
563 umem = GeoPerfUtils::getMem();
564 ucpu = int(GeoPerfUtils::getCpu() / 100.);
565 geoModelStats << "At MuonDetectorFactory::inert geo done \t SZ= " << umem << " Kb \t Time = " << ucpu << " seconds ---- \t DeltaM = " << umem - mem
566 << " \t Delta T =" << ucpu - cpu << std::endl;
567 mem = umem;
568 cpu = ucpu;
569
570 geoModelStats.close();
571 }
572 } // MuonDetectorFactory001::create
573
574} // namespace MuonGM
#define endmsg
Definition of the abstract IRDBAccessSvc interface.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition of the abstract IRDBRecord interface.
Definition of the abstract IRDBRecordset interface.
static Double_t sc
#define useAssemblies
std::map< int, unsigned int, std::less< int > > muonsysIndMap
std::stringstream my_sstream
#define skip_chambers
std::ostringstream my_osstream
int sign(int a)
IRDBRecord is one record in the IRDBRecordset object.
Definition IRDBRecord.h:27
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.
virtual unsigned int size() const =0
void set_amdb_from_RDB(bool)
Definition MYSQL.cxx:268
void setGeometryVersion(const std::string &s)
Definition MYSQL.cxx:271
static LockedMYSQL GetPointer()
Definition MYSQL.cxx:42
CxxUtils::LockedPointer< MYSQL > LockedMYSQL
Definition MYSQL.h:47
std::unique_ptr< MuonSystemDescription > m_muon
std::vector< std::string > m_selectedStations
virtual void create(GeoPhysVol *world) override
MuonDetectorFactory001(StoreGateSvc *pDetStore)
virtual const MuonDetectorManager * getDetectorManager() const override
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
void setDeltaAmdbLRS(Amg::Transform3D xf)
set the delta transform in the amdb frame and update the geoModel Delta
void setNominalAmdbLRSToGlobal(Amg::Transform3D xf)
void setTransform(GeoAlignableTransform *xf)
void setNativeToAmdbLRS(Amg::Transform3D xf)
StationMap::const_iterator StationIterator
GeoTrf::Transform3D native_to_tsz_frame(const MYSQL &mysql, const Position &p) const
Definition Station.cxx:371
int CountAlignPos(int iz, int iphi) const
Definition Station.cxx:69
const std::string & GetName() const
Definition Station.cxx:110
int GetNrOfCutouts() const
Definition Station.cxx:324
AlignPosIterator getFirstAlignPosInRange(int iz, int iphi, AlignPosIterator &lastAlignPosInRange) const
Definition Station.cxx:55
PositionIterator end() const
Definition Station.cxx:108
GeoTrf::Transform3D getNominalTransform(const MYSQL &mysql, const Position &p) const
Definition Station.cxx:511
GeoTrf::Transform3D tsz_to_global_frame(const MYSQL &mysql, const Position &p) const
Definition Station.cxx:430
PositionIterator begin() const
Definition Station.cxx:106
The Athena Transient Store API.
This class holds one or more material managers and makes them storeable, under StoreGate.
virtual const GeoMaterial * getMaterial(const std::string &name)=0
int ir
counter of the current depth
Definition fastadd.cxx:49
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
std::multimap< int, AlignPos, std::less< int > >::const_iterator AlignPosIterator
Definition Station.h:38
std::map< int, Position, std::less< int > >::const_iterator PositionIterator
Definition Station.h:37
STL namespace.