Skip to content
Snippets Groups Projects
Commit 97950fd7 authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

Merge branch 'dcraik_addAltFormatForLumiSchemaJson' into 'master'

Add secondary formatting string for lumi summary schema JSON lookups

See merge request !3839
parents 9e2fa072 a17848a2
No related branches found
No related tags found
1 merge request!3839Add secondary formatting string for lumi summary schema JSON lookups
Pipeline #4696683 passed
......@@ -99,6 +99,8 @@ class GitANNSvc : public ANNSvcBase {
Gaudi::Property<std::map<unsigned int, std::string>> m_lumi_key2JSON{this, "LumiOverrule", {}};
Gaudi::Property<std::string> m_lumi_fmt{this, "LumiRefFormatter",
"{0}:luminosity_counters/json/{1:.2}/{1}.json"}; // 0=tag, 1=key, 2=version
Gaudi::Property<std::string> m_lumi_altfmt{this, "LumiAltRefFormatter",
"key-{1}:luminosity_counters/json/{1:.2}/{1}.json"};
std::optional<std::string> fetch_from_repo( std::string const& repo, std::string const& name ) const {
if ( repo.empty() ) error() << "no repo specified..." << endmsg;
......@@ -177,6 +179,7 @@ class GitANNSvc : public ANNSvcBase {
debug() << "fetch_lumi_json( " << key << " -> " << id << " ) from repo " << m_repo.value() << endmsg;
auto s = fetch_from_repos( [&]( auto const& tag ) { return fmt::format( m_lumi_fmt.value(), tag, id ); } );
if ( !s ) s = fetch_from_repos( [&]( auto const& tag ) { return fmt::format( m_lumi_altfmt.value(), tag, id ); } );
if ( !s ) return std::nullopt;
auto json = nlohmann::json::parse( *s, nullptr, false );
if ( json.is_discarded() ) return std::nullopt;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment