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

Data class to represent an eta maximum in hough space. More...

#include <GlobalPattern.h>

Collaboration diagram for MuonR4::GlobalPattern:

Public Types

using HitType = const SpacePoint*
using StIndex = Muon::MuonStationIndex::StIndex
using HitCollection = std::unordered_map<StIndex, std::vector<HitType>>

Public Member Functions

 GlobalPattern (HitCollection &&hitPerStation)
 c-tor consuming the hit collection per station
 GlobalPattern ()=delete
 GlobalPattern (const GlobalPattern &other)=default
 Copy c-tor.
void setTheta (double theta)
 Set the average theta of the pattern.
void setPhi (double phi)
 Set the average phi of the pattern.
void setSector (std::int8_t sector)
 Set the main sector of the pattern.
void setNPrecisionLayers (unsigned n)
 Set the number of precision layers in the pattern.
void setNTriggerLayers (unsigned n)
 Set the number of trigger layers in the pattern.
void setNPhiLayers (unsigned n)
 Set the number of phi layers in the pattern.
void setMeanNormResidual2 (double res)
 Set the mean over eta hits of the square of their residual divided by acceptance window from pattern finding.
double theta () const
 Return the average global theta of the pattern.
double phi () const
 Return the average global phi of the pattern.
unsigned sector () const
 Return the main sector where the pattern is located.
unsigned secondarySector () const
 Return the associated sector to the bucket.
bool isSectorOverlap () const
 Return whether the pattern is located in the overlap region between two sectors.
double sectorPhi () const
 Return the sector phi of the pattern. It is the central phi of the sector or the the value at the edge in case of overlap.
std::vector< StIndexgetStations () const
 Return the associated stations to the pattern.
const std::vector< HitType > & hitsInStation (StIndex station) const
 Return the pattern hits in the given station.
unsigned nPrecisionLayers () const
 Return the number of precision layers in the pattern.
unsigned nTriggerLayers () const
 Return the number of trigger layers in the pattern.
unsigned nPhiLayers () const
 Return the number of phi layers in the pattern.
double meanNormResidual2 () const
 Return the mean over eta hits of the square of their residual divided by acceptance window from pattern finding.
const HitCollectionhitsPerStation () const
 Return the hits per station.
bool operator== (const GlobalPattern &other) const
 Equality operator.

Private Member Functions

void print (std::ostream &ostr) const

Private Attributes

double m_theta {0.}
 average global theta of the pattern
double m_phi {0.}
 average global phi of the pattern
unsigned m_nPrecisionLayers {0}
 Number of precision layers.
unsigned m_nTriggerLayers {0}
 Number of trigger layers.
unsigned m_nPhiLayers {0}
 Number of phi layers.
double m_meanNormResidual2 {0.}
 Mean over eta hits of the square of their residual divided by acceptance window from pattern finding.
ExpandedSector m_sector {static_cast<int8_t>(0)}
const HitCollection m_hitsInStation {}
 Hits of the pattern organized per station.

Friends

std::ostream & operator<< (std::ostream &ostr, const GlobalPattern &gp)
 The print-out operator.

Detailed Description

Data class to represent an eta maximum in hough space.

Definition at line 15 of file GlobalPattern.h.

Member Typedef Documentation

◆ HitCollection

using MuonR4::GlobalPattern::HitCollection = std::unordered_map<StIndex, std::vector<HitType>>

Definition at line 19 of file GlobalPattern.h.

◆ HitType

Definition at line 17 of file GlobalPattern.h.

◆ StIndex

Constructor & Destructor Documentation

◆ GlobalPattern() [1/3]

MuonR4::GlobalPattern::GlobalPattern ( HitCollection && hitPerStation)

c-tor consuming the hit collection per station

Definition at line 15 of file GlobalPattern.cxx.

16 : m_hitsInStation(std::move(hitPerStation)) {};
const HitCollection m_hitsInStation
Hits of the pattern organized per station.

◆ GlobalPattern() [2/3]

MuonR4::GlobalPattern::GlobalPattern ( )
delete

◆ GlobalPattern() [3/3]

MuonR4::GlobalPattern::GlobalPattern ( const GlobalPattern & other)
default

Copy c-tor.

Member Function Documentation

◆ getStations()

std::vector< GlobalPattern::StIndex > MuonR4::GlobalPattern::getStations ( ) const

Return the associated stations to the pattern.

Definition at line 18 of file GlobalPattern.cxx.

18 {
19 std::vector<StIndex> out{};
20 out.reserve(m_hitsInStation.size());
21 std::ranges::transform(m_hitsInStation, std::back_inserter(out),
22 [](const auto& pair){ return pair.first;});
23 return out;
24}

◆ hitsInStation()

const std::vector< GlobalPattern::HitType > & MuonR4::GlobalPattern::hitsInStation ( StIndex station) const

Return the pattern hits in the given station.

Definition at line 26 of file GlobalPattern.cxx.

26 {
27 const auto& it = m_hitsInStation.find(station);
28 if (it != m_hitsInStation.end()) {
29 return it->second;
30 }
31 static const std::vector<HitType> empty{};
32 return empty;
33}
static const Attributes_t empty

◆ hitsPerStation()

const HitCollection & MuonR4::GlobalPattern::hitsPerStation ( ) const
inline

Return the hits per station.

Definition at line 68 of file GlobalPattern.h.

68{ return m_hitsInStation; }

◆ isSectorOverlap()

bool MuonR4::GlobalPattern::isSectorOverlap ( ) const
inline

Return whether the pattern is located in the overlap region between two sectors.

Definition at line 52 of file GlobalPattern.h.

52{ return sector() != secondarySector(); }
unsigned secondarySector() const
Return the associated sector to the bucket.
unsigned sector() const
Return the main sector where the pattern is located.

◆ meanNormResidual2()

double MuonR4::GlobalPattern::meanNormResidual2 ( ) const
inline

Return the mean over eta hits of the square of their residual divided by acceptance window from pattern finding.

Definition at line 66 of file GlobalPattern.h.

66{ return m_meanNormResidual2; }
double m_meanNormResidual2
Mean over eta hits of the square of their residual divided by acceptance window from pattern finding.

◆ nPhiLayers()

unsigned MuonR4::GlobalPattern::nPhiLayers ( ) const
inline

Return the number of phi layers in the pattern.

Definition at line 64 of file GlobalPattern.h.

64{ return m_nPhiLayers; }
unsigned m_nPhiLayers
Number of phi layers.

◆ nPrecisionLayers()

unsigned MuonR4::GlobalPattern::nPrecisionLayers ( ) const
inline

Return the number of precision layers in the pattern.

Definition at line 60 of file GlobalPattern.h.

60{ return m_nPrecisionLayers; }
unsigned m_nPrecisionLayers
Number of precision layers.

◆ nTriggerLayers()

unsigned MuonR4::GlobalPattern::nTriggerLayers ( ) const
inline

Return the number of trigger layers in the pattern.

Definition at line 62 of file GlobalPattern.h.

62{ return m_nTriggerLayers; }
unsigned m_nTriggerLayers
Number of trigger layers.

◆ operator==()

bool MuonR4::GlobalPattern::operator== ( const GlobalPattern & other) const
inline

Equality operator.

Definition at line 76 of file GlobalPattern.h.

76 {
77 return m_hitsInStation == other.m_hitsInStation;
78 }

◆ phi()

double MuonR4::GlobalPattern::phi ( ) const
inline

Return the average global phi of the pattern.

Definition at line 46 of file GlobalPattern.h.

46{ return m_phi; }
double m_phi
average global phi of the pattern

◆ print()

void MuonR4::GlobalPattern::print ( std::ostream & ostr) const
private

Definition at line 40 of file GlobalPattern.cxx.

40 {
41 ostr<<"SpacePoint Pattern, Sector: "<< sector() << " & " << (isSectorOverlap() ? std::to_string(secondarySector()) : "-")
42 <<", theta: "<<inDegrees(theta()) << ", Phi: "<<inDegrees(phi())<< " Sector Phi: "<<inDegrees(sectorPhi())
43 <<", nPrecisionLayers: "<<nPrecisionLayers()<<", nTriggerLayers: "<<nTriggerLayers()<<", nPhiLayers: "<<nPhiLayers()
44 <<", mean normalized residual squared: "<<meanNormResidual2();
45 ostr<<", Hit per station: \n";
46 for (const auto& [station, hits] : m_hitsInStation) {
47 ostr<<" Station "<<stName(station)<<": "<<hits.size()<<" hits\n";
48 for (const auto& hit : hits) {
49 ostr<<" "<<*hit<<"\n";
50 }
51 }
52}
unsigned nTriggerLayers() const
Return the number of trigger layers in the pattern.
unsigned nPrecisionLayers() const
Return the number of precision layers in the pattern.
unsigned nPhiLayers() const
Return the number of phi layers in the pattern.
bool isSectorOverlap() const
Return whether the pattern is located in the overlap region between two sectors.
double phi() const
Return the average global phi of the pattern.
double sectorPhi() const
Return the sector phi of the pattern. It is the central phi of the sector or the the value at the edg...
double meanNormResidual2() const
Return the mean over eta hits of the square of their residual divided by acceptance window from patte...
double theta() const
Return the average global theta of the pattern.
const std::string & stName(StIndex index)
convert StIndex into a string

◆ secondarySector()

unsigned MuonR4::GlobalPattern::secondarySector ( ) const
inline

Return the associated sector to the bucket.

Definition at line 50 of file GlobalPattern.h.

50{ return m_sector.adjacentMsSector(); }
ExpandedSector m_sector

◆ sector()

unsigned MuonR4::GlobalPattern::sector ( ) const
inline

Return the main sector where the pattern is located.

Definition at line 48 of file GlobalPattern.h.

48{ return m_sector.msSector(); }

◆ sectorPhi()

double MuonR4::GlobalPattern::sectorPhi ( ) const

Return the sector phi of the pattern. It is the central phi of the sector or the the value at the edge in case of overlap.

Definition at line 35 of file GlobalPattern.cxx.

35 {
36 static const Muon::MuonSectorMapping sectorMap{};
37 return sectorMap.sectorOverlapPhi(sector(), secondarySector());
38}
double sectorOverlapPhi(int sector1, int sector2) const
returns the phi position of the overlap between the two sectors (which have to be neighboring) in rad...

◆ setMeanNormResidual2()

void MuonR4::GlobalPattern::setMeanNormResidual2 ( double res)
inline

Set the mean over eta hits of the square of their residual divided by acceptance window from pattern finding.

Definition at line 40 of file GlobalPattern.h.

std::pair< std::vector< unsigned int >, bool > res

◆ setNPhiLayers()

void MuonR4::GlobalPattern::setNPhiLayers ( unsigned n)
inline

Set the number of phi layers in the pattern.

Definition at line 38 of file GlobalPattern.h.

◆ setNPrecisionLayers()

void MuonR4::GlobalPattern::setNPrecisionLayers ( unsigned n)
inline

Set the number of precision layers in the pattern.

Definition at line 34 of file GlobalPattern.h.

◆ setNTriggerLayers()

void MuonR4::GlobalPattern::setNTriggerLayers ( unsigned n)
inline

Set the number of trigger layers in the pattern.

Definition at line 36 of file GlobalPattern.h.

◆ setPhi()

void MuonR4::GlobalPattern::setPhi ( double phi)
inline

Set the average phi of the pattern.

Definition at line 30 of file GlobalPattern.h.

30{ m_phi = phi; }

◆ setSector()

void MuonR4::GlobalPattern::setSector ( std::int8_t sector)
inline

Set the main sector of the pattern.

Definition at line 32 of file GlobalPattern.h.

32{ m_sector = ExpandedSector{sector}; }

◆ setTheta()

void MuonR4::GlobalPattern::setTheta ( double theta)
inline

Set the average theta of the pattern.

Definition at line 28 of file GlobalPattern.h.

28{ m_theta = theta; }
double m_theta
average global theta of the pattern

◆ theta()

double MuonR4::GlobalPattern::theta ( ) const
inline

Return the average global theta of the pattern.

Definition at line 44 of file GlobalPattern.h.

44{ return m_theta; }

◆ operator<<

std::ostream & operator<< ( std::ostream & ostr,
const GlobalPattern & gp )
friend

The print-out operator.

Definition at line 71 of file GlobalPattern.h.

71 {
72 gp.print(ostr);
73 return ostr;
74 }

Member Data Documentation

◆ m_hitsInStation

const HitCollection MuonR4::GlobalPattern::m_hitsInStation {}
private

Hits of the pattern organized per station.

Definition at line 100 of file GlobalPattern.h.

100{};

◆ m_meanNormResidual2

double MuonR4::GlobalPattern::m_meanNormResidual2 {0.}
private

Mean over eta hits of the square of their residual divided by acceptance window from pattern finding.

Definition at line 94 of file GlobalPattern.h.

94{0.};

◆ m_nPhiLayers

unsigned MuonR4::GlobalPattern::m_nPhiLayers {0}
private

Number of phi layers.

Definition at line 92 of file GlobalPattern.h.

92{0};

◆ m_nPrecisionLayers

unsigned MuonR4::GlobalPattern::m_nPrecisionLayers {0}
private

Number of precision layers.

Definition at line 88 of file GlobalPattern.h.

88{0};

◆ m_nTriggerLayers

unsigned MuonR4::GlobalPattern::m_nTriggerLayers {0}
private

Number of trigger layers.

Definition at line 90 of file GlobalPattern.h.

90{0};

◆ m_phi

double MuonR4::GlobalPattern::m_phi {0.}
private

average global phi of the pattern

Definition at line 86 of file GlobalPattern.h.

86{0.};

◆ m_sector

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

Definition at line 97 of file GlobalPattern.h.

97{static_cast<int8_t>(0)};

◆ m_theta

double MuonR4::GlobalPattern::m_theta {0.}
private

average global theta of the pattern

Definition at line 84 of file GlobalPattern.h.

84{0.};

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