From c97bf1982d4890f9ab32083624e4815e5ef0126b Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 23 Apr 2025 13:12:49 +0100 Subject: [PATCH] Do not use histogram buffers --- .../src/RichBXTypeMonitor.cpp | 65 ++++++++----------- .../src/RichBankSizesMonitor.cpp | 4 +- .../src/RichHitMapsMonitor.cpp | 29 ++++----- .../RichOnlineMonitors/src/RichTAEMonitor.cpp | 8 +-- 4 files changed, 41 insertions(+), 65 deletions(-) diff --git a/Rich/RichOnlineMonitors/src/RichBXTypeMonitor.cpp b/Rich/RichOnlineMonitors/src/RichBXTypeMonitor.cpp index a3ee81def..7758a5c8c 100644 --- a/Rich/RichOnlineMonitors/src/RichBXTypeMonitor.cpp +++ b/Rich/RichOnlineMonitors/src/RichBXTypeMonitor.cpp @@ -171,17 +171,6 @@ namespace Rich::Future::Mon { /// Functional operator void operator()( const LHCb::ODIN& odin, const DAQ::DecodedData& data ) const override { - // local buffers - auto hb_Occupancy_bb = h_Occupancy_bb.buffer(); - auto hb_Occupancy_ebbe = h_Occupancy_ebbe.buffer(); - auto hb_Occupancy_ee = h_Occupancy_ee.buffer(); - auto hb_pixelMapBeamCrossing = h_pixelMapBeamCrossing.buffer(); - auto hb_pixelMap2BeamCrossing = h_pixelMap2BeamCrossing.buffer(); - auto hb_pixelMapBeamGas = h_pixelMapBeamGas.buffer(); - auto hb_pixelMap2BeamGas = h_pixelMap2BeamGas.buffer(); - auto hb_pixelMapEmptyEmpty = h_pixelMapEmptyEmpty.buffer(); - auto hb_pixelMap2EmptyEmpty = h_pixelMap2EmptyEmpty.buffer(); - // Loop over RICHes for ( const auto rich : Rich::detectors() ) { // data for this RICH @@ -217,12 +206,12 @@ namespace Rich::Future::Mon { ( 13 * 6 * 4 * 4 * ( id.panel() ) + 6 * 4 * 4 * ( id.panelLocalModuleColumn() ) + 4 * 4 * id.columnLocalModuleNum() + 4 * id.elementaryCell() + id.pdNumInEC() ); if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::BeamCrossing ) { - hb_Occupancy_bb[rich][pmtbin] += weight_PMThit; + h_Occupancy_bb[rich][pmtbin] += weight_PMThit; } else if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::Beam1 || odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::Beam2 ) { - hb_Occupancy_ebbe[rich][pmtbin] += weight_PMThit; + h_Occupancy_ebbe[rich][pmtbin] += weight_PMThit; } else if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::NoBeam ) { - hb_Occupancy_ee[rich][pmtbin] += weight_PMThit; + h_Occupancy_ee[rich][pmtbin] += weight_PMThit; } const auto iGlobalX = id.ecGlobalPMTFrameX() - id.panel() * 220; @@ -233,16 +222,16 @@ namespace Rich::Future::Mon { for ( int i = 0; i < 2; ++i ) { for ( int j = 0; j < 2; ++j ) { if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::BeamCrossing ) { - ++hb_pixelMapBeamCrossing[rich][{ iGlobalX + i, iGlobalY + j }]; - ++hb_pixelMap2BeamCrossing[rich][{ iGlobalX2 + i, iGlobalY + j }]; + ++h_pixelMapBeamCrossing[rich][{ iGlobalX + i, iGlobalY + j }]; + ++h_pixelMap2BeamCrossing[rich][{ iGlobalX2 + i, iGlobalY + j }]; } else if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::Beam1 || odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::Beam2 ) { - ++hb_pixelMapBeamGas[rich][{ iGlobalX + i, iGlobalY + j }]; - ++hb_pixelMap2BeamGas[rich][{ iGlobalX2 + i, iGlobalY + j }]; + ++h_pixelMapBeamGas[rich][{ iGlobalX + i, iGlobalY + j }]; + ++h_pixelMap2BeamGas[rich][{ iGlobalX2 + i, iGlobalY + j }]; } else if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::NoBeam ) { - ++hb_pixelMapEmptyEmpty[rich][{ iGlobalX + i, iGlobalY + j }]; - ++hb_pixelMap2EmptyEmpty[rich][{ iGlobalX2 + i, iGlobalY + j }]; + ++h_pixelMapEmptyEmpty[rich][{ iGlobalX + i, iGlobalY + j }]; + ++h_pixelMap2EmptyEmpty[rich][{ iGlobalX2 + i, iGlobalY + j }]; } } } @@ -255,16 +244,16 @@ namespace Rich::Future::Mon { auto convertX = []( const auto x ) { return ( -1 * ( x + 3 - 89 - 21 ) ) + 89 + 21; }; auto convertY = []( const auto y ) { return -( y + 1 ); }; if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::BeamCrossing ) { - ++hb_pixelMapBeamCrossing[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; - ++hb_pixelMap2BeamCrossing[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; + ++h_pixelMapBeamCrossing[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; + ++h_pixelMap2BeamCrossing[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; } else if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::Beam1 || odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::Beam2 ) { - ++hb_pixelMapBeamGas[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; - ++hb_pixelMap2BeamGas[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; + ++h_pixelMapBeamGas[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; + ++h_pixelMap2BeamGas[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; } else if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::NoBeam ) { - ++hb_pixelMapEmptyEmpty[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; - ++hb_pixelMap2EmptyEmpty[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; + ++h_pixelMapEmptyEmpty[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; + ++h_pixelMap2EmptyEmpty[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; } } else { @@ -274,31 +263,31 @@ namespace Rich::Future::Mon { auto convertX = []( const auto x ) { return x + 3; }; auto convertY = []( const auto y ) { return y + 1; }; if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::BeamCrossing ) { - ++hb_pixelMapBeamCrossing[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; - ++hb_pixelMap2BeamCrossing[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; + ++h_pixelMapBeamCrossing[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; + ++h_pixelMap2BeamCrossing[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; } else if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::Beam1 || odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::Beam2 ) { - ++hb_pixelMapBeamGas[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; - ++hb_pixelMap2BeamGas[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; + ++h_pixelMapBeamGas[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; + ++h_pixelMap2BeamGas[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; } else if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::NoBeam ) { - ++hb_pixelMapEmptyEmpty[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; - ++hb_pixelMap2EmptyEmpty[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; + ++h_pixelMapEmptyEmpty[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; + ++h_pixelMap2EmptyEmpty[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; } } } else { auto convertX = []( const auto x ) { return x + 1; }; auto convertY = []( const auto y ) { return y; }; if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::BeamCrossing ) { - ++hb_pixelMapBeamCrossing[rich][{ convertX( iGlobalX ), convertY( iGlobalY ) }]; - ++hb_pixelMap2BeamCrossing[rich][{ convertX( iGlobalX2 ), convertY( iGlobalY ) }]; + ++h_pixelMapBeamCrossing[rich][{ convertX( iGlobalX ), convertY( iGlobalY ) }]; + ++h_pixelMap2BeamCrossing[rich][{ convertX( iGlobalX2 ), convertY( iGlobalY ) }]; } else if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::Beam1 || odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::Beam2 ) { - ++hb_pixelMapBeamGas[rich][{ convertX( iGlobalX ), convertY( iGlobalY ) }]; - ++hb_pixelMap2BeamGas[rich][{ convertX( iGlobalX2 ), convertY( iGlobalY ) }]; + ++h_pixelMapBeamGas[rich][{ convertX( iGlobalX ), convertY( iGlobalY ) }]; + ++h_pixelMap2BeamGas[rich][{ convertX( iGlobalX2 ), convertY( iGlobalY ) }]; } else if ( odin.bunchCrossingType() == LHCb::ODINImplementation::v7::ODIN::BXTypes::NoBeam ) { - ++hb_pixelMapEmptyEmpty[rich][{ convertX( iGlobalX ), convertY( iGlobalY ) }]; - ++hb_pixelMap2EmptyEmpty[rich][{ convertX( iGlobalX2 ), convertY( iGlobalY ) }]; + ++h_pixelMapEmptyEmpty[rich][{ convertX( iGlobalX ), convertY( iGlobalY ) }]; + ++h_pixelMap2EmptyEmpty[rich][{ convertX( iGlobalX2 ), convertY( iGlobalY ) }]; } } } diff --git a/Rich/RichOnlineMonitors/src/RichBankSizesMonitor.cpp b/Rich/RichOnlineMonitors/src/RichBankSizesMonitor.cpp index 943e09b1f..c63b207c9 100644 --- a/Rich/RichOnlineMonitors/src/RichBankSizesMonitor.cpp +++ b/Rich/RichOnlineMonitors/src/RichBankSizesMonitor.cpp @@ -100,8 +100,6 @@ namespace Rich::Future::Mon { /// Functional operator void operator()( const LHCb::RawBank::View& richBanks ) const override { - auto hb_BankSizes = h_BankSizes.buffer(); - for ( const auto* const bank : richBanks ) { if ( bank ) { const auto source_id = bank->sourceID(); @@ -115,7 +113,7 @@ namespace Rich::Future::Mon { const std::size_t bankSize = bank->size(); const auto rich = tel40ID.rich(); const auto side = tel40ID.side(); - ++hb_BankSizes[rich][side][{ source_id, bankSize }]; + ++h_BankSizes[rich][side][{ source_id, bankSize }]; } } } diff --git a/Rich/RichOnlineMonitors/src/RichHitMapsMonitor.cpp b/Rich/RichOnlineMonitors/src/RichHitMapsMonitor.cpp index 3ced84f58..8fb6ca61c 100644 --- a/Rich/RichOnlineMonitors/src/RichHitMapsMonitor.cpp +++ b/Rich/RichOnlineMonitors/src/RichHitMapsMonitor.cpp @@ -291,13 +291,6 @@ namespace Rich::Future::Mon { const DAQ::Tel40CableMapping& tel40Maps, // const DAQ::PDMDBEncodeMapping& pdmdbMaps ) const override { - // local buffers - auto hb_SlotIDVsBitID = h_SlotIDVsBitID.buffer(); - auto hb_BunchIDVsBitID = h_BunchIDVsBitID.buffer(); - auto hb_pixelMap = h_pixelMap.buffer(); - auto hb_pixelMap2 = h_pixelMap2.buffer(); - auto hb_hitMaps = h_hitMaps.buffer(); - //// Get bxID const auto bunchID = odin.bunchId(); const int slotID = std::abs( bunchID - 1024 ) % 23; @@ -351,8 +344,8 @@ namespace Rich::Future::Mon { 1e5 * static_cast( id.panel() ) + 100 * ( 24 * ( tel40Data.sourceID.data() & 0x3F ) + tel40Data.connector.data() ) + anodeData.bit.data(); - ++hb_SlotIDVsBitID[rich][{ bitID, slotID }]; - ++hb_BunchIDVsBitID[rich][{ bitID, bunchID }]; + ++h_SlotIDVsBitID[rich][{ bitID, slotID }]; + ++h_BunchIDVsBitID[rich][{ bitID, bunchID }]; } if ( m_fillVerbosePMTPlots ) { @@ -367,8 +360,8 @@ namespace Rich::Future::Mon { // For large H type PMTs fill a group of 4 corresponding to the effective smaller pixels for ( int i = 0; i < 2; ++i ) { for ( int j = 0; j < 2; ++j ) { - ++hb_pixelMap[rich][{ iGlobalX + i, iGlobalY + j }]; - ++hb_pixelMap2[rich][{ iGlobalX2 + i, iGlobalY + j }]; + ++h_pixelMap[rich][{ iGlobalX + i, iGlobalY + j }]; + ++h_pixelMap2[rich][{ iGlobalX2 + i, iGlobalY + j }]; } } } else { @@ -377,19 +370,19 @@ namespace Rich::Future::Mon { if ( 0 == side ) { auto convertX = []( const auto x ) { return ( -1 * ( x + 3 - 89 - 21 ) ) + 89 + 21; }; auto convertY = []( const auto y ) { return -( y + 1 ); }; - ++hb_pixelMap[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; - ++hb_pixelMap2[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; + ++h_pixelMap[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; + ++h_pixelMap2[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; } else { auto convertX = []( const auto x ) { return x + 3; }; auto convertY = []( const auto y ) { return y + 1; }; - ++hb_pixelMap[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; - ++hb_pixelMap2[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; + ++h_pixelMap[rich][{ convertY( iGlobalY ), convertX( iGlobalX ) }]; + ++h_pixelMap2[rich][{ convertY( iGlobalY ), convertX( iGlobalX2 ) }]; } } else { auto convertX = []( const auto x ) { return x + 1; }; auto convertY = []( const auto y ) { return y; }; - ++hb_pixelMap[rich][{ convertX( iGlobalX ), convertY( iGlobalY ) }]; - ++hb_pixelMap2[rich][{ convertX( iGlobalX2 ), convertY( iGlobalY ) }]; + ++h_pixelMap[rich][{ convertX( iGlobalX ), convertY( iGlobalY ) }]; + ++h_pixelMap2[rich][{ convertX( iGlobalX2 ), convertY( iGlobalY ) }]; } } @@ -400,7 +393,7 @@ namespace Rich::Future::Mon { // info() << "gPos " << gPos << endmsg; const auto lPos = smartIDsHelper.globalToPDPanel( gPos ); // info() << "lPos " << lPos << endmsg; - ++hb_hitMaps[rich][{ lPos.x(), lPos.y() }]; + ++h_hitMaps[rich][{ lPos.x(), lPos.y() }]; } } // hit loop diff --git a/Rich/RichOnlineMonitors/src/RichTAEMonitor.cpp b/Rich/RichOnlineMonitors/src/RichTAEMonitor.cpp index 42f4a59ad..0278cf59f 100644 --- a/Rich/RichOnlineMonitors/src/RichTAEMonitor.cpp +++ b/Rich/RichOnlineMonitors/src/RichTAEMonitor.cpp @@ -133,10 +133,6 @@ namespace Rich::Future::Mon { // In case something went wrong if ( taeEvents.empty() ) { return; } - // local buffers - auto hb_TaeIDVsBitID = h_TaeIDVsBitID.buffer(); - auto hb_NHitsVsTaeID = h_NHitsVsTaeID.buffer(); - // Loop over taeEvents for ( auto const& element : taeEvents ) { @@ -172,7 +168,7 @@ namespace Rich::Future::Mon { const auto& anodeData = pdmdbMaps.anodeData( id ); const auto& tel40Data = tel40Maps.tel40Data( id, anodeData.pdmdb, anodeData.frame ); if ( offset == 0 || odin.bunchCrossingType() == LHCb::ODIN::BXTypes::NoBeam ) { - ++hb_TaeIDVsBitID[rich][{ + ++h_TaeIDVsBitID[rich][{ 1e5 * static_cast( id.panel() ) + 100 * ( 24 * ( tel40Data.sourceID.data() & 0x3F ) + tel40Data.connector.data() ) + anodeData.bit.data(), @@ -188,7 +184,7 @@ namespace Rich::Future::Mon { } // modules } // panels if ( ( offset == 0 || odin.bunchCrossingType() == LHCb::ODIN::BXTypes::NoBeam ) && ( nHits > 0 ) ) { - ++hb_NHitsVsTaeID[rich][{ offset, nHits }]; + ++h_NHitsVsTaeID[rich][{ offset, nHits }]; } } // RICHes } -- GitLab