ATLAS Offline Software
MuonChamberToolTest.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #if defined(FLATTEN) && defined(__GNUC__)
6 // Avoid warning in dbg build
7 #pragma GCC optimize "-fno-var-tracking-assignments"
8 #endif
9 
10 #include "MuonChamberToolTest.h"
11 
19 #include <GaudiKernel/SystemOfUnits.h>
20 
21 #include "Acts/Geometry/TrapezoidVolumeBounds.hpp"
22 #include "Acts/Geometry/TrackingGeometry.hpp"
23 #include "Acts/Surfaces/TrapezoidBounds.hpp"
24 
25 #include <format>
26 namespace{
27  constexpr double tolerance = 10. *Gaudi::Units::micrometer;
28 }
29 
30 namespace MuonGMR4 {
31 
33  ATH_CHECK(m_idHelperSvc.retrieve());
35  ATH_CHECK(m_trackingGeometrySvc.retrieve());
37  return StatusCode::SUCCESS;
38  }
39  template <class EnvelopeType>
40 #if defined(FLATTEN) && defined(__GNUC__)
41 // We compile this function with optimization, even in debug builds; otherwise,
42 // the heavy use of Eigen makes it too slow. However, from here we may call
43 // to out-of-line Eigen code that is linked from other DSOs; in that case,
44 // it would not be optimized. Avoid this by forcing all Eigen code
45 // to be inlined here if possible.
46 [[gnu::flatten]]
47 #endif
48  StatusCode MuonChamberToolTest::pointInside(const EnvelopeType& chamb,
49  const Acts::Volume& boundVol,
50  const Amg::Vector3D& point,
51  const std::string& descr,
52  const Identifier& channelId) const {
53 
54  // Explicitly inline Volume::inside here so that it gets
55  // flattened in debug builds.
56  Acts::Vector3 posInVolFrame((boundVol.transform().inverse()) * point);
57  if (boundVol.volumeBounds().inside(posInVolFrame,tolerance)) {
58  ATH_MSG_VERBOSE("In channel "<<m_idHelperSvc->toString(channelId)
59  <<", point "<<descr <<" is inside of the chamber "<<std::endl<<chamb<<std::endl
60  <<"Local position:" <<Amg::toString(boundVol.itransform() * point));
61  return StatusCode::SUCCESS;
62  }
63  const Amg::Vector3D locPos{boundVol.itransform() * point};
64 
65  StripDesign planeTrapezoid{};
66  planeTrapezoid.defineTrapezoid(chamb.halfXShort(), chamb.halfXLong(), chamb.halfY());
67  planeTrapezoid.setLevel(MSG::VERBOSE);
69  static const Eigen::Rotation2D axisSwap{90. *Gaudi::Units::deg};
70  if (std::abs(locPos.z()) - chamb.halfZ() < -tolerance &&
71  planeTrapezoid.insideTrapezoid(axisSwap*locPos.block<2,1>(0,0))) {
72  return StatusCode::SUCCESS;
73  }
74  planeTrapezoid.defineStripLayout(locPos.y() * Amg::Vector2D::UnitX(), 1, 1, 1);
75  ATH_MSG_FATAL("In channel "<<m_idHelperSvc->toString(channelId) <<", the point "
76  << descr <<" "<<Amg::toString(point)<<" is not part of the chamber volume."
77  <<std::endl<<std::endl<<chamb<<std::endl<<"Local position "<<Amg::toString(locPos)
78  <<", box left edge: "<<Amg::toString(planeTrapezoid.leftEdge(1).value_or(Amg::Vector2D::Zero()))
79  <<", box right edge "<<Amg::toString(planeTrapezoid.rightEdge(1).value_or(Amg::Vector2D::Zero())));
80  return StatusCode::FAILURE;
81  }
82 
83  StatusCode MuonChamberToolTest::pointInside(const Acts::TrackingVolume& volume,
84  const Amg::Vector3D& point,
85  const std::string& descr,
86  const Identifier& chamberId) const {
87  if (volume.inside(point)) {
88  return StatusCode::SUCCESS;
89  }
90  const auto& volumeCorners = cornerPoints(volume);
91  ATH_MSG_FATAL("In channel "<<m_idHelperSvc->toString(chamberId) <<", the point "
92  << descr <<" "<<Amg::toString(point)<<" is not part of the chamber volume. The corners of the volume are:");
93  for(const auto& corner : volumeCorners) {
94  ATH_MSG_FATAL(" "<<Amg::toString(corner));
95  }
96  return StatusCode::FAILURE;
97  }
98 
99  template <class EnvelopeType>
101  const EnvelopeType& envelope) const {
102  std::shared_ptr<Acts::Volume> boundVol = envelope.boundingVolume(gctx);
103  const Chamber::ReadoutSet reEles = envelope.readoutEles();
104  for(const MuonReadoutElement* readOut : reEles) {
105  if constexpr (std::is_same_v<EnvelopeType, SpectrometerSector>) {
106  if (readOut->msSector() != &envelope) {
107  ATH_MSG_FATAL("Mismatch in the sector association "<<m_idHelperSvc->toStringDetEl(readOut->identify())
108  <<std::endl<<(*readOut->msSector())<<std::endl<<envelope);
109  return StatusCode::FAILURE;
110  }
111  } else if constexpr (std::is_same_v<EnvelopeType, Chamber>) {
112  if (readOut->chamber() != &envelope) {
113  ATH_MSG_FATAL("Mismatch in the chamber association "<<m_idHelperSvc->toStringDetEl(readOut->identify())
114  <<std::endl<<(*readOut->chamber())<<std::endl<<envelope);
115  return StatusCode::FAILURE;
116  }
117  }
118  switch (readOut->detectorType()) {
120  const auto* detEle = static_cast<const TgcReadoutElement*>(readOut);
121  ATH_CHECK(testReadoutEle(gctx, *detEle, envelope, *boundVol));
122  break;
124  const auto* detEle = static_cast<const MdtReadoutElement*>(readOut);
125  ATH_CHECK(testReadoutEle(gctx, *detEle, envelope, *boundVol));
126  break;
128  const auto* detEle = static_cast<const RpcReadoutElement*>(readOut);
129  ATH_CHECK(testReadoutEle(gctx, *detEle, envelope, *boundVol));
130  break;
131  } case ActsTrk::DetectorType::Mm: {
132  const auto* detEle = static_cast<const MmReadoutElement*>(readOut);
133  ATH_CHECK(testReadoutEle(gctx, *detEle, envelope, *boundVol));
134  break;
136  const auto* detEle = static_cast<const sTgcReadoutElement*>(readOut);
137  ATH_CHECK(testReadoutEle(gctx, *detEle, envelope, *boundVol));
138  break;
139  } default: {
140  ATH_MSG_FATAL("Who came up with putting "<<ActsTrk::to_string(readOut->detectorType())
141  <<" into the MS");
142  return StatusCode::FAILURE;
143  }
144  }
145  }
146  ATH_MSG_DEBUG("All "<<reEles.size()<<" readout elements are embedded in "<<envelope);
147  return StatusCode::SUCCESS;
148  }
149 
150  std::array<Amg::Vector3D, 8> MuonChamberToolTest::cornerPoints(const Acts::Volume& volume) const {
151  std::array<Amg::Vector3D, 8> edges{make_array<Amg::Vector3D,8>(Amg::Vector3D::Zero())};
152  unsigned int edgeIdx{0};
153  using BoundEnum = Acts::TrapezoidVolumeBounds::BoundValues;
154  const auto& bounds = static_cast<const Acts::TrapezoidVolumeBounds&>(volume.volumeBounds());
155  ATH_MSG_VERBOSE("Fetch volume bounds "<<Amg::toString(volume.transform()));
156  for (const double signX : {-1., 1.}) {
157  for (const double signY : { -1., 1.}) {
158  for (const double signZ: {-1., 1.}) {
159  const Amg::Vector3D edge{signX* (signY>0 ? bounds.get(BoundEnum::eHalfLengthXposY) :
160  bounds.get(BoundEnum::eHalfLengthXnegY)),
161  signY*bounds.get(BoundEnum::eHalfLengthY),
162  signZ*bounds.get(BoundEnum::eHalfLengthZ)};
163  edges[edgeIdx] = volume.transform() * edge;
164  ATH_MSG_VERBOSE("Local edge "<<Amg::toString(edge)<<", global edge: "<<Amg::toString(edges[edgeIdx]));
165  ++edgeIdx;
166  }
167  }
168  }
169  return edges;
170  }
171 
172  std::array<Amg::Vector3D, 8> MuonChamberToolTest::cornerPoints(const Acts::GeometryContext& gctx, const Acts::StrawSurface& surface) const {
173  std::array<Amg::Vector3D, 8> edges{make_array<Amg::Vector3D,8>(Amg::Vector3D::Zero())};
174  using BoundEnum = Acts::LineBounds::BoundValues;
175  const auto& bounds = static_cast<const Acts::LineBounds&>(surface.bounds());
176  unsigned int edgeIdx{0};
177 
178  ATH_MSG_VERBOSE("Fetch volume bounds "<<Amg::toString(surface.transform(gctx)));
179  for (const double signX : {-1., 1.}) {
180  for (const double signY : { -1., 1.}) {
181  for (const double signZ: {-1., 1.}) {
182  const Amg::Vector3D edge{signX*bounds.get(BoundEnum::eR),
183  signY*bounds.get(BoundEnum::eR),
184  signZ*bounds.get(BoundEnum::eHalfLengthZ)};
185  edges[edgeIdx] = surface.transform(gctx) * edge;
186  ++edgeIdx;
187  }
188  }
189  }
190 
191  return edges;
192  }
193 
194  std::array<Amg::Vector3D, 4> MuonChamberToolTest::cornerPoints(const Acts::GeometryContext& gctx, const Acts::PlaneSurface& surface) const {
195  std::array<Amg::Vector3D, 4> edges{make_array<Amg::Vector3D,4>(Amg::Vector3D::Zero())};
196  if(surface.bounds().type() == Acts::SurfaceBounds::BoundsType::eRectangle) { //RPC surfaces are rectangles
197  const Acts::RectangleBounds& bounds = static_cast<const Acts::RectangleBounds&>(surface.bounds());
198  using BoundEnum = Acts::RectangleBounds::BoundValues;
199 
200  unsigned int edgeIdx{0};
201  for(const double signX : {-1., 1.}) {
202  for (const double signY : { -1., 1.}) {
203  const Amg::Vector3D edge{ signX < 0 ? bounds.get(BoundEnum::eMinX) : bounds.get(BoundEnum::eMaxX),
204  signY < 0 ? bounds.get(BoundEnum::eMinY) : bounds.get(BoundEnum::eMaxY),
205  0};
206  edges[edgeIdx] = surface.transform(gctx) * edge;
207  ++edgeIdx;
208  }
209  }
210  return edges;
211 
212  } else if(surface.bounds().type() == Acts::SurfaceBounds::BoundsType::eTrapezoid) {
213  using BoundEnum = Acts::TrapezoidBounds::BoundValues;
214  const auto& bounds = static_cast<const Acts::TrapezoidBounds&>(surface.bounds());
215  unsigned int edgeIdx{0};
216 
217 
218  ATH_MSG_VERBOSE("Fetch volume bounds "<<Amg::toString(surface.transform(gctx)));
219  for (const double signX : {-1., 1.}) {
220  for (const double signY : { -1., 1.}) {
221  const Amg::Vector3D edge {
222  Amg::getRotateZ3D(-1*bounds.get(BoundEnum::eRotationAngle))*
223 
224  Amg::Vector3D(signX*bounds.get(signY < 0 ? BoundEnum::eHalfLengthXnegY : BoundEnum::eHalfLengthXposY),
225  signY*bounds.get(BoundEnum::eHalfLengthY),
226  0)};
227 
228  edges[edgeIdx] = surface.transform(gctx) * edge;
229  ++edgeIdx;
230  }
231  }
232 
233  return edges;
234  } else {
235  ATH_MSG_FATAL("The surface bounds are neither a rectangle nor a trapezoid, this is not supported yet");
236  return edges;
237  }
238 
239  }
240 
241 
242  StatusCode MuonChamberToolTest::execute(const EventContext& ctx) const {
243  const ActsGeometryContext* gctx{nullptr};
244  ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
245  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry = m_trackingGeometrySvc->trackingGeometry();
247  using SectorSet = MuonDetectorManager::MuonSectorSet;
248  const SectorSet sectors = m_detMgr->getAllSectors();
249  ATH_MSG_INFO("Fetched "<<sectors.size()<<" sectors. ");
250  for (const SpectrometerSector* sector : sectors) {
251  ATH_CHECK(allReadoutInEnvelope(*gctx, *sector));
252  const std::shared_ptr<Acts::Volume> secVolume = sector->boundingVolume(*gctx);
253  for (const SpectrometerSector::ChamberPtr& chamber : sector->chambers()){
254  const std::array<Amg::Vector3D, 8> edges = cornerPoints(*chamber->boundingVolume(*gctx));
255  unsigned int edgeCount{0};
256  for (const Amg::Vector3D& edge : edges) {
257  ATH_CHECK(pointInside(*sector,*secVolume,edge,
258  std::format("Edge {:}", edgeCount++),
259  chamber->readoutEles().front()->identify()));
260  }
261  const Acts::TrackingVolume* trkGeoVol = trackingGeometry->lowestTrackingVolume(gctx->context(), chamber->boundingVolume(*gctx)->center());
262  ATH_MSG_DEBUG("Found "<<trkGeoVol->volumeName()<< " with " << trkGeoVol->volumes().size() <<" sub volumes for chamber "<<m_idHelperSvc->toString(chamber->readoutEles().front()->identify()));
263 
264  if(trkGeoVol->volumes().size() > 2) continue; // temporary workaround for overlaps in the tracking geometry
265 
266  trkGeoVol->visitVolumes([&](const Acts::TrackingVolume* volume) {
267  ATH_MSG_DEBUG("Found sub volume "<<volume->volumeName());
268  });
269 
270 
271  std::map<Identifier, const std::array<Amg::Vector3D, 8>> strawCorners;
272  std::map<Identifier, const std::array<Amg::Vector3D, 4>> trapezoidCorners;
273 
274 
275  trkGeoVol->visitSurfaces([&](const Acts::Surface* surface) {
276  if(surface->type() == Acts::Surface::SurfaceType::Plane){
277  const auto* planeSurface = static_cast<const Acts::PlaneSurface*>(surface);
278  ATH_MSG_DEBUG("Found plane surface with id" << planeSurface->geometryId());
279  if(planeSurface->associatedDetectorElement()){ // skip the material surfaces
280  const ActsTrk::IDetectorElementBase* iDetElement = static_cast<const ActsTrk::IDetectorElementBase*> (planeSurface->associatedDetectorElement());
281  trapezoidCorners.emplace(iDetElement->identify(), cornerPoints(gctx->context(), *planeSurface));
282  }
283  } else if (surface->type() == Acts::Surface::SurfaceType::Straw) {
284  const auto* strawSurface = static_cast<const Acts::StrawSurface*>(surface);
285  if(strawSurface->associatedDetectorElement() ) {
286  const ActsTrk::IDetectorElementBase* iDetElement = static_cast<const ActsTrk::IDetectorElementBase*> (strawSurface->associatedDetectorElement());
287  strawCorners.emplace(iDetElement->identify(), cornerPoints(gctx->context(), *strawSurface));
288  }
289  } else {
290 
291  ATH_MSG_FATAL("Got non muon surface");
292  }
293 
294  }
295  , true);
296 
297  ATH_MSG_DEBUG("Found "<<strawCorners.size()<<" straw corners and "<<trapezoidCorners.size()<<" trapezoid corners in chamber "<<m_idHelperSvc->toString(chamber->readoutEles().front()->identify()));
298 
299  for (const auto& [id, corners] : strawCorners) {
300  edgeCount = 0;
301  for (unsigned int i = 0; i < corners.size(); ++i) {
302  ATH_CHECK(pointInside(*trkGeoVol, corners[i],
303  std::format("Straw corner {:}", i),
304  chamber->readoutEles().front()->identify()));
305  }
306  }
307 
308  unsigned int surfaceCount{0};
309  for (const auto& [id, corners] : trapezoidCorners) {
310  ATH_MSG_DEBUG("Found "<<corners.size()<<" corners for straw chamber "<<m_idHelperSvc->toString(id));
311  if(strawCorners.size() != 0){
312  break; // this is a straw chamber and I dont know were the plane surface comes from
313  }
314 
315  edgeCount = 0;
316  for (unsigned int i = 0; i < corners.size(); ++i) {
317  ATH_CHECK(pointInside(*trkGeoVol, corners[i],
318  std::format("Trapezoid corner {:} of surface {:}", i, ++surfaceCount),
319  id));
320  }
321  }
322 
323 
324  }
325  }
327  const ChamberSet chambers = m_detMgr->getAllChambers();
328  for (const Chamber* chamber : chambers) {
330  }
331  return StatusCode::SUCCESS;
332  }
333  template <class EnvelopeType>
335  const MdtReadoutElement& mdtMl,
336  const EnvelopeType& chamber,
337  const Acts::Volume& detVol) const {
338  ATH_MSG_VERBOSE("Test whether "<<m_idHelperSvc->toStringDetEl(mdtMl.identify())<<std::endl<<mdtMl.getParameters());
339 
340  for (unsigned int layer = 1; layer <= mdtMl.numLayers(); ++layer) {
341  for (unsigned int tube = 1; tube <= mdtMl.numTubesInLay(); ++tube) {
342  const IdentifierHash idHash = mdtMl.measurementHash(layer, tube);
343  if (!mdtMl.isValid(idHash)){
344  continue;
345  }
346  const Amg::Transform3D& locToGlob{mdtMl.localToGlobalTrans(gctx, idHash)};
347  const Identifier measId{mdtMl.measurementId(idHash)};
348 
349  ATH_CHECK(pointInside(chamber, detVol, mdtMl.globalTubePos(gctx, idHash), "tube center", measId));
350 
351  ATH_CHECK(pointInside(chamber, detVol, mdtMl.readOutPos(gctx, idHash), "tube readout", measId));
352  ATH_CHECK(pointInside(chamber, detVol, mdtMl.highVoltPos(gctx, idHash), "tube HV", measId));
353 
354  ATH_CHECK(pointInside(chamber, detVol, locToGlob*(-mdtMl.innerTubeRadius() * Amg::Vector3D::UnitX()),
355  "bottom of the tube box", measId));
356  ATH_CHECK(pointInside(chamber, detVol, locToGlob*(mdtMl.innerTubeRadius() * Amg::Vector3D::UnitX()),
357  "sealing of the tube box", measId));
358 
359  ATH_CHECK(pointInside(chamber, detVol, locToGlob*(-mdtMl.innerTubeRadius() * Amg::Vector3D::UnitY()),
360  "wall to the previous tube", measId));
361  ATH_CHECK(pointInside(chamber, detVol, locToGlob*(-mdtMl.innerTubeRadius() * Amg::Vector3D::UnitY()),
362  "wall to the next tube", measId));
363  }
364  }
365  return StatusCode::SUCCESS;
366  }
367  template<class EnvelopeType>
369  const RpcReadoutElement& rpc,
370  const EnvelopeType& chamber,
371  const Acts::Volume& detVol) const {
372 
373  ATH_MSG_VERBOSE("Test whether "<<m_idHelperSvc->toStringDetEl(rpc.identify())<<std::endl<<rpc.getParameters());
374 
375  const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
376  for (unsigned int gasGap = 1 ; gasGap <= rpc.nGasGaps(); ++gasGap) {
377  for (int doubletPhi = rpc.doubletPhi(); doubletPhi <= rpc.doubletPhiMax(); ++doubletPhi){
378  for (bool measPhi : {false, true}) {
379  const int nStrips = measPhi ? rpc.nPhiStrips() : rpc.nEtaStrips();
380  for (int strip = 1; strip <= nStrips; ++strip) {
381  const Identifier stripId = idHelper.channelID(rpc.identify(),rpc.doubletZ(),
382  doubletPhi, gasGap, measPhi, strip);
383  ATH_CHECK(pointInside(chamber, detVol, rpc.stripPosition(gctx, stripId), "center", stripId));
384  ATH_CHECK(pointInside(chamber, detVol, rpc.leftStripEdge(gctx, stripId), "right edge", stripId));
385  ATH_CHECK(pointInside(chamber, detVol, rpc.rightStripEdge(gctx, stripId), "left edge", stripId));
386  }
387  }
388  }
389  }
390  return StatusCode::SUCCESS;
391  }
392  template <class EnevelopeType>
394  const TgcReadoutElement& tgc,
395  const EnevelopeType& chamber,
396  const Acts::Volume& detVol) const {
397  for (unsigned int gasGap = 1; gasGap <= tgc.nGasGaps(); ++gasGap){
398  for (bool isStrip : {false}) {
399  const IdentifierHash layHash = tgc.constructHash(0, gasGap, isStrip);
400  const unsigned int nChannel = tgc.numChannels(layHash);
401  for (unsigned int channel = 1; channel <= nChannel ; ++channel) {
402  const IdentifierHash measHash = tgc.constructHash(channel, gasGap, isStrip);
403  ATH_CHECK(pointInside(chamber, detVol, tgc.channelPosition(gctx, measHash), "center", tgc.measurementId(measHash)));
404  }
405  }
406  }
407  return StatusCode::SUCCESS;
408  }
409  template <class EnevelopeType>
411  const MmReadoutElement& mm,
412  const EnevelopeType& chamber,
413  const Acts::Volume& detVol) const {
414 
415  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
416  for(unsigned int gasGap = 1; gasGap <= mm.nGasGaps(); ++gasGap){
418  unsigned int firstStrip = mm.firstStrip(gasGapHash);
419  for(unsigned int strip = firstStrip; strip <= mm.numStrips(gasGapHash); ++strip){
420  const Identifier stripId = idHelper.channelID(mm.identify(), mm.multilayer(), gasGap, strip);
421  ATH_CHECK(pointInside(chamber, detVol, mm.stripPosition(gctx, stripId), "center", stripId));
422  ATH_CHECK(pointInside(chamber, detVol, mm.leftStripEdge(gctx, mm.measurementHash(stripId)), "left edge", stripId));
423  ATH_CHECK(pointInside(chamber, detVol, mm.rightStripEdge(gctx, mm.measurementHash(stripId)), "right edge", stripId));
424  }
425  }
426 
427  return StatusCode::SUCCESS;
428  }
429  template <class EnvelopeType>
431  const sTgcReadoutElement& stgc,
432  const EnvelopeType& chamber,
433  const Acts::Volume& detVol) const{
434 
435  const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
436  for(unsigned int gasGap = 1; gasGap <= stgc.numLayers(); ++gasGap){
437 
438  for(unsigned int nch = 1; nch <= stgc.nChTypes(); ++nch){
439  IdentifierHash gasGapHash = sTgcReadoutElement::createHash(gasGap, nch, 0, 0);
440  const unsigned int nStrips = stgc.numChannels(gasGapHash);
442 
443  for(unsigned int strip = 1; strip <= nStrips; ++strip){
444  const Identifier stripId = idHelper.channelID(stgc.identify(), stgc.multilayer(), gasGap, nch, strip);
445  ATH_CHECK(pointInside(chamber, detVol, stgc.globalChannelPosition(gctx, stripId), "channel position", stripId));
446 
447  if(channelType == sTgcReadoutElement::ReadoutChannelType::Wire || channelType == sTgcReadoutElement::ReadoutChannelType::Strip){
448 
449  ATH_CHECK(pointInside(chamber, detVol, stgc.rightStripEdge(gctx, stgc.measurementHash(stripId)), "channel position", stripId));
450  ATH_CHECK(pointInside(chamber, detVol, stgc.leftStripEdge(gctx, stgc.measurementHash(stripId)), "channel position", stripId));
451 
452  }
453 
454  }
455 
456  }
457 
458  }
459 
460  return StatusCode::SUCCESS;
461 
462  }
463 }
464 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MuonGMR4::RpcReadoutElement::doubletPhiMax
int doubletPhiMax() const
Returns the maximum phi panel.
MuonGMR4::MuonChamberToolTest::m_trackingGeometrySvc
ServiceHandle< IActsTrackingGeometrySvc > m_trackingGeometrySvc
Definition: MuonChamberToolTest.h:113
MuonGMR4::MuonChamberToolTest::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonChamberToolTest.h:108
MuonGMR4::sTgcReadoutElement::multilayer
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
GeoModel::TransientConstSharedPtr
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
Definition: TransientConstSharedPtr.h:13
MuonGMR4::MmReadoutElement
Definition: MmReadoutElement.h:18
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonGMR4::StripDesign
Definition: StripDesign.h:30
MuonGMR4::MmReadoutElement::createHash
static IdentifierHash createHash(const int gasGap, const int strip)
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
MuonGMR4::RpcReadoutElement::nGasGaps
unsigned nGasGaps() const
Returns the number of gasgaps described by this ReadOutElement (usally 2 or 3)
MuonGMR4::SpectrometerSector
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Definition: SpectrometerSector.h:40
MuonGMR4::MuonDetectorManager::MuonSectorSet
std::set< const SpectrometerSector *, MSEnvelopeSorter > MuonSectorSet
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:123
MuonGMR4::MdtReadoutElement::numTubesInLay
unsigned int numTubesInLay() const
Returns the number of tubes per layer.
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonGMR4::sTgcReadoutElement::numChannels
unsigned int numChannels(const Identifier &measId) const
Returns the number of strips / wires / pads in a given gasGap.
ActsTrk::IDetectorElementBase::identify
virtual Identifier identify() const =0
Return the ATLAS identifier.
calibdata.chamber
chamber
Definition: calibdata.py:31
MuonGMR4::MdtReadoutElement::measurementHash
static IdentifierHash measurementHash(unsigned int layerNumber, unsigned int tubeNumber)
Transform the layer and tube number to the measurementHash.
MuonGMR4::MuonChamberToolTest::execute
StatusCode execute(const EventContext &ctx) const override
Definition: MuonChamberToolTest.cxx:242
CaloCondBlobAlgs_fillNoiseFromASCII.nChannel
nChannel
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:90
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...
ActsTrk::DetectorType::Tgc
@ Tgc
Resitive Plate Chambers.
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
MuonGMR4::sTgcReadoutElement::nChTypes
unsigned int nChTypes() const
Number of Channel Types.
MuonGMR4::MuonChamberToolTest::m_detMgr
const MuonDetectorManager * m_detMgr
Definition: MuonChamberToolTest.h:115
MuonGMR4::MdtReadoutElement::readOutPos
Amg::Vector3D readOutPos(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the readout card.
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:30
MuonGMR4::RpcReadoutElement::rightStripEdge
Amg::Vector3D rightStripEdge(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the strip edge at negative local Y.
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ActsTrk::DetectorType::sTgc
@ sTgc
Micromegas (NSW)
SpectrometerSector.h
MuonGMR4::RpcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:17
RpcIdHelper
Definition: RpcIdHelper.h:51
MuonGMR4::TgcReadoutElement::nGasGaps
unsigned nGasGaps() const
Returns the number of gasgaps described by this ReadOutElement (usally 2 or 3)
MuonGMR4::sTgcReadoutElement::measurementHash
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
ReadCondHandle.h
MuonGMR4::RpcReadoutElement::getParameters
const parameterBook & getParameters() const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/RpcReadoutElement.cxx:33
MuonGMR4::ChamberSet
SpectrometerSector::ChamberSet ChamberSet
Definition: SpectrometerSector.cxx:35
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
MuonGMR4::MuonChamberToolTest::testReadoutEle
StatusCode testReadoutEle(const ActsGeometryContext &gctx, const MdtReadoutElement &readOutEle, const EnvelopeType &envelope, const Acts::Volume &boundVol) const
Checks whether all channels of a given readout element are fully covered by the envelope.
Definition: MuonChamberToolTest.cxx:334
Amg::getRotateZ3D
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Definition: GeoPrimitivesHelpers.h:270
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:46
MuonGMR4::Chamber
Definition: Chamber.h:23
sTgcReadoutElement.h
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.
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:19
ActsTrk::IDetectorElementBase
base class interface providing the bare minimal interface extension.
Definition: IDetectorElement.h:32
ActsTrk::DetectorType::Mm
@ Mm
Maybe not needed in the migration.
SCT_CalibAlgs::firstStrip
@ firstStrip
Definition: SCT_CalibNumbers.h:10
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:287
python.SystemOfUnits.micrometer
float micrometer
Definition: SystemOfUnits.py:80
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
MuonGMR4::MuonDetectorManager::MuonChamberSet
std::set< const Chamber *, MSEnvelopeSorter > MuonChamberSet
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:124
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MuonGMR4::RpcReadoutElement::doubletPhi
int doubletPhi() const
Returns the doublet Phi field of the MuonReadoutElement identifier.
MuonGMR4::MdtReadoutElement::numLayers
unsigned int numLayers() const
Returns the number of tube layer.
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonGMR4::RpcReadoutElement::stripPosition
Amg::Vector3D stripPosition(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the position of the strip center.
MuonGMR4::sTgcReadoutElement::leftStripEdge
Amg::Vector3D leftStripEdge(const ActsGeometryContext &ctx, const IdentifierHash &measHash) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/sTgcReadoutElement.cxx:233
MuonGMR4::Chamber::ReadoutSet
std::vector< const MuonReadoutElement * > ReadoutSet
Define the list of read out elements of the chamber.
Definition: Chamber.h:26
MuonGMR4::RpcReadoutElement::nEtaStrips
unsigned nEtaStrips() const
Number of strips measuring the eta coordinate.
MuonGMR4::TgcReadoutElement::measurementId
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
MuonGMR4::StripDesign::defineTrapezoid
void defineTrapezoid(double HalfShortY, double HalfLongY, double HalfHeight)
Defines the edges of the trapezoid.
Definition: StripDesign.cxx:71
MuonGMR4::RpcReadoutElement::doubletZ
int doubletZ() const
Returns the doublet Z field of the MuonReadoutElement identifier.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
python.TransformConfig.descr
descr
print "%s.properties()" % self.__name__
Definition: TransformConfig.py:360
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
MuonGMR4::MuonChamberToolTest::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: MuonChamberToolTest.h:111
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:121
MuonChamberToolTest.h
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonGMR4::MdtReadoutElement::innerTubeRadius
double innerTubeRadius() const
Returns the inner tube radius.
tolerance
Definition: suep_shower.h:17
MuonGM::nStrips
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
Definition: MuonDetDescr/MuonGeoModelTest/src/GeoModelTgcTest.cxx:46
dumpTgcDigiThreshold.isStrip
list isStrip
Definition: dumpTgcDigiThreshold.py:33
ActsTrk::DetectorType::Mdt
@ Mdt
MuonSpectrometer.
MuonGMR4::sTgcReadoutElement::globalChannelPosition
Amg::Vector3D globalChannelPosition(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global pad/strip/wireGroup position.
xAOD::Straw
@ Straw
Definition: TrackingPrimitives.h:558
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:18
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
MuonGMR4::sTgcReadoutElement::rightStripEdge
Amg::Vector3D rightStripEdge(const ActsGeometryContext &ctx, const IdentifierHash &measHash) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/sTgcReadoutElement.cxx:277
sTgcIdHelper
Definition: sTgcIdHelper.h:55
MuonGMR4::MuonReadoutElement::identify
Identifier identify() const override final
Return the athena identifier.
MuonGMR4::MuonChamberToolTest::pointInside
StatusCode pointInside(const EnvelopeType &envelope, const Acts::Volume &boundVol, const Amg::Vector3D &point, const std::string &descr, const Identifier &channelId) const
Checks whether the point is inside of an envelope object, i.e.
Definition: MuonChamberToolTest.cxx:48
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGMR4::sTgcReadoutElement::numLayers
unsigned int numLayers() const
Returns the number of gas gap layers.
MuonGMR4::sTgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/sTgcReadoutElement.h:20
RpcReadoutElement.h
Chamber.h
MuonGMR4::MuonDetectorManager::getAllSectors
MuonSectorSet getAllSectors() const
: Returns all MuonChambers associated with the readout geometry
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:207
MuonGMR4::RpcReadoutElement::leftStripEdge
Amg::Vector3D leftStripEdge(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global posiition of the strip edge at positive local Y.
MuonGMR4::MuonChamberToolTest::cornerPoints
std::array< Amg::Vector3D, 8 > cornerPoints(const Acts::Volume &volume) const
Definition: MuonChamberToolTest.cxx:150
MmIdHelper
Definition: MmIdHelper.h:54
MdtReadoutElement.h
MuonGMR4::TgcReadoutElement::constructHash
static IdentifierHash constructHash(unsigned measCh, unsigned gasGap, const bool isStrip)
Constructs the Hash out of the Identifier fields (channel, gasGap, isStrip)
MuonGMR4::MuonChamberToolTest::initialize
StatusCode initialize() override
Definition: MuonChamberToolTest.cxx:32
ActsTrk::DetectorType::Rpc
@ Rpc
Monitored Drift Tubes.
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
MuonGMR4::MdtReadoutElement::globalTubePos
Amg::Vector3D globalTubePos(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the tube center.
createCablingJSON.doubletPhi
int doubletPhi
Definition: createCablingJSON.py:16
MuonGMR4::MuonChamberToolTest::allReadoutInEnvelope
StatusCode allReadoutInEnvelope(const ActsGeometryContext &ctx, const EnvelopeType &envelope) const
Checks whether the readout elements of an enevelope are completely embedded into the envelope.
Definition: MuonChamberToolTest.cxx:100
MuonGMR4::MdtReadoutElement::getParameters
const parameterBook & getParameters() const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx:45
MuonGMR4::MdtReadoutElement::highVoltPos
Amg::Vector3D highVoltPos(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global position of the High Voltage connectors.
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:13
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
xAOD::Plane
@ Plane
Definition: TrackingPrimitives.h:557
MuonGMR4::MuonDetectorManager::getAllChambers
MuonChamberSet getAllChambers() const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:215
MuonGMR4::TgcReadoutElement::numChannels
unsigned numChannels(const IdentifierHash &measHash) const
Returns the number of readout channels.
MuonGMR4::MdtReadoutElement::isValid
bool isValid(const IdentifierHash &measHash) const
MuonGMR4::TgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/TgcReadoutElement.h:19
MuonGMR4::RpcReadoutElement::nPhiStrips
unsigned nPhiStrips() const
Number of strips measuring the phi coordinate.
calibdata.tube
tube
Definition: calibdata.py:30
MmReadoutElement.h
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
Identifier
Definition: IdentifierFieldParser.cxx:14