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>>
using BucketCollection = std::unordered_map<StIndex, std::vector<const SpacePointBucket*>>

Public Member Functions

 GlobalPattern (HitCollection &&hitPerStation, BucketCollection &&bucketPerStation)
 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.
const ExpandedSectorexpSector () const
 Return the expanded sector 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 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.
const std::vector< const SpacePointBucket * > & bucketsInStation (StIndex station) const
 Return the parent buckets of the pattern 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.
const BucketCollection m_parentBuckets {}
 Collection of parent buckets.

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

Member Typedef Documentation

◆ BucketCollection

using MuonR4::GlobalPattern::BucketCollection = std::unordered_map<StIndex, std::vector<const SpacePointBucket*>>

Definition at line 21 of file GlobalPattern.h.

◆ HitCollection

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

Definition at line 20 of file GlobalPattern.h.

◆ HitType

Definition at line 18 of file GlobalPattern.h.

◆ StIndex

Constructor & Destructor Documentation

◆ GlobalPattern() [1/3]

MuonR4::GlobalPattern::GlobalPattern ( HitCollection && hitPerStation,
BucketCollection && bucketPerStation )

c-tor consuming the hit collection per station

Definition at line 15 of file GlobalPattern.cxx.

17 : m_hitsInStation(std::move(hitPerStation)),
18 m_parentBuckets(std::move(bucketPerStation)) {};
const BucketCollection m_parentBuckets
Collection of parent buckets.
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

◆ bucketsInStation()

const std::vector< const SpacePointBucket * > & MuonR4::GlobalPattern::bucketsInStation ( StIndex station) const

Return the parent buckets of the pattern in the given station.

Definition at line 37 of file GlobalPattern.cxx.

37 {
38 const auto& it = m_parentBuckets.find(station);
39 if (it != m_parentBuckets.end()) {
40 return it->second;
41 }
42 static const std::vector<const SpacePointBucket*> empty{};
43 return empty;
44}
static const Attributes_t empty

◆ expSector()

const ExpandedSector & MuonR4::GlobalPattern::expSector ( ) const
inline

Return the expanded sector of the pattern.

Definition at line 57 of file GlobalPattern.h.

57{ return m_sector; }
ExpandedSector m_sector

◆ getStations()

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

Return the associated stations to the pattern.

Definition at line 20 of file GlobalPattern.cxx.

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

◆ hitsInStation()

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

Return the pattern hits in the given station.

Definition at line 28 of file GlobalPattern.cxx.

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

◆ hitsPerStation()

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

Return the hits per station.

Definition at line 75 of file GlobalPattern.h.

75{ 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 55 of file GlobalPattern.h.

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

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

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

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

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

83 {
84 return m_hitsInStation == other.m_hitsInStation;
85 }

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

51 {
52 ostr<<"SpacePoint Pattern, Sector: "<< sector() << " & " << (isSectorOverlap() ? std::to_string(secondarySector()) : "-")
53 <<", theta: "<<inDegrees(theta()) << ", Phi: "<<inDegrees(phi())<< " Sector Phi: "<<inDegrees(sectorPhi())
54 <<", nPrecisionLayers: "<<nPrecisionLayers()<<", nTriggerLayers: "<<nTriggerLayers()<<", nPhiLayers: "<<nPhiLayers()
55 <<", mean normalized residual squared: "<<meanNormResidual2();
56 ostr<<", Hit per station: \n";
57 for (const auto& [station, hits] : m_hitsInStation) {
58 ostr<<" Station "<<stName(station)<<": "<<hits.size()<<" hits\n";
59 for (const auto& hit : hits) {
60 ostr<<" "<<*hit<<"\n";
61 }
62 }
63}
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 53 of file GlobalPattern.h.

53{ return m_sector.adjacentMsSector(); }

◆ sector()

unsigned 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_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 46 of file GlobalPattern.cxx.

46 {
47 static const Muon::MuonSectorMapping sectorMap{};
48 return sectorMap.sectorOverlapPhi(sector(), secondarySector());
49}
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 43 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 41 of file GlobalPattern.h.

◆ setNPrecisionLayers()

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

Set the number of precision layers in the pattern.

Definition at line 37 of file GlobalPattern.h.

◆ setNTriggerLayers()

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

Set the number of trigger layers in the pattern.

Definition at line 39 of file GlobalPattern.h.

◆ setPhi()

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

Set the average phi of the pattern.

Definition at line 33 of file GlobalPattern.h.

33{ m_phi = phi; }

◆ setSector()

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

Set the main sector of the pattern.

Definition at line 35 of file GlobalPattern.h.

35{ m_sector = ExpandedSector{sector}; }

◆ setTheta()

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

Set the average theta of the pattern.

Definition at line 31 of file GlobalPattern.h.

31{ 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 47 of file GlobalPattern.h.

47{ return m_theta; }

◆ operator<<

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

The print-out operator.

Definition at line 78 of file GlobalPattern.h.

78 {
79 gp.print(ostr);
80 return ostr;
81 }

Member Data Documentation

◆ m_hitsInStation

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

Hits of the pattern organized per station.

Definition at line 107 of file GlobalPattern.h.

107{};

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

101{0.};

◆ m_nPhiLayers

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

Number of phi layers.

Definition at line 99 of file GlobalPattern.h.

99{0};

◆ m_nPrecisionLayers

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

Number of precision layers.

Definition at line 95 of file GlobalPattern.h.

95{0};

◆ m_nTriggerLayers

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

Number of trigger layers.

Definition at line 97 of file GlobalPattern.h.

97{0};

◆ m_parentBuckets

const BucketCollection MuonR4::GlobalPattern::m_parentBuckets {}
private

Collection of parent buckets.

Definition at line 109 of file GlobalPattern.h.

109{};

◆ m_phi

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

average global phi of the pattern

Definition at line 93 of file GlobalPattern.h.

93{0.};

◆ m_sector

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

Definition at line 104 of file GlobalPattern.h.

104{static_cast<int8_t>(0)};

◆ m_theta

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

average global theta of the pattern

Definition at line 91 of file GlobalPattern.h.

91{0.};

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