ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalPattern.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8namespace {
9 double inDegrees(double angle) {
10 return angle / Gaudi::Units::deg;
11 }
12}
13namespace MuonR4 {
14
16 : m_hitsInStation(std::move(hitPerStation)) {};
17
18std::vector<GlobalPattern::StIndex> GlobalPattern::getStations() const {
19 std::vector<StIndex> out{};
20 out.reserve(m_hitsInStation.size());
21 std::ranges::transform(m_hitsInStation, std::back_inserter(out),
22 [](const auto& pair){ return pair.first;});
23 return out;
24}
25
26const std::vector<GlobalPattern::HitType>& GlobalPattern::hitsInStation(StIndex station) const {
27 const auto& it = m_hitsInStation.find(station);
28 if (it != m_hitsInStation.end()) {
29 return it->second;
30 }
31 static const std::vector<HitType> empty{};
32 return empty;
33}
34
35double GlobalPattern::sectorPhi() const {
36 static const Muon::MuonSectorMapping sectorMap{};
37 return sectorMap.sectorOverlapPhi(sector(), secondarySector());
38}
39
40void GlobalPattern::print(std::ostream& ostr) const {
41 ostr<<"SpacePoint Pattern, Sector: "<< sector() << " & " << (isSectorOverlap() ? std::to_string(secondarySector()) : "-")
42 <<", theta: "<<inDegrees(theta()) << ", Phi: "<<inDegrees(phi())<< " Sector Phi: "<<inDegrees(sectorPhi())
43 <<", nPrecisionLayers: "<<nPrecisionLayers()<<", nTriggerLayers: "<<nTriggerLayers()<<", nPhiLayers: "<<nPhiLayers()
44 <<", mean normalized residual squared: "<<meanNormResidual2();
45 ostr<<", Hit per station: \n";
46 for (const auto& [station, hits] : m_hitsInStation) {
47 ostr<<" Station "<<stName(station)<<": "<<hits.size()<<" hits\n";
48 for (const auto& hit : hits) {
49 ostr<<" "<<*hit<<"\n";
50 }
51 }
52}
53
54}
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
static const Attributes_t empty
unsigned nTriggerLayers() const
Return the number of trigger layers in the pattern.
std::unordered_map< StIndex, std::vector< HitType > > HitCollection
Muon::MuonStationIndex::StIndex StIndex
std::vector< StIndex > getStations() const
Return the associated stations to 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.
unsigned secondarySector() const
Return the associated sector to the bucket.
unsigned 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.
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...
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::vector< HitType > & hitsInStation(StIndex station) const
Return the pattern hits in the given station.
const HitCollection m_hitsInStation
Hits of the pattern organized per station.
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...
STL class.
This header ties the generic definitions in this package.
const std::string & stName(StIndex index)
convert StIndex into a string
STL namespace.