ATLAS Offline Software
MdtDriftCircleOnTrack.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONRIO_ONTRACK_MDTDRIFTCIRCLEONTRACK_H
5 #define MUONRIO_ONTRACK_MDTDRIFTCIRCLEONTRACK_H
6 
7 // Base classes
10 
11 
14 
16 #include "AthLinks/ElementLink.h"
19 
20 
21 #include <cassert>
22 
24 
25 namespace Trk{
26  class LocalParameters;
27  class ITrkEventCnvTool;
28 }
29 
30 namespace Muon
31 {
32  class MuonEventCnvTool;
33  class MdtDriftCircleOnTrackCreator;
34 
38 public:
39 
40  friend class Trk::ITrkEventCnvTool;
41  friend class Muon::MuonEventCnvTool;
43 
45  MdtDriftCircleOnTrack() = default;
46 
49 
52 
53 
54 
77  Trk::LocalParameters&& locPos,
78  Amg::MatrixX&& errDriftRadius,
79  const double driftTime,
81  const Amg::Vector3D& globDir,
82  const double positionAlongWire,
84 
107  Trk::LocalParameters&& locPos,
108  Amg::MatrixX&& errDriftRadius,
109  const double driftTime,
111  const double positionAlongWire,
113 
114 
115  // Alternate constructor that doesn't dereference the RIO link.
117  Trk::LocalParameters&& locPos,
118  Amg::MatrixX&& errDriftRadius,
119  const Identifier& id,
120  const MuonGM::MdtReadoutElement* detEl,
121  const double driftTime,
123  const double positionAlongWire,
124  const double localAngle,
126 
128  virtual ~MdtDriftCircleOnTrack() = default;
129 
131  Trk::DriftCircleSide side() const;
132 
137 
139  virtual MdtDriftCircleOnTrack* clone() const override final;
140 
142  virtual const MdtPrepData* prepRawData() const override final;
144 
147 
149  virtual IdentifierHash idDE() const override final{ return IdentifierHash(); }
150 
152  virtual const MuonGM::MdtReadoutElement* detectorElement() const override final;
153 
158  virtual const Trk::StraightLineSurface& associatedSurface() const override final;
159 
164  virtual const Amg::Vector3D& globalPosition() const override final;
165 
166  virtual bool rioType(Trk::RIO_OnTrackType::Type type) const override final {
168  }
169 
176  double driftRadius() const;
177 
182  double driftTime() const;
183 
185  double positionAlongWire() const;
186 
188  double localAngle() const;
189 
192 
194  virtual MsgStream& dump( MsgStream& stream) const override final;
195 
197  virtual std::ostream& dump( std::ostream& stream) const override final;
198 
199  // /////////////////////////////////////////////////////////////////
200  // Private data:
201  // /////////////////////////////////////////////////////////////////
202 private:
205  virtual void setLocalParameters( const Trk::LocalParameters& locPos);
206 
209  virtual void setValues(const Trk::TrkDetElementBase*,
210  const Trk::PrepRawData*) override final;
211 
214  void setGlobalPosition(Amg::Vector3D&& loc3Dframe) const;
215 
216  //Sets the error strategy, only used by the Muon::MdtDriftCircleOnTrackCreator
218 
221 
224 
227 
229  double m_localAngle{0.};
230 
233 
235  double m_driftTime{0.};
236 
239 
240  /*** Pointer to the detector element. Needed if no prepData is present*/
242 
243 };
244 
245 // /////////////////////////////////////////////////////////////////
246 // Inline methods:
247 // /////////////////////////////////////////////////////////////////:
248 
250  if (m_status == Trk::UNDECIDED) return Trk::NONE;
251  if (localParameters()[Trk::driftRadius] < 0. ) return Trk::LEFT;
252  return Trk::RIGHT;
253 }
254 
258  if (m_rio.isValid()) return m_rio.cachedElement();
259  return nullptr;
260 }
261 
263 
265  return prepRawData()->collectionHash();
266 }
267 
270 }
272  return detectorElement()->surface(identify());
273 }
274 
277 inline double MdtDriftCircleOnTrack::driftRadius() const {
279 }
280 inline double MdtDriftCircleOnTrack::driftTime() const { return m_driftTime; }
282 inline double MdtDriftCircleOnTrack::localAngle() const { return m_localAngle; }
284  return m_errorStrategy;
285 }
287  const Trk::PrepRawData* prd) {
288 
289  m_detEl = dynamic_cast<const MuonGM::MdtReadoutElement*>(detEl);
290  if (!prd) return;
292  throw std::runtime_error("No Mdt prd given to MdtDriftCircleOnTrack");
293  }
294  m_rio.setElement(static_cast<const MdtPrepData*>(prd));
295 }
296 
297 }
298 
299 #endif // MUONRIOONTRACK_MUONDRIFTCIRCLEONTRACK_H
300 
301 
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
Muon::MdtDriftCircleOnTrack::prepRawDataLink
const ElementLinkToIDC_MDT_Container & prepRawDataLink() const
Definition: MdtDriftCircleOnTrack.h:262
Trk::LocalParameters
Definition: LocalParameters.h:98
Muon::MuonDriftCircleErrorStrategy
Definition: MuonDriftCircleErrorStrategy.h:15
Trk::PrepRawDataType::MdtPrepData
@ MdtPrepData
MuonDriftCircleErrorStrategy.h
Trk::NONE
@ NONE
it was not possible to determine the which side of the straw the track passed;
Definition: DriftCircleSide.h:18
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
DriftCircleSide.h
Muon::MdtDriftCircleOnTrack::prepRawData
virtual const MdtPrepData * prepRawData() const override final
Returns the PrepRawData used to create this corrected measurement.
Definition: MdtDriftCircleOnTrack.h:257
Muon::MdtDriftCircleOnTrack::m_detEl
const MuonGM::MdtReadoutElement * m_detEl
Definition: MdtDriftCircleOnTrack.h:241
Trk::DriftCircleStatus
DriftCircleStatus
Enumerates the 'status' of the wire on which the tracks passed (based on the TRT_Side enum,...
Definition: DriftCircleStatus.h:16
Muon::MdtDriftCircleOnTrack::dump
virtual MsgStream & dump(MsgStream &stream) const override final
Dumps information about the PRD.
Definition: MdtDriftCircleOnTrack.cxx:130
CxxUtils::CachedUniquePtrT
Cached pointer with atomic update.
Definition: CachedUniquePtr.h:54
Muon::MdtDriftCircleOnTrack::operator=
MdtDriftCircleOnTrack & operator=(const MdtDriftCircleOnTrack &)
Definition: MdtDriftCircleOnTrack.cxx:94
Muon::MdtDriftCircleOnTrack::errorStrategy
const MuonDriftCircleErrorStrategy & errorStrategy() const
Get information about the creation strategy used by Muon::MdtDriftCircleOnTrackCreator when making th...
Definition: MdtDriftCircleOnTrack.h:283
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::PrepRawData::type
virtual bool type(PrepRawDataType type) const =0
Interface method checking the type.
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
MdtPrepData.h
Muon::MdtDriftCircleOnTrack::detectorElement
virtual const MuonGM::MdtReadoutElement * detectorElement() const override final
Returns the detector element, assoicated with the PRD of this class.
Definition: MdtDriftCircleOnTrack.h:268
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Muon::MdtDriftCircleOnTrack::~MdtDriftCircleOnTrack
virtual ~MdtDriftCircleOnTrack()=default
Destructor:
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::MdtDriftCircleOnTrack::m_rio
ElementLinkToIDC_MDT_Container m_rio
the pointer to the MdtPrepData object (mutable because it might need to be recreated when reading tra...
Definition: MdtDriftCircleOnTrack.h:223
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
Muon::MdtDriftCircleOnTrack::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
Returns the global Position.
Definition: MdtDriftCircleOnTrack.cxx:108
Muon::MdtDriftCircleOnTrack::driftTime
double driftTime() const
Returns the value of the drift time used to obtain the drift radius.
Definition: MdtDriftCircleOnTrack.h:280
Trk::RIO_OnTrack::type
virtual bool type(MeasurementBaseType::Type type) const override final
Extended method checking the type.
Definition: RIO_OnTrack.h:110
Trk::UNDECIDED
@ UNDECIDED
sign of drift radius has not been determined
Definition: DriftCircleStatus.h:20
Muon::MuonEventCnvTool
Tool used in the persisency convertors to help rebuild EDM objects.
Definition: MuonEventCnvTool.h:30
Trk::LocalParameters::get
double get(ParamDefs par) const
Retrieve specified parameter (const version).
MdtPrepDataContainer.h
Muon::MdtDriftCircleOnTrack::m_localAngle
double m_localAngle
This angle is the position of the point of closest approach in cylindrical coordinates,...
Definition: MdtDriftCircleOnTrack.h:229
Muon::MdtDriftCircleOnTrack::side
Trk::DriftCircleSide side() const
Returns the side on which the drift radius is wrt to the track.
Definition: MdtDriftCircleOnTrack.h:249
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:51
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:53
Trk::RIGHT
@ RIGHT
the drift radius is positive (see Trk::AtaStraightLine)
Definition: DriftCircleSide.h:22
Muon::MdtDriftCircleOnTrack::m_positionAlongWire
double m_positionAlongWire
This is the position of the point of closest approach, in the local z coord (i.e.
Definition: MdtDriftCircleOnTrack.h:232
CachedUniquePtr.h
Cached unique_ptr with atomic update.
Trk::ITrkEventCnvTool
Definition: ITrkEventCnvTool.h:31
Muon::MdtDriftCircleOnTrack::localAngle
double localAngle() const
Returns the local angle, as determined by the extrapolation used when creating this Trk::RIO_OnTrack.
Definition: MdtDriftCircleOnTrack.h:282
Muon::MdtDriftCircleOnTrack::operator=
MdtDriftCircleOnTrack & operator=(MdtDriftCircleOnTrack &&)=default
Muon::MdtDriftCircleOnTrack::clone
virtual MdtDriftCircleOnTrack * clone() const override final
Pseudo-constructor, needed to avoid excessive RTTI.
Definition: MdtDriftCircleOnTrack.h:256
Muon::MdtDriftCircleOnTrack::positionAlongWire
double positionAlongWire() const
Returns the position along the wire, as determined by the extrapolation used when creating this Trk::...
Definition: MdtDriftCircleOnTrack.h:281
Muon::MdtDriftCircleOnTrack::driftRadius
double driftRadius() const
Returns the value of the drift radius.
Definition: MdtDriftCircleOnTrack.h:277
Muon::MdtDriftCircleOnTrack::status
Trk::DriftCircleStatus status() const
Returns the status of the drift radius calibration.
Definition: MdtDriftCircleOnTrack.h:255
Muon::MdtDriftCircleOnTrack::m_status
Trk::DriftCircleStatus m_status
information on the status of the Mdt measurement - see Trk::DriftCircleStatus for definitions
Definition: MdtDriftCircleOnTrack.h:220
xAODType
Definition: ObjectType.h:13
Muon::MdtDriftCircleOnTrack::m_globalPosition
CxxUtils::CachedUniquePtr< Amg::Vector3D > m_globalPosition
global position of the measurement.
Definition: MdtDriftCircleOnTrack.h:226
Trk::MeasurementBase::m_localParams
LocalParameters m_localParams
Definition: MeasurementBase.h:111
Trk::PrepRawData
Definition: PrepRawData.h:62
Muon::MdtDriftCircleOnTrack::setValues
virtual void setValues(const Trk::TrkDetElementBase *, const Trk::PrepRawData *) override final
Sets the DetElement and Trk::PrepRawData pointers after reading from disk.
Definition: MdtDriftCircleOnTrack.h:286
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
RIO_OnTrack.h
Trk::RIO_OnTrackType::MdtDriftCircle
@ MdtDriftCircle
Definition: RIO_OnTrack.h:60
Muon::MdtDriftCircleOnTrack
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Definition: MdtDriftCircleOnTrack.h:37
Muon::MdtDriftCircleOnTrack::setLocalParameters
virtual void setLocalParameters(const Trk::LocalParameters &locPos)
Sets the local parameters.
Definition: MdtDriftCircleOnTrack.h:275
Muon::MdtDriftCircleOnTrack::idDE
virtual IdentifierHash idDE() const override final
Returns an invalid hash.
Definition: MdtDriftCircleOnTrack.h:149
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:33
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Muon::MdtDriftCircleOnTrack::rioType
virtual bool rioType(Trk::RIO_OnTrackType::Type type) const override final
Method checking the Rio On Track type.
Definition: MdtDriftCircleOnTrack.h:166
Muon::MdtDriftCircleOnTrack::setErrorStrategy
void setErrorStrategy(const MuonDriftCircleErrorStrategy &strategy)
Definition: MdtDriftCircleOnTrack.h:276
Muon::MdtDriftCircleOnTrack::setGlobalPosition
void setGlobalPosition(Amg::Vector3D &&loc3Dframe) const
Uses the passed loc3Dframe to calculate and set the global coord of this hit.
Definition: MdtDriftCircleOnTrack.cxx:125
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
Trk::DriftCircleSide
DriftCircleSide
Enumerates the 'side' of the wire on which the tracks passed (i.e.
Definition: DriftCircleSide.h:16
Muon::MdtPrepData::collectionHash
virtual IdentifierHash collectionHash() const
Returns the IdentifierHash corresponding to the Mdt tube which was hit.
Definition: MdtPrepData.h:148
Muon::MdtDriftCircleOnTrack::associatedSurface
virtual const Trk::StraightLineSurface & associatedSurface() const override final
Returns the surface on which this measurement was taken.
Definition: MdtDriftCircleOnTrack.h:271
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
MuonGM::MdtReadoutElement::surface
virtual const Trk::Surface & surface() const override final
Return surface associated with this detector element.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:891
Muon::MdtDriftCircleOnTrackCreator
Interface for the reconstruction to MDT calibration and alignment corrections.
Definition: MdtDriftCircleOnTrackCreator.h:71
Trk::LEFT
@ LEFT
the drift radius is negative (see Trk::AtaStraightLine)
Definition: DriftCircleSide.h:20
Muon::MdtDriftCircleOnTrack::collectionHash
IdentifierHash collectionHash() const
Returns the hashID of the PRD collection.
Definition: MdtDriftCircleOnTrack.h:264
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Muon::MdtDriftCircleOnTrack::m_driftTime
double m_driftTime
This is the drift time used to obtain the drift radius.
Definition: MdtDriftCircleOnTrack.h:235
Muon::MdtDriftCircleOnTrack::MdtDriftCircleOnTrack
MdtDriftCircleOnTrack()=default
Default ctor - for use by POOL only.
Muon::MdtPrepData::detectorElement
virtual const MuonGM::MdtReadoutElement * detectorElement() const override
Returns the detector element corresponding to this PRD.
Definition: MdtPrepData.h:141
Muon::MdtDriftCircleOnTrack::MdtDriftCircleOnTrack
MdtDriftCircleOnTrack(MdtDriftCircleOnTrack &&)=default
Muon::MdtDriftCircleOnTrack::m_errorStrategy
MuonDriftCircleErrorStrategy m_errorStrategy
Records information about the 'strategy' used by Muon::MdtDriftCircleOnTrackCreator to make this obje...
Definition: MdtDriftCircleOnTrack.h:238
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51
DriftCircleStatus.h
Identifier
Definition: IdentifierFieldParser.cxx:14