Skip to content
Snippets Groups Projects

Use the correct Magnet current/polarity condition name

Merged Marco Clemencic requested to merge use-correct-magnet-cond into master
2 unresolved threads
Files
4
@@ -44,13 +44,10 @@ std::shared_ptr<LHCb::Magnet::MagneticFieldGrid> LHCb::Magnet::MagneticFieldExte
dd4hep::DetElement magnetdet = m_description.detector( "Magnet" );
// Loading the current value
// XXX We not have the Measured/Set distinction in the upgrade condition ?
// auto magnet_meascond = slice.get( magnetdet, LHCb::Detector::item_key( "Measured" ) );
// XX why the diff in interface between context and slice
dd4hep::Condition magnet_meascond = context.condition( LHCb::Detector::ConditionKey( magnetdet, "Measured" ) );
YAML::Node* magnet_measdoc = static_cast<YAML::Node*>( magnet_meascond->payload() );
double current = ( *magnet_measdoc )["Current"].as<double>();
int polarity = ( *magnet_measdoc )["Polarity"].as<int>();
dd4hep::Condition magnet_cond = context.condition( LHCb::Detector::ConditionKey( magnetdet, "Magnet" ) );
YAML::Node* magnet_doc = static_cast<YAML::Node*>( magnet_cond->payload() );
double current = ( *magnet_doc )["Current"].as<double>();
int polarity = ( *magnet_doc )["Polarity"].as<int>();
dd4hep::printout( dd4hep::DEBUG, "MagneticFieldExtension", "Current value: %f", current );
dd4hep::printout( dd4hep::DEBUG, "MagneticFieldExtension", "Current polarity: %d", polarity );
Loading