5 #ifndef ACTSTRACK_SAFEDECORATOR_H
6 #define ACTSTRACK_SAFEDECORATOR_H
18 #include "GaudiKernel/EventContext.h"
29 template <
class T_Cont,
class T>
30 std::vector<SG::WriteDecorHandle<T_Cont,T> >
32 const EventContext &ctx) {
33 std::vector<SG::WriteDecorHandle<T_Cont,T> >
out;
36 out.emplace_back(a_key,ctx);
37 if (not
out.back().isValid()) {
38 std::stringstream
msg;
39 msg <<
"Failed to create decorator handdle " << a_key.key();
40 throw std::runtime_error(
msg.str() );
48 template<
class T_Parent,
class T_Cont>
52 const std::vector<std::string> &decor_names,
55 decor_out.reserve(decor_names.size());
56 for (
const std::string &a_decor_name : decor_names) {
57 assert( !a_decor_name.empty() );
58 decor_out.emplace_back(container_key.
key()+
"."+
prefix+a_decor_name);
61 parent.declare(decor_out.back());
62 decor_out.back().setOwner(&
parent);
63 decor_out.back().initialize().ignore();