ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MuonR4::MuonSpacePoint Class Reference

The muon space point is the combination of two uncalibrated measurements one of them measures the eta and the other the phi coordinate. More...

#include <MuonSpacePoint.h>

Collaboration diagram for MuonR4::MuonSpacePoint:

Public Member Functions

 MuonSpacePoint (const ActsGeometryContext &gctx, const xAOD::UncalibratedMeasurement *primMeas, const xAOD::UncalibratedMeasurement *secondMeas=nullptr)
 
const xAOD::UncalibratedMeasurementprimaryMeasurement () const
 
const xAOD::UncalibratedMeasurementsecondaryMeasurement () const
 
const MuonGMR4::MuonChambermuonChamber () const
 
const Amg::Vector3DpositionInChamber () const
 
bool measuresPhi () const
 : Does the space point contain a phi measurement More...
 
bool measuresEta () const
 : Does the space point contain an eta measurement More...
 
const Identifieridentify () const
 : Identifier of the primary measurement More...
 
double driftRadius () const
 : Returns the size of the drift radius More...
 
Amg::Vector2D uncertainty () const
 : Returns the uncertainties on the space point More...
 
const AmgSymMatrix (2) &covariance() const
 
bool operator== (const MuonSpacePoint &other) const
 : Equality check by checking the prd pointers More...
 

Private Member Functions

 AmgSymMatrix (2) m_measCovariance
 : Measurement covariance If the spacePoint represents an 1D measurement the second coordinate is the length of the channel (e.g halfLength of the wire or of the associated strip) the uncertainty of the other coordinate, otherwise More...
 

Private Attributes

const xAOD::UncalibratedMeasurementm_primaryMeas {nullptr}
 
const xAOD::UncalibratedMeasurementm_secondaryMeas {nullptr}
 
Identifier m_id {Identifier::value_type{m_primaryMeas->identifier()}}
 
const MuonGMR4::MuonChamberm_chamber {xAOD::readoutElement(m_primaryMeas)->getChamber()}
 
Amg::Vector3D m_pos {Amg::Vector3D::Zero()}
 
double m_driftR {0.}
 Drift radius of the associated drift circle - if there's any in the space point. More...
 

Detailed Description

The muon space point is the combination of two uncalibrated measurements one of them measures the eta and the other the phi coordinate.

In cases, without a complementary measurment the spacepoint just represents the single measurement and hence has a uncertainty into the other direction corresponding to the half-length of the measurement channel

Definition at line 18 of file MuonSpacePoint.h.

Constructor & Destructor Documentation

◆ MuonSpacePoint()

MuonR4::MuonSpacePoint::MuonSpacePoint ( const ActsGeometryContext gctx,
const xAOD::UncalibratedMeasurement primMeas,
const xAOD::UncalibratedMeasurement secondMeas = nullptr 
)

Position of the measurements expressed in the chamber frame

Direction along which the measurement strips point to

Intersect the two channels to define the space point

Do nothing for the pads

In case of 2D measurements like sTgc-pads or BI-RPC strips we can directly take the covariance from the measurement itself. To indicate that the space point measures both, eta & phi coordinate set the secondary measurement to be the primary one

Definition at line 16 of file MuonSpacePoint.cxx.

18  :
19  m_primaryMeas{primaryMeas},
20  m_secondaryMeas{secondaryMeas} {
21  AmgSymMatrix(2) Jac{AmgSymMatrix(2)::Identity()}, uvcov {AmgSymMatrix(2)::Identity()};
22 
23  if (primaryMeas->type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
24  m_driftR = primaryMeas->localPosition<1>()[0];
25  }
26  if (primaryMeas->numDimensions() == 1) {
27  uvcov(0,0) = primaryMeas->localCovariance<1>()[0];
28  }
29  Jac.col(0) = xAOD::channelNormalInChamber(gctx, primaryMeas).block<2,1>(0,0);
30  if (secondaryMeas) {
32  const Amg::Vector3D pos1{xAOD::positionInChamber(gctx, primaryMeas)};
33  const Amg::Vector3D pos2{xAOD::positionInChamber(gctx, secondaryMeas)};
35  const Amg::Vector3D dir1{xAOD::channelDirInChamber(gctx, primaryMeas)};
36  const Amg::Vector3D dir2{xAOD::channelDirInChamber(gctx, secondaryMeas)};
38  m_pos = pos1 + Amg::intersect<3>(pos2,dir2, pos1, dir1).value_or(0) * dir1;
39  Jac.col(1) = xAOD::channelNormalInChamber(gctx, secondaryMeas).block<2,1>(0,0);
40  uvcov(1,1) = secondaryMeas->localCovariance<1>()[0];
41  } else {
42  m_pos = xAOD::positionInChamber(gctx, primaryMeas);
43  Jac.col(1) = xAOD::channelDirInChamber(gctx, primaryMeas).block<2,1>(0,0);
44  if (primaryMeas->type() == xAOD::UncalibMeasType::MdtDriftCircleType) {
45  const xAOD::MdtDriftCircle* dc = static_cast<const xAOD::MdtDriftCircle*>(primaryMeas);
46  uvcov(1,1) = 0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash());
47  } else if (primaryMeas->type() == xAOD::UncalibMeasType::RpcStripType) {
48  if (primaryMeas->numDimensions() == 1) {
49  const xAOD::RpcStrip* strip = static_cast<const xAOD::RpcStrip*>(primaryMeas);
50  uvcov(1,1) = strip->measuresPhi() ? 0.5* strip->readoutElement()->stripPhiLength():
51  0.5* strip->readoutElement()->stripEtaLength();
52  }
53  } else if (primaryMeas->type() == xAOD::UncalibMeasType::TgcStripType) {
54  const xAOD::TgcStrip* strip = static_cast<const xAOD::TgcStrip*>(primaryMeas);
55  if (strip->measuresPhi()) {
56  uvcov(1,1) = 0.5 * strip->readoutElement()->stripLayout(strip->gasGap()).stripLength(strip->channelNumber());
57  } else {
58  uvcov(1,1) = 0.5 * strip->readoutElement()->wireGangLayout(strip->gasGap()).stripLength(strip->channelNumber());
59  }
60  } else if (primaryMeas->type() == xAOD::UncalibMeasType::MMClusterType) {
61  const xAOD::MMCluster* clust = static_cast<const xAOD::MMCluster*>(primaryMeas);
62  uvcov(1,1) = 0.5 * clust->readoutElement()->stripLayer(clust->measurementHash()).design().stripLength(clust->channelNumber());
63  } else if (primaryMeas->type() == xAOD::UncalibMeasType::sTgcStripType) {
64  const xAOD::sTgcMeasurement* meas = static_cast<const xAOD::sTgcMeasurement*>(primaryMeas);
65  switch (meas->channelType()) {
66  case sTgcIdHelper::sTgcChannelTypes::Strip:
67  uvcov(1,1) = 0.5 * meas->readoutElement()->stripDesign(meas->measurementHash()).stripLength(meas->channelNumber());
68  break;
69  case sTgcIdHelper::sTgcChannelTypes::Wire:
70  uvcov(1,1) = 0.5 * meas->readoutElement()->wireDesign(meas->measurementHash()).stripLength(meas->channelNumber());
71  break;
73  case sTgcIdHelper::sTgcChannelTypes::Pad:
74  break;
75  }
76  }
77  uvcov(1,1) = std::pow(uvcov(1,1), 2);
78  }
79  Jac = Jac.inverse().eval();
83  if (primaryMeas->numDimensions() == 2) {
84  uvcov = xAOD::toEigen(primaryMeas->localCovariance<2>());
86  }
87  m_measCovariance = Jac * uvcov * Jac.transpose();
88  }

Member Function Documentation

◆ AmgSymMatrix() [1/2]

const MuonR4::MuonSpacePoint::AmgSymMatrix ( ) const &

◆ AmgSymMatrix() [2/2]

MuonR4::MuonSpacePoint::AmgSymMatrix ( )
inlineprivate

: Measurement covariance If the spacePoint represents an 1D measurement the second coordinate is the length of the channel (e.g halfLength of the wire or of the associated strip) the uncertainty of the other coordinate, otherwise

Definition at line 67 of file MuonSpacePoint.h.

67 {AmgSymMatrix(2)::Identity()};

◆ driftRadius()

double MuonR4::MuonSpacePoint::driftRadius ( ) const

: Returns the size of the drift radius

Definition at line 111 of file MuonSpacePoint.cxx.

111  {
112  return m_driftR;
113  }

◆ identify()

const Identifier & MuonR4::MuonSpacePoint::identify ( ) const

: Identifier of the primary measurement

Definition at line 108 of file MuonSpacePoint.cxx.

108  {
109  return m_id;
110  }

◆ measuresEta()

bool MuonR4::MuonSpacePoint::measuresEta ( ) const

: Does the space point contain an eta measurement

Definition at line 105 of file MuonSpacePoint.cxx.

105  {
107  }

◆ measuresPhi()

bool MuonR4::MuonSpacePoint::measuresPhi ( ) const

: Does the space point contain a phi measurement

Definition at line 102 of file MuonSpacePoint.cxx.

102  {
104  }

◆ muonChamber()

const MuonGMR4::MuonChamber * MuonR4::MuonSpacePoint::muonChamber ( ) const

Definition at line 96 of file MuonSpacePoint.cxx.

96  {
97  return m_chamber;
98  }

◆ operator==()

bool MuonR4::MuonSpacePoint::operator== ( const MuonSpacePoint other) const
inline

: Equality check by checking the prd pointers

Definition at line 50 of file MuonSpacePoint.h.

50  {
51  return primaryMeasurement() == other.primaryMeasurement() &&
52  secondaryMeasurement() == other.secondaryMeasurement();
53  }

◆ positionInChamber()

const Amg::Vector3D & MuonR4::MuonSpacePoint::positionInChamber ( ) const

Definition at line 99 of file MuonSpacePoint.cxx.

99  {
100  return m_pos;
101  }

◆ primaryMeasurement()

const xAOD::UncalibratedMeasurement * MuonR4::MuonSpacePoint::primaryMeasurement ( ) const

Definition at line 90 of file MuonSpacePoint.cxx.

90  {
91  return m_primaryMeas;
92  }

◆ secondaryMeasurement()

const xAOD::UncalibratedMeasurement * MuonR4::MuonSpacePoint::secondaryMeasurement ( ) const

Definition at line 93 of file MuonSpacePoint.cxx.

93  {
94  return m_secondaryMeas;
95  }

◆ uncertainty()

Amg::Vector2D MuonR4::MuonSpacePoint::uncertainty ( ) const

: Returns the uncertainties on the space point

Definition at line 114 of file MuonSpacePoint.cxx.

114  {
115  return Amg::Vector2D{ Amg::error(m_measCovariance,0),Amg::error(m_measCovariance,1) };
116  }

Member Data Documentation

◆ m_chamber

const MuonGMR4::MuonChamber* MuonR4::MuonSpacePoint::m_chamber {xAOD::readoutElement(m_primaryMeas)->getChamber()}
private

Definition at line 59 of file MuonSpacePoint.h.

◆ m_driftR

double MuonR4::MuonSpacePoint::m_driftR {0.}
private

Drift radius of the associated drift circle - if there's any in the space point.

Definition at line 69 of file MuonSpacePoint.h.

◆ m_id

Identifier MuonR4::MuonSpacePoint::m_id {Identifier::value_type{m_primaryMeas->identifier()}}
private

Definition at line 58 of file MuonSpacePoint.h.

◆ m_pos

Amg::Vector3D MuonR4::MuonSpacePoint::m_pos {Amg::Vector3D::Zero()}
private

Definition at line 61 of file MuonSpacePoint.h.

◆ m_primaryMeas

const xAOD::UncalibratedMeasurement* MuonR4::MuonSpacePoint::m_primaryMeas {nullptr}
private

Definition at line 55 of file MuonSpacePoint.h.

◆ m_secondaryMeas

const xAOD::UncalibratedMeasurement* MuonR4::MuonSpacePoint::m_secondaryMeas {nullptr}
private

Definition at line 56 of file MuonSpacePoint.h.


The documentation for this class was generated from the following files:
MuonR4::MuonSpacePoint::primaryMeasurement
const xAOD::UncalibratedMeasurement * primaryMeasurement() const
Definition: MuonSpacePoint.cxx:90
MuonR4::MuonSpacePoint::identify
const Identifier & identify() const
: Identifier of the primary measurement
Definition: MuonSpacePoint.cxx:108
MuonR4::MuonSpacePoint::m_chamber
const MuonGMR4::MuonChamber * m_chamber
Definition: MuonSpacePoint.h:59
xAOD::MMCluster_v1
Definition: MMCluster_v1.h:16
MuonGMR4::StripDesign::stripLength
virtual double stripLength(int stripNumb) const
Returns length of the strip.
xAOD::sTgcMeasurement_v1::measurementHash
IdentifierHash measurementHash() const
Returns the hash of the measurement channel w.r.t ReadoutElement.
Definition: sTgcMeasurement_v1.cxx:28
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
xAOD::TgcStrip_v1
Definition: TgcStrip_v1.h:16
MuonR4::MuonSpacePoint::muonChamber
const MuonGMR4::MuonChamber * muonChamber() const
Definition: MuonSpacePoint.cxx:96
MuonGMR4::sTgcReadoutElement::stripDesign
const StripDesign & stripDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
xAOD::MdtDriftCircle_v1::measurementHash
IdentifierHash measurementHash() const
Returns the hash of the measurement channel (tube (x) layer)
Definition: MdtDriftCircle_v1.cxx:28
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
MuonGMR4::MdtReadoutElement::activeTubeLength
double activeTubeLength(const IdentifierHash &hash) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MdtReadoutElement.cxx:179
xAOD::MMCluster_v1::readoutElement
const MuonGMR4::MmReadoutElement * readoutElement() const
Retrieve the associated MmReadoutElement.
MuonR4::MuonSpacePoint::m_primaryMeas
const xAOD::UncalibratedMeasurement * m_primaryMeas
Definition: MuonSpacePoint.h:55
Muon::IMuonIdHelperSvc::measuresPhi
virtual bool measuresPhi(const Identifier &id) const =0
returns whether channel measures phi or not
MuonR4::MuonSpacePoint::m_pos
Amg::Vector3D m_pos
Definition: MuonSpacePoint.h:61
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
xAOD::RpcStrip_v1
Definition: RpcStrip_v1.h:11
xAOD::channelDirInChamber
Amg::Vector3D channelDirInChamber(const ActsGeometryContext &gctx, const UncalibratedMeasurement *meas)
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:88
keylayer_zslicemap.strip
strip
Definition: keylayer_zslicemap.py:151
xAOD::MdtDriftCircle_v1::readoutElement
const MuonGMR4::MdtReadoutElement * readoutElement() const
Retrieve the associated MdtReadoutElement.
xAOD::UncalibMeasType::TgcStripType
@ TgcStripType
xAOD::sTgcMeasurement_v1::channelNumber
uint16_t channelNumber() const
Channel number of the Measurement.
MuonGMR4::sTgcReadoutElement::wireDesign
const WireGroupDesign & wireDesign(const Identifier &measId) const
Retrieves the readoutElement Layer given the Identifier/Hash.
MuonGMR4::MuonChamber::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the idHelperSvc.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonChamber.cxx:62
xAOD::sTgcMeasurement_v1::channelType
virtual sTgcChannelTypes channelType() const =0
Returns the channel type of the measurement (Pad/Wire/Strip)
xAOD::MMCluster_v1::channelNumber
uint16_t channelNumber() const
returns the number of the central strip
xAOD::positionInChamber
Amg::Vector3D positionInChamber(const ActsGeometryContext &gctx, const UncalibratedMeasurement *meas)
Returns the position of the uncalibrated muon measurement in the attached Muon chamber frame.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:50
xAOD::channelNormalInChamber
Amg::Vector3D channelNormalInChamber(const ActsGeometryContext &gctx, const UncalibratedMeasurement *meas)
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:115
MuonR4::MuonSpacePoint::m_driftR
double m_driftR
Drift radius of the associated drift circle - if there's any in the space point.
Definition: MuonSpacePoint.h:69
MuonR4::MuonSpacePoint::secondaryMeasurement
const xAOD::UncalibratedMeasurement * secondaryMeasurement() const
Definition: MuonSpacePoint.cxx:93
MuonGMR4::MmReadoutElement::stripLayer
const StripLayer & stripLayer(const Identifier &measId) const
MuonR4::MuonSpacePoint::m_id
Identifier m_id
Definition: MuonSpacePoint.h:58
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
xAOD::sTgcMeasurement_v1::readoutElement
const MuonGMR4::sTgcReadoutElement * readoutElement() const
Retrieve the associated sTgcReadoutElement.
xAOD::MMCluster_v1::measurementHash
IdentifierHash measurementHash() const
Returns the hash of the measurement channel.
Definition: MMCluster_v1.cxx:21
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGMR4::StripLayer::design
const StripDesign & design() const
Returns the underlying strip design.
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
MuonR4::MuonSpacePoint::m_secondaryMeas
const xAOD::UncalibratedMeasurement * m_secondaryMeas
Definition: MuonSpacePoint.h:56
xAOD::MdtDriftCircle_v1
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
Definition: MdtDriftCircle_v1.h:18
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
MuonR4::MuonSpacePoint::AmgSymMatrix
const AmgSymMatrix(2) &covariance() const
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
xAOD::sTgcMeasurement_v1
Definition: sTgcMeasurement_v1.h:19