ATLAS Offline Software
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 
20 
21 #ifndef SIMULATIONBASE
22 # include "Acts/Surfaces/LineBounds.hpp"
23 # include "Acts/Surfaces/PlanarBounds.hpp"
24 #endif
25 namespace MuonGMR4 {
26 
27 class MuonChamber;
28 
38 class MuonReadoutElement : public GeoVDetectorElement, public AthMessaging, public ActsTrk::IDetectorElement {
39 
40  public:
43  struct defineArgs {
45  GeoIntrusivePtr<GeoVFullPhysVol> physVol{nullptr};
47  const GeoAlignableTransform* alignTransform{nullptr};
49  std::string chambDesign{""};
52  };
53 
54 
58 
60  virtual StatusCode initElement() = 0;
62  const GeoAlignableTransform* alignableTransform() const;
66  Identifier identify() const override final;
67 
79  Muon::MuonStationIndex::ChIndex chamberIndex() const;
80 
85 
89 
90 
95  std::string chamberDesign() const;
96 
98  const Muon::IMuonIdHelperSvc* idHelperSvc() const;
99 
106  const Identifier& id) const;
111 
126  const Identifier& id) const;
131 
136  const Identifier& id) const;
139 
140 #ifndef SIMULATIONBASE
141  const Acts::Transform3& transform(const Acts::GeometryContext& gctx) const override final;
144  const Acts::Surface& surface() const override final;
145  Acts::Surface& surface() override final;
146 
150 
152  std::shared_ptr<Acts::Surface> surfacePtr(const IdentifierHash& hash) const;
153 
155  void setChamberLink(GeoModel::TransientConstSharedPtr<MuonChamber> chamber);
156 
159  virtual std::map<Identifier, std::shared_ptr<Acts::Surface>> getSurfaces() const = 0;
160 #else
161  virtual double thickness() const = 0;
164 #endif
165  void releaseUnAlignedTrfs() const;
167 
168  unsigned int storeAlignedTransforms(const ActsTrk::DetectorAlignStore& store) const override final;
169 
171  protected:
173  const Amg::Transform3D& toStation(const ActsTrk::DetectorAlignStore* alignStore) const;
174 
176  template <class MuonDetImpl> StatusCode insertTransform(const IdentifierHash& hash);
177 
179 #ifndef SIMULATIONBASE
180  //Creates a MuonSurfaceCache for straw surfaces using the given Bounds and Identifier Hash
181  StatusCode strawSurfaceFactory(const IdentifierHash& hash, std::shared_ptr<Acts::LineBounds> lBounds);
182 
183  //Creates a MuonSurfaceCache for plane surface using the given Bounds and Identifier Hash
184  StatusCode planeSurfaceFactory(const IdentifierHash& hash, std::shared_ptr<Acts::PlanarBounds> pBounds);
185 #endif
189  private:
190  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{
191  "Muon::MuonIdHelperSvc/MuonIdHelperSvc", "MuonReadoutElement"};
192 
197  Muon::MuonStationIndex::ChIndex m_chIdx{Muon::MuonStationIndex::ChIndex::ChUnknown};
199  int m_stName{-1};
201  int m_stEta{-1};
203  int m_stPhi{-1};
204 
206  using TransformCacheMap = std::unordered_map<IdentifierHash, std::unique_ptr<ActsTrk::TransformCache>>;
208 #ifndef SIMULATIONBASE
213 #endif
214 };
215 } // namespace MuonGMR4
216 
217 namespace ActsTrk{
218  template <> Amg::Transform3D
220 }
221 
223 #endif
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
GeoModel
Definition: IGeoDbTagSvc.h:16
MuonGMR4::MuonReadoutElement::storeAlignedTransforms
unsigned int storeAlignedTransforms(const ActsTrk::DetectorAlignStore &store) const override final
Caches the aligned transformation in the provided store. Returns the number of cached elements.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:63
GeoModel::TransientConstSharedPtr
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
Definition: TransientConstSharedPtr.h:13
MuonGMR4::MuonReadoutElement::defineArgs::alignTransform
const GeoAlignableTransform * alignTransform
Pointer to the alignable transformation.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:47
SurfaceCache.h
ActsTrk::SurfaceCacheSet
std::set< std::unique_ptr< SurfaceCache >, std::less<> > SurfaceCacheSet
Definition: Tracking/Acts/ActsGeoUtils/ActsGeoUtils/SurfaceCache.h:63
MuonGMR4::MuonReadoutElement::m_localToGlobalCaches
TransformCacheMap m_localToGlobalCaches
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:207
MuonGMR4::MuonReadoutElement::surface
const Acts::Surface & surface() const override final
Returns the surface associated to the readout element plane.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:92
calibdata.chamber
chamber
Definition: calibdata.py:32
ActsTrk::DetectorAlignStore
Definition: DetectorAlignStore.h:20
ActsTrk::TransformCacheDetEle
Definition: TransformCache.h:65
MuonGMR4::MuonReadoutElement::chamberDesign
std::string chamberDesign() const
The chamber design refers to the construction parameters of a readout element.
MuonGMR4::MuonReadoutElement::m_surfaces
ActsTrk::SurfaceCacheSet m_surfaces
Cache of all associated surfaces.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:210
taskman.template
dictionary template
Definition: taskman.py:317
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:7
MuonGMR4::MuonReadoutElement::createGeoTransform
StatusCode createGeoTransform()
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:31
MuonGMR4::MuonReadoutElement::globalToLocalTrans
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:73
MuonGMR4::MuonReadoutElement::toStation
const Amg::Transform3D & toStation(const ActsTrk::DetectorAlignStore *alignStore) const
Returns the transformation into the center of the readout volume.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:54
MuonGMR4::MuonReadoutElement::layerHash
virtual IdentifierHash layerHash(const Identifier &measId) const =0
MuonGMR4::MuonChamber
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonChamber.h:39
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
MuonGMR4::MuonReadoutElement::TransformCacheMap
std::unordered_map< IdentifierHash, std::unique_ptr< ActsTrk::TransformCache > > TransformCacheMap
Cache all local to global transformations.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:206
MuonGMR4::MuonReadoutElement::m_stPhi
int m_stPhi
Cache the station phi of the identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:203
MuonGMR4::MuonReadoutElement::m_stName
int m_stName
Cache the station name of the identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:199
MuonGMR4::MuonReadoutElement::setChamberLink
void setChamberLink(GeoModel::TransientConstSharedPtr< MuonChamber > chamber)
Set's the link to the MuonChamber object to which the MuonReadoutElement belongs to.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:139
MuonGMR4::MuonReadoutElement::MuonReadoutElement
MuonReadoutElement()=delete
MuonGMR4
A muon chamber is a collection of readout elements belonging to the same station.
Definition: ChamberAssembleTool.h:16
Acts
Definition: MultiTrajectory.h:45
MuonGMR4::MuonReadoutElement::MuonReadoutElement
MuonReadoutElement(const MuonReadoutElement &)=delete
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
MuonGMR4::MuonReadoutElement::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the pointer to the muonIdHelperSvc.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonGMR4::MuonReadoutElement::m_stEta
int m_stEta
Cache the station eta of the identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:201
MuonGMR4::MuonReadoutElement::getChamber
const MuonChamber * getChamber() const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:142
MuonGMR4::MuonReadoutElement::center
Amg::Vector3D center(const ActsGeometryContext &ctx) const
Returns the detector center (Which is the same as the detector center of the first measurement layer)
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonGMR4::MuonReadoutElement::measurementId
virtual Identifier measurementId(const IdentifierHash &measHash) const =0
Converts the measurement hash back to the full Identifier.
MuonGMR4::MuonReadoutElement::identHash
IdentifierHash identHash() const
Returns the Identifier has of the Element that is Identical to the detElHash from the id_helper class...
ActsTrk::IDetectorElement
Definition: IDetectorElement.h:28
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:28
MuonGMR4::MuonReadoutElement::m_chIdx
Muon::MuonStationIndex::ChIndex m_chIdx
Cache the chamber index of the Identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:197
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
MuonGMR4::MuonReadoutElement::defineArgs::chambDesign
std::string chambDesign
chamber design name as it's occuring in the parameter book tables E.g. BMS5, RPC10,...
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:49
MuonGMR4::MuonReadoutElement::m_chambLink
GeoModel::TransientConstSharedPtr< MuonChamber > m_chambLink
Pointer to the associated MuonChamber.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:212
MuonGMR4::MuonReadoutElement::geoTransformHash
static IdentifierHash geoTransformHash()
Returns the hash that is associated with the surface cache holding the transformation that is placing...
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:39
MuonGMR4::MuonReadoutElement::alignableTransform
const GeoAlignableTransform * alignableTransform() const
Returnsthe alignable transform of the readout element.
MuonReadoutElement.icc
MuonGMR4::MuonReadoutElement::getSurfaces
virtual std::map< Identifier, std::shared_ptr< Acts::Surface > > getSurfaces() const =0
Returns all surfaces that are associated with the active readout planes.
MuonGMR4::MuonReadoutElement::defineArgs
Helper struct to ship the defining arguments of the detector element around.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:43
MuonGMR4::MuonReadoutElement::strawSurfaceFactory
StatusCode strawSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< Acts::LineBounds > lBounds)
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:97
MuonGMR4::MuonReadoutElement::identify
Identifier identify() const override final
Return the athena identifier.
MuonGMR4::MuonChamber::defineArgs
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonChamber.h:42
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGMR4::MuonReadoutElement::initElement
virtual StatusCode initElement()=0
Element initialization.
TransformCache.h
MuonGMR4::MuonReadoutElement::stationName
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
ActsTrk::TransformCacheDetEle::fetchTransform
Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const override final
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
TransientConstSharedPtr.h
MuonGMR4::MuonReadoutElement::planeSurfaceFactory
StatusCode planeSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< Acts::PlanarBounds > pBounds)
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:120
MuonGMR4::MuonReadoutElement::surfacePtr
std::shared_ptr< Acts::Surface > surfacePtr(const IdentifierHash &hash) const
Returns the pointer associated to a certain wire / plane.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:84
MuonGMR4::MuonReadoutElement::releaseUnAlignedTrfs
void releaseUnAlignedTrfs() const
Releases all cached transforms that are not connected with alignment.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:57
AthMessaging.h
MuonGMR4::MuonReadoutElement::m_detElHash
IdentifierHash m_detElHash
Cache of the detector element hash.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:195
MuonGMR4::MuonReadoutElement::measurementHash
virtual IdentifierHash measurementHash(const Identifier &measId) const =0
Constructs the identifier hash from the full measurement Identifier.
MuonGMR4::MuonReadoutElement::chamberIndex
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index of the Identifier (MMS & STS) have the same chamber Index (EIS)
MuonGMR4::MuonReadoutElement::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:190
MuonGMR4::MuonReadoutElement::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:76
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
MuonGMR4::MuonReadoutElement::insertTransform
StatusCode insertTransform(const IdentifierHash &hash)
Inserts a transfomration for caching.
MuonGMR4::MuonReadoutElement::defineArgs::detElId
Identifier detElId
ATLAS identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:51
IDetectorElement.h
MuonDetectorDefs.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
MuonGMR4::MuonReadoutElement::stationEta
int stationEta() const
Returns the stationEta (positive A site, negative O site)
IdentifierHash
Definition: IdentifierHash.h:38
MuonGMR4::MuonReadoutElement::defineArgs::physVol
GeoIntrusivePtr< GeoVFullPhysVol > physVol
Pointer to the underlying physical volume in GeoModel.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:45
MuonGMR4::MuonReadoutElement::transform
const Acts::Transform3 & transform(const Acts::GeometryContext &gctx) const override final
Returns the transformation to the origin of the chamber coordinate system.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx:80
MuonGMR4::MuonReadoutElement::stationPhi
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall))
IMuonIdHelperSvc.h
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
MuonGMR4::MuonReadoutElement::m_args
const defineArgs m_args
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:193
ServiceHandle
Definition: ClusterMakerTool.h:37