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
18
19namespace Acts{
20 class Surface;
21 class LineBounds;
22 class PlanarBounds;
23}
24namespace MuonGMR4 {
25
27class Chamber;
35class MuonReadoutElement : public GeoVDetectorElement, public AthMessaging, public ActsTrk::IDetectorElement {
36 public:
38 struct defineArgs {
40 GeoIntrusivePtr<const GeoVFullPhysVol> physVol{nullptr};
42 GeoIntrusivePtr<const GeoAlignableTransform> alignTransform{nullptr};
44 std::string chambDesign{""};
47 };
48
50 MuonReadoutElement(const defineArgs& args);
52
61
64 virtual StatusCode initElement() = 0;
66 const GeoAlignableTransform* alignableTransform() const;
68 Identifier identify() const override final;
80 Muon::MuonStationIndex::ChIndex chamberIndex() const;
102 const Muon::IMuonIdHelperSvc* idHelperSvc() const;
103
106 Amg::Vector3D center(const ActsTrk::GeometryContext& ctx) const;
110 Amg::Vector3D center(const ActsTrk::GeometryContext& ctx,
115 Amg::Vector3D center(const ActsTrk::GeometryContext& ctx,
158 const Amg::Transform3D& localToGlobalTransform(const ActsTrk::GeometryContext& ctx) const override final;
171
172#ifndef SIMULATIONBASE
176 const Amg::Transform3D& localToGlobalTransform(const Acts::GeometryContext& gctx) const;
179 const Acts::Surface& surface() const;
181 Acts::Surface& surface();
185 const Acts::Surface& surface(const IdentifierHash& hash) const;
189 Acts::Surface& surface(const IdentifierHash& hash);
193 std::shared_ptr<Acts::Surface> surfacePtr(const IdentifierHash& hash) const;
195 std::vector<std::shared_ptr<Acts::Surface>> getSurfaces() const;
197 void setChamberLink(const Chamber* chamber);
199 void setSectorLink(const SpectrometerSector* envelope);
203 const Chamber* chamber() const;
204#endif
205 const Amg::Transform3D& localToGlobalTransform(const ActsTrk::DetectorAlignStore* store) const override final;
208 virtual double thickness() const = 0;
211 void releaseUnAlignedTrfs() const;
214 unsigned int storeAlignedTransforms(ActsTrk::DetectorAlignStore& store) const override final;
217 protected:
227 const Amg::Transform3D& toStation(const ActsTrk::DetectorAlignStore* alignStore) const;
234 template <class MuonDetImpl>
235 StatusCode insertTransform(const IdentifierHash& hash);
238 StatusCode createGeoTransform();
239#ifndef SIMULATIONBASE
243 StatusCode strawSurfaceFactory(const IdentifierHash& hash, std::shared_ptr<const Acts::LineBounds> lBounds);
247 StatusCode planeSurfaceFactory(const IdentifierHash& hash, std::shared_ptr<const Acts::PlanarBounds> pBounds);
248#endif
252 private:
258 ActsTrk::IReadoutSurfacePositioning* transformCache(const IdentifierHash& measHash);
260 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{"Muon::MuonIdHelperSvc/MuonIdHelperSvc", "MuonReadoutElement"};
261
266 int m_stName{-1};
268 int m_stEta{-1};
270 int m_stPhi{-1};
272 using TransformCacheMap = std::vector<std::unique_ptr<ActsTrk::IReadoutSurfacePositioning>>;
275 std::unique_ptr<ActsTrk::IReadoutSurfacePositioning> m_centralTrfCache{};
276 // ActsTrk::ReadoutSurfacePositioning<MuonReadoutElement> m_centralTrfCache{geoTransformHash(), this};
279
280#ifndef SIMULATIONBASE
283 const Chamber* m_chambLink{nullptr};
284#endif
285};
286} // namespace MuonGMR4
287
288namespace ActsTrk{
289 template <> Amg::Transform3D
291}
292
294#endif
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
ATLAS interface of a detector element.
Interface extension for caches used to hold the transforms of surfaces from the readout geometry.
Extension to handle the caching process of the transform held by the cache.
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.
Chamber represent the volume enclosing a muon station.
Definition Chamber.h:29
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 C site).
Amg::Transform3D globalToLocalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the global ATLAS coordinate system into the local coordinate system o...
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 geometrical center point of the readout element.
const Amg::Transform3D & toStation(const ActsTrk::DetectorAlignStore *alignStore) const
Returns the transformation from the GeoModel tree and applies the A-lines if a valid alignment store ...
const Acts::Surface & surface() const
Returns the surface associated with the readout element.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc for Identifier manipulation.
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)
Invokes the factory to create straw surfaces && to associate them with the particular transform cache...
IdentifierHash identHash() const
Returns the hash of the readout element which is identical to the detector element hash provided by t...
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 mutable surface pointer associated with the transform of a given readout layer.
MuonReadoutElement(const MuonReadoutElement &)=delete
Delete the copy constructor.
StatusCode planeSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< const Acts::PlanarBounds > pBounds)
Invokes the factory to create plane surfaces && to associate them with the particular transform cache...
Identifier identify() const override final
Return the ATLAS identifier.
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
Initialization of the readout elements.
StatusCode createGeoTransform()
Creates the ReadoutSurfacePositioning corresponding the generic local -> global transformation of the...
virtual double thickness() const =0
Returns the thickness in normal direction of the strip readout planes.
MuonReadoutElement(MuonReadoutElement &&)=delete
Delete the move constructor.
const Amg::Transform3D & localToGlobalTransform(const ActsTrk::DetectorAlignStore *store) const override final
Returns the reference to the aligned local to global transform from the DetectorAlignStore actually h...
const Chamber * chamber() const
Returns the pointer to the chamber enclosing this readout element.
std::unique_ptr< ActsTrk::IReadoutSurfacePositioning > m_centralTrfCache
Cache of the transform of the readout element itself.
StatusCode insertTransform(const IdentifierHash &hash)
Constructs the TransformDetEleCache associated with the hash of the given Mdt tube or strip layer.
MuonReadoutElement(const defineArgs &args)
Constructor taking the basic define arguments.
void releaseUnAlignedTrfs() const
Release all transforms from the memory that are not connected with a geometry context but cached by t...
const SpectrometerSector * m_msSectorLink
Pointer to the associated MS-sector & MuonChamber.
const ActsTrk::IReadoutSurfacePositioning * transformCache(const IdentifierHash &measHash) const
Returns the pointer to the TransformCache associated with this measurement hash.
unsigned int storeAlignedTransforms(ActsTrk::DetectorAlignStore &store) const override final
Construct the final aligned transformations and store them in the alignment store.
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
virtual IdentifierHash measurementHash(const Identifier &measId) const =0
The measurement hash is a continous numbering schema of all readout channels described by the specifi...
virtual Identifier measurementId(const IdentifierHash &measHash) const =0
Back conversion of the measurement hash to a full Athena Identifier The behaviour is undefined if a l...
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall)).
std::vector< std::unique_ptr< ActsTrk::IReadoutSurfacePositioning > > TransformCacheMap
The transform caches corresponding to the surfaces of the tubes and gas gap planes.
const Amg::Transform3D & localToGlobalTransform(const ActsTrk::GeometryContext &ctx) const override final
Returns the transformation from the local coordinate system of the readout element into the global AT...
static IdentifierHash geoTransformHash()
Returns the hash that is associated with the surface cache holding the transformation that is placing...
const GeoAlignableTransform * alignableTransform() const
Return the alignable transform node of the readout element.
virtual IdentifierHash layerHash(const Identifier &measId) const =0
The layer hash removes the bits from the IdentifierHash corresponding to the measurement's channel nu...
MuonReadoutElement & operator=(MuonReadoutElement &&)=delete
Delete the move assignment.
MuonReadoutElement & operator=(const MuonReadoutElement &)=delete
Delete the copy assignment.
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...
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< const GeoVFullPhysVol > physVol
Pointer to the underlying physical volume in GeoModel.
Identifier detElId
ATLAS detector element identifier (First channel of the first readout layer).
GeoIntrusivePtr< const GeoAlignableTransform > alignTransform
Pointer to the alignable transform node upstream.
std::string chambDesign
chamber design name as it's occuring in the parameter book tables E.g.