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 55 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 972 of file NswSegmentFinderAlg.cxx.

972 {
973 std::unique_lock guard{m_mutex};
975 key.chIdx = msSector->chamberIndex();
976 key.phi = msSector->stationPhi();
977 key.eta = msSector->chambers().front()->stationEta();
978
979 auto &entry = m_seedStat[key];
980 entry.nSeeds += seeds;
981 entry.nExtSeeds += extSeeds;
982 entry.nSegments += segments;
983}
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 985 of file NswSegmentFinderAlg.cxx.

985 {
986
987
988 std::stringstream sstr{};
989 sstr<<"Seed statistics per sector:"<<std::endl;
990 sstr<<"-----------------------------------------------------"<<std::endl;
991 sstr<<"| Chamber | Phi | Eta | Seeds | ExtSeeds | Segments |"<<std::endl;
992 sstr<<"-----------------------------------------------------"<<std::endl;
993
994 using namespace Muon::MuonStationIndex;
995
996 for (const auto& [sector, stats] : m_seedStat) {
997 sstr << "| " << std::setw(3) << chName(sector.chIdx)
998 << " | " << std::setw(2) << static_cast<unsigned>(sector.phi)
999 << " | " << std::setw(3) << static_cast<int>(sector.eta)
1000 << " | " << std::setw(7) << stats.nSeeds
1001 << " | " << std::setw(8) << stats.nExtSeeds
1002 << " | " << std::setw(8) << stats.nSegments
1003 << " |"<<std::endl;
1004 }
1005
1006 sstr<<"------------------------------------------------------------"<<std::endl;
1007 msg<<MSG::ALWAYS<<"\n"<<sstr.str()<<endmsg;
1008 }
#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 101 of file NswSegmentFinderAlg.h.

101{};

◆ m_seedStat

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

Definition at line 99 of file NswSegmentFinderAlg.h.

99{};

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