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;
36class MuonReadoutElement : public GeoVDetectorElement, public AthMessaging, public ActsTrk::IDetectorElement {
37 public:
39 struct defineArgs {
41 GeoIntrusivePtr<const GeoVFullPhysVol> physVol{nullptr};
43 GeoIntrusivePtr<const GeoAlignableTransform> alignTransform{nullptr};
45 std::string chambDesign{""};
48 };
49
51 MuonReadoutElement(const defineArgs& args);
53
62
65 virtual StatusCode initElement() = 0;
67 const GeoAlignableTransform* alignableTransform() const;
69 Identifier identify() const override final;
81 Muon::MuonStationIndex::ChIndex chamberIndex() const;
103 const Muon::IMuonIdHelperSvc* idHelperSvc() const;
104
107 Amg::Vector3D center(const ActsTrk::GeometryContext& ctx) const;
111 Amg::Vector3D center(const ActsTrk::GeometryContext& ctx,
116 Amg::Vector3D center(const ActsTrk::GeometryContext& ctx,
172
173#ifndef SIMULATIONBASE
177 const Amg::Transform3D& transform(const Acts::GeometryContext& gctx) const override final;
180 const Acts::Surface& surface() const override final;
182 Acts::Surface& surface() override final;
194 std::shared_ptr<Acts::Surface> surfacePtr(const IdentifierHash& hash) const;
196 std::vector<std::shared_ptr<Acts::Surface>> getSurfaces() const;
200 void setSectorLink(const SpectrometerSector* envelope);
205#else
209 virtual double thickness() const = 0;
210#endif
213 void releaseUnAlignedTrfs() const;
216 unsigned int storeAlignedTransforms(const ActsTrk::DetectorAlignStore& store) const override final;
219 protected:
229 const Amg::Transform3D& toStation(const ActsTrk::DetectorAlignStore* alignStore) const;
236 template <class MuonDetImpl>
237 StatusCode insertTransform(const IdentifierHash& hash);
240 StatusCode createGeoTransform();
241#ifndef SIMULATIONBASE
245 StatusCode strawSurfaceFactory(const IdentifierHash& hash, std::shared_ptr<const Acts::LineBounds> lBounds);
249 StatusCode planeSurfaceFactory(const IdentifierHash& hash, std::shared_ptr<const Acts::PlanarBounds> pBounds);
250#endif
254 private:
257 const ActsTrk::TransformCache* transformCache(const IdentifierHash& measHash) const;
259 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{"Muon::MuonIdHelperSvc/MuonIdHelperSvc", "MuonReadoutElement"};
260
265 int m_stName{-1};
267 int m_stEta{-1};
269 int m_stPhi{-1};
271 using TransformCacheMap = std::vector<std::unique_ptr<ActsTrk::TransformCache>>;
274 std::unique_ptr<ActsTrk::TransformCache> m_centralTrfCache{};
275 // ActsTrk::TransformCacheDetEle<MuonReadoutElement> m_centralTrfCache{geoTransformHash(), this};
278
279#ifndef SIMULATIONBASE
284 const Chamber* m_chambLink{nullptr};
285#endif
286};
287} // namespace MuonGMR4
288
289namespace ActsTrk{
290 template <> Amg::Transform3D
292}
293
295#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.
Chamber represent the volume enclosing a muon station.
Definition Chamber.h:28
std::unique_ptr< ActsTrk::TransformCache > m_centralTrfCache
Cache of the transform of the readout element itself.
std::vector< std::shared_ptr< Acts::Surface > > getSurfaces() const
Returns all surfaces that are associated with the active readout planes.
const Amg::Transform3D & localToGlobalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the local coordinate system of the readout element into the global AT...
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 Amg::Transform3D & transform(const Acts::GeometryContext &gctx) const override final
Wrapper function of the localToGlobalTransform method to satisfy the Acts::IDetectorElementBase inter...
unsigned int storeAlignedTransforms(const ActsTrk::DetectorAlignStore &store) const override final
Construct the final aligned transformations and store them in the alignment store.
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...
std::vector< std::unique_ptr< ActsTrk::TransformCache > > TransformCacheMap
The transform caches corresponding to the surfaces of the tubes and gas gap planes.
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 Acts::Surface & surface() const override final
Returns the surface associated with the readout element.
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 TransformCacheDetEle corresponding the generic local -> global transformation of the read...
MuonReadoutElement(MuonReadoutElement &&)=delete
Delete the move constructor.
const Chamber * chamber() const
Returns the pointer to the chamber enclosing this readout element.
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.
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...
const ActsTrk::TransformCache * transformCache(const IdentifierHash &measHash) const
Returns the pointer to the TransformCache associated with this measurement hash.
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))
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...
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< 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.