diff --git a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBDecodeMapping.h b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBDecodeMapping.h index 9e8e88c2652eca7844355e7807e395a1cd28fb1a..011a40f3066fc4fdc3144209d1b2491252dd58be 100644 --- a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBDecodeMapping.h +++ b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBDecodeMapping.h @@ -19,7 +19,6 @@ // Det Desc #include "DetDesc/ConditionKey.h" -#include "DetDesc/IConditionDerivationMgr.h" // RICH DAQ #include "RichFutureDAQ/RichTel40CableMapping.h" @@ -28,6 +27,9 @@ #include "GaudiAlg/GetData.h" #include "RichDetectors/Rich1.h" +// Detectors +#include "RichDetectors/Utilities.h" + // STL #include <array> #include <cassert> @@ -59,8 +61,8 @@ namespace Rich::Future::DAQ { }; public: - /// No default constructor - PDMDBDecodeMapping() = delete; + /// Default constructor + PDMDBDecodeMapping() = default; /// Null constructor explicit PDMDBDecodeMapping( const Gaudi::Algorithm* parent ) : m_parent( parent ) {} @@ -177,14 +179,6 @@ namespace Rich::Future::DAQ { public: // conditions handling - // Note - With DD4HEP these will be different - /// RICH1 R-Type decoding conditions map path - static constexpr const char* R1_RTypePath = "/dd/Conditions/ReadoutConf/Rich1/PDMDB_R_DecodePixelMap"; - /// RICH2 R-Type decoding conditions map path - static constexpr const char* R2_RTypePath = "/dd/Conditions/ReadoutConf/Rich2/PDMDB_R_DecodePixelMap"; - /// RICH2 H-Type decoding conditions map path - static constexpr const char* R2_HTypePath = "/dd/Conditions/ReadoutConf/Rich2/PDMDB_H_DecodePixelMap"; - /// Default conditions name static constexpr const char* DefaultConditionKey = "PDMDBDecodeMapping-Handler"; @@ -204,30 +198,31 @@ namespace Rich::Future::DAQ { if ( parent->msgLevel( MSG::DEBUG ) ) { parent->debug() << "PDMDBDecodeMapping::addConditionDerivation : Key=" << key << endmsg; } + // Note - With DD4HEP these will be different + std::array<std::string, 3> // + cond_paths{"/dd/Conditions/ReadoutConf/Rich1/PDMDB_R_DecodePixelMap", + "/dd/Conditions/ReadoutConf/Rich2/PDMDB_R_DecodePixelMap", + "/dd/Conditions/ReadoutConf/Rich2/PDMDB_H_DecodePixelMap"}; // NOTE: CheckData test only needed here to deal with fact // not all DB tags currently in use have the required mapping conditions. // We detect this here and just return a default uninitialised object. // downstream users always check if the object is initialised before using // the object, which is only done when the DB tags require it. // Once support for the old DB tags is no longer required the test can be removed. - // Gerhard/Seb/Ben - If when you see this, if you can think of a better - // way to handle this pleae let me know ;) - if ( Gaudi::Utils::CheckData<ParamValidDataObject>()( parent->detSvc(), R2_HTypePath ) ) { - return LHCb::DetDesc:: // - addConditionDerivation( parent->conditionDerivationMgr(), // - {R1_RTypePath, R2_RTypePath, R2_HTypePath}, // input - std::move( key ), // output - [p = parent]( const ParamValidDataObject& r1Cr, // - const ParamValidDataObject& r2Cr, // - const ParamValidDataObject& r2Ch ) { - return PDMDBDecodeMapping{DecodingConds{{&r1Cr, &r2Cr}, &r2Ch}, p}; - } ); + if ( Gaudi::Utils::CheckData<ParamValidDataObject>()( parent->detSvc(), cond_paths[0] ) ) { + return parent->addConditionDerivation( std::move( cond_paths ), // input + std::move( key ), // output + [p = parent]( const ParamValidDataObject& r1Cr, // + const ParamValidDataObject& r2Cr, // + const ParamValidDataObject& r2Ch ) { + return PDMDBDecodeMapping{DecodingConds{{&r1Cr, &r2Cr}, &r2Ch}, p}; + } ); } else { // needs to depend on 'something' so fake a dependency on Rich1 Detector::Rich1::addConditionDerivation( parent ); // return an unintialised object - return LHCb::DetDesc::addConditionDerivation( - parent->conditionDerivationMgr(), {Detector::Rich1::DefaultConditionKey}, std::move( key ), + return parent->addConditionDerivation( + {Detector::Rich1::DefaultConditionKey}, std::move( key ), [p = parent]( const Detector::Rich1& ) { return PDMDBDecodeMapping{p}; } ); } } diff --git a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBEncodeMapping.h b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBEncodeMapping.h index 5541c11bd380ec25a359becbf98df5c079226d90..a1ffc464165779d58d25126aa40f4e23ea5f00df 100644 --- a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBEncodeMapping.h +++ b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichPDMDBEncodeMapping.h @@ -19,12 +19,14 @@ // Det Desc #include "DetDesc/ConditionKey.h" -#include "DetDesc/IConditionDerivationMgr.h" // Temporary. To check if conditions exist (see below) #include "GaudiAlg/GetData.h" #include "RichDetectors/Rich1.h" +// Rich Detector +#include "RichDetectors/Utilities.h" + // STL #include <array> #include <cassert> @@ -57,7 +59,7 @@ namespace Rich::Future::DAQ { public: /// Default constructor - PDMDBEncodeMapping() = delete; + PDMDBEncodeMapping() = default; /// Null constructor explicit PDMDBEncodeMapping( const Gaudi::Algorithm* parent ) : m_parent( parent ) {} @@ -176,14 +178,6 @@ namespace Rich::Future::DAQ { public: // conditions handling - // Note - With DD4HEP these will be different - /// RICH1 R-Type encoding conditions map path - static constexpr const char* R1_RTypePath = "/dd/Conditions/ReadoutConf/Rich1/PDMDB_R_EncodePixelMap"; - /// RICH2 R-Type encoding conditions map path - static constexpr const char* R2_RTypePath = "/dd/Conditions/ReadoutConf/Rich2/PDMDB_R_EncodePixelMap"; - /// RICH2 H-Type encoding conditions map path - static constexpr const char* R2_HTypePath = "/dd/Conditions/ReadoutConf/Rich2/PDMDB_H_EncodePixelMap"; - /// Default conditions name static constexpr const char* DefaultConditionKey = "PDMDBEncodeMapping-Handler"; @@ -203,6 +197,11 @@ namespace Rich::Future::DAQ { if ( parent->msgLevel( MSG::DEBUG ) ) { parent->debug() << "PDMDBEncodeMapping::addConditionDerivation : Key=" << key << endmsg; } + // Note - Will need to be different paths for DD4HEP + std::array<std::string, 3> // + cond_paths{"/dd/Conditions/ReadoutConf/Rich1/PDMDB_R_EncodePixelMap", + "/dd/Conditions/ReadoutConf/Rich2/PDMDB_R_EncodePixelMap", + "/dd/Conditions/ReadoutConf/Rich2/PDMDB_H_EncodePixelMap"}; // NOTE: CheckData test only needed here to deal with fact // not all DB tags currently in use have the required mapping conditions. // We detect this here and just return a default uninitialised object. @@ -211,22 +210,20 @@ namespace Rich::Future::DAQ { // Once support for the old DB tags is no longer required the test can be removed. // Gerhard/Seb/Ben - If when you see this, if you can think of a better // way to handle this pleae let me know ;) - if ( Gaudi::Utils::CheckData<ParamValidDataObject>()( parent->detSvc(), R2_HTypePath ) ) { - return LHCb::DetDesc:: // - addConditionDerivation( parent->conditionDerivationMgr(), // - {R1_RTypePath, R2_RTypePath, R2_HTypePath}, // input - std::move( key ), // output - [p = parent]( const ParamValidDataObject& r1Cr, // - const ParamValidDataObject& r2Cr, // - const ParamValidDataObject& r2Ch ) { - return PDMDBEncodeMapping{EncodingConds{{&r1Cr, &r2Cr}, &r2Ch}, p}; - } ); + if ( Gaudi::Utils::CheckData<ParamValidDataObject>()( parent->detSvc(), cond_paths[0] ) ) { + return parent->addConditionDerivation( std::move( cond_paths ), // input + std::move( key ), // output + [p = parent]( const ParamValidDataObject& r1Cr, // + const ParamValidDataObject& r2Cr, // + const ParamValidDataObject& r2Ch ) { + return PDMDBEncodeMapping{EncodingConds{{&r1Cr, &r2Cr}, &r2Ch}, p}; + } ); } else { // needs to depend on 'something' so fake a dependency on Rich1 Detector::Rich1::addConditionDerivation( parent ); // return an unintialised object - return LHCb::DetDesc::addConditionDerivation( - parent->conditionDerivationMgr(), {Detector::Rich1::DefaultConditionKey}, std::move( key ), + return parent->addConditionDerivation( + {Detector::Rich1::DefaultConditionKey}, std::move( key ), [p = parent]( const Detector::Rich1& ) { return PDMDBEncodeMapping{p}; } ); } } diff --git a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichTel40CableMapping.h b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichTel40CableMapping.h index 8435fd54b8046dfb8918043dc9a0d234ff5f3917..abe056a2930e1ada92b5303847b1fb872d473c91 100644 --- a/Rich/RichFutureDAQ/include/RichFutureDAQ/RichTel40CableMapping.h +++ b/Rich/RichFutureDAQ/include/RichFutureDAQ/RichTel40CableMapping.h @@ -19,7 +19,6 @@ // Det Desc #include "DetDesc/ConditionKey.h" -#include "DetDesc/IConditionDerivationMgr.h" // Boost #include "boost/container/static_vector.hpp" @@ -32,6 +31,9 @@ #include "GaudiAlg/GetData.h" #include "RichDetectors/Rich1.h" +// Rich Detector +#include "RichDetectors/Utilities.h" + namespace Gaudi { class Algorithm; } @@ -59,8 +61,8 @@ namespace Rich::Future::DAQ { using Conds = std::array<const ParamValidDataObject*, Rich::NTotalPDPanels>; public: - /// No default constructor - Tel40CableMapping() = delete; + /// Default constructor + Tel40CableMapping() = default; /// Null constructor explicit Tel40CableMapping( const Gaudi::Algorithm* parent ) : m_parent( parent ) {} @@ -243,11 +245,12 @@ namespace Rich::Future::DAQ { if ( parent->msgLevel( MSG::DEBUG ) ) { parent->debug() << "Tel40CableMapping::addConditionDerivation : Key=" << key << endmsg; } - const std::array<std::string, Rich::NTotalPDPanels> cond_paths{ - "/dd/Conditions/ReadoutConf/Rich1/R1U_Tel40CablingMap", - "/dd/Conditions/ReadoutConf/Rich1/R1D_Tel40CablingMap", - "/dd/Conditions/ReadoutConf/Rich2/R2A_Tel40CablingMap", - "/dd/Conditions/ReadoutConf/Rich2/R2C_Tel40CablingMap"}; + // Note - Will need to be different paths for DD4HEP + std::array<std::string, Rich::NTotalPDPanels> // + cond_paths{"/dd/Conditions/ReadoutConf/Rich1/R1U_Tel40CablingMap", + "/dd/Conditions/ReadoutConf/Rich1/R1D_Tel40CablingMap", + "/dd/Conditions/ReadoutConf/Rich2/R2A_Tel40CablingMap", + "/dd/Conditions/ReadoutConf/Rich2/R2C_Tel40CablingMap"}; // NOTE: CheckData test only needed here to deal with fact // not all DB tags currently in use have the required mapping conditions. // We detect this here and just return a default uninitialised object. @@ -257,22 +260,20 @@ namespace Rich::Future::DAQ { // Gerhard/Seb/Ben - If when you see this, if you can think of a better // way to handle this pleae let me know ;) if ( Gaudi::Utils::CheckData<ParamValidDataObject>()( parent->detSvc(), cond_paths[0] ) ) { - return LHCb::DetDesc:: // - addConditionDerivation( parent->conditionDerivationMgr(), // - cond_paths, // - std::move( key ), // output - [p = parent]( const ParamValidDataObject& r1U, // - const ParamValidDataObject& r1D, // - const ParamValidDataObject& r2A, // - const ParamValidDataObject& r2C ) { - return Tel40CableMapping{Conds{&r1U, &r1D, &r2A, &r2C}, p}; - } ); + return parent->addConditionDerivation( std::move( cond_paths ), // + std::move( key ), // output + [p = parent]( const ParamValidDataObject& r1U, // + const ParamValidDataObject& r1D, // + const ParamValidDataObject& r2A, // + const ParamValidDataObject& r2C ) { + return Tel40CableMapping{Conds{&r1U, &r1D, &r2A, &r2C}, p}; + } ); } else { // needs to depend on 'something' so fake a dependency on Rich1 Detector::Rich1::addConditionDerivation( parent ); // return an unintialised object - return LHCb::DetDesc::addConditionDerivation( - parent->conditionDerivationMgr(), {Detector::Rich1::DefaultConditionKey}, std::move( key ), + return parent->addConditionDerivation( + {Detector::Rich1::DefaultConditionKey}, std::move( key ), [p = parent]( const Detector::Rich1& ) { return Tel40CableMapping{p}; } ); } } diff --git a/Rich/RichFutureDAQ/src/component/RichRawBankDecoder.cpp b/Rich/RichFutureDAQ/src/component/RichRawBankDecoder.cpp index 3f843a1e4c2d51a389d8a056dd18a80128fee52f..3cf407aa2bc9afdc92dcb33786d2ba31edc675ea 100644 --- a/Rich/RichFutureDAQ/src/component/RichRawBankDecoder.cpp +++ b/Rich/RichFutureDAQ/src/component/RichRawBankDecoder.cpp @@ -16,9 +16,6 @@ // Rich Kernel #include "RichFutureKernel/RichAlgBase.h" -// DetDesc -#include "DetDesc/ConditionAccessorHolder.h" - // Gaudi Functional #include "GaudiAlg/Transformer.h"