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.
std::span< const xAOD::MuonSegment *const > segments () const
 Returns the vector of associated segments.
std::span< const Muon::MuonStationIndex::StIndex > stations () const
 The station indices of the associated sements.
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::Vector3D & position () 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.
std::size_t nStations () const
 Returns the number of stations crossed by the seed.
std::size_t nMeasurements () const
 Returns the number of measurements on the seed.
void prepareOverlap (std::shared_ptr< std::uint8_t > marker)
 Prepare the overlap marker.
void triggerOverlapMarker ()
 Trigger the overlap marker.
bool hasOverlap () const
 Returns whether the seed has been marked for overlap.

Static Public Member Functions

static std::string toString (const Location loc)

Private Member Functions

std::ostream & print (std::ostream &ostr) const
float pathLength (const xAOD::MuonSegment &segment) const
 Return the position of the reference segment if exists.

Private Attributes

Location m_loc {Location::Undefined}
 Location variable.
ExpandedSector m_sector {static_cast<std::int8_t>(0)}
 The expanded sector of the seed (centre/left/right) + sector.
Amg::Vector3D m_pos {Amg::Vector3D::Zero()}
 Posiion of the seed in the seeding space.
std::vector< const xAOD::MuonSegment * > m_segments {}
 List of associated segments.
std::size_t m_nMeasurements {0ul}
 Number of measurements in the seed.
std::vector< Muon::MuonStationIndex::StIndex > m_stations {}
 Number of stations.
std::vector< std::shared_ptr< std::uint8_t > > m_overlapMarker {}
 The overlap marker.

Friends

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

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 )
explicit

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 37 of file MsTrackSeed.cxx.

37 :
38 m_loc{loc}, m_sector{sector}{}
ExpandedSector m_sector
The expanded sector of the seed (centre/left/right) + sector.
Definition MsTrackSeed.h:84
Location m_loc
Location variable.
Definition MsTrackSeed.h:82
ExpandedSector sector() const
Returns the seed's sector.
Definition MsTrackSeed.h:66

Member Function Documentation

◆ addSegment()

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

Append a segment to the seed.

Definition at line 63 of file MsTrackSeed.cxx.

63 {
64 const float path = pathLength(*seg);
65 auto insert_itr = std::ranges::find_if(m_segments,
66 [&](const xAOD::MuonSegment* added){
67 return path < pathLength(*added);
68 });
69 m_segments.insert(insert_itr, seg);
71 if (!Acts::rangeContainsValue(m_stations, toStationIndex(seg->chamberIndex()))) {
72 m_stations.push_back(toStationIndex(seg->chamberIndex()));
73 }
74 }
float pathLength(const xAOD::MuonSegment &segment) const
Return the position of the reference segment if exists.
std::size_t m_nMeasurements
Number of measurements in the seed.
Definition MsTrackSeed.h:90
std::vector< const xAOD::MuonSegment * > m_segments
List of associated segments.
Definition MsTrackSeed.h:88
std::vector< Muon::MuonStationIndex::StIndex > m_stations
Number of stations.
Definition MsTrackSeed.h:92
::Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
std::size_t nMeasurements(const xAOD::MuonSegment &segment)
Returns the number of associated Uncalibrated measurements.
StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
path
python interpreter configuration --------------------------------------—
Definition athena.py:130
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 40 of file MsTrackSeed.cxx.

40 {
41 std::vector<const SpacePointBucket*> returnMe{};
42 for (const xAOD::MuonSegment* trfMe : segments()) {
43 if(const Segment* seg = detailedSegment(*trfMe); seg != nullptr){
44 returnMe.push_back(seg->parent()->parentBucket());
45 }
46 }
47 return returnMe;
48 }
std::span< const xAOD::MuonSegment *const > 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.

◆ hasOverlap()

bool MuonR4::MsTrackSeed::hasOverlap ( ) const

Returns whether the seed has been marked for overlap.

Definition at line 97 of file MsTrackSeed.cxx.

97 {
98 return std::ranges::any_of(m_overlapMarker, [](const auto& m ){ return (*m); });
99 }
std::vector< std::shared_ptr< std::uint8_t > > m_overlapMarker
The overlap marker.
Definition MsTrackSeed.h:94

◆ location()

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

Returns the location of the seed.

Definition at line 39 of file MsTrackSeed.cxx.

39{ return m_loc; }

◆ nMeasurements()

std::size_t MuonR4::MsTrackSeed::nMeasurements ( ) const

Returns the number of measurements on the seed.

Definition at line 76 of file MsTrackSeed.cxx.

76{ return m_nMeasurements; }

◆ nStations()

std::size_t MuonR4::MsTrackSeed::nStations ( ) const

Returns the number of stations crossed by the seed.

Definition at line 75 of file MsTrackSeed.cxx.

75{ return m_stations.size(); }

◆ pathLength()

float MuonR4::MsTrackSeed::pathLength ( const xAOD::MuonSegment & segment) const
private

Return the position of the reference segment if exists.

Definition at line 79 of file MsTrackSeed.cxx.

79 {
80 if (m_segments.empty()) {
81 return 0.;
82 }
83 const xAOD::MuonSegment& ref{*m_segments.front()};
84 return (segment.x() - ref.x())* ref.px() +
85 (segment.y() - ref.y())* ref.py() +
86 (segment.z() - ref.z())* ref.pz();
87 }
const std::regex ref(r_ef)
float px() const
float y() const
Returns the x position.
float z() const
Returns the y position.

◆ position()

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

Returns the seed's position.

Definition at line 77 of file MsTrackSeed.cxx.

77{ return m_pos; }
Amg::Vector3D m_pos
Posiion of the seed in the seeding space.
Definition MsTrackSeed.h:86

◆ prepareOverlap()

void MuonR4::MsTrackSeed::prepareOverlap ( std::shared_ptr< std::uint8_t > marker)

Prepare the overlap marker.

Definition at line 89 of file MsTrackSeed.cxx.

89 {
90 m_overlapMarker.emplace_back(std::move(marker));
91 }

◆ print()

std::ostream & MuonR4::MsTrackSeed::print ( std::ostream & ostr) const
private

Definition at line 18 of file MsTrackSeed.cxx.

18 {
19 ostr<<"MS Track seed @"<<Amg::toString(position())<<", sector: "<<sector() << ", location: "
20 << location()<<", stations: ";
21 for (const auto st : m_stations) { ostr<<st<<", "; }
22 ostr<<std::endl;
23 for (const xAOD::MuonSegment* seg : segments()) {
24 ostr<<" **** "<< printSegment(*seg) <<std::endl;
25 }
26 return ostr;
27 }
const Amg::Vector3D & position() const
Returns the seed's position.
Location location() const
Returns the location of the seed.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
std::string printSegment(const xAOD::MuonSegment &seg)
Print the details of a segment.

◆ 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 51 of file MsTrackSeed.cxx.

52 {
53 std::vector<const xAOD::MuonSegment*>::iterator itr =
54 std::ranges::find(m_segments, exist);
55 if (itr == m_segments.end()){
56 THROW_EXCEPTION("The exisiting segment could not be found");
57 }
58 (*itr) = updated;
59 }
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ sector()

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

Returns the seed's sector.

Definition at line 66 of file MsTrackSeed.h.

66{ return m_sector; }

◆ segments()

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

Returns the vector of associated segments.

Definition at line 50 of file MsTrackSeed.cxx.

50{ return m_segments; }

◆ setPosition()

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

set the seed's position

Definition at line 78 of file MsTrackSeed.cxx.

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

◆ stations()

std::span< const Muon::MuonStationIndex::StIndex > MuonR4::MsTrackSeed::stations ( ) const

The station indices of the associated sements.

Definition at line 60 of file MsTrackSeed.cxx.

60 {
61 return m_stations;
62 }

◆ toString()

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

Definition at line 28 of file MsTrackSeed.cxx.

28 {
29 switch (loc) {
30 using enum Location;
31 case Undefined: return "Undefined";
32 case Barrel: return "Barrel";
33 case Endcap: return "Endcap";
34 }
35 return "";
36 }
Location
Enum defining whether the seed is made in the endcap / barrel.
Definition MsTrackSeed.h:25

◆ triggerOverlapMarker()

void MuonR4::MsTrackSeed::triggerOverlapMarker ( )

Trigger the overlap marker.

Shared seeds are not passed

Definition at line 93 of file MsTrackSeed.cxx.

93 {
94 std::ranges::for_each(m_overlapMarker, [](const auto& m){ (*m) = 1;});
95 m_overlapMarker.clear();
96 }

◆ operator<< [1/2]

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)

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream & ostr,
const MuonR4::MsTrackSeed & seed )
friend

Definition at line 34 of file MsTrackSeed.h.

34 {
35 return seed.print(ostr);
36 }

Member Data Documentation

◆ m_loc

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

Location variable.

Definition at line 82 of file MsTrackSeed.h.

◆ m_nMeasurements

std::size_t MuonR4::MsTrackSeed::m_nMeasurements {0ul}
private

Number of measurements in the seed.

Definition at line 90 of file MsTrackSeed.h.

90{0ul};
unsigned long ul

◆ m_overlapMarker

std::vector<std::shared_ptr<std::uint8_t> > MuonR4::MsTrackSeed::m_overlapMarker {}
private

The overlap marker.

Definition at line 94 of file MsTrackSeed.h.

94{};

◆ m_pos

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

Posiion of the seed in the seeding space.

Definition at line 86 of file MsTrackSeed.h.

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

◆ m_sector

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

The expanded sector of the seed (centre/left/right) + sector.

Definition at line 84 of file MsTrackSeed.h.

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

◆ m_segments

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

List of associated segments.

Definition at line 88 of file MsTrackSeed.h.

88{};

◆ m_stations

std::vector<Muon::MuonStationIndex::StIndex> MuonR4::MsTrackSeed::m_stations {}
private

Number of stations.

Definition at line 92 of file MsTrackSeed.h.

92{};

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