16#include "GaudiKernel/IToolSvc.h"
30 (
const std::string&
type,
31 const std::string& name,
32 const IInterface* parent)
33 : base_class (
type, name, parent),
34 m_jos (
"JobOptionsSvc", name),
37 declareProperty (
"JobOptionsSvc",
m_jos,
38 "The JobOptionsSvc instance.");
40 "The ToolSvc instance.");
50 CHECK( AthAlgTool::initialize() );
53 return StatusCode::SUCCESS;
65 std::pair<map_t::iterator, bool>
res =
69 "D3PD::CollectionGetterRegistryTool")
70 <<
"Duplicate collection label " <<
label
71 <<
" for tools " <<
res.first->second->name()
72 <<
" and " << tool->name();
73 return StatusCode::FAILURE;
75 return StatusCode::SUCCESS;
89 const INamedInterface* parent,
97 "D3PD::CollectionGetterRegistryTool")
98 <<
"Can't find collection label " <<
label;
99 std::ostringstream os;
100 os <<
" Known collections:";
102 os <<
" " << p.first;
105 "D3PD::CollectionGetterRegistryTool")
107 return StatusCode::SUCCESS;
111 const auto& props =
m_jos->items([&i](
const auto& p) {
112 return std::get<0>(p).starts_with( i->second->name()+
".");
116 std::string fullname = parent->name() +
"." +
label;
117 for (
const auto& p : props) {
118 const std::string& oldname = std::get<0>(p);
119 std::string::size_type ipos = oldname.rfind (
'.');
120 if (ipos != std::string::npos) {
121 std::string pname = oldname.substr (ipos, std::string::npos);
122 if (pname !=
".Label") {
123 m_jos->set(fullname + pname, std::get<1>(p));
129 return m_toolsvc->retrieveTool (i->second->type(),
label, tool, parent);
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
#define CHECK(...)
Evaluate an expression and check for errors.
std::pair< std::vector< unsigned int >, bool > res
std::string label(const std::string &format, int i)
Block filler tool for noisy FEB information.