| The Gaudi Framework v29r1 (5cd95fa2)

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

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

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...
| ~RootNTupleCnv () override=default
| Standard destructor. 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...
| ~RootStatCnv () override=default
| Standard Destructor. More...
Public Member Functions inherited from Gaudi::RootConverter
| RootConverter (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
| Initializing Constructor. More...
| ~RootConverter () override=default
| Standard Destructor. 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...
| ~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
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
| ~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< IDataManagerSvc > & | dataManager () const
| Get Data Manager service. 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...
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 36 of file RootNTupleCnv.h.

## Constructor & Destructor Documentation

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 56 of file RootNTupleCnv.h.

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

Gaudi::RootNTupleCnv::~RootNTupleCnv | ( |  | ) |
| override default

Standard destructor.

## Member Function Documentation

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 118 of file RootNTupleCnv.cpp.

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

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 372 of file RootNTupleCnv.cpp.

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

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 101 of file RootNTupleCnv.h.

102 {
103 return StatusCode::SUCCESS;
104 }
StatusCode::SUCCESS
Definition: StatusCode.h:31

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 616 of file RootNTupleCnv.cpp.

617 {
618 typedef INTuple::ItemContainer Cont;
619 INTuple* tupl = dynamic_cast<INTuple*>( pObj );
620 IRegistry* pReg = pObj->registry();
621 RootAddress* rpA = dynamic_cast<RootAddress*>( pAddr );
622 if ( tupl && pReg && rpA ) {
623 string cntName = containerName( pReg );
624 unsigned long* ipar = const_cast<unsigned long*>( pAddr->ipar() );
625 RootDataConnection* con = (RootDataConnection*)rpA->ipar()[0];
626 if ( con ) {
627 TTree* tree = rpA->section;
628 if ( tree ) {
629 Cont& it = tupl->items();
630 size_t k, n = it.size();
631 vector<RootRef*> paddr( n );
632 vector<RootRef> addr( n );
633 for ( k = 0; k < n; ++k ) {
634 IOpaqueAddress* pA = nullptr;
635 Cont::value_type j = it[k];
636 switch ( j->type() ) {
637 case DataTypeInfo::OBJECT_ADDR:
638 pA = ( *(IOpaqueAddress**)j->buffer() );
639 paddr[k] = &addr[k];
640 addr[k].reset();
641 if ( pA ) {
642 con->makeRef( pA->registry(), addr[k] );
643 addr[k].entry = pA->ipar()[1];
644 }
645 tree->SetBranchAddress( j->name().c_str(), &paddr[k] );
646 break;
647 default:
648 break;
649 }
650 }
651 int nb = tree->Fill();
652 if ( nb > 1 ) ++ipar[1];
653 for ( k = 0; k < n; ++k ) it[k]->reset();
654 return nb > 1 ? StatusCode::SUCCESS : StatusCode::FAILURE;
655 }
656 return makeError( "fillRepRefs> Failed to access data tree:" + cntName );
657 }
658 return makeError( "fillRepRefs> Failed to access data source!" );
659 }
660 return makeError( "fillRepRefs> Invalid Tuple reference." );
661 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Gaudi::RootAddress
Description:
Definition: RootAddress.h:37
StatusCode::FAILURE
Definition: StatusCode.h:31
Gaudi::RootAddress::section
TTree * section
Pointer to ROOT TTree (filled for N-tuples only)
Definition: RootAddress.h:43
IOpaqueAddress::registry
virtual IRegistry * registry() const =0
Update branch name.
Gaudi::RootStatCnv::makeError
StatusCode makeError(const std::string &msg, bool throw_exception=false) const
Helper method to issue error messages.
Definition: RootStatCnv.cpp:102
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
INTuple
NTuple interface class definition.
Definition: INTuple.h:82
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:228
IOpaqueAddress::ipar
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:86
Gaudi::RootDataConnection::makeRef
void makeRef(IRegistry *pA, RootRef &ref)
Create reference object from registry entry.
Definition: RootDataConnection.cpp:605
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:42
std::vector
STL class.
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:52
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:94

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 270 of file RootNTupleCnv.cpp.

271 {
272 typedef INTuple::ItemContainer Cont;
273 const string* par = rpA->par();
274 unsigned long* ipar = const_cast<unsigned long*>( rpA->ipar() );
275 ++ipar[1];
276 if ( Long64_t( ipar[1] ) <= tree->GetEntries() ) {
277 GenericAddress* pA = nullptr;
278 Cont& it = tupl->items();
279 size_t k, n = it.size();
280 vector<RootRef*> paddr( n );
281 vector<RootRef> addr( n );
282 for ( k = 0; k < n; ++k ) {
283 Cont::value_type j = it[k];
284 switch ( j->type() ) {
285 case DataTypeInfo::OBJECT_ADDR:
286 paddr[k] = &addr[k];
287 tree->SetBranchAddress( j->name().c_str(), &paddr[k] );
288 break;
289 default:
290 break;
291 }
292 }
293
294 ULong64_t last = (ULong64_t)tree->GetEntries();
295 ISelectStatement* sel = tupl->selector();
296 if ( sel ) {
297 string criteria = ( sel && ( sel->type() & ISelectStatement::STRING ) ) ? sel->criteria() : string( "" );
298 if ( !( criteria.length() == 0 || criteria == "*" ) ) {
299 if ( rpA->select == nullptr ) {
300 log() << MSG::DEBUG << "Selection criteria: " << criteria << " " << ipar[1] << endmsg;
301 rpA->select = new TTreeFormula( tree->GetName(), criteria.c_str(), tree );
302 }
303 rpA->select->SetTree( tree );
304 for ( ; ipar[1] < last; ++ipar[1] ) { // loop on all selected entries
305 tree->LoadTree( ipar[1] );
306 rpA->select->GetNdata();
307 if ( fabs( rpA->select->EvalInstance( 0 ) ) > std::numeric_limits<float>::epsilon() ) {
308 break;
309 }
310 log() << MSG::DEBUG << par[0] << "/" << par[1] << " SKIP Entry: " << ipar[1] << endmsg;
311 }
312 }
313 }
314 if ( ipar[1] < last ) {
315 unsigned long entry = ipar[1];
316 if ( tree->GetEntry( entry ) > 1 ) {
317 RootRef* r = nullptr;
318 string* spar = nullptr;
319 for ( k = 0; k < n; ++k ) {
320 Cont::value_type j = it[k];
321 switch ( j->type() ) {
322 case DataTypeInfo::OBJECT_ADDR:
323 r = paddr[k];
324 pA = ( *(GenericAddress**)j->buffer() );
325 if ( pA ) { // Fill only if item is connected!
326 spar = (string*)pA->par();
327 ipar = (unsigned long*)pA->ipar();
328 log() << MSG::DEBUG;
329 pair<const RootRef*, const RootDataConnection::ContainerSection*> ls =
330 con->getMergeSection( tree->GetName(), entry );
331 if ( ls.first ) {
332 if ( ls.first->dbase >= 0 ) {
333 // Now patch the references and links 'en block' to be efficient
334 // First the leafs from the TES
335
336 r->dbase += ls.first->dbase;
337 r->container += ls.first->container;
338 r->link += ls.first->link;
339
340 if ( log().isActive() ) {
341 log() << "Refs: LS [" << entry << "] -> " << ls.first->dbase << "," << ls.first->container << ","
342 << ls.first->link << "," << ls.first->entry << " DB:" << con->getDb( r->dbase ) << endmsg;
343 }
344 }
345 }
346 spar[0] = con->getDb( r->dbase );
347 spar[1] = con->getCont( r->container );
348 spar[2] = con->getLink( r->link );
349 ipar[0] = 0;
350 ipar[1] = r->entry;
351 pA->setClID( r->clid );
352 pA->setSvcType( r->svc );
353 break;
354 }
355 break;
356 default:
357 break;
358 }
359 }
360 return StatusCode::SUCCESS;
361 }
362 log() << MSG::ERROR << "Failed to read data from NTuple tree." << endmsg;
363 return StatusCode::FAILURE;
364 }
365 log() << MSG::INFO << "End of input Ntuple." << endmsg;
366 return StatusCode::FAILURE;
367 }
368 return StatusCode::FAILURE;
369 }
Gaudi::RootStatCnv::log
MsgStream & log() const
Helper to use mesage logger.
Definition: RootStatCnv.h:40
StatusCode::SUCCESS
Definition: StatusCode.h:31
StatusCode::FAILURE
Definition: StatusCode.h:31
ISelectStatement
A select statement can either contain.
Definition: ISelectStatement.h:32
Gaudi::RootDataConnection::getDb
const std::string & getDb(int which) const
Access database/file name from saved index.
Definition: RootDataConnection.cpp:450
GenericAddress::setSvcType
void setSvcType(long typ)
Access : set the storage type of the class id.
Definition: GenericAddress.h:82
ISelectStatement::STRING
Definition: ISelectStatement.h:39
MSG::DEBUG
Definition: IMessageSvc.h:16
IOTest.sel
sel
Definition: IOTest.py:95
MsgStream::isActive
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:116
Gaudi::RootRef::container
int container
Definition: RootRefs.h:33
Gaudi::RootDataConnection::getLink
const std::string & getLink(int which) const
Access link name from saved index.
Definition: RootDataConnection.h:336
Gaudi::RootRef::entry
int entry
Definition: RootRefs.h:33
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:228
ISelectStatement::criteria
virtual const std::string & criteria() const =0
Access the selection string.
Gaudi::RootRef::dbase
int dbase
Data members to define object location in the persistent world.
Definition: RootRefs.h:33
Gaudi::RootRef
Persistent reference object.
Definition: RootRefs.h:31
GenericAddress::setClID
void setClID(const CLID &clid)
Access : Set class ID of the link.
Definition: GenericAddress.h:78
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:437
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:86
GenericAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: GenericAddress.h:84
Gaudi::RootDataConnection::getMergeSection
std::pair< const RootRef *, const ContainerSection * > getMergeSection(const std::string &container, int entry) const
Access link section for single container and entry.
Definition: RootDataConnection.cpp:578
Gaudi::RootDataConnection::getCont
const std::string & getCont(int which) const
Access container name from saved index.
Definition: RootDataConnection.h:330
std::fabs
T fabs(T...args)
Gaudi::RootRef::clid
int clid
Definition: RootRefs.h:33
std::pair
std::string::length
T length(T...args)
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:42
std::vector
STL class.
Gaudi::RootRef::link
int link
Definition: RootRefs.h:33
std::string::c_str
T c_str(T...args)
MSG::ERROR
Definition: IMessageSvc.h:16
Gaudi::RootRef::svc
int svc
Definition: RootRefs.h:33
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:41
MSG::INFO
Definition: IMessageSvc.h:16
ISelectStatement::type
virtual long type() const =0
Access the type of the object.
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
std::numeric_limits

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 244 of file RootNTupleCnv.cpp.

245 {
246 INTuple* tupl = dynamic_cast<INTuple*>( pObj );
247 RootAddress* rpA = dynamic_cast<RootAddress*>( pAddr );
248 if ( nullptr != tupl && nullptr != rpA ) {
249 RootDataConnection* con = (RootDataConnection*)rpA->ipar()[0];
250 if ( con ) {
251 TTree* tree = rpA->section;
252 if ( tree ) {
253 con->resetAge();
254 if ( con->tool()->refs() ) return i__updateObjRoot( rpA, tupl, tree, con );
255 #ifdef __POOL_COMPATIBILITY
256 // POOL compatibility mode:
257 return i__updateObjPool( rpA, tupl, tree, con );
258 #else
259 return makeError( "Failed to access reference branch for data tree:" + rpA->par()[1] );
260 #endif
261 }
262 return makeError( "Failed to access data tree:" + pAddr->par()[1] );
263 }
264 return makeError( "updateObj> Failed to access data source!" );
265 }
266 return makeError( "updateObj> Invalid Tuple reference." );
267 }
Gaudi::RootAddress
Description:
Definition: RootAddress.h:37
Gaudi::RootAddress::section
TTree * section
Pointer to ROOT TTree (filled for N-tuples only)
Definition: RootAddress.h:43
Gaudi::RootStatCnv::makeError
StatusCode makeError(const std::string &msg, bool throw_exception=false) const
Helper method to issue error messages.
Definition: RootStatCnv.cpp:102
INTuple
NTuple interface class definition.
Definition: INTuple.h:82
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:86
GenericAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: GenericAddress.h:84
Gaudi::RootDataConnection::tool
Tool * tool() const
Access tool.
Definition: RootDataConnection.h:255
Gaudi::RootDataConnection::Tool::refs
TTree * refs() const
Definition: RootDataConnection.h:210
Gaudi::IDataConnection::resetAge
void resetAge()
Reset age.
Definition: IIODataManager.h:63
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:270
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:94

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 123 of file RootNTupleCnv.h.

124 {
125 return StatusCode::SUCCESS;
126 }
StatusCode::SUCCESS
Definition: StatusCode.h:31

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 136 of file RootNTupleCnv.h.

137 {
138 return StatusCode::SUCCESS;
139 }
StatusCode::SUCCESS
Definition: StatusCode.h:31

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 149 of file RootNTupleCnv.h.

150 {
151 return StatusCode::SUCCESS;
152 }
StatusCode::SUCCESS
Definition: StatusCode.h:31

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

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