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"
24 : GeoVDetectorElement(args.physVol),
28 ATH_MSG_FATAL(
"Failed to retrieve the MuonIdHelperSvc");
40 return StatusCode::FAILURE;
54 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" "<<__func__<<
"() -- "
60 return getMaterialGeom()->getAbsoluteTransform(alignStore ? alignStore->
geoModelAlignment.get() :
nullptr);
64 cache.second->releaseNominalCache();
70 unsigned int aligned{0};
72 cache.second->getTransform(&store);
90 ActsTrk::SurfaceCacheSet::const_iterator cache =
m_surfaces.find(hash);
91 if(cache !=
m_surfaces.end())
return (*cache)->getSurface();
92 ATH_MSG_FATAL(__FILE__<<
":"<<__LINE__<<
" "<<__func__<<
"() -- Hash "<<hash
103 std::shared_ptr<const Acts::LineBounds> lBounds) {
109 <<
" no transform cache available for hash "<<hash);
110 return StatusCode::FAILURE;
113 auto insert_itr =
m_surfaces.insert(std::make_unique<ActsTrk::SurfaceCache>(transformCache->second.get()));
114 if(!insert_itr.second){
116 <<
" Insertion to muon surface cache failed for hash "<<hash);
117 return StatusCode::FAILURE;
120 (*insert_itr.first)->setSurface(Acts::Surface::makeShared<Acts::StrawSurface>(lBounds, **insert_itr.first));
121 return StatusCode::SUCCESS;
126 std::shared_ptr<const Acts::PlanarBounds> pBounds){
132 <<
" no transform cache available for hash "<<hash);
133 return StatusCode::FAILURE;
135 auto insert_itr =
m_surfaces.insert(std::make_unique<ActsTrk::SurfaceCache>(transformCache->second.get()));
136 if(!insert_itr.second){
138 <<
" Insertion to muon surface cache failed for hash "<<hash);
139 return StatusCode::FAILURE;
142 (*insert_itr.first)->setSurface(Acts::Surface::makeShared<Acts::PlaneSurface>(pBounds, **insert_itr.first));
143 return StatusCode::SUCCESS;
154 std::vector<std::shared_ptr<Acts::Surface>> surfaces{};
156 for (
const std::unique_ptr<SurfaceCache>& cache :
m_surfaces) {
158 surfaces.push_back(cache->getSurface());
160 <<std::endl<<(surfaces.back()->bounds()));
#define ATH_MSG_VERBOSE(x)
std::shared_ptr< GeoAlignmentStore > geoModelAlignment
Store containing the aligned GeoModel nodes.
AlignmentStorePtr & getStore(const DetectorType type)
Returns the mutable alignable store for the ATLAS detector type (Pixel, Mdt, etc.)
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.
std::vector< std::shared_ptr< Acts::Surface > > getSurfaces() const
Returns all surfaces that are associated with the active readout planes.
MuonReadoutElement()=delete
int m_stPhi
Cache the station phi of the identifier.
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.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
StatusCode strawSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< const Acts::LineBounds > lBounds)
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 pointer associated to a certain wire / plane.
StatusCode planeSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< const Acts::PlanarBounds > pBounds)
ActsTrk::SurfaceCacheSet m_surfaces
Cache of all associated surfaces.
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.
StatusCode createGeoTransform()
const Chamber * chamber() const
Returns the pointer to the chamber enclosing this readout element.
int m_stName
Cache the station name of the identifier.
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.
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.
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
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...
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
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 around.