Skip to content
Snippets Groups Projects
Commit c63eb4b0 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

D3PDMakerCoreComps: Migrate to IOptionsSvc

Migrate `CollectionGetterRegistryTool` from the deprecated
`IJobOptionsSvc` interface to `IOptionsSvc`.

Closes ATEAM-658.
parent 403d7481
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!39539D3PDMakerCoreComps: Migrate to IOptionsSvc
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// $Id: CollectionGetterRegistryTool.cxx 618070 2014-09-22 19:05:34Z ssnyder $
/**
* @file D3PDMakerCoreComps/src/CollectionGetterRegistryTool.cxx
* @author scott snyder <snyder@bnl.gov>
......@@ -15,8 +14,8 @@
#include "D3PDMakerInterfaces/ICollectionGetterTool.h"
#include "AthenaKernel/errorcheck.h"
#include "GaudiKernel/IToolSvc.h"
#include "GaudiKernel/IJobOptionsSvc.h"
#include <boost/algorithm/string/predicate.hpp>
namespace D3PD {
......@@ -101,14 +100,16 @@ CollectionGetterRegistryTool::get (const std::string& label,
}
// Get the properties for the source tool.
const std::vector<const Gaudi::Details::PropertyBase*>* props =
m_jos->getProperties (i->second->name());
const auto& props = m_jos->items([&i](const auto& p) {
return boost::algorithm::starts_with(std::get<0>(p), i->second->name()+".");
});
// Copy them to the destination tool (except for Label).
std::string fullname = parent->name() + "." + label;
for (size_t i = 0; i < props->size(); i++) {
if ((*props)[i]->name() != "Label")
CHECK( m_jos->addPropertyToCatalogue (fullname, *(*props)[i]) );
for (const auto& p : props) {
if (not boost::algorithm::ends_with(std::get<0>(p), ".Label")) {
m_jos->set(fullname, std::get<1>(p));
}
}
// Create the new tool.
......
// This file's extension implies that it's C, but it's really -*- C++ -*-.
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// $Id: CollectionGetterRegistryTool.h 781599 2016-11-01 15:42:00Z ssnyder $
/**
* @file D3PDMakerCoreComps/src/CollectionGetterRegistryTool.h
* @author scott snyder <snyder@bnl.gov>
......@@ -21,7 +20,7 @@
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/ServiceHandle.h"
#include "GaudiKernel/IJobOptionsSvc.h"
#include "Gaudi/Interfaces/IOptionsSvc.h"
#include <unordered_map>
......@@ -87,7 +86,7 @@ public:
private:
/// Property: The job options service.
ServiceHandle<IJobOptionsSvc> m_jos;
ServiceHandle<Gaudi::Interfaces::IOptionsSvc> m_jos;
/// Property: The tool service.
ServiceHandle<IToolSvc> m_toolsvc;
......
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