| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Protected Member Functions | List of all members
Gaudi::RootNTupleCnv Class Reference

NTuple converter class definition for NTuples writted/read using ROOT. More...

`#include <Root/RootNTupleCnv.h>`

Inheritance diagram for Gaudi::RootNTupleCnv:
[legend]
Collaboration diagram for Gaudi::RootNTupleCnv:
[legend]

## Public Member Functions
| RootNTupleCnv (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
| Standard constructor. More...
StatusCode | createRep (DataObject *pObj, IOpaqueAddress *&refpAdd) override
| Converter overrides: Convert the transient object to the requested representation. More...
StatusCode | fillRepRefs (IOpaqueAddress *pAdd, DataObject *pObj) override
| Resolve the references of the converted object. More...
StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override
| Converter overrides: Update the references of an updated transient object. More...
StatusCode | fillObjRefs (IOpaqueAddress *, DataObject *) override
| Converter overrides: Update the references of an updated transient object. More...
StatusCode | updateObj (IOpaqueAddress *pAddress, DataObject *pObject) override
| Update the transient object: NTuples end here when reading records. More...
StatusCode | updateObjRefs (IOpaqueAddress *, DataObject *) override
| Converter overrides: Update the references of an updated transient object. More...
StatusCode | updateRep (IOpaqueAddress *, DataObject *) override
| Converter overrides: Update the converted representation of a transient object. More...
StatusCode | updateRepRefs (IOpaqueAddress *, DataObject *) override
| Converter overrides: Update the converted representation of a transient object. More...
Public Member Functions inherited from Gaudi::RootStatCnv
| RootStatCnv (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
| Initializing Constructor. More...
Public Member Functions inherited from Gaudi::RootConverter
| RootConverter (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
| Initializing Constructor. More...
long | repSvcType () const override
| Retrieve the class type of the data store the converter uses. More...
StatusCode | createObj (IOpaqueAddress *pAddr, DataObject *&refpObj) override
| Converter overrides: Create transient object from persistent data. More...
StatusCode | fillObjRefs (IOpaqueAddress *pAddr, DataObject *pObj) override
| Resolve the references of the created transient object. More...
StatusCode | createRep (DataObject *pObj, IOpaqueAddress *&refpAddr) override
| Converter overrides: Convert the transient object to the requested representation. More...
StatusCode | fillRepRefs (IOpaqueAddress *pAddr, DataObject *pObj) override
| Resolve the references of the created transient object. More...
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...
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...

## Protected Member Functions
StatusCode | i__updateObjRoot (RootAddress *rpA, INTuple *tupl, TTree *tree, RootDataConnection *con)
| Update the transient object: NTuples end here when reading records. More...
Protected Member Functions inherited from Gaudi::RootStatCnv
MsgStream & | log () const
| Helper to use mesage logger. More...
StatusCode | initialize () override
| Initialize converter object. More...
StatusCode | finalize () override
| Finalize converter object. More...
virtual const std::string | containerName (IRegistry *pDir) const
| Retrieve the name of the container a given object is placed into. More...
virtual const std::string | fileName (IRegistry *pReg) const
| Retrieve the name of the file a given object is placed into. More...
virtual const std::string | topLevel (IRegistry *pReg) const
| Retrieve the full path of the file a given object is placed into. More...
StatusCode | makeError (const std::string &msg, bool throw_exception=false) const
| Helper method to issue error messages. More...
StatusCode | saveDescription (const std::string &path, const std::string &ident, const std::string &desc, const std::string &opt, const CLID &clid)
| Save statistics object description. More...
Protected Member Functions inherited from Converter
SmartIF< ISvcLocator > & | serviceLocator () const
| Retrieve pointer to service locator. More...
SmartIF< IMessageSvc > & | msgSvc () const
| Retrieve pointer to message service. More...
SmartIF< IDataManagerSvc > & | dataManager () const
| Get Data Manager service. More...

## Additional Inherited Members
Public Types inherited from Converter
using | Factory = Gaudi::PluginService::Factory< IConverter *(ISvcLocator *)>
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...
Protected Attributes inherited from Gaudi::RootStatCnv
SmartIF< IDataManagerSvc > | m_dataMgr
| Reference to data manager service to manipulate the TES. More...
std::unique_ptr< MsgStream > | m_log
| Reference to logger object. More...
Protected Attributes inherited from Gaudi::RootConverter
RootCnvSvc * | m_dbMgr
| Conversion service needed for proper operation to forward requests. More...
Protected Attributes inherited from implements< IConverter >
std::atomic_ulong | m_refCount
| Reference counter. More...

## Detailed Description

NTuple converter class definition for NTuples writted/read using ROOT.

Description: Definition of the generic converter for row wise and column wise Ntuples.

Author
  M.Frank

Version
  1.0

Definition at line 35 of file RootNTupleCnv.h.

## Constructor & Destructor Documentation

## ◆ RootNTupleCnv()

Gaudi::RootNTupleCnv::RootNTupleCnv | ( | long | typ,
|  | const CLID & | clid,
|  | ISvcLocator * | svc,
|  | RootCnvSvc * | mgr
| ) |  |
| inline

Standard constructor.

Parameters

  clid | [IN] Class ID of the object type to be converted.
  db | [IN] Pointer to POOL database interface
  svc | [IN] Pointer to Gaudi service locator

Returns
  Reference to RootNTupleCnv object

Definition at line 54 of file RootNTupleCnv.h.

55 : RootStatCnv( typ, clid, svc, mgr ) {}
Gaudi::RootStatCnv::RootStatCnv
RootStatCnv(long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
Initializing Constructor.
Definition: RootStatCnv.cpp:24

## Member Function Documentation

## ◆ createObj()

StatusCode RootNTupleCnv::createObj | ( | IOpaqueAddress * | pAddress,
|  | DataObject *& | refpObject
| ) |  |
| override

Converter overrides: Update the references of an updated transient object.

Parameters

  pAddress | [IN] Valid pointer to the object's opaque address
  refpObject | [OUT] Location to store pointer to DataObject

Returns
  Status code indicating success or failure

Definition at line 114 of file RootNTupleCnv.cpp.

114 {
115 StatusCode status = S_FAIL;
116 RootDataConnection* con = nullptr;
117 IRegistry* pRegistry = pAddr->registry();
118 RootAddress* rpA = dynamic_cast<RootAddress*>( pAddr );
119 string path = fileName( pRegistry );
120 string cntName = containerName( pRegistry );
121 string* par = const_cast<string*>( pAddr->par() );
122 status = m_dbMgr->connectDatabase( path, IDataConnection::READ, &con );
123 if ( status.isSuccess() ) {
124 string par_val, par_guid;
125 TBranch* b = con->getBranch( "##Descriptors", "GaudiStatisticsDescription" );
126 if ( b ) {
127 RootNTupleDescriptor* ptr;
128 std::unique_ptr<RootNTupleDescriptor> dsc( ptr = new RootNTupleDescriptor() );
129 b->SetAddress( &ptr );
130 for ( Long64_t i = 0, nent = b->GetEntries(); i < nent; ++i ) {
131 int nb = b->GetEntry( i );
132 if ( nb > 1 ) {
133 if ( ptr->container == cntName ) {
134 par_val = ptr->description;
135 break;
136 }
137 }
138 }
139 }
140 par[2] = _tr( cntName );
141 TTree* tree = con->getSection( par[2] );
142 if ( nullptr == tree ) { return makeError( "Failed to access N-Tuple tree:" + cntName ); }
143 if ( !par_val.empty() ) {
144 auto ntupleSvc = dataProvider().as<INTupleSvc>();
145 if ( ntupleSvc ) {
146 char c;
147 CLID clid;
148 int siz, typ;
149 string title;
150 NTuple::Tuple* nt = nullptr;
151 istringstream is( par_val );
152 getline( is, title, ';' ) >> clid >> c >> siz >> c;
153 status = ntupleSvc->create( clid, title, nt );
154 for ( int j = 0; j < siz && status.isSuccess(); j++ ) {
155 is >> c;
156 getline( is, title, ';' ) >> typ >> c;
157 switch ( typ ) {
158 case DataTypeInfo::UCHAR:
159 status = createItem( tree, nt, is, title, true, (unsigned char)0 );
160 break;
161 case DataTypeInfo::USHORT:
162 status = createItem( tree, nt, is, title, true, (unsigned short)0 );
163 break;
164 case DataTypeInfo::UINT:
165 status = createItem( tree, nt, is, title, true, 0u );
166 break;
167 case DataTypeInfo::ULONG:
168 status = createItem( tree, nt, is, title, true, 0ul );
169 break;
170 case DataTypeInfo::CHAR:
171 status = createItem( tree, nt, is, title, true, char( 0 ) );
172 break;
173 case DataTypeInfo::SHORT:
174 status = createItem( tree, nt, is, title, true, short( 0 ) );
175 break;
176 case DataTypeInfo::INT:
177 status = createItem( tree, nt, is, title, true, 0 );
178 break;
179 case DataTypeInfo::LONG:
180 status = createItem( tree, nt, is, title, true, 0l );
181 break;
182 case DataTypeInfo::BOOL:
183 status = createItem( tree, nt, is, title, true, false );
184 break;
185 case DataTypeInfo::FLOAT:
186 status = createItem( tree, nt, is, title, true, 0.f );
187 break;
188 case DataTypeInfo::DOUBLE:
189 status = createItem( tree, nt, is, title, true, 0. );
190 break;
191 /*
192 case DataTypeInfo::NTCHAR:
193 case DataTypeInfo::LONG_NTCHAR:
194 status =
195 createItem(tree, nt, is, title, true, (char*)0);
196 break;
197 case DataTypeInfo::STRING:
198 case DataTypeInfo::LONG_STRING:
199 status =
200 createItem(tree, nt, is, title, true, string(""));
201 break;
202 */
203 case DataTypeInfo::OBJECT_ADDR:
204 status = createItem( tree, nt, is, title, false, static_cast<IOpaqueAddress*>( nullptr ) );
205 break;
206 case DataTypeInfo::POINTER:
207 status = createItem( tree, nt, is, title, true, static_cast<void*>( nullptr ) );
208 break;
209 case DataTypeInfo::UNKNOWN:
210 default:
211 status = S_FAIL;
212 break;
213 }
214 if ( !status.isSuccess() ) {
215 log() << MSG::FATAL << "Error connecting (Unknown) column:" << j << endmsg << par_val << endmsg;
216 return makeError( "createObj[NTuple]> Cannot determine column!" );
217 }
218 }
219 if ( status.isSuccess() ) {
220 unsigned long* ipar = const_cast<unsigned long*>( rpA->ipar() );
221 log() << MSG::DEBUG << "Created N-tuple with description:" << par_val << endl;
222 ipar[0] = reinterpret_cast<uintptr_t>( con );
223 ipar[1] = ~0x0UL;
224 rpA->section = tree;
225 refpObject = nt;
226 } else {
227 refpObject = nullptr;
228 if ( nt ) nt->release();
229 }
230 }
231 }
232 }
233 return status;
234 }
std::string::empty
T empty(T... args)
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:40
Gaudi::RootStatCnv::makeError
StatusCode makeError(const std::string &msg, bool throw_exception=false) const
Helper method to issue error messages.
Definition: RootStatCnv.cpp:87
Gaudi::RootDataConnection::getBranch
TBranch * getBranch(std::string_view section, std::string_view branch_name)
Access data branch by name: Get existing branch in read only mode.
Definition: RootDataConnection.h:303
Gaudi::RootAddress
Description:
Definition: RootAddress.h:36
std::istringstream
STL class.
gaudirun.c
c
Definition: gaudirun.py:487
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
DataTypeInfo::INT
Definition: DataTypeInfo.h:31
Gaudi::RootAddress::section
TTree * section
Pointer to ROOT TTree (filled for N-tuples only)
Definition: RootAddress.h:41
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29
Gaudi::RootConverter::m_dbMgr
RootCnvSvc * m_dbMgr
Conversion service needed for proper operation to forward requests.
Definition: RootConverter.h:35
std::getline
T getline(T... args)
MSG::DEBUG
Definition: IMessageSvc.h:15
std::endl
T endl(T... args)
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:107
S_FAIL
#define S_FAIL
Definition: RootNTupleCnv.cpp:34
Gaudi::RootCnvSvc::connectDatabase
StatusCode connectDatabase(const std::string &dataset, int mode, RootDataConnection **con)
Connect the output file to the service with open mode.
Definition: RootCnvSvc.cpp:194
Gaudi::RootStatCnv::fileName
virtual const std::string fileName(IRegistry *pReg) const
Retrieve the name of the file a given object is placed into.
Definition: RootStatCnv.cpp:61
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30
INTupleSvc
Definition: INTupleSvc.h:36
MSG::FATAL
Definition: IMessageSvc.h:15
Gaudi::RootNTupleDescriptor
Description:
Definition: extractEvt.C:98
Gaudi::IDataConnection::READ
Definition: IIODataManager.h:39
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:465
Gaudi::RootDataConnection::getSection
TTree * getSection(std::string_view sect, bool create=false)
Access TTree section from section name. The section is created if required.
Definition: RootDataConnection.cpp:357
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33
Gaudi::RootStatCnv::log
MsgStream & log() const
Helper to use mesage logger.
Definition: RootStatCnv.h:38
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25
Gaudi::RootNTupleDescriptor::description
std::string description
Description string.
Definition: extractEvt.C:100
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:24
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:375
gaudirun.l
dictionary l
Definition: gaudirun.py:521
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:46
Converter::dataProvider
SmartIF< IDataProviderSvc > & dataProvider() const override
Get Data provider service.
Definition: Converter.cpp:68
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
std::unique_ptr
STL class.
Gaudi::RootNTupleDescriptor::container
std::string container
Identifier of description.
Definition: extractEvt.C:104
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:79
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34
Gaudi::RootStatCnv::containerName
virtual const std::string containerName(IRegistry *pDir) const
Retrieve the name of the container a given object is placed into.
Definition: RootStatCnv.cpp:46
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:93
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ createRep()

StatusCode RootNTupleCnv::createRep | ( | DataObject * | pObj,
|  | IOpaqueAddress *& | refpAdd
| ) |  |
| override

Converter overrides: Convert the transient object to the requested representation.

Convert the transient object to the requested representation.

Parameters

  pObj | [IN] Valid pointer to DataObject
  refpAdd | [OUT] Location to store pointer to the object's opaque address

Returns
  Status code indicating success or failure

Definition at line 355 of file RootNTupleCnv.cpp.

355 {
356 IRegistry* pRegistry = pObj->registry();
357 if ( pRegistry ) {
358 pAddr = pRegistry->address();
359 if ( pAddr ) return S_OK;
360
361 RootDataConnection* con = nullptr;
362 string path = fileName( pRegistry );
363 string cntName = containerName( pRegistry );
364 string secName = cntName.c_str();
365 const INTuple* nt = dynamic_cast<const INTuple*>( pObj );
366 StatusCode status = m_dbMgr->connectDatabase( path, IDataConnection::UPDATE, &con );
367 if ( !status.isSuccess() ) { return makeError( "Failed to access Tuple file:" + path ); }
368 TTree* tree = con->getSection( _tr( secName ), true );
369 if ( nullptr != nt ) {
370 const INTuple::ItemContainer& items = nt->items();
371 ostringstream os;
372 size_t item_no;
373 string desc;
374 os << nt->title() << ';' << pObj->clID() << ';' << items.size() << ';';
375 map<string, TBranch*> branches;
376 TBranch* b = nullptr;
377 for ( item_no = 0; item_no < items.size(); ++item_no ) {
378 INTupleItem* it = items[item_no];
379 if ( it->hasIndex() ) {
380 INTupleItem* itm = it->indexItem();
381 const string& n = itm->name();
382 switch ( itm->type() ) {
383 case DataTypeInfo::UCHAR:
384 desc = n + "/b";
385 b = tree->Branch( n.c_str(), const_cast<void*>( itm->buffer() ), desc.c_str() );
386 break;
387 case DataTypeInfo::USHORT:
388 desc = n + "/s";
389 b = tree->Branch( n.c_str(), const_cast<void*>( itm->buffer() ), desc.c_str() );
390 break;
391 case DataTypeInfo::UINT:
392 desc = n + "/i";
393 b = tree->Branch( n.c_str(), const_cast<void*>( itm->buffer() ), desc.c_str() );
394 break;
395 case DataTypeInfo::ULONG:
396 desc = n + "/l";
397 b = tree->Branch( n.c_str(), const_cast<void*>( itm->buffer() ), desc.c_str() );
398 break;
399 case DataTypeInfo::CHAR:
400 desc = n + "/B";
401 b = tree->Branch( n.c_str(), const_cast<void*>( itm->buffer() ), desc.c_str() );
402 break;
403 case DataTypeInfo::SHORT:
404 desc = n + "/S";
405 b = tree->Branch( n.c_str(), const_cast<void*>( itm->buffer() ), desc.c_str() );
406 break;
407 case DataTypeInfo::INT:
408 desc = n + "/I";
409 b = tree->Branch( n.c_str(), const_cast<void*>( itm->buffer() ), desc.c_str() );
410 break;
411 case DataTypeInfo::LONG:
412 desc = n + "/L";
413 b = tree->Branch( n.c_str(), const_cast<void*>( itm->buffer() ), desc.c_str() );
414 break;
415 default:
416 return makeError( "Column " + it->index() + " is not a valid index column!" );
417 }
418 branches[n] = b;
419 }
420 }
421 for ( item_no = 0; item_no < items.size(); ++item_no ) {
422 INTupleItem* it = items[item_no];
423 const string& n = it->name();
424 os << '{' << n << ';' << it->type() << ';' << it->length() << ';' << it->ndim() << ';' << it->hasIndex() << ';';
425 if ( it->hasIndex() ) {
426 os << it->index() << ';';
427 INTupleItem* itm = it->indexItem();
428 switch ( itm->type() ) {
429 case DataTypeInfo::UCHAR:
430 putRange( os, dynamic_cast<NTuple::_Data<unsigned char>*>( itm ) );
431 break;
432 case DataTypeInfo::USHORT:
433 putRange( os, dynamic_cast<NTuple::_Data<unsigned short>*>( itm ) );
434 break;
435 case DataTypeInfo::UINT:
436 putRange( os, dynamic_cast<NTuple::_Data<unsigned int>*>( itm ) );
437 break;
438 case DataTypeInfo::ULONG:
439 putRange( os, dynamic_cast<NTuple::_Data<unsigned long>*>( itm ) );
440 break;
441 case DataTypeInfo::CHAR:
442 putRange( os, dynamic_cast<NTuple::_Data<char>*>( itm ) );
443 break;
444 case DataTypeInfo::SHORT:
445 putRange( os, dynamic_cast<NTuple::_Data<short>*>( itm ) );
446 break;
447 case DataTypeInfo::INT:
448 putRange( os, dynamic_cast<NTuple::_Data<int>*>( itm ) );
449 break;
450 case DataTypeInfo::LONG:
451 putRange( os, dynamic_cast<NTuple::_Data<long>*>( itm ) );
452 break;
453 default:
454 return makeError( "NTuple:" + pRegistry->name() + " Column " + it->index() +
455 " is not a valid index column!" );
456 }
457 }
458 for ( long k = 0; k < it->ndim(); k++ ) { os << it->dim( k ) << ';'; }
459 desc = n;
460 TClass* cl = nullptr;
461 switch ( it->type() ) {
462 case DataTypeInfo::STRING:
463 desc = "/C";
464 os << 0 << ';' << 0 << ';';
465 break;
466 case DataTypeInfo::NTCHAR:
467 desc = "/C";
468 os << 0 << ';' << 0 << ';';
469 break;
470 case DataTypeInfo::OBJECT_ADDR:
471 if ( it->length() == 1 ) {
472 desc = System::typeinfoName( typeid( RootRef ) );
473 os << 0 << ';' << 0 << ';';
474 cl = TClass::GetClass( desc.c_str(), kTRUE );
475 }
476 break;
477 case DataTypeInfo::POINTER:
478 if ( it->length() == 1 ) {
479 os << 0 << ';' << 0 << ';';
480 cl = TClass::GetClass( it->typeID(), kTRUE );
481 }
482 break;
483 case DataTypeInfo::UCHAR:
484 desc = "/b";
485 putRange( os, dynamic_cast<NTuple::_Data<unsigned char>*>( it ) );
486 break;
487 case DataTypeInfo::USHORT:
488 desc = "/s";
489 putRange( os, dynamic_cast<NTuple::_Data<unsigned short>*>( it ) );
490 break;
491 case DataTypeInfo::UINT:
492 desc = "/i";
493 putRange( os, dynamic_cast<NTuple::_Data<unsigned int>*>( it ) );
494 break;
495 case DataTypeInfo::ULONG:
496 desc = "/l";
497 putRange( os, dynamic_cast<NTuple::_Data<unsigned long>*>( it ) );
498 break;
499 case DataTypeInfo::CHAR:
500 desc = "/B";
501 putRange( os, dynamic_cast<NTuple::_Data<char>*>( it ) );
502 break;
503 case DataTypeInfo::SHORT:
504 desc = "/S";
505 putRange( os, dynamic_cast<NTuple::_Data<short>*>( it ) );
506 break;
507 case DataTypeInfo::INT:
508 desc = "/I";
509 putRange( os, dynamic_cast<NTuple::_Data<int>*>( it ) );
510 break;
511 case DataTypeInfo::LONG:
512 desc = "/L";
513 putRange( os, dynamic_cast<NTuple::_Data<long>*>( it ) );
514 break;
515 case DataTypeInfo::BOOL:
516 desc = "/b";
517 putRange( os, dynamic_cast<NTuple::_Data<bool>*>( it ) );
518 break;
519 case DataTypeInfo::FLOAT:
520 desc = "/F";
521 putRange( os, dynamic_cast<NTuple::_Data<float>*>( it ) );
522 break;
523 case DataTypeInfo::DOUBLE:
524 desc = "/D";
525 putRange( os, dynamic_cast<NTuple::_Data<double>*>( it ) );
526 break;
527 case DataTypeInfo::UNKNOWN:
528 default:
529 return makeError( "Create item[FAIL]: " + it->name() );
530 }
531 os << '}';
532 if ( branches.find( n ) == branches.end() ) {
533 string tmp;
534 char text[32];
535 switch ( it->ndim() ) {
536 case 0:
537 desc = n + desc;
538 break;
539 case 2:
540 sprintf( text, "[%ld]", it->dim( 0 ) );
541 tmp = text;
542 [[fallthrough]];
543 case 1:
544 if ( it->hasIndex() ) {
545 INTupleItem* itm = it->indexItem();
546 desc = n + tmp + "[" + itm->name() + "]" + desc;
547 } else {
548 sprintf( text, "[%ld]", it->dim( 0 ) );
549 desc = n + tmp + text + desc;
550 }
551 }
552 log() << MSG::DEBUG << "Create branch:" << n << " Desc:" << desc << " of type:" << it->type() << endmsg;
553 switch ( it->type() ) {
554 case DataTypeInfo::OBJECT_ADDR:
555 branches[n] = tree->Branch( n.c_str(), cl->GetName(), const_cast<void*>( it->buffer() ) );
556 break;
557 case DataTypeInfo::POINTER:
558 branches[n] = tree->Branch( n.c_str(), cl->GetName(), const_cast<void*>( it->buffer() ) );
559 break;
560 default:
561 branches[n] = tree->Branch( n.c_str(), const_cast<void*>( it->buffer() ), desc.c_str() );
562 break;
563 }
564 }
565 }
566
567 log() << MSG::DEBUG << "Save description:" << path << " -> " << cntName << endmsg << os.str() << endmsg;
568 status = saveDescription( path, cntName, os.str(), "", pObj->clID() );
569 if ( status.isSuccess() ) {
570 status = m_dbMgr->commitOutput( path, true );
571 if ( status.isSuccess() ) {
572 string spar[] = {path, cntName};
573 unsigned long ipar[] = {(unsigned long)con, ~0x0u};
574 status = m_dbMgr->createAddress( repSvcType(), pObj->clID(), spar, ipar, pAddr );
575 if ( status.isSuccess() ) {
576 RootAddress* rpA = dynamic_cast<RootAddress*>( pAddr );
577 ( (unsigned long*)rpA->ipar() )[0] = (unsigned long)con;
578 rpA->section = tree;
579 } else {
580 pAddr->release();
581 pAddr = nullptr;
582 }
583 }
584 }
585 return status;
586 }
587 }
588 return S_FAIL;
589 }
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:40
Gaudi::RootStatCnv::makeError
StatusCode makeError(const std::string &msg, bool throw_exception=false) const
Helper method to issue error messages.
Definition: RootStatCnv.cpp:87
Gaudi::RootAddress
Description:
Definition: RootAddress.h:36
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
INTupleItem::type
virtual long type() const =0
Type information of the item.
DataTypeInfo::INT
Definition: DataTypeInfo.h:31
Gaudi::RootAddress::section
TTree * section
Pointer to ROOT TTree (filled for N-tuples only)
Definition: RootAddress.h:41
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
Gaudi::RootCnvSvc::createAddress
StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
IAddressCreator implementation: Address creation.
Definition: RootCnvSvc.cpp:347
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29
Gaudi::RootConverter::m_dbMgr
RootCnvSvc * m_dbMgr
Conversion service needed for proper operation to forward requests.
Definition: RootConverter.h:35
MSG::DEBUG
Definition: IMessageSvc.h:15
INTuple::title
virtual const std::string & title() const =0
Object title.
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
S_FAIL
#define S_FAIL
Definition: RootNTupleCnv.cpp:34
std::map::end
T end(T... args)
Gaudi::RootCnvSvc::connectDatabase
StatusCode connectDatabase(const std::string &dataset, int mode, RootDataConnection **con)
Connect the output file to the service with open mode.
Definition: RootCnvSvc.cpp:194
Gaudi::RootStatCnv::fileName
virtual const std::string fileName(IRegistry *pReg) const
Retrieve the name of the file a given object is placed into.
Definition: RootStatCnv.cpp:61
DataTypeInfo::STRING
Definition: DataTypeInfo.h:36
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30
INTupleItem::typeID
virtual const std::type_info & typeID() const =0
Compiler type ID.
INTupleItem::hasIndex
virtual bool hasIndex() const =0
Is the tuple have an index item?
std::map
STL class.
Gaudi::RootCnvSvc::commitOutput
StatusCode commitOutput(const std::string &outputFile, bool do_commit) override
Commit pending output.
Definition: RootCnvSvc.cpp:292
DataTypeInfo::NTCHAR
Definition: DataTypeInfo.h:37
INTupleItem::name
virtual const std::string & name() const =0
Access _Item name.
INTuple
NTuple interface class definition.
Definition: INTuple.h:81
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
Gaudi::RootRef
Persistent reference object.
Definition: extractEvt.C:34
INTupleItem
NTuple interface class definition.
Definition: INTuple.h:27
INTupleItem::indexItem
virtual INTupleItem * indexItem()=0
Pointer to index column (if present, 0 else)
Gaudi::RootDataConnection::getSection
TTree * getSection(std::string_view sect, bool create=false)
Access TTree section from section name. The section is created if required.
Definition: RootDataConnection.cpp:357
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
std::ostringstream
STL class.
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33
Gaudi::RootStatCnv::log
MsgStream & log() const
Helper to use mesage logger.
Definition: RootStatCnv.h:38
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25
Gaudi::RootStatCnv::saveDescription
StatusCode saveDescription(const std::string &path, const std::string &ident, const std::string &desc, const std::string &opt, const CLID &clid)
Save statistics object description.
Definition: RootStatCnv.cpp:99
INTupleItem::dim
virtual long dim(long i) const =0
Access individual dimensions.
std::ostringstream::str
T str(T... args)
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
Gaudi::RootConverter::repSvcType
long repSvcType() const override
Retrieve the class type of the data store the converter uses.
Definition: RootConverter.h:49
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32
NTuple::_Data
Abstract class describing basic data in an Ntuple.
Definition: NTuple.h:38
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:24
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
Gaudi::IDataConnection::UPDATE
Definition: IIODataManager.h:39
std::map::find
T find(T... args)
std::vector::size
T size(T... args)
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
std::vector
STL class.
DataObject::clID
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:56
INTupleItem::ndim
virtual long ndim() const =0
Dimension.
std::string::c_str
T c_str(T... args)
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:79
S_OK
#define S_OK
Definition: RootNTupleCnv.cpp:33
INTuple::items
virtual ItemContainer & items()=0
Access item container.
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34
Gaudi::RootStatCnv::containerName
virtual const std::string containerName(IRegistry *pDir) const
Retrieve the name of the container a given object is placed into.
Definition: RootStatCnv.cpp:46
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:93
std::sprintf
T sprintf(T... args)
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
INTupleItem::index
virtual const std::string & index() const =0
Access the index _Item.
INTupleItem::length
virtual long length() const =0
Access the buffer length.
INTupleItem::buffer
virtual const void * buffer() const =0
Access data buffer (CONST)

## ◆ fillObjRefs()

StatusCode Gaudi::RootNTupleCnv::fillObjRefs | ( | IOpaqueAddress * | ,
|  | DataObject * |
| ) |  |
| inline override

Converter overrides: Update the references of an updated transient object.

Parameters

  pAddress | [IN] Valid pointer to the object's opaque address
  pObject | [IN] Valid pointer to DataObject

Returns
  Status code indicating success or failure

Definition at line 95 of file RootNTupleCnv.h.

95 {
96 return StatusCode::SUCCESS;
97 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ fillRepRefs()

StatusCode RootNTupleCnv::fillRepRefs | ( | IOpaqueAddress * | pAdd,
|  | DataObject * | pObj
| ) |  |
| override

Resolve the references of the converted object.

Parameters

  pAdd | [IN] Valid pointer to the object's opaque address
  pObj | [IN] Valid pointer to DataObject

Returns
  Status code indicating success or failure

Definition at line 592 of file RootNTupleCnv.cpp.

592 {
593 typedef INTuple::ItemContainer Cont;
594 INTuple* tupl = dynamic_cast<INTuple*>( pObj );
595 IRegistry* pReg = pObj->registry();
596 RootAddress* rpA = dynamic_cast<RootAddress*>( pAddr );
597 if ( tupl && pReg && rpA ) {
598 string cntName = containerName( pReg );
599 unsigned long* ipar = const_cast<unsigned long*>( pAddr->ipar() );
600 RootDataConnection* con = reinterpret_cast<RootDataConnection*>( rpA->ipar()[0] );
601 if ( con ) {
602 TTree* tree = rpA->section;
603 if ( tree ) {
604 Cont& it = tupl->items();
605 size_t k, n = it.size();
606 vector<RootRef*> paddr( n );
607 vector<RootRef> addr( n );
608 for ( k = 0; k < n; ++k ) {
609 IOpaqueAddress* pA = nullptr;
610 Cont::value_type j = it[k];
611 switch ( j->type() ) {
612 case DataTypeInfo::OBJECT_ADDR:
613 pA = ( *(IOpaqueAddress**)j->buffer() );
614 paddr[k] = &addr[k];
615 addr[k].reset();
616 if ( pA ) {
617 con->makeRef( *pA->registry(), addr[k] );
618 addr[k].entry = pA->ipar()[1];
619 }
620 tree->SetBranchAddress( j->name().c_str(), &paddr[k] );
621 break;
622 default:
623 break;
624 }
625 }
626 int nb = tree->Fill();
627 if ( nb > 1 ) ++ipar[1];
628 for ( k = 0; k < n; ++k ) it[k]->reset();
629 return nb > 1 ? StatusCode::SUCCESS : StatusCode::FAILURE;
630 }
631 return makeError( "fillRepRefs> Failed to access data tree:" + cntName );
632 }
633 return makeError( "fillRepRefs> Failed to access data source!" );
634 }
635 return makeError( "fillRepRefs> Invalid Tuple reference." );
636 }
Gaudi::RootStatCnv::makeError
StatusCode makeError(const std::string &msg, bool throw_exception=false) const
Helper method to issue error messages.
Definition: RootStatCnv.cpp:87
Gaudi::RootAddress
Description:
Definition: RootAddress.h:36
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
Gaudi::RootAddress::section
TTree * section
Pointer to ROOT TTree (filled for N-tuples only)
Definition: RootAddress.h:41
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
INTuple
NTuple interface class definition.
Definition: INTuple.h:81
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
IOpaqueAddress::registry
virtual IRegistry * registry() const =0
Update branch name.
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
std::vector
STL class.
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:79
INTuple::items
virtual ItemContainer & items()=0
Access item container.
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
Gaudi::RootStatCnv::containerName
virtual const std::string containerName(IRegistry *pDir) const
Retrieve the name of the container a given object is placed into.
Definition: RootStatCnv.cpp:46
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:93
IOpaqueAddress::ipar
virtual const unsigned long * ipar() const =0
Access to generic link parameters.

## ◆ i__updateObjRoot()

StatusCode RootNTupleCnv::i__updateObjRoot | ( | RootAddress * | rpA,
|  | INTuple * | tupl,
|  | TTree * | tree,
|  | RootDataConnection * | con
| ) |  |
| protected

Update the transient object: NTuples end here when reading records.

Definition at line 256 of file RootNTupleCnv.cpp.

256 {
257 typedef INTuple::ItemContainer Cont;
258 const string* par = rpA->par();
259 unsigned long* ipar = const_cast<unsigned long*>( rpA->ipar() );
260 ++ipar[1];
261 if ( Long64_t( ipar[1] ) <= tree->GetEntries() ) {
262 GenericAddress* pA = nullptr;
263 Cont& it = tupl->items();
264 size_t k, n = it.size();
265 vector<RootRef*> paddr( n );
266 vector<RootRef> addr( n );
267 for ( k = 0; k < n; ++k ) {
268 Cont::value_type j = it[k];
269 switch ( j->type() ) {
270 case DataTypeInfo::OBJECT_ADDR:
271 paddr[k] = &addr[k];
272 tree->SetBranchAddress( j->name().c_str(), &paddr[k] );
273 break;
274 default:
275 break;
276 }
277 }
278
279 ULong64_t last = tree->GetEntries();
280 ISelectStatement* sel = tupl->selector();
281 if ( sel ) {
282 string criteria = ( sel && ( sel->type() & ISelectStatement::STRING ) ) ? sel->criteria() : string( "" );
283 if ( !( criteria.length() == 0 || criteria == "*" ) ) {
284 if ( rpA->select == nullptr ) {
285 log() << MSG::DEBUG << "Selection criteria: " << criteria << " " << ipar[1] << endmsg;
286 rpA->select = new TTreeFormula( tree->GetName(), criteria.c_str(), tree );
287 }
288 rpA->select->SetTree( tree );
289 for ( ; ipar[1] < last; ++ipar[1] ) { // loop on all selected entries
290 tree->LoadTree( ipar[1] );
291 rpA->select->GetNdata();
292 if ( fabs( rpA->select->EvalInstance( 0 ) ) > std::numeric_limits<float>::epsilon() ) { break; }
293 log() << MSG::DEBUG << par[0] << "/" << par[1] << " SKIP Entry: " << ipar[1] << endmsg;
294 }
295 }
296 }
297 if ( ipar[1] < last ) {
298 unsigned long entry = ipar[1];
299 if ( tree->GetEntry( entry ) > 1 ) {
300 RootRef* r = nullptr;
301 string* spar = nullptr;
302 for ( k = 0; k < n; ++k ) {
303 Cont::value_type j = it[k];
304 switch ( j->type() ) {
305 case DataTypeInfo::OBJECT_ADDR:
306 r = paddr[k];
307 pA = ( *(GenericAddress**)j->buffer() );
308 if ( pA ) { // Fill only if item is connected!
309 spar = (string*)pA->par();
310 ipar = (unsigned long*)pA->ipar();
311 log() << MSG::DEBUG;
312 pair<const RootRef*, const RootDataConnection::ContainerSection*> ls =
313 con->getMergeSection( tree->GetName(), entry );
314 if ( ls.first ) {
315 if ( ls.first->dbase >= 0 ) {
316 // Now patch the references and links 'en block' to be efficient
317 // First the leafs from the TES
318
319 r->dbase += ls.first->dbase;
320 r->container += ls.first->container;
321 r->link += ls.first->link;
322
323 if ( log().isActive() ) {
324 log() << "Refs: LS [" << entry << "] -> " << ls.first->dbase << "," << ls.first->container << ","
325 << ls.first->link << "," << ls.first->entry << " DB:" << con->getDb( r->dbase ) << endmsg;
326 }
327 }
328 }
329 spar[0] = con->getDb( r->dbase );
330 spar[1] = con->getCont( r->container );
331 spar[2] = con->getLink( r->link );
332 ipar[0] = 0;
333 ipar[1] = r->entry;
334 pA->setClID( r->clid );
335 pA->setSvcType( r->svc );
336 break;
337 }
338 break;
339 default:
340 break;
341 }
342 }
343 return StatusCode::SUCCESS;
344 }
345 log() << MSG::ERROR << "Failed to read data from NTuple tree." << endmsg;
346 return StatusCode::FAILURE;
347 }
348 log() << MSG::INFO << "End of input Ntuple." << endmsg;
349 return StatusCode::FAILURE;
350 }
351 return StatusCode::FAILURE;
352 }
MsgStream::isActive
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
GenericAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: GenericAddress.h:77
ISelectStatement
A select statement can either contain.
Definition: ISelectStatement.h:32
GenericAddress::setSvcType
void setSvcType(long typ)
Access : set the storage type of the class id.
Definition: GenericAddress.h:75
ISelectStatement::STRING
Definition: ISelectStatement.h:38
MSG::DEBUG
Definition: IMessageSvc.h:15
IOTest.sel
sel
Definition: IOTest.py:93
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Gaudi::RootRef::container
int container
Definition: extractEvt.C:36
Gaudi::RootRef::entry
int entry
Definition: extractEvt.C:36
Gaudi::RootDataConnection::getDb
const std::string & getDb(int which) const
Access database/file name from saved index.
Definition: RootDataConnection.cpp:448
GenericAddress
Generic Transient Address.
Definition: GenericAddress.h:20
INTuple::selector
virtual ISelectStatement * selector()=0
Access selector.
std::string
STL class.
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
Gaudi::RootRef::dbase
int dbase
Data members to define object location in the persistent world.
Definition: extractEvt.C:36
Gaudi::RootRef
Persistent reference object.
Definition: extractEvt.C:34
GenericAddress::setClID
void setClID(const CLID &clid)
Access : Set class ID of the link.
Definition: GenericAddress.h:71
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:465
Gaudi::RootDataConnection::getCont
const std::string & getCont(int which) const
Access container name from saved index.
Definition: RootDataConnection.h:323
Gaudi::RootStatCnv::log
MsgStream & log() const
Helper to use mesage logger.
Definition: RootStatCnv.h:38
Gaudi::RootDataConnection::getLink
const std::string & getLink(int which) const
Access link name from saved index.
Definition: RootDataConnection.h:328
std::fabs
T fabs(T... args)
Gaudi::RootDataConnection::getMergeSection
std::pair< const RootRef *, const ContainerSection * > getMergeSection(std::string_view container, int entry) const
Access link section for single container and entry.
Definition: RootDataConnection.cpp:564
Gaudi::RootRef::clid
int clid
Definition: extractEvt.C:36
std::pair
std::string::length
T length(T... args)
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
std::vector
STL class.
Gaudi::RootRef::link
int link
Definition: extractEvt.C:36
std::string::c_str
T c_str(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MSG::ERROR
Definition: IMessageSvc.h:15
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:79
Gaudi::RootRef::svc
int svc
Definition: extractEvt.C:36
INTuple::items
virtual ItemContainer & items()=0
Access item container.
Gaudi::RootAddress::select
TTreeFormula * select
Pointer to ROOT select statement (filled for N-tuples only)
Definition: RootAddress.h:39
MSG::INFO
Definition: IMessageSvc.h:15
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
std::numeric_limits

## ◆ updateObj()

StatusCode RootNTupleCnv::updateObj | ( | IOpaqueAddress * | pAddress,
|  | DataObject * | pObject
| ) |  |
| override

Update the transient object: NTuples end here when reading records.

Parameters

  pAddress | [IN] Valid pointer to the object's opaque address
  pObject | [IN] Valid pointer to DataObject

Returns
  Status code indicating success or failure

Definition at line 237 of file RootNTupleCnv.cpp.

237 {
238 INTuple* tupl = dynamic_cast<INTuple*>( pObj );
239 RootAddress* rpA = dynamic_cast<RootAddress*>( pAddr );
240 if ( !tupl || !rpA ) return makeError( "updateObj> Invalid Tuple reference." );
241 RootDataConnection* con = reinterpret_cast<RootDataConnection*>( rpA->ipar()[0] );
242 if ( !con ) return makeError( "updateObj> Failed to access data source!" );
243 TTree* tree = rpA->section;
244 if ( !tree ) return makeError( "Failed to access data tree:" + pAddr->par()[1] );
245 con->resetAge();
246 if ( con->tool()->refs() ) return i__updateObjRoot( rpA, tupl, tree, con );
247 #ifdef __POOL_COMPATIBILITY
248 // POOL compatibility mode:
249 return i__updateObjPool( rpA, tupl, tree, con );
250 #else
251 return makeError( "Failed to access reference branch for data tree:" + rpA->par()[1] );
252 #endif
253 }
Gaudi::RootStatCnv::makeError
StatusCode makeError(const std::string &msg, bool throw_exception=false) const
Helper method to issue error messages.
Definition: RootStatCnv.cpp:87
Gaudi::RootAddress
Description:
Definition: RootAddress.h:36
GenericAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: GenericAddress.h:77
Gaudi::RootDataConnection::tool
Tool * tool() const
Access tool.
Definition: RootDataConnection.h:249
Gaudi::RootAddress::section
TTree * section
Pointer to ROOT TTree (filled for N-tuples only)
Definition: RootAddress.h:41
Gaudi::RootDataConnection::Tool::refs
TTree * refs() const
Definition: RootDataConnection.h:206
INTuple
NTuple interface class definition.
Definition: INTuple.h:81
Gaudi::IDataConnection::resetAge
void resetAge()
Reset age.
Definition: IIODataManager.h:61
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:79
Gaudi::RootNTupleCnv::i__updateObjRoot
StatusCode i__updateObjRoot(RootAddress *rpA, INTuple *tupl, TTree *tree, RootDataConnection *con)
Update the transient object: NTuples end here when reading records.
Definition: RootNTupleCnv.cpp:256
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:93

## ◆ updateObjRefs()

StatusCode Gaudi::RootNTupleCnv::updateObjRefs | ( | IOpaqueAddress * | ,
|  | DataObject * |
| ) |  |
| inline override

Converter overrides: Update the references of an updated transient object.

Parameters

  pAddress | [IN] Valid pointer to the object's opaque address
  pObject | [IN] Valid pointer to DataObject

Returns
  Status code indicating success or failure

Definition at line 116 of file RootNTupleCnv.h.

116 {
117 return StatusCode::SUCCESS;
118 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ updateRep()

StatusCode Gaudi::RootNTupleCnv::updateRep | ( | IOpaqueAddress * | ,
|  | DataObject * |
| ) |  |
| inline override

Converter overrides: Update the converted representation of a transient object.

Parameters

  pAddress | [IN] Valid pointer to the object's opaque address
  pObject | [IN] Valid pointer to DataObject

Returns
  Status code indicating success or failure

Definition at line 128 of file RootNTupleCnv.h.

128 {
129 return StatusCode::SUCCESS;
130 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ updateRepRefs()

StatusCode Gaudi::RootNTupleCnv::updateRepRefs | ( | IOpaqueAddress * | ,
|  | DataObject * |
| ) |  |
| inline override

Converter overrides: Update the converted representation of a transient object.

Parameters

  pAddress | [IN] Valid pointer to the object's opaque address
  pObject | [IN] Valid pointer to DataObject

Returns
  Status code indicating success or failure

Definition at line 140 of file RootNTupleCnv.h.

140 {
141 return StatusCode::SUCCESS;
142 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

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

- RootCnv/RootCnv/RootNTupleCnv.h
- RootCnv/src/RootNTupleCnv.cpp