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 std::vector<const SpacePointBucket*>&& bucketPerStation)
17 : m_hitsInStation(std::move(hitPerStation)),
18 m_parentBuckets(std::move(bucketPerStation)) {};
19
20std::vector<GlobalPattern::StIndex> GlobalPattern::getStations() const {
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}
27
28const std::vector<GlobalPattern::HitType>& GlobalPattern::hitsInStation(StIndex station) const {
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}
36
37const std::vector<const SpacePointBucket*> GlobalPattern::bucketsInStation(StIndex station) const {
38 std::vector<const SpacePointBucket*> buckets{};
39 std::ranges::copy_if(m_parentBuckets, std::back_inserter(buckets),
40 [station](const SpacePointBucket* bucket) {
41 return Muon::MuonStationIndex::toStationIndex(bucket->msSector()->chamberIndex()) == station; });
42 return buckets;
43}
44
45double GlobalPattern::sectorPhi() const {
46 static const Muon::MuonSectorMapping sectorMap{};
47 return sectorMap.sectorOverlapPhi(sector(), secondarySector());
48}
49
50void GlobalPattern::print(std::ostream& ostr) const {
51 ostr<<"SpacePoint Pattern, Sector: "<< sector() << " & " << (isSectorOverlap() ? std::to_string(secondarySector()) : "-")
52 <<", theta: "<<inDegrees(theta()) << ", Phi: "<<inDegrees(phi())<< " Sector Phi: "<<inDegrees(sectorPhi())
53 <<", nPrecisionLayers: "<<nPrecisionLayers()<<", nTriggerLayers: "<<nTriggerLayers()<<", nPhiLayers: "<<nPhiLayers()
54 <<", mean normalized residual squared: "<<meanNormResidual2();
55 ostr<<", Hit per station: \n";
56 for (const auto& [station, hits] : m_hitsInStation) {
57 ostr<<" Station "<<stName(station)<<": "<<hits.size()<<" hits\n";
58 for (const auto& hit : hits) {
59 ostr<<" "<<*hit<<"\n";
60 }
61 }
62}
63
64}
bool hit(const Container &ids, int pdgId)
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
static const Attributes_t empty
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index scheme.
const std::vector< const SpacePointBucket * > m_parentBuckets
Collection of parent buckets.
unsigned nTriggerLayers() const
Return the number of trigger layers in the pattern.
const std::vector< const SpacePointBucket * > bucketsInStation(StIndex station) const
Return the parent buckets of the pattern in the given station.
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.
: The muon space point bucket represents a collection of points that will bre processed together in t...
const MuonGMR4::SpectrometerSector * msSector() const
returns th associated muonChamber
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.
StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
const std::string & stName(StIndex index)
convert StIndex into a string
STL namespace.