| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RootHistCnv::RNTupleCnv Class Referenceabstract

NTuple converter class definition. More...

`#include <src/RNTupleCnv.h>`

Inheritance diagram for RootHistCnv::RNTupleCnv:
[legend]
Collaboration diagram for RootHistCnv::RNTupleCnv:
[legend]

## Public Member Functions
virtual StatusCode | initialize ()
| Initialize the converter. More...
virtual StatusCode | finalize ()
| Finalize the converter. More...
virtual StatusCode | createObj (IOpaqueAddress *pAddr, DataObject *&refpObj)
| Create the transient representation of an object. More...
virtual StatusCode | updateObj (IOpaqueAddress *pAddr, DataObject *refpObj)
| Update the transient object from the other representation. More...
virtual StatusCode | createRep (DataObject *pObj, IOpaqueAddress *&refpAddr)
| Convert the transient object to the requested representation. More...
virtual StatusCode | updateRep (IOpaqueAddress *pAddr, DataObject *pObj)
| Update the converted representation of a transient object. More...
Public Member Functions inherited from RootHistCnv::RConverter
StatusCode | createRep (DataObject *pObj, IOpaqueAddress *&refpAddr) override
| Convert the transient object to the requested representation. More...
long | repSvcType () const override
StatusCode | error (const std::string &msg)
StatusCode | regTFile (const std::string, const TFile *)
StatusCode | findTFile (const std::string, TFile *&)
std::string | diskDirectory (const std::string &loc)
std::string | directory (const std::string &loc)
void | setDirectory (const std::string &loc)
void | setDiskDirectory (const std::string &loc)
StatusCode | createDirectory (const std::string &loc)
StatusCode | createDiskDirectory (const std::string &loc)
std::string | getDirectory ()
std::string | convertId (const std::string &) const
Public Member Functions inherited from Converter
StatusCode | initialize () override
| Initialize the converter. More...
StatusCode | finalize () override
| Initialize the converter. More...
StatusCode | setDataProvider (IDataProviderSvc *svc) override
| Set Data provider service. More...
SmartIF< IDataProviderSvc > & | dataProvider () const override
| Get Data provider service. More...
StatusCode | setConversionSvc (IConversionSvc *svc) override
| Set conversion service the converter is connected to. More...
SmartIF< IConversionSvc > & | conversionSvc () const override
| Get conversion service the converter is connected to. More...
StatusCode | setAddressCreator (IAddressCreator *creator) override
| Set address creator facility. More...
SmartIF< IAddressCreator > & | addressCreator () const override
| Retrieve address creator facility. More...
const CLID & | objType () const override
| Retrieve the class type of objects the converter produces. More...
virtual long | i_repSvcType () const
| Retrieve the class type of the data store the converter uses. More...
StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override
| Create the transient representation of an object. More...
StatusCode | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Resolve the references of the created transient object. More...
StatusCode | updateObj (IOpaqueAddress *pAddress, DataObject *refpObject) override
| Update the transient object from the other representation. More...
StatusCode | updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Update the references of an updated transient object. More...
StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
| Convert the transient object to the requested representation. More...
StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Resolve the references of the converted object. More...
StatusCode | updateRep (IOpaqueAddress *pAddress, DataObject *pObject) override
| Update the converted representation of a transient object. More...
StatusCode | updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Update the references of an already converted object. More...
| Converter (long storage_type, const CLID &class_type, ISvcLocator *svc=0)
| Standard Constructor. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=false) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &type, const std::string &name, T *&psvc) const
| Access a service by name, type creating it if it doesn't already exist. More...
SmartIF< IService > | service (const std::string &name, const bool createIf=true) const
| Return a pointer to the service identified by name (or "type/name") More...
Public Member Functions inherited from implements< IConverter >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| implements ()=default
| Default constructor. More...
| implements (const implements &)
| Copy constructor (zero the reference count) More...
implements & | operator= (const implements &)
| Assignment operator (do not touch the reference count). More...
| ~implements () override=default
| Virtual destructor. More...
unsigned long | addRef () override
| Reference Interface instance. More...
unsigned long | release () override
| Release Interface instance. More...
unsigned long | refCount () const override
| Current reference count. More...
Public Member Functions inherited from extend_interfaces< Interfaces...>
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected Member Functions
| RNTupleCnv (ISvcLocator *svc, const CLID &clid)
| Standard constructor. More...
virtual | ~RNTupleCnv ()=default
| Standard destructor. More...
virtual StatusCode | load (TTree *tree, INTuple *&refpObj)=0
| Create the transient representation of an object. More...
virtual StatusCode | book (const std::string &desc, INTuple *pObj, TTree *&tree)=0
| Book a new N tuple. More...
virtual StatusCode | writeData (TTree *rtree, INTuple *pObj)=0
| Write N tuple data. More...
virtual StatusCode | readData (TTree *rtree, INTuple *pObj, long ievt)=0
| Read N tuple data. More...
virtual std::string | rootVarType (int)
| Return ROOT type info: More...
Protected Member Functions inherited from RootHistCnv::RConverter
| RConverter (const CLID &clid, ISvcLocator *svc)
| Standard constructor. More...
| ~RConverter () override=default
| Standard destructor. More...
virtual StatusCode | readObject (IOpaqueAddress *pAddr, DataObject *&refpObj)
| Create the transient representation of an object. More...
virtual TObject * | createPersistent (DataObject *pObj)
| Create the persistent representation of an object. More...
StatusCode | createAddress (DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
| Create address of the transient object according to the requested representation. More...
StatusCode | createAddress (const std::string &rzdir, const CLID &clid, long id, TObject *pTobj, IOpaqueAddress *&refpAddress)
StatusCode | createAddress (const std::string &rzdir, const CLID &clid, const std::string &title, TObject *pTobj, IOpaqueAddress *&refpAddress)
TDirectory * | changeDirectory (DataObject *pObject)
| Switch to object directory (=Parent directory) More...
Protected Member Functions inherited from Converter
| ~Converter () override=default
| Standard Destructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const
| Retrieve pointer to service locator. More...
SmartIF< IMessageSvc > & | msgSvc () const
| Retrieve pointer to message service. More...
SmartIF< IMessageSvc > & | messageService () const
SmartIF< IDataManagerSvc > & | dataManager () const
| Get Data Manager service. More...

## Protected Attributes
SmartIF< INTupleSvc > | m_ntupleSvc
| Reference to N tuple service. More...
Protected Attributes inherited from implements< IConverter >
std::atomic_ulong | m_refCount
| Reference counter. More...

## Additional Inherited Members
Public Types inherited from Converter
typedef Gaudi::PluginService::Factory< IConverter *, ISvcLocator * > | Factory
Public Types inherited from implements< IConverter >
using | base_class = implements< Interfaces...>
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces...>
| Typedef to the base of this class. More...
using | iids = typename extend_interfaces_base::ext_iids
Public Types inherited from extend_interfaces< Interfaces...>
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
| take union of the ext_iids of all Interfaces... More...
Static Public Member Functions inherited from RootHistCnv::RConverter
static long | storageType ()
| Inquire storage type. More...

## Detailed Description

NTuple converter class definition.

Package : RootHistCnv Author : Charles Leggett

Definition at line 24 of file RNTupleCnv.h.

## Constructor & Destructor Documentation

RootHistCnv::RNTupleCnv::RNTupleCnv | ( | ISvcLocator * | svc,
|  | const CLID & | clid
| ) |  |
| protected

Standard constructor.

Definition at line 35 of file RNTupleCnv.cpp.

36 : RConverter(clid, svc) {
37 }
RootHistCnv::RConverter::RConverter
RConverter(const CLID &clid, ISvcLocator *svc)
Standard constructor.
Definition: RConverter.h:59

virtual RootHistCnv::RNTupleCnv::~RNTupleCnv | ( |  | ) |
| protected virtual default

Standard destructor.

## Member Function Documentation

virtual StatusCode RootHistCnv::RNTupleCnv::book | ( | const std::string & | desc,
|  | INTuple * | pObj,
|  | TTree *& | tree
| ) |  |
| protected pure virtual

Book a new N tuple.

Implemented in RootHistCnv::RCWNTupleCnv, and RootHistCnv::RRWNTupleCnv.

StatusCode RootHistCnv::RNTupleCnv::createObj | ( | IOpaqueAddress * | pAddr,
|  | DataObject *& | refpObj
| ) |  |
| virtual

Create the transient representation of an object.

Definition at line 93 of file RNTupleCnv.cpp.

96 {
97 MsgStream log (msgSvc(), "RNTupleCnv");
98
99 IRegistry* pReg = pAddress->registry();
100
101 // log << MSG::WARNING << "adr: " << pAddress->par()[0] << " <> "
102 // << pAddress->par()[1] << " <> " << pAddress->ipar()[0] << " <> "
103 // << pAddress->ipar()[1] << " <> " << hex << rAddr->tObj()
104 // << dec << " <> " << pReg->identifier() << endmsg;
105
106 std::string ident = pReg->identifier();
107
108 StatusCode status = readObject(pAddress, refpObject); // Doesn't do anything
109 if ( status.isSuccess() ) {
110 RootObjAddress *rAddr = dynamic_cast<RootObjAddress*>( pAddress );
111 if ( !rAddr ) {
112 log << MSG::ERROR << "Could not cast to RootObjAddress" << endmsg;
113 return StatusCode::FAILURE;
114 }
115 INTuple* nt = nullptr;
116 TTree* tobj = (TTree*) rAddr->tObj();
117 status = load(tobj, nt);
118 if (status.isSuccess()) {
119 refpObject = dynamic_cast<DataObject*>(nt);
120 } else {
121 log << MSG::ERROR << "Problems loading ntuple id: " << pReg->identifier()
122 << endmsg;
123 }
124 }
125 return status;
126 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:129
std::string
STL class.
INTuple
NTuple interface class definition.
Definition: INTuple.h:79
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
RootHistCnv::RNTupleCnv::load
virtual StatusCode load(TTree *tree, INTuple *&refpObj)=0
Create the transient representation of an object.
RootHistCnv::RConverter::readObject
virtual StatusCode readObject(IOpaqueAddress *pAddr, DataObject *&refpObj)
Create the transient representation of an object.
Definition: RConverter.cpp:279
MSG::ERROR
Definition: IMessageSvc.h:21
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode RootHistCnv::RNTupleCnv::createRep | ( | DataObject * | pObj,
|  | IOpaqueAddress *& | refpAddr
| ) |  |
| virtual

Convert the transient object to the requested representation.

Definition at line 130 of file RNTupleCnv.cpp.

133 {
134 GlobalDirectoryRestore restore;
135 pAddr = nullptr;
136 try {
137 IRegistry* pReg = pObject->registry();
138 if ( pReg ) {
139 pAddr = pReg->address();
140 if ( !pAddr ) {
141 auto dataMgr = dataProvider().as<IDataManagerSvc>();
142 if ( dataMgr ) {
143 IRegistry* pParentReg = nullptr;
144 StatusCode status = dataMgr->objectParent(pReg, pParentReg);
145 if ( status.isSuccess() ) {
146 IOpaqueAddress* pParAddr = pParentReg->address();
147 if ( pParAddr ) {
148 TDirectory* pParentDir = (TDirectory*)pParAddr->ipar()[0];
149 if ( pParentDir ) {
150 TTree* pTree = nullptr;
151 std::string dsc = pReg->name().substr(1);
152 gDirectory = pParentDir;
153 status = book(dsc, dynamic_cast<INTuple*>(pObject), pTree);
154 if ( !status.isSuccess() ) {
155 return status;
156 }
157 status = createAddress(pObject, gDirectory, pTree, pAddr);
158 if ( !status.isSuccess() ) {
159 return status;
160 }
161 return writeData(pTree, dynamic_cast<INTuple*>(pObject));
162 }
163 }
164 }
165 }
166 }
167 else {
168 TDirectory* pDir = (TDirectory*)pAddr->ipar()[0];
169 RootObjAddress *rAddr = dynamic_cast<RootObjAddress*>( pAddr );
170 if ( !rAddr ) {
171 MsgStream log (msgSvc(), "RNTupleCnv");
172 log << MSG::ERROR << "Could not cast to RootObjAddress" << endmsg;
173 return StatusCode::FAILURE;
174 }
175 TTree* pTree = (TTree*) rAddr->tObj();
176 gDirectory = pDir;
177 return writeData(pTree, dynamic_cast<INTuple*>(pObject));
178 }
179 }
180 }
181 catch (...) {
182 }
183 MsgStream log (msgSvc(), "RNTupleCnv");
184 log << MSG::ERROR << "Failed to create persistent N-tuple!" << endmsg;
185 return StatusCode::FAILURE;
186 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
RootHistCnv::RNTupleCnv::book
virtual StatusCode book(const std::string &desc, INTuple *pObj, TTree *&tree)=0
Book a new N tuple.
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:129
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
std::string
STL class.
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
Converter::dataProvider
SmartIF< IDataProviderSvc > & dataProvider() const override
Get Data provider service.
Definition: Converter.cpp:92
IDataManagerSvc
Definition: IDataManagerSvc.h:45
GlobalDirectoryRestore
Definition: RConverter.h:16
RootHistCnv::RNTupleCnv::writeData
virtual StatusCode writeData(TTree *rtree, INTuple *pObj)=0
Write N tuple data.
MSG::ERROR
Definition: IMessageSvc.h:21
std::string::substr
T substr(T...args)
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
IOpaqueAddress::ipar
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
RootHistCnv::RConverter::createAddress
StatusCode createAddress(DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
Create address of the transient object according to the requested representation. ...
Definition: RConverter.cpp:161

StatusCode RootHistCnv::RNTupleCnv::finalize | ( |  | ) |
| virtual

Finalize the converter.

Definition at line 56 of file RNTupleCnv.cpp.

56 {
57 //-----------------------------------------------------------------------------
58 m_ntupleSvc.reset();
59 return Converter::finalize();
60 }
Converter::finalize
StatusCode finalize() override
Initialize the converter.
Definition: Converter.cpp:74
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
RootHistCnv::RNTupleCnv::m_ntupleSvc
SmartIF< INTupleSvc > m_ntupleSvc
Reference to N tuple service.
Definition: RNTupleCnv.h:58

StatusCode RootHistCnv::RNTupleCnv::initialize | ( |  | ) |
| virtual

Initialize the converter.

Definition at line 43 of file RNTupleCnv.cpp.

43 {
44 //-----------------------------------------------------------------------------
45 StatusCode status = Converter::initialize();
46 if ( status.isSuccess() ) {
47 m_ntupleSvc = serviceLocator()->service("NTupleSvc");
48 if (!m_ntupleSvc) status = StatusCode::FAILURE;
49 }
50 return status;
51 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
Converter::initialize
StatusCode initialize() override
Initialize the converter.
Definition: Converter.cpp:65
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Converter::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Converter.cpp:124
RootHistCnv::RNTupleCnv::m_ntupleSvc
SmartIF< INTupleSvc > m_ntupleSvc
Reference to N tuple service.
Definition: RNTupleCnv.h:58

virtual StatusCode RootHistCnv::RNTupleCnv::load | ( | TTree * | tree,
|  | INTuple *& | refpObj
| ) |  |
| protected pure virtual

Create the transient representation of an object.

Implemented in RootHistCnv::RCWNTupleCnv, and RootHistCnv::RRWNTupleCnv.

virtual StatusCode RootHistCnv::RNTupleCnv::readData | ( | TTree * | rtree,
|  | INTuple * | pObj,
|  | long | ievt
| ) |  |
| protected pure virtual

Read N tuple data.

Implemented in RootHistCnv::RCWNTupleCnv, and RootHistCnv::RRWNTupleCnv.

std::string RootHistCnv::RNTupleCnv::rootVarType | ( | int | type | ) |
| protected virtual

Return ROOT type info:

Definition at line 222 of file RNTupleCnv.cpp.

222 {
223 //-----------------------------------------------------------------------------
224 switch( type ) {
225 case DataTypeInfo::BOOL: return "/O"; // bool
226 case DataTypeInfo::SHORT: return "/S"; // short
227 case DataTypeInfo::INT: return "/I"; // int
228 case DataTypeInfo::LONG: return "/I"; // long
229 case DataTypeInfo::LONGLONG: return "/L"; // longlong
230 case DataTypeInfo::USHORT: return "/s"; // ushort
231 case DataTypeInfo::UINT: return "/i"; // uint
232 case DataTypeInfo::ULONG: return "/i"; // ulong
233 case DataTypeInfo::ULONGLONG: return "/l"; // ulonglong
234 case DataTypeInfo::FLOAT: return "/F"; // float
235 case DataTypeInfo::DOUBLE: return "/D"; // double
236 case DataTypeInfo::CHAR: return "/B"; // char
237 case DataTypeInfo::UCHAR: return "/b"; // char
238 default: return "";
239 }
240 // cannot reach this point
241 }
DataTypeInfo::INT
Definition: DataTypeInfo.h:25
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:25
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:25
gaudirun.type
string type
Definition: gaudirun.py:151
DataTypeInfo::UINT
Definition: DataTypeInfo.h:24
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:24
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:26
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:24
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:24
DataTypeInfo::LONG
Definition: DataTypeInfo.h:25
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:26
DataTypeInfo::ULONGLONG
Definition: DataTypeInfo.h:29
DataTypeInfo::LONGLONG
Definition: DataTypeInfo.h:29
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:26

StatusCode RootHistCnv::RNTupleCnv::updateObj | ( | IOpaqueAddress * | pAddr,
|  | DataObject * | refpObj
| ) |  |
| virtual

Update the transient object from the other representation.

Definition at line 64 of file RNTupleCnv.cpp.

67 {
68 MsgStream log (msgSvc(), "RNTupleCnv");
69
70 StatusCode status = StatusCode::FAILURE;
71
72 RootObjAddress *rAddr = dynamic_cast<RootObjAddress*>(pAddress);
73
74 if ( !rAddr ) {
75 log << MSG::ERROR << "Could not dynamic cast to RootObjAddress" << endmsg;
76 return StatusCode::FAILURE;
77 }
78
79 TTree* rtree = (TTree*) rAddr->tObj();
80
81 try {
82 unsigned long* info = (unsigned long*)pAddress->ipar();
83 setDirectory(pAddress->par()[0]);
84 status = readData(rtree, dynamic_cast<INTuple*>(pObject), info[1]++);
85 }
86 catch (...) {
87 }
88 return status;
89 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
RootHistCnv::RConverter::setDirectory
void setDirectory(const std::string &loc)
Definition: RConverter.cpp:112
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:129
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MSG::ERROR
Definition: IMessageSvc.h:21
RootHistCnv::RNTupleCnv::readData
virtual StatusCode readData(TTree *rtree, INTuple *pObj, long ievt)=0
Read N tuple data.
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode RootHistCnv::RNTupleCnv::updateRep | ( | IOpaqueAddress * | pAddr,
|  | DataObject * | pObj
| ) |  |
| virtual

Update the converted representation of a transient object.

Definition at line 190 of file RNTupleCnv.cpp.

193 {
194 MsgStream log (msgSvc(), "RNTupleCnv");
195 if ( pAddr ) {
196 GlobalDirectoryRestore restore;
197 TDirectory* pDir = (TDirectory*)pAddr->ipar()[0];
198 RootObjAddress *rAddr = dynamic_cast<RootObjAddress*>( pAddr );
199 if ( !rAddr ) {
200 log << MSG::ERROR << "Could not cast to RootObjAddress" << endmsg;
201 return StatusCode::FAILURE;
202 }
203 TTree* pTree = (TTree*) rAddr->tObj();
204 if ( pDir && pTree ) {
205 gDirectory->cd(pDir->GetPath());
206 pTree->Write("",TObject::kOverwrite);
207 return StatusCode::SUCCESS;
208 }
209 }
210 else {
211 log << MSG::WARNING << "empty ntuple: " << pObj->registry()->identifier()
212 << endmsg;
213 return createRep(pObj,pAddr);
214 }
215 return StatusCode::FAILURE;
216 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:129
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
RootHistCnv::RNTupleCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&refpAddr)
Convert the transient object to the requested representation.
Definition: RNTupleCnv.cpp:130
GlobalDirectoryRestore
Definition: RConverter.h:16
MSG::ERROR
Definition: IMessageSvc.h:21
MSG::WARNING
Definition: IMessageSvc.h:20
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
IOpaqueAddress::ipar
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

virtual StatusCode RootHistCnv::RNTupleCnv::writeData | ( | TTree * | rtree,
|  | INTuple * | pObj
| ) |  |
| protected pure virtual

Write N tuple data.

Implemented in RootHistCnv::RCWNTupleCnv, and RootHistCnv::RRWNTupleCnv.

## Member Data Documentation

SmartIF<INTupleSvc> RootHistCnv::RNTupleCnv::m_ntupleSvc
| protected

Reference to N tuple service.

Definition at line 58 of file RNTupleCnv.h.

The documentation for this class was generated from the following files:

- RootHistCnv/src/RNTupleCnv.h
- RootHistCnv/src/RNTupleCnv.cpp