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 setTotalResidual (double res)
 Total residual of the pattern from pattern finding.
void setTotalNormalizedResidual (double res)
 Total normalized residual of the pattern 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 totalResidual () const
 Return the total residual of the pattern from pattern finding.
double totalNormalizedResidual () const
 Return the total normalized residual of the pattern 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_totalResidual {0.}
 Total residual of the pattern from pattern finding.
double m_totalNormalizedResidual {0.}
 Total residual normalized to the acceptance window of the pattern 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 73 of file GlobalPattern.h.

73{ 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 53 of file GlobalPattern.h.

◆ nEtaNonPrecisionHits()

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

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

Definition at line 65 of file GlobalPattern.h.

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

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

63{ 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 81 of file GlobalPattern.h.

81 {
82 return m_hitsInStation == other.m_hitsInStation;
83 }

◆ phi()

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

Return the average global phi of the pattern.

Definition at line 49 of file GlobalPattern.h.

49{ 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()) : "-")<< " Sector Phi: "<<sectorPhi()<<", theta: "<<theta()
37 <<", nPrecisionHits: "<<nPrecisionHits()<<", nEtaNonPrecisionHits: "<<nEtaNonPrecisionHits()<<", nPhiHits: "<<nPhiHits()
38 <<", total residual: "<<totalResidual()<<", total normalized residual: "<<totalNormalizedResidual();
39 ostr<<", Hit per station: \n";
40 for (const auto& [station, hits] : m_hitsInStation) {
41 ostr<<" Station "<<stName(station)<<": "<<hits.size()<<" hits\n";
42 for (const auto& hit : hits) {
43 ostr<<" "<<*hit<<"\n";
44 }
45 }
46}
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 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 theta() const
Return the average global theta of the pattern.
unsigned nEtaNonPrecisionHits() const
Return the number of eta non-precision hits in the pattern.
double totalNormalizedResidual() const
Return the total normalized residual of the pattern from pattern finding.
double totalResidual() const
Return the total residual of the pattern from pattern finding.
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 55 of file GlobalPattern.h.

55{ return m_sector2; }

◆ sector()

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

Return the main sector where the pattern is located.

Definition at line 51 of file GlobalPattern.h.

51{ 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...

◆ 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; }
double phi() const
Return the average global phi of the pattern.

◆ 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

◆ setTotalNormalizedResidual()

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

Total normalized residual of the pattern from pattern finding.

Definition at line 43 of file GlobalPattern.h.

std::pair< std::vector< unsigned int >, bool > res
double m_totalNormalizedResidual
Total residual normalized to the acceptance window of the pattern from pattern finding.

◆ setTotalResidual()

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

Total residual of the pattern from pattern finding.

Definition at line 41 of file GlobalPattern.h.

double m_totalResidual
Total residual of the pattern from pattern finding.

◆ theta()

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

Return the average global theta of the pattern.

Definition at line 47 of file GlobalPattern.h.

47{ return m_theta; }

◆ totalNormalizedResidual()

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

Return the total normalized residual of the pattern from pattern finding.

Definition at line 71 of file GlobalPattern.h.

◆ totalResidual()

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

Return the total residual of the pattern from pattern finding.

Definition at line 69 of file GlobalPattern.h.

69{ return m_totalResidual; }

◆ operator<<

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

The print-out operator.

Definition at line 76 of file GlobalPattern.h.

76 {
77 gp.print(ostr);
78 return ostr;
79 }

Member Data Documentation

◆ m_hitsInStation

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

Hits of the pattern organized per station.

Definition at line 108 of file GlobalPattern.h.

108{};

◆ m_nEtaNonPrecisionHits

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

Number of eta non-precision measurements.

Definition at line 95 of file GlobalPattern.h.

95{0};

◆ m_nPhiHits

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

Number of phi measurements.

Definition at line 97 of file GlobalPattern.h.

97{0};

◆ m_nPrecisionHits

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

Number of precision hits.

Definition at line 93 of file GlobalPattern.h.

93{0};

◆ m_phi

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

average global phi of the pattern

Definition at line 91 of file GlobalPattern.h.

91{0.};

◆ m_sector1

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

Definition at line 104 of file GlobalPattern.h.

104{-1};

◆ m_sector2

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

Definition at line 105 of file GlobalPattern.h.

105{-1};

◆ m_theta

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

average global theta of the pattern

Definition at line 89 of file GlobalPattern.h.

89{0.};

◆ m_totalNormalizedResidual

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

Total residual normalized to the acceptance window of the pattern from pattern finding.

Definition at line 101 of file GlobalPattern.h.

101{0.};

◆ m_totalResidual

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

Total residual of the pattern from pattern finding.

Definition at line 99 of file GlobalPattern.h.

99{0.};

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