ATLAS Offline Software
MuonReadoutGeomCnvAlg.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 */
6 
7 #include <GeoModelKernel/GeoVPhysVol.h>
11 #include <GeoModelKernel/GeoFullPhysVol.h>
12 
18 
19 
21 
25 
26 
33 
35 
37 #include <GaudiKernel/SystemOfUnits.h>
38 
39 #include <GeoModelHelpers/defineWorld.h>
40 #include <GeoModelHelpers/cloneVolume.h>
41 #include <GeoModelHelpers/getChildNodesWithTrf.h>
42 #include <GeoModelHelpers/TransformToStringConverter.h>
43 #include <GeoModelHelpers/GeoShapeUtils.h>
44 #include <map>
45 
46 #include <GaudiKernel/SystemOfUnits.h>
47 
48 
49 namespace {
50  using SubDetAlignment = ActsGeometryContext::AlignmentStorePtr;
51  bool hasStationVolume(const PVConstLink treeTop,
52  const std::set<PVConstLink>& translated) {
53  const unsigned int nCh = treeTop->getNChildVols();
54  for (unsigned int ch = 0 ; ch < nCh; ++ch) {
55  PVConstLink child = treeTop->getChildVol(ch);
56  if (translated.count(child) ||
57  hasStationVolume(child, translated)){
58  return true;
59  }
60  }
61  return false;
62  };
63 }
64 
65 MuonReadoutGeomCnvAlg::MuonReadoutGeomCnvAlg(const std::string& name, ISvcLocator* pSvcLocator):
66  AthReentrantAlgorithm{name, pSvcLocator} {}
67 
69  ATH_CHECK(m_idHelperSvc.retrieve());
71  ATH_CHECK(m_alignStoreKeys.initialize());
73  return StatusCode::SUCCESS;
74 }
75 
76 
77 StatusCode MuonReadoutGeomCnvAlg::execute(const EventContext& ctx) const {
79  if (writeHandle.isValid()) {
80  ATH_MSG_DEBUG("The current readout geometry is still valid.");
81  return StatusCode::SUCCESS;
82  }
83  writeHandle.addDependency(IOVInfiniteRange::infiniteRunLB());
85  ActsGeometryContext geoContext{};
86  using TrackingAlignment = ActsTrk::DetectorAlignStore::TrackingAlignStore;
89  if (!readHandle.isValid()) {
90  ATH_MSG_FATAL("Failed to retrieve alignment store "<<key.fullKey());
91  return StatusCode::FAILURE;
92  }
93  writeHandle.addDependency(readHandle);
94  auto alignStore = std::make_unique<ActsTrk::DetectorAlignStore>(**readHandle);
96  if (alignStore->geoModelAlignment) {
97  alignStore->geoModelAlignment->clearPosCache();
98  }
99  alignStore->trackingAlignment = std::make_unique<TrackingAlignment>(alignStore->detType);
100  geoContext.setStore(std::move(alignStore));
101  }
104  std::vector<ActsTrk::DetectorType> presentTechs = m_detMgr->getDetectorTypes();
105  for (const ActsTrk::DetectorType detType : presentTechs) {
106  if (geoContext.getStore(detType)) {
107  continue;
108  }
109  ATH_MSG_WARNING("No external detector alignment has been defined for technology "<<ActsTrk::to_string(detType));
110  geoContext.setStore(std::make_unique<ActsTrk::DetectorAlignStore>(detType));
111  }
113  ConstructionCache cacheObj;
114  cacheObj.detMgr = std::make_unique<MuonGM::MuonDetectorManager>();
115  cacheObj.world = createGeoWorld();
116  cacheObj.detMgr->addTreeTop(cacheObj.world);
118  ATH_CHECK(buildMdt(geoContext, cacheObj));
119  ATH_CHECK(buildTgc(geoContext, cacheObj));
120  ATH_CHECK(buildRpc(geoContext, cacheObj));
121  ATH_CHECK(buildSTGC(geoContext, cacheObj));
122  ATH_CHECK(buildMM(geoContext, cacheObj));
124  std::vector<GeoChildNodeWithTrf> treeTops = getChildrenWithRef(m_detMgr->getTreeTop(0), false);
125 
127  for (const GeoChildNodeWithTrf& treeTop : treeTops) {
128  if (hasStationVolume(treeTop.volume, cacheObj.translatedStations)) continue;
129  ATH_MSG_VERBOSE("Detected passive volume "<<treeTop.nodeName);
130 
131  cacheObj.world->add(const_pointer_cast(treeTop.volume));
132  }
133 
135  if (m_checkGeo) {
136  const std::vector<const MuonGMR4::MuonReadoutElement*> refEles{m_detMgr->getAllReadoutElements()};
137  for (const MuonGMR4::MuonReadoutElement* refEle : refEles) {
138  ATH_CHECK(checkIdCompability(*refEle, *cacheObj.detMgr->getReadoutElement(refEle->identify())));
139  }
140  }
141 
142  ATH_CHECK(writeHandle.record(std::move(cacheObj.detMgr)));
143  return StatusCode::SUCCESS;
144 }
146  const Identifier& stationId,
147  ConstructionCache& cacheObj) const {
148  const std::string stName{m_idHelperSvc->stationNameString(stationId)};
149  const int stEta{m_idHelperSvc->stationEta(stationId)};
150  const int stPhi{m_idHelperSvc->stationPhi(stationId)};
151  MuonGM::MuonStation* station = cacheObj.detMgr->getMuonStation(stName, stEta, stPhi);
152  if (station) {
153  ATH_MSG_DEBUG("Station "<<stName<<" "<<stEta<<" "<<stPhi<<" already exists.");
154  return StatusCode::SUCCESS;
155  }
157  const MuonGMR4::MuonReadoutElement* copyMe = m_detMgr->getReadoutElement(stationId);
158 
160  const GeoVFullPhysVol* readOutVol = copyMe->getMaterialGeom();
161  PVConstLink parentVolume = readOutVol->getParent();
162  cacheObj.translatedStations.insert(parentVolume);
164  PVLink parentPhysVol{make_intrusive<GeoFullPhysVol>(parentVolume->getLogVol())};
165 
168  const std::vector<GeoChildNodeWithTrf> children = getChildrenWithRef(parentVolume, false);
169  double minX{1.e9}, maxX{-1.e9}, minY1{1.e9}, maxY1{-1.e9}, minY2{1.e9}, maxY2{-1.e9}, minZ{1.e9}, maxZ{-1.e9};
170  for (const GeoChildNodeWithTrf& child : children) {
171  std::vector<Amg::Vector3D> edges = getPolyShapeEdges(child.volume->getLogVol()->getShape(),
172  readOutVol->getX().inverse() * child.transform);
173  for (const Amg::Vector3D& edge : edges) {
174  minX = std::min(minX, edge.x());
175  maxX = std::max(maxX, edge.x());
176  minZ = std::min(minZ, edge.z());
177  maxZ = std::max(maxZ, edge.z());
178  if (edge.z() < 0) {
179  minY1 = std::min(minY1, edge.y());
180  maxY1 = std::max(maxY1, edge.y());
181  } else {
182  minY2 = std::min(minY2, edge.y());
183  maxY2 = std::max(maxY2, edge.y());
184  }
185  }
186  }
189  const double shortS = (maxY1 - minY1);
190  const double longS = (maxY2 - minY2);
191  const double lengthR = (maxX - minX);
192  const double lengthZ = (maxZ - minZ);
193 
194 
195 
196  const GeoAlignableTransform* alignTrf{copyMe->alignableTransform()};
198  const Amg::Transform3D stationTransform = alignTrf->getDefTransform().inverse()*parentVolume->getX();
199 
200  for (const GeoChildNodeWithTrf& child : children) {
202  const GeoVPhysVol &childVolRef = *child.volume;
203  if (typeid(childVolRef) == typeid(GeoFullPhysVol)) {
204  continue;
205  }
206  // Add the beam lines / foams inside the station volume
207  PVLink childVol = const_pointer_cast<GeoVPhysVol>(child.volume);
208  parentPhysVol->add(cacheObj.newIdTag());
209  parentPhysVol->add(cacheObj.makeTransform(stationTransform*child.transform));
210  parentPhysVol->add(cloneVolume(childVol));
211  }
213  const Amg::Transform3D alignedTransform = copyMe->localToGlobalTrans(gctx) *
214  (stationTransform * readOutVol->getX()).inverse();
215 
216  ATH_MSG_VERBOSE("stName "<<stName<<","<<stEta<<","<<stPhi<<" -- shortS: "<<shortS<<", longS: "<<longS
217  <<", lengthR: "<<lengthR<<", lengthZ "<<lengthZ
218  <<std::endl<<"AlignableNode: "<<GeoTrf::toString(alignedTransform, true)
219  <<std::endl<<"Station transform: "<<GeoTrf::toString(stationTransform, true)
220  <<std::endl<<"Readout transform: "<<GeoTrf::toString(readOutVol->getX(), true));
221  auto newStation = std::make_unique<MuonGM::MuonStation>(stName,
222  shortS, lengthR, lengthZ,
223  longS, lengthR, lengthZ,
224  stEta, stPhi, false);
225  newStation->setPhysVol(parentPhysVol);
226  cacheObj.detMgr->addMuonStation(std::move(newStation));
228  cacheObj.world->add(cacheObj.newIdTag());
229  cacheObj.world->add(cacheObj.makeTransform(alignedTransform));
230  cacheObj.world->add(parentPhysVol);
231 
232  return StatusCode::SUCCESS;
233 }
234 
235 
237  const Identifier& reId,
238  ConstructionCache& cacheObj,
239  GeoIntrusivePtr<GeoVFullPhysVol>& physVol,
240  MuonGM::MuonStation* & station) const {
241 
242  ATH_CHECK(buildStation(gctx, reId, cacheObj));
243  const std::string stName{m_idHelperSvc->stationNameString(reId)};
244  station = cacheObj.detMgr->getMuonStation(stName,
245  m_idHelperSvc->stationEta(reId),
246  m_idHelperSvc->stationPhi(reId));
247 
248  PVLink parentPhysVol{station->getPhysVol()};
250  GeoIntrusivePtr<const GeoVFullPhysVol> readOutVol{copyMe->getMaterialGeom()};
251  parentPhysVol->add(cacheObj.newIdTag());
252  parentPhysVol->add(cacheObj.makeTransform(parentPhysVol->getX().inverse() *
253  copyMe->localToGlobalTrans(gctx)));
255  PVLink clonedVol{cloneVolume(const_pointer_cast<GeoVFullPhysVol>(readOutVol))};
256  physVol = dynamic_pointer_cast<GeoVFullPhysVol>(clonedVol);
257  parentPhysVol->add(physVol);
258  return StatusCode::SUCCESS;
259 }
260 
262  ConstructionCache& cacheObj) const {
263 
264  const std::vector<const MuonGMR4::RpcReadoutElement*> readoutEles = m_detMgr->getAllRpcReadoutElements();
265  ATH_MSG_INFO("Copy "<<readoutEles.size()<<" Rpc readout elements to the legacy system");
266  const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
267  for (const MuonGMR4::RpcReadoutElement* copyMe : readoutEles) {
268  const Identifier reId = copyMe->identify();
269  const MuonGMR4::RpcReadoutElement::parameterBook& pars{copyMe->getParameters()};
270  GeoIntrusivePtr<GeoVFullPhysVol> physVol{};
271  MuonGM::MuonStation* station{nullptr};
272  ATH_CHECK(cloneReadoutVolume(gctx,reId, cacheObj, physVol, station));
273  auto newElement = std::make_unique<MuonGM::RpcReadoutElement>(physVol,
274  m_idHelperSvc->stationNameString(reId),
275  1, 1, false, cacheObj.detMgr.get());
276  const bool aSide{copyMe->stationEta() > 0};
277  newElement->setDoubletPhi(copyMe->doubletPhi());
278  newElement->setDoubletR(copyMe->doubletR());
279  newElement->setDoubletZ(copyMe->doubletZ());
280  newElement->setIdentifier(reId);
281  newElement->setParentMuonStation(station);
282 
284  newElement->setLongRsize(pars.halfLength);
285  newElement->setLongSsize(pars.halfWidth);
286  newElement->setLongZsize(pars.halfThickness);
287  newElement->setRsize(pars.halfLength);
288  newElement->setSsize(pars.halfWidth);
289  newElement->setZsize(pars.halfThickness);
290 
291  newElement->m_nlayers = copyMe->nGasGaps();
292  newElement->m_phistripwidth = copyMe->stripPhiWidth();
293  newElement->m_etastripwidth = copyMe->stripEtaWidth();
294  newElement->m_phistrippitch = copyMe->stripPhiPitch();
295  newElement->m_etastrippitch = (aSide > 0 ? 1. : -1.) *copyMe->stripEtaPitch();
296  newElement->m_phistriplength = copyMe->stripPhiLength();
297  newElement->m_etastriplength = copyMe->stripEtaLength();
298 
299  newElement->m_nphistripsperpanel = copyMe->nPhiStrips();
300  newElement->m_netastripsperpanel = copyMe->nEtaStrips();
301  newElement->m_nphistrippanels = copyMe->nPhiPanels();
302  newElement->m_hasDEDontop = true;
303  newElement->m_descratzneg = false;
304 
305  for (unsigned int gasGap = 1; gasGap <= copyMe->nGasGaps(); ++gasGap) {
306  for (int doubPhi = copyMe->doubletPhiMax(); doubPhi >= copyMe->doubletPhi(); --doubPhi) {
307  for (bool measPhi : {false, true}) {
308  const int channel = 1;
309  const Identifier gapId = idHelper.channelID(copyMe->identify(),
310  copyMe->doubletZ(),
311  doubPhi, gasGap, measPhi,
312  channel);
313 
314  const Amg::Vector3D locStripPos = copyMe->globalToLocalTrans(gctx) * copyMe->stripPosition(gctx, gapId);
315  ATH_MSG_VERBOSE("GasGap "<<m_idHelperSvc->toString(gapId)<<", local strip position: "<<Amg::toString(locStripPos));
316  newElement->m_gasGap_xPos[gasGap -1] = locStripPos.x();
319  const int dbPIdx = copyMe->doubletPhi() == 2 ? 1 : doubPhi;
320  if (measPhi) {
321  newElement->m_first_phistrip_s[dbPIdx -1] = locStripPos.y();
322  newElement->m_phistrip_z = locStripPos.z();
323  } else{
324  newElement->m_first_etastrip_z = locStripPos.z();
325  newElement->m_etastrip_s[dbPIdx-1] = locStripPos.y();
326  }
327  }
328  }
329  }
330  newElement->m_mirrored = true;
331  newElement->fillCache();
332  newElement->m_mirrored = false;
333  ATH_CHECK(dumpAndCompare(gctx, *copyMe, *newElement));
334  cacheObj.detMgr->addRpcReadoutElement(std::move(newElement));
335  }
336  return StatusCode::SUCCESS;
337 }
338 
339 
341  ConstructionCache& cacheObj) const {
342 
343  std::vector<const MuonGMR4::TgcReadoutElement*> tgcReadouts{m_detMgr->getAllTgcReadoutElements()};
344  std::stable_sort(tgcReadouts.begin(), tgcReadouts.end(),
346  return a->stationEta() > b->stationEta();
347  });
348  ATH_MSG_INFO("Copy "<<tgcReadouts.size()<<" Tgc readout elements to the legacy system");
349  const TgcIdHelper& idHelper{m_idHelperSvc->tgcIdHelper()};
350 
351  using TgcReadoutParams = MuonGM::TgcReadoutParams;
352  std::map<std::string, std::shared_ptr<TgcReadoutParams>> readoutParMap{};
353 
354  for (const MuonGMR4::TgcReadoutElement* copyMe: tgcReadouts) {
355  const Identifier reId = copyMe->identify();
356  GeoIntrusivePtr<GeoVFullPhysVol> physVol{};
357  MuonGM::MuonStation* station{nullptr};
358  ATH_CHECK(cloneReadoutVolume(gctx,reId, cacheObj, physVol, station));
359 
360  auto newRE = std::make_unique<MuonGM::TgcReadoutElement>(physVol, m_idHelperSvc->stationNameString(reId),
361  cacheObj.detMgr.get());
362  newRE->setIdentifier(reId);
363  newRE->setParentMuonStation(station);
364 
365  std::shared_ptr<TgcReadoutParams>& readOutPars = readoutParMap[copyMe->chamberDesign()];
366  if (!readOutPars) {
370 
371  std::array<WiregangArray, 3> wires{};
372  GasGapIntArray nWireGangs{}, nStrips{};
373  StripArray botMountings{}, topMountings{};
374  bool stripSet{false};
375  double wirePitch{0.};
376 
377  for (unsigned int gasGap =1; gasGap <= copyMe->nGasGaps(); ++gasGap) {
378  nWireGangs[gasGap -1] = copyMe->numWireGangs(gasGap);
379  nStrips[gasGap -1] = copyMe->numStrips(gasGap);
380  if (nWireGangs[gasGap -1]) {
381  const MuonGMR4::WireGroupDesign& design{copyMe->wireGangLayout(gasGap)};
382  wirePitch = design.stripPitch();
383  WiregangArray& fillMe{wires[gasGap-1]};
384  for (int gang = 1; gang <= design.numStrips(); ++gang) {
385  fillMe[gang -1] = design.numWiresInGroup(gang);
386  }
387  }
388  if (nStrips[gasGap -1] && !stripSet) {
389  const MuonGMR4::RadialStripDesign& design {copyMe->stripLayout(gasGap)};
390  const int nCh = nStrips[gasGap -1];
391  for (int strip = 1; strip <= nCh; ++strip) {
392  botMountings[strip-1] = - design.stripLeftBottom(strip).x();
393  topMountings[strip-1] = - design.stripLeftTop(strip).x();
394  }
395  botMountings[nCh] = - design.stripRightBottom(nCh).x();
396  topMountings[nCh] = - design.stripRightTop(nCh).x();
397 
398  stripSet = true;
399  }
400  }
401  readOutPars = std::make_unique<TgcReadoutParams>(copyMe->chamberDesign(),
402  0, 0, wirePitch,
403  idHelper.stationPhiMax(reId),
404  std::move(nWireGangs),
405  std::move(wires[0]),
406  std::move(wires[1]),
407  std::move(wires[2]),
408  0,
409  std::move(botMountings),
410  std::move(topMountings),
411  std::move(nStrips));
412  }
413 
415  for (unsigned int gasGap = 1; gasGap <= copyMe->nGasGaps(); ++gasGap) {
416  const IdentifierHash layHash{ copyMe->constructHash(0, gasGap, false)};
418  const Amg::Vector3D translation{copyMe->globalToLocalTrans(gctx) * copyMe->center(gctx, layHash)};
419  newRE->setPlaneZ(translation.x(), gasGap);
420  }
421  newRE->setSsize(copyMe->moduleHeight());
422  newRE->setRsize(copyMe->moduleWidthS());
423  newRE->setZsize(copyMe->moduleThickness());
424 
425  newRE->setLongSsize(copyMe->moduleHeight());
426  newRE->setLongRsize(copyMe->moduleWidthL());
427  newRE->setLongZsize(copyMe->moduleThickness());
428 
429  newRE->setReadOutParams(readOutPars);
430  newRE->fillCache();
431  ATH_CHECK(dumpAndCompare(gctx, *copyMe, *newRE));
432  cacheObj.detMgr->addTgcReadoutElement(std::move(newRE));
433 
434  }
435  return StatusCode::SUCCESS;
436 }
437 
438 GeoIntrusivePtr<GeoVFullPhysVol> MuonReadoutGeomCnvAlg::cloneNswWedge(const ActsGeometryContext& gctx,
439  const MuonGMR4::MuonReadoutElement* copyMe,
440  ConstructionCache& cacheObj) const {
441  GeoIntrusivePtr<const GeoVFullPhysVol> readOutVol{copyMe->getMaterialGeom()};
442  cacheObj.translatedStations.insert(readOutVol->getParent());
443 
444  PVLink clonedVol{cloneVolume(const_pointer_cast<GeoVFullPhysVol>(readOutVol))};
445  GeoIntrusivePtr<GeoFullPhysVol> physVol{dynamic_pointer_cast<GeoFullPhysVol>(clonedVol)};
446  cacheObj.world->add(cacheObj.newIdTag());
447  cacheObj.world->add(cacheObj.makeTransform(copyMe->localToGlobalTrans(gctx)));
448  cacheObj.world->add(physVol);
449  return physVol;
450 }
452  ConstructionCache& cacheObj) const {
453 
454  SubDetAlignment alignItr = gctx.getStore(ActsTrk::DetectorType::Mm);
455  const auto alignStore = alignItr ?
456  static_cast<const MmAlignmentStore*>(alignItr->internalAlignment.get()) : nullptr;
457 
458  const std::vector<const MuonGMR4::MmReadoutElement*> mmReadouts{m_detMgr->getAllMmReadoutElements()};
459  ATH_MSG_INFO("Copy "<<mmReadouts.size()<<" Mm readout elements to the legacy system");
460 
461  for (const MuonGMR4::MmReadoutElement* copyMe : mmReadouts) {
462  const Identifier reId = copyMe->identify();
463  GeoIntrusivePtr<GeoVFullPhysVol> physVol{cloneNswWedge(gctx, copyMe, cacheObj)};
464  auto newRE = std::make_unique<MuonGM::MMReadoutElement>(physVol,
465  m_idHelperSvc->stationNameString(reId),
466  copyMe->stationEta(),
467  copyMe->stationPhi(),
468  copyMe->multilayer(), cacheObj.detMgr.get(),
469  alignStore ? alignStore->passivation : nullptr);
471  for (unsigned int gasGap = 0; gasGap < copyMe->nGasGaps(); ++gasGap) {
472  const MuonGMR4::StripLayer& stripLayer{copyMe->stripLayer(MuonGMR4::MmReadoutElement::createHash(gasGap +1, 0))};
473  const MuonGMR4::StripDesign& designFrom{stripLayer.design()};
474 
475  newRE->m_Xlg[gasGap] = stripLayer.toOrigin() *
476  Amg::getRotateZ3D(-designFrom.stereoAngle()) *
478  ATH_MSG_VERBOSE("Layer transform "<<gasGap<<" "<<GeoTrf::toString(newRE->m_Xlg[gasGap], true));
479 
480  MuonGM::MuonChannelDesign& designTo{newRE->m_etaDesign[gasGap]};
481  designTo.defineTrapezoid(designFrom.shortHalfHeight(),
482  designFrom.longHalfHeight(),
483  designFrom.halfWidth(),
484  designFrom.stereoAngle());
486  designTo.detType = MuonGM::MuonChannelDesign::DetType::MM;
487  designTo.inputPitch = designFrom.stripPitch();
488  designTo.inputWidth = designTo.inputPitch * std::cos(designTo.stereoAngle());
489  designTo.nMissedBottomEta = designTo.nMissedBottomStereo = designFrom.firstStripNumber() - 1;
490  designTo.totalStrips = designFrom.numStrips();
491  designTo.nch = designFrom.numStrips();
492 
493  designTo.setFirstPos(designFrom.firstStripPos().x() + 0.5*designTo.inputPitch);
494  }
495 
496  newRE->fillCache();
497  if (alignStore && alignStore->getBLine(reId)) {
498  newRE->setBLinePar(*alignStore->getBLine(reId));
499  }
500  ATH_CHECK(dumpAndCompare(gctx, *copyMe, *newRE));
501  cacheObj.detMgr->addMMReadoutElement(std::move(newRE));
502  }
503  return StatusCode::SUCCESS;
504 }
505 
507  ConstructionCache& cacheObj) const{
508  SubDetAlignment alignItr = gctx.getStore(ActsTrk::DetectorType::sTgc);
509  auto alignStore = alignItr ? static_cast<const sTgcAlignmentStore*>(alignItr->internalAlignment.get()) : nullptr;
510 
511  const std::vector<const MuonGMR4::sTgcReadoutElement*> sTgcReadOuts{m_detMgr->getAllsTgcReadoutElements()};
512  ATH_MSG_INFO("Copy "<<sTgcReadOuts.size()<<" sTgc readout elements to the legacy system");
513 
514  for (const MuonGMR4::sTgcReadoutElement* copyMe : sTgcReadOuts) {
515  const Identifier reId = copyMe->identify();
516  GeoIntrusivePtr<GeoVFullPhysVol> physVol{cloneNswWedge(gctx, copyMe, cacheObj)};
517 
518  auto newRE = std::make_unique<MuonGM::sTgcReadoutElement>(physVol,
519  m_idHelperSvc->stationNameString(reId).substr(1),
520  copyMe->stationEta(),
521  copyMe->stationPhi(),
522  copyMe->multilayer(),
523  cacheObj.detMgr.get());
524 
525  if (alignStore && alignStore->getBLine(reId)) {
526  newRE->setBLinePar(*alignStore->getBLine(reId));
527  }
528  for (unsigned int layer = 1; layer <= copyMe->numLayers(); ++layer) {
530  using ChannelDesign = MuonGM::MuonChannelDesign;
531  const IdentifierHash layerHash = MuonGMR4::sTgcReadoutElement::createHash(layer,channelType::Strip,0);
532  newRE->m_Xlg[layer -1] = Amg::getTranslate3D(copyMe->globalToLocalTrans(gctx) *
533  copyMe->center(gctx, layerHash));
534 
535  const MuonGMR4::StripDesign& copyEtaDesign{copyMe->stripDesign(layerHash)};
537  ChannelDesign& etaDesign{newRE->m_etaDesign[layer-1]};
538  etaDesign.type = ChannelDesign::ChannelType::etaStrip;
539  etaDesign.detType = ChannelDesign::DetType::STGC;
540  if (copyEtaDesign.yCutout()) {
541  etaDesign.defineDiamond(copyEtaDesign.shortHalfHeight(),
542  copyEtaDesign.longHalfHeight(),
543  copyEtaDesign.halfWidth(),
544  copyEtaDesign.yCutout());
545  } else {
546  etaDesign.defineTrapezoid(copyEtaDesign.shortHalfHeight(),
547  copyEtaDesign.longHalfHeight(),
548  copyEtaDesign.halfWidth());
549  }
550  etaDesign.inputPitch = copyEtaDesign.stripPitch();
551  etaDesign.inputWidth = copyEtaDesign.stripWidth();
552  etaDesign.nch = copyEtaDesign.numStrips();
553  etaDesign.setFirstPos(copyEtaDesign.firstStripPos().x());
555 
556  const MuonGMR4::WireGroupDesign& copyPhiDesign{copyMe->wireDesign(layerHash)};
557 
558  ChannelDesign& phiDesign{newRE->m_phiDesign[layer-1]};
559  phiDesign.type = ChannelDesign::ChannelType::phiStrip;
560  phiDesign.detType = ChannelDesign::DetType::STGC;
561  if (copyPhiDesign.yCutout() == 0.) {
562  phiDesign.defineTrapezoid(copyPhiDesign.shortHalfHeight(),
563  copyPhiDesign.longHalfHeight(),
564  copyPhiDesign.halfWidth());
565  } else {
566  phiDesign.defineDiamond(copyPhiDesign.shortHalfHeight(),
567  copyPhiDesign.longHalfHeight(),
568  copyPhiDesign.halfWidth(),
569  copyPhiDesign.yCutout());
570  }
571  phiDesign.inputPitch = copyPhiDesign.stripPitch();
572  phiDesign.inputWidth = copyPhiDesign.stripWidth();
573  phiDesign.setFirstPos(copyPhiDesign.firstStripPos().x()); // Position of 1st wire, accounts for staggering
574  phiDesign.firstPitch = copyPhiDesign.numWiresInGroup(1); // Number of Wires in 1st group, group staggering
575  phiDesign.groupWidth = copyPhiDesign.numWiresInGroup(2); // Number of Wires normal group
576  phiDesign.nGroups = copyPhiDesign.numStrips(); // Number of Wire Groups
577  phiDesign.wireCutout = copyPhiDesign.wireCutout(); // Size of "active" wire region for digits
578  phiDesign.nch = copyPhiDesign.nAllWires();
579 
580  const MuonGMR4::PadDesign& copyPadDesign{copyMe->padDesign(layerHash)};
581  MuonGM::MuonPadDesign& padDesign{newRE->m_padDesign[layer-1]};
582  padDesign.Length = copyMe->chamberHeight();
583  padDesign.sWidth = copyMe->sChamberLength();
584  padDesign.lWidth = copyMe->lChamberLength();
585  padDesign.Size = 2.*copyPadDesign.halfWidth();
586  padDesign.ysFrame = copyMe->sFrameWidth();
587  padDesign.ylFrame = copyMe->lFrameWidth();
588  padDesign.thickness = copyMe->thickness();
589  padDesign.yCutout = copyPadDesign.yCutout();
590  padDesign.setR(copyPadDesign.beamlineRadius());
591  padDesign.sPadWidth = 2.*copyPadDesign.shortHalfHeight();
592  padDesign.lPadWidth = 2.*copyPadDesign.longHalfHeight();
593  padDesign.nPadColumns = copyPadDesign.numPadPhi();
594  padDesign.firstPhiPos = copyPadDesign.firstPadPhiDiv();
595  padDesign.inputPhiPitch = copyPadDesign.anglePadPhi();
596  padDesign.PadPhiShift = copyPadDesign.padPhiShift();
597  padDesign.nPadH = copyPadDesign.numPadEta();
598  padDesign.padEtaMax = copyPadDesign.maxPadEta();
599  padDesign.firstRowPos = copyPadDesign.firstPadHeight();
600  padDesign.inputRowPitch = copyPadDesign.padHeight();
601  padDesign.sectorOpeningAngle = copyPadDesign.sectorAngle();
602  }
603  newRE->fillCache();
604  cacheObj.detMgr->addsTgcReadoutElement(std::move(newRE));
605  }
606  return StatusCode::SUCCESS;
607 }
609  ConstructionCache& cacheObj) const {
611  SubDetAlignment alignItr = gctx.getStore(ActsTrk::DetectorType::Mdt);
612  const MdtAlignmentStore* alignStore = alignItr ?
613  static_cast<const MdtAlignmentStore*>(alignItr->internalAlignment.get()) : nullptr;
614 
615  const std::vector<const MuonGMR4::MdtReadoutElement*> mdtReadOuts{m_detMgr->getAllMdtReadoutElements()};
616  ATH_MSG_INFO("Copy "<<mdtReadOuts.size()<<" Mdt readout elements to the legacy system");
617  for (const MuonGMR4::MdtReadoutElement* copyMe : mdtReadOuts) {
618  const Identifier reId = copyMe->identify();
619  ATH_MSG_DEBUG("Translate "<<m_idHelperSvc->toStringDetEl(reId));
621  GeoIntrusivePtr<GeoVFullPhysVol> physVol{};
622  MuonGM::MuonStation* station{nullptr};
623  ATH_CHECK(cloneReadoutVolume(gctx,reId, cacheObj, physVol, station));
624 
625  const MuonGMR4::MdtReadoutElement::parameterBook& pars{copyMe->getParameters()};
626  auto newElement = std::make_unique<MuonGM::MdtReadoutElement>(physVol,
627  m_idHelperSvc->stationNameString(reId),
628  cacheObj.detMgr.get());
629  newElement->setIdentifier(reId);
630  newElement->setMultilayer(copyMe->multilayer());
631  // cppcheck-suppress invalidLifetime; ok: mgr took ownership.
632  newElement->setParentMuonStation(station);
634  newElement->setLongRsize(2*pars.halfY);
636  newElement->setLongSsize(2*pars.longHalfX - 1.*Gaudi::Units::cm);
637  newElement->setLongZsize(2*pars.halfHeight);
638  newElement->setRsize(2*pars.halfY);
639  newElement->setSsize(2*pars.shortHalfX - 1.*Gaudi::Units::cm);
640  newElement->setZsize(2*pars.halfHeight);
641 
642  newElement->m_nlayers = copyMe->numLayers();
643  newElement->m_ntubesperlayer = copyMe->numTubesInLay();
644  newElement->m_deadlength = pars.deadLength;
645  newElement->m_endpluglength = pars.endPlugLength;
646  newElement->m_innerRadius = pars.tubeInnerRad;
647  newElement->m_tubeWallThickness = pars.tubeWall;
648  newElement->m_tubepitch = pars.tubePitch;
651 
653  const MuonGMR4::MdtTubeLayer& tubeLay{*pars.tubeLayers[0]};
654  unsigned int step{1};
655  double lastLength{2.*tubeLay.tubeHalfLength(1)};
656  for (unsigned tube = 0; tube < copyMe->numTubesInLay(); ++tube) {
657  const double currLength = 2.*tubeLay.tubeHalfLength(tube);
658  if (std::abs(lastLength - currLength) > std::numeric_limits<float>::epsilon() ||
659  tube == copyMe->numTubesInLay() -1) {
660  newElement->m_tubelength[step-1] = lastLength;
661  newElement->m_tubelength[step] = currLength;
662  if (step == 1) {
663  newElement->m_ntubesinastep = tube;
664  }
665  lastLength = currLength;
666  ++step;
667  }
668  }
669  newElement->m_nsteps = step;
670 
672  const Amg::Transform3D globToLoc{copyMe->globalToLocalTrans(gctx)};
673  double xOffSet{pars.halfY}, yOffSet{pars.halfHeight};
674  if (newElement->barrel()) std::swap(xOffSet, yOffSet);
675  for (unsigned lay = 1; lay <= copyMe->numLayers(); ++lay) {
676  const IdentifierHash tubeHash{copyMe->measurementHash(lay, 1)};
677  const Amg::Vector3D locTube = globToLoc * copyMe->globalTubePos(gctx, tubeHash);
678  newElement->m_firstwire_x[lay-1] = locTube.z() + xOffSet;
679  newElement->m_firstwire_y[lay-1] = locTube.x() + yOffSet;
680  }
681  MdtAlignmentStore::chamberDistortions distort = alignStore ? alignStore->getDistortion(reId) :
683 
684  if (!station->hasMdtAsBuiltParams()){
685  station->setMdtAsBuiltParams(distort.asBuilt);
686  }
687  if (!station->hasBLines()){
688  station->setBline(distort.bLine);
689  }
690 
691  newElement->geoInitDone();
692 
693  newElement->setBLinePar(distort.bLine);
694  newElement->fillCache();
696  ATH_CHECK(dumpAndCompare(gctx, *copyMe, *newElement));
697  cacheObj.detMgr->addMdtReadoutElement(std::move(newElement));
698  }
699  return StatusCode::SUCCESS;
700 }
701 
703  const MuonGM::MuonReadoutElement& testEle) const{
704 
705  if (refEle.identify() != testEle.identify()) {
706  ATH_MSG_FATAL("Two different elements are compared "
707  <<m_idHelperSvc->toString(refEle.identify())<<" vs. "
708  <<m_idHelperSvc->toString(testEle.identify()));
709  return StatusCode::FAILURE;
710  }
711  if (refEle.identHash() != testEle.detectorElementHash()) {
712  ATH_MSG_FATAL("The hashes of the two detector elements "<<m_idHelperSvc->toString(refEle.identify())
713  <<" are completely different "<<refEle.identHash()<<" vs. "<<testEle.detectorElementHash());
714  return StatusCode::FAILURE;
715  }
716  return StatusCode::SUCCESS;
717 }
718 
720  const MuonGMR4::MmReadoutElement& refEle,
721  const MuonGM::MMReadoutElement& testEle) const {
722 
723  if (!m_checkGeo) {
724  return StatusCode::SUCCESS;
725  }
726  ATH_CHECK(checkIdCompability(refEle, testEle));
727 
728  ATH_MSG_VERBOSE("Compare basic readout transforms"<<std::endl
729  <<GeoTrf::toString(testEle.absTransform(),true)<<std::endl
730  <<GeoTrf::toString(refEle.localToGlobalTrans(gctx), true));
731  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
732  for (unsigned int gasGap = 1; gasGap <= refEle.nGasGaps(); ++ gasGap) {
733  const Identifier gapId = idHelper.channelID(refEle.identify(), refEle.multilayer(), gasGap, 1);
734 
735  const Amg::Transform3D& refTrf{refEle.localToGlobalTrans(gctx, gapId)};
736  const Amg::Transform3D& testTrf{testEle.transform(gapId)};
737  if (!Amg::doesNotDeform(refTrf.inverse()*testTrf)) {
738  ATH_MSG_FATAL("The layer "<<m_idHelperSvc->toStringGasGap(gapId)<<" does not transform equally"
739  <<GeoTrf::toString(refTrf, true) <<" vs. "<<GeoTrf::toString(testTrf, true));
740  return StatusCode::FAILURE;
741  }
742  const MuonGMR4::StripDesign& stripDesign{refEle.stripLayer(gapId).design()};
743 
744  for (int strip = stripDesign.firstStripNumber(); strip <= stripDesign.numStrips(); ++strip) {
745  const Identifier stripId = idHelper.channelID(refEle.identify(), refEle.multilayer(), gasGap, strip);
746  const Amg::Vector3D refStripPos{refEle.stripPosition(gctx, stripId)};
747  const Amg::Vector3D refStripDir{refEle.localToGlobalTrans(gctx, refEle.layerHash(stripId)).linear() * Amg::Vector3D::UnitX()};
748 
749  Amg::Vector3D testStripPos{Amg::Vector3D::Zero()};
750  if (!testEle.stripGlobalPosition(stripId, testStripPos)) {
751  ATH_MSG_FATAL("Failed to retrieve strip position "<<m_idHelperSvc->toString(stripId));
752  return StatusCode::FAILURE;
753  }
754  const double dist = refStripDir.dot(refStripPos - testStripPos);
755  if (std::abs(dist) > 10. * Gaudi::Units::micrometer) {
756  ATH_MSG_FATAL("The strip "<<Amg::toString(testStripPos)<<" is not describing the same strip as "
757  <<Amg::toString(refStripPos)<<". Channel "<<m_idHelperSvc->toString(stripId)
758  <<" distance: "<<dist<<" "<<(dist / testEle.m_etaDesign[gasGap -1].inputWidth));
759  return StatusCode::FAILURE;
760  }
761  ATH_MSG_VERBOSE("Channel postion "<<m_idHelperSvc->toString(stripId)<<" match between legacy & new");
762  }
763  }
764  return StatusCode::SUCCESS;
765 }
766 
768  const MuonGMR4::MdtReadoutElement& refEle,
769  const MuonGM::MdtReadoutElement& testEle) const {
770 
771  if (!m_checkGeo) {
772  return StatusCode::SUCCESS;
773  }
774  ATH_CHECK(checkIdCompability(refEle, testEle));
775 
776  ATH_MSG_VERBOSE("Detector element "<<m_idHelperSvc->toString(refEle.identify())
777  <<std::endl<<GeoTrf::toString(refEle.localToGlobalTrans(gctx))
778  <<std::endl<<GeoTrf::toString(testEle.getMaterialGeom()->getAbsoluteTransform())
779  <<std::endl<<"r-size: "<<testEle.getRsize()<<"/"<<testEle.getLongRsize()
780  <<" s-size: "<<testEle.getSsize()<<"/"<<testEle.getLongSsize()
781  <<" z-size: "<<testEle.getZsize()<<"/"<<testEle.getLongZsize());
782  for (unsigned int lay = 1; lay <= refEle.numLayers(); ++lay){
783  for (unsigned int tube = 1; tube <= refEle.numTubesInLay(); ++tube) {
784  const IdentifierHash tubeHash {refEle.measurementHash(lay,tube)};
785  if (!refEle.isValid(tubeHash)) {
786  ATH_MSG_VERBOSE("SKip layer / tube "<<lay <<","<<tube);
787  continue;
788  }
789  const Amg::Transform3D globToLocal = refEle.globalToLocalTrans(gctx, tubeHash);
790 
791  const Amg::Vector3D refPos = refEle.globalTubePos(gctx, tubeHash);
792  const Amg::Vector3D tubePos = testEle.tubePos(lay, tube);
793 
794 
795  if ( (refPos - tubePos).mag() > Gaudi::Units::micrometer &&
796  (globToLocal*refPos - globToLocal * tubePos).perp() > Gaudi::Units::micrometer) {
797  ATH_MSG_ERROR("Tube positions differ for "<<m_idHelperSvc->toString(refEle.measurementId(tubeHash))
798  <<" reference: "<<GeoTrf::toString(refPos)<<" vs. test: "
799  <<GeoTrf::toString(tubePos) <<" delta: "<<(refPos - tubePos).mag());
800  return StatusCode::FAILURE;
801  }
802  ATH_MSG_VERBOSE("Tube positions layer: "<<lay<<", tube: "<<tube
803  <<std::endl<<"reference: "<<GeoTrf::toString(refPos)
804  <<std::endl<<"test: "<<GeoTrf::toString(tubePos)
805  <<std::endl<<testEle.tubeLength(lay, tube)<<"/"
806  <<testEle.getActiveTubeLength(lay, tube)<<"/"
807  <<testEle.getWireLength(lay,tube)
808  <<" vs. "<<refEle.tubeLength(tubeHash)<<"/"<<refEle.activeTubeLength(tubeHash)
809  <<"/"<<refEle.wireLength(tubeHash));
810  if (std::abs(testEle.tubeLength(lay,tube) - refEle.tubeLength(tubeHash)) >
811  std::numeric_limits<float>::epsilon() ) {
812  ATH_MSG_WARNING("Different tube length's detected for "<<m_idHelperSvc->toStringDetEl(refEle.identify())
813  << " layer: "<<lay<<", tube: "<<tube<<" "<<testEle.tubeLength(lay,tube)<<" (new) vs. "
814  <<refEle.tubeLength(tubeHash)<<" (ref)");
815  }
816  }
817  }
818 
819  return StatusCode::SUCCESS;
820 }
822  const MuonGMR4::RpcReadoutElement& refEle,
823  const MuonGM::RpcReadoutElement& testEle) const {
824 
825  if (!m_checkGeo) {
826  return StatusCode::SUCCESS;
827  }
828  ATH_CHECK(checkIdCompability(refEle, testEle));
829 
830  ATH_MSG_VERBOSE("Compare basic readout transforms"<<std::endl
831  <<GeoTrf::toString(testEle.absTransform(),true)<<std::endl
832  <<GeoTrf::toString(refEle.localToGlobalTrans(gctx), true));
833  const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
834  for (unsigned int gasGap = 1; gasGap <= refEle.nGasGaps(); ++gasGap) {
835  for (int doubPhi = refEle.doubletPhi(); doubPhi <= refEle.doubletPhiMax(); ++doubPhi) {
836  for (bool measPhi : {false, true}) {
837  for (int strip = 1; strip <= testEle.Nstrips(measPhi); ++strip) {
838  const Identifier stripId = idHelper.channelID(refEle.identify(),
839  refEle.doubletZ(),
840  doubPhi, gasGap, measPhi, strip);
841 
842  const Amg::Transform3D& refTrans{refEle.localToGlobalTrans(gctx, stripId)};
843  const Amg::Transform3D& testTrans{testEle.transform(stripId)};
844  if (strip == 1 && Amg::doesNotDeform(refTrans.inverse()*testTrans)) {
845  ATH_MSG_ERROR("Transformation for "<<m_idHelperSvc->toString(stripId)<<std::endl
846  <<" *** ref: "<<GeoTrf::toString(refTrans, true)<<std::endl
847  <<" *** test: "<<GeoTrf::toString(testTrans, true));
848  return StatusCode::FAILURE;
849  }
850 
851  const Amg::Vector3D refStripPos = refEle.stripPosition(gctx, stripId);
852  const Amg::Vector3D testStripPos = testEle.stripPos(stripId);
853  if ((refStripPos - testStripPos).mag() > std::numeric_limits<float>::epsilon()){
854  ATH_MSG_ERROR("Mismatch in strip positions "<<m_idHelperSvc->toString(stripId)
855  <<" ref: "<<Amg::toString(refStripPos)<<" test: "<<Amg::toString(testStripPos)
856  <<" local coordinates -- ref: "<<Amg::toString(testEle.absTransform().inverse()*refStripPos)
857  <<" test: "<<Amg::toString(testEle.absTransform().inverse()*testStripPos));
858  return StatusCode::FAILURE;
859  }
860  ATH_MSG_VERBOSE("Agreement between new and old geometry for channel "<<m_idHelperSvc->toString(stripId)
861  <<" strip position "<<Amg::toString(refStripPos));
862  }
863  }
864  }
865  }
866  return StatusCode::SUCCESS;
867 }
869  const MuonGMR4::TgcReadoutElement& refEle,
870  const MuonGM::TgcReadoutElement& testEle) const {
871 
872  if (!m_checkGeo) {
873  return StatusCode::SUCCESS;
874  }
875  ATH_CHECK(checkIdCompability(refEle, testEle));
876 
877  const TgcIdHelper& idHelper{m_idHelperSvc->tgcIdHelper()};
878 
879  ATH_MSG_VERBOSE("Detector element "<<m_idHelperSvc->toString(refEle.identify())
880  <<std::endl<<GeoTrf::toString(refEle.localToGlobalTrans(gctx), true)
881  <<std::endl<<GeoTrf::toString(testEle.getMaterialGeom()->getAbsoluteTransform(), true)
882  <<std::endl<<"r-size: "<<testEle.getRsize()<<"/"<<testEle.getLongRsize()
883  <<" s-size: "<<testEle.getSsize()<<"/"<<testEle.getLongSsize()
884  <<" z-size: "<<testEle.getZsize()<<"/"<<testEle.getLongZsize());
885 
886  for (unsigned int gasGap = 1; gasGap <= refEle.nGasGaps(); ++gasGap) {
887  for (bool isStrip : {false, true}) {
888  const IdentifierHash layHash = refEle.constructHash(0, gasGap, isStrip);
889  const Identifier layId = idHelper.channelID(refEle.identify(), gasGap, isStrip, 1);
890  ATH_MSG_VERBOSE("Test layer "<<m_idHelperSvc->toString(layId)<<" "<<refEle.numChannels(layHash)<<" "<<layHash);
891  if (!refEle.numChannels(layHash)) continue;
892  const Amg::Transform3D& refLayerTrf = refEle.localToGlobalTrans(gctx, layHash);
893  const Amg::Transform3D& testLayerTrf = testEle.transform(layId);
894  if (!Amg::isIdentity(refLayerTrf.inverse()* testLayerTrf)) {
895  ATH_MSG_FATAL("The transformations in "<<m_idHelperSvc->toString(layId)
896  <<std::endl<<"ref : "<<GeoTrf::toString(refLayerTrf,true)
897  <<std::endl<<"test: "<<GeoTrf::toString(testLayerTrf,true)
898  <<" are not identical. ");
899  return StatusCode::FAILURE;
900  }
901  ATH_MSG_VERBOSE("Transformations in "<<m_idHelperSvc->toString(layId)
902  <<std::endl<<"ref : "<<GeoTrf::toString(refLayerTrf,true)
903  <<std::endl<<"test: "<<GeoTrf::toString(testLayerTrf,true));
904 
905  for (unsigned int ch = 1; ch <= refEle.numChannels(layHash); ++ch) {
906  const IdentifierHash measHash = refEle.constructHash(ch, gasGap, isStrip);
907  const Identifier measId = refEle.measurementId(measHash);
908  const Amg::Vector3D refChannel = refEle.channelPosition(gctx, measHash);
909  const Amg::Vector3D testChannel = testEle.channelPos(measId);
910  if ((refChannel - testChannel).mag() < std::numeric_limits<float>::epsilon()){
911  continue;
912  }
913  std::stringstream msg{};
914  msg<<"The channel "<<m_idHelperSvc->toString(measId)
915  << " is not at the same position "<<Amg::toString(refChannel)
916  <<" vs. "<<Amg::toString(testChannel)<<". Difference: "
917  <<(refChannel - testChannel).mag();
918  if (!isStrip) {
919  msg<<std::endl<<"*** Test *** - wirePitch: "<<testEle.wirePitch()
920  <<", tot wires "<<testEle.nWires(gasGap)
921  <<", wires to reach "<<testEle.nPitchesToGang(gasGap, ch)
922  <<", wires in gang "<<testEle.nWires(gasGap, ch);
923  const MuonGMR4::WireGroupDesign& design{refEle.wireGangLayout(gasGap)};
924  msg<<std::endl<<"*** Ref *** - wirePitch: "<<design.stripPitch()
925  <<", tot wires "<<testEle.nWires(gasGap)
926  <<", wires to reach "<<design.numPitchesToGroup(ch)
927  <<", wires in gang "<<design.numWiresInGroup(ch);
928  } else {
929  const Amg::Vector3D locRefPos{refLayerTrf.inverse() * refChannel};
930  const Amg::Vector3D locTestPos{refLayerTrf.inverse()* testChannel};
931  msg<<std::endl<<"*** Ref **** - "<<Amg::toString(locRefPos)<<std::endl;
932  msg<<std::endl<<"*** Test **** - "<<Amg::toString(locTestPos)<<std::endl;
933  }
934  ATH_MSG_FATAL(msg.str());
935  return StatusCode::FAILURE;
936  }
937 
938  }
939  }
940  return StatusCode::SUCCESS;
941 }
943  const MuonGMR4::sTgcReadoutElement& refEle,
944  const MuonGM::sTgcReadoutElement& testEle) const {
945 
946  if (!m_checkGeo) {
947  return StatusCode::SUCCESS;
948  }
949  ATH_CHECK(checkIdCompability(refEle, testEle));
950 
951  ATH_MSG_VERBOSE("Compare basic readout transforms"<<std::endl
952  <<GeoTrf::toString(testEle.absTransform(),true)<<std::endl
953  <<GeoTrf::toString(refEle.localToGlobalTrans(gctx), true));
954  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
955  for (unsigned int gasGap = 1; gasGap <= refEle.numLayers(); ++gasGap) {
956  for (int chType = sTgcIdHelper::sTgcChannelTypes::Pad; chType <= sTgcIdHelper::sTgcChannelTypes::Wire; ++chType) {
957  unsigned int numChannel = 0;
958  const Identifier layID = idHelper.channelID(refEle.identify(),
959  refEle.multilayer(),
960  gasGap, chType, 1);
961  switch(chType) {
962  case sTgcIdHelper::sTgcChannelTypes::Pad:
963  numChannel = refEle.numPads(layID);
964  break;
965 
966  case sTgcIdHelper::sTgcChannelTypes::Strip:
967  numChannel = refEle.numStrips(layID);
968  break;
969 
970  case sTgcIdHelper::sTgcChannelTypes::Wire:
971  numChannel = refEle.numWireGroups(gasGap);
972  break;
973  }
974  for (unsigned int channel = 1; channel < numChannel ; ++channel) {
975  const Identifier chID = idHelper.channelID(refEle.identify(),
976  refEle.multilayer(),
977  gasGap, chType, channel);
978 
979  const Amg::Transform3D& refTrans{refEle.localToGlobalTrans(gctx, chID)};
980  const Amg::Transform3D& testTrans{testEle.transform(chID)};
981  if (channel == 1 && Amg::doesNotDeform(refTrans.inverse()*testTrans)) {
982  ATH_MSG_ERROR("Transformation for "<<m_idHelperSvc->toString(chID)<<std::endl
983  <<" *** ref: "<<GeoTrf::toString(refTrans, true)<<std::endl
984  <<" *** test: "<<GeoTrf::toString(testTrans, true));
985  return StatusCode::FAILURE;
986  }
987  if (chType == sTgcIdHelper::sTgcChannelTypes::Pad) {
988  const Amg::Vector3D refChannelPos = refEle.globalChannelPosition(gctx, chID);
989  Amg::Vector3D testChannelPos(Amg::Vector3D::Zero());
990  testEle.stripGlobalPosition(chID, testChannelPos);
991 
992  const std::array<Amg::Vector3D,4> refPadCorners = refEle.globalPadCorners(gctx, chID);
993  std::array<Amg::Vector3D,4> testPadCorners{make_array<Amg::Vector3D, 4>(Amg::Vector3D::Zero())};
994  testEle.padGlobalCorners(chID, testPadCorners);
995  for (unsigned int cornerIdx = 0; cornerIdx < refPadCorners.size(); ++cornerIdx) {
996  if ((refPadCorners[cornerIdx] - testPadCorners[cornerIdx]).mag() > 10. * Gaudi::Units::micrometer){
997  ATH_MSG_ERROR("Mismatch in pad Corner "<<m_idHelperSvc->toString(chID)
998  <<" ref: "<<Amg::toString(refPadCorners[cornerIdx])<<" test: "<<Amg::toString(testPadCorners[cornerIdx])
999  <<" local coordinates -- ref: "<<Amg::toString(testEle.absTransform().inverse()*refPadCorners[cornerIdx])
1000  <<" test: "<<Amg::toString(testEle.absTransform().inverse()*testPadCorners[cornerIdx]));
1001  return StatusCode::FAILURE;
1002  }
1003  }
1004  if ((refChannelPos - testChannelPos).mag() > 10. * Gaudi::Units::micrometer){
1005  ATH_MSG_ERROR("Mismatch in channel positions "<<m_idHelperSvc->toString(chID)
1006  <<" ref: "<<Amg::toString(refChannelPos)<<" test: "<<Amg::toString(testChannelPos)
1007  <<" local coordinates -- ref: "<<Amg::toString(testEle.absTransform().inverse()*refChannelPos)
1008  <<" test: "<<Amg::toString(testEle.absTransform().inverse()*testChannelPos));
1009  return StatusCode::FAILURE;
1010  }
1011  ATH_MSG_VERBOSE("Agreement between new and old geometry for channel "<<m_idHelperSvc->toString(chID)
1012  <<" channel position "<<Amg::toString(refChannelPos));
1013  }
1014  else {
1015  const Amg::Vector3D refChannelPos = refEle.globalChannelPosition(gctx, chID);
1016  Amg::Vector3D testChannelPos(Amg::Vector3D::Zero());
1017  testEle.stripGlobalPosition(chID, testChannelPos);
1018  if ((refChannelPos - testChannelPos).mag() > 10. * Gaudi::Units::micrometer){
1019  ATH_MSG_ERROR("Mismatch in channel positions "<<m_idHelperSvc->toString(chID)
1020  <<" ref: "<<Amg::toString(refChannelPos)<<" test: "<<Amg::toString(testChannelPos)
1021  <<" local coordinates -- ref: "<<Amg::toString(testEle.absTransform().inverse()*refChannelPos)
1022  <<" test: "<<Amg::toString(testEle.absTransform().inverse()*testChannelPos));
1023  return StatusCode::FAILURE;
1024  }
1025  ATH_MSG_VERBOSE("Agreement between new and old geometry for channel "<<m_idHelperSvc->toString(chID)
1026  <<" channel position "<<Amg::toString(refChannelPos));
1027  }
1028  }
1029  }
1030  }
1031  return StatusCode::SUCCESS;
1032 }
MuonReadoutGeomCnvAlg::buildMM
StatusCode buildMM(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: MuonReadoutGeomCnvAlg.cxx:451
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MuonGMR4::RpcReadoutElement::doubletPhiMax
int doubletPhiMax() const
Returns the maximum phi panel.
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
chType
sTgcIdHelper::sTgcChannelTypes chType
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/src/NSWGeoPlottingAlg.cxx:20
MuonGM::MuonPadDesign
Parameters defining the design of the readout sTGC pads.
Definition: MuonPadDesign.h:40
MdtReadoutElement.h
MuonGMR4::sTgcReadoutElement::multilayer
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
MuonGM::MuonClusterReadoutElement::transform
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
Definition: MuonClusterReadoutElement.h:124
MuonGMR4::MmReadoutElement
Definition: MmReadoutElement.h:20
STGC
@ STGC
Definition: RegSelEnums.h:39
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
MuonGMR4::TgcReadoutElement::wireGangLayout
const WireGroupDesign & wireGangLayout(unsigned int gasGap) const
Returns access to the wire group design of the given gasGap [1-3] If the gap does not have a wires an...
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonGMR4::MuonDetectorManager::getDetectorTypes
std::vector< ActsTrk::DetectorType > getDetectorTypes() const
Returns a list of all detector types.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:135
MuonGMR4::StripDesign
Definition: StripDesign.h:30
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
MuonReadoutGeomCnvAlg::ConstructionCache::translatedStations
std::set< PVConstLink > translatedStations
Set of all translated Physical volumes.
Definition: MuonReadoutGeomCnvAlg.h:56
MuonGMR4::MmReadoutElement::createHash
static IdentifierHash createHash(const int gasGap, const int strip)
MuonGM::MuonReadoutElement::absTransform
const Amg::Transform3D & absTransform() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:210
SiliconTech::strip
@ strip
MuonGMR4::MmReadoutElement::nGasGaps
unsigned int nGasGaps() const
Returns the number of gas gaps.
MuonGMR4::WireGroupDesign
Definition: WireGroupDesign.h:23
max
#define max(a, b)
Definition: cfImp.cxx:41
MuonGM::MdtReadoutElement::tubeLength
double tubeLength(const int tubeLayer, const int tube) const
MuonReadoutGeomCnvAlg::ConstructionCache::newIdTag
GeoIntrusivePtr< GeoIdentifierTag > newIdTag()
Returns an identifier tag.
Definition: MuonReadoutGeomCnvAlg.h:58
MuonReadoutGeomCnvAlg::cloneReadoutVolume
StatusCode cloneReadoutVolume(const ActsGeometryContext &gctx, const Identifier &stationId, ConstructionCache &cacheObj, GeoIntrusivePtr< GeoVFullPhysVol > &clonedPhysVol, MuonGM::MuonStation *&station) const
Clones the fullPhysical volume of the readoutElement and embeds it into the associated station.
Definition: MuonReadoutGeomCnvAlg.cxx:236
MuonGMR4::MdtReadoutElement::numTubesInLay
unsigned int numTubesInLay() const
Returns the number of tubes per layer.
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ActsTrk::DetectorType
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
Definition: GeometryDefs.h:17
MdtAlignmentStore::chamberDistortions::bLine
const BLinePar * bLine
Definition: MdtAlignmentStore.h:26
perp
Scalar perp() const
perp method - perpenticular length
Definition: AmgMatrixBasePlugin.h:35
MuonGM::MuonStation::getPhysVol
PVConstLink getPhysVol() const
Definition: MuonStation.cxx:383
MuonGM::MuonChannelDesign::defineTrapezoid
void defineTrapezoid(double HalfShortY, double HalfLongY, double HalfHeight)
set the trapezoid dimensions
Definition: MuonChannelDesign.cxx:25
ActsTrk::DetectorAlignStore::TrackingAlignStore
Store holding the transfomations used by the Acts algorithms.
Definition: DetectorAlignStore.h:33
TgcIdHelper
Definition: TgcIdHelper.h:50
sTgcReadoutElement.h
MuonGMR4::MdtReadoutElement::tubeLength
double tubeLength(const IdentifierHash &hash) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx:185
MuonReadoutGeomCnvAlg::m_checkGeo
Gaudi::Property< bool > m_checkGeo
Definition: MuonReadoutGeomCnvAlg.h:134
MuonGM::GasGapIntArray
TgcReadoutParams::GasGapIntArray GasGapIntArray
Definition: RDBReaderAtlas.cxx:20
MuonGMR4::MdtReadoutElement::measurementHash
static IdentifierHash measurementHash(unsigned int layerNumber, unsigned int tubeNumber)
Transform the layer and tube number to the measurementHash.
MuonGMR4::TgcReadoutElement::nGasGaps
unsigned int nGasGaps() const
Returns the number of gasgaps described by this ReadOutElement (usally 2 or 3)
MuonGMR4::TgcReadoutElement::channelPosition
Amg::Vector3D channelPosition(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the center of the measurement channel eta measurement: wire gang center phi measurement: stri...
MuonGMR4::RpcReadoutElement::nGasGaps
unsigned int nGasGaps() const
Returns the number of gasgaps described by this ReadOutElement (usally 2 or 3)
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
MuonGMR4::MdtReadoutElement::activeTubeLength
double activeTubeLength(const IdentifierHash &hash) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx:179
MuonGM::MuonReadoutElement::getZsize
double getZsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:198
MuonGM::MuonReadoutElement::detectorElementHash
IdentifierHash detectorElementHash() const
Returns the IdentifierHash of the detector element.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:186
deg
#define deg
Definition: SbPolyhedron.cxx:17
MuonGMR4::sTgcReadoutElement::ReadoutChannelType
ReadoutChannelType
ReadoutChannelType to distinguish the available readout channels Pad - pad readout channel Strip - et...
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/sTgcReadoutElement.h:31
MuonGMR4::MdtTubeLayer
Helper struct to retrieve the tube lengths and the tube centers directly from the GeoModel tree.
Definition: MdtTubeLayer.h:28
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:54
MuonGMR4::MuonDetectorManager::getAllReadoutElements
std::vector< const MuonReadoutElement * > getAllReadoutElements() const
Returns the list of all detector elements.
MuonGMR4::MuonReadoutElement::globalToLocalTrans
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:78
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ActsTrk::DetectorType::sTgc
@ sTgc
Micromegas (NSW)
sTgcIdHelper::sTgcChannelTypes
sTgcChannelTypes
Definition: sTgcIdHelper.h:190
MuonGM::MuonReadoutElement::getLongSsize
double getLongSsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:199
sTgcAlignmentStore.h
MuonReadoutGeomCnvAlg::ConstructionCache::world
PVLink world
Pointer to the world.
Definition: MuonReadoutGeomCnvAlg.h:54
MuonGMR4::RpcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:18
MuonGMR4::TgcReadoutElement::constructHash
static IdentifierHash constructHash(unsigned int measCh, unsigned int gasGap, const bool isStrip)
Constructs the Hash out of the Identifier fields (channel, gasGap, isStrip)
RpcIdHelper
Definition: RpcIdHelper.h:51
MuonGM::WiregangArray
TgcReadoutParams::WiregangArray WiregangArray
Definition: RDBReaderAtlas.cxx:22
MuonReadoutGeomCnvAlg::ConstructionCache::detMgr
std::unique_ptr< MuonGM::MuonDetectorManager > detMgr
Pointer to the legacy MuonDetectorManager.
Definition: MuonReadoutGeomCnvAlg.h:52
ReadCondHandle.h
MuonGM::sTgcReadoutElement::padGlobalCorners
bool padGlobalCorners(const Identifier &id, std::array< Amg::Vector3D, 4 > &gcorners) const
pad global corners
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h:372
MuonGMR4::RpcReadoutElement::parameterBook
Set of parameters to describe a RPC chamber.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:22
MuonGM::TgcReadoutElement::channelPos
Amg::Vector3D channelPos(const Identifier &id) const
Returns the position of the active channel (wireGang or strip)
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
Amg::getRotateZ3D
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Definition: GeoPrimitivesHelpers.h:270
MuonGM::MuonReadoutElement
Base class for the XxxReadoutElement, with Xxx = Mdt, Rpc, Tgc, Csc.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:40
MuonGM::MuonReadoutElement::getLongRsize
double getLongRsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:200
MuonGM::MuonReadoutElement::getSsize
double getSsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:196
MuonGMR4::MdtReadoutElement::measurementId
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx:45
MdtAlignmentStore
Helper struct to cache simulatenously the As-built and the BLine corrections of the Mdts for fast acc...
Definition: MdtAlignmentStore.h:19
MuonGMR4::MdtReadoutElement::wireLength
double wireLength(const IdentifierHash &hash) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx:188
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
MuonGM::MdtReadoutElement::getWireLength
double getWireLength(const int tubeLayer, const int tube) const
MdtAlignmentStore::getDistortion
chamberDistortions getDistortion(const Identifier &detElId) const
Returns a chamber distortion that's cached for the corresponding Mdt chamber element.
Definition: MdtAlignmentStore.h:33
sTgcReadoutElement.h
ActsGeometryContext::getStore
AlignmentStorePtr & getStore(const DetectorType type)
Returns the mutable alignable store for the ATLAS detector type (Pixel, Mdt, etc.)
Definition: ActsGeometryContext.h:33
MMReadoutElement.h
MuonReadoutGeomCnvAlg::ConstructionCache
Definition: MuonReadoutGeomCnvAlg.h:41
MuonGMR4::sTgcReadoutElement::createHash
static IdentifierHash createHash(const unsigned int gasGap, const unsigned int channelType, const unsigned int channel, const unsigned int wireInGrp=0)
Create a measurement hash from the Identifier fields.
MdtAlignmentStore::chamberDistortions
Helper struct to store the pointer to the Mdt distrotion parameters, namely the As-built and the BLin...
Definition: MdtAlignmentStore.h:25
MuonReadoutGeomCnvAlg::dumpAndCompare
StatusCode dumpAndCompare(const ActsGeometryContext &gctx, const MuonGMR4::RpcReadoutElement &refEle, const MuonGM::RpcReadoutElement &testEle) const
Definition: MuonReadoutGeomCnvAlg.cxx:821
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MuonGMR4::MmReadoutElement::multilayer
int multilayer() const
Returns the multi layer of the element [1-2].
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonGM::TgcReadoutElement::nPitchesToGang
double nPitchesToGang(int gasGap, int gang) const
Returns the number of wire pitches that have to be travelled to reach gang i.
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:50
MuonReadoutGeomCnvAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonReadoutGeomCnvAlg.h:128
MuonGMR4::MmReadoutElement::stripPosition
Amg::Vector3D stripPosition(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the position of the strip center.
ActsTrk::DetectorType::Mm
@ Mm
Maybe not needed in the migration.
MuonGMR4::sTgcReadoutElement::numWireGroups
unsigned int numWireGroups(unsigned int gasGap) const
Number of wire groups in the gas gap.
MuonGM::MuonChannelDesign::DetType::MM
@ MM
MuonGMR4::MdtReadoutElement::parameterBook
Set of parameters to describe a MDT chamber.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:24
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
MuonGM::MuonReadoutElement::getLongZsize
double getLongZsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:201
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MdtAlignmentStore.h
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MuonGM::TgcReadoutElement::nWires
int nWires(int gasGap) const
Returns the total number of wires in a given gas gap.
MuonGM::MMReadoutElement::stripGlobalPosition
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
Definition: MMReadoutElement.h:282
WriteCondHandle.h
MuonGMR4::RpcReadoutElement::doubletPhi
int doubletPhi() const
Returns the doublet Phi field of the MuonReadoutElement identifier.
MuonGM::MdtReadoutElement::getActiveTubeLength
double getActiveTubeLength(const int tubeLayer, const int tube) const
MuonGM::sTgcReadoutElement
An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station c...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h:28
MuonGMR4::MdtReadoutElement::numLayers
unsigned int numLayers() const
Returns the number of tube layer.
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Amg::doesNotDeform
bool doesNotDeform(const Amg::Transform3D &trans)
Checks whether the linear part of the transformation rotates or stetches any of the basis vectors.
Definition: GeoPrimitivesHelpers.h:338
MuonGMR4::RpcReadoutElement::stripPosition
Amg::Vector3D stripPosition(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the position of the strip center.
MuonGM::MuonStation
Definition: MuonStation.h:51
IOVInfiniteRange::infiniteRunLB
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
Definition: IOVInfiniteRange.h:39
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
MuonReadoutGeomCnvAlg::m_writeKey
SG::WriteCondHandleKey< MuonGM::MuonDetectorManager > m_writeKey
Definition: MuonReadoutGeomCnvAlg.h:130
MuonChamber.h
MuonGMR4::TgcReadoutElement::measurementId
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
MuonGMR4::RpcReadoutElement::doubletZ
int doubletZ() const
Returns the doublet Z field of the MuonReadoutElement identifier.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Amg::isIdentity
bool isIdentity(const Amg::Transform3D &trans)
Checks whether the transformation is the Identity transformation.
Definition: GeoPrimitivesHelpers.h:348
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
MuonReadoutGeomCnvAlg::cloneNswWedge
GeoIntrusivePtr< GeoVFullPhysVol > cloneNswWedge(const ActsGeometryContext &gctx, const MuonGMR4::MuonReadoutElement *nswRE, ConstructionCache &cacheObj) const
Clones the fullPhysicalVolume of the
Definition: MuonReadoutGeomCnvAlg.cxx:438
MuonGMR4::MuonReadoutElement::identHash
IdentifierHash identHash() const
Returns the Identifier has of the Element that is Identical to the detElHash from the id_helper class...
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
min
#define min(a, b)
Definition: cfImp.cxx:40
MuonGMR4::MmReadoutElement::stripLayer
const StripLayer & stripLayer(const Identifier &measId) const
MuonGM::nStrips
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
Definition: MuonDetDescr/MuonGeoModelTest/src/GeoModelTgcTest.cxx:46
MuonGMR4::MuonDetectorManager::getTreeTop
PVConstLink getTreeTop(unsigned int i) const override final
Returns the i-th top node of the MuonSystem trees.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:125
IOVInfiniteRange.h
MuonReadoutGeomCnvAlg::buildTgc
StatusCode buildTgc(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: MuonReadoutGeomCnvAlg.cxx:340
MdtAlignmentStore::chamberDistortions::asBuilt
const MdtAsBuiltPar * asBuilt
Definition: MdtAlignmentStore.h:27
dumpTgcDigiThreshold.isStrip
list isStrip
Definition: dumpTgcDigiThreshold.py:33
ActsTrk::DetectorType::Mdt
@ Mdt
MuonSpectrometer.
MuonGM::MMReadoutElement::m_etaDesign
std::array< MuonChannelDesign, 4 > m_etaDesign
Definition: MMReadoutElement.h:155
MuonReadoutGeomCnvAlg::buildRpc
StatusCode buildRpc(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: MuonReadoutGeomCnvAlg.cxx:261
MuonGMR4::sTgcReadoutElement::globalChannelPosition
Amg::Vector3D globalChannelPosition(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global pad/strip/wireGroup position.
MuonReadoutGeomCnvAlg::m_alignStoreKeys
SG::ReadCondHandleKeyArray< ActsTrk::DetectorAlignStore > m_alignStoreKeys
Definition: MuonReadoutGeomCnvAlg.h:132
MmAlignmentStore
Definition: MmAlignmentStore.h:15
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:19
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
MuonGMR4::MuonReadoutElement::alignableTransform
const GeoAlignableTransform * alignableTransform() const
Returnsthe alignable transform of the readout element.
MuonReadoutGeomCnvAlg::MuonReadoutGeomCnvAlg
MuonReadoutGeomCnvAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonReadoutGeomCnvAlg.cxx:65
MuonGM::RpcReadoutElement::stripPos
Amg::Vector3D stripPos(const Identifier &id) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx:177
MuonGM::sTgcReadoutElement::stripGlobalPosition
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h:334
sTgcIdHelper
Definition: sTgcIdHelper.h:55
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Amg::getRotateY3D
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
Definition: GeoPrimitivesHelpers.h:261
MuonGMR4::MuonReadoutElement::identify
Identifier identify() const override final
Return the athena identifier.
MuonReadoutGeomCnvAlg::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition: MuonReadoutGeomCnvAlg.h:135
MuonReadoutGeomCnvAlg::initialize
StatusCode initialize() override
Definition: MuonReadoutGeomCnvAlg.cxx:68
sTgcAlignmentStore
Definition: sTgcAlignmentStore.h:14
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGM::TgcReadoutElement::wirePitch
double wirePitch() const
Returns the pitch of the wires.
MuonGMR4::TgcReadoutElement::numChannels
unsigned int numChannels(const IdentifierHash &measHash) const
Returns the number of readout channels.
MuonGMR4::sTgcReadoutElement::numLayers
unsigned int numLayers() const
Returns the number of gas gap layers.
MuonGMR4::sTgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/sTgcReadoutElement.h:21
MuonGMR4::StripLayer::design
const StripDesign & design() const
Returns the underlying strip design.
RpcReadoutElement.h
MuonChannelDesign.h
SG::ReadCondHandleKey< ActsTrk::DetectorAlignStore >
MuonGM::MuonPadDesign::Length
double Length
Definition: MuonPadDesign.h:55
MuonGM::StripArray
TgcReadoutParams::StripArray StripArray
Definition: RDBReaderAtlas.cxx:23
MuonGM::MuonChannelDesign
Definition: MuonChannelDesign.h:24
MuonGMR4::StripLayer
Definition: StripLayer.h:10
MuonReadoutGeomCnvAlg.h
MuonGM::MdtReadoutElement::tubePos
Amg::Vector3D tubePos(const Identifier &id) const
Returns the global position of the given tube.
a
TList * a
Definition: liststreamerinfos.cxx:10
MmIdHelper
Definition: MmIdHelper.h:54
MuonGM::MuonReadoutElement::getRsize
double getRsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:197
MuonGMR4::MmReadoutElement::layerHash
IdentifierHash layerHash(const Identifier &measId) const override final
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MdtReadoutElement.h
MuonGMR4::sTgcReadoutElement::globalPadCorners
globalCornerArray globalPadCorners(const ActsGeometryContext &ctx, const Identifier &measId) const
GeoPrimitivesHelpers.h
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
MuonGM::MuonReadoutElement::identify
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:184
ActsGeometryContext::AlignmentStorePtr
GeoModel::TransientConstSharedPtr< AlignmentStore > AlignmentStorePtr
Definition: ActsGeometryContext.h:31
MuonGM::TgcReadoutParams
Definition: TgcReadoutParams.h:38
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition: MMReadoutElement.h:23
MuonGM::RpcReadoutElement::Nstrips
int Nstrips(bool measphi) const
returns the number of strips for the phi or eta plane
MuonGMR4::sTgcReadoutElement::numPads
unsigned int numPads(const Identifier &measId) const
Pads Total number of pads in the given layer.
python.DecayParser.children
children
Definition: DecayParser.py:32
MuonGMR4::sTgcReadoutElement::numStrips
unsigned int numStrips(const Identifier &measId) const
Strips Number of strips in a chamber.
MuonGMR4::MuonReadoutElement::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:81
LArCellBinning.step
step
Definition: LArCellBinning.py:158
MuonGMR4::MdtReadoutElement::globalTubePos
Amg::Vector3D globalTubePos(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the tube center.
MmAlignmentStore.h
TgcReadoutElement.h
MuonReadoutGeomCnvAlg::ConstructionCache::makeTransform
GeoIntrusivePtr< GeoTransform > makeTransform(const Amg::Transform3D &trf)
Transforms an Amg::Transform3D into a GeoModelTransform node If the transform has been shown before t...
Definition: MuonReadoutGeomCnvAlg.h:48
MuonGMR4::StripDesign::stripPitch
double stripPitch() const
Distance between two adjacent strips.
MuonReadoutGeomCnvAlg::buildStation
StatusCode buildStation(const ActsGeometryContext &gctx, const Identifier &stationId, ConstructionCache &cacheObj) const
builds a station object from readout element.
Definition: MuonReadoutGeomCnvAlg.cxx:145
IdentifierHash
Definition: IdentifierHash.h:38
MuonGMR4::PadDesign
Definition: PadDesign.h:24
MuonStation.h
MuonGMR4::RadialStripDesign
Definition: RadialStripDesign.h:23
TgcReadoutElement.h
MuonReadoutGeomCnvAlg::buildMdt
StatusCode buildMdt(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: MuonReadoutGeomCnvAlg.cxx:608
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
MuonReadoutGeomCnvAlg::checkIdCompability
StatusCode checkIdCompability(const MuonGMR4::MuonReadoutElement &refEle, const MuonGM::MuonReadoutElement &testEle) const
Definition: MuonReadoutGeomCnvAlg.cxx:702
MuonGMR4::MdtReadoutElement::isValid
bool isValid(const IdentifierHash &measHash) const
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:25
MuonGMR4::TgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/TgcReadoutElement.h:20
calibdata.tube
tube
Definition: calibdata.py:31
MuonGM::MuonChannelDesign::ChannelType::etaStrip
@ etaStrip
MmReadoutElement.h
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
Amg::getTranslate3D
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
Definition: GeoPrimitivesHelpers.h:289
MuonGMR4::MuonDetectorManager::getReadoutElement
const MuonReadoutElement * getReadoutElement(const Identifier &id) const
Returns a generic Muon readout element.
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
MuonReadoutGeomCnvAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition: MuonReadoutGeomCnvAlg.cxx:77
RpcReadoutElement.h
MuonReadoutGeomCnvAlg::buildSTGC
StatusCode buildSTGC(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: MuonReadoutGeomCnvAlg.cxx:506