ATLAS Offline Software
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"
34 #include "MuonGeoModel/DBReader.h"
35 #include "MuonGeoModel/FPVMAP.h"
36 #include "MuonGeoModel/MYSQL.h"
40 #include "MuonGeoModel/Station.h"
46 #include "StoreGate/StoreGateSvc.h"
47 
48 #include <fstream>
49 #include <iomanip>
50 #include <sstream>
51 #include <stdexcept>
52 #include <vector>
53 
54 using my_sstream = std::stringstream;
55 using my_osstream = std::ostringstream;
56 
57 // The objects for mapping plane indexes in MuonSystem to the record index in RDBRecordset
58 using muonsysIndMap = std::map<int, unsigned int, std::less<int>>;
59 
60 using namespace GeoGenfun;
61 using 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 
69 namespace MuonGM {
70 
71  MuonDetectorFactory001::MuonDetectorFactory001(StoreGateSvc *pDetStore):
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;
102  if (m_dumpMemoryBreakDown) {
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
121  m_includeCutouts = 1;
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
131 
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
139  mysql->setGeometryVersion(m_layout);
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 
160  if (m_dumpMemoryBreakDown) {
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
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 
195  if (m_dumpMemoryBreakDown) {
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 
340  PositionIterator pit;
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 
531  if (m_dumpMemoryBreakDown) {
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 
544  if (m_dumpMemoryBreakDown) {
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 
562  if (m_dumpMemoryBreakDown) {
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
MuonGM::MuonDetectorManager::set_DBMuonVersion
void set_DBMuonVersion(const std::string &version)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:685
CxxUtils::LockedPointer::get
T * get()
Definition: LockedPointer.h:43
MuonGM::MuonDetectorFactory001::getDetectorManager
virtual const MuonDetectorManager * getDetectorManager() const override
Definition: MuonDetectorFactory001.cxx:91
MuonGM::AlignPos
Definition: AlignPos.h:12
MuonGM::MuonDetectorManager::nMdtDE
unsigned int nMdtDE() const
Number of Mdt DetectorElements.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:266
MuonGM::MuonDetectorFactory001::m_hasSTgc
bool m_hasSTgc
Definition: MuonDetectorFactory001.h:90
MuonGM::MuonDetectorFactory001::m_DBMuonVersion
std::string m_DBMuonVersion
Definition: MuonDetectorFactory001.h:76
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
MuonGM::Station::tsz_to_global_frame
GeoTrf::Transform3D tsz_to_global_frame(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:430
MuonGM::MuonSystemDescription
Definition: MuonSystemDescription.h:12
MuonGM::Station::getFirstAlignPosInRange
AlignPosIterator getFirstAlignPosInRange(int iz, int iphi, AlignPosIterator &lastAlignPosInRange) const
Definition: Station.cxx:55
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
IRDBAccessSvc::getRecordsetPtr
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
my_sstream
std::stringstream my_sstream
Definition: MuonDetectorFactory001.cxx:54
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CxxUtils::LockedPointer
A pointer together with a movable lock.
Definition: LockedPointer.h:35
MuonGM::Station::getNominalTransform
GeoTrf::Transform3D getNominalTransform(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:511
MuonGM::MuonDetectorManager::addTreeTop
void addTreeTop(PVLink)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:117
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
muonsysIndMap
std::map< int, unsigned int, std::less< int > > muonsysIndMap
Definition: MuonDetectorFactory001.cxx:58
FPVMAP.h
MuonGM::MuonDetectorFactory001::m_minimalGeoFlag
int m_minimalGeoFlag
Definition: MuonDetectorFactory001.h:85
MuonGM::MuonDetectorManager::nTgcDE
unsigned int nTgcDE() const
Number of Tgc DetectorElements.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:269
MuonGM::MuonChamber
Definition: MuonChamber.h:29
MuonGM::Station
Definition: Station.h:40
skel.it
it
Definition: skel.GENtoEVGEN.py:396
deg
#define deg
Definition: SbPolyhedron.cxx:17
MuonGM::MuonDetectorFactory001::m_enableFineClashFixing
int m_enableFineClashFixing
Definition: MuonDetectorFactory001.h:88
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
DBReader.h
MuonGM::MuonDetectorFactory001::m_hasMM
bool m_hasMM
Definition: MuonDetectorFactory001.h:91
IdDictManager.h
MuonGM::MuonDetectorFactory001::BEEShiftDisabled
bool BEEShiftDisabled() const
Definition: MuonDetectorFactory001.h:133
MuonGM::MuonDetectorManager::setGeometryVersion
void setGeometryVersion(const std::string &version)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:686
MuonGM::MuonDetectorFactory001::m_pRDBAccess
IRDBAccessSvc * m_pRDBAccess
Definition: MuonDetectorFactory001.h:102
python.AtlRunQueryParser.ap
ap
Definition: AtlRunQueryParser.py:826
MuonGM::MuonDetectorFactory001::m_rdb
int m_rdb
Definition: MuonDetectorFactory001.h:84
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MuonGM::MuonDetectorManager::nMdtRE
unsigned int nMdtRE() const
Number of Mdt ReadoutElements.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:259
useAssemblies
#define useAssemblies
Definition: MuonDetectorFactory001.cxx:67
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Station.h
MuonGM::Station::begin
PositionIterator begin() const
Definition: Station.cxx:106
RDBReaderAtlas.h
StationSelector.h
MuonChamber.h
MuonGM::MuonDetectorManager::nCscDE
unsigned int nCscDE() const
Number of Csc DetectorElements.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:267
MuonGM::MuonDetectorFactory001::m_DBnode
std::string m_DBnode
Definition: MuonDetectorFactory001.h:78
MuonGM::MuonStation::setNativeToAmdbLRS
void setNativeToAmdbLRS(Amg::Transform3D xf)
Definition: MuonStation.cxx:54
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonGM::MuonDetectorFactory001::m_altAsciiDBMap
AltAsciiDBMap m_altAsciiDBMap
Definition: MuonDetectorFactory001.h:103
MuonGM::MuonDetectorManager::geometryVersion
const std::string & geometryVersion() const
it can be Rome-Initial or P03, or ...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:254
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonGM::MuonStation::setTransform
void setTransform(GeoAlignableTransform *xf)
Definition: MuonStation.cxx:50
MuonGM::PositionIterator
std::map< int, Position, std::less< int > >::const_iterator PositionIterator
Definition: Station.h:37
sel
sel
Definition: SUSYToolsTester.cxx:97
my_osstream
std::ostringstream my_osstream
Definition: MuonDetectorFactory001.cxx:55
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonGM::MuonStation
Definition: MuonStation.h:51
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
MuonGM::AlignPosIterator
std::multimap< int, AlignPos, std::less< int > >::const_iterator AlignPosIterator
Definition: Station.h:38
MuonGM::MuonDetectorManager::setCutoutsFlag
void setCutoutsFlag(int flag)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:688
MuonGM::MuonDetectorManager::setCutoutsBogFlag
void setCutoutsBogFlag(int flag)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:689
MuonGM::MuonDetectorManager::setMinimalGeoFlag
void setMinimalGeoFlag(int flag)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:687
MuonGM::MuonDetectorFactory001::m_manager
MuonDetectorManager * m_manager
Definition: MuonDetectorFactory001.h:100
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
MuonGM::MuonDetectorFactory001::m_selectedStPhi
std::vector< int > m_selectedStPhi
Definition: MuonDetectorFactory001.h:97
MuonGM::StationSelector
Definition: StationSelector.h:17
MuonGM::MuonDetectorFactory001::m_selectedStEta
std::vector< int > m_selectedStEta
Definition: MuonDetectorFactory001.h:96
MuonGM::MuonDetectorManager::nRpcDE
unsigned int nRpcDE() const
Number of Rpc DetectorElements.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:268
CLHEPtoEigenConverter.h
MYSQL.h
MuonGM::MuonDetectorManager::get_DBMuonVersion
const std::string & get_DBMuonVersion() const
the name of the MuonSpectrometer tag (in the geometry DB) actually accessed
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:255
StoredMaterialManager.h
MuonGM::MuonDetectorFactory001::create
virtual void create(GeoPhysVol *world) override
Definition: MuonDetectorFactory001.cxx:94
MuonGM::MYSQL::GetPointer
static LockedMYSQL GetPointer()
Definition: MYSQL.cxx:42
MuonGM::MuonDetectorManager::nTgcRE
unsigned int nTgcRE() const
Number of Tgc ReadoutElements.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:262
MuonGM::MuonDetectorFactory001::~MuonDetectorFactory001
~MuonDetectorFactory001()
MuonGM::MuonDetectorManager::nMuonStation
unsigned int nMuonStation() const
Number of MuonStations.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:258
MuonSystemDescription.h
MuonGM::MuonDetectorFactory001::m_includeCutoutsBog
int m_includeCutoutsBog
Definition: MuonDetectorFactory001.h:82
MuonGM::Station::GetNrOfCutouts
int GetNrOfCutouts() const
Definition: Station.cxx:324
ir
int ir
counter of the current depth
Definition: fastadd.cxx:49
MuonGM::MuonDetectorManager::getMuonStation
const MuonStation * getMuonStation(const std::string &stName, int eta, int phi) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:137
MuonGM::MuonDetectorManager::nRpcRE
unsigned int nRpcRE() const
Number of Rpc ReadoutElements.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:261
hydjet.StoreGateSvc
StoreGateSvc
Definition: hydjet.minbias.pbpb5520.r12345.job.py:40
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
MuonGM::MuonDetectorFactory001::m_includeCutouts
int m_includeCutouts
Definition: MuonDetectorFactory001.h:81
MuonGM::StationSelector::StationIterator
StationMap::const_iterator StationIterator
Definition: StationSelector.h:20
GeoGenfun
Definition: ArrayFunction.cxx:7
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
MuonGM::MuonDetectorFactory001::m_dumpMemoryBreakDown
bool m_dumpMemoryBreakDown
Definition: MuonDetectorFactory001.h:87
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition: IRDBRecord.h:27
DEBUG
#define DEBUG
Definition: page_access.h:11
RPDUtils::sideC
unsigned constexpr int sideC
Definition: RPDUtils.h:15
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
python.changerun.pv
pv
Definition: changerun.py:81
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
MuonDetectorFactory001.h
MuonGM::MuonDetectorFactory001::m_muon
std::unique_ptr< MuonSystemDescription > m_muon
Definition: MuonDetectorFactory001.h:99
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
checkFileSG.fi
fi
Definition: checkFileSG.py:65
WriteBchToCool.dbr
dbr
Definition: WriteBchToCool.py:164
MuonGM::Station::native_to_tsz_frame
GeoTrf::Transform3D native_to_tsz_frame(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:371
MuonGM::MuonDetectorFactory001::m_selectedStations
std::vector< std::string > m_selectedStations
Definition: MuonDetectorFactory001.h:95
dqt_zlumi_alleff_HIST.eff
int eff
Definition: dqt_zlumi_alleff_HIST.py:113
MuonGM::MuonDetectorManager::nCscRE
unsigned int nCscRE() const
Number of Csc ReadoutElements.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:260
IRDBRecord::getDouble
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
MuonGM::Station::end
PositionIterator end() const
Definition: Station.cxx:108
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
MuonStation.h
skip_chambers
#define skip_chambers
Definition: MuonDetectorFactory001.cxx:63
MuonGM::MuonStation::setDeltaAmdbLRS
void setDeltaAmdbLRS(Amg::Transform3D xf)
set the delta transform in the amdb frame and update the geoModel Delta
Definition: MuonStation.cxx:131
MuonGM::Station::GetName
const std::string & GetName() const
Definition: Station.cxx:110
StoreGateSvc.h
MuonGM::MuonDetectorFactory001::m_DBkey
std::string m_DBkey
Definition: MuonDetectorFactory001.h:77
python.SystemOfUnits.degree
tuple degree
Definition: SystemOfUnits.py:106
MuonGM::Station::CountAlignPos
int CountAlignPos(int iz, int iphi) const
Definition: Station.cxx:69
MuonGM::MuonStation::setNominalAmdbLRSToGlobal
void setNominalAmdbLRSToGlobal(Amg::Transform3D xf)
Definition: MuonStation.cxx:60
MuonGM::MuonDetectorFactory001::m_pDetStore
StoreGateSvc * m_pDetStore
Definition: MuonDetectorFactory001.h:101
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
getCpu
int getCpu()
Definition: SingleTrackValidation.cxx:53
MuonGM::MuonDetectorFactory001::m_layout
std::string m_layout
Definition: MuonDetectorFactory001.h:80
MuonGM::MuonDetectorFactory001::m_hasCSC
bool m_hasCSC
Definition: MuonDetectorFactory001.h:89
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37