ATLAS Offline Software
Loading...
Searching...
No Matches
MdtCalibInput Class Reference

#include <MdtCalibInput.h>

Collaboration diagram for MdtCalibInput:

Public Types

enum class  BFieldComp { alongWire = 0 , alongTrack = 1 }

Public Member Functions

 MdtCalibInput (const Identifier &id, const int16_t adc, const int16_t tdc, const MuonGMR4::MdtReadoutElement *reEle, const ActsTrk::GeometryContext &gctx)
 Minimal constructor in the PhaseII geomerty setup.
 MdtCalibInput (const Identifier &id, const int16_t adc, const int16_t tdc, const MuonGM::MdtReadoutElement *reEle)
 Minimal constructor in the legacy geomerty setup.
 MdtCalibInput (const MdtDigit &digit, const MuonGM::MuonDetectorManager &detMgr)
 Constructor taking the Mdt digit & the legacy II detector manager.
 MdtCalibInput (const MdtDigit &digit, const MuonGMR4::MuonDetectorManager &detMgr, const ActsTrk::GeometryContext &gctx)
 Constructor taking the Mdt digit & the Phase II detector manager.
 MdtCalibInput (const Muon::MdtPrepData &prd)
 Constructor taking the MdtPrepdata.
 MdtCalibInput (const xAOD::MdtDriftCircle &prd, const ActsTrk::GeometryContext &gctx)
 Constructor taking taking the xAOD::MdtDriftCircle.
 MdtCalibInput (MdtCalibInput &&other)=default
MdtCalibInputoperator= (MdtCalibInput &&other)=default
 ~MdtCalibInput ()
const Identifieridentify () const
 Returns the Identifier of the hit.
int16_t tdc () const
 Returns the tdc counts of the hit.
int16_t adc () const
 Returns the amount of accumulated charge.
const MuonGM::MdtReadoutElementlegacyDescriptor () const
 Returns the legacy readout element.
const MuonGMR4::MdtReadoutElementdecriptor () const
 Returns the R4 readout element.
const Amg::Vector3DclosestApproach () const
 Returns the point of closest approach to the wire.
void setClosestApproach (const Amg::Vector3D &approach)
 Sets the closest approach.
const Amg::Vector3DtrackDirection () const
 Returns the track direction (Can be zero)
void setTrackDirection (const Amg::Vector3D &trackDir, bool hasPhi)
 Sets the direction of the externally determined track.
bool trackDirHasPhi () const
 Returns whether the track has a phi constaint or not.
double timeOfFlight () const
 Returns the time of flight.
void setTimeOfFlight (const double toF)
 Sets the time of flight (Usually globPos.mag() * inverseSpeed of light)
double triggerTime () const
 Returns the trigger offset time.
void setTriggerTime (const double trigTime)
 Sets the trigger offset time.
double distanceToTrack () const
 Returns the distance to track (signed)
Amg::Vector2D projectMagneticField (const Amg::Vector3D &fieldInGlob) const
 Splits the B-field into the components that point along the transverse track direction & along the tube wire.
double signalPropagationDistance () const
 Calculates the distance that the signal has to travel along the wire.
const Trk::StraightLineSurfacelegacySurface () const
 Returns the assocaited ideal surface (Throw exception if no legacy RE is available)
const Amg::Vector3DsurfaceCenter () const
 Returns the center of the associated surface.
double tubeLength () const
 Returns the tube length.
double readOutSide () const
 Returns the sign of the readout position in local coordinates.
double innerTubeR () const
 Returns the inner tube radius.

Private Types

using ReadoutEle_t = std::variant<const MuonGM::MdtReadoutElement*, const MuonGMR4::MdtReadoutElement*>
 Variant type to store the legacy & Phase-II style readout geometry in a single variable.

Private Member Functions

const Amg::Transform3DlocalToGlobal () const
 Local to global transformation of the tube.
Amg::Vector3D center () const
 Translational part of the local -> global transform.

Private Attributes

Identifier m_id {}
 Tube identifier.
int16_t m_adc {0}
 Adc counts of the hit.
int16_t m_tdc {0}
 Tdc counts of the hit.
const ActsTrk::GeometryContextm_gctx {nullptr}
 Geometry context, needed to fetch the alignment.
ReadoutEle_t m_RE {}
 Pointer to the associated readout element.
IdentifierHash m_hash {}
 Measurement hash of the Identifier (needed for Phase II)
Amg::Vector3D m_approach {center()}
 Point of closest approach of the track.
Amg::Vector3D m_trackDir {Amg::Vector3D::Zero()}
 Global track direction.
bool m_trackHasPhi {false}
 Does the track direction contain a phi constraint.
double m_ToF {center().mag() * s_inverseSpeed}
double m_trigTime {0.}
 Trigger time.
double m_distToTrack {0.}
 Distance to track (signed)

Static Private Attributes

static constexpr double s_inverseSpeed {1. / Gaudi::Units::c_light}
 Time of flight.

Detailed Description

Definition at line 36 of file MdtCalibInput.h.

Member Typedef Documentation

◆ ReadoutEle_t

Variant type to store the legacy & Phase-II style readout geometry in a single variable.

Definition at line 161 of file MdtCalibInput.h.

Member Enumeration Documentation

◆ BFieldComp

enum class MdtCalibInput::BFieldComp
strong
Enumerator
alongWire 
alongTrack 

Definition at line 126 of file MdtCalibInput.h.

126 {
127 alongWire = 0,
128 alongTrack = 1,
129 };

Constructor & Destructor Documentation

◆ MdtCalibInput() [1/7]

MdtCalibInput::MdtCalibInput ( const Identifier & id,
const int16_t adc,
const int16_t tdc,
const MuonGMR4::MdtReadoutElement * reEle,
const ActsTrk::GeometryContext & gctx )

Minimal constructor in the PhaseII geomerty setup.

It takes all necessary ingredients to run later the calibration loop.

Parameters
idIdentifier of the hit to calibrate
adcRecorded adc counts from the tube
tdcRecorded tdc counts from the tube
detMgrPointer to the associated readout element
gctxGeometry context to globally align the tube within ATLAS

Definition at line 32 of file MdtCalibInput.cxx.

36 :
37 m_id{id},
38 m_adc{adc},
39 m_tdc{tdc},
40 m_gctx{&gctx},
41 m_RE{reEle},
42 m_hash{std::get<const MuonGMR4::MdtReadoutElement*>(m_RE)->measurementHash(m_id)} {}
int16_t tdc() const
Returns the tdc counts of the hit.
Identifier m_id
Tube identifier.
int16_t m_tdc
Tdc counts of the hit.
const ActsTrk::GeometryContext * m_gctx
Geometry context, needed to fetch the alignment.
IdentifierHash m_hash
Measurement hash of the Identifier (needed for Phase II)
int16_t adc() const
Returns the amount of accumulated charge.
ReadoutEle_t m_RE
Pointer to the associated readout element.
int16_t m_adc
Adc counts of the hit.

◆ MdtCalibInput() [2/7]

MdtCalibInput::MdtCalibInput ( const Identifier & id,
const int16_t adc,
const int16_t tdc,
const MuonGM::MdtReadoutElement * reEle )

Minimal constructor in the legacy geomerty setup.

It takes all necessary ingredients to run later the calibration loop.

Parameters
idIdentifier of the hit to calibrate
adcRecorded adc counts from the tube
tdcRecorded tdc counts from the tube
reElePointer to the associated readout element

Definition at line 50 of file MdtCalibInput.cxx.

53 :
54 m_id{id},
55 m_adc{adc},
56 m_tdc{tdc},
57 m_RE{reEle} {}

◆ MdtCalibInput() [3/7]

MdtCalibInput::MdtCalibInput ( const MdtDigit & digit,
const MuonGM::MuonDetectorManager & detMgr )

Constructor taking the Mdt digit & the legacy II detector manager.

Parameters
digitDigit containing all adc & tdc information
detMgrReference to the Detector manager to fetch the Proper readout element
gctxGeometry context to globally align the tube within ATLAS

Definition at line 59 of file MdtCalibInput.cxx.

60 :
61 MdtCalibInput(digit.identify(), digit.adc(), digit.tdc(),
62 detMgr.getMdtReadoutElement(digit.identify())) {}
MdtCalibInput(const Identifier &id, const int16_t adc, const int16_t tdc, const MuonGMR4::MdtReadoutElement *reEle, const ActsTrk::GeometryContext &gctx)
Minimal constructor in the PhaseII geomerty setup.
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)

◆ MdtCalibInput() [4/7]

MdtCalibInput::MdtCalibInput ( const MdtDigit & digit,
const MuonGMR4::MuonDetectorManager & detMgr,
const ActsTrk::GeometryContext & gctx )

Constructor taking the Mdt digit & the Phase II detector manager.

Parameters
digitDigit containing all adc & tdc information
detMgrReference to the Detector manager to fetch the Proper readout element
gctxGeometry context to globally align the tube within ATLAS

Definition at line 44 of file MdtCalibInput.cxx.

46 :
47 MdtCalibInput(digit.identify(), digit.adc(), digit.tdc(),
48 detMgr.getMdtReadoutElement(digit.identify()), gctx){}

◆ MdtCalibInput() [5/7]

MdtCalibInput::MdtCalibInput ( const Muon::MdtPrepData & prd)

Constructor taking the MdtPrepdata.

The

Definition at line 76 of file MdtCalibInput.cxx.

76 :
77 m_id{prd.identify()},
78 m_adc{static_cast<int16_t>(prd.adc())},
79 m_tdc{static_cast<int16_t>(prd.tdc())},
80 m_RE{prd.detectorElement()},
82}
Amg::Vector3D m_approach
Point of closest approach of the track.
int adc() const
Returns the ADC (typically range is 0 to 250)
virtual const MuonGM::MdtReadoutElement * detectorElement() const override
Returns the detector element corresponding to this PRD.
virtual const Amg::Vector3D & globalPosition() const
Returns the global position of the CENTER of the drift tube (i.e.
int tdc() const
Returns the TDC (typically range is 0 to 2500).
Identifier identify() const
return the identifier
setScaleOne setStatusOne setSaturated int16_t

◆ MdtCalibInput() [6/7]

MdtCalibInput::MdtCalibInput ( const xAOD::MdtDriftCircle & prd,
const ActsTrk::GeometryContext & gctx )

Constructor taking taking the xAOD::MdtDriftCircle.

Parameters
prdReference to the uncalibrated Drift circle
gctxGeometry context to place the drift circle globally within ATLAS

Definition at line 65 of file MdtCalibInput.cxx.

66 :
67 m_id{prd.identify()},
68 m_adc{prd.adc()},
69 m_tdc{prd.tdc()},
70 m_gctx{&gctx},
71 m_RE{prd.readoutElement()},
72 m_hash{prd.measurementHash()},
const Amg::Transform3D & localToGlobal() const
Local to global transformation of the tube.
const MuonGMR4::MdtReadoutElement * readoutElement() const
Retrieve the associated MdtReadoutElement.
const Identifier & identify() const
: Returns the Athena identifier of the drift circle.
Amg::Vector3D localMeasurementPos() const
: Return the measurement's position vector in the local frame.
IdentifierHash measurementHash() const
Returns the hash of the measurement channel (tube (x) layer)
int16_t adc() const
Returns the ADC (typically range is 0 to 250)
int16_t tdc() const
Returns the TDC (typically range is 0 to 2500)

◆ MdtCalibInput() [7/7]

MdtCalibInput::MdtCalibInput ( MdtCalibInput && other)
default

◆ ~MdtCalibInput()

MdtCalibInput::~MdtCalibInput ( )
default

Member Function Documentation

◆ adc()

int16_t MdtCalibInput::adc ( ) const

Returns the amount of accumulated charge.

Definition at line 86 of file MdtCalibInput.cxx.

86{ return m_adc; }

◆ center()

Amg::Vector3D MdtCalibInput::center ( ) const
private

Translational part of the local -> global transform.

Definition at line 203 of file MdtCalibInput.cxx.

203 {
204 return localToGlobal().translation();
205}

◆ closestApproach()

const Amg::Vector3D & MdtCalibInput::closestApproach ( ) const

Returns the point of closest approach to the wire.

Definition at line 105 of file MdtCalibInput.cxx.

105{return m_approach; }

◆ decriptor()

const MuonGMR4::MdtReadoutElement * MdtCalibInput::decriptor ( ) const

Returns the R4 readout element.

Definition at line 96 of file MdtCalibInput.cxx.

96 {
97 return std::visit([](const auto& re) -> const MuonGMR4::MdtReadoutElement*{
98 using REType = std::decay_t<decltype(re)>;
99 if constexpr( std::is_same_v<REType, const MuonGMR4::MdtReadoutElement*>){
100 return re;
101 }
102 return nullptr;
103 }, m_RE);
104}
const boost::regex re(r_e)

◆ distanceToTrack()

double MdtCalibInput::distanceToTrack ( ) const

Returns the distance to track (signed)

Definition at line 156 of file MdtCalibInput.cxx.

156{ return m_distToTrack; }
double m_distToTrack
Distance to track (signed)

◆ identify()

const Identifier & MdtCalibInput::identify ( ) const

Returns the Identifier of the hit.

Definition at line 84 of file MdtCalibInput.cxx.

84{ return m_id; }

◆ innerTubeR()

double MdtCalibInput::innerTubeR ( ) const

Returns the inner tube radius.

Definition at line 169 of file MdtCalibInput.cxx.

169 {
170 const double tubeR = std::visit([](const auto& re) -> double {
171 using REType = std::decay_t<decltype(re)>;
172 if constexpr(std::is_same_v<REType, const MuonGMR4::MdtReadoutElement*>){
173 return re->innerTubeRadius();
174 } else if (std::is_same_v<REType, const MuonGM::MdtReadoutElement*>) {
175 return re->innerTubeRadius();
176 }
177 }, m_RE);
178 return tubeR;
179 }

◆ legacyDescriptor()

const MuonGM::MdtReadoutElement * MdtCalibInput::legacyDescriptor ( ) const

Returns the legacy readout element.

Definition at line 87 of file MdtCalibInput.cxx.

87 {
88 return std::visit([](const auto& re) -> const MuonGM::MdtReadoutElement*{
89 using REType = std::decay_t<decltype(re)>;
90 if constexpr( std::is_same_v<REType, const MuonGM::MdtReadoutElement*>){
91 return re;
92 }
93 return nullptr;
94 }, m_RE);
95}

◆ legacySurface()

const Trk::StraightLineSurface & MdtCalibInput::legacySurface ( ) const

Returns the assocaited ideal surface (Throw exception if no legacy RE is available)

Definition at line 138 of file MdtCalibInput.cxx.

138 {
139 const MuonGM::MdtReadoutElement* re = legacyDescriptor();
140 assert(re != nullptr);
141 return re->surface(identify());
142}
const MuonGM::MdtReadoutElement * legacyDescriptor() const
Returns the legacy readout element.
const Identifier & identify() const
Returns the Identifier of the hit.

◆ localToGlobal()

const Amg::Transform3D & MdtCalibInput::localToGlobal ( ) const
private

Local to global transformation of the tube.

Definition at line 192 of file MdtCalibInput.cxx.

192 {
193 return std::visit([this](const auto& re) ->const Amg::Transform3D&{
194 using REType = std::decay_t<decltype(re)>;
195 if constexpr(std::is_same_v<REType, const MuonGMR4::MdtReadoutElement*>){
196 assert(m_gctx != nullptr);
197 return re->localToGlobalTrans(*m_gctx, m_hash);
198 } else if (std::is_same_v<REType, const MuonGM::MdtReadoutElement*>) {
199 return re->localToGlobalTransf(identify());
200 }
201 }, m_RE);
202}
Eigen::Affine3d Transform3D

◆ operator=()

MdtCalibInput & MdtCalibInput::operator= ( MdtCalibInput && other)
default

◆ projectMagneticField()

Amg::Vector2D MdtCalibInput::projectMagneticField ( const Amg::Vector3D & fieldInGlob) const

Splits the B-field into the components that point along the transverse track direction & along the tube wire.

Rotate the B-field into the rest frame of the tube (Z-axis along the wire)

In the local coordinate system, the wire points along the z-axis

Convert kilo tesla into tesla... Waaait whaat?

Definition at line 125 of file MdtCalibInput.cxx.

125 {
126 const Amg::Transform3D trf{localToGlobal().inverse()};
128 const Amg::Vector3D locBField = trf.linear() * fieldInGlob;
130 const Amg::Vector3D locTrkDir = trf.linear() * trackDirection();
131
132 const double perpendComp = locTrkDir.block<2,1>(0,0).dot(locBField.block<2,1>(0,0))
133 / locTrkDir.perp();
134 const double paralelComp = locBField.z();
136 return 1000. * Amg::Vector2D{paralelComp, perpendComp};
137}
const Amg::Vector3D & trackDirection() const
Returns the track direction (Can be zero)
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
dot(G, fn, nodesToHighlight=[])
Definition dot.py:5

◆ readOutSide()

double MdtCalibInput::readOutSide ( ) const

Returns the sign of the readout position in local coordinates.

By convention the new readout geometry points along the negative z-axis

Definition at line 180 of file MdtCalibInput.cxx.

180 {
182 const double roSide = std::visit([this](const auto& re) ->double{
183 using REType = std::decay_t<decltype(re)>;
184 if constexpr(std::is_same_v<REType, const MuonGMR4::MdtReadoutElement*>){
185 return re->getParameters().readoutSide;
186 } else if (std::is_same_v<REType, const MuonGM::MdtReadoutElement*>) {
187 return re->tubeFrame_localROPos(identify()).z() > 0. ? 1. : -1.;
188 }
189 }, m_RE);
190 return roSide;
191}

◆ setClosestApproach()

void MdtCalibInput::setClosestApproach ( const Amg::Vector3D & approach)

Sets the closest approach.

Definition at line 106 of file MdtCalibInput.cxx.

106 {
107 m_approach = approach;
108}

◆ setTimeOfFlight()

void MdtCalibInput::setTimeOfFlight ( const double toF)

Sets the time of flight (Usually globPos.mag() * inverseSpeed of light)

Definition at line 116 of file MdtCalibInput.cxx.

116{ m_ToF = toF; }

◆ setTrackDirection()

void MdtCalibInput::setTrackDirection ( const Amg::Vector3D & trackDir,
bool hasPhi )

Sets the direction of the externally determined track.

Parameters
trackDirDirection vector of the track (global frame)
hasPhiFlag whether the track direction contains phi information

Definition at line 110 of file MdtCalibInput.cxx.

110 {
111 m_trackDir = trackDir;
112 m_trackHasPhi = hasPhi;
113}
Amg::Vector3D m_trackDir
Global track direction.
bool m_trackHasPhi
Does the track direction contain a phi constraint.

◆ setTriggerTime()

void MdtCalibInput::setTriggerTime ( const double trigTime)

Sets the trigger offset time.

Definition at line 119 of file MdtCalibInput.cxx.

119{ m_trigTime = trigTime; }
double m_trigTime
Trigger time.

◆ signalPropagationDistance()

double MdtCalibInput::signalPropagationDistance ( ) const

Calculates the distance that the signal has to travel along the wire.

Definition at line 143 of file MdtCalibInput.cxx.

143 {
144 const double propDist = std::visit([this](const auto& re) ->double {
145 using REType = std::decay_t<decltype(re)>;
146 if constexpr(std::is_same_v<REType, const MuonGMR4::MdtReadoutElement*>){
147 assert(m_gctx != nullptr);
148 return re->distanceToReadout(*m_gctx, m_hash, closestApproach());
149 } else if (std::is_same_v<REType, const MuonGM::MdtReadoutElement*>) {
150 return re->distanceFromRO(closestApproach(), identify()) -
151 re->RODistanceFromTubeCentre(identify());
152 }
153 }, m_RE);
154 return propDist;
155}
const Amg::Vector3D & closestApproach() const
Returns the point of closest approach to the wire.

◆ surfaceCenter()

const Amg::Vector3D & MdtCalibInput::surfaceCenter ( ) const

Returns the center of the associated surface.

Definition at line 121 of file MdtCalibInput.cxx.

121 {
123}
virtual const Trk::Surface & surface() const override final
Return surface associated with this detector element.
const Amg::Vector3D & center() const
Returns the center position of the Surface.

◆ tdc()

int16_t MdtCalibInput::tdc ( ) const

Returns the tdc counts of the hit.

Definition at line 85 of file MdtCalibInput.cxx.

85{ return m_tdc; }

◆ timeOfFlight()

double MdtCalibInput::timeOfFlight ( ) const

Returns the time of flight.

Definition at line 115 of file MdtCalibInput.cxx.

115{ return m_ToF; }

◆ trackDirection()

const Amg::Vector3D & MdtCalibInput::trackDirection ( ) const

Returns the track direction (Can be zero)

Definition at line 109 of file MdtCalibInput.cxx.

109{ return m_trackDir; }

◆ trackDirHasPhi()

bool MdtCalibInput::trackDirHasPhi ( ) const

Returns whether the track has a phi constaint or not.

Definition at line 114 of file MdtCalibInput.cxx.

114{ return m_trackHasPhi; }

◆ triggerTime()

double MdtCalibInput::triggerTime ( ) const

Returns the trigger offset time.

Definition at line 118 of file MdtCalibInput.cxx.

118{ return m_trigTime; }

◆ tubeLength()

double MdtCalibInput::tubeLength ( ) const

Returns the tube length.

Definition at line 158 of file MdtCalibInput.cxx.

158 {
159 const double tubeLength = std::visit([this](const auto& re) ->double{
160 using REType = std::decay_t<decltype(re)>;
161 if constexpr(std::is_same_v<REType, const MuonGMR4::MdtReadoutElement*>){
162 return re->tubeLength(m_hash);
163 } else if (std::is_same_v<REType, const MuonGM::MdtReadoutElement*>) {
164 return re->tubeLength(identify());
165 }
166 }, m_RE);
167 return tubeLength;
168 }
double tubeLength() const
Returns the tube length.

Member Data Documentation

◆ m_adc

int16_t MdtCalibInput::m_adc {0}
private

Adc counts of the hit.

Definition at line 154 of file MdtCalibInput.h.

154{0};

◆ m_approach

Amg::Vector3D MdtCalibInput::m_approach {center()}
private

Point of closest approach of the track.

Definition at line 167 of file MdtCalibInput.h.

167{center()};
Amg::Vector3D center() const
Translational part of the local -> global transform.

◆ m_distToTrack

double MdtCalibInput::m_distToTrack {0.}
private

Distance to track (signed)

Definition at line 178 of file MdtCalibInput.h.

178{0.};

◆ m_gctx

const ActsTrk::GeometryContext* MdtCalibInput::m_gctx {nullptr}
private

Geometry context, needed to fetch the alignment.

Definition at line 159 of file MdtCalibInput.h.

159{nullptr};

◆ m_hash

IdentifierHash MdtCalibInput::m_hash {}
private

Measurement hash of the Identifier (needed for Phase II)

Definition at line 165 of file MdtCalibInput.h.

165{};

◆ m_id

Identifier MdtCalibInput::m_id {}
private

Tube identifier.

Definition at line 152 of file MdtCalibInput.h.

152{};

◆ m_RE

ReadoutEle_t MdtCalibInput::m_RE {}
private

Pointer to the associated readout element.

Definition at line 163 of file MdtCalibInput.h.

163{};

◆ m_tdc

int16_t MdtCalibInput::m_tdc {0}
private

Tdc counts of the hit.

Definition at line 156 of file MdtCalibInput.h.

156{0};

◆ m_ToF

double MdtCalibInput::m_ToF {center().mag() * s_inverseSpeed}
private

Definition at line 174 of file MdtCalibInput.h.

174{center().mag() * s_inverseSpeed};
static constexpr double s_inverseSpeed
Time of flight.

◆ m_trackDir

Amg::Vector3D MdtCalibInput::m_trackDir {Amg::Vector3D::Zero()}
private

Global track direction.

Definition at line 169 of file MdtCalibInput.h.

169{Amg::Vector3D::Zero()};

◆ m_trackHasPhi

bool MdtCalibInput::m_trackHasPhi {false}
private

Does the track direction contain a phi constraint.

Definition at line 171 of file MdtCalibInput.h.

171{false};

◆ m_trigTime

double MdtCalibInput::m_trigTime {0.}
private

Trigger time.

Definition at line 176 of file MdtCalibInput.h.

176{0.};

◆ s_inverseSpeed

double MdtCalibInput::s_inverseSpeed {1. / Gaudi::Units::c_light}
staticconstexprprivate

Time of flight.

Definition at line 173 of file MdtCalibInput.h.

173{1. / Gaudi::Units::c_light};

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