|
ATLAS Offline Software
|
Go to the documentation of this file.
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"
22 MuonReadoutElement::~MuonReadoutElement() =
default;
24 : GeoVDetectorElement(
args.physVol),
27 if (!m_idHelperSvc.retrieve().isSuccess()) {
30 m_stName = m_idHelperSvc->stationName(
identify());
31 m_stEta = m_idHelperSvc->stationEta(
identify());
32 m_stPhi = m_idHelperSvc->stationPhi(
identify());
33 m_detElHash = m_idHelperSvc->detElementHash(
identify());
34 m_chIdx = m_idHelperSvc->chamberIndex(
identify());
40 return StatusCode::FAILURE;
45 static const IdentifierHash
hash{
static_cast<unsigned>(~0)-1};
51 const IdentifierHash&
hash)
const {
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);
84 #ifndef SIMULATIONBASE
90 ActsTrk::SurfaceCacheSet::const_iterator cache =
m_surfaces.find(
hash);
91 if(cache !=
m_surfaces.end())
return (*cache)->getSurface();
103 std::shared_ptr<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;
131 <<
" no transform cache available for hash "<<
hash);
132 return StatusCode::FAILURE;
134 auto insert_itr =
m_surfaces.insert(std::make_unique<ActsTrk::SurfaceCache>(transformCache->second.get()));
135 if(!insert_itr.second){
137 <<
" Insertion to muon surface cache failed for hash "<<
hash);
138 return StatusCode::FAILURE;
141 (*insert_itr.first)->setSurface(Acts::Surface::makeShared<Acts::PlaneSurface>(pBounds, **insert_itr.first));
142 return StatusCode::SUCCESS;
153 std::vector<std::shared_ptr<Acts::Surface>> surfaces{};
155 for (
const std::unique_ptr<SurfaceCache>& cache :
m_surfaces) {
157 surfaces.push_back(cache->getSurface());
159 <<std::endl<<(surfaces.back()->bounds()));
unsigned int storeAlignedTransforms(const ActsTrk::DetectorAlignStore &store) const override final
Caches the aligned transformation in the provided store. Returns the number of cached elements.
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
const Chamber * m_chambLink
const Chamber * chamber() const
Returns the pointer to the chamber enclosing this readout element.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
std::shared_ptr< GeoAlignmentStore > geoModelAlignment
Store containing the aligned GeoModel nodes.
TransformCacheMap m_localToGlobalCaches
const Acts::Surface & surface() const override final
Returns the surface associated to the readout element plane.
std::vector< std::shared_ptr< Acts::Surface > > getSurfaces() const
Returns all surfaces that are associated with the active readout planes.
ActsTrk::SurfaceCacheSet m_surfaces
Cache of all associated surfaces.
StatusCode createGeoTransform()
virtual DetectorType detectorType() const =0
Returns the detector element type.
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
const Amg::Transform3D & toStation(const ActsTrk::DetectorAlignStore *alignStore) const
Returns the local -> global transformation to go from the volume center origin.
#define ATH_MSG_VERBOSE(x)
AlignmentStorePtr & getStore(const DetectorType type)
Returns the mutable alignable store for the ATLAS detector type (Pixel, Mdt, etc.)
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the pointer to the muonIdHelperSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
Eigen::Affine3d Transform3D
Class to provide easy MsgStream access and capabilities.
Include the GeoPrimitives which need to be put first.
void setSectorLink(const SpectrometerSector *envelope)
Set the link to the enclosing sector envelope.
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.
Helper struct to ship the defining arguments of the detector element around.
StatusCode strawSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< Acts::LineBounds > lBounds)
Identifier identify() const override final
Return the athena identifier.
StatusCode planeSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< Acts::PlanarBounds > pBounds)
std::shared_ptr< Acts::Surface > surfacePtr(const IdentifierHash &hash) const
Returns the pointer associated to a certain wire / plane.
void releaseUnAlignedTrfs() const
Releases all cached transforms that are not connected with alignment.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
void setChamberLink(const Chamber *chamber)
Sets the link to the enclosing chamber.
const Amg::Transform3D & transform(const Acts::GeometryContext &gctx) const override final
Returns the transformation to the origin of the chamber coordinate system.
const SpectrometerSector * m_msSectorLink
Pointer to the associated MS-sector & MuonChamber.