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  SectorField
 sector's field to dump the seed statistics More...
struct  SeedField

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

894 {
895 std::unique_lock guard{m_mutex};
897 key.chIdx = msSector->chamberIndex();
898 key.phi = msSector->stationPhi();
899 key.eta = msSector->chambers().front()->stationEta();
900
901 auto &entry = m_seedStat[key];
902 entry.nSeeds += seeds;
903 entry.nExtSeeds += extSeeds;
904 entry.nSegments += segments;
905}
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 907 of file NswSegmentFinderAlg.cxx.

907 {
908
909
910 std::stringstream sstr{};
911 sstr<<"Seed statistics per sector:"<<std::endl;
912 sstr<<"-----------------------------------------------------"<<std::endl;
913 sstr<<"| Chamber | Phi | Eta | Seeds | ExtSeeds | Segments |"<<std::endl;
914 sstr<<"-----------------------------------------------------"<<std::endl;
915
916 using namespace Muon::MuonStationIndex;
917
918 for (const auto& [sector, stats] : m_seedStat) {
919 sstr << "| " << std::setw(3) << chName(sector.chIdx)
920 << " | " << std::setw(2) << static_cast<unsigned>(sector.phi)
921 << " | " << std::setw(3) << static_cast<int>(sector.eta)
922 << " | " << std::setw(7) << stats.nSeeds
923 << " | " << std::setw(8) << stats.nExtSeeds
924 << " | " << std::setw(8) << stats.nSegments
925 << " |"<<std::endl;
926 }
927
928 sstr<<"------------------------------------------------------------"<<std::endl;
929 msg<<MSG::ALWAYS<<"\n"<<sstr.str()<<endmsg;
930 }
#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: