11#include "GaudiKernel/System.h"
22 const std::string& name,
23 const IInterface* parent) :
31 declareInterface< TrigSerTPTool >(
this );
35 "allows to skip classes not relevant in the current "
38 "an instance of the messageSvc for debugging purposes" );
40 "simpler setup for running online" );
42 "use AthDictLoaderSvc instead of plain ROOT" );
53 ATH_MSG_INFO(
"Could not retrieve a separate MsgSvc for "
54 "the T/P debugging" );
58 m_logTP = std::make_unique< MsgStream >( msvc,
59 "TrigSerTPTool-T/P" );
81 return StatusCode::SUCCESS;
87 ITPCnvBase* cnvtr = m_convertesCache[persistent];
97 m_convertesCache[persistent] = cnvtr;
102 std::string &persName )
const
112 const auto tpItr =
m_TPmap.find( clname );
115 <<
"Transient class " << clname
116 <<
" is not in the T/P Converter map";
119 persName = tpItr->second;
123 ATH_MSG_ERROR(
"T/P Converter for transient class " << tpItr->first
124 <<
" persistent class " << persName <<
" could not be retrieved");
129 const std::string persname =
131 TClass *persObjCl =
getClass( persname );
134 persptr = persObjCl->New();
135 ATH_MSG_DEBUG(
"created object of " << persptr <<
" at " << persptr );
138 <<
"Couldn't find dictionary for type " << persname;
143 ATH_MSG_DEBUG(
"invoking TP for " << clname <<
" at " << ptr );
146 persName = std::move(persname);
150 catch(
const std::runtime_error& e ){
153 const std::string issue = e.what();
154 if( issue.find(
"is deprecated" ) != std::string::npos ) {
158 REPORT_MESSAGE( MSG::ERROR ) <<
"An exception occurred: " << e.what();
167 std::string& transName )
const
178 <<
"T/P Converter for persistent class "
179 << persName <<
" could not be retrieved";
187 TClass *transCl =
getClass( transName );
190 trans = transCl->New();
200 catch (
const std::runtime_error& e){
201 REPORT_MESSAGE( MSG::ERROR ) <<
"An exception occurred: " << e.what();
214 const auto tpItr =
m_TPmap.find( transClassName );
217 <<
"Transient class " << transClassName
218 <<
" is not in the T/P Converter map";
219 static const std::string dummy(
"" );
224 return tpItr->second;
233 cl = TClass::GetClass( cname.c_str() );
#define ATH_CHECK
Evaluate an expression and check for errors.
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual const std::type_info & transientTInfo() const =0
return C++ type id of the transient class this converter is for
virtual void persToTransWithKeyUntyped(const void *pers, void *trans, const std::string &, MsgStream &msg)
Convert persistent object representation to transient.
virtual void transToPersUntyped(const void *trans, void *pers, MsgStream &msg)=0
Convert transient object representation to persistent.
virtual const std::type_info & persistentTInfo() const =0
return C++ type id of the persistent class this converter is for