2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 /***************************************************************************
6 Rpc Readout Element properties
7 -----------------------------------------
8 ***************************************************************************/
10 #ifndef MUONREADOUTGEOMETRY_RPCREADOUTELEMENT_ICC
11 #define MUONREADOUTGEOMETRY_RPCREADOUTELEMENT_ICC
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; }
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); }
35 inline double RpcReadoutElement::stripPanelSsize(bool measphi) const {
37 return Nstrips(measphi) * StripPitch(measphi) - (StripPitch(measphi) - StripWidth(measphi));
39 return StripLength(measphi);
42 inline double RpcReadoutElement::stripPanelZsize(bool measphi) const {
44 return Nstrips(measphi) * StripPitch(measphi) - (StripPitch(measphi) - StripWidth(measphi));
46 return StripLength(measphi);
50 inline int RpcReadoutElement::surfaceHash(const Identifier& id) const {
51 return surfaceHash(m_idHelper.doubletPhi(id), m_idHelper.gasGap(id), m_idHelper.measuresPhi(id));
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));
59 inline int RpcReadoutElement::layerHash(const Identifier& id) const {
60 return layerHash(m_idHelper.doubletPhi(id), m_idHelper.gasGap(id));
62 inline int RpcReadoutElement::stripNumber(const Amg::Vector2D& pos, const Identifier& id) const {
63 const MuonStripDesign* design = getDesign(id);
64 return design ? design->stripNumber(pos) : -1;
66 inline bool RpcReadoutElement::stripPosition(const Identifier& id, Amg::Vector2D& pos) const {
67 const MuonStripDesign* design = getDesign(id);
68 return design && design->stripPosition(m_idHelper.strip(id), pos);
70 inline int RpcReadoutElement::numberOfStrips(const Identifier& layerId) const {
71 return numberOfStrips(1, m_idHelper.measuresPhi(layerId));
74 inline bool RpcReadoutElement::spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector2D& pos) const {
75 Amg::Vector2D phiPos{Amg::Vector2D::Zero()}, etaPos{Amg::Vector2D::Zero()};
76 if (!stripPosition(phiId, phiPos) || !stripPosition(etaId, etaPos)) return false;
77 spacePointPosition(phiPos, etaPos, pos);
81 inline bool RpcReadoutElement::spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector3D& pos) const {
82 Amg::Vector2D lpos{Amg::Vector2D::Zero()};
83 spacePointPosition(phiId, etaId, lpos);
84 surface(phiId).localToGlobal(lpos, pos, pos);
87 inline void RpcReadoutElement::spacePointPosition(const Amg::Vector2D& phiPos, const Amg::Vector2D& etaPos, Amg::Vector2D& pos) const {
94 #endif // MUONREADOUTGEOMETRY_RPCREADOUTELEMENT_ICC