ATLAS Offline Software
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRKTRACK_H
6 #define TRKTRACK_H
7 
8 #include <atomic>
9 #include <iostream>
10 #include <memory>
11 #include <vector>
12 
14 #include "AthenaKernel/CLASS_DEF.h"
15 #include "CxxUtils/CachedValue.h"
19 #include "TrkTrack/TrackInfo.h"
22 class MsgStream;
23 class TrackCnv_p1;
24 class TrackCnv_p2;
25 class TrackCnv_p3;
26 class TrackCnv_p4;
27 class TrackCnv_p12;
28 
29 namespace Trk {
73 class Track : public Trk::ObjectCounter<Trk::Track> {
74  public:
75  friend class TrackSlimmingTool;
76 
84  Track() = default;
85 
89  Track(const TrackInfo& info,
90  std::unique_ptr<TrackStates> trackStateOnSurfaces,
91  std::unique_ptr<FitQuality> fitQuality);
92 
93  Track(const Track& rhs);
94 
95  Track& operator=(const Track& rhs);
96 
97  Track(Track&& rhs) = default;
98 
99  Track& operator=(Track&& rhs) = default;
100 
101  virtual ~Track() = default;
102 
108  bool isValid() const;
109 
113  const FitQuality* fitQuality() const;
121  void setFitQuality(std::unique_ptr<FitQuality> quality);
122 
133 
138  std::unique_ptr<Trk::TrackStates> input);
139 
143  const TrackInfo& info() const;
144 
149 
153  void setInfo(const TrackInfo& input);
154 
160 
166 
170  void setTrackSummary(std::unique_ptr<Trk::TrackSummary> input);
171 
185  const Perigee* perigeeParameters() const;
186 
195 
205 
215 
219  void resetCaches();
220 
221  protected:
222  friend class ::TrackCnv_p1;
223  friend class ::TrackCnv_p2;
224  friend class ::TrackCnv_p3;
225  friend class ::TrackCnv_p4;
226  friend class ::TrackCnv_p12;
227 
229 
234  void findPerigee() const;
235 
240  void copyHelper(const Track& rhs);
241 
248  std::unique_ptr<TrackStates> m_trackStateVector = nullptr;
249 
261 
272 
281 
289 
293  std::unique_ptr<FitQuality> m_fitQuality{nullptr};
294 
298  std::unique_ptr<Trk::TrackSummary> m_trackSummary{nullptr};
299 
305 
306  private:
311  void findPerigeeImpl() const;
312 
313 }; // end of class definitions
314 
318 MsgStream& operator<<(MsgStream& sl, const Track& track);
319 
323 std::ostream& operator<<(std::ostream& sl, const Track& track);
324 
325 } // namespace Trk
326 
327 #include "Track.icc"
328 #endif
329 
Track.icc
Trk::Track::resetCaches
void resetCaches()
reset all caches
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::Track::fitQuality
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
Trk::Track::m_cachedMeasurementVector
CxxUtils::CachedValue< DataVector< const MeasurementBase > > m_cachedMeasurementVector
A vector of MeasurementBase: these objects represent the "hits" on the track (but not outliers - see ...
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:271
TrackParameters.h
Trk::Track::fitQuality
FitQuality * fitQuality()
return a pointer to the fit quality non-const overload
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::Track::info
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
Trk::Track::m_cachedParameterVector
CxxUtils::CachedValue< DataVector< const TrackParameters > > m_cachedParameterVector
A vector of TrackParameters: these can be any of the classes that derive from Trk::TrackParameters,...
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:260
Trk::Track::trackStateOnSurfaces
Trk::TrackStates * trackStateOnSurfaces()
return a pointer to a DataVector of const TrackStateOnSurfaces.
Trk::TrackSlimmingTool
Definition: TrackSlimmingTool.h:37
TrkObjectCounter.h
Trk::Track::operator=
Track & operator=(Track &&rhs)=default
move assignment operator
TrackCnv_p12
Definition: TrackCnv_p12.h:19
Trk::Track::TSoS_iterator
Trk::TrackStates::const_iterator TSoS_iterator
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:228
Trk::Track::~Track
virtual ~Track()=default
destructor
Trk::Track::m_cachedOutlierVector
CxxUtils::CachedValue< DataVector< const MeasurementBase > > m_cachedOutlierVector
These objects represent the "outliers" on the track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:280
Trk::ObjectCounter
Helper to enable counting number of instantiations in debug builds.
Definition: TrkObjectCounter.h:18
Trk::Track::m_fitQuality
std::unique_ptr< FitQuality > m_fitQuality
A pointer to the Track's FitQuality.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:293
Trk::Track::m_trackSummary
std::unique_ptr< Trk::TrackSummary > m_trackSummary
Datamember to cache the TrackSummary.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:298
Trk::Track::findPerigee
void findPerigee() const
Find perigee in the vector of track parameters.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:123
Trk::Track::setFitQuality
void setFitQuality(std::unique_ptr< FitQuality > quality)
set FitQuality.
Trk::Track::m_perigeeParameters
CxxUtils::CachedValue< const Perigee * > m_perigeeParameters
A pointer to the Track's Perigee parameters.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:288
Trk::Track::Track
Track()=default
Default constructor Here for POOL and simple tests.
Trk::Track::m_trackStateVector
std::unique_ptr< TrackStates > m_trackStateVector
TrackStateOnSurface.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:248
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
CxxUtils::CachedValue
Cached value with atomic update.
Definition: CachedValue.h:55
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
TrackSummary.h
DataVector< const Trk::TrackStateOnSurface >
Trk::Track::outliersOnTrack
const DataVector< const MeasurementBase > * outliersOnTrack() const
return a pointer to a vector of MeasurementBase, which represent outliers (i.e.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:210
Trk::Track::setInfo
void setInfo(const TrackInfo &input)
set the info.
Trk::Track::m_trackInfo
Trk::TrackInfo m_trackInfo
This is a class which stores the identity of where the track was created, fitted, which properties th...
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:304
Trk::Track::trackParameters
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:97
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
CachedValue.h
Cached value with atomic update.
Trk::Track::info
TrackInfo & info()
returns a ref to the info.
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
TrackInfo.h
Trk::Track::setTrackStateOnSurfaces
void setTrackStateOnSurfaces(std::unique_ptr< Trk::TrackStates > input)
Set the TrackStateOnSurfaces.
Trk::Track::isValid
bool isValid() const
returns true if the track has non-nullptr fitQuality and non-empty Trk::TrackStates
TrackCnv_p2
Definition: TrackCnv_p2.h:26
TrackCnv_p4
Definition: TrackCnv_p4.h:26
Trk::Track::measurementsOnTrack
const DataVector< const MeasurementBase > * measurementsOnTrack() const
return a pointer to a vector of MeasurementBase (NOT including any that come from outliers).
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:178
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
Trk::Track::copyHelper
void copyHelper(const Track &rhs)
Helper method to factor common part of copy ctor and copy assignment.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:56
Trk::Track::trackSummary
const Trk::TrackSummary * trackSummary() const
Returns a pointer to the const Trk::TrackSummary owned by this const track (could be nullptr)
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
Trk::Track::operator=
Track & operator=(const Track &rhs)
assignment operator
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:42
Trk::Track::Track
Track(Track &&rhs)=default
move constructor
Trk::Track::setTrackSummary
void setTrackSummary(std::unique_ptr< Trk::TrackSummary > input)
Set the track summary.
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
Trk::Track::findPerigeeImpl
void findPerigeeImpl() const
find PerigeeImpl.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:129
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
FitQuality.h
TrackCnv_p1
Definition: TrackCnv_p1.h:26
CLASS_DEF.h
macros to associate a CLID to a type
TrackCnv_p3
Definition: TrackCnv_p3.h:28
TrackStateOnSurface.h
Trk::Track::trackSummary
Trk::TrackSummary * trackSummary()
Returns a pointer to the Trk::TrackSummary owned by this track (could be nullptr)