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

#include <ExpandedSector.h>

Collaboration diagram for MuonR4::ExpandedSector:

Public Types

enum class  SectorProjector : std::int8_t { leftOverlap = -1 , center = 0 , rightOverlap = 1 }
 Enumeration to select the sector projection of the regular MS sector. More...

Public Member Functions

 ExpandedSector (const unsigned msSector, const SectorProjector proj)
 Constructor of the expanded sector taking the regular MS sector number and the projector.
 ExpandedSector (const double phi)
 Constructor from an arbitrary phi angle.
 ExpandedSector (const std::int8_t expSector)
 Constructor from a expanded sector number.
bool operator< (const ExpandedSector &other) const
 Define the ordering operator.
bool operator== (const ExpandedSector &other) const
 Define the equal operator.
bool operator!= (const ExpandedSector &other) const
 Define the unequal operator.
unsigned msSector () const
 Returns the ms sector corresponding to the expanded sector.
unsigned adjacentMsSector () const
 Returns the neighbouring msSector number constructed from the primary sector and the sector overlap projector.
SectorProjector projector () const
 Returns the projector in the corresponding MS sector.
std::int8_t sector () const
 Returns the expanded sector number.
double phi () const
 Returns the phi angle of the expanded sector.
Amg::Vector3D radialDir () const
 Returns the vector pointing radially along the sector plane.
Amg::Vector3D normalDir () const
 Returns the vector that is normal to the plane spanned by the expanded sector.
bool isNeighbour (const ExpandedSector &other) const

Static Public Member Functions

static std::string toString (const SectorProjector proj)
 Return the projector as a string.

Private Member Functions

std::ostream & toString (std::ostream &ostr) const
 Pipe the object to an ostream.

Private Attributes

std::int8_t m_sector {0}
 the sector number stored

Friends

std::ostream & operator<< (std::ostream &ostr, const SectorProjector proj)
 Define the ostream operator.
std::ostream & operator<< (std::ostream &ostr, const ExpandedSector &sec)

Detailed Description

Definition at line 27 of file ExpandedSector.h.

Member Enumeration Documentation

◆ SectorProjector

enum class MuonR4::ExpandedSector::SectorProjector : std::int8_t
strong

Enumeration to select the sector projection of the regular MS sector.

Enumerator
leftOverlap 
center 

Project the segment onto the overlap with the previous sector.

rightOverlap 

Project the segment onto the sector centre.

Definition at line 31 of file ExpandedSector.h.

31 : std::int8_t {
32 leftOverlap = -1,
33 center = 0,
34 rightOverlap = 1
35 };

Constructor & Destructor Documentation

◆ ExpandedSector() [1/3]

MuonR4::ExpandedSector::ExpandedSector ( const unsigned msSector,
const SectorProjector proj )
explicit

Constructor of the expanded sector taking the regular MS sector number and the projector.

Parameters
msSectorNumber of the ms reference sector [1-16]
projSplitting of the sector to the overlap with the left / right adjacent sector or the sector center

Definition at line 48 of file ExpandedSector.cxx.

49 {
50 m_sector = (2*msSector + Acts::toUnderlying(proj)) % nExpanded;
51 }
std::int8_t m_sector
the sector number stored
unsigned msSector() const
Returns the ms sector corresponding to the expanded sector.

◆ ExpandedSector() [2/3]

MuonR4::ExpandedSector::ExpandedSector ( const double phi)
explicit

Constructor from an arbitrary phi angle.

The angle is assigned to the msSectors and then the expanded sector is deduced

Parameters
phiAngle from [-pi, pi]

Definition at line 53 of file ExpandedSector.cxx.

53 {
54 std::vector<int> sectors{};
55 sectorMap.getSectors(phi, sectors);
56 assert(!sectors.empty());
57 if (sectors.size() == 1) {
58 (*this) = ExpandedSector{static_cast<unsigned>(sectors[0]), SectorProjector::center};
59 } else {
60 const int dS = (sectors[1] - sectors[0]) % numberOfSectors();
61 assert(std::abs(dS) == 1);
62 (*this) = ExpandedSector{static_cast<unsigned>(sectors[0]),
63 static_cast<SectorProjector>(dS)};
64 }
65 }
double phi() const
Returns the phi angle of the expanded sector.
SectorProjector
Enumeration to select the sector projection of the regular MS sector.
@ center
Project the segment onto the overlap with the previous sector.
ExpandedSector(const unsigned msSector, const SectorProjector proj)
Constructor of the expanded sector taking the regular MS sector number and the projector.
constexpr unsigned numberOfSectors()
return total number of sectors

◆ ExpandedSector() [3/3]

MuonR4::ExpandedSector::ExpandedSector ( const std::int8_t expSector)
explicit

Constructor from a expanded sector number.

Parameters
expSectorRaw expanded sector number

Definition at line 46 of file ExpandedSector.cxx.

46 :
47 m_sector{expSector}{}

Member Function Documentation

◆ adjacentMsSector()

unsigned MuonR4::ExpandedSector::adjacentMsSector ( ) const

Returns the neighbouring msSector number constructed from the primary sector and the sector overlap projector.

Definition at line 76 of file ExpandedSector.cxx.

76 {
77 const auto [msSec, proj] = msSectorAndProj(sector());
78 if (msSec == 1 && proj == SectorProjector::leftOverlap){
79 return numberOfSectors();
80 } else if (msSec == numberOfSectors() && proj == SectorProjector::rightOverlap) {
81 return 1;
82 }
83 return msSec + Acts::toUnderlying(proj);
84
85 }
@ rightOverlap
Project the segment onto the sector centre.
std::int8_t sector() const
Returns the expanded sector number.

◆ isNeighbour()

bool MuonR4::ExpandedSector::isNeighbour ( const ExpandedSector & other) const

Definition at line 104 of file ExpandedSector.cxx.

104 {
105 const int dS = (other.sector() - sector()) % nExpanded;
106 return std::abs(dS) <= 1;
107 }

◆ msSector()

unsigned MuonR4::ExpandedSector::msSector ( ) const

Returns the ms sector corresponding to the expanded sector.

Note
If the expanded sector is constructed with the left / right overlap. The msSector number might be the adjacent msSector

Definition at line 70 of file ExpandedSector.cxx.

70 {
71 return std::get<0>(msSectorAndProj(sector()));
72 }

◆ normalDir()

Amg::Vector3D MuonR4::ExpandedSector::normalDir ( ) const

Returns the vector that is normal to the plane spanned by the expanded sector.

Definition at line 101 of file ExpandedSector.cxx.

101 {
102 return Acts::makeDirectionFromPhiTheta(phi() + 90._degree, 90._degree);
103 }

◆ operator!=()

bool MuonR4::ExpandedSector::operator!= ( const ExpandedSector & other) const

Define the unequal operator.

Definition at line 92 of file ExpandedSector.cxx.

92 {
93 return sector() != other.sector();
94 }

◆ operator<()

bool MuonR4::ExpandedSector::operator< ( const ExpandedSector & other) const

Define the ordering operator.

Definition at line 86 of file ExpandedSector.cxx.

86 {
87 return sector() < other.sector();
88 }

◆ operator==()

bool MuonR4::ExpandedSector::operator== ( const ExpandedSector & other) const

Define the equal operator.

Definition at line 89 of file ExpandedSector.cxx.

89 {
90 return sector() == other.sector();
91 }

◆ phi()

double MuonR4::ExpandedSector::phi ( ) const

Returns the phi angle of the expanded sector.

Definition at line 95 of file ExpandedSector.cxx.

95 {
96 return sectorMap.sectorOverlapPhi(msSector(), adjacentMsSector());
97 }
unsigned adjacentMsSector() const
Returns the neighbouring msSector number constructed from the primary sector and the sector overlap p...

◆ projector()

SectorProjector MuonR4::ExpandedSector::projector ( ) const

Returns the projector in the corresponding MS sector.

Definition at line 67 of file ExpandedSector.cxx.

67 {
68 return std::get<1>(msSectorAndProj(sector()));
69 }

◆ radialDir()

Amg::Vector3D MuonR4::ExpandedSector::radialDir ( ) const

Returns the vector pointing radially along the sector plane.

Definition at line 98 of file ExpandedSector.cxx.

98 {
99 return Acts::makeDirectionFromPhiTheta(phi(), 90._degree);
100 }

◆ sector()

std::int8_t MuonR4::ExpandedSector::sector ( ) const

Returns the expanded sector number.

Definition at line 73 of file ExpandedSector.cxx.

73 {
74 return m_sector;
75 }

◆ toString() [1/2]

std::string MuonR4::ExpandedSector::toString ( const SectorProjector proj)
static

Return the projector as a string.

Definition at line 109 of file ExpandedSector.cxx.

109 {
110 switch (proj){
111 using enum SectorProjector;
112 case leftOverlap: return "leftOverlap";
113 case center: return "center";
114 case rightOverlap: return "rightOverlap";
115 }
116 return "";
117 }

◆ toString() [2/2]

std::ostream & MuonR4::ExpandedSector::toString ( std::ostream & ostr) const
private

Pipe the object to an ostream.

Definition at line 118 of file ExpandedSector.cxx.

118 {
119 ostr<<"Expanded sector: "<<static_cast<int>(sector()) <<" -> "
120 <<projector()<<" of sector "<<msSector();
121 return ostr;
122 }
SectorProjector projector() const
Returns the projector in the corresponding MS sector.

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & ostr,
const ExpandedSector & sec )
friend

Definition at line 42 of file ExpandedSector.h.

42 {
43 return sec.toString(ostr);
44 }

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream & ostr,
const SectorProjector proj )
friend

Define the ostream operator.

Definition at line 39 of file ExpandedSector.h.

39 {
40 return ostr<<(toString(proj));
41 }
static std::string toString(const SectorProjector proj)
Return the projector as a string.

Member Data Documentation

◆ m_sector

std::int8_t MuonR4::ExpandedSector::m_sector {0}
private

the sector number stored

Definition at line 92 of file ExpandedSector.h.

92{0};

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