ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::Segment Class Referenceabstract

Base class for all TrackSegment implementations, extends the common MeasurementBase. More...

#include <Segment.h>

Inheritance diagram for Trk::Segment:
Collaboration diagram for Trk::Segment:

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

 Segment ()
 Default Constructor for POOL.
 Segment (const Segment &seg)
 Copy Constructor.
 Segment (Segment &&) noexcept
 Move Constructor.
Segment & operator= (const Segment &seg)
 Assignment operator.
Segment & operator= (Segment &&) noexcept
 Move assignment operator.
 Segment (LocalParameters &&locpars, Amg::MatrixX &&locerr, DataVector< const MeasurementBase > &&measurements, FitQuality *fitq=nullptr, Author author=AuthorUnknown)
 Constructor with parameters.
virtual ~Segment ()
 Destructor.
virtual Segment * clone () const override=0
 Pseudo-constructor: needed to avoid excessive RTTI.
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.
virtual const Surface & associatedSurface () const =0
 Interface method to get the associated Surface.
virtual const Amg::Vector3D & globalPosition () const =0
 Interface method to get the global Position.
virtual MsgStream & dump (MsgStream &out) const =0
 Interface method for output, to be overloaded by child classes*.
virtual std::ostream & dump (std::ostream &out) const =0
 Interface method for output, to be overloaded by child classes*.

Static Public Member Functions

static std::size_t numberOfInstantiations ()

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

Friends

class ::SegmentCnv_p1

Detailed Description

Base class for all TrackSegment implementations, extends the common MeasurementBase.

Trk::LocalParameters, an Trk::ErrorMatrix and a number of fitted RIOs are the commonalities of all track segments, the derived classes can overwrite the base class definitions of Trk::RIO_OnTrack, Trk::PrepRawData and Trk::Surface with derived classes for internal use and to avoid extensive RTTI.

The Surface is chosen not to be a private member of the base class, such that dedicated Segments can save specific Surface types and overwrite the return type by a child class to avoid extensive RTTI.

Access to any information of the contained ROTs, such as the underlying Trk::PrepRawData, the pointer to the Trk::DetectorElementBase such as identifiers have to be retrieved from the ROT itself.

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 Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.h.

Member Enumeration Documentation

◆ Author

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

◆ Segment() [1/4]

Trk::Segment::Segment ( )

Default Constructor for POOL.

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

16 : Trk::MeasurementBase()
17 , Trk::ObjectCounter<Trk::Segment>()
18 , m_fitQuality(nullptr)
21{
22}
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.

◆ Segment() [2/4]

Trk::Segment::Segment ( const Segment & seg)

Copy Constructor.

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

39 : Trk::MeasurementBase(seg)
40 , Trk::ObjectCounter<Trk::Segment>(seg)
41 , m_fitQuality(seg.m_fitQuality ? seg.m_fitQuality->clone() : nullptr)
43 , m_author(seg.m_author)
44{
45 // DV deep copy
46 m_containedMeasBases.reserve(seg.m_containedMeasBases.size());
47 for (const Trk::MeasurementBase* const measurement :
48 seg.m_containedMeasBases) {
49 m_containedMeasBases.push_back(measurement->clone());
50 }
51}
const MeasurementBase * measurement(unsigned int) const
returns the Trk::MeasurementBase objects depending on the integer

◆ Segment() [3/4]

Trk::Segment::Segment ( Trk::Segment && seg)
noexcept

Move Constructor.

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

55 : Trk::MeasurementBase(seg)
56 , m_fitQuality(std::move(seg.m_fitQuality))
58 , m_author(seg.m_author)
59{
60}

◆ Segment() [4/4]

Trk::Segment::Segment ( Trk::LocalParameters && locpars,
Amg::MatrixX && locerr,
DataVector< const MeasurementBase > && measurements,
FitQuality * fitq = nullptr,
Author author = AuthorUnknown )

Constructor with parameters.

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

29 : Trk::MeasurementBase(std::move(locpars), std::move(locerr))
30 , Trk::ObjectCounter<Trk::Segment>()
31 , m_fitQuality(fitqual)
32 , m_containedMeasBases(std::move(measurements))
34{
35}
Author author() const
return segment author

◆ ~Segment()

Trk::Segment::~Segment ( )
virtualdefault

Destructor.

Member Function Documentation

◆ associatedSurface()

◆ author()

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

return segment author

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

200{
201 return m_author;
202}

◆ clone()

virtual Segment * Trk::Segment::clone ( ) const
overridepure virtual

Pseudo-constructor: needed to avoid excessive RTTI.

Implements Trk::MeasurementBase.

Implemented in Muon::MuonSegment, MuonSegment, and Trk::TrackSegment.

◆ containedMeasurements()

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

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}

◆ containedMeasurementsDataVector()

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

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

173{
175}

◆ dump() [1/2]

◆ dump() [2/2]

◆ dumpAuthor()

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

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
inline

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}

◆ globalPosition()

◆ hasContainedMeasurements()

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

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
inline

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
inline

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]

Trk::Segment & Trk::Segment::operator= ( const Segment & seg)

Assignment operator.

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

68{
69 if (this != &seg) {
71 m_fitQuality.reset(seg.m_fitQuality ? seg.m_fitQuality->clone() : nullptr);
72 // Deep copy
74 m_containedMeasBases.reserve(seg.m_containedMeasBases.size());
75 for (const Trk::MeasurementBase* const measurement :
76 seg.m_containedMeasBases) {
77 m_containedMeasBases.push_back(measurement->clone());
78 }
79 m_author = seg.m_author;
80 }
81 return (*this);
82}
MeasurementBase & operator=(const MeasurementBase &)=default

◆ operator=() [2/2]

Trk::Segment & Trk::Segment::operator= ( Trk::Segment && seg)
noexcept

Move assignment operator.

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

88{
89 if (this != &seg) {
91 m_fitQuality = std::move(seg.m_fitQuality);
92 //called function throws exception of type SG::ExcInsertionInBaseClass.
94 m_author = seg.m_author;
95 }
96 return (*this);
97}

◆ setAuthor()

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

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

◆ type()

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

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
inline

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.

◆ ::SegmentCnv_p1

friend class ::SegmentCnv_p1
friend

Member Data Documentation

◆ m_author

Author Trk::Segment::m_author
protected

segment author

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

◆ m_containedMeasBases

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

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
protected

The fit quality of the Segment.

Definition at line 150 of file Tracking/TrkEvent/TrkSegment/TrkSegment/Segment.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: