diff --git a/CaloFuture/CaloFuturePIDs/src/SelectiveElectronMatchAlg.cpp b/CaloFuture/CaloFuturePIDs/src/SelectiveElectronMatchAlg.cpp index e3f95028b460b701a49a20646a8fa85c0bb140cb..0aeefc606f22b8ba5ff12dcd20e9bfeebcbefa03 100644 --- a/CaloFuture/CaloFuturePIDs/src/SelectiveElectronMatchAlg.cpp +++ b/CaloFuture/CaloFuturePIDs/src/SelectiveElectronMatchAlg.cpp @@ -17,8 +17,6 @@ #include "Magnet/DeMagnet.h" #include "SelectiveMatchUtils.h" -#include <yaml-cpp/yaml.h> - /** @class SelectiveElectronMatchAlg SelectiveElectronMatchAlg.h * * Matches tracks with local electron hypos in and around calo cell @@ -62,13 +60,13 @@ namespace LHCb::Calo { public: electronXcorrections() = default; // needed by DD4hep even if unused ! - electronXcorrections( YAML::Node const& c ) - : alphaPOut{ c["alphaPOut"].as<std::array<double, 4>>() } - , alphaNOut{ c["alphaNOut"].as<std::array<double, 4>>() } - , alphaPMid{ c["alphaPMid"].as<std::array<double, 4>>() } - , alphaNMid{ c["alphaNMid"].as<std::array<double, 4>>() } - , alphaPInn{ c["alphaPInn"].as<std::array<double, 4>>() } - , alphaNInn{ c["alphaNInn"].as<std::array<double, 4>>() } {} + electronXcorrections( nlohmann::json const& c ) + : alphaPOut{ c["alphaPOut"].get<std::array<double, 4>>() } + , alphaNOut{ c["alphaNOut"].get<std::array<double, 4>>() } + , alphaPMid{ c["alphaPMid"].get<std::array<double, 4>>() } + , alphaNMid{ c["alphaNMid"].get<std::array<double, 4>>() } + , alphaPInn{ c["alphaPInn"].get<std::array<double, 4>>() } + , alphaNInn{ c["alphaNInn"].get<std::array<double, 4>>() } {} const std::array<double, 4>& operator()( const int area, const int charge, const int polarity ) const { bool qpolarity = charge * polarity > 0; @@ -186,8 +184,8 @@ namespace LHCb::Calo { // ============================================================================ StatusCode SelectiveElectronMatchAlg::initialize() { auto sc = Transformer::initialize().andThen( [&] { - addConditionDerivation<electronXcorrections( YAML::Node const& )>( { m_xcorrectionlocation.value() }, - inputLocation<electronXcorrections>() ); + addConditionDerivation<electronXcorrections( nlohmann::json const& )>( { m_xcorrectionlocation.value() }, + inputLocation<electronXcorrections>() ); } ); return sc; } diff --git a/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.cpp b/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.cpp index 418cf44d125629f9d2c2902b1197c5a4346f8624..d7a9f04a09b885aa562c0ad446242325f07b8349 100644 --- a/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.cpp +++ b/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.cpp @@ -13,8 +13,6 @@ #include "Core/FloatComparison.h" #include "Event/ProtoParticle.h" -#include <yaml-cpp/yaml.h> - using namespace LHCb::Math::Approx; namespace Gaudi::Parsers { @@ -121,12 +119,12 @@ namespace LHCb::Calo::Correction { StatusCode Base::initialize() { return ConditionAccessorHolder::initialize().andThen( [&]() -> StatusCode { if ( m_hypos.empty() ) return Error( "Empty vector of allowed Calorimeter Hypotheses!" ); - addConditionDerivation( { m_conditionName }, m_params.key(), [&]( YAML::Node const& cond ) { + addConditionDerivation( { m_conditionName }, m_params.key(), [&]( nlohmann::json const& cond ) { Parameters params; - for ( auto it = cond.begin(); it != cond.end(); it++ ) { - auto type = accept( it->first.as<std::string>() ); + for ( auto& [key, val] : cond.items() ) { + auto type = accept( key ); if ( !type ) continue; - const auto& parVec = it->second.as<std::vector<double>>(); + const auto& parVec = val.get<std::vector<double>>(); if ( parVec.size() < 2 ) { error() << " # of parameters is insufficient!!" << endmsg; continue; diff --git a/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.h b/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.h index 758b43b45c5a5789b1857d119b05d36bbacd0db6..cebd8ea3c525dc7ec0ab2147fff33f9fc54715e8 100644 --- a/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.h +++ b/CaloFuture/CaloFutureReco/src/CaloCorrectionBase.h @@ -247,7 +247,7 @@ namespace LHCb::Calo::Correction { ConditionAccessor<Parameters> m_params{ this, name() + "-Parameters" }; void constructParams( Functions&, const LHCb::span<const double> ); - Parameters constructParams( YAML::Node const& ); + Parameters constructParams( nlohmann::json const& ); public: // required by clients to retrieve internal condition m_param diff --git a/CaloFuture/CaloFutureReco/src/ClusterCovarianceMatrixTool.cpp b/CaloFuture/CaloFutureReco/src/ClusterCovarianceMatrixTool.cpp index 36fb5eba008dc79f36b736bd4a3d767e2545559b..f639414c1fecbd5a855f171bc856850513be0d2f 100644 --- a/CaloFuture/CaloFutureReco/src/ClusterCovarianceMatrixTool.cpp +++ b/CaloFuture/CaloFutureReco/src/ClusterCovarianceMatrixTool.cpp @@ -10,8 +10,6 @@ \*****************************************************************************/ #include "ClusterCovarianceMatrixTool.h" -#include <yaml-cpp/yaml.h> - /** @file * * Implementation file for class FutureClusterCovarianceMatrixTool @@ -55,7 +53,7 @@ namespace LHCb::Calo { // depends on m_conditionName so that calls to m_dbAccessor give proper results addConditionDerivation( { m_conditionName, m_dbAccessor->getParamConditionPath() }, m_parameters.key(), - [&]( YAML::Node const&, Correction::Parameters const& baseParams ) { return getParams( baseParams ); } ); + [&]( nlohmann::json const&, Correction::Parameters const& baseParams ) { return getParams( baseParams ); } ); return StatusCode::SUCCESS; } ); } diff --git a/CaloFuture/CaloFutureReco/src/SubClusterSelectorTool.cpp b/CaloFuture/CaloFutureReco/src/SubClusterSelectorTool.cpp index 62806e4d5ea24be236f12ec547ddc86d7f09da55..ae6fcf8b870616d60891b5ed923f813c29d16d00 100644 --- a/CaloFuture/CaloFutureReco/src/SubClusterSelectorTool.cpp +++ b/CaloFuture/CaloFutureReco/src/SubClusterSelectorTool.cpp @@ -12,8 +12,6 @@ #include "fmt/format.h" -#include <yaml-cpp/yaml.h> - //----------------------------------------------------------------------------- // Implementation file for class : SubClusterSelectorTool // @@ -46,7 +44,7 @@ namespace LHCb::Calo { // depends on m_condition so that calls to m_dbAccessor give proper results addConditionDerivation( { m_condition, m_dbAccessor->getParamConditionPath() }, m_tags.key(), - [&]( YAML::Node const&, Correction::Parameters const& baseParams ) { return getParams( baseParams ); } ); + [&]( nlohmann::json const&, Correction::Parameters const& baseParams ) { return getParams( baseParams ); } ); return StatusCode::SUCCESS; } ); } diff --git a/Tr/PatPV/src/PVOfflineTool.cpp b/Tr/PatPV/src/PVOfflineTool.cpp index 8303ae727cea1824290c145914ebbd8d2e9a31f3..b26f033b2d7eb36f0c9de77cb9148b6798a2d24a 100644 --- a/Tr/PatPV/src/PVOfflineTool.cpp +++ b/Tr/PatPV/src/PVOfflineTool.cpp @@ -30,8 +30,6 @@ #include <string> #include <vector> -#include <yaml-cpp/yaml.h> - class PVOfflineTool : public extends<LHCb::DetDesc::ConditionAccessorHolder<GaudiTool>, IPVOfflineTool> { public: // Standard constructor @@ -243,7 +241,7 @@ StatusCode PVOfflineTool::initialize() { { LHCb::standard_geometry_top, LHCb::Det::VP::det_path }, m_ir.key() ); #else if ( Gaudi::Utils::CheckData<Condition>()( this->detSvc(), LHCb::Conditions::InteractionRegion::ConditionPath ) ) { - addConditionDerivation<LHCb::Conditions::InteractionRegion( const YAML::Node& )>( + addConditionDerivation<LHCb::Conditions::InteractionRegion( const nlohmann::json& )>( { LHCb::Conditions::InteractionRegion::ConditionPath }, m_ir.key() ); } else { addConditionDerivation<LHCb::Conditions::InteractionRegion( const DeVP& vp )>( { LHCb::Det::VP::det_path }, diff --git a/Tr/PrKalmanFilter/src/KalmanFilterTool.cpp b/Tr/PrKalmanFilter/src/KalmanFilterTool.cpp index e8e41b541228336b34c2edf893a9a69905052df8..cfacb6922e64c3dba918af026f9b1eefa972915e 100644 --- a/Tr/PrKalmanFilter/src/KalmanFilterTool.cpp +++ b/Tr/PrKalmanFilter/src/KalmanFilterTool.cpp @@ -629,7 +629,7 @@ namespace LHCb::Pr { #else if ( auto* detSvc = this->service( "DetectorDataSvc" ).get(); Gaudi::Utils::CheckData<Condition>()( dynamic_cast<IDataProviderSvc*>( detSvc ), LHCb::Conditions::InteractionRegion::ConditionPath ) ) { - addConditionDerivation<LHCb::Conditions::InteractionRegion( const YAML::Node& )>( + addConditionDerivation<LHCb::Conditions::InteractionRegion( const nlohmann::json& )>( { LHCb::Conditions::InteractionRegion::ConditionPath }, inputLocation<Conditions::InteractionRegion>() ); } else { addConditionDerivation<Conditions::InteractionRegion( const DeVP& vp )>(