ATLAS Offline Software
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Rpc Readout Element properties
7  -----------------------------------------
8 ***************************************************************************/
9 
10 #ifndef MUONREADOUTGEOMETRY_RPCREADOUTELEMENT_ICC
11 #define MUONREADOUTGEOMETRY_RPCREADOUTELEMENT_ICC
12 
13 namespace MuonGM {
14  inline int RpcReadoutElement::getDoubletR() const { return m_dbR; }
15  inline int RpcReadoutElement::getDoubletZ() const { return m_dbZ; }
16  inline int RpcReadoutElement::getDoubletPhi() const { return m_dbPhi; }
17  inline bool RpcReadoutElement::hasDEDontop() const { return m_hasDEDontop; }
18 
19  inline int RpcReadoutElement::nGasGapPerLay() const { return m_nphigasgaps; }
20  inline int RpcReadoutElement::NphiStripPanels() const { return m_nphistrippanels; }
21  inline int RpcReadoutElement::NphiStrips() const { return m_nphistripsperpanel; }
22  inline int RpcReadoutElement::NetaStrips() const { return m_netastripsperpanel; }
23  inline int RpcReadoutElement::numberOfLayers(bool) const { return m_nlayers; }
24  inline int RpcReadoutElement::Nstrips(bool measphi) const { return measphi ? m_nphistripsperpanel : m_netastripsperpanel; }
25  inline double RpcReadoutElement::StripWidth(bool measphi) const { return measphi ? m_phistripwidth : m_etastripwidth; }
26  inline double RpcReadoutElement::StripLength(bool measphi) const { return measphi ? m_phistriplength : m_etastriplength; }
27  inline double RpcReadoutElement::StripPitch(bool measphi) const { return measphi ? m_phistrippitch : m_etastrippitch; }
28  inline double RpcReadoutElement::StripPanelDead(bool measphi) const { return measphi ? m_phipaneldead : m_etapaneldead; }
29  inline double RpcReadoutElement::gasGapSsize() const { return m_gasgapssize; }
30  inline double RpcReadoutElement::gasGapZsize() const { return m_gasgapzsize; }
31  inline int RpcReadoutElement::numberOfStrips(int, bool measuresPhi) const { return Nstrips(measuresPhi); }
32  inline int RpcReadoutElement::boundaryHash(const Identifier& id) const { return measuresPhi(id); }
33  inline bool RpcReadoutElement::measuresPhi(const Identifier& id) const { return m_idHelper.measuresPhi(id); }
34 
35  inline double RpcReadoutElement::stripPanelSsize(bool measphi) const {
36  if (measphi) {
37  return Nstrips(measphi) * StripPitch(measphi) - (StripPitch(measphi) - StripWidth(measphi));
38  }
39  return StripLength(measphi);
40  }
41 
42  inline double RpcReadoutElement::stripPanelZsize(bool measphi) const {
43  if (!measphi){
44  return Nstrips(measphi) * StripPitch(measphi) - (StripPitch(measphi) - StripWidth(measphi));
45  }
46  return StripLength(measphi);
47  }
48 
49 
50  inline int RpcReadoutElement::surfaceHash(const Identifier& id) const {
51  return surfaceHash(m_idHelper.doubletPhi(id), m_idHelper.gasGap(id), m_idHelper.measuresPhi(id));
52  }
53 
54  inline const Amg::Vector3D RpcReadoutElement::REcenter() const {
55  if (NphiStripPanels() == 1) return MuonClusterReadoutElement::center(0);
56  return 0.5 * (MuonClusterReadoutElement::center(0) + MuonClusterReadoutElement::center(2));
57  }
58 
59  inline int RpcReadoutElement::layerHash(const Identifier& id) const {
60  return layerHash(m_idHelper.doubletPhi(id), m_idHelper.gasGap(id));
61  }
62 
63 
64 
65  inline double RpcReadoutElement::distanceToReadout(const Amg::Vector2D& pos, const Identifier& id) const {
66  const MuonStripDesign* design = getDesign(id);
67  throw std::runtime_error("Method is not implemented");
68  return design ? design->distanceToReadout(pos) : 0.;
69  }
70  inline int RpcReadoutElement::stripNumber(const Amg::Vector2D& pos, const Identifier& id) const {
71  const MuonStripDesign* design = getDesign(id);
72  return design ? design->stripNumber(pos) : -1;
73  }
74  inline bool RpcReadoutElement::stripPosition(const Identifier& id, Amg::Vector2D& pos) const {
75  const MuonStripDesign* design = getDesign(id);
76  return design && design->stripPosition(m_idHelper.strip(id), pos);
77  }
78  inline int RpcReadoutElement::numberOfStrips(const Identifier& layerId) const {
79  return numberOfStrips(1, m_idHelper.measuresPhi(layerId));
80  }
81 
82  inline bool RpcReadoutElement::spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector2D& pos) const {
83  Amg::Vector2D phiPos{Amg::Vector2D::Zero()}, etaPos{Amg::Vector2D::Zero()};
84  if (!stripPosition(phiId, phiPos) || !stripPosition(etaId, etaPos)) return false;
85  spacePointPosition(phiPos, etaPos, pos);
86  return true;
87  }
88 
89  inline bool RpcReadoutElement::spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector3D& pos) const {
90  Amg::Vector2D lpos{Amg::Vector2D::Zero()};
91  spacePointPosition(phiId, etaId, lpos);
92  surface(phiId).localToGlobal(lpos, pos, pos);
93  return true;
94  }
95  inline void RpcReadoutElement::spacePointPosition(const Amg::Vector2D& phiPos, const Amg::Vector2D& etaPos, Amg::Vector2D& pos) const {
96  pos[0] = phiPos.x();
97  pos[1] = etaPos.x();
98  }
99 
100 } // namespace MuonGM
101 
102 #endif // MUONREADOUTGEOMETRY_RPCREADOUTELEMENT_ICC