| The Gaudi Framework v28r2-patches (bc4ad17a)

- 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...

## 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 34 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 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

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

137 {
138 StatusCode status = S_FAIL;
139 RootDataConnection* con = nullptr;
140 IRegistry* pRegistry = pAddr->registry();
141 RootAddress* rpA = dynamic_cast<RootAddress*>(pAddr);
142 string path = fileName(pRegistry);
143 string cntName = containerName(pRegistry);
144 string* par = const_cast<string*>(pAddr->par());
145 status = m_dbMgr->connectDatabase(path,IDataConnection::READ,&con);
146 if ( status.isSuccess() ) {
147 string par_val, par_guid;
148 TBranch* b = con->getBranch("##Descriptors","GaudiStatisticsDescription");
149 if ( b ) {
150 RootNTupleDescriptor* ptr;
151 std::unique_ptr<RootNTupleDescriptor> dsc(ptr=new RootNTupleDescriptor());
152 b->SetAddress(&ptr);
153 for(Long64_t i=0, nent = b->GetEntries(); i<nent; ++i) {
154 int nb = b->GetEntry(i);
155 if ( nb > 1 ) {
156 if ( ptr->container == cntName ) {
157 par_val = ptr->description;
158 break;
159 }
160 }
161 }
162 }
163 par[2] = _tr(cntName);
164 TTree* tree = con->getSection(par[2]);
165 if ( nullptr == tree ) {
166 return makeError("Failed to access N-Tuple tree:"+cntName);
167 }
168 if ( !par_val.empty() ) {
169 auto ntupleSvc = dataProvider().as<INTupleSvc>();
170 if ( ntupleSvc ) {
171 char c;
172 CLID clid;
173 int siz, typ;
174 string title;
175 NTuple::Tuple* nt = nullptr;
176 istringstream is(par_val);
177 getline(is, title, ';') >> clid >> c >> siz >> c;
178 status = ntupleSvc->create(clid, title, nt);
179 for ( int j = 0; j < siz && status.isSuccess(); j++ ) {
180 is >> c;
181 getline(is, title, ';') >> typ >> c;
182 switch ( typ )
183 {
184 case DataTypeInfo::UCHAR:
185 status = createItem(tree, nt, is, title, true, (unsigned char)0);
186 break;
187 case DataTypeInfo::USHORT:
188 status = createItem(tree, nt, is, title, true, (unsigned short)0);
189 break;
190 case DataTypeInfo::UINT:
191 status = createItem(tree, nt, is, title, true, (unsigned int)0);
192 break;
193 case DataTypeInfo::ULONG:
194 status = createItem(tree, nt, is, title, true, (unsigned long)0);
195 break;
196 case DataTypeInfo::CHAR:
197 status = createItem(tree, nt, is, title, true, char(0));
198 break;
199 case DataTypeInfo::SHORT:
200 status = createItem(tree, nt, is, title, true, short(0));
201 break;
202 case DataTypeInfo::INT:
203 status = createItem(tree, nt, is, title, true, int(0));
204 break;
205 case DataTypeInfo::LONG:
206 status = createItem(tree, nt, is, title, true, long(0));
207 break;
208 case DataTypeInfo::BOOL:
209 status = createItem(tree, nt, is, title, true, false);
210 break;
211 case DataTypeInfo::FLOAT:
212 status = createItem(tree, nt, is, title, true, float(0.0));
213 break;
214 case DataTypeInfo::DOUBLE:
215 status = createItem(tree, nt, is, title, true, double(0.0));
216 break;
217 /*
218 case DataTypeInfo::NTCHAR:
219 case DataTypeInfo::LONG_NTCHAR:
220 status =
221 createItem(tree, nt, is, title, true, (char*)0);
222 break;
223 case DataTypeInfo::STRING:
224 case DataTypeInfo::LONG_STRING:
225 status =
226 createItem(tree, nt, is, title, true, string(""));
227 break;
228 */
229 case DataTypeInfo::OBJECT_ADDR:
230 status = createItem(tree, nt, is, title, false, (IOpaqueAddress*)nullptr);
231 break;
232 case DataTypeInfo::POINTER:
233 status = createItem(tree, nt, is, title, true, (void*)nullptr);
234 break;
235 case DataTypeInfo::UNKNOWN:
236 default:
237 status = S_FAIL;
238 break;
239 }
240 if ( !status.isSuccess() ) {
241 log() << MSG::FATAL
242 << "Error connecting (Unknown) column:" << j << endmsg
243 << par_val << endmsg;
244 return makeError("createObj[NTuple]> Cannot determine column!");
245 }
246 }
247 if ( status.isSuccess() ) {
248 unsigned long* ipar = const_cast<unsigned long*>(rpA->ipar());
249 log() << MSG::DEBUG << "Created N-tuple with description:"
250 << par_val << endl;
251 ipar[0] = (unsigned long)con;
252 ipar[1] = ~0x0UL;
253 rpA->section = tree;
254 refpObject = nt;
255 }
256 else {
257 refpObject = nullptr;
258 if ( nt ) nt->release();
259 }
260 }
261 }
262 }
263 return status;
264 }
Gaudi::RootStatCnv::log
MsgStream & log() const
Helper to use mesage logger.
Definition: RootStatCnv.h:38
std::string::empty
T empty(T...args)
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:28
Gaudi::RootAddress
Description:
Definition: RootAddress.h:36
std::istringstream
STL class.
gaudirun.c
c
Definition: gaudirun.py:391
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:772
DataTypeInfo::INT
Definition: DataTypeInfo.h:25
Gaudi::RootAddress::section
TTree * section
Pointer to ROOT TTree (filled for N-tuples only)
Definition: RootAddress.h:41
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:25
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
Gaudi::RootConverter::m_dbMgr
RootCnvSvc * m_dbMgr
Conversion service needed for proper operation to forward requests.
Definition: RootConverter.h:36
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:355
MSG::DEBUG
Definition: IMessageSvc.h:18
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:97
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:207
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:25
INTupleSvc
Definition: INTupleSvc.h:37
MSG::FATAL
Definition: IMessageSvc.h:22
Gaudi::RootNTupleDescriptor
Description:
Definition: RootRefs.h:77
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
Gaudi::IDataConnection::READ
Definition: IIODataManager.h:38
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:386
DataTypeInfo::UINT
Definition: DataTypeInfo.h:24
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:24
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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:67
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:108
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:26
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:307
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:24
Gaudi::RootNTupleDescriptor::description
std::string description
Description string.
Definition: RootRefs.h:79
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:24
DataTypeInfo::LONG
Definition: DataTypeInfo.h:25
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:26
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:23
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:370
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:56
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:28
Converter::dataProvider
SmartIF< IDataProviderSvc > & dataProvider() const override
Get Data provider service.
Definition: Converter.cpp:92
std::unique_ptr
STL class.
Gaudi::RootNTupleDescriptor::container
std::string container
Identifier of description.
Definition: RootRefs.h:83
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:26
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:50
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:92
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

400 {
401 IRegistry* pRegistry = pObj->registry();
402 if ( nullptr != pRegistry ) {
403 pAddr = pRegistry->address();
404 if ( nullptr != pAddr ) {
405 return S_OK;
406 }
407
408 RootDataConnection* con = nullptr;
409 string path = fileName(pRegistry);
410 string cntName = containerName(pRegistry);
411 string secName = cntName.c_str();
412 const INTuple* nt = dynamic_cast<const INTuple*>(pObj);
413 StatusCode status = m_dbMgr->connectDatabase(path, IDataConnection::UPDATE, &con);
414 if ( !status.isSuccess() ) {
415 return makeError("Failed to access Tuple file:"+path);
416 }
417 TTree* tree = con->getSection(_tr(secName),true);
418 if ( nullptr != nt ) {
419 const INTuple::ItemContainer& items = nt->items();
420 ostringstream os;
421 size_t item_no;
422 string desc;
423 os << nt->title()<<';'<<pObj->clID()<<';'<<items.size()<< ';';
424 map<string,TBranch*> branches;
425 TBranch* b = nullptr;
426 for(item_no = 0; item_no < items.size(); ++item_no ) {
427 INTupleItem* it = items[item_no];
428 if ( it->hasIndex() ) {
429 INTupleItem* itm = it->indexItem();
430 const string& n = itm->name();
431 switch( itm->type() )
432 {
433 case DataTypeInfo::UCHAR:
434 desc = n+"/b";
435 b = tree->Branch(n.c_str(),(void*)itm->buffer(),desc.c_str());
436 break;
437 case DataTypeInfo::USHORT:
438 desc = n+"/s";
439 b = tree->Branch(n.c_str(),(void*)itm->buffer(),desc.c_str());
440 break;
441 case DataTypeInfo::UINT:
442 desc = n+"/i";
443 b = tree->Branch(n.c_str(),(void*)itm->buffer(),desc.c_str());
444 break;
445 case DataTypeInfo::ULONG:
446 desc = n+"/l";
447 b = tree->Branch(n.c_str(),(void*)itm->buffer(),desc.c_str());
448 break;
449 case DataTypeInfo::CHAR:
450 desc = n+"/B";
451 b = tree->Branch(n.c_str(),(void*)itm->buffer(),desc.c_str());
452 break;
453 case DataTypeInfo::SHORT:
454 desc = n+"/S";
455 b = tree->Branch(n.c_str(),(void*)itm->buffer(),desc.c_str());
456 break;
457 case DataTypeInfo::INT:
458 desc = n+"/I";
459 b = tree->Branch(n.c_str(),(void*)itm->buffer(),desc.c_str());
460 break;
461 case DataTypeInfo::LONG:
462 desc = n+"/L";
463 b = tree->Branch(n.c_str(),(void*)itm->buffer(),desc.c_str());
464 break;
465 default:
466 return makeError("Column "+it->index()+" is not a valid index column!");
467 }
468 branches[n] = b;
469 }
470 }
471 for(item_no = 0; item_no < items.size(); ++item_no ) {
472 INTupleItem* it = items[item_no];
473 const string& n = it->name();
474 os << '{'
475 << n << ';'
476 << it->type() << ';'
477 << it->length() << ';'
478 << it->ndim() << ';'
479 << it->hasIndex() << ';';
480 if ( it->hasIndex() ) {
481 os << it->index() << ';';
482 INTupleItem* itm = it->indexItem();
483 switch( itm->type() )
484 {
485 case DataTypeInfo::UCHAR:
486 putRange(os, dynamic_cast<NTuple::_Data<unsigned char>*>(itm));
487 break;
488 case DataTypeInfo::USHORT:
489 putRange(os, dynamic_cast<NTuple::_Data<unsigned short>*>(itm));
490 break;
491 case DataTypeInfo::UINT:
492 putRange(os, dynamic_cast<NTuple::_Data<unsigned int>*>(itm));
493 break;
494 case DataTypeInfo::ULONG:
495 putRange(os, dynamic_cast<NTuple::_Data<unsigned long>*>(itm));
496 break;
497 case DataTypeInfo::CHAR:
498 putRange(os, dynamic_cast<NTuple::_Data<char>*>(itm));
499 break;
500 case DataTypeInfo::SHORT:
501 putRange(os, dynamic_cast<NTuple::_Data<short>*>(itm));
502 break;
503 case DataTypeInfo::INT:
504 putRange(os, dynamic_cast<NTuple::_Data<int>*>(itm));
505 break;
506 case DataTypeInfo::LONG:
507 putRange(os, dynamic_cast<NTuple::_Data<long>*>(itm));
508 break;
509 default:
510 return makeError("NTuple:"+pRegistry->name()+" Column "+it->index()+
511 " is not a valid index column!");
512 }
513 }
514 for ( long k = 0; k < it->ndim(); k++ ) {
515 os << it->dim(k) << ';';
516 }
517 desc = n;
518 TClass* cl = nullptr;
519 switch(it->type())
520 {
521 case DataTypeInfo::STRING:
522 desc = "/C";
523 os << 0 << ';' << 0 << ';';
524 break;
525 case DataTypeInfo::NTCHAR:
526 desc = "/C";
527 os << 0 << ';' << 0 << ';';
528 break;
529 case DataTypeInfo::OBJECT_ADDR:
530 if ( it->length() == 1 ) {
531 desc = System::typeinfoName(typeid(RootRef));
532 os << 0 << ';' << 0 << ';';
533 cl = TClass::GetClass(desc.c_str(),kTRUE);
534 }
535 break;
536 case DataTypeInfo::POINTER:
537 if ( it->length() == 1 ) {
538 os << 0 << ';' << 0 << ';';
539 cl = TClass::GetClass(it->typeID(), kTRUE);
540 }
541 break;
542 case DataTypeInfo::UCHAR:
543 desc = "/b";
544 putRange(os, dynamic_cast<NTuple::_Data<unsigned char>*>(it));
545 break;
546 case DataTypeInfo::USHORT:
547 desc = "/s";
548 putRange(os, dynamic_cast<NTuple::_Data<unsigned short>*>(it));
549 break;
550 case DataTypeInfo::UINT:
551 desc = "/i";
552 putRange(os, dynamic_cast<NTuple::_Data<unsigned int>*>(it));
553 break;
554 case DataTypeInfo::ULONG:
555 desc = "/l";
556 putRange(os, dynamic_cast<NTuple::_Data<unsigned long>*>(it));
557 break;
558 case DataTypeInfo::CHAR:
559 desc = "/B";
560 putRange(os, dynamic_cast<NTuple::_Data<char>*>(it));
561 break;
562 case DataTypeInfo::SHORT:
563 desc = "/S";
564 putRange(os, dynamic_cast<NTuple::_Data<short>*>(it));
565 break;
566 case DataTypeInfo::INT:
567 desc = "/I";
568 putRange(os, dynamic_cast<NTuple::_Data<int>*>(it));
569 break;
570 case DataTypeInfo::LONG:
571 desc = "/L";
572 putRange(os, dynamic_cast<NTuple::_Data<long>*>(it));
573 break;
574 case DataTypeInfo::BOOL:
575 desc = "/b";
576 putRange(os, dynamic_cast<NTuple::_Data<bool>*>(it));
577 break;
578 case DataTypeInfo::FLOAT:
579 desc = "/F";
580 putRange(os, dynamic_cast<NTuple::_Data<float>*>(it));
581 break;
582 case DataTypeInfo::DOUBLE:
583 desc = "/D";
584 putRange(os, dynamic_cast<NTuple::_Data<double>*>(it));
585 break;
586 case DataTypeInfo::UNKNOWN:
587 default:
588 return makeError("Create item[FAIL]: "+it->name());
589 }
590 os << '}';
591 if ( branches.find(n) == branches.end() ) {
592 string tmp;
593 char text[32];
594 switch(it->ndim())
595 {
596 case 0:
597 desc = n+desc;
598 break;
599 case 2:
600 sprintf(text,"[%ld]",it->dim(0));
601 tmp = text;
602 case 1:
603 if ( it->hasIndex() ) {
604 INTupleItem* itm = it->indexItem();
605 desc = n + tmp + "[" + itm->name() + "]" + desc;
606 }
607 else {
608 sprintf(text,"[%ld]",it->dim(0));
609 desc = n + tmp + text + desc;
610 }
611 }
612 log() << MSG::DEBUG << "Create branch:" << n << " Desc:" << desc
613 << " of type:" << it->type() << endmsg;
614 switch(it->type())
615 {
616 case DataTypeInfo::OBJECT_ADDR:
617 branches[n] = tree->Branch(n.c_str(),cl->GetName(),(void*)it->buffer());
618 break;
619 case DataTypeInfo::POINTER:
620 branches[n] = tree->Branch(n.c_str(),cl->GetName(),(void*)it->buffer());
621 break;
622 default:
623 branches[n] = tree->Branch(n.c_str(),(void*)it->buffer(),desc.c_str());
624 break;
625 }
626 }
627 }
628
629 log() << MSG::DEBUG << "Save description:" << path << " -> " << cntName << endmsg
630 << os.str() << endmsg;
631 status = saveDescription(path,cntName,os.str(),"",pObj->clID());
632 if ( status.isSuccess() ) {
633 status = m_dbMgr->commitOutput(path, true);
634 if ( status.isSuccess() ) {
635 string spar[] = { path, cntName};
636 unsigned long ipar[] = { (unsigned long)con, ~0x0u };
637 status = m_dbMgr->createAddress(repSvcType(),pObj->clID(),spar,ipar,pAddr);
638 if ( status.isSuccess() ) {
639 RootAddress* rpA = dynamic_cast<RootAddress*>(pAddr);
640 ((unsigned long*)rpA->ipar())[0] = (unsigned long)con;
641 rpA->section = tree;
642 }
643 else {
644 pAddr->release();
645 pAddr = nullptr;
646 }
647 }
648 }
649 return status;
650 }
651 }
652 return S_FAIL;
653 }
Gaudi::RootStatCnv::log
MsgStream & log() const
Helper to use mesage logger.
Definition: RootStatCnv.h:38
INTupleItem::name
virtual const std::string & name() const =0
Access _Item name.
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:28
Gaudi::RootAddress
Description:
Definition: RootAddress.h:36
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:772
DataTypeInfo::INT
Definition: DataTypeInfo.h:25
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:299
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:373
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:25
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
Gaudi::RootConverter::m_dbMgr
RootCnvSvc * m_dbMgr
Conversion service needed for proper operation to forward requests.
Definition: RootConverter.h:36
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:355
MSG::DEBUG
Definition: IMessageSvc.h:18
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:97
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:207
DataTypeInfo::STRING
Definition: DataTypeInfo.h:27
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:25
Gaudi::RootConverter::repSvcType
long repSvcType() const override
Retrieve the class type of the data store the converter uses.
Definition: RootConverter.h:54
std::map
STL class.
Gaudi::RootCnvSvc::commitOutput
StatusCode commitOutput(const std::string &outputFile, bool do_commit) override
Commit pending output.
Definition: RootCnvSvc.cpp:313
DataTypeInfo::NTCHAR
Definition: DataTypeInfo.h:27
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
INTuple
NTuple interface class definition.
Definition: INTuple.h:79
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:217
Gaudi::RootRef
Persistent reference object.
Definition: RootRefs.h:30
INTupleItem::ndim
virtual long ndim() const =0
Dimension.
INTupleItem
NTuple interface class definition.
Definition: INTuple.h:26
DataObject::clID
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:68
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:24
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:24
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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:67
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:108
std::ostringstream
STL class.
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:26
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:24
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:112
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:24
DataTypeInfo::LONG
Definition: DataTypeInfo.h:25
NTuple::_Data
Abstract class describing basic data in an Ntuple.
Definition: NTuple.h:37
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:26
INTupleItem::type
virtual long type() const =0
Type information of the item.
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:23
Gaudi::IDataConnection::UPDATE
Definition: IIODataManager.h:38
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:28
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:26
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:50
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:92
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:244

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

101 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

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

656 {
657 typedef INTuple::ItemContainer Cont;
658 INTuple* tupl = dynamic_cast<INTuple*>(pObj);
659 IRegistry* pReg = pObj->registry();
660 RootAddress* rpA = dynamic_cast<RootAddress*>(pAddr);
661 if ( tupl && pReg && rpA ) {
662 string cntName = containerName(pReg);
663 unsigned long* ipar = const_cast<unsigned long*>(pAddr->ipar());
664 RootDataConnection* con = (RootDataConnection*)rpA->ipar()[0];
665 if ( con ) {
666 TTree* tree = rpA->section;
667 if ( tree ) {
668 Cont& it = tupl->items();
669 size_t k, n = it.size();
670 vector<RootRef*> paddr(n);
671 vector<RootRef> addr(n);
672 for(k = 0; k < n; ++k) {
673 IOpaqueAddress* pA = nullptr;
674 Cont::value_type j = it[k];
675 switch( j->type() )
676 {
677 case DataTypeInfo::OBJECT_ADDR:
678 pA = (*(IOpaqueAddress**)j->buffer());
679 paddr[k] = &addr[k];
680 addr[k].reset();
681 if ( pA ) {
682 con->makeRef(pA->registry(),addr[k]);
683 addr[k].entry = pA->ipar()[1];
684 }
685 tree->SetBranchAddress(j->name().c_str(),&paddr[k]);
686 break;
687 default:
688 break;
689 }
690 }
691 int nb = tree->Fill();
692 if ( nb>1 ) ++ipar[1];
693 for(k = 0; k < n; ++k) it[k]->reset();
694 return nb>1 ? StatusCode::SUCCESS : StatusCode::FAILURE;
695 }
696 return makeError("fillRepRefs> Failed to access data tree:"+cntName);
697 }
698 return makeError("fillRepRefs> Failed to access data source!");
699 }
700 return makeError("fillRepRefs> Invalid Tuple reference.");
701 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::RootAddress
Description:
Definition: RootAddress.h:36
StatusCode::FAILURE
Definition: StatusCode.h:29
Gaudi::RootAddress::section
TTree * section
Pointer to ROOT TTree (filled for N-tuples only)
Definition: RootAddress.h:41
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:97
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
INTuple
NTuple interface class definition.
Definition: INTuple.h:79
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:217
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:108
Gaudi::RootDataConnection::makeRef
void makeRef(IRegistry *pA, RootRef &ref)
Create reference object from registry entry.
Definition: RootDataConnection.cpp:604
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:28
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:50
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:92

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

293 {
294 typedef INTuple::ItemContainer Cont;
295 const string* par = rpA->par();
296 unsigned long* ipar = const_cast<unsigned long*>(rpA->ipar());
297 ++ipar[1];
298 if ( Long64_t(ipar[1]) <= tree->GetEntries() ) {
299 GenericAddress* pA = nullptr;
300 Cont& it = tupl->items();
301 size_t k, n = it.size();
302 vector<RootRef*> paddr(n);
303 vector<RootRef> addr(n);
304 for(k = 0; k < n; ++k) {
305 Cont::value_type j = it[k];
306 switch( j->type() )
307 {
308 case DataTypeInfo::OBJECT_ADDR:
309 paddr[k] = &addr[k];
310 tree->SetBranchAddress(j->name().c_str(),&paddr[k]);
311 break;
312 default:
313 break;
314 }
315 }
316
317 ULong64_t last = (ULong64_t)tree->GetEntries();
318 ISelectStatement* sel = tupl->selector();
319 if ( sel ) {
320 string criteria = (sel && (sel->type() & ISelectStatement::STRING))
321 ? sel->criteria() : string("");
322 if ( !(criteria.length() == 0 || criteria == "*") ) {
323 if ( rpA->select == nullptr ) {
324 log() << MSG::DEBUG << "Selection criteria: " << criteria << " " << ipar[1] << endmsg;
325 rpA->select = new TTreeFormula(tree->GetName(),criteria.c_str(), tree);
326 }
327 rpA->select->SetTree(tree);
328 for( ; ipar[1] < last; ++ipar[1]) { // loop on all selected entries
329 tree->LoadTree(ipar[1]);
330 rpA->select->GetNdata();
331 if ( fabs(rpA->select->EvalInstance(0)) > std::numeric_limits<float>::epsilon() ) {
332 break;
333 }
334 log() << MSG::DEBUG << par[0] << "/" << par[1] << " SKIP Entry: " << ipar[1] << endmsg;
335 }
336 }
337 }
338 if ( ipar[1] < last ) {
339 unsigned long entry = ipar[1];
340 if ( tree->GetEntry(entry) > 1 ) {
341 RootRef *r = nullptr;
342 string *spar = nullptr;
343 for(k = 0; k < n; ++k) {
344 Cont::value_type j = it[k];
345 switch( j->type() )
346 {
347 case DataTypeInfo::OBJECT_ADDR:
348 r = paddr[k];
349 pA = (*(GenericAddress**)j->buffer());
350 if ( pA ) { // Fill only if item is connected!
351 spar = (string*)pA->par();
352 ipar = (unsigned long*)pA->ipar();
353 log() << MSG::DEBUG;
354 pair<const RootRef*,const RootDataConnection::ContainerSection*> ls = con->getMergeSection(tree->GetName(),entry);
355 if ( ls.first ) {
356 if ( ls.first->dbase >= 0 ) {
357 // Now patch the references and links 'en block' to be efficient
358 // First the leafs from the TES
359
360 r->dbase += ls.first->dbase;
361 r->container += ls.first->container;
362 r->link += ls.first->link;
363
364 if ( log().isActive() ) {
365 log() << "Refs: LS [" << entry << "] -> "
366 << ls.first->dbase << "," << ls.first->container
367 << "," << ls.first->link
368 << "," << ls.first->entry
369 << " DB:" << con->getDb(r->dbase)
370 << endmsg;
371 }
372 }
373 }
374 spar[0] = con->getDb(r->dbase);
375 spar[1] = con->getCont(r->container);
376 spar[2] = con->getLink(r->link);
377 ipar[0] = 0;
378 ipar[1] = r->entry;
379 pA->setClID(r->clid);
380 pA->setSvcType(r->svc);
381 break;
382 }
383 break;
384 default:
385 break;
386 }
387 }
388 return StatusCode::SUCCESS;
389 }
390 log() << MSG::ERROR << "Failed to read data from NTuple tree." << endmsg;
391 return StatusCode::FAILURE;
392 }
393 log() << MSG::INFO << "End of input Ntuple." << endmsg;
394 return StatusCode::FAILURE;
395 }
396 return StatusCode::FAILURE;
397 }
Gaudi::RootStatCnv::log
MsgStream & log() const
Helper to use mesage logger.
Definition: RootStatCnv.h:38
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29
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:448
GenericAddress::setSvcType
void setSvcType(long typ)
Access : set the storage type of the class id.
Definition: GenericAddress.h:100
ISelectStatement::STRING
Definition: ISelectStatement.h:38
MSG::DEBUG
Definition: IMessageSvc.h:18
IOTest.sel
sel
Definition: IOTest.py:84
MsgStream::isActive
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:128
Gaudi::RootRef::container
int container
Definition: RootRefs.h:32
Gaudi::RootDataConnection::getLink
const std::string & getLink(int which) const
Access link name from saved index.
Definition: RootDataConnection.h:328
Gaudi::RootRef::entry
int entry
Definition: RootRefs.h:32
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:217
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:32
Gaudi::RootRef
Persistent reference object.
Definition: RootRefs.h:30
GenericAddress::setClID
void setClID(const CLID &clid)
Access : Set class ID of the link.
Definition: GenericAddress.h:92
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:386
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:108
GenericAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: GenericAddress.h:104
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:576
Gaudi::RootDataConnection::getCont
const std::string & getCont(int which) const
Access container name from saved index.
Definition: RootDataConnection.h:324
std::fabs
T fabs(T...args)
Gaudi::RootRef::clid
int clid
Definition: RootRefs.h:32
std::pair
std::string::length
T length(T...args)
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:28
std::vector
STL class.
Gaudi::RootRef::link
int link
Definition: RootRefs.h:32
std::string::c_str
T c_str(T...args)
MSG::ERROR
Definition: IMessageSvc.h:21
Gaudi::RootRef::svc
int svc
Definition: RootRefs.h:32
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:19
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:244
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 267 of file RootNTupleCnv.cpp.

267 {
268 INTuple* tupl = dynamic_cast<INTuple*>(pObj);
269 RootAddress* rpA = dynamic_cast<RootAddress*>(pAddr);
270 if ( nullptr != tupl && nullptr != rpA ) {
271 RootDataConnection* con = (RootDataConnection*)rpA->ipar()[0];
272 if ( con ) {
273 TTree* tree = rpA->section;
274 if ( tree ) {
275 con->resetAge();
276 if ( con->tool()->refs() )
277 return i__updateObjRoot(rpA,tupl,tree,con);
278 #ifdef __POOL_COMPATIBILITY
279 // POOL compatibility mode:
280 return i__updateObjPool(rpA,tupl,tree,con);
281 #else
282 return makeError("Failed to access reference branch for data tree:"+rpA->par()[1]);
283 #endif
284 }
285 return makeError("Failed to access data tree:"+pAddr->par()[1]);
286 }
287 return makeError("updateObj> Failed to access data source!");
288 }
289 return makeError("updateObj> Invalid Tuple reference.");
290 }
Gaudi::RootAddress
Description:
Definition: RootAddress.h:36
Gaudi::RootAddress::section
TTree * section
Pointer to ROOT TTree (filled for N-tuples only)
Definition: RootAddress.h:41
Gaudi::RootStatCnv::makeError
StatusCode makeError(const std::string &msg, bool throw_exception=false) const
Helper method to issue error messages.
Definition: RootStatCnv.cpp:97
INTuple
NTuple interface class definition.
Definition: INTuple.h:79
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:108
GenericAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: GenericAddress.h:104
Gaudi::RootDataConnection::tool
Tool * tool() const
Access tool.
Definition: RootDataConnection.h:253
Gaudi::RootDataConnection::Tool::refs
TTree * refs() const
Definition: RootDataConnection.h:208
Gaudi::IDataConnection::resetAge
void resetAge()
Reset age.
Definition: IIODataManager.h:60
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:293
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:92

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

123 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

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

135 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

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

147 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

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

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