Gaudi::RootCnvSvc Class Reference

Description: More...

#include <src/RootCnvSvc.h>

Inheritance diagram for Gaudi::RootCnvSvc:
Collaboration diagram for Gaudi::RootCnvSvc:

Public Member Functions

 RootCnvSvc (const std::string &name, ISvcLocator *svc)
 Standard constructor. More...
 
virtual ~RootCnvSvc ()
 Standard destructor. More...
 
virtual StatusCode updateServiceState (IOpaqueAddress *)
 Update state of the service. More...
 
StatusCode error (const std::string &msg)
 Standard way to print errors. More...
 
StatusCode connectDatabase (const std::string &dataset, int mode, RootDataConnection **con)
 Connect the output file to the service with open mode. More...
 
virtual StatusCode initialize ()
 ConversionSvc overload: initialize Db service. More...
 
virtual StatusCode finalize ()
 ConversionSvc overload: Finalize Db service. More...
 
virtual IConvertercreateConverter (long typ, const CLID &wanted, const ICnvFactory *fac)
 ConversionSvc overload: Create new Converter using factory. More...
 
virtual void loadConverter (DataObject *pObj)
 ConversionSvc overload: Load the class (dictionary) for the converter. More...
 
virtual StatusCode connectOutput (const std::string &outputFile, const std::string &openMode)
 Connect the output file to the service with open mode. More...
 
virtual StatusCode connectOutput (const std::string &outputFile)
 Connect the output file to the service. More...
 
virtual StatusCode commitOutput (const std::string &outputFile, bool do_commit)
 Commit pending output. More...
 
virtual StatusCode disconnect (const std::string &dbName)
 Disconnect from an existing data stream. More...
 
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
 IAddressCreator implementation: Address creation. More...
 
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress)
 IAddressCreator implementation: Creates an address in string form to object form. More...
 
virtual StatusCode createNullRep (const std::string &path)
 Insert null marker for not existent transient object. More...
 
virtual StatusCode createNullRef (const std::string &path)
 Insert null marker for not existent transient object. More...
 
virtual StatusCode i__createRep (DataObject *pObj, IOpaqueAddress *&refpAddr)
 Convert the transient object to the requested persistent representation. More...
 
virtual StatusCode i__fillRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Resolve the references of the converted object. More...
 
virtual StatusCode i__createObj (IOpaqueAddress *pAddr, DataObject *&refpObj)
 Create transient object from persistent data. More...
 
virtual StatusCode i__fillObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Resolve the references of the created transient object. More...
 
 RootCnvSvc (const std::string &name, ISvcLocator *svc)
 Standard constructor. More...
 
virtual ~RootCnvSvc ()
 Standard destructor. More...
 
virtual StatusCode updateServiceState (IOpaqueAddress *)
 Update state of the service. More...
 
StatusCode error (const std::string &msg)
 Standard way to print errors. More...
 
StatusCode connectDatabase (const std::string &dataset, int mode, RootDataConnection **con)
 Connect the output file to the service with open mode. More...
 
virtual StatusCode initialize ()
 ConversionSvc overload: initialize Db service. More...
 
virtual StatusCode finalize ()
 ConversionSvc overload: Finalize Db service. More...
 
virtual IConvertercreateConverter (long typ, const CLID &wanted, const ICnvFactory *fac)
 ConversionSvc overload: Create new Converter using factory. More...
 
virtual void loadConverter (DataObject *pObj)
 ConversionSvc overload: Load the class (dictionary) for the converter. More...
 
virtual StatusCode connectOutput (const std::string &outputFile, const std::string &openMode)
 Connect the output file to the service with open mode. More...
 
virtual StatusCode connectOutput (const std::string &outputFile)
 Connect the output file to the service. More...
 
virtual StatusCode commitOutput (const std::string &outputFile, bool do_commit)
 Commit pending output. More...
 
virtual StatusCode disconnect (const std::string &dbName)
 Disconnect from an existing data stream. More...
 
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
 IAddressCreator implementation: Address creation. More...
 
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress)
 IAddressCreator implementation: Creates an address in string form to object form. More...
 
virtual StatusCode createNullRep (const std::string &path)
 Insert null marker for not existent transient object. More...
 
virtual StatusCode createNullRef (const std::string &path)
 Insert null marker for not existent transient object. More...
 
virtual StatusCode i__createRep (DataObject *pObj, IOpaqueAddress *&refpAddr)
 Convert the transient object to the requested persistent representation. More...
 
virtual StatusCode i__fillRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Resolve the references of the converted object. More...
 
virtual StatusCode i__createObj (IOpaqueAddress *pAddr, DataObject *&refpObj)
 Create transient object from persistent data. More...
 
virtual StatusCode i__fillObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Resolve the references of the created transient object. More...
 
- Public Member Functions inherited from ConversionSvc
virtual long repSvcType () const
 Retrieve the class type of the data store the converter uses. More...
 
const CLIDobjType () const
 Implementation of IConverter: dummy call. More...
 
virtual StatusCode setDataProvider (IDataProviderSvc *pService)
 Implementation of IConverter: Set Data provider service. More...
 
virtual SmartIF< IDataProviderSvc > & dataProvider () const
 Implementation of IConverter: Get Data provider service. More...
 
virtual StatusCode setConversionSvc (IConversionSvc *svc)
 Implementation of IConverter: Set conversion service the converter is connected to. More...
 
virtual SmartIF< IConversionSvc > & conversionSvc () const
 Implementation of IConverter: Get conversion service the converter is connected to. More...
 
virtual StatusCode setAddressCreator (IAddressCreator *creator)
 Set address creator facility. More...
 
virtual SmartIF< IAddressCreator > & addressCreator () const
 Retrieve address creator facility. More...
 
virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject)
 Implementation of IConverter: Create the transient representation of an object. More...
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Resolve the references of the created transient object. More...
 
virtual StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject)
 Implementation of IConverter: Update the transient object from the other representation. More...
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Update the references of an updated transient object. More...
 
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Implementation of IConverter: Convert the transient object to the requested representation. More...
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Resolve the references of the converted object. More...
 
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Update the converted representation of a transient object. More...
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Update the references of an already converted object. More...
 
virtual StatusCode addConverter (const CLID &clid)
 Add converter object to conversion service. More...
 
virtual StatusCode addConverter (IConverter *pConverter)
 Add converter object to conversion service. More...
 
virtual StatusCode removeConverter (const CLID &clid)
 Remove converter object from conversion service (if present). More...
 
virtual IConverterconverter (const CLID &wanted)
 Retrieve converter from list. More...
 
virtual StatusCode convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress)
 Convert an address to string form. More...
 
 ConversionSvc (const std::string &name, ISvcLocator *svc, long type)
 Standard Constructor. More...
 
virtual long repSvcType () const
 Retrieve the class type of the data store the converter uses. More...
 
const CLIDobjType () const
 Implementation of IConverter: dummy call. More...
 
virtual StatusCode setDataProvider (IDataProviderSvc *pService)
 Implementation of IConverter: Set Data provider service. More...
 
virtual SmartIF< IDataProviderSvc > & dataProvider () const
 Implementation of IConverter: Get Data provider service. More...
 
virtual StatusCode setConversionSvc (IConversionSvc *svc)
 Implementation of IConverter: Set conversion service the converter is connected to. More...
 
virtual SmartIF< IConversionSvc > & conversionSvc () const
 Implementation of IConverter: Get conversion service the converter is connected to. More...
 
virtual StatusCode setAddressCreator (IAddressCreator *creator)
 Set address creator facility. More...
 
virtual SmartIF< IAddressCreator > & addressCreator () const
 Retrieve address creator facility. More...
 
virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject)
 Implementation of IConverter: Create the transient representation of an object. More...
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Resolve the references of the created transient object. More...
 
virtual StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject)
 Implementation of IConverter: Update the transient object from the other representation. More...
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Update the references of an updated transient object. More...
 
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Implementation of IConverter: Convert the transient object to the requested representation. More...
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Resolve the references of the converted object. More...
 
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Update the converted representation of a transient object. More...
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Implementation of IConverter: Update the references of an already converted object. More...
 
virtual StatusCode addConverter (const CLID &clid)
 Add converter object to conversion service. More...
 
virtual StatusCode addConverter (IConverter *pConverter)
 Add converter object to conversion service. More...
 
virtual StatusCode removeConverter (const CLID &clid)
 Remove converter object from conversion service (if present). More...
 
virtual IConverterconverter (const CLID &wanted)
 Retrieve converter from list. More...
 
virtual StatusCode convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress)
 Convert an address to string form. More...
 
 ConversionSvc (const std::string &name, ISvcLocator *svc, long type)
 Standard Constructor. More...
 
- Public Member Functions inherited from extends< BASE, 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...
 
 ~extends () override=default
 Virtual destructor. 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...
 
 ~extends () override=default
 Virtual destructor. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Protected Member Functions

TClass * getClass (DataObject *pObject)
 Helper: Get TClass for a given DataObject pointer. More...
 
MsgStreamlog () const
 Helper: Use message streamer. More...
 
TClass * getClass (DataObject *pObject)
 Helper: Get TClass for a given DataObject pointer. More...
 
MsgStreamlog () const
 Helper: Use message streamer. More...
 
- Protected Member Functions inherited from ConversionSvc
virtual ~ConversionSvc ()
 Standard Destructor. More...
 
virtual StatusCode configureConverter (long typ, const CLID &clid, IConverter *cnv)
 Configure the new converter before initialize is called. More...
 
virtual StatusCode initializeConverter (long typ, const CLID &clid, IConverter *cnv)
 Initialize the new converter. More...
 
virtual StatusCode activateConverter (long typ, const CLID &clid, IConverter *cnv)
 Activate the new converter after initialization. More...
 
virtual SmartIF< IAddressCreator > & addressCreator ()
 Retrieve address creation interface. More...
 
StatusCode makeCall (int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
 
virtual ~ConversionSvc ()
 Standard Destructor. More...
 
virtual StatusCode configureConverter (long typ, const CLID &clid, IConverter *cnv)
 Configure the new converter before initialize is called. More...
 
virtual StatusCode initializeConverter (long typ, const CLID &clid, IConverter *cnv)
 Initialize the new converter. More...
 
virtual StatusCode activateConverter (long typ, const CLID &clid, IConverter *cnv)
 Activate the new converter after initialization. More...
 
virtual SmartIF< IAddressCreator > & addressCreator ()
 Retrieve address creation interface. More...
 
StatusCode makeCall (int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
 

Protected Attributes

SmartIF< Gaudi::IIODataManagerm_ioMgr
 Reference to the I/O data manager. More...
 
SmartIF< IIncidentSvcm_incidentSvc
 Reference to incident service. More...
 
Gaudi::RootDataConnectionm_current = nullptr
 On writing: reference to active output stream. More...
 
TClass * m_classRefs
 TClass pointer to reference class. More...
 
TClass * m_classDO
 TClass pointer to DataObject class. More...
 
RootConnectionSetupm_setup = nullptr
 Setup structure (ref-counted) and passed to data connections. More...
 
std::string m_currSection
 Property: ROOT section name. More...
 
bool m_incidentEnabled
 Property: Flag to enable incidents on FILE_OPEN. More...
 
std::string m_shareFiles
 Property: Share files ? If set to YES, files will not be closed on finalize. More...
 
std::string m_recordName
 Property: Records name to fire incident for file records. More...
 
std::string m_ioPerfStats
 Property: Enable TTree IOperfStats if not empty; otherwise perf stat file name. More...
 
std::string m_compression
 Property: Compression-algorithm:compression-level. More...
 
int m_autoFlush
 Property: AutoFlush parameter for ROOT TTree (Number of events between auto flushes) More...
 
int m_basketSize
 Property: Basket optimization parameter for ROOT TTree (total basket size) More...
 
int m_bufferSize
 Property: Buffer size optimization parameter for ROOT TTree. More...
 
int m_splitLevel
 Property: Split level optimization parameter for ROOT TTree. More...
 
std::set< std::string > m_badFiles
 Set with bad files/tables. More...
 
std::unique_ptr< MsgStreamm_log
 Message streamer. More...
 
- Protected Attributes inherited from ConversionSvc
SmartIF< IDataProviderSvcm_dataSvc
 Pointer to data provider service. More...
 
SmartIF< IAddressCreatorm_addressCreator
 Pointer to the address creation service interface. More...
 
SmartIF< IConversionSvcm_cnvSvc
 Pointer to the IConversionSvc interface of this. More...
 
long m_type
 Conversion service type. More...
 
std::vector< WorkerEntrym_workers
 List of conversion workers. More...
 

Additional Inherited Members

- Public Types inherited from extends< BASE, Interfaces >
typedef extends base_class
 Typedef to this class. More...
 
typedef extend_interfaces< Interfaces...> extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extends base_class
 Typedef to this class. More...
 
typedef extend_interfaces< Interfaces...> extend_interfaces_base
 Typedef to the base of this class. More...
 
- 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...
 

Detailed Description

Description:

RootCnvSvc class implementation definition.

Author
Markus Frank
Version
1.0
Date
20/12/2009

Definition at line 52 of file RootCnvSvc.h.

Constructor & Destructor Documentation

Gaudi::RootCnvSvc::RootCnvSvc ( const std::string &  name,
ISvcLocator svc 
)

Standard constructor.

RootCnvSvc::~RootCnvSvc ( )
virtual

Standard destructor.

Definition at line 76 of file RootCnvSvc.cpp.

76  {
77  if (m_setup) m_setup->release();
78 }
void release()
Decrease reference count.
RootConnectionSetup * m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:66
Gaudi::RootCnvSvc::RootCnvSvc ( const std::string &  name,
ISvcLocator svc 
)

Standard constructor.

virtual Gaudi::RootCnvSvc::~RootCnvSvc ( )
virtual

Standard destructor.

Member Function Documentation

virtual StatusCode Gaudi::RootCnvSvc::commitOutput ( const std::string &  outputFile,
bool  do_commit 
)
virtual

Commit pending output.

Parameters
outputFileString containig output file
do_commitif true commit the output and flush eventually pending items to the database if false, discard pending buffers. Note: The possibility to commit or rollback depends on the database technology used!
Returns
Status code indicating success or failure.

Reimplemented from ConversionSvc.

virtual StatusCode Gaudi::RootCnvSvc::commitOutput ( const std::string &  outputFile,
bool  do_commit 
)
virtual

Commit pending output.

Parameters
outputFileString containig output file
do_commitif true commit the output and flush eventually pending items to the database if false, discard pending buffers. Note: The possibility to commit or rollback depends on the database technology used!
Returns
Status code indicating success or failure.

Reimplemented from ConversionSvc.

StatusCode Gaudi::RootCnvSvc::connectDatabase ( const std::string &  dataset,
int  mode,
RootDataConnection **  con 
)

Connect the output file to the service with open mode.

Parameters
datasetString containig file name
modeString containig opening mode
Returns
Status code indicating success or failure.
StatusCode Gaudi::RootCnvSvc::connectDatabase ( const std::string &  dataset,
int  mode,
RootDataConnection **  con 
)

Connect the output file to the service with open mode.

Parameters
datasetString containig file name
modeString containig opening mode
Returns
Status code indicating success or failure.
virtual StatusCode Gaudi::RootCnvSvc::connectOutput ( const std::string &  outputFile,
const std::string &  openMode 
)
virtual

Connect the output file to the service with open mode.

Parameters
outputFileString containig output file
openModeString containig opening mode of the output file
Returns
Status code indicating success or failure.

Reimplemented from ConversionSvc.

virtual StatusCode Gaudi::RootCnvSvc::connectOutput ( const std::string &  outputFile,
const std::string &  openMode 
)
virtual

Connect the output file to the service with open mode.

Parameters
outputFileString containig output file
openModeString containig opening mode of the output file
Returns
Status code indicating success or failure.

Reimplemented from ConversionSvc.

virtual StatusCode Gaudi::RootCnvSvc::connectOutput ( const std::string &  outputFile)
virtual

Connect the output file to the service.

Parameters
outputFileString containig output file
Returns
Status code indicating success or failure.

Reimplemented from ConversionSvc.

virtual StatusCode Gaudi::RootCnvSvc::connectOutput ( const std::string &  outputFile)
virtual

Connect the output file to the service.

Parameters
outputFileString containig output file
Returns
Status code indicating success or failure.

Reimplemented from ConversionSvc.

virtual StatusCode Gaudi::RootCnvSvc::createAddress ( long  svc_type,
const CLID clid,
const std::string *  par,
const unsigned long *  ip,
IOpaqueAddress *&  refpAddress 
)
virtual

IAddressCreator implementation: Address creation.

Create an address using the link infotmation together with the triple (database name/container name/object name).

Parameters
refLinkReference to abstract link information
dbNameDatabase name
containerNameObject container name
refpAddressOpaque address information to retrieve object
Returns
StatusCode indicating SUCCESS or failure

Reimplemented from ConversionSvc.

StatusCode RootCnvSvc::createAddress ( long  svc_type,
const CLID clid,
const std::string *  par,
const unsigned long *  ip,
IOpaqueAddress *&  refpAddress 
)
virtual

IAddressCreator implementation: Address creation.

Create an address using the link infotmation together with the triple (database name/container name/object name).

Parameters
refLinkReference to abstract link information
dbNameDatabase name
containerNameObject container name
refpAddressOpaque address information to retrieve object
Returns
StatusCode indicating SUCCESS or failure

Reimplemented from ConversionSvc.

Definition at line 390 of file RootCnvSvc.cpp.

395 {
396  refpAddress = new RootAddress(typ,clid,par[0],par[1],ip[0],ip[1]);
397  return S_OK;
398 }
Description:
Definition: RootAddress.h:36
#define S_OK
Definition: RootCnvSvc.cpp:38
virtual StatusCode Gaudi::RootCnvSvc::createAddress ( long  svc_type,
const CLID clid,
const std::string &  refAddress,
IOpaqueAddress *&  refpAddress 
)
inlinevirtual

IAddressCreator implementation: Creates an address in string form to object form.

Parameters
svc_typeTechnology identifier encapsulated in this address.
clidClass identifier of the DataObject represented by the opaque address
addressInput address.
refpAddressOutput address in string form.
Returns
Status code indicating success or failure.

Reimplemented from ConversionSvc.

Definition at line 204 of file RootCnvSvc.h.

207  {
208  return this->ConversionSvc::createAddress(svc_type,clid,refAddress,refpAddress);
209  }
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
Create a Generic address using explicit arguments to identify a single object.
virtual StatusCode Gaudi::RootCnvSvc::createAddress ( long  svc_type,
const CLID clid,
const std::string &  refAddress,
IOpaqueAddress *&  refpAddress 
)
inlinevirtual

IAddressCreator implementation: Creates an address in string form to object form.

Parameters
svc_typeTechnology identifier encapsulated in this address.
clidClass identifier of the DataObject represented by the opaque address
addressInput address.
refpAddressOutput address in string form.
Returns
Status code indicating success or failure.

Reimplemented from ConversionSvc.

Definition at line 204 of file RootCnvSvc.h.

207  {
208  return this->ConversionSvc::createAddress(svc_type,clid,refAddress,refpAddress);
209  }
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
Create a Generic address using explicit arguments to identify a single object.
IConverter * RootCnvSvc::createConverter ( long  typ,
const CLID wanted,
const ICnvFactory *  fac 
)
virtual

ConversionSvc overload: Create new Converter using factory.

Reimplemented from ConversionSvc.

Definition at line 157 of file RootCnvSvc.cpp.

157  {
158  if ( wanted == CLID_StatisticsFile )
159  return new RootDatabaseCnv(typ,wanted,serviceLocator().get(),this);
160  else if ( wanted == CLID_StatisticsDirectory )
161  return new RootDirectoryCnv(typ,wanted,serviceLocator().get(),this);
162  else if ( wanted == CLID_RowWiseTuple )
163  return new RootNTupleCnv(typ,wanted,serviceLocator().get(),this);
164  else if ( wanted == CLID_ColumnWiseTuple )
165  return new RootNTupleCnv(typ,wanted,serviceLocator().get(),this);
166  else
167  return new RootConverter(typ,wanted,serviceLocator().get(),this);
168 }
Statistics file converter class definition.
NTuple converter class definition for NTuples writted/read using ROOT.
Definition: RootNTupleCnv.h:34
Description: NTuple directory converter class definition Definition of the converter to manage the di...
Description: Definition of the ROOT data converter.
Definition: RootConverter.h:32
virtual IConverter* Gaudi::RootCnvSvc::createConverter ( long  typ,
const CLID wanted,
const ICnvFactory *  fac 
)
virtual

ConversionSvc overload: Create new Converter using factory.

Reimplemented from ConversionSvc.

StatusCode RootCnvSvc::createNullRef ( const std::string &  path)
virtual

Insert null marker for not existent transient object.

Parameters
path[IN] Path to the (null-)object
Returns
Status code indicating success or failure.

Definition at line 409 of file RootCnvSvc.cpp.

409  {
410  RootObjectRefs* refs = 0;
411  size_t len = path.find('/',1);
412  string section = path.substr(1,len==string::npos ? string::npos : len-1);
413  pair<int,unsigned long> ret =
414  m_current->save(section,path+"#R",0,refs,m_bufferSize,m_splitLevel);
415  if( log().level() <= MSG::VERBOSE )
416  log() << MSG::VERBOSE << "Writing object:" << path << " "
417  << ret.first << " " << hex << ret.second << dec << " [NULL]" << endmsg;
418  return S_OK;
419 }
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
std::pair< int, unsigned long > save(const std::string &section, const std::string &cnt, TClass *cl, void *pObj, int buff_siz, int split_lvl, bool fill_missing=false)
Save object of a given class to section and container.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:60
list path
Definition: __init__.py:15
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject...
Definition: RootRefs.h:71
int m_splitLevel
Property: Split level optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:88
#define S_OK
Definition: RootCnvSvc.cpp:38
int m_bufferSize
Property: Buffer size optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:86
virtual StatusCode Gaudi::RootCnvSvc::createNullRef ( const std::string &  path)
virtual

Insert null marker for not existent transient object.

Parameters
path[IN] Path to the (null-)object
Returns
Status code indicating success or failure.
StatusCode RootCnvSvc::createNullRep ( const std::string &  path)
virtual

Insert null marker for not existent transient object.

Parameters
path[IN] Path to the (null-)object
Returns
Status code indicating success or failure.

Definition at line 401 of file RootCnvSvc.cpp.

401  {
402  size_t len = path.find('/',1);
403  string section = path.substr(1,len==string::npos ? string::npos : len-1);
405  return S_OK;
406 }
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:60
list path
Definition: __init__.py:15
int m_splitLevel
Property: Split level optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:88
#define S_OK
Definition: RootCnvSvc.cpp:38
std::pair< int, unsigned long > saveObj(const std::string &section, const std::string &cnt, TClass *cl, DataObject *pObj, int buff_siz, int split_lvl, bool fill_missing=false)
Save object of a given class to section and container.
int m_bufferSize
Property: Buffer size optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:86
virtual StatusCode Gaudi::RootCnvSvc::createNullRep ( const std::string &  path)
virtual

Insert null marker for not existent transient object.

Parameters
path[IN] Path to the (null-)object
Returns
Status code indicating success or failure.
virtual StatusCode Gaudi::RootCnvSvc::disconnect ( const std::string &  dbName)
virtual

Disconnect from an existing data stream.

Parameters
dbNameString containing name of the database
Returns
Status code indicating success or failure.
virtual StatusCode Gaudi::RootCnvSvc::disconnect ( const std::string &  dbName)
virtual

Disconnect from an existing data stream.

Parameters
dbNameString containing name of the database
Returns
Status code indicating success or failure.
StatusCode Gaudi::RootCnvSvc::error ( const std::string &  msg)

Standard way to print errors.

after the printout an exception is thrown.

Parameters
msg[IN] Message string to be printed.
Returns
Status code returning failure.
StatusCode Gaudi::RootCnvSvc::error ( const std::string &  msg)

Standard way to print errors.

after the printout an exception is thrown.

Parameters
msg[IN] Message string to be printed.
Returns
Status code returning failure.
StatusCode RootCnvSvc::finalize ( )
virtual

ConversionSvc overload: Finalize Db service.

Reimplemented from ConversionSvc.

Definition at line 126 of file RootCnvSvc.cpp.

126  {
127  log() << MSG::INFO;
128  if ( m_ioMgr ) {
129  IIODataManager::Connections cons = m_ioMgr->connections(0);
130  for(auto &i : cons ) {
131  auto pc = dynamic_cast<RootDataConnection*>(i);
132  if ( pc ) {
133  if ( pc->owner() == this && !m_ioPerfStats.empty() ) {
134  pc->saveStatistics(m_ioPerfStats);
135  }
136  if ( pc->lookupClient(this) ) {
137  size_t num_clients = pc->removeClient(this);
138  if ( num_clients == 0 ) {
139  if ( m_ioMgr->disconnect(pc).isSuccess() ) {
140  log() << "Disconnected data IO:" << pc->fid()
141  << " [" << pc->pfn() << "]" << endmsg;
142  delete pc;
143  }
144  }
145  }
146  }
147  }
148  m_ioMgr.reset();
149  }
150  m_log.reset();
152  m_setup->setIncidentSvc(nullptr);
153  return ConversionSvc::finalize();
154 }
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94
std::vector< Connection * > Connections
constexpr double pc
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:56
virtual StatusCode finalize()
stop the service.
RootConnectionSetup * m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:66
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootCnvSvc.h:58
std::string m_ioPerfStats
Property: Enable TTree IOperfStats if not empty; otherwise perf stat file name.
Definition: RootCnvSvc.h:77
void setIncidentSvc(IIncidentSvc *m)
Set incident service reference.
list i
Definition: ana.py:128
Concrete implementation of the IDataConnection interface to access ROOT files.
virtual StatusCode Gaudi::RootCnvSvc::finalize ( )
virtual

ConversionSvc overload: Finalize Db service.

Reimplemented from ConversionSvc.

TClass * RootCnvSvc::getClass ( DataObject pObject)
protected

Helper: Get TClass for a given DataObject pointer.

Definition at line 188 of file RootCnvSvc.cpp.

188  {
189  auto i=s_classesClids.find(pObject->clID());
190  if ( i != s_classesClids.end() ) return i->second;
191  loadConverter(pObject);
192  i=s_classesClids.find(pObject->clID());
193  if ( i != s_classesClids.end() ) return i->second;
194 
195  string cname = System::typeinfoName(typeid(*pObject));
196  throw runtime_error("Unknown ROOT class for object:"+cname);
197  return nullptr;
198 }
virtual void loadConverter(DataObject *pObj)
ConversionSvc overload: Load the class (dictionary) for the converter.
Definition: RootCnvSvc.cpp:171
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:68
list i
Definition: ana.py:128
TClass* Gaudi::RootCnvSvc::getClass ( DataObject pObject)
protected

Helper: Get TClass for a given DataObject pointer.

virtual StatusCode Gaudi::RootCnvSvc::i__createObj ( IOpaqueAddress pAddr,
DataObject *&  refpObj 
)
virtual

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.
StatusCode RootCnvSvc::i__createObj ( IOpaqueAddress pAddr,
DataObject *&  refpObj 
)
virtual

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.

Definition at line 486 of file RootCnvSvc.cpp.

486  {
487  refpObj = nullptr;
488  if ( pA ) {
489  RootDataConnection* con = nullptr;
490  const string* par = pA->par();
491  unsigned long* ipar = const_cast<unsigned long*>(pA->ipar());
493  if ( sc.isSuccess() ) {
494  ipar[0] = (unsigned long)con;
495  DataObject* pObj = 0;
496  size_t len = par[1].find('/',1);
497  string section = par[1].substr(1,len==string::npos ? string::npos : len-1);
498 
499  int nb = con->loadObj(section,par[1],ipar[1],pObj);
500  if ( nb > 1 || (nb == 1 && pObj->clID() == CLID_DataObject) ) {
501  refpObj = pObj;
502  return S_OK;
503  }
504  delete pObj;
505  }
506  string tag = par[0]+":"+par[1];
507  if ( m_badFiles.find(tag) == m_badFiles.end() ) {
508  m_badFiles.insert(tag);
509  return error("createObj> Cannot access the object:"+tag);
510  }
511  return S_FAIL;
512  }
513  return S_FAIL;
514 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
int loadObj(const std::string &section, const std::string &cnt, unsigned long entry, DataObject *&pObj)
Load object.
std::set< std::string > m_badFiles
Set with bad files/tables.
Definition: RootCnvSvc.h:91
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:68
StatusCode error(const std::string &msg)
Standard way to print errors.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
#define S_OK
Definition: RootCnvSvc.cpp:38
StatusCode connectDatabase(const std::string &dataset, int mode, RootDataConnection **con)
Connect the output file to the service with open mode.
#define S_FAIL
Definition: RootCnvSvc.cpp:39
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
Concrete implementation of the IDataConnection interface to access ROOT files.
virtual StatusCode Gaudi::RootCnvSvc::i__createRep ( DataObject pObj,
IOpaqueAddress *&  refpAddr 
)
virtual

Convert the transient object to the requested persistent 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 RootCnvSvc::i__createRep ( DataObject pObj,
IOpaqueAddress *&  refpAddr 
)
virtual

Convert the transient object to the requested persistent 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 422 of file RootCnvSvc.cpp.

422  {
423  refpAddr = 0;
424  if ( pObj ) {
425  CLID clid = pObj->clID();
426  IRegistry* pR = pObj->registry();
427  string p[2] = {m_current->fid(), pR->identifier()};
428  TClass* cl = (clid == CLID_DataObject) ? m_classDO : getClass(pObj);
429  size_t len = p[1].find('/',1);
430  string sect = p[1].substr(1,len==string::npos ? string::npos : len-1);
431  pair<int,unsigned long> ret =
432  m_current->saveObj(sect,p[1],cl,pObj,m_bufferSize,m_splitLevel,true);
433  if ( ret.first > 1 || (clid == CLID_DataObject && ret.first==1) ) {
434  unsigned long ip[2] = {0,ret.second};
435  if ( m_currSection.empty() ) m_currSection = p[1];
436  return createAddress(repSvcType(),clid,p,ip,refpAddr);
437  }
438  return error("Failed to write object data for:"+p[1]);
439  }
440  return error("createRep> Current Database is invalid!");
441 }
const std::string & fid() const
Access file id.
std::string m_currSection
Property: ROOT section name.
Definition: RootCnvSvc.h:68
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
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:60
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
int m_splitLevel
Property: Split level optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:88
virtual long repSvcType() const
Retrieve the class type of the data store the converter uses.
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:68
StatusCode error(const std::string &msg)
Standard way to print errors.
TClass * m_classDO
TClass pointer to DataObject class.
Definition: RootCnvSvc.h:64
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
std::pair< int, unsigned long > saveObj(const std::string &section, const std::string &cnt, TClass *cl, DataObject *pObj, int buff_siz, int split_lvl, bool fill_missing=false)
Save object of a given class to section and container.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
virtual const id_type & identifier() const =0
Full identifier (or key)
int m_bufferSize
Property: Buffer size optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:86
TClass * getClass(DataObject *pObject)
Helper: Get TClass for a given DataObject pointer.
Definition: RootCnvSvc.cpp:188
virtual StatusCode Gaudi::RootCnvSvc::i__fillObjRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Resolve the references of the created transient object.

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

Resolve the references of the created 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 517 of file RootCnvSvc.cpp.

517  {
518  if ( pA && pObj ) {
519  const unsigned long* ipar = pA->ipar();
520  RootDataConnection* con = (RootDataConnection*)ipar[0];
521  if ( con ) {
522  RootObjectRefs refs;
523  const string* par = pA->par();
524  size_t len = par[1].find('/',1);
525  string section = par[1].substr(1,len==string::npos ? string::npos : len-1);
526  int nb = con->loadRefs(section,par[1],ipar[1],refs);
527  if ( nb >= 1 ) {
528  string npar[3];
529  unsigned long nipar[2];
530  IOpaqueAddress* nPA;
531  IRegistry* pR = pObj->registry();
532  auto dataMgr = SmartIF<IDataManagerSvc>{ pR->dataSvc() };
533  LinkManager* mgr = pObj->linkMgr();
534  for(const auto& i : refs.links ) mgr->addLink(con->getLink(i),nullptr);
535  for(size_t j=0, n=refs.refs.size(); j<n; ++j) {
536  const RootRef& r = refs.refs[j];
537  npar[0] = con->getDb(r.dbase);
538  npar[1] = con->getCont(r.container);
539  npar[2] = con->getLink(r.link);
540  nipar[0] = 0;
541  nipar[1] = r.entry;
542  StatusCode sc = addressCreator()->createAddress(r.svc,r.clid,npar,nipar,nPA);
543  if ( sc.isSuccess() ) {
544  if( log().level() <= MSG::VERBOSE )
545  log() << MSG::VERBOSE << dataMgr.as<IService>()->name()
546  << " -> Register:" << pA->registry()->identifier()
547  << "#" << npar[2] << "[" << r.entry << "]" << endmsg;
548  sc = dataMgr->registerAddress(pA->registry(),npar[2],nPA);
549  if ( sc.isSuccess() ) {
550  continue;
551  }
552  }
553  log() << MSG::ERROR << con->fid() << ": Failed to create address!!!!" << endmsg;
554  return S_FAIL;
555  }
556  return pObj->update();
557  }
558  else if ( nb < 0 ) {
559  string tag = par[0]+":"+par[1];
560  if ( m_badFiles.find(tag) == m_badFiles.end() ) {
561  m_badFiles.insert(tag);
562  return error("createObj> Cannot access the object:"+tag+" [Corrupted file]");
563  }
564  }
565  }
566  return S_FAIL;
567  }
568  return error("read> Cannot read object -- no valid object address present ");
569 }
virtual StatusCode update()
Provide empty placeholder for internal object reconfiguration callback.
Definition: DataObject.cpp:83
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
const std::string & fid() const
Access file id.
MSG::Level level()
Retrieve output level.
Definition: MsgStream.h:112
const std::string & getDb(int which) const
Access database/file name from saved index.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ipar, IOpaqueAddress *&refpAddress)=0
Create a Generic address using explicit arguments to identify a single object.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::set< std::string > m_badFiles
Set with bad files/tables.
Definition: RootCnvSvc.h:91
const std::string & getLink(int which) const
Access link name from saved index.
std::vector< int > links
The links of the link manager.
Definition: RootRefs.h:73
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
int loadRefs(const std::string &section, const std::string &cnt, unsigned long entry, RootObjectRefs &refs)
Load references object.
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject...
Definition: RootRefs.h:71
LinkManager * linkMgr() const
Retrieve Link manager.
Definition: DataObject.h:78
int dbase
Data members to define object location in the persistent world.
Definition: RootRefs.h:32
Persistent reference object.
Definition: RootRefs.h:30
StatusCode error(const std::string &msg)
Standard way to print errors.
General service interface definition.
Definition: IService.h:18
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
const std::string & getCont(int which) const
Access container name from saved index.
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
virtual SmartIF< IAddressCreator > & addressCreator() const
Retrieve address creator facility.
Opaque address interface definition.
#define S_FAIL
Definition: RootCnvSvc.cpp:39
list i
Definition: ana.py:128
Concrete implementation of the IDataConnection interface to access ROOT files.
std::vector< RootRef > refs
The references corresponding to the next layer of items in the data store.
Definition: RootRefs.h:75
virtual StatusCode Gaudi::RootCnvSvc::i__fillRepRefs ( IOpaqueAddress pAddr,
DataObject pObj 
)
virtual

Resolve the references of the converted object.

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

Resolve the references of the converted object.

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

Definition at line 444 of file RootCnvSvc.cpp.

444  {
445  if ( pObj ) {
446  typedef vector<IRegistry*> Leaves;
447  Leaves leaves;
448  RootObjectRefs refs;
449  IRegistry* pR = pObj->registry();
450  auto dataMgr = SmartIF<IDataManagerSvc>{ pR->dataSvc() };
451  if ( dataMgr ) {
452  StatusCode status = dataMgr->objectLeaves(pObj, leaves);
453  if ( status.isSuccess() ) {
454  RootRef ref;
455  const string& id = pR->identifier();
456  size_t len = id.find('/',1);
457  string sect = id.substr(1,len==string::npos ? string::npos : len-1);
458  LinkManager* pLinks = pObj->linkMgr();
459  for(auto &i : leaves ) {
460  if ( i->address() ) {
461  m_current->makeRef(i,ref);
462  ref.entry = i->address()->ipar()[1];
463  refs.refs.push_back(ref);
464  }
465  }
466  for(int i = 0, n=pLinks->size(); i < n; ++i) {
467  LinkManager::Link* lnk = pLinks->link(i);
468  int link_id = m_current->makeLink(lnk->path());
469  refs.links.push_back(link_id);
470  }
471  pair<int,unsigned long> ret =
472  m_current->save(sect,id+"#R",m_classRefs,&refs,m_bufferSize,m_splitLevel,true);
473  if ( ret.first > 1 ) {
474  if( log().level() <= MSG::DEBUG )
475  log() << MSG::DEBUG << "Writing object:" << id << " "
476  << ret.first << " " << hex << ret.second << dec << endmsg;
477  return S_OK;
478  }
479  }
480  }
481  }
482  return S_FAIL;
483 }
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
std::pair< int, unsigned long > save(const std::string &section, const std::string &cnt, TClass *cl, void *pObj, int buff_siz, int split_lvl, bool fill_missing=false)
Save object of a given class to section and container.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:60
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::vector< int > links
The links of the link manager.
Definition: RootRefs.h:73
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject...
Definition: RootRefs.h:71
LinkManager * linkMgr() const
Retrieve Link manager.
Definition: DataObject.h:78
Persistent reference object.
Definition: RootRefs.h:30
int m_splitLevel
Property: Split level optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:88
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
#define S_OK
Definition: RootCnvSvc.cpp:38
void makeRef(IRegistry *pA, RootRef &ref)
Create reference object from registry entry.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
TClass * m_classRefs
TClass pointer to reference class.
Definition: RootCnvSvc.h:62
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
virtual const id_type & identifier() const =0
Full identifier (or key)
int makeLink(const std::string &p)
Convert path string to path index.
#define S_FAIL
Definition: RootCnvSvc.cpp:39
list i
Definition: ana.py:128
std::vector< RootRef > refs
The references corresponding to the next layer of items in the data store.
Definition: RootRefs.h:75
int m_bufferSize
Property: Buffer size optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:86
StatusCode RootCnvSvc::initialize ( )
virtual

ConversionSvc overload: initialize Db service.

Reimplemented from ConversionSvc.

Definition at line 92 of file RootCnvSvc.cpp.

92  {
93  string cname;
95  if ( !status.isSuccess() ) {
96  return error("Failed to initialize ConversionSvc base class.");
97  }
98  m_log.reset( new MsgStream(msgSvc(),name()) );
99  if ( !m_compression.empty() ) {
100  log() << MSG::INFO << "Setting global ROOT compression to:" << m_compression << endmsg;
101  if ( !(status=RootConnectionSetup::setCompression(m_compression)).isSuccess() ) {
102  return error("Unable to interprete ROOT compression encoding:"+m_compression);
103  }
104  }
105  m_ioMgr = service("IODataManager");
106  if( !m_ioMgr)
107  return error("Unable to localize interface from service:IODataManager");
108  m_incidentSvc = service("IncidentSvc");
109  if( !m_incidentSvc )
110  return error("Unable to localize interface from service:IncidentSvc");
111  m_setup->setMessageSvc(new MsgStream(msgSvc(),name()));
114  cname = System::typeinfoName(typeid(DataObject));
115  m_classDO = TClass::GetClass(cname.c_str());
116  if ( !m_classDO )
117  return error("Unable to load class description for DataObject");
118  cname = System::typeinfoName(typeid(RootObjectRefs));
119  m_classRefs = TClass::GetClass(cname.c_str());
120  if ( !m_classRefs )
121  return error("Unable to load class description for ObjectRefs");
122  return S_OK;
123 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
bool patchStreamers(MsgStream &log)
void setMessageSvc(MsgStream *m)
Set message service reference.
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:56
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject...
Definition: RootRefs.h:71
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
StatusCode error(const std::string &msg)
Standard way to print errors.
TClass * m_classDO
TClass pointer to DataObject class.
Definition: RootCnvSvc.h:64
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
#define S_OK
Definition: RootCnvSvc.cpp:38
TClass * m_classRefs
TClass pointer to reference class.
Definition: RootCnvSvc.h:62
RootConnectionSetup * m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:66
std::string m_compression
Property: Compression-algorithm:compression-level.
Definition: RootCnvSvc.h:79
static long setCompression(const std::string &compression)
Set the global compression level.
virtual StatusCode initialize()
Initialize the service.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootCnvSvc.h:58
void setIncidentSvc(IIncidentSvc *m)
Set incident service reference.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
virtual StatusCode Gaudi::RootCnvSvc::initialize ( )
virtual

ConversionSvc overload: initialize Db service.

Reimplemented from ConversionSvc.

void RootCnvSvc::loadConverter ( DataObject pObj)
virtual

ConversionSvc overload: Load the class (dictionary) for the converter.

Reimplemented from ConversionSvc.

Definition at line 171 of file RootCnvSvc.cpp.

171  {
172  if (pObject) {
173  string cname = System::typeinfoName(typeid(*pObject));
174  if( log().level() <= MSG::DEBUG )
175  log() << MSG::DEBUG << "Trying to 'Autoload' dictionary for class " << cname << endmsg;
176  TClass* cl = s_classesNames[cname];
177  if ( 0 == cl ) {
178  cl = TClass::GetClass(cname.c_str());
179  if ( cl ) {
180  s_classesNames[cname] = cl;
181  s_classesClids[pObject->clID()] = cl;
182  }
183  }
184  }
185 }
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
virtual void Gaudi::RootCnvSvc::loadConverter ( DataObject pObj)
virtual

ConversionSvc overload: Load the class (dictionary) for the converter.

Reimplemented from ConversionSvc.

MsgStream& Gaudi::RootCnvSvc::log ( ) const
inlineprotected

Helper: Use message streamer.

Definition at line 99 of file RootCnvSvc.h.

99 { return *m_log; }
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94
MsgStream& Gaudi::RootCnvSvc::log ( ) const
inlineprotected

Helper: Use message streamer.

Definition at line 99 of file RootCnvSvc.h.

99 { return *m_log; }
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94
virtual StatusCode Gaudi::RootCnvSvc::updateServiceState ( IOpaqueAddress )
inlinevirtual

Update state of the service.

Reimplemented from ConversionSvc.

Definition at line 110 of file RootCnvSvc.h.

virtual StatusCode Gaudi::RootCnvSvc::updateServiceState ( IOpaqueAddress )
inlinevirtual

Update state of the service.

Reimplemented from ConversionSvc.

Definition at line 110 of file RootCnvSvc.h.

Member Data Documentation

int Gaudi::RootCnvSvc::m_autoFlush
protected

Property: AutoFlush parameter for ROOT TTree (Number of events between auto flushes)

Definition at line 82 of file RootCnvSvc.h.

std::set< std::string > Gaudi::RootCnvSvc::m_badFiles
protected

Set with bad files/tables.

Definition at line 91 of file RootCnvSvc.h.

int Gaudi::RootCnvSvc::m_basketSize
protected

Property: Basket optimization parameter for ROOT TTree (total basket size)

Definition at line 84 of file RootCnvSvc.h.

int Gaudi::RootCnvSvc::m_bufferSize
protected

Property: Buffer size optimization parameter for ROOT TTree.

Definition at line 86 of file RootCnvSvc.h.

TClass * Gaudi::RootCnvSvc::m_classDO
protected

TClass pointer to DataObject class.

Definition at line 64 of file RootCnvSvc.h.

TClass * Gaudi::RootCnvSvc::m_classRefs
protected

TClass pointer to reference class.

Definition at line 62 of file RootCnvSvc.h.

std::string Gaudi::RootCnvSvc::m_compression
protected

Property: Compression-algorithm:compression-level.

Definition at line 79 of file RootCnvSvc.h.

Gaudi::RootDataConnection * Gaudi::RootCnvSvc::m_current = nullptr
protected

On writing: reference to active output stream.

Definition at line 60 of file RootCnvSvc.h.

std::string Gaudi::RootCnvSvc::m_currSection
protected

Property: ROOT section name.

Definition at line 68 of file RootCnvSvc.h.

bool Gaudi::RootCnvSvc::m_incidentEnabled
protected

Property: Flag to enable incidents on FILE_OPEN.

Definition at line 71 of file RootCnvSvc.h.

SmartIF< IIncidentSvc > Gaudi::RootCnvSvc::m_incidentSvc
protected

Reference to incident service.

Definition at line 58 of file RootCnvSvc.h.

SmartIF< Gaudi::IIODataManager > Gaudi::RootCnvSvc::m_ioMgr
protected

Reference to the I/O data manager.

Definition at line 56 of file RootCnvSvc.h.

std::string Gaudi::RootCnvSvc::m_ioPerfStats
protected

Property: Enable TTree IOperfStats if not empty; otherwise perf stat file name.

Definition at line 77 of file RootCnvSvc.h.

std::unique_ptr< MsgStream > Gaudi::RootCnvSvc::m_log
protected

Message streamer.

Definition at line 94 of file RootCnvSvc.h.

std::string Gaudi::RootCnvSvc::m_recordName
protected

Property: Records name to fire incident for file records.

Definition at line 75 of file RootCnvSvc.h.

RootConnectionSetup * Gaudi::RootCnvSvc::m_setup = nullptr
protected

Setup structure (ref-counted) and passed to data connections.

Definition at line 66 of file RootCnvSvc.h.

std::string Gaudi::RootCnvSvc::m_shareFiles
protected

Property: Share files ? If set to YES, files will not be closed on finalize.

Definition at line 73 of file RootCnvSvc.h.

int Gaudi::RootCnvSvc::m_splitLevel
protected

Property: Split level optimization parameter for ROOT TTree.

Definition at line 88 of file RootCnvSvc.h.


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