Skip to content
Snippets Groups Projects

Do not assume Condition payload contains a YAML::Node

Merged Marco Clemencic requested to merge avoid-condition-as-yaml into master
1 file
+ 6
9
Compare changes
  • Side-by-side
  • Inline
/*****************************************************************************\
* (c) Copyright 2000-2018 CERN for the benefit of the LHCb Collaboration *
* (c) Copyright 2000-2022 CERN for the benefit of the LHCb Collaboration *
* *
* This software is distributed under the terms of the GNU General Public *
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
@@ -18,8 +18,6 @@
#include "LHCbAlgs/Transformer.h"
#include <yaml-cpp/yaml.h>
#ifdef USE_DD4HEP
// needed by getDet/existDet API. Should be dropped when made properly functional
# include "DetDesc/Condition.h"
@@ -116,13 +114,12 @@ bool UTTightDigitCreator::aboveDigitSignalToNoise( const UTDigit* aDigit, const
StatusCode UTTightDigitCreator::loadCutsFromConditions() {
// load conditions
auto& tmp = *getDet<Condition>( m_conditionLocation );
auto& cInfo = std::any_cast<YAML::Node&>( tmp.payload );
info() << "Loading cuts tagged as " << cInfo["tag"].as<std::string>() << endmsg;
auto* cInfo = getDet<Condition>( m_conditionLocation );
info() << "Loading cuts tagged as " << cInfo->param<std::string>( "tag" ) << endmsg;
m_digitSig2NoiseThreshold = cInfo["HitThreshold"].as<double>();
m_clusterSig2NoiseThreshold = cInfo["ConfirmationThreshold"].as<double>();
m_highThreshold = cInfo["SpilloverThreshold"].as<double>();
m_digitSig2NoiseThreshold = cInfo->param<double>( "HitThreshold" );
m_clusterSig2NoiseThreshold = cInfo->param<double>( "ConfirmationThreshold" );
m_highThreshold = cInfo->param<double>( "SpilloverThreshold" );
return StatusCode::SUCCESS;
}
Loading