ATLAS Offline Software
Loading...
Searching...
No Matches
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
20namespace Acts{
21 class Surface;
22 class LineBounds;
23 class PlanarBounds;
24}
25namespace MuonGMR4 {
26
28class Chamber;
38class 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
55 MuonReadoutElement(const defineArgs& args);
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
98
100 const Muon::IMuonIdHelperSvc* idHelperSvc() const;
101
104 Amg::Vector3D center(const ActsTrk::GeometryContext& ctx) const;
107 Amg::Vector3D center(const ActsTrk::GeometryContext& ctx,
111 Amg::Vector3D center(const ActsTrk::GeometryContext& ctx,
113
124 Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext& ctx) const;
133
136 const Amg::Transform3D& localToGlobalTrans(const ActsTrk::GeometryContext& ctx) const;
139 const Amg::Transform3D& localToGlobalTrans(const ActsTrk::GeometryContext& ctx,
141
142#ifndef SIMULATIONBASE
144 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
169 virtual double thickness() const = 0;
170#endif
172 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
184 StatusCode createGeoTransform();
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<const 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<const Acts::PlanarBounds> pBounds);
191#endif
195 private:
196 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{"Muon::MuonIdHelperSvc/MuonIdHelperSvc", "MuonReadoutElement"};
197
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
222namespace ActsTrk{
223 template <> Amg::Transform3D
225}
226
228#endif
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Base class interface for the actual readout elements.
Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const override final
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
This is a "hash" representation of an Identifier.
std::vector< std::shared_ptr< Acts::Surface > > getSurfaces() const
Returns all surfaces that are associated with the active readout planes.
int stationEta() const
Returns the stationEta (positive A site, negative O site)
const SpectrometerSector * msSector() const
Returns the pointer to the envelope volume enclosing all chambers in the sector.
Amg::Vector3D center(const ActsTrk::GeometryContext &ctx) const
Returns the detector center (Which is the same as the detector center of the first measurement layer)
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
const Amg::Transform3D & toStation(const ActsTrk::DetectorAlignStore *alignStore) const
Returns the local -> global transformation to go from the volume center origin.
const Amg::Transform3D & transform(const Acts::GeometryContext &gctx) const override final
Returns the transformation to the origin of the chamber coordinate system.
const std::string & chamberDesign() const
The chamber design refers to the construction parameters of a readout element.
StatusCode strawSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< const Acts::LineBounds > lBounds)
IdentifierHash identHash() const
Returns the Identifier has of the Element that is Identical to the detElHash from the id_helper class...
void setChamberLink(const Chamber *chamber)
Sets the link to the enclosing chamber.
void setSectorLink(const SpectrometerSector *envelope)
Set the link to the enclosing sector envelope.
std::shared_ptr< Acts::Surface > surfacePtr(const IdentifierHash &hash) const
Returns the pointer associated to a certain wire / plane.
MuonReadoutElement(const MuonReadoutElement &)=delete
StatusCode planeSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< const Acts::PlanarBounds > pBounds)
Identifier identify() const override final
Return the athena identifier.
const Acts::Surface & surface() const override final
Returns the surface associated to the readout element plane.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the pointer to the muonIdHelperSvc.
Muon::MuonStationIndex::ChIndex m_chIdx
Cache the chamber index of the Identifier.
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index of the Identifier (MMS & STS) have the same chamber Index (EIS)
virtual StatusCode initElement()=0
Element initialization.
const Chamber * chamber() const
Returns the pointer to the chamber enclosing this readout element.
StatusCode insertTransform(const IdentifierHash &hash)
Inserts a transfomration for caching.
void releaseUnAlignedTrfs() const
Releases all cached transforms that are not connected with alignment.
const SpectrometerSector * m_msSectorLink
Pointer to the associated MS-sector & MuonChamber.
unsigned int storeAlignedTransforms(const ActsTrk::DetectorAlignStore &store) const override final
Caches the aligned transformation in the provided store. Returns the number of cached elements.
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
virtual IdentifierHash measurementHash(const Identifier &measId) const =0
Constructs the identifier hash from the full measurement Identifier.
virtual Identifier measurementId(const IdentifierHash &measHash) const =0
Converts the measurement hash back to the full Identifier.
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall))
static IdentifierHash geoTransformHash()
Returns the hash that is associated with the surface cache holding the transformation that is placing...
const GeoAlignableTransform * alignableTransform() const
Returnsthe alignable transform of the readout element.
virtual IdentifierHash layerHash(const Identifier &measId) const =0
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
std::unordered_map< IdentifierHash, std::unique_ptr< ActsTrk::TransformCache > > TransformCacheMap
Cache all local to global transformations.
MuonReadoutElement & operator=(const MuonReadoutElement &)=delete
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
std::set< std::unique_ptr< SurfaceCache >, std::less<> > SurfaceCacheSet
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Affine3d Transform3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
RpcReadoutElement::defineArgs defineArgs
ChIndex
enum to classify the different chamber layers in the muon spectrometer
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
STL namespace.
GeoIntrusivePtr< GeoVFullPhysVol > physVol
Pointer to the underlying physical volume in GeoModel.
std::string chambDesign
chamber design name as it's occuring in the parameter book tables E.g. BMS5, RPC10,...