Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
MuonR4::MsTrackSeed Class Reference

#include <MsTrackSeed.h>

Collaboration diagram for MuonR4::MsTrackSeed:

Public Types

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

Public Member Functions

 MsTrackSeed (const Location loc)
 Constructor with location defintion. More...
 
const std::vector< const xAOD::MuonSegment * > & segments () const
 Returns the vector of associated segments. More...
 
const std::vector< const Segment * > & detailedSegments () const
 Returns the list of detailed segments. More...
 
void addSegment (const xAOD::MuonSegment *seg)
 Append a segment to the seed. More...
 
const std::unordered_set< const SpacePointBucket * > & buckets () const
 Returns the list of associated buckets. More...
 
const Amg::Vector3Dposition () const
 Returns the seed's position. More...
 
void setPosition (Amg::Vector3D &&pos)
 set the seed's position More...
 
const MuonGMR4::SpectrometerSectormsSector () const
 Returns the associated MS sector. More...
 
Location location () const
 Returns the location of the seed. More...
 
bool operator== (const MsTrackSeed &other) const
 Equality operator. More...
 
bool operator< (const MsTrackSeed &other) const
 Returns if all segments of this seed are also in the seed as well. More...
 

Static Private Member Functions

static bool compatibleSectors (const MuonGMR4::SpectrometerSector *secA, const MuonGMR4::SpectrometerSector *secB)
 Returns whether two spectrometer sectors may be compatbile. More...
 

Private Attributes

Location m_loc {Location::Undefined}
 
Amg::Vector3D m_pos {Amg::Vector3D::Zero()}
 
std::vector< const xAOD::MuonSegment * > m_segments {}
 
std::vector< const Segment * > m_detSegments {}
 
std::unordered_set< const SpacePointBucket * > m_buckets {}
 

Detailed Description

Definition at line 18 of file MsTrackSeed.h.

Member Enumeration Documentation

◆ Location

enum MuonR4::MsTrackSeed::Location : int8_t
strong

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

Enumerator
Undefined 
Barrel 
Endcap 

Definition at line 21 of file MsTrackSeed.h.

21  : int8_t{
22  Undefined =-1,
23  Barrel,
24  Endcap
25  };

Constructor & Destructor Documentation

◆ MsTrackSeed()

MuonR4::MsTrackSeed::MsTrackSeed ( const Location  loc)

Constructor with location defintion.

Definition at line 49 of file MsTrackSeed.cxx.

49 : m_loc{loc}{}

Member Function Documentation

◆ addSegment()

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

Append a segment to the seed.

Definition at line 55 of file MsTrackSeed.cxx.

55  {
56  const Segment* recoSeg = detailedSegment(*seg);
57  auto insert_itr = std::ranges::find_if(m_detSegments, [recoSeg](const Segment* added){
58  return recoSeg->position().mag2() < added->position().mag2();
59  });
60  m_segments.insert(m_segments.begin() + std::distance(m_detSegments.begin(), insert_itr), seg);
61  m_buckets.insert(recoSeg->parent()->parentBucket());
62  m_detSegments.insert(insert_itr, recoSeg);
63  }

◆ buckets()

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

Returns the list of associated buckets.

Definition at line 51 of file MsTrackSeed.cxx.

51 { return m_buckets; }

◆ compatibleSectors()

bool MuonR4::MsTrackSeed::compatibleSectors ( const MuonGMR4::SpectrometerSector secA,
const MuonGMR4::SpectrometerSector secB 
)
staticprivate

Returns whether two spectrometer sectors may be compatbile.

Parameters
secAFirst sector to compare
secBSecond sector to compare

Definition at line 69 of file MsTrackSeed.cxx.

70  {
71  const unsigned int secMax = Muon::MuonStationIndex::numberOfSectors();
72  return secA->side() == secB->side() &&
73  std::abs(secA->sector() - secB->sector()) % secMax <= 1;
74  }

◆ detailedSegments()

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

Returns the list of detailed segments.

Definition at line 53 of file MsTrackSeed.cxx.

53 { return m_detSegments; }

◆ location()

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

Returns the location of the seed.

Definition at line 50 of file MsTrackSeed.cxx.

50 { return m_loc; }

◆ msSector()

const MuonGMR4::SpectrometerSector * MuonR4::MsTrackSeed::msSector ( ) const

Returns the associated MS sector.

Definition at line 66 of file MsTrackSeed.cxx.

66  {
67  return m_detSegments.size() ? m_detSegments.front()->msSector() : nullptr;
68  }

◆ operator<()

bool MuonR4::MsTrackSeed::operator< ( const MsTrackSeed other) const

Returns if all segments of this seed are also in the seed as well.

Definition at line 35 of file MsTrackSeed.cxx.

35  {
36  if (!compatibleSectors(msSector(), other.msSector()) ||
37  other.segments().size() < segments().size()) {
38  return false;
39  }
40  auto searched_itr = other.segments().begin();
41  for (const xAOD::MuonSegment* seg : m_segments) {
42  searched_itr = std::find(searched_itr, other.segments().end(), seg);
43  if (searched_itr == other.segments().end()) {
44  return false;
45  }
46  }
47  return true;
48  }

◆ operator==()

bool MuonR4::MsTrackSeed::operator== ( const MsTrackSeed other) const

Equality operator.

Definition at line 21 of file MsTrackSeed.cxx.

21  {
22  if (!compatibleSectors(msSector(), other.msSector())) {
23  return false;
24  }
25  if (other.segments().size() != m_segments.size()){
26  return false;
27  }
28  for (size_t s = 0; s < m_segments.size(); ++s) {
29  if (m_segments[s] != other.segments()[s]) {
30  return false;
31  }
32  }
33  return true;
34  }

◆ position()

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

Returns the seed's position.

Definition at line 64 of file MsTrackSeed.cxx.

64 { return m_pos; }

◆ segments()

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

Returns the vector of associated segments.

Definition at line 52 of file MsTrackSeed.cxx.

52 { return m_segments; }

◆ setPosition()

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

set the seed's position

Definition at line 65 of file MsTrackSeed.cxx.

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

Member Data Documentation

◆ m_buckets

std::unordered_set<const SpacePointBucket*> MuonR4::MsTrackSeed::m_buckets {}
private

Definition at line 59 of file MsTrackSeed.h.

◆ m_detSegments

std::vector<const Segment*> MuonR4::MsTrackSeed::m_detSegments {}
private

Definition at line 58 of file MsTrackSeed.h.

◆ m_loc

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

Definition at line 55 of file MsTrackSeed.h.

◆ m_pos

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

Definition at line 56 of file MsTrackSeed.h.

◆ m_segments

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

Definition at line 57 of file MsTrackSeed.h.


The documentation for this class was generated from the following files:
MuonGMR4::SpectrometerSector::sector
int sector() const
Returns the sector of the MS-sector.
Definition: SpectrometerSector.cxx:43
Undefined
@ Undefined
Definition: MaterialTypes.h:8
MuonGMR4::SpectrometerSector::side
int8_t side() const
Returns the side of the MS-sector 1 -> A side ; -1 -> C side.
Definition: SpectrometerSector.cxx:36
DetType::Endcap
@ Endcap
Definition: DetType.h:14
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
Trk::TrackState::Segment
@ Segment
Definition: TrackStateDefs.h:37
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
MuonR4::MsTrackSeed::m_buckets
std::unordered_set< const SpacePointBucket * > m_buckets
Definition: MsTrackSeed.h:59
Muon::MuonStationIndex::numberOfSectors
constexpr unsigned numberOfSectors()
return total number of sectors
Definition: MuonStationIndex.h:116
DetType::Barrel
@ Barrel
Definition: DetType.h:14
MuonR4::detailedSegment
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
Definition: TrackingHelpers.cxx:7
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MuonR4::MsTrackSeed::m_loc
Location m_loc
Definition: MsTrackSeed.h:55
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
MuonR4::MsTrackSeed::msSector
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
Definition: MsTrackSeed.cxx:66
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:146
mag2
Scalar mag2() const
mag2 method - forward to squaredNorm()
Definition: AmgMatrixBasePlugin.h:31
MuonR4::MsTrackSeed::m_pos
Amg::Vector3D m_pos
Definition: MsTrackSeed.h:56
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
MuonR4::MsTrackSeed::compatibleSectors
static bool compatibleSectors(const MuonGMR4::SpectrometerSector *secA, const MuonGMR4::SpectrometerSector *secB)
Returns whether two spectrometer sectors may be compatbile.
Definition: MsTrackSeed.cxx:69
MuonR4::MsTrackSeed::m_detSegments
std::vector< const Segment * > m_detSegments
Definition: MsTrackSeed.h:58
MuonR4::MsTrackSeed::m_segments
std::vector< const xAOD::MuonSegment * > m_segments
Definition: MsTrackSeed.h:57
MuonR4::MsTrackSeed::segments
const std::vector< const xAOD::MuonSegment * > & segments() const
Returns the vector of associated segments.
Definition: MsTrackSeed.cxx:52