ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::TrackSegment Class Referencefinal

Class for a generic track segment that holdes polymorphic Trk::MeasurementBase objects, it extends the Trk::Segment base class. More...

#include <TrackSegment.h>

Inheritance diagram for Trk::TrackSegment:
Collaboration diagram for Trk::TrackSegment:

Public Types

enum  Author {
  AuthorUnknown = 0 , MooMdtSegmentMakerTool = 1 , MooCscSegmentMakerTool = 2 , Muonboy = 3 ,
  DCMathSegmentMaker = 4 , MDT_DHoughSegmentMakerTool = 5 , CSC_DHoughSegmentMakerTool = 6 , Csc2dSegmentMaker = 7 ,
  Csc4dSegmentMaker = 8 , TRT_SegmentMaker = 9 , CTBTracking = 10 , DCMathSegmentMakerCurved = 11 ,
  NswStereoSeeded = 12 , NswStgcSeeded = 13 , NswPadSeeded = 14 , NswQuadAlign = 15 ,
  NumberOfAuthors = 16
}
 enum to identify who created the segment. More...

Public Member Functions

 TrackSegment ()
 Default Constructor for POOL.
 TrackSegment (const TrackSegment &seg)=default
 Copy Constructor.
 TrackSegment (TrackSegment &&) noexcept=default
 Move Constructor.
TrackSegment & operator= (const TrackSegment &seg)=default
 Assignment operator.
TrackSegment & operator= (TrackSegment &&) noexcept=default
 Move assignment operator.
 TrackSegment (LocalParameters &&locpars, Amg::MatrixX &&locerr, const Surface *sf, DataVector< const MeasurementBase > &&crots, FitQuality *fqual, Segment::Author author=Segment::AuthorUnknown)
 Constructor with parameters.
virtual ~TrackSegment ()=default
 Destructor.
virtual TrackSegment * clone () const override final
 needed to avoid excessive RTTI
const Surface & associatedSurface () const override final
 returns the surface for the local to global transformation
const Amg::Vector3D & globalPosition () const override final
 Interface method to get the global Position.
MsgStream & dump (MsgStream &out) const override final
 returns some information about this MeasurementBase/TrackSegment.
std::ostream & dump (std::ostream &out) const override final
 returns some information about this MeasurementBase/TrackSegment.
std::unique_ptr< Segment > uniqueClone () const
 NVI uniqueClone method.
virtual bool type (MeasurementBaseType::Type type) const override final
 Extended method checking the type.
const std::vector< const Trk::MeasurementBase * > & containedMeasurements () const
 returns the vector of Trk::MeasurementBase objects
const DataVector< const Trk::MeasurementBase > & containedMeasurementsDataVector () const
bool hasContainedMeasurements () const
unsigned int numberOfMeasurementBases () const
 Return the number of contained Trk::MeasurementBase (s).
const MeasurementBase * measurement (unsigned int) const
 returns the Trk::MeasurementBase objects depending on the integer
const FitQuality * fitQuality () const
 return the FitQuality object, returns NULL if no FitQuality is defined
void setAuthor (Author a)
 sets the segment author
Author author () const
 return segment author
std::string dumpAuthor () const
 returns human readble string version of author
const LocalParameters & localParameters () const
 Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance () const
 Interface method to get the localError.
const Surface * surfacePtr ()
 return the ptr we hold useful for tests
const Surface * release () noexcept
 release ala unique_ptr release
void destroySurface () noexcept
 destroySurface deletes the ptr if not null and the surface has not a associatedDetectorElement Usefull also for testing

Static Public Member Functions

static std::size_t numberOfInstantiations ()
static const Surface * cloneHelper (const Surface *input)
 Helper for cloning or not when we need depending on if we have an associatedDetectorElement.

Static Public Attributes

static std::atomic_size_t s_numberOfInstantiations

Protected Attributes

std::unique_ptr< FitQuality > m_fitQuality
 The fit quality of the Segment.
DataVector< const MeasurementBase > m_containedMeasBases
 The vector of contained (generic) Trk::MeasurementBase objects.
Author m_author
 segment author
LocalParameters m_localParams
Amg::MatrixX m_localCovariance
const Surface * m_associatedSurface

Private Attributes

Amg::Vector3D m_globalPosition

Friends

class ::TrackSegmentCnv_p1

Detailed Description

Class for a generic track segment that holdes polymorphic Trk::MeasurementBase objects, it extends the Trk::Segment base class.

Trk::MeasurementBase objects of different type can be used to describe this track segment. The fitted Trk::LocalParameters such as the associated ErrorMatrix are directly forwarded to be stored in the Trk::MeasurementBase base class.

A Surface has to be provided to give the reference frame the \ Trk::TrackSegment is expressed to.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch
Christos Anastopoulos Athena MT

Definition at line 53 of file TrackSegment.h.

Member Enumeration Documentation

◆ Author

enum Trk::Segment::Author
inherited

enum to identify who created the segment.

If you update this don't forget to update the dump method.

Enumerator
AuthorUnknown 
MooMdtSegmentMakerTool 
MooCscSegmentMakerTool 
Muonboy 
DCMathSegmentMaker 
MDT_DHoughSegmentMakerTool 
CSC_DHoughSegmentMakerTool 
Csc2dSegmentMaker 
Csc4dSegmentMaker 
TRT_SegmentMaker 
CTBTracking 
DCMathSegmentMakerCurved 
NswStereoSeeded 
NswStgcSeeded 
NswPadSeeded 
NswQuadAlign 
NumberOfAuthors 

Definition at line 62 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

63 {
64 AuthorUnknown = 0,
67 Muonboy = 3,
74 CTBTracking = 10,
76 NswStereoSeeded = 12,
77 NswStgcSeeded = 13,
78 NswPadSeeded = 14,
79 NswQuadAlign = 15,
81 };

Constructor & Destructor Documentation

◆ TrackSegment() [1/4]

Trk::TrackSegment::TrackSegment ( )

Default Constructor for POOL.

Definition at line 20 of file TrackSegment.cxx.

21 : Trk::Segment()
23 , m_globalPosition(INVALID_VECTOR3D)
24{
25}
Amg::Vector3D m_globalPosition
Trk::SurfacePtrHolderImplDetEl< Surface > SurfacePtrHolderDetEl

◆ TrackSegment() [2/4]

Trk::TrackSegment::TrackSegment ( const TrackSegment & seg)
default

Copy Constructor.

◆ TrackSegment() [3/4]

Trk::TrackSegment::TrackSegment ( TrackSegment && )
defaultnoexcept

Move Constructor.

◆ TrackSegment() [4/4]

Trk::TrackSegment::TrackSegment ( Trk::LocalParameters && locpars,
Amg::MatrixX && locerr,
const Surface * sf,
DataVector< const MeasurementBase > && crots,
FitQuality * fqual,
Segment::Author author = Segment::AuthorUnknown )

Constructor with parameters.

Definition at line 28 of file TrackSegment.cxx.

34 : Trk::Segment(std::move(locpars), std::move(locerr),
35 std::move(crots), fqual, author)
37 , m_globalPosition(INVALID_VECTOR3D)
38{
42 }
43}
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Author author() const
return segment author
Eigen::Matrix< double, 3, 1 > Vector3D

◆ ~TrackSegment()

virtual Trk::TrackSegment::~TrackSegment ( )
virtualdefault

Destructor.

Member Function Documentation

◆ associatedSurface()

const Surface & Trk::TrackSegment::associatedSurface ( ) const
inlinefinaloverridevirtual

returns the surface for the local to global transformation

Implements Trk::MeasurementBase.

Definition at line 112 of file TrackSegment.h.

113{
114 return (*m_associatedSurface);
115}

◆ author()

Segment::Author Trk::Segment::author ( ) const
inlineinherited

return segment author

Definition at line 199 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

200{
201 return m_author;
202}

◆ clone()

TrackSegment * Trk::TrackSegment::clone ( ) const
inlinefinaloverridevirtual

needed to avoid excessive RTTI

Implements Trk::Segment.

Definition at line 106 of file TrackSegment.h.

107{
108 return new TrackSegment(*this);
109}
TrackSegment()
Default Constructor for POOL.

◆ cloneHelper()

const Surface * Trk::SurfacePtrHolderImplDetEl< Surface >::cloneHelper ( const Surface * input)
inlinestaticinherited

Helper for cloning or not when we need depending on if we have an associatedDetectorElement.

Definition at line 213 of file SurfaceHolderImpl.h.

214 {
215 return (input && input->associatedDetectorElement() == nullptr
216 ? input->clone()
217 : input);
218 }

◆ containedMeasurements()

const std::vector< const MeasurementBase * > & Trk::Segment::containedMeasurements ( ) const
inlineinherited

returns the vector of Trk::MeasurementBase objects

Definition at line 166 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

167{
168 return m_containedMeasBases.stdcont();
169}
DataVector< const MeasurementBase > m_containedMeasBases
The vector of contained (generic) Trk::MeasurementBase objects.

◆ containedMeasurementsDataVector()

const DataVector< const MeasurementBase > & Trk::Segment::containedMeasurementsDataVector ( ) const
inlineinherited

Definition at line 172 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

173{
175}

◆ destroySurface()

void Trk::SurfacePtrHolderImplDetEl< Surface >::destroySurface ( )
inlinenoexceptinherited

destroySurface deletes the ptr if not null and the surface has not a associatedDetectorElement Usefull also for testing

Definition at line 201 of file SurfaceHolderImpl.h.

202 {
204 m_associatedSurface->associatedDetectorElement() == nullptr) {
205 delete m_associatedSurface;
206 }
207 //
208 m_associatedSurface = nullptr;
209 }

◆ dump() [1/2]

MsgStream & Trk::TrackSegment::dump ( MsgStream & out) const
finaloverridevirtual

returns some information about this MeasurementBase/TrackSegment.

It should be overloaded by any child classes

Implements Trk::MeasurementBase.

Definition at line 52 of file TrackSegment.cxx.

53{
54 out << "Trk::TrackSegment (generic track segment) " << std::endl;
55 out << " - it contains : " << numberOfMeasurementBases()
56 << " RIO_OnTrack object" << std::endl;
57 out << " - parmaters : " << std::endl;
58 out << " - parameter key : " << std::endl;
59 // TODO - out proper output (see MuonSegment) EJWM
60 return out;
61}
unsigned int numberOfMeasurementBases() const
Return the number of contained Trk::MeasurementBase (s).

◆ dump() [2/2]

std::ostream & Trk::TrackSegment::dump ( std::ostream & out) const
finaloverridevirtual

returns some information about this MeasurementBase/TrackSegment.

It should be overloaded by any child classes

Implements Trk::MeasurementBase.

Definition at line 64 of file TrackSegment.cxx.

65{
66 out << "Trk::TrackSegment (generic track segment) " << std::endl;
67 out << " - it contains : " << numberOfMeasurementBases()
68 << " RIO_OnTrack object" << std::endl;
69 out << " - parmaters : " << std::endl;
70 out << " - parameter key : " << std::endl;
71 // TODO - out proper output (see MuonSegment) EJWM
72 return out;
73}

◆ dumpAuthor()

std::string Trk::Segment::dumpAuthor ( ) const
inherited

returns human readble string version of author

Definition at line 99 of file Tracking/TrkEvent/TrkSegment/src/Segment.cxx.

99 {
100 std::string author;
101 switch (m_author) {
102 case AuthorUnknown:
103 author = "AuthorUnknown";
104 break;
106 author = "MooMdtSegmentMakerTool";
107 break;
109 author = "MooCscSegmentMakerTool";
110 break;
111 case Muonboy:
112 author = "Muonboy";
113 break;
115 author = "DCMathSegmentMaker";
116 break;
118 author = "MDT_DHoughSegmentMakerTool";
119 break;
121 author = "CSC_DHoughSegmentMakerTool";
122 break;
124 author = "Csc2dSegmentMaker";
125 break;
127 author = "Csc4dSegmentMaker";
128 break;
129 case TRT_SegmentMaker:
130 author = "TRT_SegmentMaker";
131 break;
132 case NswStereoSeeded:
133 author = "Nsw MM stereo seeded";
134 break;
135 case NswStgcSeeded:
136 author = "Nsw sTgc seeded";
137 break;
138 case NswQuadAlign:
139 author = "Nsw single quad";
140 break;
141 case NswPadSeeded:
142 author = "Nsw single quad";
143 break;
144 default:
145 author = "Unrecognised author, enum = " + std::to_string(m_author);
146 break;
147 }
148 return author;
149}

◆ fitQuality()

const FitQuality * Trk::Segment::fitQuality ( ) const
inlineinherited

return the FitQuality object, returns NULL if no FitQuality is defined

Definition at line 160 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

161{
162 return m_fitQuality.get();
163}
std::unique_ptr< FitQuality > m_fitQuality
The fit quality of the Segment.

◆ globalPosition()

const Amg::Vector3D & Trk::TrackSegment::globalPosition ( ) const
finaloverridevirtual

Interface method to get the global Position.

Implements Trk::MeasurementBase.

Definition at line 46 of file TrackSegment.cxx.

47{
48 return m_globalPosition;
49}

◆ hasContainedMeasurements()

bool Trk::Segment::hasContainedMeasurements ( ) const
inlineinherited

Definition at line 178 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

179{
180 return !m_containedMeasBases.empty();
181}

◆ localCovariance()

const Amg::MatrixX & Trk::MeasurementBase::localCovariance ( ) const
inlineinherited

Interface method to get the localError.

Definition at line 138 of file MeasurementBase.h.

139{
140 return m_localCovariance;
141}
Amg::MatrixX m_localCovariance

◆ localParameters()

const Trk::LocalParameters & Trk::MeasurementBase::localParameters ( ) const
inlineinherited

Interface method to get the LocalParameters.

Definition at line 132 of file MeasurementBase.h.

133{
134 return m_localParams;
135}
LocalParameters m_localParams

◆ measurement()

const MeasurementBase * Trk::Segment::measurement ( unsigned int indx) const
inlineinherited

returns the Trk::MeasurementBase objects depending on the integer

Definition at line 184 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

185{
186 if (!m_containedMeasBases.empty() && indx < m_containedMeasBases.size()) {
187 return std::as_const(m_containedMeasBases)[indx];
188 }
189 return nullptr;
190}

◆ numberOfInstantiations()

std::size_t Trk::ObjectCounter< Trk::Segment >::numberOfInstantiations ( )
inlinestaticinherited

Definition at line 25 of file TrkObjectCounter.h.

26 {
27#ifndef NDEBUG
28 return s_numberOfInstantiations.load();
29#endif
30 return 0;
31 }
Helper to enable counting number of instantiations in debug builds.

◆ numberOfMeasurementBases()

unsigned int Trk::Segment::numberOfMeasurementBases ( ) const
inlineinherited

Return the number of contained Trk::MeasurementBase (s).

Definition at line 193 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

194{
195 return m_containedMeasBases.size();
196}

◆ operator=() [1/2]

TrackSegment & Trk::TrackSegment::operator= ( const TrackSegment & seg)
default

Assignment operator.

◆ operator=() [2/2]

TrackSegment & Trk::TrackSegment::operator= ( TrackSegment && )
defaultnoexcept

Move assignment operator.

◆ release()

const Surface * Trk::SurfacePtrHolderImplDetEl< Surface >::release ( )
inlinenoexceptinherited

release ala unique_ptr release

Definition at line 192 of file SurfaceHolderImpl.h.

193 {
194 const S* tmp = m_associatedSurface;
195 m_associatedSurface = nullptr;
196 return tmp;
197 }

◆ setAuthor()

void Trk::Segment::setAuthor ( Author a)
inherited

sets the segment author

Definition at line 150 of file Tracking/TrkEvent/TrkSegment/src/Segment.cxx.

150 {
151 m_author = a;
152}
static Double_t a

◆ surfacePtr()

const Surface * Trk::SurfacePtrHolderImplDetEl< Surface >::surfacePtr ( )
inlineinherited

return the ptr we hold useful for tests

Definition at line 190 of file SurfaceHolderImpl.h.

190{ return m_associatedSurface; }

◆ type()

virtual bool Trk::Segment::type ( MeasurementBaseType::Type type) const
inlinefinaloverridevirtualinherited

Extended method checking the type.

Implements Trk::MeasurementBase.

Definition at line 114 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

115 {
117 }
virtual bool type(MeasurementBaseType::Type type) const override final
Extended method checking the type.

◆ uniqueClone()

std::unique_ptr< Segment > Trk::Segment::uniqueClone ( ) const
inlineinherited

NVI uniqueClone method.

Definition at line 108 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

109 {
110 return std::unique_ptr<Segment>(clone());
111 }
virtual Segment * clone() const override=0
Pseudo-constructor: needed to avoid excessive RTTI.

◆ ::TrackSegmentCnv_p1

friend class ::TrackSegmentCnv_p1
friend

Definition at line 100 of file TrackSegment.h.

Member Data Documentation

◆ m_associatedSurface

const Surface* Trk::SurfacePtrHolderImplDetEl< Surface >::m_associatedSurface
protectedinherited

Definition at line 221 of file SurfaceHolderImpl.h.

◆ m_author

Author Trk::Segment::m_author
protectedinherited

segment author

Definition at line 156 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

◆ m_containedMeasBases

DataVector<const MeasurementBase> Trk::Segment::m_containedMeasBases
protectedinherited

The vector of contained (generic) Trk::MeasurementBase objects.

Definition at line 153 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

◆ m_fitQuality

std::unique_ptr<FitQuality> Trk::Segment::m_fitQuality
protectedinherited

The fit quality of the Segment.

Definition at line 150 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

◆ m_globalPosition

Amg::Vector3D Trk::TrackSegment::m_globalPosition
private

Definition at line 102 of file TrackSegment.h.

◆ m_localCovariance

Amg::MatrixX Trk::MeasurementBase::m_localCovariance
protectedinherited

Definition at line 112 of file MeasurementBase.h.

◆ m_localParams

LocalParameters Trk::MeasurementBase::m_localParams
protectedinherited

Definition at line 111 of file MeasurementBase.h.

◆ s_numberOfInstantiations

std::atomic_size_t Trk::ObjectCounter< Trk::Segment >::s_numberOfInstantiations
inlinestaticinherited

Definition at line 22 of file TrkObjectCounter.h.


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