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
 Returns true if the expanded sector is a neighbour of the other.
double sectorSize () const
 Return the expanded sector (half) size.

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

Returns true if the expanded sector is a neighbour of the other.

Definition at line 114 of file ExpandedSector.cxx.

114 {
115 const int dS = std::abs(other.sector() - sector());
116 return std::min(dS, nExpanded - dS) <= 1;
117 }

◆ 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 111 of file ExpandedSector.cxx.

111 {
112 return Acts::makeDirectionFromPhiTheta(phi() + 90._degree, 90._degree);
113 }

◆ operator!=()

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

Define the unequal operator.

Definition at line 102 of file ExpandedSector.cxx.

102 {
103 return sector() != other.sector();
104 }

◆ operator<()

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

Define the ordering operator.

Definition at line 96 of file ExpandedSector.cxx.

96 {
97 return sector() < other.sector();
98 }

◆ operator==()

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

Define the equal operator.

Definition at line 99 of file ExpandedSector.cxx.

99 {
100 return sector() == other.sector();
101 }

◆ phi()

double MuonR4::ExpandedSector::phi ( ) const

Returns the phi angle of the expanded sector.

Definition at line 105 of file ExpandedSector.cxx.

105 {
106 return sectorMap.sectorOverlapPhi(msSector(), adjacentMsSector());
107 }
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 108 of file ExpandedSector.cxx.

108 {
109 return Acts::makeDirectionFromPhiTheta(phi(), 90._degree);
110 }

◆ 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 }

◆ sectorSize()

double MuonR4::ExpandedSector::sectorSize ( ) const

Return the expanded sector (half) size.

The overlap size is the same for small and large sectors

Definition at line 86 of file ExpandedSector.cxx.

86 {
87 unsigned sector1 {msSector()};
88 unsigned sector2 {adjacentMsSector()};
89
90 if (sector1 == sector2) {
91 return sectorMap.sectorSize(sector1);
92 }
94 return sectorMap.sectorWidth(sector1) - sectorMap.sectorSize(sector1);
95 }

◆ toString() [1/2]

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

Return the projector as a string.

Definition at line 119 of file ExpandedSector.cxx.

119 {
120 switch (proj){
121 using enum SectorProjector;
122 case leftOverlap: return "leftOverlap";
123 case center: return "center";
124 case rightOverlap: return "rightOverlap";
125 }
126 return "";
127 }

◆ toString() [2/2]

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

Pipe the object to an ostream.

Definition at line 128 of file ExpandedSector.cxx.

128 {
129 ostr<<"Expanded sector: "<<static_cast<int>(sector()) <<" -> "
130 <<projector()<<" of sector "<<msSector();
131 return ostr;
132 }
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 94 of file ExpandedSector.h.

94{0};

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