ATLAS Offline Software
MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/RpcReadoutElement.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
5 
6 
9 
11 #include <GaudiKernel/SystemOfUnits.h>
12 #include <optional>
13 
14 #ifndef SIMULATIONBASE
15 # include "Acts/Surfaces/RectangleBounds.hpp"
16 #endif
17 using namespace ActsTrk;
18 
19 namespace MuonGMR4 {
21 std::ostream& operator<<(std::ostream& ostr, const parameterBook& pars) {
22  ostr<<"chamber width/length/thickness [mm]: "<<(2.*pars.halfWidth)<<"/";
23  ostr<<(2.*pars.halfLength)<<"/"<<(2.*pars.halfThickness)<<std::endl;
24  if (pars.etaDesign) ostr<<"Eta strips: "<<(*pars.etaDesign)<<std::endl;
25  if (pars.phiDesign) ostr<<"Phi strips: "<<(*pars.phiDesign)<<std::endl;
26  return ostr;
27 }
28 RpcReadoutElement::~RpcReadoutElement() = default;
29 RpcReadoutElement::RpcReadoutElement(defineArgs&& args)
31  m_pars{std::move(args)} {
32 }
33 
35 
39 
40  ATH_MSG_DEBUG("Parameter book "<<parameterBook());
41  if (m_pars.layers.empty()) {
42  ATH_MSG_FATAL("The readout element "<<idHelperSvc()->toStringDetEl(identify())<<" doesn't have any layers defined");
43  return StatusCode::FAILURE;
44  }
45 #ifndef SIMULATIONBASE
47  m_pars.halfLength)));
48 #endif
49  for (unsigned int layer = 0; layer < m_pars.layers.size(); ++layer) {
50  IdentifierHash layHash{layer};
51  if (!m_pars.layers[layer]) {
52  ATH_MSG_VERBOSE("Layer "<<layer <<" has not sensor layout associated.");
53  continue;
54  }
55  ATH_CHECK(insertTransform<RpcReadoutElement>(layHash));
56 #ifndef SIMULATIONBASE
57  const StripDesign& design{sensorLayout(layHash).design()};
58  ATH_CHECK(planeSurfaceFactory(layHash, m_pars.layerBounds->make_bounds(design.halfWidth(),
59  design.shortHalfHeight())));
60 #endif
61  }
63  chamberStripPos(createHash(1, 1, doubletPhi(), false))).mag();
64 #ifndef SIMULATIONBASE
65  m_pars.layerBounds.reset();
66 #endif
67  return StatusCode::SUCCESS;
68 }
69 
71  return sensorLayout(hash).toOrigin();
72 }
73 
74 Amg::Vector3D RpcReadoutElement::stripPosition(const ActsGeometryContext& ctx, const IdentifierHash& measHash) const {
75  return localToGlobalTrans(ctx, layerHash(measHash)) *
76  sensorLayout(measHash).localStripPos(stripNumber(measHash));
77 }
78 Amg::Vector3D RpcReadoutElement::rightStripEdge(const ActsGeometryContext& ctx, const IdentifierHash& measHash) const{
79  return localToGlobalTrans(ctx, layerHash(measHash)) *
80  sensorLayout(measHash).localStripLeftEdge(stripNumber(measHash));
81 }
82 Amg::Vector3D RpcReadoutElement::leftStripEdge(const ActsGeometryContext& ctx, const IdentifierHash& measHash) const {
83  return localToGlobalTrans(ctx, layerHash(measHash)) *
84  sensorLayout(measHash).localStripRightEdge(stripNumber(measHash));
85 }
86 
87 Amg::Vector3D RpcReadoutElement::chamberStripPos(const IdentifierHash& measHash) const {
88  return sensorLayout(measHash).stripPosition(stripNumber(measHash));
89 }
90 
91 double RpcReadoutElement::distanceToEdge(const IdentifierHash& layerHash,
92  const Amg::Vector2D& posInStripPlane,
93  const EdgeSide side) const {
96  const double refPoint{design.longHalfHeight() * (side == EdgeSide::readOut ? -1. : 1.)};
97  return std::abs(refPoint - posInStripPlane.y());
98 }
99 
100 
101 }
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
MuonGMR4::parameterBook
MmReadoutElement::parameterBook parameterBook
Definition: MmReadoutElement.cxx:22
MuonGMR4::RpcReadoutElement::parameterBook::halfWidth
double halfWidth
Elongation within the sector
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:29
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonGMR4::StripDesign
Definition: StripDesign.h:30
MuonGMR4::RpcReadoutElement::measuresPhi
static bool measuresPhi(const IdentifierHash &measHash)
MuonGMR4::RpcReadoutElement::defineArgs
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:46
AthCheckMacros.h
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
MuonGMR4::RpcReadoutElement::m_pars
parameterBook m_pars
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:155
MuonGMR4::RpcReadoutElement::parameterBook::layers
std::vector< StripLayerPtr > layers
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:36
MuonGMR4::StripLayer::toOrigin
const Amg::Transform3D & toOrigin() const
Returns the transformation to go from the strip layer center to the origin of the Strip chamber.
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
SurfaceBoundSet.h
MuonGMR4::MuonReadoutElement::createGeoTransform
StatusCode createGeoTransform()
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:36
MuonGMR4::RpcReadoutElement::parameterBook::etaDesign
StripDesignPtr etaDesign
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:39
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
MuonGMR4::RpcReadoutElement::EdgeSide
EdgeSide
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:107
MuonGMR4::StripLayer::stripPosition
Amg::Vector3D stripPosition(unsigned int stripNum) const
Returns the position of the strip expressed in the chamber frame.
MuonGMR4::RpcReadoutElement::getParameters
const parameterBook & getParameters() const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/RpcReadoutElement.cxx:34
MuonGMR4::RpcReadoutElement::parameterBook
Set of parameters to describe a RPC chamber.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:21
TRT::Hit::side
@ side
Definition: HitInfo.h:83
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:20
MuonGMR4::RpcReadoutElement::parameterBook::phiDesign
StripDesignPtr phiDesign
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:38
MuonGMR4::MuonReadoutElement::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the pointer to the muonIdHelperSvc.
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::RpcReadoutElement::parameterBook::halfLength
double halfLength
RPC panel dimensions.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:25
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MuonGMR4::RpcReadoutElement::doubletPhi
int doubletPhi() const
Returns the doublet Phi field of the MuonReadoutElement identifier.
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.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ActsTrk::operator<<
MsgStream & operator<<(MsgStream &out, const ActsUtils::Stat &stat)
Definition: TrackToTruthAssociationAlg.cxx:25
MuonGMR4::RpcReadoutElement::initElement
StatusCode initElement() override final
Element initialization.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/RpcReadoutElement.cxx:36
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonGMR4::StripLayer::localStripPos
Amg::Vector3D localStripPos(unsigned int stripum) const
Returns the position of the strip expressed in the local frame.
MuonGMR4::MuonReadoutElement::geoTransformHash
static IdentifierHash geoTransformHash()
Returns the hash that is associated with the surface cache holding the transformation that is placing...
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:44
MuonGMR4::RpcReadoutElement::sensorLayout
const StripLayer & sensorLayout(const IdentifierHash &measHash) const
Access to the StripLayer associated to a given measurement Hash.
MuonGMR4::RpcReadoutElement::m_gasThickness
double m_gasThickness
Distance between 2 gas gaps (Radial direction)
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:167
MuonGMR4::RpcReadoutElement::layerHash
IdentifierHash layerHash(const Identifier &measId) const override final
MuonGMR4::MuonReadoutElement::identify
Identifier identify() const override final
Return the athena identifier.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGMR4::RpcReadoutElement::parameterBook::layerBounds
ActsTrk::SurfaceBoundSetPtr< Acts::RectangleBounds > layerBounds
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:41
MuonGMR4::StripLayer::design
const StripDesign & design() const
Returns the underlying strip design.
MuonGMR4::RpcReadoutElement::distanceToEdge
double distanceToEdge(const IdentifierHash &layerHash, const Amg::Vector2D &posInStripPlane, const EdgeSide side) const
Returns the disance to the readout.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/RpcReadoutElement.cxx:91
RpcReadoutElement.h
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::RpcReadoutElement::chamberStripPos
Amg::Vector3D chamberStripPos(const IdentifierHash &measHash) const
Returns the local strip position w.r.t. to the chamber origin.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/RpcReadoutElement.cxx:87
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
MuonGMR4::MuonReadoutElement::planeSurfaceFactory
StatusCode planeSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< Acts::PlanarBounds > pBounds)
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:125
GeoPrimitivesHelpers.h
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::StripLayer::localStripLeftEdge
Amg::Vector3D localStripLeftEdge(unsigned int stripNum) const
Returns the position of the left strip edge (positive local y) expressed in the local frame.
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:54
MuonGMR4::RpcReadoutElement::EdgeSide::readOut
@ readOut
MuonGMR4::RpcReadoutElement::fromGapToChamOrigin
Amg::Transform3D fromGapToChamOrigin(const IdentifierHash &layerHash) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/RpcReadoutElement.cxx:70
MuonGMR4::StripLayer::localStripRightEdge
Amg::Vector3D localStripRightEdge(unsigned int stripNum) const
Returns the position of the right strip edge (negative local y) exoressed in the local frame.
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
MuonGMR4::RpcReadoutElement::stripNumber
static unsigned int stripNumber(const IdentifierHash &measHash)
MuonGMR4::RpcReadoutElement::createHash
static IdentifierHash createHash(const unsigned int strip, const unsigned int gasGap, const unsigned int doubPhi, const bool measPhi)
Constructs an Identifier hash from the Identifier fields controlled by this readout element