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
12
13namespace MuonR4 {
16 public:
17 using HitType = const SpacePoint*;
19 using HitCollection = std::unordered_map<StIndex, std::vector<HitType>>;
20
22 GlobalPattern(HitCollection&& hitPerStation);
23 GlobalPattern() = delete;
25 GlobalPattern(const GlobalPattern& other) = default;
26
28 void setTheta(double theta) { m_theta = theta; }
30 void setPhi(double phi) { m_phi = phi; }
32 void setSector(std::int8_t sector) { m_sector = ExpandedSector{sector}; }
34 void setNPrecisionLayers(unsigned n) { m_nPrecisionLayers = n; }
36 void setNTriggerLayers(unsigned n) { m_nTriggerLayers = n; }
38 void setNPhiLayers(unsigned n) { m_nPhiLayers = n; }
41
42
44 double theta() const { return m_theta; }
46 double phi() const { return m_phi; }
48 unsigned sector() const { return m_sector.msSector(); }
50 unsigned secondarySector() const { return m_sector.adjacentMsSector(); }
52 bool isSectorOverlap() const { return sector() != secondarySector(); }
54 double sectorPhi() const;
56 std::vector<StIndex> getStations() const;
58 const std::vector<HitType>& hitsInStation(StIndex station) const;
60 unsigned nPrecisionLayers() const { return m_nPrecisionLayers; }
62 unsigned nTriggerLayers() const { return m_nTriggerLayers; }
64 unsigned nPhiLayers() const { return m_nPhiLayers; }
66 double meanNormResidual2() const { return m_meanNormResidual2; }
68 const HitCollection& hitsPerStation() const { return m_hitsInStation; }
69
71 friend std::ostream& operator<<(std::ostream& ostr, const GlobalPattern& gp) {
72 gp.print(ostr);
73 return ostr;
74 }
75
76 bool operator==(const GlobalPattern& other) const {
77 return m_hitsInStation == other.m_hitsInStation;
78 }
79
80 private:
81 void print(std::ostream& ostr) const;
82
84 double m_theta{0.};
86 double m_phi{0.};
88 unsigned m_nPrecisionLayers{0};
90 unsigned m_nTriggerLayers{0};
92 unsigned m_nPhiLayers{0};
95
96 // The pattern can extend over two sectors in the overlap region
97 ExpandedSector m_sector{static_cast<int8_t>(0)};
98
101};
102
104} // namespace MuonR4
105
108
109#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
double m_theta
average global theta of the pattern
void setSector(std::int8_t sector)
Set the main sector of the pattern.
unsigned m_nPrecisionLayers
Number of precision layers.
void setNPrecisionLayers(unsigned n)
Set the number of precision layers in the pattern.
void setPhi(double phi)
Set the average phi of the pattern.
unsigned nTriggerLayers() const
Return the number of trigger layers in the pattern.
friend std::ostream & operator<<(std::ostream &ostr, const GlobalPattern &gp)
The print-out operator.
const SpacePoint * HitType
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.
double m_phi
average global phi of 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.
const HitCollection & hitsPerStation() const
Return the hits per station.
double m_meanNormResidual2
Mean over eta hits of the square of their residual divided by acceptance window from pattern finding.
unsigned secondarySector() const
Return the associated sector to the bucket.
void setMeanNormResidual2(double res)
Set the mean over eta hits of the square of their residual divided by acceptance window from pattern ...
unsigned sector() const
Return the main sector where the pattern is located.
ExpandedSector m_sector
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.
unsigned m_nTriggerLayers
Number of trigger layers.
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...
void setNTriggerLayers(unsigned n)
Set the number of trigger layers in the pattern.
double meanNormResidual2() const
Return the mean over eta hits of the square of their residual divided by acceptance window from patte...
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.
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.
unsigned m_nPhiLayers
Number of phi layers.
void setNPhiLayers(unsigned n)
Set the number of phi layers in the pattern.
const HitCollection m_hitsInStation
Hits of the pattern organized per station.
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