ATLAS Offline Software
Loading...
Searching...
No Matches
MuonR4::NswSegmentFinderAlg::SeedStatistics Class Reference

Seed statistics per sector to be printed in the end. More...

Collaboration diagram for MuonR4::NswSegmentFinderAlg::SeedStatistics:

Classes

struct  SeedField
struct  SectorField
 sector's field to dump the seed statistics More...

Public Types

using chIdx_t = Muon::MuonStationIndex::ChIndex

Public Member Functions

 SeedStatistics ()=default
void addToStat (const MuonGMR4::SpectrometerSector *msSector, unsigned int nSeeds, unsigned int nExtSeeds, unsigned int nSegments)
void printTableSeedStats (MsgStream &msg) const

Private Types

using SeedStatistic_T = std::map<SectorField, SeedField>

Private Attributes

SeedStatistic_T m_seedStat {}
std::mutex m_mutex {}

Detailed Description

Seed statistics per sector to be printed in the end.

Definition at line 57 of file NswSegmentFinderAlg.h.

Member Typedef Documentation

◆ chIdx_t

◆ SeedStatistic_T

Constructor & Destructor Documentation

◆ SeedStatistics()

MuonR4::NswSegmentFinderAlg::SeedStatistics::SeedStatistics ( )
default

Member Function Documentation

◆ addToStat()

void MuonR4::NswSegmentFinderAlg::SeedStatistics::addToStat ( const MuonGMR4::SpectrometerSector * msSector,
unsigned int nSeeds,
unsigned int nExtSeeds,
unsigned int nSegments )

Definition at line 1077 of file NswSegmentFinderAlg.cxx.

1077 {
1078 std::unique_lock guard{m_mutex};
1079 SectorField key{};
1080 key.chIdx = msSector->chamberIndex();
1081 key.phi = msSector->stationPhi();
1082 key.eta = msSector->chambers().front()->stationEta();
1083
1084 auto &entry = m_seedStat[key];
1085 entry.nSeeds += seeds;
1086 entry.nExtSeeds += extSeeds;
1087 entry.nSegments += segments;
1088}
const ChamberSet & chambers() const
Returns the associated chambers with this sector.
int stationPhi() const
: Returns the station phi of the sector
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index scheme.

◆ printTableSeedStats()

void MuonR4::NswSegmentFinderAlg::SeedStatistics::printTableSeedStats ( MsgStream & msg) const

Definition at line 1090 of file NswSegmentFinderAlg.cxx.

1090 {
1091
1092
1093 std::stringstream sstr{};
1094 sstr<<"Seed statistics per sector:"<<std::endl;
1095 sstr<<"-----------------------------------------------------"<<std::endl;
1096 sstr<<"| Chamber | Phi | Eta | Seeds | ExtSeeds | FittedSegments |"<<std::endl;
1097 sstr<<"-----------------------------------------------------"<<std::endl;
1098
1099 using namespace Muon::MuonStationIndex;
1100
1101 for (const auto& [sector, stats] : m_seedStat) {
1102 sstr << "| " << std::setw(3) << chName(sector.chIdx)
1103 << " | " << std::setw(2) << static_cast<unsigned>(sector.phi)
1104 << " | " << std::setw(3) << static_cast<int>(sector.eta)
1105 << " | " << std::setw(7) << stats.nSeeds
1106 << " | " << std::setw(8) << stats.nExtSeeds
1107 << " | " << std::setw(8) << stats.nSegments
1108 << " |"<<std::endl;
1109 }
1110
1111 sstr<<"------------------------------------------------------------"<<std::endl;
1112 msg<<MSG::ALWAYS<<"\n"<<sstr.str()<<endmsg;
1113 }
#define endmsg
const std::string & chName(ChIndex index)
convert ChIndex into a string

Member Data Documentation

◆ m_mutex

std::mutex MuonR4::NswSegmentFinderAlg::SeedStatistics::m_mutex {}
private

Definition at line 103 of file NswSegmentFinderAlg.h.

103{};

◆ m_seedStat

SeedStatistic_T MuonR4::NswSegmentFinderAlg::SeedStatistics::m_seedStat {}
private

Definition at line 101 of file NswSegmentFinderAlg.h.

101{};

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