ATLAS Offline Software
MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // MuonSegment.h, (c) ATLAS Detector software
8 
9 #ifndef MUONSEGMENT_MUONSEGMENT_H
10 #define MUONSEGMENT_MUONSEGMENT_H
11 
12 // Trk
16 #include "TrkSegment/Segment.h"
19 
20 namespace Muon {
21 
41 class MuonSegment final
42  : public Trk::Segment
44  , public Trk::SurfacePtrHolderImplDetEl<Trk::PlaneSurface>
45 {
46 public:
48  static const float kNoValue;
49 
51  MuonSegment();
53  MuonSegment(const MuonSegment& seg);
55  MuonSegment& operator=(const MuonSegment& seg);
57  MuonSegment(MuonSegment&& seg) noexcept = default;
59  MuonSegment& operator=(MuonSegment&& seg) noexcept = default;
60 
73  Amg::MatrixX&& locerr,
74  Trk::PlaneSurface* psf,
76  Trk::FitQuality* fqual,
78 
90  MuonSegment(const Amg::Vector2D& segLocPos, // 2 local position coordinates
91  const Trk::LocalDirection& segLocDir, //
92  Amg::MatrixX&& segLocalErr, //
93  Trk::PlaneSurface* psf, // plane surface to define frame
94  DataVector<const Trk::MeasurementBase>&& cmeas, // vector of contained measurements on track
95  Trk::FitQuality* fqual, // fit quality object
97 
99  virtual ~MuonSegment();
100 
102  virtual MuonSegment* clone() const override final;
103 
105  virtual const Amg::Vector3D& globalPosition() const override final;
106 
109 
111  const Trk::LocalDirection& localDirection() const;
112 
115  virtual const Trk::PlaneSurface& associatedSurface() const override final;
116 
118  unsigned int numberOfContainedROTs() const;
119 
122  const Trk::RIO_OnTrack* rioOnTrack(unsigned int) const;
123 
125  void setT0Error(float t0, float t0Error);
126 
128  bool hasFittedT0() const;
129 
131  void recalculateCache();
132 
133 private:
137 
140 
142  Trk::LocalDirection m_localDirection;
143 
146 
147 protected:
150  virtual MsgStream& dump(MsgStream& out) const override final;
153  virtual std::ostream& dump(std::ostream& out) const override final;
154 };
155 
156 inline const Amg::Vector3D&
158 {
159  return m_globalPosition;
160 }
161 
162 inline const Amg::Vector3D&
164 {
165  return m_globalDirection;
166 }
167 
168 inline const Trk::LocalDirection&
170 {
171  return m_localDirection;
172 }
173 
174 inline const Trk::PlaneSurface&
176 {
177  return (*m_associatedSurface);
178 }
179 
180 inline MuonSegment*
182 {
183  return new MuonSegment(*this);
184 }
185 
186 inline const Trk::RIO_OnTrack*
187 MuonSegment::rioOnTrack(unsigned int indx) const
188 {
189  if (indx < containedMeasurements().size()) {
190  const Trk::MeasurementBase* meas = containedMeasurements()[indx];
192  return static_cast<const Trk::RIO_OnTrack*>(meas);
193  }
194  }
195  return nullptr;
196 }
197 
198 inline unsigned int
200 {
201  return containedMeasurements().size();
202 }
203 
204 inline void
205 MuonSegment::setT0Error(float t0, float t0Error)
206 {
207  m_time = t0;
208  m_errorTime = t0Error;
209 }
210 
211 inline bool
213 {
214  return m_time != MuonSegment::kNoValue;
215 }
216 
217 }
218 
219 #endif // MUONSEGMENT_MUONSEGMENT_H
220 
Trk::LocalParameters
Definition: LocalParameters.h:98
Muon::MuonSegment::~MuonSegment
virtual ~MuonSegment()
Destructor.
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
Muon::MuonSegment::kNoValue
static const float kNoValue
define invalid value, used when the segment has no fitted t0
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:48
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Muon::MuonSegment::m_localDirection
Trk::LocalDirection m_localDirection
LocalDirection.
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:142
Muon::MuonSegment::rioOnTrack
const Trk::RIO_OnTrack * rioOnTrack(unsigned int) const
returns the RIO_OnTrack (also known as ROT) objects depending on the integer
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:187
Trk::SpaceTimePointBase
SpaceTimePointBase.
Definition: SpaceTimePointBase.h:23
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Muon::MuonSegment::dump
virtual MsgStream & dump(MsgStream &out) const override final
returns some information about this RIO_OnTrack/TrackSegment.
Definition: MuonSegment.cxx:126
Muon::MuonSegment::m_globalPosition
Amg::Vector3D m_globalPosition
The global position the surface can be associated to.
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:136
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
Trk::SurfacePtrHolderImplDetEl< Trk::PlaneSurface >::m_associatedSurface
const Trk::PlaneSurface * m_associatedSurface
Definition: SurfaceHolderImpl.h:244
Muon::MuonSegment::numberOfContainedROTs
unsigned int numberOfContainedROTs() const
number of RIO_OnTracks
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:199
Muon::MuonSegment::hasFittedT0
bool hasFittedT0() const
returns whether the segment has a fitted t0
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:212
Muon::MuonSegment::m_globalDirection
Amg::Vector3D m_globalDirection
cache global direction, not persistified
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:139
protected
#define protected
Definition: DetDescrConditionsDict_dict_fixes.cxx:14
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
SpaceTimePointBase.h
Segment.h
Muon::MuonSegment::localDirection
const Trk::LocalDirection & localDirection() const
local direction
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:169
Trk::Segment::containedMeasurements
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:166
Trk::Segment
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:56
Muon::MuonSegment::clearMeasVector
void clearMeasVector()
private method to clear the Trk::MeasurementBase vector
Muon::MuonSegment::setT0Error
void setT0Error(float t0, float t0Error)
set the fitted time and error on the time
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:205
Trk::MeasurementBase::type
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
Muon::MuonSegment::operator=
MuonSegment & operator=(MuonSegment &&seg) noexcept=default
Move Assignment operator.
Trk::Segment::AuthorUnknown
@ AuthorUnknown
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:64
SurfaceHolderImpl.h
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
DataVector< const Trk::MeasurementBase >
Trk::LocalDirection
represents the three-dimensional global direction with respect to a planar surface frame.
Definition: LocalDirection.h:81
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Muon::MuonSegment::recalculateCache
void recalculateCache()
recalculate the cache
Definition: MuonSegment.cxx:109
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
RIO_OnTrack.h
Muon::MuonSegment::MuonSegment
MuonSegment(MuonSegment &&seg) noexcept=default
Move Constructor.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
Muon::MuonSegment::clone
virtual MuonSegment * clone() const override final
needed to avoid excessive RTTI
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:181
Trk::SpaceTimePointBase::m_errorTime
float m_errorTime
error on the time measurement
Definition: SpaceTimePointBase.h:61
Muon::MuonSegment::operator=
MuonSegment & operator=(const MuonSegment &seg)
Assignment operator.
Definition: MuonSegment.cxx:45
Trk::PlaneSurface
Definition: PlaneSurface.h:64
PlaneSurface.h
Trk::SurfacePtrHolderImplDetEl
Definition: SurfaceHolderImpl.h:165
Muon::MuonSegment::MuonSegment
MuonSegment()
Default Constructor for POOL.
Definition: MuonSegment.cxx:22
Trk::Segment::author
Author author() const
return segment author
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:199
Muon::MuonSegment::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
global position
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:157
LocalDirection.h
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
ParticleJetParams::Author
Author
Definition: ParticleJetParamDefs.h:33
Trk::SpaceTimePointBase::m_time
float m_time
measured time
Definition: SpaceTimePointBase.h:58
Muon::MuonSegment::associatedSurface
virtual const Trk::PlaneSurface & associatedSurface() const override final
returns the surface for the local to global transformation
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:175
Muon::MuonSegment::globalDirection
const Amg::Vector3D & globalDirection() const
global direction
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:163