ATLAS Offline Software
MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONGEOMODELR4_MUONREADOUTELEMENT_H
5 #define MUONGEOMODELR4_MUONREADOUTELEMENT_H
6 
10 #include <GaudiKernel/ServiceHandle.h>
11 #include <GeoModelKernel/GeoVDetectorElement.h>
12 #include <GeoModelKernel/GeoAlignableTransform.h>
14 
15 #include <ActsGeoUtils/Defs.h>
19 
20 namespace Acts{
21  class Surface;
22  class LineBounds;
23  class PlanarBounds;
24 }
25 namespace MuonGMR4 {
26 
27 class SpectrometerSector;
28 class Chamber;
38 class MuonReadoutElement : public GeoVDetectorElement, public AthMessaging, public ActsTrk::IDetectorElement {
39 
40  public:
43  struct defineArgs {
45  GeoIntrusivePtr<GeoVFullPhysVol> physVol{nullptr};
47  const GeoAlignableTransform* alignTransform{nullptr};
49  std::string chambDesign{""};
52  };
53 
54 
57 
62  virtual StatusCode initElement() = 0;
64  const GeoAlignableTransform* alignableTransform() const;
68  Identifier identify() const override final;
69 
81  Muon::MuonStationIndex::ChIndex chamberIndex() const;
82 
87 
91 
92 
97  const std::string& chamberDesign() const;
98 
100  const Muon::IMuonIdHelperSvc* idHelperSvc() const;
101 
108  const Identifier& id) const;
113 
128  const Identifier& id) const;
133 
138  const Identifier& id) const;
141 
142 #ifndef SIMULATIONBASE
143  const Amg::Transform3D& transform(const Acts::GeometryContext& gctx) const override final;
146  const Acts::Surface& surface() const override final;
147  Acts::Surface& surface() override final;
148 
152 
154  std::shared_ptr<Acts::Surface> surfacePtr(const IdentifierHash& hash) const;
155 
159  void setSectorLink(const SpectrometerSector* envelope);
165  std::vector<std::shared_ptr<Acts::Surface>> getSurfaces() const;
166 #else
167  virtual double thickness() const = 0;
170 #endif
171  void releaseUnAlignedTrfs() const;
173 
174  unsigned int storeAlignedTransforms(const ActsTrk::DetectorAlignStore& store) const override final;
175 
177  protected:
179  const Amg::Transform3D& toStation(const ActsTrk::DetectorAlignStore* alignStore) const;
180 
182  template <class MuonDetImpl> StatusCode insertTransform(const IdentifierHash& hash);
183 
185 #ifndef SIMULATIONBASE
186  //Creates a MuonSurfaceCache for straw surfaces using the given Bounds and Identifier Hash
187  StatusCode strawSurfaceFactory(const IdentifierHash& hash, std::shared_ptr<Acts::LineBounds> lBounds);
188 
189  //Creates a MuonSurfaceCache for plane surface using the given Bounds and Identifier Hash
190  StatusCode planeSurfaceFactory(const IdentifierHash& hash, std::shared_ptr<Acts::PlanarBounds> pBounds);
191 #endif
195  private:
196  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{"Muon::MuonIdHelperSvc/MuonIdHelperSvc", "MuonReadoutElement"};
197 
202  Muon::MuonStationIndex::ChIndex m_chIdx{Muon::MuonStationIndex::ChIndex::ChUnknown};
204  int m_stName{-1};
206  int m_stEta{-1};
208  int m_stPhi{-1};
210  using TransformCacheMap = std::unordered_map<IdentifierHash, std::unique_ptr<ActsTrk::TransformCache>>;
212 #ifndef SIMULATIONBASE
217  const Chamber* m_chambLink{nullptr};
218 #endif
219 };
220 } // namespace MuonGMR4
221 
222 namespace ActsTrk{
223  template <> Amg::Transform3D
225 }
226 
228 #endif
SGTest::store
TestStore store
Definition: TestStore.cxx:23
MuonGMR4::MuonReadoutElement::storeAlignedTransforms
unsigned int storeAlignedTransforms(const ActsTrk::DetectorAlignStore &store) const override final
Caches the aligned transformation in the provided store. Returns the number of cached elements.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:68
MuonGMR4::MuonReadoutElement::m_chambLink
const Chamber * m_chambLink
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:217
MuonGMR4::MuonReadoutElement::chamber
const Chamber * chamber() const
Returns the pointer to the chamber enclosing this readout element.
MuonGMR4::RpcReadoutElement::defineArgs
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:46
MuonGMR4::MuonReadoutElement::msSector
const SpectrometerSector * msSector() const
Returns the pointer to the envelope volume enclosing all chambers in the sector.
xAOD::L2MuonParameters::Chamber
Chamber
Define chamber types and locations.
Definition: TrigMuonDefs.h:15
MuonGMR4::SpectrometerSector
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Definition: SpectrometerSector.h:40
MuonGMR4::MuonReadoutElement::defineArgs::alignTransform
const GeoAlignableTransform * alignTransform
Pointer to the alignable transformation.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:47
ActsTrk::SurfaceCacheSet
std::set< std::unique_ptr< SurfaceCache >, std::less<> > SurfaceCacheSet
Definition: Tracking/Acts/ActsGeoUtils/ActsGeoUtils/Defs.h:22
MuonGMR4::MuonReadoutElement::m_localToGlobalCaches
TransformCacheMap m_localToGlobalCaches
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:211
MuonGMR4::MuonReadoutElement::surface
const Acts::Surface & surface() const override final
Returns the surface associated to the readout element plane.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:97
ActsTrk::DetectorAlignStore
Definition: DetectorAlignStore.h:20
MuonGMR4::MuonReadoutElement::operator=
MuonReadoutElement & operator=(const MuonReadoutElement &)=delete
MuonGMR4::MuonReadoutElement::getSurfaces
std::vector< std::shared_ptr< Acts::Surface > > getSurfaces() const
Returns all surfaces that are associated with the active readout planes.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:152
MuonGMR4::MuonReadoutElement::chamberDesign
const std::string & chamberDesign() const
The chamber design refers to the construction parameters of a readout element.
ActsTrk::TransformCacheDetEle
Definition: Tracking/Acts/ActsGeoUtils/ActsGeoUtils/Defs.h:26
MuonGMR4::MuonReadoutElement::m_surfaces
ActsTrk::SurfaceCacheSet m_surfaces
Cache of all associated surfaces.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:214
taskman.template
dictionary template
Definition: taskman.py:317
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
MuonGMR4::MuonReadoutElement::createGeoTransform
StatusCode createGeoTransform()
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:36
MuonGMR4::MuonReadoutElement::globalToLocalTrans
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:78
MuonGMR4::MuonReadoutElement::toStation
const Amg::Transform3D & toStation(const ActsTrk::DetectorAlignStore *alignStore) const
Returns the local -> global transformation to go from the volume center origin.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:59
MuonGMR4::MuonReadoutElement::layerHash
virtual IdentifierHash layerHash(const Identifier &measId) const =0
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
MuonGMR4::MuonReadoutElement::TransformCacheMap
std::unordered_map< IdentifierHash, std::unique_ptr< ActsTrk::TransformCache > > TransformCacheMap
Cache all local to global transformations.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:210
MuonGMR4::MuonReadoutElement::m_stPhi
int m_stPhi
Cache the station phi of the identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:208
MuonGMR4::MuonReadoutElement::m_stName
int m_stName
Cache the station name of the identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:204
MuonGMR4::Chamber
Definition: Chamber.h:22
MuonGMR4::MuonReadoutElement::MuonReadoutElement
MuonReadoutElement()=delete
Defs.h
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:20
Acts
Definition: ChamberAssembleTool.h:18
MuonGMR4::MuonReadoutElement::MuonReadoutElement
MuonReadoutElement(const MuonReadoutElement &)=delete
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
vector
Definition: MultiHisto.h:13
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonGMR4::MuonReadoutElement::m_stEta
int m_stEta
Cache the station eta of the identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:206
MuonGMR4::MuonReadoutElement::center
Amg::Vector3D center(const ActsGeometryContext &ctx) const
Returns the detector center (Which is the same as the detector center of the first measurement layer)
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonGMR4::MuonReadoutElement::measurementId
virtual Identifier measurementId(const IdentifierHash &measHash) const =0
Converts the measurement hash back to the full Identifier.
MuonGMR4::MuonReadoutElement::identHash
IdentifierHash identHash() const
Returns the Identifier has of the Element that is Identical to the detElHash from the id_helper class...
ActsTrk::IDetectorElement
Base class interface for the actual readout elements.
Definition: IDetectorElement.h:43
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonGMR4::MuonReadoutElement::m_chIdx
Muon::MuonStationIndex::ChIndex m_chIdx
Cache the chamber index of the Identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:202
MuonGMR4::MuonReadoutElement::setSectorLink
void setSectorLink(const SpectrometerSector *envelope)
Set the link to the enclosing sector envelope.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:148
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
MuonGMR4::MuonReadoutElement::defineArgs::chambDesign
std::string chambDesign
chamber design name as it's occuring in the parameter book tables E.g. BMS5, RPC10,...
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:49
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::MuonReadoutElement::alignableTransform
const GeoAlignableTransform * alignableTransform() const
Returnsthe alignable transform of the readout element.
MuonReadoutElement.icc
MuonGMR4::MuonReadoutElement::defineArgs
Helper struct to ship the defining arguments of the detector element around.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:43
MuonGMR4::MuonReadoutElement::strawSurfaceFactory
StatusCode strawSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< Acts::LineBounds > lBounds)
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:102
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::MuonReadoutElement::initElement
virtual StatusCode initElement()=0
Element initialization.
MuonGMR4::MuonReadoutElement::~MuonReadoutElement
virtual ~MuonReadoutElement()
TransformCache.h
MuonGMR4::MuonReadoutElement::stationName
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
ActsTrk::TransformCacheDetEle::fetchTransform
Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const override final
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
TransientConstSharedPtr.h
MuonGMR4::MuonReadoutElement::planeSurfaceFactory
StatusCode planeSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< Acts::PlanarBounds > pBounds)
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:125
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:89
MuonGMR4::MuonReadoutElement::releaseUnAlignedTrfs
void releaseUnAlignedTrfs() const
Releases all cached transforms that are not connected with alignment.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:62
AthMessaging.h
MuonGMR4::MuonReadoutElement::m_detElHash
IdentifierHash m_detElHash
Cache of the detector element hash.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:200
MuonGMR4::MuonReadoutElement::measurementHash
virtual IdentifierHash measurementHash(const Identifier &measId) const =0
Constructs the identifier hash from the full measurement Identifier.
MuonGMR4::MuonReadoutElement::chamberIndex
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index of the Identifier (MMS & STS) have the same chamber Index (EIS)
MuonGMR4::MuonReadoutElement::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:196
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
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
MuonGMR4::MuonReadoutElement::insertTransform
StatusCode insertTransform(const IdentifierHash &hash)
Inserts a transfomration for caching.
MuonGMR4::MuonReadoutElement::defineArgs::detElId
Identifier detElId
ATLAS identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:51
IDetectorElement.h
MuonDetectorDefs.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:54
MuonGMR4::MuonReadoutElement::stationEta
int stationEta() const
Returns the stationEta (positive A site, negative O site)
MuonGMR4::MuonReadoutElement::setChamberLink
void setChamberLink(const Chamber *chamber)
Sets the link to the enclosing chamber.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:145
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
MuonGMR4::MuonReadoutElement::defineArgs::physVol
GeoIntrusivePtr< GeoVFullPhysVol > physVol
Pointer to the underlying physical volume in GeoModel.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:45
MuonGMR4::MuonReadoutElement::transform
const Amg::Transform3D & transform(const Acts::GeometryContext &gctx) const override final
Returns the transformation to the origin of the chamber coordinate system.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:85
MuonGMR4::MuonReadoutElement::stationPhi
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall))
IMuonIdHelperSvc.h
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
MuonGMR4::MuonReadoutElement::m_msSectorLink
const SpectrometerSector * m_msSectorLink
Pointer to the associated MS-sector & MuonChamber.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:216
MuonGMR4::MuonReadoutElement::m_args
const defineArgs m_args
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:198
ServiceHandle
Definition: ClusterMakerTool.h:37
Identifier
Definition: IdentifierFieldParser.cxx:14