The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
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.
 
StatusCode updateServiceState (IOpaqueAddress *) override
 Update state of the service.
 
StatusCode error (const std::string &msg)
 Standard way to print errors.
 
StatusCode connectDatabase (const std::string &dataset, int mode, RootDataConnection **con)
 Connect the output file to the service with open mode.
 
StatusCode initialize () override
 ConversionSvc overload: initialize Db service.
 
StatusCode finalize () override
 ConversionSvc overload: Finalize Db service.
 
IConvertercreateConverter (long typ, const CLID &wanted, const ICnvFactory *fac) override
 ConversionSvc overload: Create new Converter using factory.
 
void loadConverter (DataObject *pObj) override
 ConversionSvc overload: Load the class (dictionary) for the converter.
 
StatusCode connectOutput (const std::string &outputFile, const std::string &openMode) override
 Connect the output file to the service with open mode.
 
StatusCode connectOutput (const std::string &outputFile) override
 Connect the output file to the service.
 
StatusCode commitOutput (const std::string &outputFile, bool do_commit) override
 Commit pending output.
 
virtual StatusCode disconnect (const std::string &dbName)
 Disconnect from an existing data stream.
 
StatusCode createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
 IAddressCreator implementation: Address creation.
 
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.
 
virtual StatusCode createNullRep (const std::string &path)
 Insert null marker for not existent transient object.
 
virtual StatusCode createNullRef (const std::string &path)
 Insert null marker for not existent transient object.
 
virtual StatusCode i__createRep (DataObject *pObj, IOpaqueAddress *&refpAddr)
 Convert the transient object to the requested persistent representation.
 
virtual StatusCode i__fillRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Resolve the references of the converted object.
 
virtual StatusCode i__createObj (IOpaqueAddress *pAddr, DataObject *&refpObj)
 Create transient object from persistent data.
 
virtual StatusCode i__fillObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
 Resolve the references of the created transient object.
 
- Public Member Functions inherited from ConversionSvc
 ConversionSvc (const std::string &name, ISvcLocator *svc, long type)
 Standard Constructor.
 
 ConversionSvc (const ConversionSvc &)=delete
 disable copy and assignment
 
ConversionSvcoperator= (const ConversionSvc &)=delete
 
StatusCode initialize () override
 Initialize the service.
 
StatusCode finalize () override
 stop the service.
 
long repSvcType () const override
 Retrieve the class type of the data store the converter uses.
 
const CLIDobjType () const override
 Implementation of IConverter: dummy call.
 
StatusCode setDataProvider (IDataProviderSvc *pService) override
 Implementation of IConverter: Set Data provider service.
 
SmartIF< IDataProviderSvc > & dataProvider () const override
 Implementation of IConverter: Get Data provider service.
 
StatusCode setConversionSvc (IConversionSvc *svc) override
 Implementation of IConverter: Set conversion service the converter is connected to.
 
SmartIF< IConversionSvc > & conversionSvc () const override
 Implementation of IConverter: Get conversion service the converter is connected to.
 
StatusCode setAddressCreator (IAddressCreator *creator) override
 Set address creator facility.
 
SmartIF< IAddressCreator > & addressCreator () const override
 Retrieve address creator facility.
 
StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override
 Implementation of IConverter: Create the transient representation of an object.
 
StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Resolve the references of the created transient object.
 
StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject) override
 Implementation of IConverter: Update the transient object from the other representation.
 
StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Update the references of an updated transient object.
 
StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
 Implementation of IConverter: Convert the transient object to the requested representation.
 
StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Resolve the references of the converted object.
 
StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Update the converted representation of a transient object.
 
StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Update the references of an already converted object.
 
StatusCode addConverter (const CLID &clid) override
 Add converter object to conversion service.
 
StatusCode addConverter (IConverter *pConverter) override
 Add converter object to conversion service.
 
StatusCode removeConverter (const CLID &clid) override
 Remove converter object from conversion service (if present).
 
IConverterconverter (const CLID &wanted) override
 Retrieve converter from list.
 
StatusCode connectOutput (const std::string &outputFile, const std::string &openMode) override
 Connect the output file to the service with open mode.
 
StatusCode connectOutput (const std::string &output) override
 Connect the output file to the service.
 
StatusCode commitOutput (const std::string &output, bool do_commit) override
 Commit pending output.
 
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.
 
StatusCode convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) override
 Convert an address to string form.
 
StatusCode createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) override
 Convert an address in string form to object form.
 
- Public Member Functions inherited from extends< Service, IConversionSvc, IAddressCreator >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
- Public Member Functions inherited from Service
const std::string & name () const override
 Retrieve name of the service.
 
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.
 
StatusCode sysStart () override
 Initialize Service.
 
StatusCode sysStop () override
 Initialize Service.
 
StatusCode sysFinalize () override
 Finalize Service.
 
StatusCode sysReinitialize () override
 Re-initialize the Service.
 
StatusCode sysRestart () override
 Re-initialize the Service.
 
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor.
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator.
 
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, bool createIf=true)
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
 Declare used tool.
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
 
template<class T>
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked.
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property.
 
Gaudi::Details::PropertyBasedeclareProperty (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.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation.
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property.
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name.
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream)
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor.
 
const SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream.
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS)
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL)
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING)
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO)
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG)
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO)
 

Protected Member Functions

TClass * getClass (DataObject *pObject)
 Helper: Get TClass for a given DataObject pointer.
 
MsgStreamlog () const
 Helper: Use message streamer.
 
- Protected Member Functions inherited from ConversionSvc
virtual StatusCode configureConverter (long typ, const CLID &clid, IConverter *cnv)
 Configure the new converter before initialize is called.
 
virtual StatusCode initializeConverter (long typ, const CLID &clid, IConverter *cnv)
 Initialize the new converter.
 
virtual StatusCode activateConverter (long typ, const CLID &clid, IConverter *cnv)
 Activate the new converter after initialization.
 
virtual SmartIF< IAddressCreator > & addressCreator ()
 Retrieve address creation interface.
 
StatusCode makeCall (int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
 
- Protected Member Functions inherited from Service
std::vector< IAlgTool * > & tools ()
 
 ~Service () override
 
int outputLevel () const
 get the Service's output level
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 Set up local caches.
 
MSG::Level resetMessaging ()
 Reinitialize internal states.
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream.
 

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_minBufferSize
 
Gaudi::Property< int > m_maxBufferSize
 
Gaudi::Property< int > m_approxEventsPerBasket
 
Gaudi::Property< int > m_splitLevel { this, "SplitLevel", 0, "Split level optimization parameter for ROOT TTree" }
 
Gaudi::Property< std::string > m_compression
 
SmartIF< Gaudi::IIODataManagerm_ioMgr
 Reference to the I/O data manager.
 
SmartIF< IIncidentSvcm_incidentSvc
 Reference to incident service.
 
Gaudi::RootDataConnectionm_current = nullptr
 On writing: reference to active output stream.
 
TClass * m_classRefs = nullptr
 TClass pointer to reference class.
 
TClass * m_classDO = nullptr
 TClass pointer to DataObject class.
 
std::shared_ptr< RootConnectionSetupm_setup
 Setup structure (ref-counted) and passed to data connections.
 
std::string m_currSection
 Property: ROOT section name.
 
std::set< std::string > m_badFiles
 Set with bad files/tables.
 
std::unique_ptr< MsgStreamm_log
 Message streamer.
 
- Protected Attributes inherited from ConversionSvc
SmartIF< IDataProviderSvcm_dataSvc
 Pointer to data provider service.
 
SmartIF< IAddressCreatorm_addressCreator
 Pointer to the address creation service interface.
 
SmartIF< IConversionSvcm_cnvSvc
 Pointer to the IConversionSvc interface of this.
 
long m_type
 Conversion service type.
 
std::vector< WorkerEntrym_workers
 List of conversion workers.
 
- Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state.
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state.
 
Gaudi::Property< int > m_outputLevel { this, "OutputLevel", MSG::NIL, "output level" }
 flag indicating whether ToolHandle tools have been added to m_tools
 
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()" }
 
Gaudi::Property< bool > m_autoRetrieveTools
 
Gaudi::Property< bool > m_checkToolDeps
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service.
 

Additional Inherited Members

- Public Types inherited from extends< Service, IConversionSvc, IAddressCreator >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from Service
using Factory = Gaudi::PluginService::Factory<IService*( const std::string&, ISvcLocator* )>
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using PropertyHolderImpl
 Typedef used to refer to this class from derived classes, as in.
 
- Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 

Detailed Description

Description:

RootCnvSvc class implementation definition.

Author
Markus Frank
Version
1.0
Date
20/12/2009

Definition at line 61 of file RootCnvSvc.h.

Constructor & Destructor Documentation

◆ RootCnvSvc()

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

Standard constructor.

Definition at line 60 of file RootCnvSvc.cpp.

61 : ConversionSvc( nam, svc, ROOT_StorageType ), m_setup{ new RootConnectionSetup() } {
62 m_setup->cacheBranches.push_back( "*" );
63 declareProperty( "LoadSection", m_setup->loadSection = "Event" );
64
65 // ROOT Read parameters: must be shared for the entire file!
66 declareProperty( "CacheSize", m_setup->cacheSize = 10 * MBYTE );
67 declareProperty( "LearnEntries", m_setup->learnEntries = 10 );
68 declareProperty( "CacheBranches", m_setup->cacheBranches );
69 declareProperty( "VetoBranches", m_setup->vetoBranches );
70
71 declareProperty( m_setup->produceReproducibleFiles );
72 m_setup->produceReproducibleFiles.setOwnerType<RootCnvSvc>();
73
74 declareProperty( m_setup->root630ForwardCompatibility );
75 m_setup->root630ForwardCompatibility.setOwnerType<RootCnvSvc>();
76}
const long ROOT_StorageType
Definition ClassID.h:60
#define MBYTE
ConversionSvc(const std::string &name, ISvcLocator *svc, long type)
Standard Constructor.
RootCnvSvc(const std::string &name, ISvcLocator *svc)
Standard constructor.
std::shared_ptr< RootConnectionSetup > m_setup
Setup structure (ref-counted) and passed to data connections.
Definition RootCnvSvc.h:93
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
Definition Service.h:91

Member Function Documentation

◆ commitOutput()

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

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.

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

Definition at line 311 of file RootCnvSvc.cpp.

311 {
312 if ( m_current ) {
313 size_t len = m_currSection.find( '/', 1 );
314 string section = m_currSection.substr( 1, len == string::npos ? string::npos : len - 1 );
315 TBranch* b = m_current->getBranch( section, m_currSection );
316 if ( b ) {
317 Long64_t evt = b->GetEntries();
318 TTree* t = b->GetTree();
319 TObjArray* a = t->GetListOfBranches();
320 Int_t nb = a->GetEntriesFast();
322 for ( Int_t i = 0; i < nb; ++i ) {
323 TBranch* br_ptr = (TBranch*)a->UncheckedAt( i );
324 Long64_t br_evt = br_ptr->GetEntries();
325 if ( br_evt < evt ) {
326 Long64_t num = evt - br_evt;
327 br_ptr->SetAddress( nullptr );
328 while ( num > 0 ) {
329 br_ptr->Fill();
330 --num;
331 }
332 if ( log().level() <= MSG::DEBUG )
333 log() << MSG::DEBUG << "commit: Added " << long( evt - br_evt ) << " Section: " << evt
334 << " Branch: " << br_ptr->GetEntries() << " RefNo: " << br_ptr->GetEntries() - 1
335 << " NULL entries to:" << br_ptr->GetName() << endmsg;
336 }
337 }
338
339 b->GetTree()->SetEntries( evt );
340 if ( log().level() <= MSG::DEBUG )
341 log() << MSG::DEBUG << "Set section entries of " << m_currSection << " to " << long( evt ) << " entries."
342 << endmsg;
343 } else {
344 return error( "commitOutput> Failed to update entry numbers on " + dsn );
345 }
346 }
347 return S_OK;
348}
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
#define S_OK
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & log() const
Helper: Use message streamer.
Definition RootCnvSvc.h:106
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition RootCnvSvc.h:87
std::string m_currSection
Property: ROOT section name.
Definition RootCnvSvc.h:95
@ DEBUG
Definition IMessageSvc.h:22

◆ connectDatabase()

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

Definition at line 210 of file RootCnvSvc.cpp.

210 {
211 try {
212 IDataConnection* c = m_ioMgr->connection( dataset );
213 bool fire_incident = false;
214 *con = nullptr;
215 if ( !c ) {
216 auto connection = std::make_unique<RootDataConnection>( this, dataset, m_setup );
217 StatusCode sc = ( mode != IDataConnection::READ )
218 ? m_ioMgr->connectWrite( connection.get(), IDataConnection::IoType( mode ), "ROOT" )
219 : m_ioMgr->connectRead( false, connection.get() );
220 c = sc.isSuccess() ? m_ioMgr->connection( dataset ) : nullptr;
221 if ( c ) {
222 bool writable = 0 != ( mode & ( IDataConnection::UPDATE | IDataConnection::RECREATE ) );
223 fire_incident = m_incidentEnabled && ( 0 != ( mode & ( IDataConnection::UPDATE | IDataConnection::READ ) ) );
224 if ( writable ) {
225 m_incidentSvc->fireIncident(
226 ContextIncident<TFile*>( connection->pfn(), "CONNECTED_OUTPUT", connection->file() ) );
227 }
228 if ( 0 != ( mode & IDataConnection::READ ) ) {
229 m_incidentSvc->fireIncident(
230 ContextIncident<TFile*>( connection->pfn(), "CONNECTED_INPUT", connection->file() ) );
231 if ( !m_ioPerfStats.empty() ) { connection->enableStatistics( m_setup->loadSection ); }
232 }
233 connection.release();
234 } else {
235 m_incidentSvc->fireIncident( Incident(
236 dataset, mode == IDataConnection::READ ? IncidentType::FailInputFile : IncidentType::FailOutputFile ) );
237 // An error message was already printed by the IODataManager. no need to do it here!
238 return StatusCode::FAILURE;
239 }
240 }
241 RootDataConnection* pc = dynamic_cast<RootDataConnection*>( c );
242 if ( pc ) {
243 if ( !pc->isConnected() )
244 if ( auto sc = pc->connectRead(); !sc ) return sc;
245 *con = pc;
246 pc->resetAge();
247 pc->addClient( this );
248 }
249 if ( *con ) {
250 if ( fire_incident ) {
251 IOpaqueAddress* pAddr = nullptr;
252 string fid = pc->fid();
253 string section = m_recordName[0] == '/' ? m_recordName.value().substr( 1 ) : m_recordName.value();
254 TBranch* b = pc->getBranch( section, m_recordName.value() );
255 if ( b ) {
256 const string par[2] = { fid, m_recordName };
257 unsigned long ipar[2] = { (unsigned long)( *con ), (unsigned long)b->GetEntries() - 1 };
258 for ( int i = 0; i < b->GetEntries(); ++i ) {
259 ipar[1] = i;
260 if ( !pc->mergeFIDs().empty() ) fid = pc->mergeFIDs()[i];
261 if ( !createAddress( repSvcType(), CLID_DataObject, par, ipar, pAddr ).isSuccess() ) {
262 if ( log().level() <= MSG::VERBOSE )
263 log() << MSG::VERBOSE << "Failed to create address for " << m_recordName << " in:" << fid << " ["
264 << pc->fid() << "][" << i << "]" << endmsg;
265 continue;
266 }
267 if ( log().level() <= MSG::VERBOSE )
268 log() << MSG::VERBOSE << "Prepare " << m_recordName << " " << fid << " [" << par[0] << "][" << i << "]"
269 << endmsg;
270 m_incidentSvc->fireIncident( ContextIncident<IOpaqueAddress*>( fid, "FILE_OPEN_READ", pAddr ) );
271 }
272 } else {
273 if ( log().level() <= MSG::VERBOSE )
274 log() << MSG::VERBOSE << "No valid Records " << m_recordName << " present in:" << pc->fid() << endmsg;
275 }
276 }
277
278 // We can remove retired connections, which are no longer used....
279 for ( auto& i : m_ioMgr->connections( this ) ) {
280 if ( i != *con && !i->isConnected() ) {
281 RootDataConnection* pc = dynamic_cast<RootDataConnection*>( i );
282 if ( pc && pc->lookupClient( this ) ) {
283 size_t num_client = pc->removeClient( this );
284 if ( num_client == 0 ) {
285 if ( m_ioMgr->disconnect( pc ).isSuccess() ) {
286 log() << MSG::INFO << "Removed disconnected IO stream:" << pc->fid() << " [" << pc->pfn() << "]"
287 << endmsg;
288 delete pc;
289 }
290 }
291 }
292 }
293 }
294 return S_OK;
295 }
296 m_incidentSvc->fireIncident( Incident( dataset, IncidentType::FailOutputFile ) );
297 return S_FAIL;
298 } catch ( exception& e ) {
299 m_incidentSvc->fireIncident( Incident( dataset, IncidentType::FailOutputFile ) );
300 return error( string( "connectDatabase> Caught exception:" ) + e.what() );
301 } catch ( ... ) {
302 m_incidentSvc->fireIncident( Incident( dataset, IncidentType::FailOutputFile ) );
303 return error( "connectDatabase> Unknown Fatal Exception for " + dataset );
304 }
305}
#define S_FAIL
long repSvcType() const override
Retrieve the class type of the data store the converter uses.
IoType
I/O Connection types.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition RootCnvSvc.h:85
Gaudi::Property< bool > m_incidentEnabled
Definition RootCnvSvc.h:67
StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
IAddressCreator implementation: Address creation.
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition RootCnvSvc.h:83
Gaudi::Property< std::string > m_ioPerfStats
Definition RootCnvSvc.h:63
Gaudi::Property< std::string > m_recordName
Definition RootCnvSvc.h:68
bool isSuccess() const
Definition StatusCode.h:314
constexpr static const auto FAILURE
Definition StatusCode.h:100
constexpr double pc
@ INFO
Definition IMessageSvc.h:22
@ VERBOSE
Definition IMessageSvc.h:22

◆ connectOutput() [1/2]

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

Connect the output file to the service.

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

◆ connectOutput() [2/2]

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

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.

◆ createAddress() [1/2]

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

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.

Definition at line 199 of file RootCnvSvc.h.

200 {
201 return this->ConversionSvc::createAddress( svc_type, clid, refAddress, refpAddress );
202 }
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.

◆ createAddress() [2/2]

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
refLinkReference to abstract link information
dbNameDatabase name
containerNameObject container name
refpAddressOpaque address information to retrieve object
Returns
StatusCode indicating SUCCESS or failure

Definition at line 357 of file RootCnvSvc.cpp.

358 {
359 refpAddress = new RootAddress( typ, clid, par[0], par[1], ip[0], ip[1] );
360 return S_OK;
361}

◆ createConverter()

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

ConversionSvc overload: Create new Converter using factory.

Reimplemented from ConversionSvc.

Definition at line 146 of file RootCnvSvc.cpp.

146 {
147 if ( wanted == CLID_StatisticsFile )
148 return new RootDatabaseCnv( typ, wanted, serviceLocator().get(), this );
149 else if ( wanted == CLID_StatisticsDirectory )
150 return new RootDirectoryCnv( typ, wanted, serviceLocator().get(), this );
151 else if ( wanted == CLID_RowWiseTuple )
152 return new RootNTupleCnv( typ, wanted, serviceLocator().get(), this );
153 else if ( wanted == CLID_ColumnWiseTuple )
154 return new RootNTupleCnv( typ, wanted, serviceLocator().get(), this );
155 else
156 return new RootConverter( typ, wanted, serviceLocator().get(), this );
157}
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition Service.cpp:336
get
decorate the vector of properties
Definition decorators.py:94

◆ createNullRef()

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

373 {
374 RootObjectRefs* refs = nullptr;
375 size_t len = path.find( '/', 1 );
376 string section = path.substr( 1, len == string::npos ? string::npos : len - 1 );
377 pair<int, unsigned long> ret = m_current->save( section, path + "#R", nullptr, refs, m_minBufferSize, m_maxBufferSize,
379 if ( log().level() <= MSG::VERBOSE )
380 log() << MSG::VERBOSE << "Writing object:" << path << " " << ret.first << " " << hex << ret.second << dec
381 << " [NULL]" << endmsg;
382 return S_OK;
383}
Gaudi::Property< int > m_approxEventsPerBasket
Definition RootCnvSvc.h:76
Gaudi::Property< int > m_maxBufferSize
Definition RootCnvSvc.h:74
Gaudi::Property< int > m_splitLevel
Definition RootCnvSvc.h:78
Gaudi::Property< int > m_minBufferSize
Definition RootCnvSvc.h:72
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
MsgStream & dec(MsgStream &log)
Definition MsgStream.h:254
MsgStream & hex(MsgStream &log)
Definition MsgStream.h:258

◆ createNullRep()

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

364 {
365 size_t len = path.find( '/', 1 );
366 string section = path.substr( 1, len == string::npos ? string::npos : len - 1 );
367 m_current->saveObj( section, path, nullptr, nullptr, m_minBufferSize, m_maxBufferSize, m_approxEventsPerBasket,
368 m_splitLevel );
369 return S_OK;
370}

◆ disconnect()

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

Definition at line 351 of file RootCnvSvc.cpp.

351 {
352 IDataConnection* c = m_ioMgr->connection( dataset );
353 return c ? m_ioMgr->disconnect( c ) : S_FAIL;
354}

◆ error()

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

79 {
80 if ( m_log ) {
81 log() << MSG::ERROR << "Error: " << msg << endmsg;
82 return S_FAIL;
83 }
84 MsgStream m( msgSvc(), name() );
85 m << MSG::ERROR << "Error: " << msg << endmsg;
86 return S_FAIL;
87}
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition RootCnvSvc.h:101
const std::string & name() const override
Retrieve name of the service.
Definition Service.cpp:333
constexpr double m
@ ERROR
Definition IMessageSvc.h:22

◆ finalize()

StatusCode RootCnvSvc::finalize ( )
override

ConversionSvc overload: Finalize Db service.

Definition at line 118 of file RootCnvSvc.cpp.

118 {
119 log() << MSG::INFO;
120 if ( m_ioMgr ) {
121 IIODataManager::Connections cons = m_ioMgr->connections( nullptr );
122 for ( auto& i : cons ) {
123 auto pc = dynamic_cast<RootDataConnection*>( i );
124 if ( pc ) {
125 if ( pc->owner() == this && !m_ioPerfStats.empty() ) { pc->saveStatistics( m_ioPerfStats.value() ); }
126 if ( pc->lookupClient( this ) ) {
127 size_t num_clients = pc->removeClient( this );
128 if ( num_clients == 0 ) {
129 if ( m_ioMgr->disconnect( pc ).isSuccess() ) {
130 log() << "Disconnected data IO:" << pc->fid() << " [" << pc->pfn() << "]" << endmsg;
131 delete pc;
132 }
133 }
134 }
135 }
136 }
137 m_ioMgr.reset();
138 }
139 m_log.reset();
140 m_incidentSvc.reset();
141 m_setup->setIncidentSvc( nullptr );
143}
StatusCode finalize() override
stop the service.
std::vector< Connection * > Connections

◆ getClass()

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

Helper: Get TClass for a given DataObject pointer.

Definition at line 177 of file RootCnvSvc.cpp.

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

◆ i__createObj()

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

448 {
449 refpObj = nullptr;
450 if ( !pA ) return S_FAIL;
451 RootDataConnection* con = nullptr;
452 const string* par = pA->par();
453 unsigned long* ipar = const_cast<unsigned long*>( pA->ipar() );
454 StatusCode sc = connectDatabase( par[0], IDataConnection::READ, &con );
455 if ( sc.isSuccess() ) {
456 ipar[0] = (unsigned long)con;
457 DataObject* pObj = nullptr;
458 size_t len = par[1].find( '/', 1 );
459 string section = par[1].substr( 1, len == string::npos ? string::npos : len - 1 );
460
461 int nb = con->loadObj( section, par[1], ipar[1], pObj );
462 if ( nb > 1 || ( nb == 1 && pObj->clID() == CLID_DataObject ) ) {
463 refpObj = pObj;
464 return S_OK;
465 }
466 delete pObj;
467 }
468 string tag = par[0] + ":" + par[1];
469
470 const auto [itr, new_bad] = m_badFiles.insert( tag );
471 if ( new_bad ) { return error( "createObj> Cannot access the object:" + tag ); }
472 return S_FAIL;
473}
StatusCode connectDatabase(const std::string &dataset, int mode, RootDataConnection **con)
Connect the output file to the service with open mode.
std::set< std::string > m_badFiles
Set with bad files/tables.
Definition RootCnvSvc.h:98
int loadObj(std::string_view section, std::string_view cnt, unsigned long entry, DataObject *&pObj)
Load object.

◆ i__createRep()

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

386 {
387 refpAddr = nullptr;
388 if ( !pObj ) return error( "createRep> Current Database is invalid!" );
389 CLID clid = pObj->clID();
390 IRegistry* pR = pObj->registry();
391 string p[2] = { m_current->fid(), pR->identifier() };
392 TClass* cl = ( clid == CLID_DataObject ) ? m_classDO : getClass( pObj );
393 size_t len = p[1].find( '/', 1 );
394 string sect = p[1].substr( 1, len == string::npos ? string::npos : len - 1 );
395 pair<int, unsigned long> ret = m_current->saveObj( sect, p[1], cl, pObj, m_minBufferSize, m_maxBufferSize,
397 if ( ret.first > 1 || ( clid == CLID_DataObject && ret.first == 1 ) ) {
398 unsigned long ip[2] = { 0, ret.second };
399 if ( m_currSection.empty() ) m_currSection = p[1];
400 return createAddress( repSvcType(), clid, p, ip, refpAddr );
401 }
402 return error( "Failed to write object data for:" + p[1] );
403}
unsigned int CLID
Class ID definition.
Definition ClassID.h:16
IRegistry * registry() const
Get pointer to Registry.
Definition DataObject.h:79
TClass * m_classDO
TClass pointer to DataObject class.
Definition RootCnvSvc.h:91
TClass * getClass(DataObject *pObject)
Helper: Get TClass for a given DataObject pointer.
virtual const id_type & identifier() const =0
Full identifier (or key)

◆ i__fillObjRefs()

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

476 {
477 if ( !pA || !pObj ) return error( "read> Cannot read object -- no valid object address present " );
478
479 const unsigned long* ipar = pA->ipar();
480 RootDataConnection* con = (RootDataConnection*)ipar[0];
481 if ( con ) {
482 RootObjectRefs refs;
483 const string* par = pA->par();
484 size_t len = par[1].find( '/', 1 );
485 string section = par[1].substr( 1, len == string::npos ? string::npos : len - 1 );
486 int nb = con->loadRefs( section, par[1], ipar[1], refs );
487 if ( nb >= 1 ) {
488 string npar[3];
489 unsigned long nipar[2];
490 IRegistry* pR = pObj->registry();
491 auto dataMgr = SmartIF<IDataManagerSvc>{ pR->dataSvc() };
492 LinkManager* mgr = pObj->linkMgr();
493 for ( const auto& i : refs.links ) mgr->addLink( con->getLink( i ), nullptr );
494 for ( auto& r : refs.refs ) {
495 npar[0] = con->getDb( r.dbase );
496 npar[1] = con->getCont( r.container );
497 npar[2] = con->getLink( r.link );
498 nipar[0] = 0;
499 nipar[1] = r.entry;
500 IOpaqueAddress* nPA = nullptr;
501 StatusCode sc = addressCreator()->createAddress( r.svc, r.clid, npar, nipar, nPA );
502 if ( sc.isSuccess() ) {
503 if ( log().level() <= MSG::VERBOSE )
504 log() << MSG::VERBOSE << dataMgr.as<IService>()->name() << " -> Register:" << pA->registry()->identifier()
505 << "#" << npar[2] << "[" << r.entry << "]" << endmsg;
506 sc = dataMgr->registerAddress( pA->registry(), npar[2], nPA );
507 if ( sc.isSuccess() ) continue;
508 }
509 log() << MSG::ERROR << con->fid() << ": Failed to create address!!!!" << endmsg;
510 return S_FAIL;
511 }
512 return pObj->update();
513 } else if ( nb < 0 ) {
514 string tag = par[0] + ":" + par[1];
515
516 const auto [itr, new_bad] = m_badFiles.insert( tag );
517 if ( new_bad ) { return error( "createObj> Cannot access the object:" + tag + " [Corrupted file]" ); }
518 }
519 }
520 return S_FAIL;
521}
SmartIF< IAddressCreator > & addressCreator() const override
Retrieve address creator facility.
LinkManager * linkMgr()
Retrieve Link manager.
Definition DataObject.h:81
virtual StatusCode update()
Provide empty placeholder for internal object reconfiguration callback.
const std::string & fid() const
Access file id.
const std::string & getLink(int which) const
Access link name from saved index.
const std::string & getDb(int which) const
Access database/file name from saved index.
int loadRefs(std::string_view section, std::string_view cnt, unsigned long entry, RootObjectRefs &refs)
Load references object.
const std::string & getCont(int which) const
Access container name from saved index.
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.
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
std::vector< int > links
The links of the link manager.
Definition RootRefs.h:69
std::vector< RootRef > refs
The references corresponding to the next layer of items in the data store.
Definition RootRefs.h:71

◆ i__fillRepRefs()

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

406 {
407 if ( pObj ) {
408 typedef vector<IRegistry*> Leaves;
409 Leaves leaves;
410 RootObjectRefs refs;
411 IRegistry* pR = pObj->registry();
412 auto dataMgr = SmartIF<IDataManagerSvc>{ pR->dataSvc() };
413 if ( dataMgr ) {
414 StatusCode status = dataMgr->objectLeaves( pObj, leaves );
415 if ( status.isSuccess() ) {
416 RootRef ref;
417 const string& id = pR->identifier();
418 size_t len = id.find( '/', 1 );
419 string sect = id.substr( 1, len == string::npos ? string::npos : len - 1 );
420 LinkManager* pLinks = pObj->linkMgr();
421 for ( auto& i : leaves ) {
422 if ( i->address() ) {
423 m_current->makeRef( *i, ref );
424 ref.entry = i->address()->ipar()[1];
425 refs.refs.push_back( ref );
426 }
427 }
428 for ( int i = 0, n = pLinks->size(); i < n; ++i ) {
429 const LinkManager::Link* lnk = pLinks->link( i );
430 int link_id = m_current->makeLink( lnk->path() );
431 refs.links.push_back( link_id );
432 }
433 pair<int, unsigned long> ret = m_current->save( sect, id + "#R", m_classRefs, &refs, m_minBufferSize,
435 if ( ret.first > 1 ) {
436 if ( log().level() <= MSG::DEBUG )
437 log() << MSG::DEBUG << "Writing object:" << id << " " << ret.first << " " << hex << ret.second << dec
438 << endmsg;
439 return S_OK;
440 }
441 }
442 }
443 }
444 return S_FAIL;
445}
TClass * m_classRefs
TClass pointer to reference class.
Definition RootCnvSvc.h:89

◆ initialize()

StatusCode RootCnvSvc::initialize ( )
override

ConversionSvc overload: initialize Db service.

Definition at line 90 of file RootCnvSvc.cpp.

90 {
91 string cname;
92 StatusCode status = ConversionSvc::initialize();
93 if ( !status.isSuccess() ) { return error( "Failed to initialize ConversionSvc base class." ); }
94 m_log.reset( new MsgStream( msgSvc(), name() ) );
95 if ( !m_compression.empty() ) {
96 log() << MSG::INFO << "Setting global ROOT compression to:" << m_compression.value() << endmsg;
97 if ( !( status = RootConnectionSetup::setCompression( m_compression.value() ) ).isSuccess() ) {
98 return error( "Unable to interprete ROOT compression encoding:" + m_compression );
99 }
100 }
101 m_ioMgr = service( "IODataManager" );
102 if ( !m_ioMgr ) return error( "Unable to localize interface from service:IODataManager" );
103 m_incidentSvc = service( "IncidentSvc" );
104 if ( !m_incidentSvc ) return error( "Unable to localize interface from service:IncidentSvc" );
105 m_setup->setMessageSvc( new MsgStream( msgSvc(), name() ) );
106 m_setup->setIncidentSvc( m_incidentSvc.get() );
108 cname = System::typeinfoName( typeid( DataObject ) );
109 m_classDO = TClass::GetClass( cname.c_str() );
110 if ( !m_classDO ) return error( "Unable to load class description for DataObject" );
111 cname = System::typeinfoName( typeid( RootObjectRefs ) );
112 m_classRefs = TClass::GetClass( cname.c_str() );
113 if ( !m_classRefs ) return error( "Unable to load class description for ObjectRefs" );
114 return S_OK;
115}
StatusCode initialize() override
Initialize the service.
Gaudi::Property< std::string > m_compression
Definition RootCnvSvc.h:79
static StatusCode setCompression(std::string_view compression)
Set the global compression level.
SmartIF< IFace > service(const std::string &name, bool createIf=true) const
Definition Service.h:79
bool patchStreamers(MsgStream &log)

◆ loadConverter()

void RootCnvSvc::loadConverter ( DataObject * pObj)
overridevirtual

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

Reimplemented from ConversionSvc.

Definition at line 160 of file RootCnvSvc.cpp.

160 {
161 if ( pObject ) {
162 string cname = System::typeinfoName( typeid( *pObject ) );
163 if ( log().level() <= MSG::DEBUG )
164 log() << MSG::DEBUG << "Trying to 'Autoload' dictionary for class " << cname << endmsg;
165 TClass* cl = s_classesNames[cname];
166 if ( nullptr == cl ) {
167 cl = TClass::GetClass( cname.c_str() );
168 if ( cl ) {
169 s_classesNames[cname] = cl;
170 s_classesClids[pObject->clID()] = cl;
171 }
172 }
173 }
174}

◆ log()

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

Helper: Use message streamer.

Definition at line 106 of file RootCnvSvc.h.

106{ return *m_log; }

◆ updateServiceState()

StatusCode Gaudi::RootCnvSvc::updateServiceState ( IOpaqueAddress * )
inlineoverridevirtual

Update state of the service.

Reimplemented from ConversionSvc.

Definition at line 113 of file RootCnvSvc.h.

113{ return StatusCode::SUCCESS; }
constexpr static const auto SUCCESS
Definition StatusCode.h:99

Member Data Documentation

◆ m_approxEventsPerBasket

Gaudi::Property<int> Gaudi::RootCnvSvc::m_approxEventsPerBasket
protected
Initial value:
{ this, "ApproxEventsPerBasket", 1000,
"Resize TBasket buffers to fit approximately this many events" }

Definition at line 76 of file RootCnvSvc.h.

76 { this, "ApproxEventsPerBasket", 1000,
77 "Resize TBasket buffers to fit approximately this many events" };

◆ m_badFiles

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

Set with bad files/tables.

Definition at line 98 of file RootCnvSvc.h.

◆ m_classDO

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

TClass pointer to DataObject class.

Definition at line 91 of file RootCnvSvc.h.

◆ m_classRefs

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

TClass pointer to reference class.

Definition at line 89 of file RootCnvSvc.h.

◆ m_compression

Gaudi::Property<std::string> Gaudi::RootCnvSvc::m_compression
protected
Initial value:
{ this, "GlobalCompression", "",
"Compression-algorithm:compression-level, empty: do nothing" }

Definition at line 79 of file RootCnvSvc.h.

79 { this, "GlobalCompression", "",
80 "Compression-algorithm:compression-level, empty: do nothing" };

◆ m_current

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

On writing: reference to active output stream.

Definition at line 87 of file RootCnvSvc.h.

◆ m_currSection

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

Property: ROOT section name.

Definition at line 95 of file RootCnvSvc.h.

◆ m_incidentEnabled

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

Definition at line 67 of file RootCnvSvc.h.

67{ this, "EnableIncident", true, "Flag to enable incidents on FILE_OPEN" };

◆ m_incidentSvc

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

Reference to incident service.

Definition at line 85 of file RootCnvSvc.h.

◆ m_ioMgr

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

Reference to the I/O data manager.

Definition at line 83 of file RootCnvSvc.h.

◆ m_ioPerfStats

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 63 of file RootCnvSvc.h.

63 {
64 this, "IOPerfStats", "", "Enable TTree IOperfStats if not empty; otherwise perf stat file name" };

◆ m_log

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

Message streamer.

Definition at line 101 of file RootCnvSvc.h.

◆ m_maxBufferSize

Gaudi::Property<int> Gaudi::RootCnvSvc::m_maxBufferSize
protected
Initial value:
{ this, "MaxBufferSize", 100 * 1024 * 1024 ,
"Maximum buffer size to use for writing TTree baskets" }

Definition at line 74 of file RootCnvSvc.h.

74 { this, "MaxBufferSize", 100 * 1024 * 1024 /*MBYTE*/,
75 "Maximum buffer size to use for writing TTree baskets" };

◆ m_minBufferSize

Gaudi::Property<int> Gaudi::RootCnvSvc::m_minBufferSize
protected
Initial value:
{ this, "MinBufferSize", 2 * 1024 ,
"Minimum buffer size to use for writing TTree baskets" }

Definition at line 72 of file RootCnvSvc.h.

72 { this, "MinBufferSize", 2 * 1024 /*kBYTE*/,
73 "Minimum buffer size to use for writing TTree baskets" };

◆ m_recordName

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 68 of file RootCnvSvc.h.

68 { this, "RecordsName", "/FileRecords",
69 "Records name to fire incident for file records" };

◆ m_setup

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

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

Definition at line 93 of file RootCnvSvc.h.

◆ m_shareFiles

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 65 of file RootCnvSvc.h.

65 { this, "ShareFiles", "NO",
66 "Share files? If set to YES, files will not be closed on finalize" };

◆ m_splitLevel

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

Definition at line 78 of file RootCnvSvc.h.

78{ this, "SplitLevel", 0, "Split level optimization parameter for ROOT TTree" };

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