| The Gaudi Framework v30r0 (c919700c)

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

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

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

Description: More...

`#include <src/RootCnvSvc.h>`

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

## Public Member Functions
| RootCnvSvc (const std::string &name, ISvcLocator *svc)
| Standard constructor. More...
| ~RootCnvSvc () override=default
| Standard destructor. More...
virtual StatusCode | updateServiceState (IOpaqueAddress *) override
| 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...
StatusCode | initialize () override
| ConversionSvc overload: initialize Db service. More...
StatusCode | finalize () override
| ConversionSvc overload: Finalize Db service. More...
IConverter * | createConverter (long typ, const CLID &wanted, const ICnvFactory *fac) override
| ConversionSvc overload: Create new Converter using factory. More...
void | loadConverter (DataObject *pObj) override
| ConversionSvc overload: Load the class (dictionary) for the converter. More...
StatusCode | connectOutput (const std::string &outputFile, const std::string &openMode) override
| Connect the output file to the service with open mode. More...
StatusCode | connectOutput (const std::string &outputFile) override
| Connect the output file to the service. More...
StatusCode | commitOutput (const std::string &outputFile, bool do_commit) override
| Commit pending output. More...
virtual StatusCode | disconnect (const std::string &dbName)
| Disconnect from an existing data stream. More...
StatusCode | createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
| IAddressCreator implementation: Address creation. More...
StatusCode | createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) override
| 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
| ConversionSvc (const std::string &name, ISvcLocator *svc, long type)
| Standard Constructor. More...
| ConversionSvc (const ConversionSvc &)=delete
| disable copy and assignment More...
ConversionSvc & | operator= (const ConversionSvc &)=delete
StatusCode | initialize () override
| Initialize the service. More...
StatusCode | finalize () override
| stop the service. More...
long | repSvcType () const override
| Retrieve the class type of the data store the converter uses. More...
const CLID & | objType () const override
| Implementation of IConverter: dummy call. More...
StatusCode | setDataProvider (IDataProviderSvc *pService) override
| Implementation of IConverter: Set Data provider service. More...
SmartIF< IDataProviderSvc > & | dataProvider () const override
| Implementation of IConverter: Get Data provider service. More...
StatusCode | setConversionSvc (IConversionSvc *svc) override
| Implementation of IConverter: Set conversion service the converter is connected to. More...
SmartIF< IConversionSvc > & | conversionSvc () const override
| Implementation of IConverter: 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...
StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override
| Implementation of IConverter: Create the transient representation of an object. More...
StatusCode | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Implementation of IConverter: Resolve the references of the created transient object. More...
StatusCode | updateObj (IOpaqueAddress *pAddress, DataObject *refpObject) override
| Implementation of IConverter: Update the transient object from the other representation. More...
StatusCode | updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Implementation of IConverter: Update the references of an updated transient object. More...
StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
| Implementation of IConverter: Convert the transient object to the requested representation. More...
StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Implementation of IConverter: Resolve the references of the converted object. More...
StatusCode | updateRep (IOpaqueAddress *pAddress, DataObject *pObject) override
| Implementation of IConverter: Update the converted representation of a transient object. More...
StatusCode | updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
| Implementation of IConverter: Update the references of an already converted object. More...
StatusCode | addConverter (const CLID &clid) override
| Add converter object to conversion service. More...
StatusCode | addConverter (IConverter *pConverter) override
| Add converter object to conversion service. More...
StatusCode | removeConverter (const CLID &clid) override
| Remove converter object from conversion service (if present). More...
IConverter * | converter (const CLID &wanted) override
| Retrieve converter from list. More...
StatusCode | connectOutput (const std::string &outputFile, const std::string &openMode) override
| Connect the output file to the service with open mode. More...
StatusCode | connectOutput (const std::string &output) override
| Connect the output file to the service. More...
StatusCode | commitOutput (const std::string &output, bool do_commit) override
| Commit pending output. More...
StatusCode | createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
| Create a Generic address using explicit arguments to identify a single object. More...
StatusCode | convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) override
| Convert an address to string form. More...
StatusCode | createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) override
| Convert an address in string form to object form. More...
Public Member Functions inherited from extends< Service, IConversionSvc, IAddressCreator >
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 Service
const std::string & | name () const override
| Retrieve name of the service. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
| Initialize Service. More...
StatusCode | sysStart () override
| Initialize Service. More...
StatusCode | sysStop () override
| Initialize Service. More...
StatusCode | sysFinalize () override
| Finalize Service. More...
StatusCode | sysReinitialize () override
| Re-initialize the Service. More...
StatusCode | sysRestart () override
| Re-initialize the Service. More...
| Service (std::string name, ISvcLocator *svcloc)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job. More...
template<class T >
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<typename IFace = IService>
SmartIF< IFace > | service (const std::string &name, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist. More...
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
| Declare used tool. More...
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| PropertyHolder ()=default
| ~PropertyHolder () override=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces... >
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected Member Functions
TClass * | getClass (DataObject *pObject)
| Helper: Get TClass for a given DataObject pointer. More...
MsgStream & | log () const
| Helper: Use message streamer. More...
Protected Member Functions inherited from ConversionSvc
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 Member Functions inherited from Service
| ~Service () override
| Standard Destructor. More...
int | outputLevel () const
| get the `Service's` output level More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level | setUpMessaging ()
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
Gaudi::Property< std::string > | m_ioPerfStats
Gaudi::Property< std::string > | m_shareFiles
Gaudi::Property< bool > | m_incidentEnabled {this, "EnableIncident", true, "Flag to enable incidents on FILE_OPEN"}
Gaudi::Property< std::string > | m_recordName
Gaudi::Property< int > | m_autoFlush
Gaudi::Property< int > | m_basketSize
Gaudi::Property< int > | m_bufferSize
Gaudi::Property< int > | m_splitLevel {this, "SplitLevel", 0, "Split level optimization parameter for ROOT TTree"}
Gaudi::Property< std::string > | m_compression
SmartIF< Gaudi::IIODataManager > | m_ioMgr
| Reference to the I/O data manager. More...
SmartIF< IIncidentSvc > | m_incidentSvc
| Reference to incident service. More...
Gaudi::RootDataConnection * | m_current = nullptr
| On writing: reference to active output stream. More...
TClass * | m_classRefs = nullptr
| TClass pointer to reference class. More...
TClass * | m_classDO = nullptr
| TClass pointer to DataObject class. More...
std::shared_ptr< RootConnectionSetup > | m_setup
| Setup structure (ref-counted) and passed to data connections. More...
std::string | m_currSection
| Property: ROOT section name. More...
std::set< std::string > | m_badFiles
| Set with bad files/tables. More...
std::unique_ptr< MsgStream > | m_log
| Message streamer. More...
Protected Attributes inherited from ConversionSvc
SmartIF< IDataProviderSvc > | m_dataSvc
| Pointer to data provider service. More...
SmartIF< IAddressCreator > | m_addressCreator
| Pointer to the address creation service interface. More...
SmartIF< IConversionSvc > | m_cnvSvc
| Pointer to the IConversionSvc interface of this. More...
long | m_type
| Conversion service type. More...
std::vector< WorkerEntry > | m_workers
| List of conversion workers. More...
Protected Attributes inherited from Service
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::Property< int > | m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
Gaudi::Property< bool > | m_auditInit {this, "AuditServices", false, "[[deprecated]] unused"}
Gaudi::Property< bool > | m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
Gaudi::Property< bool > | m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
Gaudi::Property< bool > | m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
Gaudi::Property< bool > | m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
Gaudi::Property< bool > | m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
Gaudi::Property< bool > | m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
SmartIF< IAuditorSvc > | m_pAuditorSvc
| Auditor Service. More...

## Additional Inherited Members
Public Types inherited from extends< Service, IConversionSvc, IAddressCreator >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
Public Types inherited from Service
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using | base_class = CommonMessaging
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...

## Detailed Description

Description:

RootCnvSvc class implementation definition.

Author
  Markus Frank

Version
  1.0

Date
  20/12/2009

Definition at line 53 of file RootCnvSvc.h.

## Constructor & Destructor Documentation

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

Standard constructor.

Definition at line 53 of file RootCnvSvc.cpp.

54 : ConversionSvc( nam, svc, ROOT_StorageType ), m_setup{new RootConnectionSetup()}
55 {
56 m_setup->cacheBranches.push_back( "*" );
57 declareProperty( "LoadSection", m_setup->loadSection = "Event" );
58
59 // ROOT Read parameters: must be shared for the entire file!
60 declareProperty( "CacheSize", m_setup->cacheSize = 10 * MBYTE );
61 declareProperty( "LearnEntries", m_setup->learnEntries = 10 );
62 declareProperty( "CacheBranches", m_setup->cacheBranches );
63 declareProperty( "VetoBranches", m_setup->vetoBranches );
64 }
ConversionSvc::ConversionSvc
ConversionSvc(const std::string &name, ISvcLocator *svc, long type)
Standard Constructor.
Definition: ConversionSvc.cpp:347
Gaudi::RootCnvSvc::m_setup
std::shared_ptr< RootConnectionSetup > m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:86
PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Details::PropertyBase &prop)
Declare a property.
Definition: PropertyHolder.h:99
ROOT_StorageType
const long ROOT_StorageType
Definition: ClassID.h:52
MBYTE
#define MBYTE
Definition: RootCnvSvc.cpp:50
Gaudi::RootConnectionSetup
Definition: RootDataConnection.h:44

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

Standard destructor.

## Member Function Documentation

StatusCode RootCnvSvc::commitOutput | ( | const std::string & | outputFile,
|  | bool | do_commit
| ) |  |
| override

Commit pending output.

Parameters

  outputFile | String containig output file
  do_commit | if 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.

fill NULL pointers to all branches, which have less entries than the section branch

Definition at line 312 of file RootCnvSvc.cpp.

313 {
314 if ( m_current ) {
315 size_t len = m_currSection.find( '/', 1 );
316 string section = m_currSection.substr( 1, len == string::npos ? string::npos : len - 1 );
317 TBranch* b = m_current->getBranch( section, m_currSection );
318 if ( b ) {
319 Long64_t evt = b->GetEntries();
320 TTree* t = b->GetTree();
321 TObjArray* a = t->GetListOfBranches();
322 Int_t nb = a->GetEntriesFast();
324 for ( Int_t i = 0; i < nb; ++i ) {
325 TBranch* br_ptr = (TBranch*)a->UncheckedAt( i );
326 Long64_t br_evt = br_ptr->GetEntries();
327 if ( br_evt < evt ) {
328 Long64_t num = evt - br_evt;
329 br_ptr->SetAddress( nullptr );
330 while ( num > 0 ) {
331 br_ptr->Fill();
332 --num;
333 }
334 if ( log().level() <= MSG::DEBUG )
335 log() << MSG::DEBUG << "commit: Added " << long( evt - br_evt ) << " Section: " << evt
336 << " Branch: " << br_ptr->GetEntries() << " RefNo: " << br_ptr->GetEntries() - 1
337 << " NULL entries to:" << br_ptr->GetName() << endmsg;
338 }
339 }
340
341 b->GetTree()->SetEntries( evt );
342 if ( evt == 1 ) {
343 b->GetTree()->OptimizeBaskets( m_basketSize, 1.1, "" );
344 }
345 if ( evt > 0 && ( evt % m_autoFlush ) == 0 ) {
346 if ( evt == m_autoFlush ) {
347 b->GetTree()->SetAutoFlush( m_autoFlush );
348 b->GetTree()->OptimizeBaskets( m_basketSize, 1., "" );
349 } else {
350 b->GetTree()->FlushBaskets();
351 }
352 }
353 if ( log().level() <= MSG::DEBUG )
354 log() << MSG::DEBUG << "Set section entries of " << m_currSection << " to " << long( evt ) << " entries."
355 << endmsg;
356 } else {
357 return error( "commitOutput> Failed to update entry numbers on " + dsn );
358 }
359 }
360 return S_OK;
361 }
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
Gaudi::RootCnvSvc::m_autoFlush
Gaudi::Property< int > m_autoFlush
Definition: RootCnvSvc.h:65
Gaudi::RootCnvSvc::m_currSection
std::string m_currSection
Property: ROOT section name.
Definition: RootCnvSvc.h:88
MSG::DEBUG
Definition: IMessageSvc.h:16
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:38
Gaudi::RootDataConnection::getBranch
TBranch * getBranch(const std::string &section, const std::string &branch_name)
Access data branch by name: Get existing branch in read only mode.
Definition: RootDataConnection.h:309
std::string::find
T find(T...args)
std::string::substr
T substr(T...args)
Gaudi::RootCnvSvc::m_basketSize
Gaudi::Property< int > m_basketSize
Definition: RootCnvSvc.h:67
gaudirun.level
level
Definition: gaudirun.py:271
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
IOTest.evt
evt
Definition: IOTest.py:96
Gaudi::RootCnvSvc::m_current
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:80

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

Connect the output file to the service with open mode.

Parameters

  dataset | String containig file name
  mode | String containig opening mode

Returns
  Status code indicating success or failure.

Definition at line 211 of file RootCnvSvc.cpp.

212 {
213 try {
214 IDataConnection* c = m_ioMgr->connection( dataset );
215 bool fire_incident = false;
216 *con = nullptr;
217 if ( !c ) {
218 std::unique_ptr<RootDataConnection> connection( new RootDataConnection( this, dataset, m_setup ) );
219 StatusCode sc = ( mode != IDataConnection::READ )
220 ? m_ioMgr->connectWrite( connection.get(), IDataConnection::IoType( mode ), "ROOT" )
221 : m_ioMgr->connectRead( false, connection.get() );
222 c = sc.isSuccess() ? m_ioMgr->connection( dataset ) : nullptr;
223 if ( c ) {
224 bool writable = 0 != ( mode & ( IDataConnection::UPDATE | IDataConnection::RECREATE ) );
225 fire_incident = m_incidentEnabled && ( 0 != ( mode & ( IDataConnection::UPDATE | IDataConnection::READ ) ) );
226 if ( writable ) {
227 m_incidentSvc->fireIncident(
228 ContextIncident<TFile*>( connection->pfn(), "CONNECTED_OUTPUT", connection->file() ) );
229 }
230 if ( 0 != ( mode & IDataConnection::READ ) ) {
231 if ( !m_ioPerfStats.empty() ) {
232 connection->enableStatistics( m_setup->loadSection );
233 }
234 }
235 connection.release();
236 } else {
237 m_incidentSvc->fireIncident( Incident(
238 dataset, mode == IDataConnection::READ ? IncidentType::FailInputFile : IncidentType::FailOutputFile ) );
239 // An error message was already printed by the IODataManager. no need to do it here!
240 return StatusCode::FAILURE;
241 }
242 }
243 RootDataConnection* pc = dynamic_cast<RootDataConnection*>( c );
244 if ( pc ) {
245 if ( !pc->isConnected() ) pc->connectRead();
246 *con = pc;
247 pc->resetAge();
248 pc->addClient( this );
249 }
250 if ( *con ) {
251 if ( fire_incident ) {
252 IOpaqueAddress* pAddr = nullptr;
253 string fid = pc->fid();
254 string section = m_recordName[0] == '/' ? m_recordName.value().substr( 1 ) : m_recordName.value();
255 TBranch* b = pc->getBranch( section, m_recordName );
256 if ( b ) {
257 const string par[2] = {fid, m_recordName};
258 unsigned long ipar[2] = {(unsigned long)( *con ), (unsigned long)b->GetEntries() - 1};
259 for ( int i = 0; i < b->GetEntries(); ++i ) {
260 ipar[1] = i;
261 if ( !pc->mergeFIDs().empty() ) fid = pc->mergeFIDs()[i];
262 if ( !createAddress( repSvcType(), CLID_DataObject, par, ipar, pAddr ).isSuccess() ) {
263 if ( log().level() <= MSG::VERBOSE )
264 log() << MSG::VERBOSE << "Failed to create address for " << m_recordName << " in:" << fid << " ["
265 << pc->fid() << "][" << i << "]" << endmsg;
266 continue;
267 }
268 if ( log().level() <= MSG::VERBOSE )
269 log() << MSG::VERBOSE << "Prepare " << m_recordName << " " << fid << " [" << par[0] << "][" << i << "]"
270 << endmsg;
271 m_incidentSvc->fireIncident( ContextIncident<IOpaqueAddress*>( fid, "FILE_OPEN_READ", pAddr ) );
272 }
273 } else {
274 if ( log().level() <= MSG::VERBOSE )
275 log() << MSG::VERBOSE << "No valid Records " << m_recordName << " present in:" << pc->fid() << endmsg;
276 }
277 }
278
279 // We can remove retired connections, which are no longer used....
280 for ( auto& i : m_ioMgr->connections( this ) ) {
281 if ( i != *con && !i->isConnected() ) {
282 RootDataConnection* pc = dynamic_cast<RootDataConnection*>( i );
283 if ( pc && pc->lookupClient( this ) ) {
284 size_t num_client = pc->removeClient( this );
285 if ( num_client == 0 ) {
286 if ( m_ioMgr->disconnect( pc ).isSuccess() ) {
287 log() << MSG::INFO << "Removed disconnected IO stream:" << pc->fid() << " [" << pc->pfn() << "]"
288 << endmsg;
289 delete pc;
290 }
291 }
292 }
293 }
294 }
295 return S_OK;
296 }
297 m_incidentSvc->fireIncident( Incident( dataset, IncidentType::FailOutputFile ) );
298 return S_FAIL;
299 } catch ( exception& e ) {
300 m_incidentSvc->fireIncident( Incident( dataset, IncidentType::FailOutputFile ) );
301 return error( string( "connectDatabase> Caught exception:" ) + e.what() );
302 } catch ( ... ) {
303 m_incidentSvc->fireIncident( Incident( dataset, IncidentType::FailOutputFile ) );
304 return error( "connectDatabase> Unknown Fatal Exception for " + dataset );
305 }
306 }
Gaudi::RootDataConnection::addClient
void addClient(const IInterface *client)
Add new client to this data source.
Definition: RootDataConnection.cpp:152
Gaudi::RootDataConnection::lookupClient
bool lookupClient(const IInterface *client) const
Lookup client for this data source.
Definition: RootDataConnection.cpp:163
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
std::vector::empty
T empty(T...args)
gaudirun.c
c
Definition: gaudirun.py:407
Gaudi::IDataConnection::fid
const std::string & fid() const
Access file id.
Definition: IIODataManager.h:55
Gaudi::RootCnvSvc::m_recordName
Gaudi::Property< std::string > m_recordName
Definition: RootCnvSvc.h:61
Gaudi::IDataConnection::IoType
IoType
I/O Connection types.
Definition: IIODataManager.h:41
Gaudi::RootCnvSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootCnvSvc.h:78
Gaudi::RootDataConnection::isConnected
bool isConnected() const override
Check if connected to data source.
Definition: RootDataConnection.h:251
Gaudi::RootCnvSvc::createAddress
StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
IAddressCreator implementation: Address creation.
Definition: RootCnvSvc.cpp:371
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
Gaudi::RootCnvSvc::m_setup
std::shared_ptr< RootConnectionSetup > m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:86
Gaudi::RootDataConnection::removeClient
size_t removeClient(const IInterface *client)
Remove client from this data source.
Definition: RootDataConnection.cpp:155
Gaudi::Units::pc
constexpr double pc
Definition: SystemOfUnits.h:102
Gaudi::IDataConnection::RECREATE
Definition: IIODataManager.h:41
MSG::VERBOSE
Definition: IMessageSvc.h:16
Gaudi::IDataConnection::pfn
const std::string & pfn() const
Access physical file name.
Definition: IIODataManager.h:57
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
Gaudi::IDataConnection::READ
Definition: IIODataManager.h:41
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:437
std::exception::what
T what(T...args)
Gaudi::RootCnvSvc::m_ioPerfStats
Gaudi::Property< std::string > m_ioPerfStats
Definition: RootCnvSvc.h:56
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ContextIncident
Definition: DataIncident.h:16
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:38
Gaudi::RootDataConnection::getBranch
TBranch * getBranch(const std::string &section, const std::string &branch_name)
Access data branch by name: Get existing branch in read only mode.
Definition: RootDataConnection.h:309
std::exception
STL class.
Gaudi::IDataConnection::UPDATE
Definition: IIODataManager.h:41
Gaudi::RootDataConnection::mergeFIDs
const StringVec & mergeFIDs() const
Access merged FIDs.
Definition: RootDataConnection.h:259
Gaudi::RootDataConnection::connectRead
StatusCode connectRead() override
Open data stream in read mode.
Definition: RootDataConnection.cpp:215
std::unique_ptr
STL class.
Gaudi::IDataConnection
ABC describing basic data connection.
Definition: IIODataManager.h:25
Gaudi::RootCnvSvc::m_ioMgr
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:76
Gaudi::IDataConnection::resetAge
void resetAge()
Reset age.
Definition: IIODataManager.h:63
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17
ConversionSvc::repSvcType
long repSvcType() const override
Retrieve the class type of the data store the converter uses.
Definition: ConversionSvc.cpp:308
gaudirun.level
level
Definition: gaudirun.py:271
StatusCode::FAILURE
Definition: StatusCode.h:29
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
MSG::INFO
Definition: IMessageSvc.h:16
S_FAIL
#define S_FAIL
Definition: RootCnvSvc.cpp:39
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:94
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi::RootCnvSvc::m_incidentEnabled
Gaudi::Property< bool > m_incidentEnabled
Definition: RootCnvSvc.h:60

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

Connect the output file to the service with open mode.

Parameters

  outputFile | String containig output file
  openMode | String containig opening mode of the output file

Returns
  Status code indicating success or failure.

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

Connect the output file to the service.

Parameters

  outputFile | String containig output file

Returns
  Status code indicating success or failure.

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

IAddressCreator implementation: Address creation.

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

Parameters

  refLink | Reference to abstract link information
  dbName | Database name
  containerName | Object container name
  refpAddress | Opaque address information to retrieve object

Returns
  StatusCode indicating SUCCESS or failure

Definition at line 371 of file RootCnvSvc.cpp.

373 {
374 refpAddress = new RootAddress( typ, clid, par[0], par[1], ip[0], ip[1] );
375 return S_OK;
376 }
Gaudi::RootAddress
Description:
Definition: RootAddress.h:37
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:38

StatusCode Gaudi::RootCnvSvc::createAddress | ( | long | svc_type,
|  | const CLID & | clid,
|  | const std::string & | refAddress,
|  | IOpaqueAddress *& | refpAddress
| ) |  |
| inline override

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

Parameters

  svc_type | Technology identifier encapsulated in this address.
  clid | Class identifier of the DataObject represented by the opaque address
  address | Input address.
  refpAddress | Output address in string form.

Returns
  Status code indicating success or failure.

Definition at line 195 of file RootCnvSvc.h.

197 {
198 return this->ConversionSvc::createAddress( svc_type, clid, refAddress, refpAddress );
199 }
ConversionSvc::createAddress
StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
Create a Generic address using explicit arguments to identify a single object.
Definition: ConversionSvc.cpp:323

IConverter * RootCnvSvc::createConverter | ( | long | typ,
|  | const CLID & | wanted,
|  | const ICnvFactory * | fac
| ) |  |
| override virtual

ConversionSvc overload: Create new Converter using factory.

Reimplemented from ConversionSvc.

Definition at line 141 of file RootCnvSvc.cpp.

142 {
143 if ( wanted == CLID_StatisticsFile )
144 return new RootDatabaseCnv( typ, wanted, serviceLocator().get(), this );
145 else if ( wanted == CLID_StatisticsDirectory )
146 return new RootDirectoryCnv( typ, wanted, serviceLocator().get(), this );
147 else if ( wanted == CLID_RowWiseTuple )
148 return new RootNTupleCnv( typ, wanted, serviceLocator().get(), this );
149 else if ( wanted == CLID_ColumnWiseTuple )
150 return new RootNTupleCnv( typ, wanted, serviceLocator().get(), this );
151 else
152 return new RootConverter( typ, wanted, serviceLocator().get(), this );
153 }
Gaudi::RootDatabaseCnv
Statistics file converter class definition.
Definition: RootDatabaseCnv.h:29
Gaudi::RootNTupleCnv
NTuple converter class definition for NTuples writted/read using ROOT.
Definition: RootNTupleCnv.h:36
Gaudi::RootDirectoryCnv
Description: NTuple directory converter class definition Definition of the converter to manage the di...
Definition: RootDirectoryCnv.h:31
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
Gaudi::RootConverter
Description: Definition of the ROOT data converter.
Definition: RootConverter.h:33

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 388 of file RootCnvSvc.cpp.

389 {
390 RootObjectRefs* refs = nullptr;
391 size_t len = path.find( '/', 1 );
392 string section = path.substr( 1, len == string::npos ? string::npos : len - 1 );
393 pair<int, unsigned long> ret = m_current->save( section, path + "#R", nullptr, refs, m_bufferSize, m_splitLevel );
394 if ( log().level() <= MSG::VERBOSE )
395 log() << MSG::VERBOSE << "Writing object:" << path << " " << ret.first << " " << hex << ret.second << dec
396 << " [NULL]" << endmsg;
397 return S_OK;
398 }
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
MSG::dec
MsgStream & dec(MsgStream &log)
Definition: MsgStream.h:299
MSG::hex
MsgStream & hex(MsgStream &log)
Definition: MsgStream.h:304
Gaudi::RootCnvSvc::m_splitLevel
Gaudi::Property< int > m_splitLevel
Definition: RootCnvSvc.h:71
Gaudi::RootCnvSvc::m_bufferSize
Gaudi::Property< int > m_bufferSize
Definition: RootCnvSvc.h:69
MSG::VERBOSE
Definition: IMessageSvc.h:16
Gaudi::RootObjectRefs
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject...
Definition: RootRefs.h:60
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:38
std::pair
Gaudi::RootDataConnection::save
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.
Definition: RootDataConnection.cpp:471
std::string::find
T find(T...args)
std::string::substr
T substr(T...args)
gaudirun.level
level
Definition: gaudirun.py:271
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi::RootCnvSvc::m_current
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:80

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 379 of file RootCnvSvc.cpp.

380 {
381 size_t len = path.find( '/', 1 );
382 string section = path.substr( 1, len == string::npos ? string::npos : len - 1 );
383 m_current->saveObj( section, path, nullptr, nullptr, m_bufferSize, m_splitLevel );
384 return S_OK;
385 }
Gaudi::RootDataConnection::saveObj
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.
Definition: RootDataConnection.cpp:463
Gaudi::RootCnvSvc::m_splitLevel
Gaudi::Property< int > m_splitLevel
Definition: RootCnvSvc.h:71
Gaudi::RootCnvSvc::m_bufferSize
Gaudi::Property< int > m_bufferSize
Definition: RootCnvSvc.h:69
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:38
std::string::find
T find(T...args)
std::string::substr
T substr(T...args)
Gaudi::RootCnvSvc::m_current
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:80

StatusCode RootCnvSvc::disconnect | ( | const std::string & | dbName | ) |
| virtual

Disconnect from an existing data stream.

Parameters

  dbName | String containing name of the database

Returns
  Status code indicating success or failure.

Definition at line 364 of file RootCnvSvc.cpp.

365 {
366 IDataConnection* c = m_ioMgr->connection( dataset );
367 return c ? m_ioMgr->disconnect( c ) : S_FAIL;
368 }
gaudirun.c
c
Definition: gaudirun.py:407
Gaudi::IDataConnection
ABC describing basic data connection.
Definition: IIODataManager.h:25
Gaudi::RootCnvSvc::m_ioMgr
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:76
S_FAIL
#define S_FAIL
Definition: RootCnvSvc.cpp:39

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

Definition at line 67 of file RootCnvSvc.cpp.

68 {
69 if ( m_log ) {
70 log() << MSG::ERROR << "Error: " << msg << endmsg;
71 return S_FAIL;
72 }
73 MsgStream m( msgSvc(), name() );
74 m << MSG::ERROR << "Error: " << msg << endmsg;
75 return S_FAIL;
76 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
Gaudi::RootCnvSvc::m_log
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:94
CommonMessagingBase::msgSvc
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:75
MSG::ERROR
Definition: IMessageSvc.h:16
S_FAIL
#define S_FAIL
Definition: RootCnvSvc.cpp:39
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

StatusCode RootCnvSvc::finalize | ( |  | ) |
| override

ConversionSvc overload: Finalize Db service.

Definition at line 110 of file RootCnvSvc.cpp.

111 {
112 log() << MSG::INFO;
113 if ( m_ioMgr ) {
114 IIODataManager::Connections cons = m_ioMgr->connections( nullptr );
115 for ( auto& i : cons ) {
116 auto pc = dynamic_cast<RootDataConnection*>( i );
117 if ( pc ) {
118 if ( pc->owner() == this && !m_ioPerfStats.empty() ) {
119 pc->saveStatistics( m_ioPerfStats );
120 }
121 if ( pc->lookupClient( this ) ) {
122 size_t num_clients = pc->removeClient( this );
123 if ( num_clients == 0 ) {
124 if ( m_ioMgr->disconnect( pc ).isSuccess() ) {
125 log() << "Disconnected data IO:" << pc->fid() << " [" << pc->pfn() << "]" << endmsg;
126 delete pc;
127 }
128 }
129 }
130 }
131 }
132 m_ioMgr.reset();
133 }
134 m_log.reset();
135 m_incidentSvc.reset();
136 m_setup->setIncidentSvc( nullptr );
137 return ConversionSvc::finalize();
138 }
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
Gaudi::RootCnvSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootCnvSvc.h:78
Gaudi::RootCnvSvc::m_setup
std::shared_ptr< RootConnectionSetup > m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:86
Gaudi::Units::pc
constexpr double pc
Definition: SystemOfUnits.h:102
Gaudi::RootCnvSvc::m_ioPerfStats
Gaudi::Property< std::string > m_ioPerfStats
Definition: RootCnvSvc.h:56
Gaudi::RootCnvSvc::m_log
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94
std::unique_ptr::reset
T reset(T...args)
std::vector
STL class.
Gaudi::RootCnvSvc::m_ioMgr
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:76
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:92
MSG::INFO
Definition: IMessageSvc.h:16
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:94
ConversionSvc::finalize
StatusCode finalize() override
stop the service.
Definition: ConversionSvc.cpp:255
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

TClass * RootCnvSvc::getClass | ( | DataObject * | pObject | ) |
| protected

Helper: Get TClass for a given DataObject pointer.

Definition at line 174 of file RootCnvSvc.cpp.

175 {
176 auto i = s_classesClids.find( pObject->clID() );
177 if ( i != s_classesClids.end() ) return i->second;
178 loadConverter( pObject );
179 i = s_classesClids.find( pObject->clID() );
180 if ( i != s_classesClids.end() ) return i->second;
181
182 string cname = System::typeinfoName( typeid( *pObject ) );
183 throw runtime_error( "Unknown ROOT class for object:" + cname );
184 return nullptr;
185 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:336
Gaudi::RootCnvSvc::loadConverter
void loadConverter(DataObject *pObj) override
ConversionSvc overload: Load the class (dictionary) for the converter.
Definition: RootCnvSvc.cpp:156
DataObject::clID
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:62
std::runtime_error
STL class.

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 464 of file RootCnvSvc.cpp.

465 {
466 refpObj = nullptr;
467 if ( !pA ) return S_FAIL;
468 RootDataConnection* con = nullptr;
469 const string* par = pA->par();
470 unsigned long* ipar = const_cast<unsigned long*>( pA->ipar() );
471 StatusCode sc = connectDatabase( par[0], IDataConnection::READ, &con );
472 if ( sc.isSuccess() ) {
473 ipar[0] = (unsigned long)con;
474 DataObject* pObj = nullptr;
475 size_t len = par[1].find( '/', 1 );
476 string section = par[1].substr( 1, len == string::npos ? string::npos : len - 1 );
477
478 int nb = con->loadObj( section, par[1], ipar[1], pObj );
479 if ( nb > 1 || ( nb == 1 && pObj->clID() == CLID_DataObject ) ) {
480 refpObj = pObj;
481 return S_OK;
482 }
483 delete pObj;
484 }
485 string tag = par[0] + ":" + par[1];
486 if ( m_badFiles.find( tag ) == m_badFiles.end() ) {
487 m_badFiles.insert( tag );
488 return error( "createObj> Cannot access the object:" + tag );
489 }
490 return S_FAIL;
491 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
Gaudi::RootDataConnection::loadObj
int loadObj(const std::string &section, const std::string &cnt, unsigned long entry, DataObject *&pObj)
Load object.
Definition: RootDataConnection.cpp:504
std::set::end
T end(T...args)
Gaudi::RootCnvSvc::connectDatabase
StatusCode connectDatabase(const std::string &dataset, int mode, RootDataConnection **con)
Connect the output file to the service with open mode.
Definition: RootCnvSvc.cpp:211
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
Gaudi::IDataConnection::READ
Definition: IIODataManager.h:41
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:437
DataObject::clID
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:62
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:38
std::set::insert
T insert(T...args)
Gaudi::RootCnvSvc::m_badFiles
std::set< std::string > m_badFiles
Set with bad files/tables.
Definition: RootCnvSvc.h:91
std::string::find
T find(T...args)
std::string::substr
T substr(T...args)
S_FAIL
#define S_FAIL
Definition: RootCnvSvc.cpp:39
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:94

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 401 of file RootCnvSvc.cpp.

402 {
403 refpAddr = nullptr;
404 if ( !pObj ) return error( "createRep> Current Database is invalid!" );
405 CLID clid = pObj->clID();
406 IRegistry* pR = pObj->registry();
407 string p[2] = {m_current->fid(), pR->identifier()};
408 TClass* cl = ( clid == CLID_DataObject ) ? m_classDO : getClass( pObj );
409 size_t len = p[1].find( '/', 1 );
410 string sect = p[1].substr( 1, len == string::npos ? string::npos : len - 1 );
411 pair<int, unsigned long> ret = m_current->saveObj( sect, p[1], cl, pObj, m_bufferSize, m_splitLevel, true );
412 if ( ret.first > 1 || ( clid == CLID_DataObject && ret.first == 1 ) ) {
413 unsigned long ip[2] = {0, ret.second};
414 if ( m_currSection.empty() ) m_currSection = p[1];
415 return createAddress( repSvcType(), clid, p, ip, refpAddr );
416 }
417 return error( "Failed to write object data for:" + p[1] );
418 }
std::string::empty
T empty(T...args)
Gaudi::IDataConnection::fid
const std::string & fid() const
Access file id.
Definition: IIODataManager.h:55
Gaudi::RootCnvSvc::m_currSection
std::string m_currSection
Property: ROOT section name.
Definition: RootCnvSvc.h:88
Gaudi::RootDataConnection::saveObj
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.
Definition: RootDataConnection.cpp:463
Gaudi::RootCnvSvc::createAddress
StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
IAddressCreator implementation: Address creation.
Definition: RootCnvSvc.cpp:371
Gaudi::RootCnvSvc::m_splitLevel
Gaudi::Property< int > m_splitLevel
Definition: RootCnvSvc.h:71
Gaudi::RootCnvSvc::m_bufferSize
Gaudi::Property< int > m_bufferSize
Definition: RootCnvSvc.h:69
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
DataObject::clID
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:62
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
Gaudi::RootCnvSvc::m_classDO
TClass * m_classDO
TClass pointer to DataObject class.
Definition: RootCnvSvc.h:84
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
std::pair
std::string::find
T find(T...args)
ConversionSvc::repSvcType
long repSvcType() const override
Retrieve the class type of the data store the converter uses.
Definition: ConversionSvc.cpp:308
std::string::substr
T substr(T...args)
Gaudi::RootCnvSvc::m_current
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:80
Gaudi::RootCnvSvc::getClass
TClass * getClass(DataObject *pObject)
Helper: Get TClass for a given DataObject pointer.
Definition: RootCnvSvc.cpp:174

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 494 of file RootCnvSvc.cpp.

495 {
496 if ( !pA || !pObj ) return error( "read> Cannot read object -- no valid object address present " );
497
498 const unsigned long* ipar = pA->ipar();
499 RootDataConnection* con = (RootDataConnection*)ipar[0];
500 if ( con ) {
501 RootObjectRefs refs;
502 const string* par = pA->par();
503 size_t len = par[1].find( '/', 1 );
504 string section = par[1].substr( 1, len == string::npos ? string::npos : len - 1 );
505 int nb = con->loadRefs( section, par[1], ipar[1], refs );
506 if ( nb >= 1 ) {
507 string npar[3];
508 unsigned long nipar[2];
509 IRegistry* pR = pObj->registry();
510 auto dataMgr = SmartIF<IDataManagerSvc>{pR->dataSvc()};
511 LinkManager* mgr = pObj->linkMgr();
512 for ( const auto& i : refs.links ) mgr->addLink( con->getLink( i ), nullptr );
513 for ( auto& r : refs.refs ) {
514 npar[0] = con->getDb( r.dbase );
515 npar[1] = con->getCont( r.container );
516 npar[2] = con->getLink( r.link );
517 nipar[0] = 0;
518 nipar[1] = r.entry;
519 IOpaqueAddress* nPA = nullptr;
520 StatusCode sc = addressCreator()->createAddress( r.svc, r.clid, npar, nipar, nPA );
521 if ( sc.isSuccess() ) {
522 if ( log().level() <= MSG::VERBOSE )
523 log() << MSG::VERBOSE << dataMgr.as<IService>()->name() << " -> Register:" << pA->registry()->identifier()
524 << "#" << npar[2] << "[" << r.entry << "]" << endmsg;
525 sc = dataMgr->registerAddress( pA->registry(), npar[2], nPA );
526 if ( sc.isSuccess() ) continue;
527 }
528 log() << MSG::ERROR << con->fid() << ": Failed to create address!!!!" << endmsg;
529 return S_FAIL;
530 }
531 return pObj->update();
532 } else if ( nb < 0 ) {
533 string tag = par[0] + ":" + par[1];
534 if ( m_badFiles.find( tag ) == m_badFiles.end() ) {
535 m_badFiles.insert( tag );
536 return error( "createObj> Cannot access the object:" + tag + " [Corrupted file]" );
537 }
538 }
539 }
540 return S_FAIL;
541 }
ConversionSvc::addressCreator
SmartIF< IAddressCreator > & addressCreator() const override
Retrieve address creator facility.
Definition: ConversionSvc.cpp:191
DataObject::update
virtual StatusCode update()
Provide empty placeholder for internal object reconfiguration callback.
Definition: DataObject.cpp:71
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
SmartIF< IDataManagerSvc >
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
Gaudi::IDataConnection::fid
const std::string & fid() const
Access file id.
Definition: IIODataManager.h:55
Gaudi::RootDataConnection::getDb
const std::string & getDb(int which) const
Access database/file name from saved index.
Definition: RootDataConnection.cpp:450
IAddressCreator::createAddress
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.
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
Gaudi::RootDataConnection::getLink
const std::string & getLink(int which) const
Access link name from saved index.
Definition: RootDataConnection.h:336
std::set::end
T end(T...args)
LinkManager::addLink
long addLink(const std::string &path, const DataObject *pObject) const
Add link by object reference and path.
Definition: LinkManager.cpp:59
Gaudi::RootObjectRefs::refs
std::vector< RootRef > refs
The references corresponding to the next layer of items in the data store.
Definition: RootRefs.h:64
MSG::VERBOSE
Definition: IMessageSvc.h:16
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
Gaudi::RootDataConnection::loadRefs
int loadRefs(const std::string &section, const std::string &cnt, unsigned long entry, RootObjectRefs &refs)
Load references object.
Definition: RootDataConnection.cpp:558
Gaudi::RootObjectRefs
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject...
Definition: RootRefs.h:60
DataObject::linkMgr
LinkManager * linkMgr() const
Retrieve Link manager.
Definition: DataObject.h:75
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:437
IService
General service interface definition.
Definition: IService.h:18
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IRegistry::dataSvc
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
Gaudi::RootDataConnection::getCont
const std::string & getCont(int which) const
Access container name from saved index.
Definition: RootDataConnection.h:330
Gaudi::RootObjectRefs::links
std::vector< int > links
The links of the link manager.
Definition: RootRefs.h:62
std::set::insert
T insert(T...args)
Gaudi::RootCnvSvc::m_badFiles
std::set< std::string > m_badFiles
Set with bad files/tables.
Definition: RootCnvSvc.h:91
std::string::find
T find(T...args)
MSG::ERROR
Definition: IMessageSvc.h:16
std::string::substr
T substr(T...args)
MsgStream::level
MSG::Level level() const
Retrieve output level.
Definition: MsgStream.h:108
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
S_FAIL
#define S_FAIL
Definition: RootCnvSvc.cpp:39
Gaudi::RootDataConnection
Concrete implementation of the IDataConnection interface to access ROOT files.
Definition: RootDataConnection.h:94
LinkManager
A LinkManager is the object aggregated into a DataObject, which is responsible for the handling of no...
Definition: LinkManager.h:21
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

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 421 of file RootCnvSvc.cpp.

422 {
423 if ( pObj ) {
424 typedef vector<IRegistry*> Leaves;
425 Leaves leaves;
426 RootObjectRefs refs;
427 IRegistry* pR = pObj->registry();
428 auto dataMgr = SmartIF<IDataManagerSvc>{pR->dataSvc()};
429 if ( dataMgr ) {
430 StatusCode status = dataMgr->objectLeaves( pObj, leaves );
431 if ( status.isSuccess() ) {
432 RootRef ref;
433 const string& id = pR->identifier();
434 size_t len = id.find( '/', 1 );
435 string sect = id.substr( 1, len == string::npos ? string::npos : len - 1 );
436 LinkManager* pLinks = pObj->linkMgr();
437 for ( auto& i : leaves ) {
438 if ( i->address() ) {
439 m_current->makeRef( i, ref );
440 ref.entry = i->address()->ipar()[1];
441 refs.refs.push_back( ref );
442 }
443 }
444 for ( int i = 0, n = pLinks->size(); i < n; ++i ) {
445 LinkManager::Link* lnk = pLinks->link( i );
446 int link_id = m_current->makeLink( lnk->path() );
447 refs.links.push_back( link_id );
448 }
449 pair<int, unsigned long> ret =
450 m_current->save( sect, id + "#R", m_classRefs, &refs, m_bufferSize, m_splitLevel, true );
451 if ( ret.first > 1 ) {
452 if ( log().level() <= MSG::DEBUG )
453 log() << MSG::DEBUG << "Writing object:" << id << " " << ret.first << " " << hex << ret.second << dec
454 << endmsg;
455 return S_OK;
456 }
457 }
458 }
459 }
460 return S_FAIL;
461 }
LinkManager::Link::path
const std::string & path() const
Access to path of object.
Definition: LinkManager.h:66
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
SmartIF< IDataManagerSvc >
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
MSG::DEBUG
Definition: IMessageSvc.h:16
MSG::dec
MsgStream & dec(MsgStream &log)
Definition: MsgStream.h:299
Gaudi::RootObjectRefs::refs
std::vector< RootRef > refs
The references corresponding to the next layer of items in the data store.
Definition: RootRefs.h:64
Gaudi::RootRef::entry
int entry
Definition: RootRefs.h:33
MSG::hex
MsgStream & hex(MsgStream &log)
Definition: MsgStream.h:304
Gaudi::RootCnvSvc::m_splitLevel
Gaudi::Property< int > m_splitLevel
Definition: RootCnvSvc.h:71
Gaudi::RootCnvSvc::m_bufferSize
Gaudi::Property< int > m_bufferSize
Definition: RootCnvSvc.h:69
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
Gaudi::RootObjectRefs
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject...
Definition: RootRefs.h:60
DataObject::linkMgr
LinkManager * linkMgr() const
Retrieve Link manager.
Definition: DataObject.h:75
compareRootHistos.ref
string ref
Definition: compareRootHistos.py:14
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:228
Gaudi::RootRef
Persistent reference object.
Definition: RootRefs.h:31
std::vector::push_back
T push_back(T...args)
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:38
Gaudi::RootDataConnection::makeRef
void makeRef(IRegistry *pA, RootRef &ref)
Create reference object from registry entry.
Definition: RootDataConnection.cpp:605
LinkManager::link
Link * link(long id)
Retrieve symbolic link identified by ID.
Definition: LinkManager.cpp:31
IRegistry::dataSvc
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
std::pair
Gaudi::RootObjectRefs::links
std::vector< int > links
The links of the link manager.
Definition: RootRefs.h:62
Gaudi::RootDataConnection::save
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.
Definition: RootDataConnection.cpp:471
std::string::find
T find(T...args)
std::vector< IRegistry * >
Gaudi::RootDataConnection::makeLink
int makeLink(const std::string &p)
Convert path string to path index.
Definition: RootDataConnection.cpp:441
gaudirun.level
level
Definition: gaudirun.py:271
LinkManager::Link
Embedded class defining a symbolic link Note: No copy constructor; bitwise copy (done by the compiler...
Definition: LinkManager.h:32
S_FAIL
#define S_FAIL
Definition: RootCnvSvc.cpp:39
LinkManager
A LinkManager is the object aggregated into a DataObject, which is responsible for the handling of no...
Definition: LinkManager.h:21
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
LinkManager::size
long size() const
Retrieve number of link present.
Definition: LinkManager.h:105
Gaudi::RootCnvSvc::m_current
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:80
Gaudi::RootCnvSvc::m_classRefs
TClass * m_classRefs
TClass pointer to reference class.
Definition: RootCnvSvc.h:82

StatusCode RootCnvSvc::initialize | ( |  | ) |
| override

ConversionSvc overload: initialize Db service.

Definition at line 79 of file RootCnvSvc.cpp.

80 {
81 string cname;
82 StatusCode status = ConversionSvc::initialize();
83 if ( !status.isSuccess() ) {
84 return error( "Failed to initialize ConversionSvc base class." );
85 }
86 m_log.reset( new MsgStream( msgSvc(), name() ) );
87 if ( !m_compression.empty() ) {
88 log() << MSG::INFO << "Setting global ROOT compression to:" << m_compression << endmsg;
89 if ( !( status = RootConnectionSetup::setCompression( m_compression ) ).isSuccess() ) {
90 return error( "Unable to interprete ROOT compression encoding:" + m_compression );
91 }
92 }
93 m_ioMgr = service( "IODataManager" );
94 if ( !m_ioMgr ) return error( "Unable to localize interface from service:IODataManager" );
95 m_incidentSvc = service( "IncidentSvc" );
96 if ( !m_incidentSvc ) return error( "Unable to localize interface from service:IncidentSvc" );
97 m_setup->setMessageSvc( new MsgStream( msgSvc(), name() ) );
98 m_setup->setIncidentSvc( m_incidentSvc.get() );
99 GaudiRoot::patchStreamers( log() );
100 cname = System::typeinfoName( typeid( DataObject ) );
101 m_classDO = TClass::GetClass( cname.c_str() );
102 if ( !m_classDO ) return error( "Unable to load class description for DataObject" );
103 cname = System::typeinfoName( typeid( RootObjectRefs ) );
104 m_classRefs = TClass::GetClass( cname.c_str() );
105 if ( !m_classRefs ) return error( "Unable to load class description for ObjectRefs" );
106 return S_OK;
107 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
Gaudi::RootCnvSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootCnvSvc.h:78
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:336
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
Gaudi::RootCnvSvc::m_setup
std::shared_ptr< RootConnectionSetup > m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:86
Gaudi::RootCnvSvc::m_compression
Gaudi::Property< std::string > m_compression
Definition: RootCnvSvc.h:72
GaudiRoot::patchStreamers
bool patchStreamers(MsgStream &log)
Definition: RootIOHandler.cpp:216
Gaudi::RootConnectionSetup::setCompression
static StatusCode setCompression(const std::string &compression)
Set the global compression level.
Definition: RootDataConnection.cpp:96
Gaudi::RootObjectRefs
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject...
Definition: RootRefs.h:60
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Gaudi::RootCnvSvc::m_log
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:38
Gaudi::RootCnvSvc::m_classDO
TClass * m_classDO
TClass pointer to DataObject class.
Definition: RootCnvSvc.h:84
std::unique_ptr::reset
T reset(T...args)
CommonMessagingBase::msgSvc
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:75
Gaudi::RootCnvSvc::m_ioMgr
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:76
std::string::c_str
T c_str(T...args)
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn&#39;t already exist.
Definition: Service.h:85
MSG::INFO
Definition: IMessageSvc.h:16
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
ConversionSvc::initialize
StatusCode initialize() override
Initialize the service.
Definition: ConversionSvc.cpp:252
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi::RootCnvSvc::m_classRefs
TClass * m_classRefs
TClass pointer to reference class.
Definition: RootCnvSvc.h:82

void RootCnvSvc::loadConverter | ( | DataObject * | pObj | ) |
| override virtual

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

Reimplemented from ConversionSvc.

Definition at line 156 of file RootCnvSvc.cpp.

157 {
158 if ( pObject ) {
159 string cname = System::typeinfoName( typeid( *pObject ) );
160 if ( log().level() <= MSG::DEBUG )
161 log() << MSG::DEBUG << "Trying to 'Autoload' dictionary for class " << cname << endmsg;
162 TClass* cl = s_classesNames[cname];
163 if ( nullptr == cl ) {
164 cl = TClass::GetClass( cname.c_str() );
165 if ( cl ) {
166 s_classesNames[cname] = cl;
167 s_classesClids[pObject->clID()] = cl;
168 }
169 }
170 }
171 }
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:336
MSG::DEBUG
Definition: IMessageSvc.h:16
std::string::c_str
T c_str(T...args)
gaudirun.level
level
Definition: gaudirun.py:271
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

MsgStream& Gaudi::RootCnvSvc::log | ( |  | ) | const
| inline protected

Helper: Use message streamer.

Definition at line 99 of file RootCnvSvc.h.

99 { return *m_log; }
Gaudi::RootCnvSvc::m_log
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94

virtual StatusCode Gaudi::RootCnvSvc::updateServiceState | ( | IOpaqueAddress * |  | ) |
| inline override virtual

Update state of the service.

Reimplemented from ConversionSvc.

Definition at line 109 of file RootCnvSvc.h.

109 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:29

## Member Data Documentation

Gaudi::Property<int> Gaudi::RootCnvSvc::m_autoFlush
| protected

Initial value:
{this, "AutoFlush", 100,
"AutoFlush parameter for ROOT TTree (Number of events between auto flushes)"}

Definition at line 65 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.

Gaudi::Property<int> Gaudi::RootCnvSvc::m_basketSize
| protected

Initial value:
{this, "BasketSize", 2 * 1024 * 1024 ,
"Basket optimization parameter for ROOT TTree (total basket size)"}

Definition at line 67 of file RootCnvSvc.h.

Gaudi::Property<int> Gaudi::RootCnvSvc::m_bufferSize
| protected

Initial value:
{this, "BufferSize", 2 * 1024 ,
"Buffer size optimization parameter for ROOT TTree"}

Definition at line 69 of file RootCnvSvc.h.

TClass* Gaudi::RootCnvSvc::m_classDO = nullptr
| protected

TClass pointer to DataObject class.

Definition at line 84 of file RootCnvSvc.h.

TClass* Gaudi::RootCnvSvc::m_classRefs = nullptr
| protected

TClass pointer to reference class.

Definition at line 82 of file RootCnvSvc.h.

Gaudi::Property<std::string> Gaudi::RootCnvSvc::m_compression
| protected

Initial value:
{this, "GlobalCompression", "",
"Compression-algorithm:compression-level, empty: do nothing"}

Definition at line 72 of file RootCnvSvc.h.

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

On writing: reference to active output stream.

Definition at line 80 of file RootCnvSvc.h.

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

Property: ROOT section name.

Definition at line 88 of file RootCnvSvc.h.

Gaudi::Property<bool> Gaudi::RootCnvSvc::m_incidentEnabled {this, "EnableIncident", true, "Flag to enable incidents on FILE_OPEN"}
| protected

Definition at line 60 of file RootCnvSvc.h.

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

Reference to incident service.

Definition at line 78 of file RootCnvSvc.h.

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

Reference to the I/O data manager.

Definition at line 76 of file RootCnvSvc.h.

Gaudi::Property<std::string> Gaudi::RootCnvSvc::m_ioPerfStats
| protected

Initial value:
{this, "IOPerfStats", "",
"Enable TTree IOperfStats if not empty; otherwise perf stat file name"}

Definition at line 56 of file RootCnvSvc.h.

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

Message streamer.

Definition at line 94 of file RootCnvSvc.h.

Gaudi::Property<std::string> Gaudi::RootCnvSvc::m_recordName
| protected

Initial value:
{this, "RecordsName", "/FileRecords",
"Records name to fire incident for file records"}

Definition at line 61 of file RootCnvSvc.h.

std::shared_ptr<RootConnectionSetup> Gaudi::RootCnvSvc::m_setup
| protected

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

Definition at line 86 of file RootCnvSvc.h.

Gaudi::Property<std::string> Gaudi::RootCnvSvc::m_shareFiles
| protected

Initial value:
{this, "ShareFiles", "NO",
"Share files? If set to YES, files will not be closed on finalize"}

Definition at line 58 of file RootCnvSvc.h.

Gaudi::Property<int> Gaudi::RootCnvSvc::m_splitLevel {this, "SplitLevel", 0, "Split level optimization parameter for ROOT TTree"}
| protected

Definition at line 71 of file RootCnvSvc.h.

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

- RootCnv/RootCnv/RootCnvSvc.h
- RootCnv/src/RootCnvSvc.cpp