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 (int sector)
 Set the main sector of the pattern.
void setSecondarySector (int sector)
 Set the associated sector to the bucket in case of overlap.
void setNPrecisionHits (unsigned n)
 Set the number of precision hits in the pattern.
void setNEtaNonPrecisionHits (unsigned n)
 Set the number of eta non-precision hits in the pattern.
void setNPhiHits (unsigned n)
 Set the number of phi hits 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.
int sector () const
 Return the main sector where the pattern is located.
bool isSectorOverlap () const
 Return whether the pattern is located in the overlap region between two sectors.
int secondarySector () const
 Return the associated sector to the bucket.
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 nPrecisionHits () const
 Return the number of precision hits in the pattern.
unsigned nEtaNonPrecisionHits () const
 Return the number of eta non-precision hits in the pattern.
unsigned nPhiHits () const
 Return the number of phi hits 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_nPrecisionHits {0}
 Number of precision hits.
unsigned m_nEtaNonPrecisionHits {0}
 Number of eta non-precision measurements.
unsigned m_nPhiHits {0}
 Number of phi measurements.
double m_meanNormResidual2 {0.}
 Mean over eta hits of the square of their residual divided by acceptance window from pattern finding.
int m_sector1 {-1}
int m_sector2 {-1}
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 14 of file GlobalPattern.h.

Member Typedef Documentation

◆ HitCollection

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

Definition at line 18 of file GlobalPattern.h.

◆ HitType

Definition at line 16 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 10 of file GlobalPattern.cxx.

11 : 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 13 of file GlobalPattern.cxx.

13 {
14 std::vector<StIndex> out{};
15 out.reserve(m_hitsInStation.size());
16 std::ranges::transform(m_hitsInStation, std::back_inserter(out),
17 [](const auto& pair){ return pair.first;});
18 return out;
19}

◆ hitsInStation()

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

Return the pattern hits in the given station.

Definition at line 21 of file GlobalPattern.cxx.

21 {
22 const auto& it = m_hitsInStation.find(station);
23 if (it != m_hitsInStation.end()) {
24 return it->second;
25 }
26 static const std::vector<HitType> empty{};
27 return empty;
28}
static const Attributes_t empty

◆ hitsPerStation()

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

Return the hits per station.

Definition at line 69 of file GlobalPattern.h.

69{ 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 51 of file GlobalPattern.h.

◆ 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 67 of file GlobalPattern.h.

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

◆ nEtaNonPrecisionHits()

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

Return the number of eta non-precision hits in the pattern.

Definition at line 63 of file GlobalPattern.h.

63{ return m_nEtaNonPrecisionHits; }
unsigned m_nEtaNonPrecisionHits
Number of eta non-precision measurements.

◆ nPhiHits()

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

Return the number of phi hits in the pattern.

Definition at line 65 of file GlobalPattern.h.

65{ return m_nPhiHits; }
unsigned m_nPhiHits
Number of phi measurements.

◆ nPrecisionHits()

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

Return the number of precision hits in the pattern.

Definition at line 61 of file GlobalPattern.h.

61{ return m_nPrecisionHits; }
unsigned m_nPrecisionHits
Number of precision hits.

◆ operator==()

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

Equality operator.

Definition at line 77 of file GlobalPattern.h.

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

◆ phi()

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

Return the average global phi of the pattern.

Definition at line 47 of file GlobalPattern.h.

47{ 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 35 of file GlobalPattern.cxx.

35 {
36 ostr<<"SpacePoint Pattern, Sector: "<< sector() << " & " << (isSectorOverlap() ? std::to_string(secondarySector()) : "-")
37 <<", theta: "<<theta() << ", Phi: "<<phi()<< " Sector Phi: "<<sectorPhi()
38 <<", nPrecisionHits: "<<nPrecisionHits()<<", nEtaNonPrecisionHits: "<<nEtaNonPrecisionHits()<<", nPhiHits: "<<nPhiHits()
39 <<", mean normalized residual squared: "<<meanNormResidual2();
40 ostr<<", Hit per station: \n";
41 for (const auto& [station, hits] : m_hitsInStation) {
42 ostr<<" Station "<<stName(station)<<": "<<hits.size()<<" hits\n";
43 for (const auto& hit : hits) {
44 ostr<<" "<<*hit<<"\n";
45 }
46 }
47}
unsigned nPhiHits() const
Return the number of phi hits in the pattern.
int secondarySector() const
Return the associated sector to the bucket.
unsigned nPrecisionHits() const
Return the number of precision hits 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.
unsigned nEtaNonPrecisionHits() const
Return the number of eta non-precision hits in the pattern.
int sector() const
Return the main sector where the pattern is located.
const std::string & stName(StIndex index)
convert StIndex into a string

◆ secondarySector()

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

Return the associated sector to the bucket.

Definition at line 53 of file GlobalPattern.h.

53{ return m_sector2; }

◆ sector()

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

Return the main sector where the pattern is located.

Definition at line 49 of file GlobalPattern.h.

49{ return m_sector1; }

◆ 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 30 of file GlobalPattern.cxx.

30 {
31 static const Muon::MuonSectorMapping sectorMap{};
32 return sectorMap.sectorOverlapPhi(sector(), secondarySector());
33}
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 41 of file GlobalPattern.h.

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

◆ setNEtaNonPrecisionHits()

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

Set the number of eta non-precision hits in the pattern.

Definition at line 37 of file GlobalPattern.h.

◆ setNPhiHits()

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

Set the number of phi hits in the pattern.

Definition at line 39 of file GlobalPattern.h.

39{ m_nPhiHits = n; }

◆ setNPrecisionHits()

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

Set the number of precision hits in the pattern.

Definition at line 35 of file GlobalPattern.h.

◆ setPhi()

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

Set the average phi of the pattern.

Definition at line 29 of file GlobalPattern.h.

29{ m_phi = phi; }

◆ setSecondarySector()

void MuonR4::GlobalPattern::setSecondarySector ( int sector)
inline

Set the associated sector to the bucket in case of overlap.

Definition at line 33 of file GlobalPattern.h.

33{ m_sector2 = sector; }

◆ setSector()

void MuonR4::GlobalPattern::setSector ( int sector)
inline

Set the main sector of the pattern.

Definition at line 31 of file GlobalPattern.h.

31{ m_sector1 = sector; }

◆ setTheta()

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

Set the average theta of the pattern.

Definition at line 27 of file GlobalPattern.h.

27{ 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 45 of file GlobalPattern.h.

45{ return m_theta; }

◆ operator<<

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

The print-out operator.

Definition at line 72 of file GlobalPattern.h.

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

Member Data Documentation

◆ m_hitsInStation

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

Hits of the pattern organized per station.

Definition at line 102 of file GlobalPattern.h.

102{};

◆ 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 95 of file GlobalPattern.h.

95{0.};

◆ m_nEtaNonPrecisionHits

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

Number of eta non-precision measurements.

Definition at line 91 of file GlobalPattern.h.

91{0};

◆ m_nPhiHits

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

Number of phi measurements.

Definition at line 93 of file GlobalPattern.h.

93{0};

◆ m_nPrecisionHits

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

Number of precision hits.

Definition at line 89 of file GlobalPattern.h.

89{0};

◆ m_phi

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

average global phi of the pattern

Definition at line 87 of file GlobalPattern.h.

87{0.};

◆ m_sector1

int MuonR4::GlobalPattern::m_sector1 {-1}
private

Definition at line 98 of file GlobalPattern.h.

98{-1};

◆ m_sector2

int MuonR4::GlobalPattern::m_sector2 {-1}
private

Definition at line 99 of file GlobalPattern.h.

99{-1};

◆ m_theta

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

average global theta of the pattern

Definition at line 85 of file GlobalPattern.h.

85{0.};

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