9# include "Acts/Surfaces/LineBounds.hpp"
10# include "Acts/Surfaces/PlanarBounds.hpp"
11# include "Acts/Geometry/GeometryContext.hpp"
12# include "Acts/Surfaces/StrawSurface.hpp"
13# include "Acts/Surfaces/PlaneSurface.hpp"
20 : GeoVDetectorElement(args.physVol),
24 ATH_MSG_FATAL(
"Failed to retrieve the MuonIdHelperSvc");
36 return StatusCode::FAILURE;
39 return StatusCode::SUCCESS;
47 return getMaterialGeom()->getAbsoluteTransform(alignStore ? alignStore->
geoModelAlignment.get() :
nullptr);
52 cache->releaseNominalCache();
60 unsigned int aligned{1};
64 cache->getTransform(&store);
83 SurfaceCacheSet::const_iterator cache =
m_surfaces.find(hash);
84 if(cache !=
m_surfaces.end())
return (*cache)->getSurface();
85 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" "<<__func__<<
"() -- Hash "<<hash
96 std::shared_ptr<const Acts::LineBounds> lBounds) {
102 <<
" no transform cache available for hash "<<hash);
103 return StatusCode::FAILURE;
106 auto insert_itr =
m_surfaces.insert(std::make_unique<SurfaceCache>(cache));
107 if(!insert_itr.second){
109 <<
" Insertion to muon surface cache failed for hash "<<hash);
110 return StatusCode::FAILURE;
113 (*insert_itr.first)->setSurface(Acts::Surface::makeShared<Acts::StrawSurface>(lBounds, **insert_itr.first));
114 return StatusCode::SUCCESS;
119 std::shared_ptr<const Acts::PlanarBounds> pBounds){
125 <<
" no transform cache available for hash "<<hash);
126 return StatusCode::FAILURE;
128 auto insert_itr =
m_surfaces.insert(std::make_unique<SurfaceCache>(cache));
129 if(!insert_itr.second){
131 <<
" Insertion to muon surface cache failed for hash "<<hash);
132 return StatusCode::FAILURE;
135 (*insert_itr.first)->setSurface(Acts::Surface::makeShared<Acts::PlaneSurface>(pBounds, **insert_itr.first));
136 return StatusCode::SUCCESS;
147 std::vector<std::shared_ptr<Acts::Surface>> surfaces{};
149 for (
const std::unique_ptr<SurfaceCache>& cache :
m_surfaces) {
151 surfaces.push_back(cache->getSurface());
153 <<std::endl<<(surfaces.back()->bounds()));
#define ATH_MSG_VERBOSE(x)
std::shared_ptr< GeoAlignmentStore > geoModelAlignment
Store containing the aligned GeoModel nodes.
virtual DetectorType detectorType() const =0
Returns the detector element type.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
This is a "hash" representation of an Identifier.
Chamber represent the volume enclosing a muon station.
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 m_stPhi
Cache the station phi of the identifier.
Amg::Transform3D globalToLocalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the global ATLAS coordinate system into the local coordinate system o...
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.
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...
TransformCacheMap m_localToGlobalCaches
void setChamberLink(const Chamber *chamber)
Sets the link to the enclosing chamber.
virtual ~MuonReadoutElement()
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.
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...
ActsTrk::SurfaceCacheSet m_surfaces
Cache of all associated surfaces.
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.
StatusCode createGeoTransform()
Creates the TransformCacheDetEle corresponding the generic local -> global transformation of the read...
const Chamber * chamber() const
Returns the pointer to the chamber enclosing this readout element.
int m_stName
Cache the station name of the identifier.
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::TransformCache * transformCache(const IdentifierHash &measHash) const
Returns the pointer to the TransformCache associated with this measurement hash.
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.
const Chamber * m_chambLink
IdentifierHash m_detElHash
Cache of the detector element hash.
int m_stEta
Cache the station eta of the identifier.
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::shared_ptr< Acts::Surface > surfacePtr
Eigen::Affine3d Transform3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
std::string toString(const MuonGMR4::MuonReadoutElement *re)
Helper struct to ship the defining arguments of the detector element.