ATLAS Offline Software
Loading...
Searching...
No Matches
MuonR4::MsTrackSeed Class Reference

#include <MsTrackSeed.h>

Collaboration diagram for MuonR4::MsTrackSeed:

Public Types

enum class  Location : int8_t { Undefined =-1 , Barrel , Endcap }
 Enum defining whether the seed is made in the endcap / barrel. More...

Public Member Functions

 MsTrackSeed (const Location loc, const ExpandedSector sector)
 Constructor with location defintion.
const std::vector< const xAOD::MuonSegment * > & segments () const
 Returns the vector of associated segments.
std::vector< const Segment * > detailedSegments () const
 Returns the list of detailed segments.
std::vector< const SpacePointBucket * > buckets () const
 Returns the list of associated buckets.
void addSegment (const xAOD::MuonSegment *seg)
 Append a segment to the seed.
void replaceSegment (const xAOD::MuonSegment *exist, const xAOD::MuonSegment *updated)
 Replaces an already added segment in the seed with a better suited one.
const Amg::Vector3Dposition () const
 Returns the seed's position.
void setPosition (Amg::Vector3D &&pos)
 set the seed's position
Location location () const
 Returns the location of the seed.
ExpandedSector sector () const
 Returns the seed's sector.

Static Public Member Functions

static std::string toString (const Location loc)

Private Attributes

Location m_loc {Location::Undefined}
 Location variable.
ExpandedSector m_sector {static_cast<std::int8_t>(0)}
Amg::Vector3D m_pos {Amg::Vector3D::Zero()}
std::vector< const xAOD::MuonSegment * > m_segments {}

Friends

std::ostream & operator<< (std::ostream &ostr, const Location loc)

Detailed Description

Definition at line 22 of file MsTrackSeed.h.

Member Enumeration Documentation

◆ Location

enum class MuonR4::MsTrackSeed::Location : int8_t
strong

Enum defining whether the seed is made in the endcap / barrel.

Enumerator
Undefined 
Barrel 
Endcap 

Definition at line 25 of file MsTrackSeed.h.

25 : int8_t{
26 Undefined =-1,
27 Barrel,
28 Endcap
29 };
@ Undefined
@ Endcap
Definition DetType.h:14
@ Barrel
Definition DetType.h:14

Constructor & Destructor Documentation

◆ MsTrackSeed()

MuonR4::MsTrackSeed::MsTrackSeed ( const Location loc,
const ExpandedSector sector )

Constructor with location defintion.

Parameters
locLocaltion definition whether the seed is constructed on the barrel or on the endcap surface
sectorIn which tree sector is the seed constructed: sector: 2*MS-sector +- Overlap

Definition at line 52 of file MsTrackSeed.cxx.

52 :
53 m_loc{loc}, m_sector{sector}{}
ExpandedSector m_sector
Definition MsTrackSeed.h:67
Location m_loc
Location variable.
Definition MsTrackSeed.h:66
ExpandedSector sector() const
Returns the seed's sector.
Definition MsTrackSeed.h:63

Member Function Documentation

◆ addSegment()

void MuonR4::MsTrackSeed::addSegment ( const xAOD::MuonSegment * seg)

Append a segment to the seed.

Definition at line 83 of file MsTrackSeed.cxx.

83 {
84 const float r2 = Acts::hypotSquare(seg->x(), seg->y(), seg->z());
85 auto insert_itr = std::ranges::find_if(m_segments,
86 [&r2](const xAOD::MuonSegment* added){
87 return r2 < Acts::hypotSquare(added->x(), added->y(), added->z());
88 });
89 m_segments.insert(insert_itr, seg);
90 }
std::vector< const xAOD::MuonSegment * > m_segments
Definition MsTrackSeed.h:69
float y() const
Returns the x position.
float z() const
Returns the y position.
MuonSegment_v1 MuonSegment
Reference the current persistent version:

◆ buckets()

std::vector< const SpacePointBucket * > MuonR4::MsTrackSeed::buckets ( ) const

Returns the list of associated buckets.

Definition at line 55 of file MsTrackSeed.cxx.

55 {
56 std::vector<const SpacePointBucket*> returnMe{};
57 for (const Segment* seg : detailedSegments()){
58 returnMe.push_back(seg->parent()->parentBucket());
59 }
60 return returnMe;
61 }
std::vector< const Segment * > detailedSegments() const
Returns the list of detailed segments.

◆ detailedSegments()

std::vector< const Segment * > MuonR4::MsTrackSeed::detailedSegments ( ) const

Returns the list of detailed segments.

Definition at line 64 of file MsTrackSeed.cxx.

64 {
65 std::vector<const Segment*> segs{};
66 segs.reserve(segments().size());
67 for (const xAOD::MuonSegment* trfMe : segments()) {
68 if(const Segment* seg = detailedSegment(*trfMe); seg != nullptr){
69 segs.push_back(seg);
70 }
71 }
72 return segs;
73 }
size_t size() const
Number of registered mappings.
const std::vector< const xAOD::MuonSegment * > & segments() const
Returns the vector of associated segments.
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.

◆ location()

MsTrackSeed::Location MuonR4::MsTrackSeed::location ( ) const

Returns the location of the seed.

Definition at line 54 of file MsTrackSeed.cxx.

54{ return m_loc; }

◆ position()

const Amg::Vector3D & MuonR4::MsTrackSeed::position ( ) const

Returns the seed's position.

Definition at line 91 of file MsTrackSeed.cxx.

91{ return m_pos; }
Amg::Vector3D m_pos
Definition MsTrackSeed.h:68

◆ replaceSegment()

void MuonR4::MsTrackSeed::replaceSegment ( const xAOD::MuonSegment * exist,
const xAOD::MuonSegment * updated )

Replaces an already added segment in the seed with a better suited one.

Parameters
existPointer to the segment that is already part of the seed (Exception is thrown if not)
updatedPointer to the segment with which the segment is replaced with

Definition at line 74 of file MsTrackSeed.cxx.

75 {
76 std::vector<const xAOD::MuonSegment*>::iterator itr =
77 std::ranges::find(m_segments, exist);
78 if (itr == m_segments.end()){
79 THROW_EXCEPTION("The exisiting segment could not be found");
80 }
81 (*itr) = updated;
82 }
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ sector()

ExpandedSector MuonR4::MsTrackSeed::sector ( ) const
inline

Returns the seed's sector.

Definition at line 63 of file MsTrackSeed.h.

63{ return m_sector; }

◆ segments()

const std::vector< const xAOD::MuonSegment * > & MuonR4::MsTrackSeed::segments ( ) const

Returns the vector of associated segments.

Definition at line 63 of file MsTrackSeed.cxx.

63{ return m_segments; }

◆ setPosition()

void MuonR4::MsTrackSeed::setPosition ( Amg::Vector3D && pos)

set the seed's position

Definition at line 92 of file MsTrackSeed.cxx.

92{ m_pos = std::move(pos); }

◆ toString()

std::string MuonR4::MsTrackSeed::toString ( const Location loc)
static

Definition at line 43 of file MsTrackSeed.cxx.

43 {
44 switch (loc) {
45 using enum Location;
46 case Undefined: return "Undefined";
47 case Barrel: return "Barrel";
48 case Endcap: return "Endcap";
49 }
50 return "";
51 }
Location
Enum defining whether the seed is made in the endcap / barrel.
Definition MsTrackSeed.h:25

◆ operator<<

std::ostream & operator<< ( std::ostream & ostr,
const Location loc )
friend

Definition at line 31 of file MsTrackSeed.h.

31 {
32 return ostr<<toString(loc);
33 }
static std::string toString(const Location loc)

Member Data Documentation

◆ m_loc

Location MuonR4::MsTrackSeed::m_loc {Location::Undefined}
private

Location variable.

Definition at line 66 of file MsTrackSeed.h.

◆ m_pos

Amg::Vector3D MuonR4::MsTrackSeed::m_pos {Amg::Vector3D::Zero()}
private

Definition at line 68 of file MsTrackSeed.h.

68{Amg::Vector3D::Zero()};

◆ m_sector

ExpandedSector MuonR4::MsTrackSeed::m_sector {static_cast<std::int8_t>(0)}
private

Definition at line 67 of file MsTrackSeed.h.

67{static_cast<std::int8_t>(0)};

◆ m_segments

std::vector<const xAOD::MuonSegment*> MuonR4::MsTrackSeed::m_segments {}
private

Definition at line 69 of file MsTrackSeed.h.

69{};

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