Gaudi::RootDirectoryCnv Class Reference

Description: NTuple directory converter class definition Definition of the converter to manage the directories in an database representing N-Tuples. More...

#include <src/RootDirectoryCnv.h>

Inheritance diagram for Gaudi::RootDirectoryCnv:
Collaboration diagram for Gaudi::RootDirectoryCnv:

Public Member Functions

 RootDirectoryCnv (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor. More...
 
virtual ~RootDirectoryCnv ()
 Standard Destructor. More...
 
virtual StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&refpObj)
 Converter overrides: Create transient object from persistent data. More...
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Resolve the references of the transient object. More...
 
virtual StatusCode updateObj (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update transient object from persistent data. More...
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update the references of an updated transient object. More...
 
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&refpAddr)
 Converter overrides: Convert the transient object to the requested representation. More...
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Fill references of persistent object representation. More...
 
virtual StatusCode updateRep (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update persistent object representation. More...
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update references of persistent object representation. More...
 
 RootDirectoryCnv (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor. More...
 
virtual ~RootDirectoryCnv ()
 Standard Destructor. More...
 
virtual StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&refpObj)
 Converter overrides: Create transient object from persistent data. More...
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Resolve the references of the transient object. More...
 
virtual StatusCode updateObj (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update transient object from persistent data. More...
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update the references of an updated transient object. More...
 
virtual StatusCode createRep (DataObject *pObj, IOpaqueAddress *&refpAddr)
 Converter overrides: Convert the transient object to the requested representation. More...
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Fill references of persistent object representation. More...
 
virtual StatusCode updateRep (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update persistent object representation. More...
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Converter overrides: Update references of persistent object representation. 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...
 
 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...
 
virtual ~RootConverter ()
 Standard Destructor. More...
 
virtual long repSvcType () const
 Retrieve the class type of the data store the converter uses. More...
 
 RootConverter (long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
 Initializing Constructor. More...
 
virtual ~RootConverter ()
 Standard Destructor. More...
 
virtual long repSvcType () const
 Retrieve the class type of the data store the converter uses. 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 CLIDobjType () 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< IServiceservice (const std::string &name, const bool createIf=true) const
 Return a pointer to the service identified by name (or "type/name") More...
 
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 CLIDobjType () 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< IServiceservice (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< Interfaces >
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...
 
implementsoperator= (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...
 
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...
 
implementsoperator= (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...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Additional Inherited Members

- Public Types inherited from Converter
typedef Gaudi::PluginService::Factory< IConverter *, ISvcLocator * > Factory
 
typedef Gaudi::PluginService::Factory< IConverter *, ISvcLocator * > Factory
 
- Public Types inherited from implements< Interfaces >
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
 
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...
 
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
- Protected Member Functions inherited from Gaudi::RootStatCnv
MsgStreamlog () 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...
 
MsgStreamlog () 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< IMessageSvc > & messageService () const
 
SmartIF< IDataManagerSvc > & dataManager () const
 Get Data Manager service. More...
 
 ~Converter () override=default
 Standard Destructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 Retrieve pointer to message service. More...
 
SmartIF< IMessageSvc > & messageService () const
 
SmartIF< IDataManagerSvc > & dataManager () const
 Get Data Manager service. More...
 
- Protected Attributes inherited from Gaudi::RootStatCnv
SmartIF< IDataManagerSvcm_dataMgr
 Reference to data manager service to manipulate the TES. More...
 
std::unique_ptr< MsgStreamm_log
 Reference to logger object. More...
 
- Protected Attributes inherited from Gaudi::RootConverter
RootCnvSvcm_dbMgr
 Conversion service needed for proper operation to forward requests. More...
 
- Protected Attributes inherited from implements< Interfaces >
unsigned long m_refCount = 0
 Reference counter. More...
 

Detailed Description

Description: NTuple directory converter class definition Definition of the converter to manage the directories in an database representing N-Tuples.

Author
M.Frank
Version
1.0

Definition at line 30 of file RootDirectoryCnv.h.

Constructor & Destructor Documentation

RootDirectoryCnv::RootDirectoryCnv ( long  typ,
const CLID clid,
ISvcLocator svc,
RootCnvSvc mgr 
)

Initializing Constructor.

Parameters
typ[IN] Concrete storage type of the converter
clid[IN] Class identifier of the object
svc[IN] Pointer to service locator object
Returns
Reference to RootBaseCnv object

Definition at line 30 of file RootDirectoryCnv.cpp.

33  : RootStatCnv(typ, clid, svc, mgr)
34 {
35 }
RootStatCnv(long typ, const CLID &clid, ISvcLocator *svc, RootCnvSvc *mgr)
Initializing Constructor.
Definition: RootStatCnv.cpp:24
virtual Gaudi::RootDirectoryCnv::~RootDirectoryCnv ( )
inlinevirtual

Standard Destructor.

Definition at line 43 of file RootDirectoryCnv.h.

43 { }
Gaudi::RootDirectoryCnv::RootDirectoryCnv ( long  typ,
const CLID clid,
ISvcLocator svc,
RootCnvSvc mgr 
)

Initializing Constructor.

Parameters
typ[IN] Concrete storage type of the converter
clid[IN] Class identifier of the object
svc[IN] Pointer to service locator object
Returns
Reference to RootBaseCnv object
virtual Gaudi::RootDirectoryCnv::~RootDirectoryCnv ( )
inlinevirtual

Standard Destructor.

Definition at line 43 of file RootDirectoryCnv.h.

43 { }

Member Function Documentation

StatusCode RootDirectoryCnv::createObj ( IOpaqueAddress pAddr,
DataObject *&  refpObj 
)
virtual

Converter overrides: Create transient object from persistent data.

Parameters
pAddr[IN] Pointer to object address.
refpObj[OUT] Location to pointer to store data object
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

Reimplemented in Gaudi::RootDatabaseCnv, and Gaudi::RootDatabaseCnv.

Definition at line 39 of file RootDirectoryCnv.cpp.

39  {
40  refpObj = new NTuple::Directory();
41  return StatusCode::SUCCESS;
42 }
Small class representing an N tuple directory in the transient store.
Definition: NTuple.h:1068
virtual StatusCode Gaudi::RootDirectoryCnv::createObj ( IOpaqueAddress pAddr,
DataObject *&  refpObj 
)
virtual

Converter overrides: Create transient object from persistent data.

Parameters
pAddr[IN] Pointer to object address.
refpObj[OUT] Location to pointer to store data object
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

Reimplemented in Gaudi::RootDatabaseCnv, and Gaudi::RootDatabaseCnv.

StatusCode RootDirectoryCnv::createRep ( DataObject pObj,
IOpaqueAddress *&  refpAddr 
)
virtual

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

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

Definition at line 46 of file RootDirectoryCnv.cpp.

46  {
47  string dsc;
48  if ( objType() == CLID_StatisticsDirectory ) {
49  dsc = "Directory containing statistics results.";
50  }
51  else if ( objType() == CLID_StatisticsFile ) {
52  dsc = "File containing statistics results.";
53  }
54  else {
55  return StatusCode::FAILURE;
56  }
57  string ident = containerName(pObj->registry());
58  string path = fileName(pObj->registry());
59  return saveDescription(path, ident, dsc, ident, objType());
60 }
list path
Definition: __init__.py:15
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
virtual const std::string fileName(IRegistry *pReg) const
Retrieve the name of the file a given object is placed into.
Definition: RootStatCnv.cpp:67
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.
virtual const std::string containerName(IRegistry *pDir) const
Retrieve the name of the container a given object is placed into.
Definition: RootStatCnv.cpp:50
const CLID & objType() const override
Retrieve the class type of objects the converter produces.
Definition: Converter.cpp:14
virtual StatusCode Gaudi::RootDirectoryCnv::createRep ( DataObject pObj,
IOpaqueAddress *&  refpAddr 
)
virtual

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

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

StatusCode RootDirectoryCnv::fillObjRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Resolve the references of the transient object.

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

Definition at line 63 of file RootDirectoryCnv.cpp.

63  {
64  return updateObjRefs(pAddr, pObj);
65 }
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddr, DataObject *pObj)
Converter overrides: Update the references of an updated transient object.
virtual StatusCode Gaudi::RootDirectoryCnv::fillObjRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Resolve the references of the transient object.

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

StatusCode RootDirectoryCnv::fillRepRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Fill references of persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

Definition at line 190 of file RootDirectoryCnv.cpp.

192 {
193  return StatusCode::SUCCESS;
194 }
virtual StatusCode Gaudi::RootDirectoryCnv::fillRepRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Fill references of persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Reimplemented from Gaudi::RootConverter.

virtual StatusCode Gaudi::RootDirectoryCnv::updateObj ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update transient object from persistent data.

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.
StatusCode RootDirectoryCnv::updateObj ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update transient object from persistent data.

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.

Definition at line 166 of file RootDirectoryCnv.cpp.

168 {
169  return StatusCode::SUCCESS;
170 }
StatusCode RootDirectoryCnv::updateObjRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

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

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.

Definition at line 69 of file RootDirectoryCnv.cpp.

71 {
72  typedef vector<RootNTupleDescriptor*> REFS;
73  REFS refs;
75  if ( pAddr ) {
76  IRegistry* pReg = pAddr->registry();
77  if ( pReg ) {
78  typedef vector<IRegistry*> Leaves;
79  string ident = pReg->identifier();
80  string fname = fileName(pReg);
81  string cntName = containerName(pReg);
82  RootDataConnection* con = 0;
83  Leaves leaves;
84  status = m_dbMgr->connectDatabase(fname, IDataConnection::READ, &con);
85  if ( status.isSuccess() ) {
86  TBranch* b = con->getBranch("##Descriptors","GaudiStatisticsDescription");
87  if ( b ) {
88  for(Long64_t n=b->GetEntries(), i=0; i<n; ++i) {
89  RootNTupleDescriptor* ref=0;
90  b->SetAddress(&ref);
91  int nb = b->GetEntry(i);
92  if ( nb > 1 ) {
93  string s = ref->container.substr(0,cntName.length());
94  log() << MSG::VERBOSE << "Read description:" << ref->container
95  << " " << ident << " " << cntName << endmsg;
96  if ( s == cntName ) {
97  if ( ref->container.length() >= cntName.length()+1 ) {
98  if ( ref->container.find('/',cntName.length()+1) == string::npos ) {
99  refs.push_back(ref);
100  continue;
101  }
102  }
103  }
104  }
105  delete ref;
106  }
107  }
108  log() << MSG::DEBUG << "Got " << refs.size() << " tuple connection(s)....." << endmsg;
109  status = m_dataMgr->objectLeaves(pObject, leaves);
110  if ( status.isSuccess() ) {
111  for(auto& ref : refs ) {
112  if ( ref ) {
113  bool need_to_add = std::none_of( std::begin(leaves), std::end(leaves),
114  [&](Leaves::const_reference j) {
115  return containerName(j) == ref->container;
116  });
117  if ( need_to_add ) {
118  IOpaqueAddress* pA= nullptr;
119  if ( ref->clid == CLID_StatisticsDirectory ||
120  ref->clid == CLID_StatisticsFile ||
121  ref->clid == CLID_RowWiseTuple ||
122  ref->clid == CLID_ColumnWiseTuple )
123  {
124  string spar[] = { fname, ref->container};
125  unsigned long ipar[] = { ~0x0UL, ~0x0UL };
126  status = m_dbMgr->createAddress(repSvcType(),
127  ref->clid,
128  spar,
129  ipar,
130  pA);
131  }
132  if ( status.isSuccess() ) {
133  string top = topLevel(pReg);
134  string leaf_name = top + ref->container.substr(7);
135  status = m_dataMgr->registerAddress(leaf_name, pA);
136  if ( status.isSuccess() ) {
137  log() << MSG::DEBUG << "Created address for " << leaf_name
138  << " of type " << ref->clid << endmsg;
139  continue;
140  }
141  makeError("Failed to register leaves to directory:"+ident,false).ignore();
142  break;
143  }
144  makeError("Failed to create leave address to directory:"+ident,false).ignore();
145  break;
146  }
147  }
148  makeError("Failed to add leaves to directory:"+ident,false).ignore();
149  break;
150  }
151  }
152  }
153  else {
154  return makeError("Failed to access required tuple data description.",false);
155  }
156  }
157  }
158  for(REFS::iterator k = refs.begin(); k != refs.end(); ++k) {
159  if ( *k ) delete (*k);
160  }
161  return status;
162 }
MsgStream & log() const
Helper to use mesage logger.
Definition: RootStatCnv.h:38
virtual const std::string topLevel(IRegistry *pReg) const
Retrieve the full path of the file a given object is placed into.
Definition: RootStatCnv.cpp:81
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
IAddressCreator implementation: Address creation.
Definition: RootCnvSvc.cpp:390
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode makeError(const std::string &msg, bool throw_exception=false) const
Helper method to issue error messages.
Definition: RootStatCnv.cpp:97
SmartIF< IDataManagerSvc > m_dataMgr
Reference to data manager service to manipulate the TES.
Definition: RootStatCnv.h:33
virtual IRegistry * registry() const =0
Update branch name.
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual const std::string fileName(IRegistry *pReg) const
Retrieve the name of the file a given object is placed into.
Definition: RootStatCnv.cpp:67
TBranch * getBranch(const std::string &section, const std::string &branch_name)
Access data branch by name: Get existing branch in read only mode.
virtual long repSvcType() const
Retrieve the class type of the data store the converter uses.
Definition: RootConverter.h:54
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
RootCnvSvc * m_dbMgr
Conversion service needed for proper operation to forward requests.
Definition: RootConverter.h:36
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by its ...
StatusCode connectDatabase(const std::string &dataset, int mode, RootDataConnection **con)
Connect the output file to the service with open mode.
std::string container
Identifier of description.
Definition: RootRefs.h:104
string s
Definition: gaudirun.py:246
virtual const id_type & identifier() const =0
Full identifier (or key)
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
unsigned long clid
Class ID of the described object.
Definition: RootRefs.h:106
Opaque address interface definition.
void ignore() const
Definition: StatusCode.h:108
virtual const std::string containerName(IRegistry *pDir) const
Retrieve the name of the container a given object is placed into.
Definition: RootStatCnv.cpp:50
list i
Definition: ana.py:128
Concrete implementation of the IDataConnection interface to access ROOT files.
virtual StatusCode Gaudi::RootDirectoryCnv::updateObjRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

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

Parameters
pAddr[IN] Pointer to object address.
pObj[IN] Pointer to data object
Returns
Status code indicating success or failure.
StatusCode RootDirectoryCnv::updateRep ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Definition at line 174 of file RootDirectoryCnv.cpp.

176 {
177  return StatusCode::SUCCESS;
178 }
virtual StatusCode Gaudi::RootDirectoryCnv::updateRep ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.
virtual StatusCode Gaudi::RootDirectoryCnv::updateRepRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update references of persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.
StatusCode RootDirectoryCnv::updateRepRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Converter overrides: Update references of persistent object representation.

Parameters
pObj[IN] Pointer to data object
refpAddr[OUT] Location to store pointer to object address.
Returns
Status code indicating success or failure.

Definition at line 182 of file RootDirectoryCnv.cpp.

184 {
185  return StatusCode::SUCCESS;
186 }

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