23#include "GaudiKernel/DataObject.h"
25#include "GaudiKernel/ServiceHandle.h"
26#include "GaudiKernel/System.h"
37 std::string name_from_clid (
const CLID clid)
40 o <<
"AthenaRootLeafCnv_" << clid;
54 ISvcLocator* pSvcLocator ) :
55 ::
Converter( ROOT_StorageType, clid, pSvcLocator ),
67 ::
Converter ( ROOT_StorageType, CLID_NULL, pSvcLocator ),
90 msg().setLevel( MSG::INFO );
95 if ( ::Converter::initialize().isFailure() ) {
97 return StatusCode::FAILURE;
104 IDictLoaderSvc_t dictSvc(
"AthDictLoaderSvc",
107 if ( !dictSvc.retrieve().isSuccess() ) {
108 ATH_MSG_ERROR(
"could not retrieve [" << dictSvc.typeAndName() <<
"] !");
109 return StatusCode::FAILURE;
112 RootType ty = dictSvc->load_type(this->objType());
114 << this->objType() <<
"]: name=["
115 << ty.
Name() <<
"]");
118 ATH_MSG_DEBUG(
"converter correctly initialized - clid=[" << objType() <<
"]");
119 return StatusCode::SUCCESS;
129 return ROOT_StorageType;
142 ATH_MSG_DEBUG(
"::createObj(" << pAddr <<
", " << pObj <<
")");
146 return StatusCode::FAILURE;
149 <<
"/" << rba->par()[1] <<
"]...");
152 <<
"/" << rba->par()[1] <<
"]... [done]");
155 return StatusCode::SUCCESS;
164 ATH_MSG_INFO(
"::createRep(" << pObj <<
", " << pAddr <<
")");
167 return StatusCode::FAILURE;
169 msg(MSG::INFO) <<
" -> clid: [" << pObj->clID() <<
"]" <<
endmsg
170 <<
" -> name: [" << pObj->name() <<
"]" <<
endmsg;
191 GenericAddress* addr =
new GenericAddress(ROOT_StorageType,
196 (ROOT_StorageType,
id,
199 (
unsigned long)(value_ptr),
200 (
unsigned long)(m_nbrEvts-1));
203 return StatusCode::SUCCESS;
209 return ROOT_StorageType;
#define ATH_MSG_VERBOSE(x)
uint32_t CLID
The Class ID type.
Include TBranchElement.h, suppressing clang warnings.
MsgStream & msg() const
The standard message stream.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
static long storageType()
virtual StatusCode initialize()
Gaudi Service Implementation.
LeafCnv(const CLID &clid, ISvcLocator *pSvcLocator)
Constructor with parameters:
virtual ~LeafCnv()
Destructor:
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create a persistent representation for a transient object.
RootType m_type
the type we can convert
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create a transient object from a persistent representation.
A simple class to hold the buffer of a TBranch from a TTree.
void setBranchAddress(const RootType &t)
setup the ROOT TTree internal address for the branch.
RootType m_type
the buffer for the TBranch
std::string Name(unsigned int mod=Reflex::SCOPED) const
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....