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

Readout element to describe the Monitored Drift Tube (Mdt) chambers Mdt chambers usually comrpise out of two packs consisting out of 3 or 4 tube layers which are separated by a space frame onto which they are glued. More...

#include <MdtReadoutElement.h>

Inheritance diagram for MuonGMR4::MdtReadoutElement:
Collaboration diagram for MuonGMR4::MdtReadoutElement:

Classes

struct  defineArgs
 Declare the define args as concatination of the parameters to describe the chamber and the defineArgs from the MuonReadoutElement holding the Identifier && GeoModel objects. More...
struct  parameterBook
 Set of parameters to describe a MDT chamber. More...

Public Member Functions

 MdtReadoutElement (defineArgs &&args)
 Constructor with the define arguments.
virtual ~MdtReadoutElement ()
 Destructor.
const parameterBookgetParameters () const
 Get a const reference to the parameter book.
ActsTrk::DetectorType detectorType () const override final
 Overload the detector type.
double thickness () const override final
 Overload from the Acts::DetectorElement (2 * halfheight)
StatusCode initElement () override final
 Overload from MuonReadoutElement.
unsigned multilayer () const
 Returns the multi layer of the readout element [1;\2].
unsigned numLayers () const
 Returns how many tube layers are inside the multi layer [1;4].
unsigned numTubesInLay () const
 Returns the number of tubes in a layer.
IdentifierHash measurementHash (const Identifier &measId) const override final
 Constructs the measurement hash from the full measurement Identifier.
IdentifierHash layerHash (const Identifier &measId) const override final
 Projects the measurement hash onto the layerHash mainly used to access the plane surface in the center of each tube layer.
Identifier measurementId (const IdentifierHash &measHash) const override final
 Back conversion of the measurement hash towards a full identifier Tube & layer number are extracted from the hash and combined with the mising Identifier fields from the readout element.
bool isValid (const IdentifierHash &measHash) const
 Checks whether the passed meaurement hash corresponds to a valid tube described by the readout element.
bool isBarrel () const
 States whether the chamber is built into the barrel or not.
double tubePitch () const
 Returns the pitch between 2 tubes in a layer.
double innerTubeRadius () const
 Returns the inner tube radius.
double tubeRadius () const
 Adds the thickness of the tube wall onto the radius.
double moduleWidthS () const
 Returns the length of the bottom edge of the chamber (short width)
double moduleWidthL () const
 Returns the length of the top edge of the chamber (top width)
double moduleHeight () const
 Returns the height of the chamber (Distance bottom - topWidth)
double moduleThickness () const
 Returns the thickness of the chamber.
Amg::Vector3D globalTubePos (const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
 Returns the position of the tube mid point in the ATLAS coordinate frame.
Amg::Vector3D globalTubePos (const ActsTrk::GeometryContext &ctx, const IdentifierHash &hash) const
 Returns the position of the tube mid point in the ATLAS coordinate frame.
Amg::Vector3D readOutPos (const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
 Returns the endpoint of the tube where the readout card is mounted in the ATLAS coordinate frame.
Amg::Vector3D readOutPos (const ActsTrk::GeometryContext &ctx, const IdentifierHash &hash) const
 Returns the endpoint of the tube where the readout card is mounted in the ATLAS coordinate frame.
Amg::Vector3D highVoltPos (const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
 Returns the endpoint of the tube connected to the high voltage in the ATLAS coordinate frame.
Amg::Vector3D highVoltPos (const ActsTrk::GeometryContext &ctx, const IdentifierHash &hash) const
 Returns the endpoint of the tube connected to the high voltage in the ATLAS coordinate frame.
double distanceToReadout (const ActsTrk::GeometryContext &ctx, const Identifier &measId, const Amg::Vector3D &globPoint) const
 Returns the distance to the readout card along the wire.
double distanceToReadout (const ActsTrk::GeometryContext &ctx, const IdentifierHash &measHash, const Amg::Vector3D &globPoint) const
 Returns the distance to the readout card along the wire.
double distanceToReadout (const IdentifierHash &measHash, const Amg::Vector3D &localPoint) const
 Returns the distance to the readout assuming that the parsed point is expressed in the local coordinate system of the tube.
double activeTubeLength (const IdentifierHash &hash) const
double tubeLength (const IdentifierHash &hash) const
double wireLength (const IdentifierHash &hash) const
double uncutTubeLength (const IdentifierHash &tubeHash) const
 Returns the uncut tube length.
void setComplementaryReadoutEle (const MdtReadoutElement *other)
 Set the link to the second readout element inside the muon station.
Amg::Vector3D bLineReferencePoint () const
 Returns the fixed point of the B-line & as-bult defromation model expressed in the as-built frame.
Amg::Vector3D localTubePos (const IdentifierHash &hash) const
 Returns the tube position in the chamber coordinate frame (Not applying the B-line corrections)
Amg::Transform3D asBuiltRefFrame () const
 Returns the transformation to go into the reference frame of the as-buit & b-line model starting from the readout element frame.
const MdtReadoutElementcomplementaryRE () const
 Returns the pointer to the other readout element inside the muon station.
const GeoAlignableTransform * alignableTransform () const
 Return the alignable transform node of the readout element.
Identifier identify () const override final
 Return the ATLAS identifier.
IdentifierHash identHash () const
 Returns the hash of the readout element which is identical to the detector element hash provided by the associated idHelper.
int stationName () const
 Returns the stationName (BIS, BOS, etc) encoded into the integer.
int stationEta () const
 Returns the stationEta (positive A site, negative C 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 geometrical center point of the readout element.
Amg::Vector3D center (const ActsTrk::GeometryContext &ctx, const Identifier &id) const
 Returns the origin of the readout element's transform.
Amg::Vector3D center (const ActsTrk::GeometryContext &ctx, const IdentifierHash &hash) const
 Returns the origin of the readout element's transform.
Amg::Transform3D globalToLocalTransform (const ActsTrk::GeometryContext &ctx) const
 Returns the transformation from the global ATLAS coordinate system into the local coordinate system of the readout element.
Amg::Transform3D globalToLocalTransform (const ActsTrk::GeometryContext &ctx, const Identifier &id) const
 Returns the transformations from the ATLAS coordinate system into the local coordinate system of the readout sensor.
Amg::Transform3D globalToLocalTransform (const ActsTrk::GeometryContext &ctx, const IdentifierHash &hash) const
 Returns the transformations from the ATLAS coordinate system into the local coordinate system using the measurement / layer hash mechanism.
const Amg::Transform3DlocalToGlobalTransform (const ActsTrk::GeometryContext &ctx) const
 Returns the transformation from the local coordinate system of the readout element into the global ATLAS coordinate system (inverse of globalToLocal).
const Amg::Transform3DlocalToGlobalTransform (const ActsTrk::GeometryContext &ctx, const Identifier &id) const
 Returns the transformation from the local coordinate system of the readout element into the global ATLAS coordinate system (inverse of globalToLocal).
const Amg::Transform3DlocalToGlobalTransform (const ActsTrk::GeometryContext &ctx, const IdentifierHash &id) const
 Returns the transformation from the local coordinate system of the readout element into the global ATLAS coordinate system (inverse of globalToLocal).
const Amg::Transform3DlocalToGlobalTransform (const Acts::GeometryContext &gctx) const override final
 Wrapper function of the localToGlobalTransform method to satisfy the Acts::IDetectorElementBase interface.
const Acts::Surface & surface () const override final
 Returns the surface associated with the readout element.
Acts::Surface & surface () override final
 Returns the mutable surface associated with the readout element.
const Acts::Surface & surface (const IdentifierHash &hash) const
 Returns the surface associated with the transform of a given readout layer.
Acts::Surface & surface (const IdentifierHash &hash)
 Returns the mutable surface associated with the transform of a given readout layer.
std::shared_ptr< Acts::Surface > surfacePtr (const IdentifierHash &hash) const
 Returns the mutable surface pointer associated with the transform of a given readout layer.
std::vector< std::shared_ptr< Acts::Surface > > getSurfaces () const
 Returns all surfaces that are associated with the active readout planes.
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.
virtual bool isSensitive () const final override
 Returns whether the detector element is sensitive.
void releaseUnAlignedTrfs () const
 Release all transforms from the memory that are not connected with a geometry context but cached by the readout element itself.
unsigned int storeAlignedTransforms (const ActsTrk::DetectorAlignStore &store) const override final
 Construct the final aligned transformations and store them in the alignment store.
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 measurementHash (unsigned layerNumber, unsigned tubeNumber)
 Constructs a Measurement hash from layer && tube number.
static unsigned tubeNumber (const IdentifierHash &hash)
 Transforms the measurement hash into a tube number ranging from [0; numTubeInLay() -1].
static unsigned layerNumber (const IdentifierHash &hash)
 Transforms the measurement hash into a tube-layer number ranging from [0; numLayers() -1].
static IdentifierHash layerHash (const IdentifierHash &measHash)
 Static method to tranform a measurement hash into a layer hash.

Protected Member Functions

const Amg::Transform3DtoStation (const ActsTrk::DetectorAlignStore *alignStore) const
 Returns the transformation from the GeoModel tree and applies the A-lines if a valid alignment store pointer is provided.
template<class MuonDetImpl>
StatusCode insertTransform (const IdentifierHash &hash)
 Constructs the TransformDetEleCache associated with the hash of the given Mdt tube or strip layer.
StatusCode createGeoTransform ()
 Creates the TransformCacheDetEle corresponding the generic local -> global transformation of the readout element.
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.
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.

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 tubeSide_t = MdtAsBuiltPar::tubeSide_t
 Moves the wire endpoints according to the as-built model.
using TransformCacheMap = std::vector<std::unique_ptr<ActsTrk::TransformCache>>
 The transform caches corresponding to the surfaces of the tubes and gas gap planes.

Private Member Functions

Amg::Transform3D toChamberLayer (const IdentifierHash &hash) const
 Returns the transformation into the rest frame of the tube x-axis: Pointing towards the next layer y-axis: Pointing parallel to the wire layer z-axis: Pointing along the wire.
Amg::Transform3D toTubeFrame (const IdentifierHash &hash) const
 Returns the transformation into the rest frame of the tube x-axis: Pointing towards the next layer y-axis: Pointing parallel to the wire layer z-axis: Pointing along the wire.
Amg::Transform3D fromIdealToDeformed (const IdentifierHash &tubeHash, const ActsTrk::DetectorAlignStore *store) const
 Applies the B & as-built parameters.
Amg::Vector3D wireEndpointAsBuilt (const MdtAsBuiltPar &asBuilt, const IdentifierHash &tubeHash, const Amg::Vector3D &nominalEnd, const tubeSide_t side) const
Amg::Vector3D applyBlineCorrections (const BLinePar &bline, const Amg::Vector3D &localTubeEndPoint, const Amg::Vector3D &fixedPoint, const double thickness) const
 Apply the B-line model correction to a tube endpoint.
const ActsTrk::TransformCachetransformCache (const IdentifierHash &measHash) const
 Returns the pointer to the TransformCache associated with this measurement hash.
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

parameterBook m_pars {}
 defining parameter set
const MdtIdHelperm_idHelper {idHelperSvc()->mdtIdHelper()}
 Detector identifier helper to quickly extract the ID fields.
int m_stML {m_idHelper.multilayer(identify())}
 Identifier index of the multilayer (1-2)
bool m_isBarrel {m_idHelper.isBarrel(identify())}
 Flag defining whether the chamber is barrel or not.
const MdtReadoutElementm_reOtherMl {this}
 Complementary readout element.
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {"Muon::MuonIdHelperSvc/MuonIdHelperSvc", "MuonReadoutElement"}
 IdHelperSvc for Identifier manipulation.
const defineArgs m_args {}
IdentifierHash m_detElHash {}
 Cache of the detector element hash.
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 {}
std::unique_ptr< ActsTrk::TransformCachem_centralTrfCache {}
 Cache of the transform of the readout element itself.
Muon::MuonStationIndex::ChIndex m_chIdx {Muon::MuonStationIndex::ChIndex::ChUnknown}
 Cache the chamber index of the Identifier.
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

Readout element to describe the Monitored Drift Tube (Mdt) chambers Mdt chambers usually comrpise out of two packs consisting out of 3 or 4 tube layers which are separated by a space frame onto which they are glued.

Each readout element covers the description of one such pack called a multilayer. The multilayers have an internal numbering of tubes and layers. The first tube of the first layer is defined to be closed to the IP.

Definition at line 25 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h.

Member Typedef Documentation

◆ TransformCacheMap

using MuonGMR4::MuonReadoutElement::TransformCacheMap = std::vector<std::unique_ptr<ActsTrk::TransformCache>>
privateinherited

The transform caches corresponding to the surfaces of the tubes and gas gap planes.

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

◆ tubeSide_t

Moves the wire endpoints according to the as-built model.

Parameters
asBuiltAs-built model parameters
tubeHashMeasurement hash of the considered tube
nominalEndTube end of a nominally uncut tube
sideDoes the end represent positive or negative z

Definition at line 263 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h.

Constructor & Destructor Documentation

◆ MdtReadoutElement()

MuonGMR4::MdtReadoutElement::MdtReadoutElement ( defineArgs && args)

Constructor with the define arguments.

Definition at line 41 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

42 : MuonReadoutElement(args),
43 m_pars{std::move(args)} {
44}
MuonReadoutElement(const defineArgs &args)
Constructor taking the basic define arguments.

◆ ~MdtReadoutElement()

MuonGMR4::MdtReadoutElement::~MdtReadoutElement ( )
virtualdefault

Destructor.

Member Function Documentation

◆ activeTubeLength()

double MuonGMR4::MdtReadoutElement::activeTubeLength ( const IdentifierHash & hash) const

Definition at line 173 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

173 {
174 const unsigned int layer = layerNumber(hash);
175 const unsigned int tube = tubeNumber(hash);
176 const MdtTubeLayer& zeroT{*m_pars.tubeLayers[layer]};
177 return 2. * zeroT.tubeHalfLength(tube);
178}
static unsigned tubeNumber(const IdentifierHash &hash)
Transforms the measurement hash into a tube number ranging from [0; numTubeInLay() -1].
static unsigned layerNumber(const IdentifierHash &hash)
Transforms the measurement hash into a tube-layer number ranging from [0; numLayers() -1].
@ layer
Definition HitInfo.h:79

◆ alignableTransform()

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

Return the alignable transform node of the readout element.

◆ applyBlineCorrections()

Amg::Vector3D MuonGMR4::MdtReadoutElement::applyBlineCorrections ( const BLinePar & bline,
const Amg::Vector3D & localTubeEndPoint,
const Amg::Vector3D & fixedPoint,
const double thickness ) const
private

Apply the B-line model correction to a tube endpoint.

Parameters
blineSet of b-line parameters
localTubeEndPointEndpoint of the tube to correct
fixedPointPoint in the chamber that's invariant in the b-line model
thicknessThickness of the two multilayers

Definition at line 320 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

323 {
324
325 using Parameter = BLinePar::Parameter;
326 Amg::Vector3D deformedPos{localTubeEndPoint};
327 // MDT deformations like tube bow: bz,bp,bn bend the tube while the wire endpoints are not affected
328 // => the wire keeps it's nominal straight line trajectory but it is not concentric to the tube
329 // ==> in this function bz, bp and bn are ignored or set to 0
330 // MDT deformations that extend/contract the wire longitudinally (while keeping it straight):
331 // delta_s from eg and tr are irrelevant for the tube geometry
332 // and for the wire trajectory => set to 0 here
333 // (should be applied as a correction to the
334 // tube lenght => tube surface bounds
335 // =++>>>> effect in tracking just through the gravitational sagging TOTALLY NEGLIGIBLE=> ignore)
336 // pg is irrelevant for tracking purposes and (at least for the endcaps) is applies to the internal bars only, not to the tubes !!!
337 // =++>>>> IGNORE IT
338 // ep,en: bend the tube by moving (differently) the endplugs ===> the wire straight trajectory is moved w.r.t. the nominal one
339 // in addition the tubes keep their nominal position at the center => the wire is not concentric to
340 // the tube delta_s from ep,en must also be considered for the implementation of the realistic tube
341 // trajectory induced by ep,en
342 // tw,sp,sn,pg (for deltaT and deltaZ) are geometrical effects, that impact on tracking and keep the wire straight.
343 const double chamberHeight = std::max(moduleHeight(), m_reOtherMl->moduleHeight());
344
345
346 // NOTE s0,z0,t0 are the coord. in the amdb frame of this point: the origin of the frame can be different than the fixed point for
347 // deformations s0mdt,z0mdt,t0mdt
348 // (always equal to the point at lowest t,z and s=0 of the MDT stack)
349 ATH_MSG_VERBOSE( "** In "<<__func__<<" - moduleWidthS " << moduleWidthS()<<", moduleWidthL: "
350 <<moduleWidthL() <<", height: "<<chamberHeight<<", thickness: " <<chamberThickness << "." );
351 ATH_MSG_VERBOSE( "** In "<<__func__<<" - going to correct for B-line the position of Point at " << Amg::toString(localTubeEndPoint));
352
353 double s0mdt = localTubeEndPoint.x(); // always I think !
354 if (std::abs(fixedPoint.x()) > 0.01) {
355 s0mdt = localTubeEndPoint.x() - fixedPoint.x();
356 }
357 double z0mdt = localTubeEndPoint.y();
358 // unless in the D section of this station there's a dy diff. from 0 for the innermost MDT multilayer (sometimes
359 // in the barrel)
360 // unless in the D section of this station there's a dz diff. from 0 for the innermost MDT multilayer (often in barrel)
361 if (std::abs(fixedPoint.y()) > 0.01) {
362 z0mdt = localTubeEndPoint.y() - fixedPoint.y();
363 }
364 double t0mdt = localTubeEndPoint.z();
365 if (std::abs(fixedPoint.z()) > 0.01) {
366 t0mdt = localTubeEndPoint.z() - fixedPoint.z();
367 }
368 if (z0mdt < 0 || t0mdt < 0) {
369 ATH_MSG_WARNING(""<<__func__<<": correcting the local position of a point outside the mdt station (2 multilayers) volume -- RE "
370 << idHelperSvc()->toStringDetEl(identify()) << " local point: szt=" <<Amg::toString(localTubeEndPoint)
371 << " fixedPoint " <<Amg::toString(fixedPoint)<<", z0mdt: "<<z0mdt<<", t0mdt"<<t0mdt);
372 }
373 ATH_MSG_VERBOSE( "** In "<<__func__<<" - correct for offset of B-line fixed point " << s0mdt << " " << z0mdt << " " << t0mdt);
374
375 constexpr double amdbMargin = 1.*Gaudi::Units::cm;
376 const double width_actual = moduleWidthS() - amdbMargin + (moduleWidthL() - moduleWidthS()) * (z0mdt / chamberHeight);
377 const double s_rel = s0mdt / (width_actual / 2.);
378 const double z_rel = (z0mdt - chamberHeight / 2.) / (chamberHeight / 2.);
379 const double t_rel = (t0mdt - chamberThickness / 2.) / (chamberThickness / 2.);
380
381 ATH_MSG_VERBOSE( "** In "<<__func__<<" - width_actual: "<<width_actual<<", s_rel: "<<s_rel<<", z_rel: "<<z_rel
382 <<", t_rel:" << t_rel );
383 double ds{0.},dz{0.},dt{0.};
384
385 // sp, sn - cross plate sag out of plane
386 if ( bline.getParameter(Parameter::sp) || bline.getParameter(Parameter::sn)) {
387 double ztmp = z_rel * z_rel - 1;
388 dt += 0.5 * (bline.getParameter(Parameter::sp) + bline.getParameter(Parameter::sn)) * ztmp
389 + 0.5 * (bline.getParameter(Parameter::sp) - bline.getParameter(Parameter::sn)) * ztmp * s_rel;
390 }
391
392 // tw - twist
393 if (bline.getParameter(Parameter::tw)) {
394 dt -= bline.getParameter(Parameter::tw) * s_rel * z_rel;
395 dz += bline.getParameter(Parameter::tw) * s_rel * t_rel * chamberThickness / chamberHeight;
396 ATH_MSG_VERBOSE( "** In "<<__func__<<": tw=" << bline.getParameter(Parameter::tw) << " dt: "<<dt<<", dz: "<< dz );
397 }
398
399 constexpr double expansionScale = BLinePar::expansionScale;
400 // eg - global expansion
401 if (bline.getParameter(Parameter::eg)) {
402 double egppm = bline.getParameter(Parameter::eg) * expansionScale;
403 ds += 0.;
404 dz += z0mdt * egppm;
405 dt += t0mdt * egppm;
406 }
407
408 // ep, en - local expansion
409 //
410 // Imporant note: the chamber height and length, as they denoted in Christoph's talk,
411 // correspond to thickness and height parameters of this function;
412 //
413
414 if (bline.getParameter(Parameter::ep) || bline.getParameter(Parameter::en)) {
415 const double ep = bline.getParameter(Parameter::ep) * expansionScale;
416 const double en = bline.getParameter(Parameter::en) * expansionScale;
417 const double phi = 0.5 * (ep + en) * s_rel * s_rel + 0.5 * (ep - en) * s_rel;
418 const double localDt = phi * (t0mdt - chamberThickness / 2.);
419 const double localDz = phi * (z0mdt - chamberHeight / 2.);
420 dt += localDt;
421 dz += localDz;
422 }
423
424 ATH_MSG_VERBOSE( "posOnDefChamStraighWire: ds="<<ds<<",z="<<dz<<",t="<<dt);
425 deformedPos[0] = localTubeEndPoint[0] + ds;
426 deformedPos[1] = localTubeEndPoint[1] + dz;
427 deformedPos[2] = localTubeEndPoint[2] + dt;
428 return deformedPos;
429}
Scalar phi() const
phi method
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
float getParameter(const Parameter p) const
Returns a given parameter.
Definition BLinePar.h:40
static constexpr double expansionScale
Definition BLinePar.h:35
double moduleWidthL() const
Returns the length of the top edge of the chamber (top width)
double moduleHeight() const
Returns the height of the chamber (Distance bottom - topWidth)
double moduleWidthS() const
Returns the length of the bottom edge of the chamber (short width)
Identifier identify() const override final
Return the ATLAS identifier.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the pointer to the muonIdHelperSvc.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, 3, 1 > Vector3D

◆ asBuiltRefFrame()

Amg::Transform3D MuonGMR4::MdtReadoutElement::asBuiltRefFrame ( ) const

Returns the transformation to go into the reference frame of the as-buit & b-line model starting from the readout element frame.

Definition at line 219 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

219 {
220 return alignableTransform()->getDefTransform().inverse()*
221 getMaterialGeom()->getParent()->getX() *
222 getMaterialGeom()->getX();
223}
const GeoAlignableTransform * alignableTransform() const
Return the alignable transform node of the readout element.

◆ bLineReferencePoint()

Amg::Vector3D MuonGMR4::MdtReadoutElement::bLineReferencePoint ( ) const

Returns the fixed point of the B-line & as-bult defromation model expressed in the as-built frame.

Definition at line 233 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

233 {
234 /* The fix point is the point that's closest to the interaction point.
235 / Recall that the readout element origin is expressed in the geometric centre &
236 the x-axis points upwards. The point is then transformed into the Muon station frame */
237 const MdtReadoutElement* refEle{multilayer() == 1 ? this : m_reOtherMl};
238 return refEle->asBuiltRefFrame()*(-0.5*( refEle->moduleThickness() *Amg::Vector3D::UnitX() +
239 (stationEta() >0 || !isBarrel() ? 1. : -1.)*refEle->moduleHeight() * Amg::Vector3D::UnitZ()));
240}
bool isBarrel() const
States whether the chamber is built into the barrel or not.
MdtReadoutElement(defineArgs &&args)
Constructor with the define arguments.
unsigned multilayer() const
Returns the multi layer of the readout element [1;\2].
int stationEta() const
Returns the stationEta (positive A site, negative C site)

◆ center() [1/3]

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

Returns the geometrical center point of the readout element.

Parameters
ctxGeometry context to take the alignment corrections into account

◆ center() [2/3]

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

Returns the origin of the readout element's transform.

Parameters
ctxGeometry context to take the alignment corrections into account
idIdentifier of the measurement channel to be retrieved

◆ center() [3/3]

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

Returns the origin of the readout element's transform.

Parameters
ctxGeometry context to take the alignment corrections into account
hashMeasurement hash of the transform to be retrieved

◆ 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.

It's used for the retrieval of the chamber meta data containing the information about the number of sensors, their sepration 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)

◆ complementaryRE()

const MdtReadoutElement * MuonGMR4::MdtReadoutElement::complementaryRE ( ) const

Returns the pointer to the other readout element inside the muon station.

◆ createGeoTransform()

StatusCode MuonGMR4::MuonReadoutElement::createGeoTransform ( )
protectedinherited

Creates the TransformCacheDetEle corresponding the generic local -> global transformation of the readout element.

Needs to be called by each technology during initialization

Check that the alignable node has been assigned

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

32 {
34 if(!alignableTransform()) {
35 ATH_MSG_FATAL("The readout element "<<idHelperSvc()->toStringDetEl(identify())<<" has no assigned alignable node");
36 return StatusCode::FAILURE;
37 }
38 m_centralTrfCache = std::make_unique<TransformCacheDetEle<MuonReadoutElement>>(geoTransformHash(), this);
39 return StatusCode::SUCCESS;
40}
#define ATH_MSG_FATAL(x)
std::unique_ptr< ActsTrk::TransformCache > m_centralTrfCache
Cache of the transform of the readout element itself.
static IdentifierHash geoTransformHash()
Returns the hash that is associated with the surface cache holding the transformation that is placing...

◆ detectorType()

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

Overload the detector type.

Implements ActsTrk::IDetectorElementBase.

Definition at line 89 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h.

89 {
91 }
@ Mdt
MuonSpectrometer.

◆ distanceToReadout() [1/3]

double MuonGMR4::MdtReadoutElement::distanceToReadout ( const ActsTrk::GeometryContext & ctx,
const Identifier & measId,
const Amg::Vector3D & globPoint ) const

Returns the distance to the readout card along the wire.

Parameters
ctxGeometry context carrying the current alignment
measIdIdentifier of the tube for which the distance is to be calculated
globPointExternal point in the ATLAS coordinate frame

◆ distanceToReadout() [2/3]

double MuonGMR4::MdtReadoutElement::distanceToReadout ( const ActsTrk::GeometryContext & ctx,
const IdentifierHash & measHash,
const Amg::Vector3D & globPoint ) const

Returns the distance to the readout card along the wire.

Parameters
ctxGeometry context carrying the current alignment
measHashMeasurement hash of the tube for which the distance is to be calculated
globPointExternal point in the ATLAS coordinate frame

Definition at line 191 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

193 {
194 return distanceToReadout(measHash, globalToLocalTransform(ctx, measHash) * globPoint);
195
196}
double distanceToReadout(const ActsTrk::GeometryContext &ctx, const Identifier &measId, const Amg::Vector3D &globPoint) const
Returns the distance to the readout card along the wire.
Amg::Transform3D globalToLocalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the global ATLAS coordinate system into the local coordinate system o...

◆ distanceToReadout() [3/3]

double MuonGMR4::MdtReadoutElement::distanceToReadout ( const IdentifierHash & measHash,
const Amg::Vector3D & localPoint ) const

Returns the distance to the readout assuming that the parsed point is expressed in the local coordinate system of the tube.

I.e. the wire points along the z-axis

Parameters
measHashIdentifierHash of the tube
localPointExternal local point inside the tube (No check is made whether that's the case).

The position of the readout chip is at the negative tube side

Definition at line 197 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

198 {
200 const unsigned int layer = layerNumber(measHash);
201 const unsigned int tube = tubeNumber(measHash);
202 const MdtTubeLayer& zeroT{*m_pars.tubeLayers[layer]};
203 const double readOutPos = m_pars.readoutSide * zeroT.tubeHalfLength(tube);
204 return std::abs(readOutPos - localPoint.z());
205}
Amg::Vector3D readOutPos(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the endpoint of the tube where the readout card is mounted in the ATLAS coordinate frame.

◆ fromIdealToDeformed()

Amg::Transform3D MuonGMR4::MdtReadoutElement::fromIdealToDeformed ( const IdentifierHash & tubeHash,
const ActsTrk::DetectorAlignStore * store ) const
private

Applies the B & as-built parameters.

No deformation parameters were parsed at all

No deformation parameters were stored for this particular readout element

Relative sign to calculate the thickness. If multilayer == 1, we want the lower point and the upper point otherwise.

Move the tube into the center

Apply as-built correction

Switch tube ends back to MGM coordinates

Definition at line 440 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

441 {
442#ifdef SIMULATIONBASE
443 ATH_MSG_VERBOSE("No deformed transformation available "<<idHelperSvc()->toString(measurementId(tubeHash))
444 <<"store address to make the compiler happy: "<<store);
445 return Amg::Transform3D::Identity();
446#else
448 if (!store || !store->internalAlignment) {
449 ATH_MSG_VERBOSE("No deformed transformation available "<<idHelperSvc()->toString(measurementId(tubeHash)));
450 return Amg::Transform3D::Identity();
451 }
452 using ChamberDistortions = MdtAlignmentStore::chamberDistortions;
453
455 const ChamberDistortions distortPars = static_cast<const MdtAlignmentStore&>(*store->internalAlignment).getDistortion(identify());
456 if (!distortPars) {
457 ATH_MSG_VERBOSE("No set of deformation parameters is in the DB for "<<idHelperSvc()->toString(measurementId(tubeHash)));
458 return Amg::Transform3D::Identity();
459 }
460
461 const Amg::Vector3D fixedPoint{bLineReferencePoint()};
462
463
464 const double height = std::max(moduleHeight(), m_reOtherMl->moduleHeight()) -
465 (tubePitch() - 2. * tubeRadius());
466
467 const Amg::Transform3D toAMDB{asBuiltRefFrame()};
470 const double relSign = (multilayer() == 1 ? -1. : 1.);
471
472 const double modHalfThick{0.5*relSign*moduleThickness()},
473 modHalTHickO{-0.5*relSign*m_reOtherMl->moduleThickness()};
474
475 const double thickness = relSign*( (toAMDB* (modHalfThick*Amg::Vector3D::UnitX())) -
476 (m_reOtherMl->asBuiltRefFrame()*(modHalTHickO* Amg::Vector3D::UnitX()))).z();
477
478
479 Amg::Vector3D idealTube = localTubePos(tubeHash);
481 idealTube[Amg::y] = 0.;
482
483 Amg::Vector3D positiveEnd = toAMDB * (idealTube + 0.5 * uncutTubeLength(tubeHash) * Amg::Vector3D::UnitY());
484 Amg::Vector3D negativeEnd = toAMDB * (idealTube - 0.5 * uncutTubeLength(tubeHash) * Amg::Vector3D::UnitY());
486 if (distortPars.asBuilt) {
487 positiveEnd = wireEndpointAsBuilt(*distortPars.asBuilt, tubeHash, positiveEnd, tubeSide_t::POS);
488 negativeEnd = wireEndpointAsBuilt(*distortPars.asBuilt, tubeHash, negativeEnd, tubeSide_t::NEG);
489 }
490 Amg::Vector3D positiveEndBline{positiveEnd};
491 Amg::Vector3D negativeEndBline{negativeEnd};
492 if (distortPars.bLine) {
493 positiveEndBline = applyBlineCorrections(*distortPars.bLine, positiveEndBline, fixedPoint, thickness);
494 negativeEndBline = applyBlineCorrections(*distortPars.bLine, negativeEndBline, fixedPoint, thickness);
495 }
496
497 ATH_MSG_VERBOSE("Calculate the deformation parameters of "<<idHelperSvc()->toString(measurementId(tubeHash))
498 <<", ideal tube "<<Amg::toString(idealTube)
499 <<", fixed point "<<Amg::toString(fixedPoint)
500 <<"/ "<<Amg::toString(alignableTransform()->getDefTransform() * fixedPoint)
501 <<", thickness: "<<thickness<<", height: "<<height);
502
503 const Amg::Transform3D fromAMDB{toAMDB.inverse()};
505 positiveEnd = fromAMDB * positiveEnd;
506 negativeEnd = fromAMDB * negativeEnd;
507 positiveEndBline = fromAMDB * positiveEndBline;
508 negativeEndBline = fromAMDB * negativeEndBline;
509
510 // Calculate deformation. Make sure that the wire length stays the same.
511 // Code in positionOnDeformedChamber does not provide this by default.
512 // Break transformation into translation of the wire center and the rotation of the wire
513 // Move to the coordinate system originated at the wire center, then rotate the wire, then
514 // move wire center to the new position
515 const Amg::Transform3D to_center{Amg::getTranslate3D(-idealTube)};
516 const Amg::Transform3D from_center{Amg::getTranslate3D( 0.5 * (positiveEndBline + negativeEndBline))};
517 const Amg::Vector3D old_direction = (positiveEnd - negativeEnd).unit();
518 const Amg::Vector3D new_direction = (positiveEndBline - negativeEndBline).unit();
519 const Amg::Vector3D rotation_vector = old_direction.cross(new_direction);
520
521 Amg::Transform3D deformedTransform{Amg::Transform3D::Identity()};
522 if (rotation_vector.mag() > 10. * std::numeric_limits<double>::epsilon()) {
523 const Amg::AngleAxis3D wire_rotation(std::asin(rotation_vector.mag()), rotation_vector.unit());
524 deformedTransform = from_center * wire_rotation * to_center;
525 } else {
526 deformedTransform = from_center * to_center;
527 }
528 ATH_MSG_VERBOSE("To center "<<GeoTrf::toString(to_center)<<" from: "<<GeoTrf::toString(from_center)<<
529 " -- direction: "<<GeoTrf::toString(old_direction)<<" vs. "<<GeoTrf::toString(new_direction)
530 <<" --> rot: "<<GeoTrf::toString(rotation_vector)<<" ==> "<<GeoTrf::toString(deformedTransform,true));
531 return deformedTransform;
532#endif
533}
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
double thickness() const override final
Overload from the Acts::DetectorElement (2 * halfheight)
Amg::Vector3D localTubePos(const IdentifierHash &hash) const
Returns the tube position in the chamber coordinate frame (Not applying the B-line corrections)
Amg::Vector3D bLineReferencePoint() const
Returns the fixed point of the B-line & as-bult defromation model expressed in the as-built frame.
double tubeRadius() const
Adds the thickness of the tube wall onto the radius.
Amg::Transform3D asBuiltRefFrame() const
Returns the transformation to go into the reference frame of the as-buit & b-line model starting from...
double moduleThickness() const
Returns the thickness of the chamber.
double uncutTubeLength(const IdentifierHash &tubeHash) const
Returns the uncut tube length.
Amg::Vector3D wireEndpointAsBuilt(const MdtAsBuiltPar &asBuilt, const IdentifierHash &tubeHash, const Amg::Vector3D &nominalEnd, const tubeSide_t side) const
Amg::Vector3D applyBlineCorrections(const BLinePar &bline, const Amg::Vector3D &localTubeEndPoint, const Amg::Vector3D &fixedPoint, const double thickness) const
Apply the B-line model correction to a tube endpoint.
Identifier measurementId(const IdentifierHash &measHash) const override final
Back conversion of the measurement hash towards a full identifier Tube & layer number are extracted f...
double tubePitch() const
Returns the pitch between 2 tubes in a layer.
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
Eigen::AngleAxisd AngleAxis3D
Eigen::Affine3d Transform3D
std::string toString(const MuonGMR4::MuonReadoutElement *re)
TestStore store
Definition TestStore.cxx:23

◆ 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 41 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

41 {
42 static const IdentifierHash hash{static_cast<unsigned>(~0)-1};
43 return hash;
44}

◆ getParameters()

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

Get a const reference to the parameter book.

Definition at line 45 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

45{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 146 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

146 {
147 std::vector<std::shared_ptr<Acts::Surface>> surfaces{};
148 surfaces.reserve(m_surfaces.size());
149 for (const std::unique_ptr<SurfaceCache>& cache : m_surfaces) {
150 if (cache->hash() != geoTransformHash()) {
151 surfaces.push_back(cache->getSurface());
152 ATH_MSG_VERBOSE("Add surface "<<idHelperSvc()->toString(cache->identify())
153 <<std::endl<<(surfaces.back()->bounds()));
154 }
155 }
156 return surfaces;
157}

◆ globalToLocalTransform() [1/3]

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

Returns the transformation from the global ATLAS coordinate system into the local coordinate system of the readout element.

The local axes are oriented such that x-axis: Is parallel to the sensors measuring the eta coordinate (e.g. parallel to the Mdt tube wire) y-axis: Is parallel to the sensors measuring the phi coordinate (e.g. to the next tube wire) z-axis: Points vertically outwards the chamber (e.g. radially outwards for barrel or to the endcap cavern wall)

Parameters
ctxGeometry context to take the alignment corrections into account

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

71 {
73}

◆ globalToLocalTransform() [2/3]

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

Returns the transformations from the ATLAS coordinate system into the local coordinate system of the readout sensor.

The orientiation of the axes depends on whether the sensor is described by a plane or by a tube wire. In the former case, the axes are oriented such that x-axis: Points to the next eta sensor such that local-x always constrains the precision coordinate y-axis: Points to the next phi sensor such that local y always constains the coordinate along the precision sensor z-axis: Is the cross-product of the other two For Mdt tubes the axis orientiation is such that x-axis: Points to the next tube in the same tube-layer y-axis: Points to the next tube-layer plane z-axis: Points along the tube wire

Parameters
ctxGeometry context to take the alignment corrections into account
idIdentifier of the measurement for which the transform shall be retrieved

◆ globalToLocalTransform() [3/3]

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

Returns the transformations from the ATLAS coordinate system into the local coordinate system using the measurement / layer hash mechanism.

For strip-like detectors a layer hash must always be parsed. For the Mdts a measurement or layer hash can be parsed depending on whether the plane transform or the particular tube transform shall be retrieved.

Parameters
ctxGeometry context to take the alignment corrections into account.
hashHash of the transform to fetch (Measurement or layer hash).

◆ globalTubePos() [1/2]

Amg::Vector3D MuonGMR4::MdtReadoutElement::globalTubePos ( const ActsTrk::GeometryContext & ctx,
const Identifier & measId ) const

Returns the position of the tube mid point in the ATLAS coordinate frame.

Parameters
ctxGeometry context carrying the current alignment
measIdIdentifier of the tube for which the position is to be retrieved

◆ globalTubePos() [2/2]

Amg::Vector3D MuonGMR4::MdtReadoutElement::globalTubePos ( const ActsTrk::GeometryContext & ctx,
const IdentifierHash & hash ) const

Returns the position of the tube mid point in the ATLAS coordinate frame.

Parameters
ctxGeometry context carrying the current alignment
hashMeasurement hash of the tube for which the position is to be retrieved

Definition at line 144 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

145 {
146 return localToGlobalTransform(ctx, hash).translation();
147}
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...

◆ highVoltPos() [1/2]

Amg::Vector3D MuonGMR4::MdtReadoutElement::highVoltPos ( const ActsTrk::GeometryContext & ctx,
const Identifier & measId ) const

Returns the endpoint of the tube connected to the high voltage in the ATLAS coordinate frame.

Parameters
ctxGeometry context carrying the current alignment
measIdIdentifier of the tube for which the position is to be retrieved

◆ highVoltPos() [2/2]

Amg::Vector3D MuonGMR4::MdtReadoutElement::highVoltPos ( const ActsTrk::GeometryContext & ctx,
const IdentifierHash & hash ) const

Returns the endpoint of the tube connected to the high voltage in the ATLAS coordinate frame.

Parameters
ctxGeometry context carrying the current alignment
hashMeasurement hash of the tube for which the position is to be retrieved

Definition at line 157 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

158 {
159 return localToGlobalTransform(ctx, hash) *
160 (-0.5*activeTubeLength(hash) * m_pars.readoutSide * Amg::Vector3D::UnitZ());
161}

◆ identHash()

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

Returns the hash of the readout element which is identical to the detector element hash provided by the associated idHelper.

◆ identify()

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

Return the ATLAS identifier.

Implements ActsTrk::IDetectorElementBase.

◆ idHelperSvc()

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

Returns the pointer to the muonIdHelperSvc.

◆ initElement()

StatusCode MuonGMR4::MdtReadoutElement::initElement ( )
finaloverridevirtual

Overload from MuonReadoutElement.

First check whether we're having tubes

Create bounds that are representing the surface planes of each tube layer & the readout element itself

Coordinate system of the trapezoid is in the center while the tubes are defined w.r.t. to the chamber edge. Move first tube into the proper position

Cache the transformations to the chamber layers

Cache the transformations to the tube layers

Ensure that all linear transformations are rotations

Ensure that all tubes have the same pitch

Implements MuonGMR4::MuonReadoutElement.

Definition at line 51 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

51 {
54 if (!numLayers() || !numTubesInLay()) {
55 ATH_MSG_FATAL("The readout element "<< idHelperSvc()->toStringDetEl(identify())<<" has no tubes. Please check "<<std::endl<<m_pars);
56 return StatusCode::FAILURE;
57 }
58 if (m_pars.tubePitch<=tubeRadius()) {
59 ATH_MSG_FATAL("The tubes of "<<idHelperSvc()->toStringDetEl(identify())<<" will fall together on a single point. Please check "<<std::endl<<m_pars);
60 return StatusCode::FAILURE;
61 }
62#ifndef SIMULATIONBASE
64 ATH_CHECK(planeSurfaceFactory(geoTransformHash(), m_pars.boundFactory->makeBounds<Acts::TrapezoidBounds>(m_pars.shortHalfX,
65 m_pars.longHalfX,
66 m_pars.halfY)));
67#endif
70
71 std::optional<Amg::Vector3D> prevLayPos{std::nullopt};
72
73 for (unsigned int lay =1 ; lay <= numLayers() ; ++lay) {
75 const IdentifierHash layHash = measurementHash(lay,0);
77#ifdef SIMULATIONBASE_REMOVEPLANESURFACE
78 ATH_CHECK(planeSurfaceFactory(layHash, m_pars.boundFactory->makeBounds<Acts::TrapezoidBounds>(m_pars.shortHalfX,
79 m_pars.longHalfX,
80 m_pars.halfY)));
81#endif
83 std::optional<Amg::Vector3D> prevTubePos{std::nullopt};
84 MdtTubeLayer& layer = *m_pars.tubeLayers[lay-1];
85
86 for (unsigned int tube = 1; tube <= numTubesInLay(); ++ tube) {
87 const IdentifierHash idHash = measurementHash(lay,tube);
88 if (m_pars.removedTubes.count(idHash)) {
89 prevTubePos = std::nullopt;
90 continue;
91 }
93#ifndef SIMULATIONBASE
94 ATH_CHECK(strawSurfaceFactory(idHash, m_pars.boundFactory->
95 makeBounds<Acts::LineBounds>(tubeRadius(),
96 0.5*tubeLength(idHash))));
97#endif
99 GeoTrf::Transform3D tubeFrame = layer.tubeTransform(tubeNumber(idHash));
100 const AmgSymMatrix(3) tubeRot = tubeFrame.linear();
101 if (std::abs(tubeRot.determinant()- 1.) > std::numeric_limits<float>::epsilon()){
102 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" Transformation matrix is not a pure rotation for "<<
103 idHelperSvc()->toStringDetEl(identify())<<" in layer: "<<lay<<", tube: "<<tube
104 <<Amg::toString(tubeFrame));
105 return StatusCode::FAILURE;
106 }
108 const Amg::Vector3D tubePos = tubeFrame.translation();
109
110 constexpr double pitchTolerance = 20. * Gaudi::Units::micrometer;
111 if (prevTubePos) {
112 const double dR = std::abs((tubePos - (*prevTubePos)).z());
113 if (std::abs(dR - tubePitch()) > pitchTolerance) {
114 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" Detected irregular tube in "<<
115 idHelperSvc()->toStringDetEl(identify())<<" in layer: "<<lay<<", tube: "<<tube
116 <<". Expected tube pitch: "<<tubePitch()<<" measured tube pitch: "
117 <<dR<<" tube position: "<<Amg::toString(tubePos,2)
118 <<" previous: "<<Amg::toString((*prevTubePos), 2));
119 return StatusCode::FAILURE;
120 }
121 }
122 if (prevLayPos && tube == 1) {
123 const double dR = (tubePos - (*prevLayPos)).mag();
124 if (std::abs(dR - tubePitch()) > pitchTolerance) {
125 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" Detected irregular layer pitch in "<<
126 idHelperSvc()->toStringDetEl(identify())<<" for layer "<<lay
127 <<". Expected tube pitch: "<<tubePitch()<<" measured tube pitch: "
128 <<dR<<" tube position: "<<Amg::toString(tubePos,2)
129 <<" previous:"<<Amg::toString((*prevLayPos), 2));
130 }
131 }
132 if (tube == 1) {
133 prevLayPos = std::make_optional<Amg::Vector3D>(tubePos);
134 }
135 prevTubePos = std::make_optional<Amg::Vector3D>(tubePos);
136 }
137 }
138#ifndef SIMULATIONBASE
139 m_pars.boundFactory.reset();
140#endif
141 return StatusCode::SUCCESS;
142}
Scalar mag() const
mag method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define AmgSymMatrix(dim)
if(febId1==febId2)
double tubeLength
#define z
unsigned numLayers() const
Returns how many tube layers are inside the multi layer [1;4].
unsigned numTubesInLay() const
Returns the number of tubes in a layer.
static IdentifierHash measurementHash(unsigned layerNumber, unsigned tubeNumber)
Constructs a Measurement hash from layer && tube number.
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...
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...
StatusCode createGeoTransform()
Creates the TransformCacheDetEle corresponding the generic local -> global transformation of the read...
StatusCode insertTransform(const IdentifierHash &hash)
Constructs the TransformDetEleCache associated with the hash of the given Mdt tube or strip layer.

◆ 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)

◆ innerTubeRadius()

double MuonGMR4::MdtReadoutElement::innerTubeRadius ( ) const

Returns the inner tube radius.

◆ insertTransform()

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

Constructs the TransformDetEleCache associated with the hash of the given Mdt tube or strip layer.

The method is templated over the specific implementation of the readout element as the TransformCacheDetEle implements the assembly of the final transforms. The method returns a failure of an instance for the same hash has already been invoked earlier

Parameters
hashMeasurement / layer hash to identifier the transform of the readout layer

◆ isBarrel()

bool MuonGMR4::MdtReadoutElement::isBarrel ( ) const

States whether the chamber is built into the barrel or not.

◆ isSensitive()

virtual bool MuonGMR4::MuonReadoutElement::isSensitive ( ) const
inlinefinaloverridevirtualinherited

Returns whether the detector element is sensitive.

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

206{ return true; }

◆ isValid()

bool MuonGMR4::MdtReadoutElement::isValid ( const IdentifierHash & measHash) const

Checks whether the passed meaurement hash corresponds to a valid tube described by the readout element.

Parameters
measHashAssociated measurement hash encoding tube & layer number

◆ layerHash() [1/2]

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

Projects the measurement hash onto the layerHash mainly used to access the plane surface in the center of each tube layer.

Parameters
measIdIdentifier of an associated Mdt measurement

Implements MuonGMR4::MuonReadoutElement.

◆ layerHash() [2/2]

IdentifierHash MuonGMR4::MdtReadoutElement::layerHash ( const IdentifierHash & measHash)
static

Static method to tranform a measurement hash into a layer hash.

Parameters
measHashMeasurement corresponding to this readout element

◆ layerNumber()

unsigned MuonGMR4::MdtReadoutElement::layerNumber ( const IdentifierHash & hash)
static

Transforms the measurement hash into a tube-layer number ranging from [0; numLayers() -1].

Parameters
hashMeasurement hash to transform

◆ localToGlobalTransform() [1/4]

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

Wrapper function of the localToGlobalTransform method to satisfy the Acts::IDetectorElementBase interface.

Parameters
gctxActs representation of the GeometryContext

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

78 {
79 const GeometryContext *gctx = anygctx.get<const GeometryContext *>();
81}

◆ localToGlobalTransform() [2/4]

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

Returns the transformation from the local coordinate system of the readout element into the global ATLAS coordinate system (inverse of globalToLocal).

Parameters
ctxGeometry context to take the alignment corrections into account.

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

74 {
76}

◆ localToGlobalTransform() [3/4]

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

Returns the transformation from the local coordinate system of the readout element into the global ATLAS coordinate system (inverse of globalToLocal).

Parameters
ctxGeometry context to take the alignment corrections into account
idIdentifier of the measurement for which the transform shall be retrieved

◆ localToGlobalTransform() [4/4]

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

Returns the transformation from the local coordinate system of the readout element into the global ATLAS coordinate system (inverse of globalToLocal).

Parameters
ctxGeometry context to take the alignment corrections into account
hashHash of the transform to fetch (Measurement or layer hash).

◆ localTubePos()

Amg::Vector3D MuonGMR4::MdtReadoutElement::localTubePos ( const IdentifierHash & hash) const

Returns the tube position in the chamber coordinate frame (Not applying the B-line corrections)

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

149 {
150 return toTubeFrame(hash).translation();
151}
Amg::Transform3D toTubeFrame(const IdentifierHash &hash) const
Returns the transformation into the rest frame of the tube x-axis: Pointing towards the next layer y-...

◆ measurementHash() [1/2]

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

Constructs the measurement 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

Parameters
measIdIdentifier of an associated Mdt measurement

Implements MuonGMR4::MuonReadoutElement.

◆ measurementHash() [2/2]

IdentifierHash MuonGMR4::MdtReadoutElement::measurementHash ( unsigned layerNumber,
unsigned tubeNumber )
static

Constructs a Measurement hash from layer && tube number.

Parameters
layerNumberNumber of the tube layer [1;numLayers()]
tubenumberNumber of the tube inside the layer [1;numTubesInLay()]

◆ measurementId()

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

Back conversion of the measurement hash towards a full identifier Tube & layer number are extracted from the hash and combined with the mising Identifier fields from the readout element.

Parameters
measHashMeasurement hash to transform

Implements MuonGMR4::MuonReadoutElement.

Definition at line 46 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

46 {
47 return m_idHelper.channelID(identify(), multilayer(),
48 layerNumber(measHash) + 1,
49 tubeNumber(measHash) + 1);
50}
const MdtIdHelper & m_idHelper
Detector identifier helper to quickly extract the ID fields.

◆ moduleHeight()

double MuonGMR4::MdtReadoutElement::moduleHeight ( ) const

Returns the height of the chamber (Distance bottom - topWidth)

◆ moduleThickness()

double MuonGMR4::MdtReadoutElement::moduleThickness ( ) const

Returns the thickness of the chamber.

◆ moduleWidthL()

double MuonGMR4::MdtReadoutElement::moduleWidthL ( ) const

Returns the length of the top edge of the chamber (top width)

◆ moduleWidthS()

double MuonGMR4::MdtReadoutElement::moduleWidthS ( ) const

Returns the length of the bottom edge of the chamber (short width)

◆ 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 167 of file AthMessaging.h.

168{
169 MsgStream* ms = m_msg_tls.get();
170 if (!ms) {
171 if (!m_initialized.test_and_set()) initMessaging();
172 ms = new MsgStream(m_imsg,m_nm);
173 m_msg_tls.reset( ms );
174 }
175
176 ms->setLevel (m_lvl);
177 return *ms;
178}
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 182 of file AthMessaging.h.

183{ 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 user did not set explicit message level we have to initialize
154 // the messaging and retrieve the default via the MessageSvc.
155 if (m_lvl==MSG::NIL && !m_initialized.test_and_set()) initMessaging();
156
157 if (m_lvl <= lvl) {
158 msg() << lvl;
159 return true;
160 } else {
161 return false;
162 }
163}

◆ msSector()

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

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

◆ multilayer()

unsigned MuonGMR4::MdtReadoutElement::multilayer ( ) const

Returns the multi layer of the readout element [1;\2].

◆ numLayers()

unsigned MuonGMR4::MdtReadoutElement::numLayers ( ) const

Returns how many tube layers are inside the multi layer [1;4].

◆ numTubesInLay()

unsigned MuonGMR4::MdtReadoutElement::numTubesInLay ( ) const

Returns the number of tubes in a layer.

◆ planeSurfaceFactory()

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

Invokes the factory to create plane surfaces && to associate them with the particular transform cache.

Parameters
hashLayer hash of the readout plane of interest
lBoundsBounds describing the rectangle or trapezoidal surface's dimensions

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

119 {
120
121 //get the local to global transform cache
122 const TransformCache* cache = transformCache(hash);
123 if (!cache) {
124 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" - "<<idHelperSvc()->toString(identify())
125 <<" no transform cache available for hash "<<hash);
126 return StatusCode::FAILURE;
127 }
128 auto insert_itr = m_surfaces.insert(std::make_unique<SurfaceCache>(cache));
129 if(!insert_itr.second){
130 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" - "<<idHelperSvc()->toString(identify())
131 <<" Insertion to muon surface cache failed for hash "<<hash);
132 return StatusCode::FAILURE;
133 }
134 //Create a plane surface for the surface cache
135 (*insert_itr.first)->setSurface(Acts::Surface::makeShared<Acts::PlaneSurface>(pBounds, **insert_itr.first));
136 return StatusCode::SUCCESS;
137}
const ActsTrk::TransformCache * transformCache(const IdentifierHash &measHash) const
Returns the pointer to the TransformCache associated with this measurement hash.

◆ readOutPos() [1/2]

Amg::Vector3D MuonGMR4::MdtReadoutElement::readOutPos ( const ActsTrk::GeometryContext & ctx,
const Identifier & measId ) const

Returns the endpoint of the tube where the readout card is mounted in the ATLAS coordinate frame.

Parameters
ctxGeometry context carrying the current alignment
measIdIdentifier of the tube for which the position is to be retrieved

◆ readOutPos() [2/2]

Amg::Vector3D MuonGMR4::MdtReadoutElement::readOutPos ( const ActsTrk::GeometryContext & ctx,
const IdentifierHash & hash ) const

Returns the endpoint of the tube where the readout card is mounted in the ATLAS coordinate frame.

Parameters
ctxGeometry context carrying the current alignment
hashMeasurement hash of the tube for which the position is to be retrieved

Definition at line 152 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

153 {
154 return localToGlobalTransform(ctx, hash) *
155 (0.5*activeTubeLength(hash) * m_pars.readoutSide * Amg::Vector3D::UnitZ());
156}

◆ releaseUnAlignedTrfs()

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

Release all transforms from the memory that are not connected with a geometry context but cached by the readout element itself.

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

49 {
50 for (const auto& cache : m_localToGlobalCaches) {
51 if (cache){
52 cache->releaseNominalCache();
53 }
54 }
55 m_centralTrfCache->releaseNominalCache();
56}

◆ setChamberLink()

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

Sets the link to the enclosing chamber.

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

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

◆ setComplementaryReadoutEle()

void MuonGMR4::MdtReadoutElement::setComplementaryReadoutEle ( const MdtReadoutElement * other)

Set the link to the second readout element inside the muon station.

Parameters
otherpointer to the readoutElement

Definition at line 207 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

207 {
209}

◆ 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 142 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonReadoutElement.cxx.

142 {
143 m_msSectorLink = envelope;
144}
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 C 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 MuonGMR4::MuonReadoutElement::storeAlignedTransforms ( const ActsTrk::DetectorAlignStore & store) const
finaloverridevirtualinherited

Construct the final aligned transformations and store them in the alignment store.

Returns the number of how many transformations have been stored

Implements ActsTrk::IDetectorElement.

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

58 {
59 if (store.detType != detectorType()) return 0;
60 unsigned int aligned{1};
61 m_centralTrfCache->getTransform(&store);
62 for (const auto& cache : m_localToGlobalCaches) {
63 if (cache) {
64 cache->getTransform(&store);
65 }
66 ++aligned;
67 }
68 return aligned;
69}
virtual DetectorType detectorType() const =0
Returns the detector element type.

◆ strawSurfaceFactory()

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

Invokes the factory to create straw surfaces && to associate them with the particular transform cache.

Parameters
hashMeasurement hash of the tube of interest
lBoundsSurface bound object describing the straw radius and the active tube length

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

96 {
97
98 //get the local to global transform cache
99 const TransformCache* cache = transformCache(hash);
100 if (!cache) {
101 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" - "<<idHelperSvc()->toString(identify())
102 <<" no transform cache available for hash "<<hash);
103 return StatusCode::FAILURE;
104 }
105
106 auto insert_itr = m_surfaces.insert(std::make_unique<SurfaceCache>(cache));
107 if(!insert_itr.second){
108 ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" - "<<idHelperSvc()->toString(identify())
109 <<" Insertion to muon surface cache failed for hash "<<hash);
110 return StatusCode::FAILURE;
111 }
112 //Create straw surface for the surface cache
113 (*insert_itr.first)->setSurface(Acts::Surface::makeShared<Acts::StrawSurface>(lBounds, **insert_itr.first));
114 return StatusCode::SUCCESS;
115
116}

◆ surface() [1/4]

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

Returns the surface associated with the readout element.

It is placed in the center of the readout element's volume and has the volumes surface bounds

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

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

◆ surface() [2/4]

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

Returns the mutable surface associated with the readout element.

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

91{ return surface(geoTransformHash()); }

◆ surface() [3/4]

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

Returns the mutable surface associated with the transform of a given readout layer.

(E.g. tube or the strip plane)

Parameters
hashHash of the surface to fetch (Measurement or layer hash).

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

93{ 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 surface associated with the transform of a given readout layer.

(E.g. tube or the strip plane)

Parameters
hashHash of the surface to fetch (Measurement or layer hash).

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

92{ return *surfacePtr(hash); }

◆ surfacePtr()

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

Returns the mutable surface pointer associated with the transform of a given readout layer.

(E.g. tube or the strip plane)

Parameters
hashHash of the surface to fetch (Measurement or layer hash).

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

82 {
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
86 <<" is unknown to "<<idHelperSvc()->toStringDetEl(identify()));
87 return nullptr;
88}

◆ thickness()

double MuonGMR4::MdtReadoutElement::thickness ( ) const
finaloverridevirtual

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

Implements MuonGMR4::MuonReadoutElement.

◆ toChamberLayer()

Amg::Transform3D MuonGMR4::MdtReadoutElement::toChamberLayer ( const IdentifierHash & hash) const
private

Returns the transformation into the rest frame of the tube x-axis: Pointing towards the next layer y-axis: Pointing parallel to the wire layer z-axis: Pointing along the wire.

Definition at line 162 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

162 {
163 const unsigned int layer = layerNumber(hash);
164 const MdtTubeLayer& zeroT{*m_pars.tubeLayers[layer]};
165 return zeroT.layerTransform();
166}

◆ toStation()

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

Returns the transformation from the GeoModel tree and applies the A-lines if a valid alignment store pointer is provided.

The local coordinate system in GeoModel differs from the system used by the localToGlobaTransformations. It is referred to the AMDB coordinate system used to describe the MS in Run 1-3 x-axis: Points along the thickness of the readout element (e.g. radially outwards for barrel chambers or along global Z for detector mounted in the endcaps) y-axis: Points along the edge which is parallel to the eta sensors z-axis: Points along towards the next eta sensor

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

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

◆ toTubeFrame()

Amg::Transform3D MuonGMR4::MdtReadoutElement::toTubeFrame ( const IdentifierHash & hash) const
private

Returns the transformation into the rest frame of the tube x-axis: Pointing towards the next layer y-axis: Pointing parallel to the wire layer z-axis: Pointing along the wire.

Definition at line 167 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

167 {
168 const unsigned int layer = layerNumber(hash);
169 const unsigned int tube = tubeNumber(hash);
170 const MdtTubeLayer& zeroT{*m_pars.tubeLayers[layer]};
171 return zeroT.tubeTransform(tube);
172}

◆ transformCache()

const ActsTrk::TransformCache * MuonGMR4::MuonReadoutElement::transformCache ( const IdentifierHash & measHash) const
privateinherited

Returns the pointer to the TransformCache associated with this measurement hash.

Parameters
measHashMeasurement hash for which the cache shall be returned

◆ tubeLength()

double MuonGMR4::MdtReadoutElement::tubeLength ( const IdentifierHash & hash) const

Definition at line 185 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

185 {
186 return activeTubeLength(hash) + 2.*m_pars.deadLength;
187}

◆ tubeNumber()

unsigned MuonGMR4::MdtReadoutElement::tubeNumber ( const IdentifierHash & hash)
static

Transforms the measurement hash into a tube number ranging from [0; numTubeInLay() -1].

Parameters
hashMeasurement hash to transform

◆ tubePitch()

double MuonGMR4::MdtReadoutElement::tubePitch ( ) const

Returns the pitch between 2 tubes in a layer.

◆ tubeRadius()

double MuonGMR4::MdtReadoutElement::tubeRadius ( ) const

Adds the thickness of the tube wall onto the radius.

◆ uncutTubeLength()

double MuonGMR4::MdtReadoutElement::uncutTubeLength ( const IdentifierHash & tubeHash) const

Returns the uncut tube length.

Definition at line 179 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

179 {
180 const unsigned int layer = layerNumber(tubeHash);
181 const unsigned int tube = tubeNumber(tubeHash);
182 const MdtTubeLayer& zeroT{*m_pars.tubeLayers[layer]};
183 return 2.*zeroT.uncutHalfLength(tube);
184}

◆ wireEndpointAsBuilt()

Amg::Vector3D MuonGMR4::MdtReadoutElement::wireEndpointAsBuilt ( const MdtAsBuiltPar & asBuilt,
const IdentifierHash & tubeHash,
const Amg::Vector3D & nominalEnd,
const tubeSide_t side ) const
private

Definition at line 250 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

253 {
254
255
256 ATH_MSG_VERBOSE( "Applying as-built parameters for chamber " << idHelperSvc()->toString(measurementId(tubeHash)));
257
258
260 using multilayer_t = MdtAsBuiltPar::multilayer_t;
261 const multilayer_t ml = (multilayer() == 1) ? multilayer_t::ML1 : multilayer_t::ML2;
262
263 const IdentifierHash refLayer{measurementHash((ml == multilayer_t::ML1) ? numLayers() : 1, 1)};
264 const Amg::Vector3D refTube{localTubePos(refLayer)};
265
266
267 const double sideSign = 0.5*(1.- 2.*(side ==tubeSide_t::NEG));
268 // Compute the reference for the as-built parameters
269 const Amg::Vector3D reference_point = asBuiltRefFrame() *
270 Amg::Vector3D {refTube.x() + (1. - 2.*(ml == multilayer_t::ML2)) * tubeRadius(),
271 sideSign*uncutTubeLength(refLayer),
272 -0.5*moduleHeight()};
273 ATH_MSG_VERBOSE("AMDB transform "<<" "<<idHelperSvc()->toStringDetEl(identify())<<
274 " "<<GeoTrf::toString(asBuiltRefFrame(), true)<<", reference point: "<<Amg::toString(reference_point));
275
276
277 const int tubeLayer = layerNumber(tubeHash);
278 const int tube = tubeNumber(tubeHash);
279 const int layer_delta = ml == multilayer_t::ML1 ? numLayers() - tubeLayer : tubeLayer +1;
280
281
282 // Get the As-Built parameters for this ML and side of the chamber
283 const double zpitch = params.zpitch(ml, side);
284 const double ypitch = params.ypitch(ml, side);
285 const double stagg = params.stagg(ml, side);
286 const double alpha = params.alpha(ml, side);
287 const double y0 = params.y0(ml, side);
288 const double z0 = params.z0(ml, side);
289
290 const Amg::Transform3D planeRot{Amg::getRotateX3D(-alpha)};
291 ATH_MSG_VERBOSE("Rotation angle "<<(alpha/Gaudi::Units::deg));
292
293 // Find the vector from the reference_point to the endplug
294 // 0 for layer 1 and 3, 1 for layer 2 and 4
295 const double offset_stagg = 0.5 * zpitch * stagg * ( (layer_delta-1) % 2);
296 const Amg::Vector3D endPlug = planeRot * Amg::Vector3D{0.,
297 tube* zpitch + offset_stagg,
298 (layer_delta-1) * ypitch};
299
300 // Calculate x position, which varies for endcap chambers
301 const double xshift = sideSign*(uncutTubeLength(tubeHash) - uncutTubeLength(refLayer));
302 ATH_MSG_VERBOSE("Off set staggering "<<offset_stagg<<", layer_delta: "<<layer_delta<<", zpitch: "<<zpitch<<", ypitch: "<<ypitch
303 <<", xshift: "<<xshift);
304
305 Amg::Vector3D ret(reference_point.x() + xshift,
306 reference_point.y() + z0 + endPlug.y(),
307 reference_point.z() + y0 + endPlug.z());
308
309
310 if ((ret - wireEnd).mag() > 3. * Gaudi::Units::mm) {
311 ATH_MSG_WARNING("Large as-built correction for chamber " << idHelperSvc()->toString(measurementId(tubeHash))
312 << ", side "<< (side == tubeSide_t::POS ? "positive" : "negative")
313 << ", endpoint "<<Amg::toString(wireEnd)<<", return: "<<Amg::toString(ret));
314 }
315 ATH_MSG_VERBOSE((side == tubeSide_t::POS ? "positive" : "negative")<<" wire end has moved from "
316 <<Amg::toString(wireEnd)<<" to "<<Amg::toString(ret)<<" End plug: "<<Amg::toString(endPlug));
317 return ret;
318}
multilayer_t
MDT multi-layer index.
tubeSide_t
MDT tube side.
MdtAsBuiltPar::tubeSide_t tubeSide_t
Moves the wire endpoints according to the as-built model.
Amg::Transform3D getRotateX3D(double angle)
get a rotation transformation around X-axis

◆ wireLength()

double MuonGMR4::MdtReadoutElement::wireLength ( const IdentifierHash & hash) const

Definition at line 188 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx.

188 {
189 return tubeLength(hash) - 2.*m_pars.endPlugLength;
190}

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_centralTrfCache

std::unique_ptr<ActsTrk::TransformCache> MuonGMR4::MuonReadoutElement::m_centralTrfCache {}
privateinherited

Cache of the transform of the readout element itself.

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

274{};

◆ 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 263 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h.

263{};

◆ m_idHelper

const MdtIdHelper& MuonGMR4::MdtReadoutElement::m_idHelper {idHelperSvc()->mdtIdHelper()}
private

Detector identifier helper to quickly extract the ID fields.

Definition at line 283 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h.

virtual const MdtIdHelper & mdtIdHelper() const =0
access to MdtIdHelper

◆ m_idHelperSvc

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

IdHelperSvc for Identifier manipulation.

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

259{"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_isBarrel

bool MuonGMR4::MdtReadoutElement::m_isBarrel {m_idHelper.isBarrel(identify())}
private

Flag defining whether the chamber is barrel or not.

Definition at line 287 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h.

287{m_idHelper.isBarrel(identify())};

◆ 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 283 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h.

283{};

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_pars

parameterBook MuonGMR4::MdtReadoutElement::m_pars {}
private

defining parameter set

Definition at line 281 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h.

281{};

◆ m_reOtherMl

const MdtReadoutElement* MuonGMR4::MdtReadoutElement::m_reOtherMl {this}
private

Complementary readout element.

Definition at line 289 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h.

289{this};

◆ m_stEta

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

Cache the station eta of the identifier.

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

267{-1};

◆ m_stML

int MuonGMR4::MdtReadoutElement::m_stML {m_idHelper.multilayer(identify())}
private

Identifier index of the multilayer (1-2)

Definition at line 285 of file MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h.

285{m_idHelper.multilayer(identify())};

◆ m_stName

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

Cache the station name of the identifier.

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

265{-1};

◆ m_stPhi

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

Cache the station phi of the identifier.

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

269{-1};

◆ m_surfaces

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

Cache of all associated surfaces.

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


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