From 0fdcbed95da345e9059dcf746cfcab337253113f Mon Sep 17 00:00:00 2001 From: Chris Jones <jonesc@hep.phy.cam.ac.uk> Date: Mon, 7 Nov 2022 15:24:41 +0000 Subject: [PATCH] RichFutureDAQ - Small cleanup --- .../src/lib/RichPDMDBDecodeMapping.cpp | 22 +++++++++---------- .../src/lib/RichTel40CableMapping.cpp | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Rich/RichFutureDAQ/src/lib/RichPDMDBDecodeMapping.cpp b/Rich/RichFutureDAQ/src/lib/RichPDMDBDecodeMapping.cpp index bf1e06b0656..e525ab9dd2d 100644 --- a/Rich/RichFutureDAQ/src/lib/RichPDMDBDecodeMapping.cpp +++ b/Rich/RichFutureDAQ/src/lib/RichPDMDBDecodeMapping.cpp @@ -27,11 +27,11 @@ #define verbo( ... ) \ if ( messenger() ) { ri_verbo( __VA_ARGS__ ); } -// boost -#include "boost/container/static_vector.hpp" - // STL #include <algorithm> +#include <array> +#include <cstdint> +#include <string> #include <vector> using namespace Rich::Future::DAQ; @@ -43,19 +43,17 @@ void PDMDBDecodeMapping::checkVersion( const DecodingConds& C ) { // check status is (still) OK before continuing if ( !isInitialised() ) { return; } - // mapping version - boost::container::static_vector<int, 3> condVers; - - auto checkV = [&]( const auto& cond ) { - // Access parameter, with default value 0 if missing - condVers.push_back( condition_param<int>( cond, "MappingVersion", 0 ) ); + auto getVersion = []( const auto& cond ) { + // Access version, with default value 0 if missing + return condition_param<int>( cond, "MappingVersion", 0 ); }; // extract version from all conditions - for ( const auto rich : Rich::detectors() ) { checkV( C.rTypeConds[rich] ); } - checkV( C.hTypeCond ); + const auto condVers = std::array{getVersion( C.rTypeConds[Rich::Rich1] ), // + getVersion( C.rTypeConds[Rich::Rich2] ), // + getVersion( C.hTypeCond )}; - // Should all be the same for all panels. + // Should all be the same if ( !condVers.empty() && std::all_of( condVers.begin(), condVers.end(), [first = condVers.front()]( const auto& e ) { return e == first; } ) ) { m_mappingVer = condVers.front(); diff --git a/Rich/RichFutureDAQ/src/lib/RichTel40CableMapping.cpp b/Rich/RichFutureDAQ/src/lib/RichTel40CableMapping.cpp index 6d52d64fddb..abb26e58c13 100644 --- a/Rich/RichFutureDAQ/src/lib/RichTel40CableMapping.cpp +++ b/Rich/RichFutureDAQ/src/lib/RichTel40CableMapping.cpp @@ -157,7 +157,7 @@ void Tel40CableMapping::fillCableMaps( const Conds& C ) { sourceID, // link, // isLargePMT, // - bool( status ), // + 0 != status, // PDModuleNumber( modN ), // PDMDBID( pdmdb ), // PDMDBFrame( pdmdbLink ) ); -- GitLab