Skip to content
Snippets Groups Projects

RichSmartIDClustering: Only print 4D message when detector is enabled

@@ -32,6 +32,7 @@
// STL
#include <algorithm>
#include <array>
#include <functional>
#include <limits>
#include <memory>
@@ -82,16 +83,20 @@ namespace Rich::Future {
Detector::PDInfo::addConditionDerivation( this );
// loop over RICHes
for ( const auto rich : {Rich::Rich1, Rich::Rich2} ) {
if ( m_enable4D[rich] ) {
info() << "Hit times enabled for " << rich << " | Window = " //
<< ( m_avHitTime[rich] - m_timeWindow[rich] ) << " to " //
<< ( m_avHitTime[rich] + m_timeWindow[rich] ) << " ns" << endmsg;
if ( m_usedDets[rich] ) {
if ( m_enable4D[rich] ) {
info() << "Hit times enabled for " << rich << " | Window = " //
<< ( m_avHitTime[rich] - m_timeWindow[rich] ) << " to " //
<< ( m_avHitTime[rich] + m_timeWindow[rich] ) << " ns" << endmsg;
}
if ( m_overallMax[rich] < LHCb::RichSmartID::MaPMT::TotalPixels ) {
info() << "Maximum PD occupancy for " << rich << " = " << m_overallMax[rich] << endmsg;
}
m_runClusterSplit[rich] =
( m_minClusSize[rich] > 1 || m_maxClusSize[rich] < LHCb::RichSmartID::MaPMT::TotalPixels );
} else {
info() << "Pixels for " << rich << " are disabled" << endmsg;
}
// checks
if ( !m_usedDets[rich] ) { info() << "Pixels for " << rich << " are disabled" << endmsg; }
// cached data
m_runClusterSplit[rich] =
( m_minClusSize[rich] > 1 || m_maxClusSize[rich] < LHCb::RichSmartID::MaPMT::TotalPixels );
}
// force enable debug/verbose messages
// return setProperty( "OutputLevel", MSG::VERBOSE );
@@ -146,7 +151,7 @@ namespace Rich::Future {
Gaudi::Property<unsigned int> m_maxClusters{this, "MaxClusters", std::numeric_limits<unsigned int>::max()};
/// Absolute max PD occupancy. If exceeded PD is rejected.
Gaudi::Property<DetectorArray<std::size_t>> m_overallMax{this, "AbsoluteMaxPDOcc", {64, 64}};
Gaudi::Property<DetectorArray<std::size_t>> m_overallMax{this, "AbsoluteMaxPDOcc", {99999u, 99999u}};
/// Sort PD data within a RICH panel
Gaudi::Property<bool> m_sortPanels{this, "SortPDsInPanels", false};
@@ -170,6 +175,13 @@ namespace Rich::Future {
/// Is cluster splitting enabled
DetectorArray<bool> m_runClusterSplit = {{false, false}};
private:
// counters
/// PD rejected
mutable DetectorArray<Gaudi::Accumulators::BinomialCounter<>> m_rejPD{
{{this, "RICH1 PD rejected"}, {this, "RICH2 PD rejected"}}};
private:
// messaging
@@ -207,6 +219,9 @@ OutData SmartIDClustering::operator()( const DAQ::DecodedData& data, //
// Loop over the raw RICH data
// Note the data is implicitly sorted by RICH and side
// local counter buffers
auto rejPD = std::array{m_rejPD[Rich::Rich1].buffer(), m_rejPD[Rich::Rich2].buffer()};
// First, RICH detectors
for ( const auto& rD : data ) {
// sides per RICH
@@ -224,13 +239,16 @@ OutData SmartIDClustering::operator()( const DAQ::DecodedData& data, //
const auto rich = pd.pdID().rich();
// The list of hits
const auto& IDs = pd.smartIDs();
// Is it selected ?
if ( pdIsOK( pd.pdID(), pdInfo ) && // PD ID is OK
!IDs.empty() && // PD has some hits
IDs.size() <= m_overallMax[rich] ) // PD max occ cut
{
// Save this PD
pdDataV.emplace_back( &pd );
// Sanity checks on the PDID
if ( pdIsOK( pd.pdID(), pdInfo ) && !IDs.empty() ) {
const bool usePD = ( IDs.size() <= m_overallMax[rich] );
// only fill counter if PD occ cut is effectively active
if ( m_overallMax[rich] < LHCb::RichSmartID::MaPMT::TotalPixels ) { rejPD[rich] += !usePD; }
if ( usePD ) {
pdDataV.emplace_back( &pd );
} else {
_ri_verbo << "Rejected " << pd.pdID() << endmsg;
}
}
}
}
@@ -245,6 +263,8 @@ OutData SmartIDClustering::operator()( const DAQ::DecodedData& data, //
} );
}
_ri_verbo << "Selected " << pdDataV.size() << " PDs" << endmsg;
// Loop over the PD vector and cluster
for ( const auto PD : pdDataV ) {
@@ -277,6 +297,7 @@ OutData SmartIDClustering::operator()( const DAQ::DecodedData& data, //
if ( !m_clusterHits[rich] || PD->smartIDs().size() < 2 ) {
// just loop over the raw RichSmartIDs and make a 'cluster' for each
_ri_verbo << "Making " << PD->smartIDs().size() << " hits for " << PD->pdID() << endmsg;
for ( const auto& ID : PD->smartIDs() ) {
if ( timeSel( ID ) ) { clusters.emplace_back( rich, panel, ID, dePD ); }
}
Loading