ATLAS Offline Software
Loading...
Searching...
No Matches
MuonGMR4::MmReadoutElement Class Reference

#include <MmReadoutElement.h>

Inheritance diagram for MuonGMR4::MmReadoutElement:
Collaboration diagram for MuonGMR4::MmReadoutElement:

Classes

struct  defineArgs
struct  parameterBook
 Set of parameters to describe a RPC chamber. More...

Public Member Functions

 MmReadoutElement (defineArgs &&args)
const parameterBookgetParameters () const
ActsTrk::DetectorType detectorType () const override final
 Overload from the ActsTrk::IDetectorElement.
double thickness () const override final
 Overload from the Acts::DetectorElement (2 * halfheight)
int multilayer () const
 Returns the multi layer of the element [1-2].
double moduleHeight () const
 Returns the height along the z-axis.
double moduleWidthS () const
 Returns the width at the short edge.
double moduleWidthL () const
 Returns the width at the top edge.
double moduleThickness () const
 Returns the module thickness.
double gapLengthS (const IdentifierHash &layerHash) const
 Length of gas Gap on short side.
double gapLengthL (const IdentifierHash &layerHash) const
 Length of gas Gap on long side.
double gapHeight (const IdentifierHash &layerHash) const
 Height of gas Gap.
unsigned int nGasGaps () const
 Returns the number of gas gaps.
unsigned int numStrips (const IdentifierHash &layerHash) const
 Returns the number of total active strips.
unsigned int firstStrip (const IdentifierHash &layerHash) const
 Returns the first active strip.
double stripLength (const IdentifierHash &measHash) const
 Returns the strip length.
int readoutSide (const IdentifierHash &measHash) const
 Returns the readout side.
StatusCode initElement () override final
 Element initialization.
IdentifierHash measurementHash (const Identifier &measId) const override final
 Constructs the identifier hash from the full measurement Identifier.
IdentifierHash layerHash (const Identifier &measId) const override final
IdentifierHash layerHash (const IdentifierHash &measHash) const
Identifier measurementId (const IdentifierHash &measHash) const override final
 Converts the measurement hash back to the full Identifier.
Amg::Vector3D stripPosition (const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
 Returns the position of the strip center.
Amg::Vector3D stripPosition (const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
Amg::Vector3D leftStripEdge (const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
 Returns the global position of the strip edge.
Amg::Vector3D leftStripEdge (const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
Amg::Vector3D rightStripEdge (const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
 Returns the global position of the strip edge.
Amg::Vector3D rightStripEdge (const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash) const
const StripLayerstripLayer (const Identifier &measId) const
const StripLayerstripLayer (const IdentifierHash &measHash) const
const GeoAlignableTransform * alignableTransform () const
 Returnsthe alignable transform of the readout element.
Identifier identify () const override final
 Return the athena identifier.
IdentifierHash identHash () const
 Returns the Identifier has of the Element that is Identical to the detElHash from the id_helper class.
int stationName () const
 Returns the stationName (BIS, BOS, etc) encoded into the integer.
int stationEta () const
 Returns the stationEta (positive A site, negative O site)
int stationPhi () const
 Returns the stationPhi (1-8) -> sector (2*phi - (isSmall))
Muon::MuonStationIndex::ChIndex chamberIndex () const
 Returns the chamber index of the Identifier (MMS & STS) have the same chamber Index (EIS)
const std::string & chamberDesign () const
 The chamber design refers to the construction parameters of a readout element.
const Muon::IMuonIdHelperSvcidHelperSvc () const
 Returns the pointer to the muonIdHelperSvc.
Amg::Vector3D center (const ActsTrk::GeometryContext &ctx) const
 Returns the detector center (Which is the same as the detector center of the first measurement layer)
Amg::Vector3D center (const ActsTrk::GeometryContext &ctx, const Identifier &id) const
 Returns the center of a given detector layer using the complete Identifier of the measurement.
Amg::Vector3D center (const ActsTrk::GeometryContext &ctx, const IdentifierHash &hash) const
 Returns the center of a given detector layer using the Identifier hash of the measurement.
Amg::Transform3D globalToLocalTrans (const ActsTrk::GeometryContext &ctx) const
 Transformations to translate between local <-> global coordinates.
Amg::Transform3D globalToLocalTrans (const ActsTrk::GeometryContext &ctx, const Identifier &id) const
 Returns the global to local transformation into the rest frame of a given measurement layer.
Amg::Transform3D globalToLocalTrans (const ActsTrk::GeometryContext &ctx, const IdentifierHash &hash) const
 Returns the global to local transformation into the rest frame of a given measurement layer.
const Amg::Transform3DlocalToGlobalTrans (const ActsTrk::GeometryContext &ctx) const
 Returns the local to global transformation into the ATLAS coordinate system.
const Amg::Transform3DlocalToGlobalTrans (const ActsTrk::GeometryContext &ctx, const Identifier &id) const
const Amg::Transform3DlocalToGlobalTrans (const ActsTrk::GeometryContext &ctx, const IdentifierHash &id) const
const Amg::Transform3Dtransform (const Acts::GeometryContext &gctx) const override final
 Returns the transformation to the origin of the chamber coordinate system.
const Acts::Surface & surface () const override final
 Returns the surface associated to the readout element plane.
Acts::Surface & surface () override final
const Acts::Surface & surface (const IdentifierHash &hash) const
 Returns the sufrface associated to a wire / measurement plane in the detector.
Acts::Surface & surface (const IdentifierHash &hash)
std::shared_ptr< Acts::Surface > surfacePtr (const IdentifierHash &hash) const
 Returns the pointer associated to a certain wire / plane.
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.
const SpectrometerSectormsSector () const
 Returns the pointer to the envelope volume enclosing all chambers in the sector.
const Chamberchamber () const
 Returns the pointer to the chamber enclosing this readout element.
std::vector< std::shared_ptr< Acts::Surface > > getSurfaces () const
 Returns all surfaces that are associated with the active readout planes.
void releaseUnAlignedTrfs () const
 Releases all cached transforms that are not connected with alignment.
unsigned int storeAlignedTransforms (const ActsTrk::DetectorAlignStore &store) const override final
 Caches the aligned transformation in the provided store. Returns the number of cached elements.
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Static Public Member Functions

static IdentifierHash createHash (const int gasGap, const int strip)

Protected Member Functions

const Amg::Transform3DtoStation (const ActsTrk::DetectorAlignStore *alignStore) const
 Returns the local -> global transformation to go from the volume center origin.
template<class MuonDetImpl>
StatusCode insertTransform (const IdentifierHash &hash)
 Inserts a transfomration for caching.
StatusCode createGeoTransform ()
StatusCode strawSurfaceFactory (const IdentifierHash &hash, std::shared_ptr< const Acts::LineBounds > lBounds)
StatusCode planeSurfaceFactory (const IdentifierHash &hash, std::shared_ptr< const Acts::PlanarBounds > pBounds)

Static Protected Member Functions

static IdentifierHash geoTransformHash ()
 Returns the hash that is associated with the surface cache holding the transformation that is placing the ReadoutElement inside the ATLAS coordinate system.

Private Types

using TransformCacheMap = std::unordered_map<IdentifierHash, std::unique_ptr<ActsTrk::TransformCache>>
 Cache all local to global transformations.

Private Member Functions

Amg::Transform3D fromGapToChamOrigin (const IdentifierHash &layerHash) const
void initMessaging () const
 Initialize our message level and MessageSvc.

Static Private Member Functions

static unsigned int gasGapNumber (const IdentifierHash &measHash)
static unsigned int stripNumber (const IdentifierHash &measHash)

Private Attributes

parameterBook m_pars {}
const MmIdHelperm_idHelper {idHelperSvc()->mmIdHelper()}
const int m_multilayer {m_idHelper.multilayer(identify())}
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {"Muon::MuonIdHelperSvc/MuonIdHelperSvc", "MuonReadoutElement"}
const defineArgs m_args {}
IdentifierHash m_detElHash {}
 Cache of the detector element hash.
Muon::MuonStationIndex::ChIndex m_chIdx {Muon::MuonStationIndex::ChIndex::ChUnknown}
 Cache the chamber index of the Identifier.
int m_stName {-1}
 Cache the station name of the identifier.
int m_stEta {-1}
 Cache the station eta of the identifier.
int m_stPhi {-1}
 Cache the station phi of the identifier.
TransformCacheMap m_localToGlobalCaches
ActsTrk::SurfaceCacheSet m_surfaces
 Cache of all associated surfaces.
const SpectrometerSectorm_msSectorLink {}
 Pointer to the associated MS-sector & MuonChamber.
const Chamberm_chambLink {nullptr}
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 18 of file MmReadoutElement.h.

Member Typedef Documentation

◆ TransformCacheMap

using MuonGMR4::MuonReadoutElement::TransformCacheMap = std::unordered_map<IdentifierHash, std::unique_ptr<ActsTrk::TransformCache>>
privateinherited

Cache all local to global transformations.

Definition at line 210 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h.

Constructor & Destructor Documentation

◆ MmReadoutElement()

MuonGMR4::MmReadoutElement::MmReadoutElement ( defineArgs && args)

Definition at line 28 of file MmReadoutElement.cxx.

28 :
30 m_pars{std::move(args)} {
31}

Member Function Documentation

◆ alignableTransform()

const GeoAlignableTransform * MuonGMR4::MuonReadoutElement::alignableTransform ( ) const
inherited

Returnsthe alignable transform of the readout element.

◆ center() [1/3]

Amg::Vector3D MuonGMR4::MuonReadoutElement::center ( const ActsTrk::GeometryContext & ctx) const
inherited

Returns the detector center (Which is the same as the detector center of the first measurement layer)

◆ center() [2/3]

Amg::Vector3D MuonGMR4::MuonReadoutElement::center ( const ActsTrk::GeometryContext & ctx,
const Identifier & id ) const
inherited

Returns the center of a given detector layer using the complete Identifier of the measurement.

◆ center() [3/3]

Amg::Vector3D MuonGMR4::MuonReadoutElement::center ( const ActsTrk::GeometryContext & ctx,
const IdentifierHash & hash ) const
inherited

Returns the center of a given detector layer using the Identifier hash of the measurement.

◆ chamber()

const Chamber * MuonGMR4::MuonReadoutElement::chamber ( ) const
inherited

Returns the pointer to the chamber enclosing this readout element.

◆ chamberDesign()

const std::string & MuonGMR4::MuonReadoutElement::chamberDesign ( ) const
inherited

The chamber design refers to the construction parameters of a readout element.

Used for the retrieval of the chamber parameters E.g. the chambers BOL1A8 & BOL2A8 are identical in terms of number of tubes, dimensions etc.

◆ chamberIndex()

Muon::MuonStationIndex::ChIndex MuonGMR4::MuonReadoutElement::chamberIndex ( ) const
inherited

Returns the chamber index of the Identifier (MMS & STS) have the same chamber Index (EIS)

◆ createGeoTransform()

StatusCode MuonGMR4::MuonReadoutElement::createGeoTransform ( )
protectedinherited

Check that the alignable node has been assigned

Definition at line 36 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

36 {
38 if(!alignableTransform()) {
39 ATH_MSG_FATAL("The readout element "<<idHelperSvc()->toStringDetEl(identify())<<" has no assigned alignable node");
40 return StatusCode::FAILURE;
41 }
43}
#define ATH_MSG_FATAL(x)
Identifier identify() const override final
Return the athena identifier.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the pointer to the muonIdHelperSvc.
StatusCode insertTransform(const IdentifierHash &hash)
Inserts a transfomration for caching.
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.

◆ createHash()

IdentifierHash MuonGMR4::MmReadoutElement::createHash ( const int gasGap,
const int strip )
static

◆ detectorType()

ActsTrk::DetectorType MuonGMR4::MmReadoutElement::detectorType ( ) const
inlinefinaloverridevirtual

Overload from the ActsTrk::IDetectorElement.

Implements ActsTrk::IDetectorElementBase.

Definition at line 54 of file MmReadoutElement.h.

54 {
56 }
@ Mm
Maybe not needed in the migration.

◆ firstStrip()

unsigned int MuonGMR4::MmReadoutElement::firstStrip ( const IdentifierHash & layerHash) const

Returns the first active strip.

◆ fromGapToChamOrigin()

Amg::Transform3D MuonGMR4::MmReadoutElement::fromGapToChamOrigin ( const IdentifierHash & layerHash) const
private

Definition at line 73 of file MmReadoutElement.cxx.

73 {
74 return stripLayer(layHash).toOrigin();
75}
const StripLayer & stripLayer(const Identifier &measId) const
const Amg::Transform3D & toOrigin() const
Returns the transformation to go from the strip layer center to the origin of the Strip chamber.

◆ gapHeight()

double MuonGMR4::MmReadoutElement::gapHeight ( const IdentifierHash & layerHash) const

Height of gas Gap.

◆ gapLengthL()

double MuonGMR4::MmReadoutElement::gapLengthL ( const IdentifierHash & layerHash) const

Length of gas Gap on long side.

◆ gapLengthS()

double MuonGMR4::MmReadoutElement::gapLengthS ( const IdentifierHash & layerHash) const

Length of gas Gap on short side.

◆ gasGapNumber()

unsigned int MuonGMR4::MmReadoutElement::gasGapNumber ( const IdentifierHash & measHash)
staticprivate

◆ geoTransformHash()

IdentifierHash MuonGMR4::MuonReadoutElement::geoTransformHash ( )
staticprotectedinherited

Returns the hash that is associated with the surface cache holding the transformation that is placing the ReadoutElement inside the ATLAS coordinate system.

Definition at line 44 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

44 {
45 static const IdentifierHash hash{static_cast<unsigned>(~0)-1};
46 return hash;
47}

◆ getParameters()

const parameterBook & MuonGMR4::MmReadoutElement::getParameters ( ) const

Definition at line 33 of file MmReadoutElement.cxx.

33{ return m_pars; }

◆ getSurfaces()

std::vector< std::shared_ptr< Acts::Surface > > MuonGMR4::MuonReadoutElement::getSurfaces ( ) const
inherited

Returns all surfaces that are associated with the active readout planes.

Definition at line 153 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

153 {
154 std::vector<std::shared_ptr<Acts::Surface>> surfaces{};
155 surfaces.reserve(m_surfaces.size());
156 for (const std::unique_ptr<SurfaceCache>& cache : m_surfaces) {
157 if (cache->hash() != geoTransformHash()) {
158 surfaces.push_back(cache->getSurface());
159 ATH_MSG_VERBOSE("Add surface "<<idHelperSvc()->toString(cache->identify())
160 <<std::endl<<(surfaces.back()->bounds()));
161 }
162 }
163 return surfaces;
164}
#define ATH_MSG_VERBOSE(x)
std::string toString(const MuonGMR4::MuonReadoutElement *re)

◆ globalToLocalTrans() [1/3]

Amg::Transform3D MuonGMR4::MuonReadoutElement::globalToLocalTrans ( const ActsTrk::GeometryContext & ctx) const
inherited

Transformations to translate between local <-> global coordinates.

They follow the common ATLAS conventations that the origin is located in the center of the detector layer x-axis: Points towards the sky y-axis: Points towards the edges of ATLAS z-axis: Points along the beamline The transformations always include the corrections from the A-Lines of the alignment system Returns the global to local transformation into the rest frame of the detector (Coincides with the first measurement layer)

Definition at line 78 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

78 {
80}
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.

◆ globalToLocalTrans() [2/3]

Amg::Transform3D MuonGMR4::MuonReadoutElement::globalToLocalTrans ( const ActsTrk::GeometryContext & ctx,
const Identifier & id ) const
inherited

Returns the global to local transformation into the rest frame of a given measurement layer.

◆ globalToLocalTrans() [3/3]

Amg::Transform3D MuonGMR4::MuonReadoutElement::globalToLocalTrans ( const ActsTrk::GeometryContext & ctx,
const IdentifierHash & hash ) const
inherited

Returns the global to local transformation into the rest frame of a given measurement layer.

◆ identHash()

IdentifierHash MuonGMR4::MuonReadoutElement::identHash ( ) const
inherited

Returns the Identifier has of the Element that is Identical to the detElHash from the id_helper class.

◆ identify()

Identifier MuonGMR4::MuonReadoutElement::identify ( ) const
finaloverridevirtualinherited

Return the athena identifier.

The Identifier is identical with the first measurment channel in readout element (E.g. Strip 1 in Layer 1 in the NSW)

Implements ActsTrk::IDetectorElementBase.

◆ idHelperSvc()

const Muon::IMuonIdHelperSvc * MuonGMR4::MuonReadoutElement::idHelperSvc ( ) const
inherited

Returns the pointer to the muonIdHelperSvc.

◆ initElement()

StatusCode MuonGMR4::MmReadoutElement::initElement ( )
finaloverridevirtual

Element initialization.

Implements MuonGMR4::MuonReadoutElement.

Definition at line 35 of file MmReadoutElement.cxx.

35 {
36 ATH_MSG_DEBUG("Parameter book "<<parameterBook());
38
39 if (m_pars.layers.empty()) {
40 ATH_MSG_FATAL("The readout element "<<idHelperSvc()->toStringDetEl(identify())<<" doesn't have any layers defined");
41 return StatusCode::FAILURE;
42 }
43#ifndef SIMULATIONBASE
45 m_pars.layerBounds->makeBounds<Acts::TrapezoidBounds>(m_pars.halfShortWidth,
46 m_pars.halfLongWidth,
47 m_pars.halfHeight,
48 90.*Gaudi::Units::deg)));
49#endif
50 for (unsigned int layer = 0; layer < m_pars.layers.size(); ++layer) {
51 IdentifierHash layHash{layer};
52 if (m_pars.layers[layer]->hash() != layHash) {
53 ATH_MSG_FATAL("Layer "<<m_pars.layers[layer]<<" has a very strange hash. Expect "<<layer);
54 return StatusCode::FAILURE;
55 }
57#ifndef SIMULATIONBASE
58 const StripDesign& design{m_pars.layers[layer]->design()};
59
61 m_pars.layerBounds->makeBounds<Acts::TrapezoidBounds>(design.shortHalfHeight(),
62 design.longHalfHeight(),
63 design.halfWidth(),
64 90.*Gaudi::Units::deg + design.stereoAngle())));
65#endif
66 }
67#ifndef SIMULATIONBASE
68 m_pars.layerBounds.reset();
69#endif
70 return StatusCode::SUCCESS;
71}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
StatusCode planeSurfaceFactory(const IdentifierHash &hash, std::shared_ptr< const Acts::PlanarBounds > pBounds)
MmReadoutElement::parameterBook parameterBook
@ layer
Definition HitInfo.h:79

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ insertTransform()

template<class MuonDetImpl>
StatusCode MuonGMR4::MuonReadoutElement::insertTransform ( const IdentifierHash & hash)
protectedinherited

Inserts a transfomration for caching.

◆ layerHash() [1/2]

IdentifierHash MuonGMR4::MmReadoutElement::layerHash ( const Identifier & measId) const
finaloverridevirtual

◆ layerHash() [2/2]

IdentifierHash MuonGMR4::MmReadoutElement::layerHash ( const IdentifierHash & measHash) const

◆ leftStripEdge() [1/2]

Amg::Vector3D MuonGMR4::MmReadoutElement::leftStripEdge ( const ActsTrk::GeometryContext & ctx,
const Identifier & measId ) const

Returns the global position of the strip edge.

◆ leftStripEdge() [2/2]

Amg::Vector3D MuonGMR4::MmReadoutElement::leftStripEdge ( const ActsTrk::GeometryContext & ctx,
const IdentifierHash & measHash ) const

Definition at line 105 of file MmReadoutElement.cxx.

105 {
106 const IdentifierHash lHash = layerHash(measHash);
107 if (static_cast<unsigned int>(lHash) < m_pars.layers.size()) {
108 return localToGlobalTrans(ctx, lHash) * stripLayer(lHash).localStripLeftEdge(stripNumber(measHash));
109 }
110 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" The layer hash "<<static_cast<unsigned int>(lHash)
111 <<" is out of range. Maximum range "<<m_pars.layers.size());
112 return Amg::Vector3D::Zero();
113}
#define ATH_MSG_WARNING(x)
static unsigned int stripNumber(const IdentifierHash &measHash)
IdentifierHash layerHash(const Identifier &measId) const override final
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Amg::Vector3D localStripLeftEdge(unsigned int stripNum, bool phiView=false) const
Returns the position of the strip edge at (positive y in the strip design description) in the local c...

◆ localToGlobalTrans() [1/3]

const Amg::Transform3D & MuonGMR4::MuonReadoutElement::localToGlobalTrans ( const ActsTrk::GeometryContext & ctx) const
inherited

Returns the local to global transformation into the ATLAS coordinate system.

Definition at line 81 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

81 {
83}

◆ localToGlobalTrans() [2/3]

const Amg::Transform3D & MuonGMR4::MuonReadoutElement::localToGlobalTrans ( const ActsTrk::GeometryContext & ctx,
const Identifier & id ) const
inherited

◆ localToGlobalTrans() [3/3]

const Amg::Transform3D & MuonGMR4::MuonReadoutElement::localToGlobalTrans ( const ActsTrk::GeometryContext & ctx,
const IdentifierHash & id ) const
inherited

Definition at line 50 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

51 {
52 TransformCacheMap::const_iterator cache = m_localToGlobalCaches.find(hash);
53 if (cache != m_localToGlobalCaches.end()) return cache->second->getTransform(ctx.getStore(detectorType()).get());
54 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" "<<__func__<<"() -- "
55 <<idHelperSvc()->toStringDetEl(identify())<<" hash: "<<hash<<" is unknown.");
56 return dummyTrans;
57}
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.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130

◆ measurementHash()

IdentifierHash MuonGMR4::MmReadoutElement::measurementHash ( const Identifier & measId) const
finaloverridevirtual

Constructs the identifier hash from the full measurement Identifier.

The hash is always defined w.r.t the specific detector element and used to access the information in memory quickly

Implements MuonGMR4::MuonReadoutElement.

◆ measurementId()

Identifier MuonGMR4::MmReadoutElement::measurementId ( const IdentifierHash & measHash) const
finaloverridevirtual

Converts the measurement hash back to the full Identifier.

Implements MuonGMR4::MuonReadoutElement.

◆ moduleHeight()

double MuonGMR4::MmReadoutElement::moduleHeight ( ) const

Returns the height along the z-axis.

◆ moduleThickness()

double MuonGMR4::MmReadoutElement::moduleThickness ( ) const

Returns the module thickness.

◆ moduleWidthL()

double MuonGMR4::MmReadoutElement::moduleWidthL ( ) const

Returns the width at the top edge.

◆ moduleWidthS()

double MuonGMR4::MmReadoutElement::moduleWidthS ( ) const

Returns the width at the short edge.

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ msSector()

const SpectrometerSector * MuonGMR4::MuonReadoutElement::msSector ( ) const
inherited

Returns the pointer to the envelope volume enclosing all chambers in the sector.

◆ multilayer()

int MuonGMR4::MmReadoutElement::multilayer ( ) const

Returns the multi layer of the element [1-2].

◆ nGasGaps()

unsigned int MuonGMR4::MmReadoutElement::nGasGaps ( ) const

Returns the number of gas gaps.

◆ numStrips()

unsigned int MuonGMR4::MmReadoutElement::numStrips ( const IdentifierHash & layerHash) const

Returns the number of total active strips.

◆ planeSurfaceFactory()

StatusCode MuonGMR4::MuonReadoutElement::planeSurfaceFactory ( const IdentifierHash & hash,
std::shared_ptr< const Acts::PlanarBounds > pBounds )
protectedinherited

Definition at line 125 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

126 {
127
128 //get the local to global transform cache
129 TransformCacheMap::const_iterator transformCache = m_localToGlobalCaches.find(hash);
130 if (transformCache == m_localToGlobalCaches.end()) {
131 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" - "<<idHelperSvc()->toString(identify())
132 <<" no transform cache available for hash "<<hash);
133 return StatusCode::FAILURE;
134 }
135 auto insert_itr = m_surfaces.insert(std::make_unique<ActsTrk::SurfaceCache>(transformCache->second.get()));
136 if(!insert_itr.second){
137 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" - "<<idHelperSvc()->toString(identify())
138 <<" Insertion to muon surface cache failed for hash "<<hash);
139 return StatusCode::FAILURE;
140 }
141 //Create a plane surface for the surface cache
142 (*insert_itr.first)->setSurface(Acts::Surface::makeShared<Acts::PlaneSurface>(pBounds, **insert_itr.first));
143 return StatusCode::SUCCESS;
144}

◆ readoutSide()

int MuonGMR4::MmReadoutElement::readoutSide ( const IdentifierHash & measHash) const

Returns the readout side.

◆ releaseUnAlignedTrfs()

void MuonGMR4::MuonReadoutElement::releaseUnAlignedTrfs ( ) const
inherited

Releases all cached transforms that are not connected with alignment.

Definition at line 62 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

62 {
63 for (const auto& cache : m_localToGlobalCaches) {
64 cache.second->releaseNominalCache();
65 }
66}

◆ rightStripEdge() [1/2]

Amg::Vector3D MuonGMR4::MmReadoutElement::rightStripEdge ( const ActsTrk::GeometryContext & ctx,
const Identifier & measId ) const

Returns the global position of the strip edge.

◆ rightStripEdge() [2/2]

Amg::Vector3D MuonGMR4::MmReadoutElement::rightStripEdge ( const ActsTrk::GeometryContext & ctx,
const IdentifierHash & measHash ) const

Definition at line 123 of file MmReadoutElement.cxx.

123 {
124 const IdentifierHash lHash = layerHash(measHash);
125 if (static_cast<unsigned int>(lHash) < m_pars.layers.size()) {
126 return localToGlobalTrans(ctx, lHash) * stripLayer(lHash).localStripRightEdge(stripNumber(measHash));
127 }
128 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" The layer hash "<<static_cast<unsigned int>(lHash)
129 <<" is out of range. Maximum range "<<m_pars.layers.size());
130 return Amg::Vector3D::Zero();
131}
Amg::Vector3D localStripRightEdge(unsigned int stripNum, bool phiView=false) const
Returns the position of the right strip edge at (negative y in the strip design description) in the l...

◆ setChamberLink()

void MuonGMR4::MuonReadoutElement::setChamberLink ( const Chamber * chamber)
inherited

Sets the link to the enclosing chamber.

Definition at line 146 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

146 {
148}
const Chamber * chamber() const
Returns the pointer to the chamber enclosing this readout element.

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ setSectorLink()

void MuonGMR4::MuonReadoutElement::setSectorLink ( const SpectrometerSector * envelope)
inherited

Set the link to the enclosing sector envelope.

Definition at line 149 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

149 {
150 m_msSectorLink = envelope;
151}
const SpectrometerSector * m_msSectorLink
Pointer to the associated MS-sector & MuonChamber.

◆ stationEta()

int MuonGMR4::MuonReadoutElement::stationEta ( ) const
inherited

Returns the stationEta (positive A site, negative O site)

◆ stationName()

int MuonGMR4::MuonReadoutElement::stationName ( ) const
inherited

Returns the stationName (BIS, BOS, etc) encoded into the integer.

◆ stationPhi()

int MuonGMR4::MuonReadoutElement::stationPhi ( ) const
inherited

Returns the stationPhi (1-8) -> sector (2*phi - (isSmall))

◆ storeAlignedTransforms()

unsigned int MuonGMR4::MuonReadoutElement::storeAlignedTransforms ( const ActsTrk::DetectorAlignStore & store) const
finaloverridevirtualinherited

Caches the aligned transformation in the provided store. Returns the number of cached elements.

Implements ActsTrk::IDetectorElement.

Definition at line 68 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

68 {
69 if (store.detType != detectorType()) return 0;
70 unsigned int aligned{0};
71 for (const auto& cache : m_localToGlobalCaches) {
72 cache.second->getTransform(&store);
73 ++aligned;
74 }
75 return aligned;
76}
TestStore store
Definition TestStore.cxx:23

◆ strawSurfaceFactory()

StatusCode MuonGMR4::MuonReadoutElement::strawSurfaceFactory ( const IdentifierHash & hash,
std::shared_ptr< const Acts::LineBounds > lBounds )
protectedinherited

Definition at line 102 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

103 {
104
105 //get the local to global transform cache
106 TransformCacheMap::const_iterator transformCache = m_localToGlobalCaches.find(hash);
107 if (transformCache == m_localToGlobalCaches.end()) {
108 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" - "<<idHelperSvc()->toString(identify())
109 <<" no transform cache available for hash "<<hash);
110 return StatusCode::FAILURE;
111 }
112
113 auto insert_itr = m_surfaces.insert(std::make_unique<ActsTrk::SurfaceCache>(transformCache->second.get()));
114 if(!insert_itr.second){
115 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" - "<<idHelperSvc()->toString(identify())
116 <<" Insertion to muon surface cache failed for hash "<<hash);
117 return StatusCode::FAILURE;
118 }
119 //Create straw surface for the surface cache
120 (*insert_itr.first)->setSurface(Acts::Surface::makeShared<Acts::StrawSurface>(lBounds, **insert_itr.first));
121 return StatusCode::SUCCESS;
122
123}

◆ stripLayer() [1/2]

const StripLayer & MuonGMR4::MmReadoutElement::stripLayer ( const Identifier & measId) const

◆ stripLayer() [2/2]

const StripLayer & MuonGMR4::MmReadoutElement::stripLayer ( const IdentifierHash & measHash) const

◆ stripLength()

double MuonGMR4::MmReadoutElement::stripLength ( const IdentifierHash & measHash) const

Returns the strip length.

◆ stripNumber()

unsigned int MuonGMR4::MmReadoutElement::stripNumber ( const IdentifierHash & measHash)
staticprivate

◆ stripPosition() [1/2]

Amg::Vector3D MuonGMR4::MmReadoutElement::stripPosition ( const ActsTrk::GeometryContext & ctx,
const Identifier & measId ) const

Returns the position of the strip center.

◆ stripPosition() [2/2]

Amg::Vector3D MuonGMR4::MmReadoutElement::stripPosition ( const ActsTrk::GeometryContext & ctx,
const IdentifierHash & measHash ) const

Definition at line 86 of file MmReadoutElement.cxx.

86 {
87 const IdentifierHash lHash = layerHash(measHash);
88 if (static_cast<unsigned int>(lHash) < m_pars.layers.size()) {
89 return localToGlobalTrans(ctx, lHash) * stripLayer(lHash).localStripPosition(stripNumber(measHash));
90 }
91 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" The layer hash "<<static_cast<unsigned int>(lHash)
92 <<" is out of range. Maximum range "<<m_pars.layers.size());
93 return Amg::Vector3D::Zero();
94}
Amg::Vector3D localStripPosition(unsigned int stripum, bool phiView=false) const
Returns the position of the strip centre expressed in the frame of the local readout plane.

◆ surface() [1/4]

const Acts::Surface & MuonGMR4::MuonReadoutElement::surface ( ) const
finaloverrideinherited

Returns the surface associated to the readout element plane.

Definition at line 97 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

97{ return surface(geoTransformHash()); }
const Acts::Surface & surface() const override final
Returns the surface associated to the readout element plane.

◆ surface() [2/4]

Acts::Surface & MuonGMR4::MuonReadoutElement::surface ( )
finaloverrideinherited

◆ surface() [3/4]

Acts::Surface & MuonGMR4::MuonReadoutElement::surface ( const IdentifierHash & hash)
inherited

Definition at line 100 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

100{ return *surfacePtr(hash); }
std::shared_ptr< Acts::Surface > surfacePtr

◆ surface() [4/4]

const Acts::Surface & MuonGMR4::MuonReadoutElement::surface ( const IdentifierHash & hash) const
inherited

Returns the sufrface associated to a wire / measurement plane in the detector.

Definition at line 99 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

99{ return *surfacePtr(hash); }

◆ surfacePtr()

std::shared_ptr< Acts::Surface > MuonGMR4::MuonReadoutElement::surfacePtr ( const IdentifierHash & hash) const
inherited

Returns the pointer associated to a certain wire / plane.

Definition at line 89 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

89 {
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
93 <<" is unknown to "<<idHelperSvc()->toStringDetEl(identify()));
94 return nullptr;
95}

◆ thickness()

double MuonGMR4::MmReadoutElement::thickness ( ) const
finaloverride

Overload from the Acts::DetectorElement (2 * halfheight)

◆ toStation()

const Amg::Transform3D & MuonGMR4::MuonReadoutElement::toStation ( const ActsTrk::DetectorAlignStore * alignStore) const
protectedinherited

Returns the local -> global transformation to go from the volume center origin.

Definition at line 59 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

59 {
60 return getMaterialGeom()->getAbsoluteTransform(alignStore ? alignStore->geoModelAlignment.get() : nullptr);
61}
std::shared_ptr< GeoAlignmentStore > geoModelAlignment
Store containing the aligned GeoModel nodes.

◆ transform()

const Acts::Transform3 & MuonGMR4::MuonReadoutElement::transform ( const Acts::GeometryContext & gctx) const
finaloverrideinherited

Returns the transformation to the origin of the chamber coordinate system.

Definition at line 85 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

85 {
86 const ActsTrk::GeometryContext *gctx = anygctx.get<const ActsTrk::GeometryContext *>();
87 return localToGlobalTrans(*gctx, geoTransformHash());
88}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_args

const defineArgs MuonGMR4::MuonReadoutElement::m_args {}
privateinherited

◆ m_chambLink

const Chamber* MuonGMR4::MuonReadoutElement::m_chambLink {nullptr}
privateinherited

◆ m_chIdx

◆ m_detElHash

IdentifierHash MuonGMR4::MuonReadoutElement::m_detElHash {}
privateinherited

Cache of the detector element hash.

Definition at line 200 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h.

200{};

◆ m_idHelper

const MmIdHelper& MuonGMR4::MmReadoutElement::m_idHelper {idHelperSvc()->mmIdHelper()}
private

Definition at line 132 of file MmReadoutElement.h.

virtual const MmIdHelper & mmIdHelper() const =0
access to CscIdHelper

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonGMR4::MuonReadoutElement::m_idHelperSvc {"Muon::MuonIdHelperSvc/MuonIdHelperSvc", "MuonReadoutElement"}
privateinherited

Definition at line 196 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h.

196{"Muon::MuonIdHelperSvc/MuonIdHelperSvc", "MuonReadoutElement"};

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_localToGlobalCaches

TransformCacheMap MuonGMR4::MuonReadoutElement::m_localToGlobalCaches
privateinherited

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_msSectorLink

const SpectrometerSector* MuonGMR4::MuonReadoutElement::m_msSectorLink {}
privateinherited

Pointer to the associated MS-sector & MuonChamber.

Definition at line 216 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h.

216{};

◆ m_multilayer

const int MuonGMR4::MmReadoutElement::m_multilayer {m_idHelper.multilayer(identify())}
private

Definition at line 134 of file MmReadoutElement.h.

134{m_idHelper.multilayer(identify())};
const MmIdHelper & m_idHelper

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_pars

parameterBook MuonGMR4::MmReadoutElement::m_pars {}
private

Definition at line 130 of file MmReadoutElement.h.

130{};

◆ m_stEta

int MuonGMR4::MuonReadoutElement::m_stEta {-1}
privateinherited

Cache the station eta of the identifier.

Definition at line 206 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h.

206{-1};

◆ m_stName

int MuonGMR4::MuonReadoutElement::m_stName {-1}
privateinherited

Cache the station name of the identifier.

Definition at line 204 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h.

204{-1};

◆ m_stPhi

int MuonGMR4::MuonReadoutElement::m_stPhi {-1}
privateinherited

Cache the station phi of the identifier.

Definition at line 208 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h.

208{-1};

◆ m_surfaces

ActsTrk::SurfaceCacheSet MuonGMR4::MuonReadoutElement::m_surfaces
privateinherited

Cache of all associated surfaces.

Definition at line 214 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h.


The documentation for this class was generated from the following files: