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

908 {
909 std::unique_lock guard{m_mutex};
911 key.chIdx = msSector->chamberIndex();
912 key.phi = msSector->stationPhi();
913 key.eta = msSector->chambers().front()->stationEta();
914
915 auto &entry = m_seedStat[key];
916 entry.nSeeds += seeds;
917 entry.nExtSeeds += extSeeds;
918 entry.nSegments += segments;
919}
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 921 of file NswSegmentFinderAlg.cxx.

921 {
922
923
924 std::stringstream sstr{};
925 sstr<<"Seed statistics per sector:"<<std::endl;
926 sstr<<"-----------------------------------------------------"<<std::endl;
927 sstr<<"| Chamber | Phi | Eta | Seeds | ExtSeeds | Segments |"<<std::endl;
928 sstr<<"-----------------------------------------------------"<<std::endl;
929
930 using namespace Muon::MuonStationIndex;
931
932 for (const auto& [sector, stats] : m_seedStat) {
933 sstr << "| " << std::setw(3) << chName(sector.chIdx)
934 << " | " << std::setw(2) << static_cast<unsigned>(sector.phi)
935 << " | " << std::setw(3) << static_cast<int>(sector.eta)
936 << " | " << std::setw(7) << stats.nSeeds
937 << " | " << std::setw(8) << stats.nExtSeeds
938 << " | " << std::setw(8) << stats.nSegments
939 << " |"<<std::endl;
940 }
941
942 sstr<<"------------------------------------------------------------"<<std::endl;
943 msg<<MSG::ALWAYS<<"\n"<<sstr.str()<<endmsg;
944 }
#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: