ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalPattern.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONR4_MUONFASTRECOEVENT_GLOBALPATTERN__H
6#define MUONR4_MUONFASTRECOEVENT_GLOBALPATTERN__H
7
11
12namespace MuonR4 {
15 public:
16 using HitType = const SpacePoint*;
18 using HitCollection = std::unordered_map<StIndex, std::vector<HitType>>;
19
21 GlobalPattern(HitCollection&& hitPerStation);
22 GlobalPattern() = delete;
24 GlobalPattern(const GlobalPattern& other) = default;
25
27 void setTheta(double theta) { m_theta = theta; }
29 void setPhi(double phi) { m_phi = phi; }
35 void setNPrecisionHits(unsigned n) { m_nPrecisionHits = n; }
39 void setNPhiHits(unsigned n) { m_nPhiHits = n; }
42
43
45 double theta() const { return m_theta; }
47 double phi() const { return m_phi; }
49 int sector() const { return m_sector1; }
51 bool isSectorOverlap() const { return m_sector2 != m_sector1; }
53 int secondarySector() const { return m_sector2; }
55 double sectorPhi() const;
57 std::vector<StIndex> getStations() const;
59 const std::vector<HitType>& hitsInStation(StIndex station) const;
61 unsigned nPrecisionHits() const { return m_nPrecisionHits; }
63 unsigned nEtaNonPrecisionHits() const { return m_nEtaNonPrecisionHits; }
65 unsigned nPhiHits() const { return m_nPhiHits; }
67 double totalResidual() const { return m_totalResidual; }
69 const HitCollection& hitsPerStation() const { return m_hitsInStation; }
70
72 friend std::ostream& operator<<(std::ostream& ostr, const GlobalPattern& gp) {
73 gp.print(ostr);
74 return ostr;
75 }
76
77 bool operator==(const GlobalPattern& other) const {
78 return m_hitsInStation == other.m_hitsInStation;
79 }
80
81 private:
82 void print(std::ostream& ostr) const;
83
85 double m_theta{0.};
87 double m_phi{0.};
89 unsigned m_nPrecisionHits{0};
93 unsigned m_nPhiHits{0};
95 double m_totalResidual{0.};
96
97 // The pattern can extend over two sectors in the overlap region
98 int m_sector1{-1};
99 int m_sector2{-1};
100
103};
104
106} // namespace MuonR4
107
110
111#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
An STL vector of pointers that by default owns its pointed-to elements.
std::pair< std::vector< unsigned int >, bool > res
Derived DataVector<T>.
Definition DataVector.h:795
void setTotalResidual(double res)
Total residual of the pattern from pattern finding.
double m_theta
average global theta of 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.
unsigned m_nPrecisionHits
Number of precision hits.
void setPhi(double phi)
Set the average phi of the pattern.
friend std::ostream & operator<<(std::ostream &ostr, const GlobalPattern &gp)
The print-out operator.
const SpacePoint * HitType
unsigned nPhiHits() const
Return the number of phi hits in the pattern.
std::unordered_map< StIndex, std::vector< HitType > > HitCollection
Muon::MuonStationIndex::StIndex StIndex
GlobalPattern(HitCollection &&hitPerStation)
c-tor consuming the hit collection per station
std::vector< StIndex > getStations() const
Return the associated stations to the pattern.
void setNPrecisionHits(unsigned n)
Set the number of precision hits in the pattern.
double m_phi
average global phi of the pattern
int secondarySector() const
Return the associated sector to the bucket.
unsigned m_nPhiHits
Number of phi measurements.
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.
const HitCollection & hitsPerStation() const
Return the hits per station.
unsigned nPrecisionHits() const
Return the number of precision hits in the pattern.
unsigned m_nEtaNonPrecisionHits
Number of eta non-precision measurements.
double m_totalResidual
Total residual of the pattern from pattern finding.
bool isSectorOverlap() const
Return whether the pattern is located in the overlap region between two sectors.
void print(std::ostream &ostr) const
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...
bool operator==(const GlobalPattern &other) const
Equality operator.
GlobalPattern(const GlobalPattern &other)=default
Copy c-tor.
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.
void setTheta(double theta)
Set the average theta of the pattern.
const std::vector< HitType > & hitsInStation(StIndex station) const
Return the pattern hits in the given station.
double totalResidual() const
Return the total residual of the pattern from pattern finding.
const HitCollection m_hitsInStation
Hits of the pattern organized per station.
int sector() const
Return the main sector where the pattern is located.
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
This header ties the generic definitions in this package.
DataVector< GlobalPattern > GlobalPatternContainer
Abrivation of the GlobalPattern container type.
StIndex
enum to classify the different station layers in the muon spectrometer