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 */
8 #include <GaudiKernel/SystemOfUnits.h>
9 #include <optional>
10 #ifndef SIMULATIONBASE
11 # include "Acts/Surfaces/RectangleBounds.hpp"
12 #endif
13 using namespace ActsTrk;
14 
15 namespace MuonGMR4 {
17 std::ostream& operator<<(std::ostream& ostr, const parameterBook& pars) {
18  ostr<<"chamber width/length/thickness [mm]: "<<(2.*pars.halfWidth)<<"/";
19  ostr<<(2.*pars.halfLength)<<"/"<<(2.*pars.halfThickness)<<std::endl;
20  if (pars.etaDesign) ostr<<"Eta strips: "<<(*pars.etaDesign)<<std::endl;
21  if (pars.phiDesign) ostr<<"Phi strips: "<<(*pars.phiDesign)<<std::endl;
22  return ostr;
23 }
24 
25 RpcReadoutElement::RpcReadoutElement(defineArgs&& args)
26  : MuonReadoutElement(std::move(args)),
27  m_pars{std::move(args)} {
28 }
29 
31 
35 
36  ATH_MSG_DEBUG("Parameter book "<<parameterBook());
37  if (m_pars.layers.empty()) {
38  ATH_MSG_FATAL("The readout element "<<idHelperSvc()->toStringDetEl(identify())<<" doesn't have any layers defined");
39  return StatusCode::FAILURE;
40  }
41 #ifndef SIMULATIONBASE
43  m_pars.halfLength)));
44 #endif
45  for (unsigned int layer = 0; layer < m_pars.layers.size(); ++layer) {
46  IdentifierHash layHash{layer};
47  if (!m_pars.layers[layer]) {
48  ATH_MSG_VERBOSE("Layer "<<layer <<" has not sensor layout associated.");
49  continue;
50  }
51  ATH_CHECK(insertTransform<RpcReadoutElement>(layHash));
52 #ifndef SIMULATIONBASE
53  const StripDesign& design{sensorLayout(layHash).design()};
54  ATH_CHECK(planeSurfaceFactory(layHash, m_pars.layerBounds->make_bounds(design.halfWidth(),
55  design.shortHalfHeight())));
56 #endif
57  }
59  chamberStripPos(createHash(1, 1, doubletPhi(), false))).mag();
60 #ifndef SIMULATIONBASE
61  m_pars.layerBounds.reset();
62 #endif
63  return StatusCode::SUCCESS;
64 }
65 
67  return sensorLayout(hash).toOrigin();
68 }
69 
70 Amg::Vector3D RpcReadoutElement::stripPosition(const ActsGeometryContext& ctx, const IdentifierHash& measHash) const {
71  return localToGlobalTrans(ctx, layerHash(measHash)) *
72  sensorLayout(measHash).localStripPos(stripNumber(measHash));
73 }
74 Amg::Vector3D RpcReadoutElement::rightStripEdge(const ActsGeometryContext& ctx, const IdentifierHash& measHash) const{
75  return localToGlobalTrans(ctx, layerHash(measHash)) *
76  sensorLayout(measHash).localStripLeftEdge(stripNumber(measHash));
77 }
78 Amg::Vector3D RpcReadoutElement::leftStripEdge(const ActsGeometryContext& ctx, const IdentifierHash& measHash) const {
79  return localToGlobalTrans(ctx, layerHash(measHash)) *
80  sensorLayout(measHash).localStripRightEdge(stripNumber(measHash));
81 }
82 
83 Amg::Vector3D RpcReadoutElement::chamberStripPos(const IdentifierHash& measHash) const {
84  return sensorLayout(measHash).stripPosition(stripNumber(measHash));
85 }
86 #ifndef SIMULATIONBASE
87 std::map<Identifier, std::shared_ptr<Acts::Surface>> RpcReadoutElement::getSurfaces() const {
88  std::map<Identifier, std::shared_ptr<Acts::Surface>> surfaces{};
89  for (const StripLayerPtr& layer : m_pars.layers) {
90  if (!layer) continue;
91  const IdentifierHash hash = createHash(1, gasGapNumber(layer->hash()) +1 ,
92  doubletPhiNumber(layer->hash()) +1,
93  measuresPhi(layer->hash()));
95  }
96  return surfaces;
97 
98 }
99 #endif
100 
101 }
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
GeoModel::TransientConstSharedPtr
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
Definition: TransientConstSharedPtr.h:13
MuonGMR4::parameterBook
MmReadoutElement::parameterBook parameterBook
Definition: MmReadoutElement.cxx:18
MuonGMR4::RpcReadoutElement::parameterBook::halfWidth
double halfWidth
Elongation within the sector
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:26
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:43
AthCheckMacros.h
MuonGMR4::RpcReadoutElement::getSurfaces
std::map< Identifier, std::shared_ptr< Acts::Surface > > getSurfaces() const override final
Returns all surfaces that are associated with the active readout planes.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/RpcReadoutElement.cxx:87
MuonGMR4::RpcReadoutElement::doubletPhiNumber
static unsigned int doubletPhiNumber(const IdentifierHash &measHash)
MuonGMR4::RpcReadoutElement::m_pars
parameterBook m_pars
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:142
MuonGMR4::RpcReadoutElement::parameterBook::layers
std::vector< StripLayerPtr > layers
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:33
MuonGMR4::RpcReadoutElement::measurementId
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
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
MuonGMR4::MuonReadoutElement::createGeoTransform
StatusCode createGeoTransform()
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:31
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::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:30
MuonGMR4::RpcReadoutElement::parameterBook
Set of parameters to describe a RPC chamber.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:18
MuonGMR4
A muon chamber is a collection of readout elements belonging to the same station.
Definition: ChamberAssembleTool.h:16
EventPrimitivesToStringConverter.h
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:22
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:32
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:28
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:39
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:154
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:38
MuonGMR4::StripLayer::design
const StripDesign & design() const
Returns the underlying strip design.
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:83
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:120
MuonGMR4::MuonReadoutElement::surfacePtr
std::shared_ptr< Acts::Surface > surfacePtr(const IdentifierHash &hash) const
Returns the pointer associated to a certain wire / plane.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:84
GeoPrimitivesHelpers.h
MuonGMR4::RpcReadoutElement::gasGapNumber
static unsigned int gasGapNumber(const IdentifierHash &measHash)
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:76
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:34
MuonGMR4::RpcReadoutElement::fromGapToChamOrigin
Amg::Transform3D fromGapToChamOrigin(const IdentifierHash &layerHash) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/RpcReadoutElement.cxx:66
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:25
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