ATLAS Offline Software
StripLayer.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONREADOUTGEOMETRYR4_STRIPLAYER_ICC
5 #define MUONREADOUTGEOMETRYR4_STRIPLAYER_ICC
6 
7 namespace MuonGMR4{
8  inline const Amg::Transform3D& StripLayer::toOrigin() const { return m_transform->getDefTransform(); }
9  inline bool StripLayer::hasPhiDesign() const {
10  assert(m_phiDesign && m_etaDesign);
11  return m_phiDesign.get() != m_etaDesign.get();
12  }
13  inline const StripDesign& StripLayer::design(bool phiView) const {
14  return phiView ? *m_phiDesign :*m_etaDesign;
15  }
16  inline const IdentifierHash StripLayer::hash() const { return m_hash; }
17 
18  inline Amg::Vector3D StripLayer::to3D(CheckVector2D&& vec, const bool phiView) const{
19  Amg::Vector3D pos{Amg::Vector3D::Zero()};
20  if (!phiView || !hasPhiDesign()) {
21  pos.block<2,1>(0, 0) = std::move(*vec);
22  } else {
23  pos.block<2,1>(0,0) = Eigen::Rotation2D{m_phiRot} * std::move(*vec);
24  }
25  return pos;
26  }
27  inline Amg::Vector2D StripLayer::to2D(const Amg::Vector3D& vec, const bool phiView) const{
28  if (!phiView || !hasPhiDesign()) {
29  return vec.block<2,1>(0,0);
30  }
31  return Eigen::Rotation2D{-m_phiRot} * vec.block<2,1>(0,0);
32  }
33  inline Amg::Vector3D StripLayer::localStripPosition(unsigned int stripNum, bool phiView) const {
34  return to3D(design(phiView).center(stripNum), phiView);
35  }
36  inline Amg::Vector3D StripLayer::localStripLeftEdge(unsigned int stripNum, bool phiView) const {
37  return to3D(design(phiView).leftEdge(stripNum), phiView);
38  }
39  inline Amg::Vector3D StripLayer::localStripRightEdge(unsigned int stripNum, bool phiView) const {
40  return to3D(design(phiView).rightEdge(stripNum), phiView);
41  }
42 }
43 #endif