The Gaudi Framework  v36r9p1 (5c15b2bb)
Gaudi::RootCnvSvc Class Reference

#include <src/RootCnvSvc.h>

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

Public Member Functions

 RootCnvSvc (const std::string &name, ISvcLocator *svc)
 Standard constructor. More...
 
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...
 
IConvertercreateConverter (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...
 
ConversionSvcoperator= (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 CLIDobjType () 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...
 
IConverterconverter (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::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
- Public Member Functions inherited from Service
const std::stringname () 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...
 
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 >
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, std::string toolTypeAndName, bool createIf=true)
 Declare used tool. More...
 
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. More...
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
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. More...
 
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. More...
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property. More...
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property. More...
 
virtual StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p)=0
 Set the property from a property with a different name. More...
 
virtual StatusCode setProperty (const std::string &s)=0
 Set the property by string. More...
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals. More...
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string. More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name More...
 
StatusCode getProperty (std::string_view 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 (std::string_view name) const override
 Return true if we have a property with the given name. More...
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected More...
 
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) More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 

Protected Member Functions

TClass * getClass (DataObject *pObject)
 Helper: Get TClass for a given DataObject pointer. More...
 
MsgStreamlog () const
 Helper: Use message streamer. More...
 
- Protected Member Functions inherited from ConversionSvc
virtual 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
std::vector< IAlgTool * > & tools ()
 
 ~Service () override
 Standard Destructor
More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 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::stringm_ioPerfStats
 
Gaudi::Property< std::stringm_shareFiles
 
Gaudi::Property< bool > m_incidentEnabled { this, "EnableIncident", true, "Flag to enable incidents on FILE_OPEN" }
 
Gaudi::Property< std::stringm_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::stringm_compression
 
SmartIF< Gaudi::IIODataManagerm_ioMgr
 Reference to the I/O data manager. More...
 
SmartIF< IIncidentSvcm_incidentSvc
 Reference to incident service. More...
 
Gaudi::RootDataConnectionm_current = nullptr
 On writing: reference to active output stream. More...
 
TClass * m_classRefs = nullptr
 TClass pointer to reference class. More...
 
TClass * m_classDO = nullptr
 TClass pointer to DataObject class. More...
 
std::shared_ptr< RootConnectionSetupm_setup
 Setup structure (ref-counted) and passed to data connections. More...
 
std::string m_currSection
 Property: ROOT section name. More...
 
std::set< std::stringm_badFiles
 Set with bad files/tables. More...
 
std::unique_ptr< MsgStreamm_log
 Message streamer. More...
 
- Protected Attributes inherited from ConversionSvc
SmartIF< IDataProviderSvcm_dataSvc
 Pointer to data provider service. More...
 
SmartIF< IAddressCreatorm_addressCreator
 Pointer to the address creation service interface. More...
 
SmartIF< IConversionSvcm_cnvSvc
 Pointer to the IConversionSvc interface of this. More...
 
long m_type
 Conversion service type. More...
 
std::vector< WorkerEntrym_workers
 List of conversion workers. More...
 
- 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" }
 flag indicating whether ToolHandle tools have been added to m_tools More...
 
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()" }
 
Gaudi::Property< bool > m_autoRetrieveTools
 
Gaudi::Property< bool > m_checkToolDeps
 
SmartIF< IAuditorSvcm_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
using Factory = Gaudi::PluginService::Factory< IService *(const std::string &, ISvcLocator *)>
 
- 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 62 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.

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 }

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

306  {
307  if ( m_current ) {
308  size_t len = m_currSection.find( '/', 1 );
309  string section = m_currSection.substr( 1, len == string::npos ? string::npos : len - 1 );
310  TBranch* b = m_current->getBranch( section, m_currSection );
311  if ( b ) {
312  Long64_t evt = b->GetEntries();
313  TTree* t = b->GetTree();
314  TObjArray* a = t->GetListOfBranches();
315  Int_t nb = a->GetEntriesFast();
317  for ( Int_t i = 0; i < nb; ++i ) {
318  TBranch* br_ptr = (TBranch*)a->UncheckedAt( i );
319  Long64_t br_evt = br_ptr->GetEntries();
320  if ( br_evt < evt ) {
321  Long64_t num = evt - br_evt;
322  br_ptr->SetAddress( nullptr );
323  while ( num > 0 ) {
324  br_ptr->Fill();
325  --num;
326  }
327  if ( log().level() <= MSG::DEBUG )
328  log() << MSG::DEBUG << "commit: Added " << long( evt - br_evt ) << " Section: " << evt
329  << " Branch: " << br_ptr->GetEntries() << " RefNo: " << br_ptr->GetEntries() - 1
330  << " NULL entries to:" << br_ptr->GetName() << endmsg;
331  }
332  }
333 
334  b->GetTree()->SetEntries( evt );
335  if ( log().level() <= MSG::DEBUG )
336  log() << MSG::DEBUG << "Set section entries of " << m_currSection << " to " << long( evt ) << " entries."
337  << endmsg;
338  } else {
339  return error( "commitOutput> Failed to update entry numbers on " + dsn );
340  }
341  }
342  return S_OK;
343 }

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

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

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

201  {
202  return this->ConversionSvc::createAddress( svc_type, clid, refAddress, refpAddress );
203  }

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

353  {
354  refpAddress = new RootAddress( typ, clid, par[0], par[1], ip[0], ip[1] );
355  return S_OK;
356 }

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

143  {
144  if ( wanted == CLID_StatisticsFile )
145  return new RootDatabaseCnv( typ, wanted, serviceLocator().get(), this );
146  else if ( wanted == CLID_StatisticsDirectory )
147  return new RootDirectoryCnv( typ, wanted, serviceLocator().get(), this );
148  else if ( wanted == CLID_RowWiseTuple )
149  return new RootNTupleCnv( typ, wanted, serviceLocator().get(), this );
150  else if ( wanted == CLID_ColumnWiseTuple )
151  return new RootNTupleCnv( typ, wanted, serviceLocator().get(), this );
152  else
153  return new RootConverter( typ, wanted, serviceLocator().get(), this );
154 }

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

368  {
369  RootObjectRefs* refs = nullptr;
370  size_t len = path.find( '/', 1 );
371  string section = path.substr( 1, len == string::npos ? string::npos : len - 1 );
372  pair<int, unsigned long> ret = m_current->save( section, path + "#R", nullptr, refs, m_minBufferSize, m_maxBufferSize,
374  if ( log().level() <= MSG::VERBOSE )
375  log() << MSG::VERBOSE << "Writing object:" << path << " " << ret.first << " " << hex << ret.second << dec
376  << " [NULL]" << endmsg;
377  return S_OK;
378 }

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

359  {
360  size_t len = path.find( '/', 1 );
361  string section = path.substr( 1, len == string::npos ? string::npos : len - 1 );
363  m_splitLevel );
364  return S_OK;
365 }

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

346  {
347  IDataConnection* c = m_ioMgr->connection( dataset );
348  return c ? m_ioMgr->disconnect( c ) : S_FAIL;
349 }

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

76  {
77  if ( m_log ) {
78  log() << MSG::ERROR << "Error: " << msg << endmsg;
79  return S_FAIL;
80  }
81  MsgStream m( msgSvc(), name() );
82  m << MSG::ERROR << "Error: " << msg << endmsg;
83  return S_FAIL;
84 }

◆ finalize()

StatusCode RootCnvSvc::finalize ( )
override

ConversionSvc overload: Finalize Db service.

Definition at line 115 of file RootCnvSvc.cpp.

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

◆ getClass()

TClass * RootCnvSvc::getClass ( DataObject pObject)
protected

Helper: Get TClass for a given DataObject pointer.

Definition at line 174 of file RootCnvSvc.cpp.

174  {
175  auto i = s_classesClids.find( pObject->clID() );
176  if ( i != s_classesClids.end() ) return i->second;
177  loadConverter( pObject );
178  i = s_classesClids.find( pObject->clID() );
179  if ( i != s_classesClids.end() ) return i->second;
180 
181  string cname = System::typeinfoName( typeid( *pObject ) );
182  throw runtime_error( "Unknown ROOT class for object:" + cname );
183  return nullptr;
184 }

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

443  {
444  refpObj = nullptr;
445  if ( !pA ) return S_FAIL;
446  RootDataConnection* con = nullptr;
447  const string* par = pA->par();
448  unsigned long* ipar = const_cast<unsigned long*>( pA->ipar() );
450  if ( sc.isSuccess() ) {
451  ipar[0] = (unsigned long)con;
452  DataObject* pObj = nullptr;
453  size_t len = par[1].find( '/', 1 );
454  string section = par[1].substr( 1, len == string::npos ? string::npos : len - 1 );
455 
456  int nb = con->loadObj( section, par[1], ipar[1], pObj );
457  if ( nb > 1 || ( nb == 1 && pObj->clID() == CLID_DataObject ) ) {
458  refpObj = pObj;
459  return S_OK;
460  }
461  delete pObj;
462  }
463  string tag = par[0] + ":" + par[1];
464  if ( m_badFiles.find( tag ) == m_badFiles.end() ) {
465  m_badFiles.insert( tag );
466  return error( "createObj> Cannot access the object:" + tag );
467  }
468  return S_FAIL;
469 }

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

381  {
382  refpAddr = nullptr;
383  if ( !pObj ) return error( "createRep> Current Database is invalid!" );
384  CLID clid = pObj->clID();
385  IRegistry* pR = pObj->registry();
386  string p[2] = { m_current->fid(), pR->identifier() };
387  TClass* cl = ( clid == CLID_DataObject ) ? m_classDO : getClass( pObj );
388  size_t len = p[1].find( '/', 1 );
389  string sect = p[1].substr( 1, len == string::npos ? string::npos : len - 1 );
392  if ( ret.first > 1 || ( clid == CLID_DataObject && ret.first == 1 ) ) {
393  unsigned long ip[2] = { 0, ret.second };
394  if ( m_currSection.empty() ) m_currSection = p[1];
395  return createAddress( repSvcType(), clid, p, ip, refpAddr );
396  }
397  return error( "Failed to write object data for:" + p[1] );
398 }

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

472  {
473  if ( !pA || !pObj ) return error( "read> Cannot read object -- no valid object address present " );
474 
475  const unsigned long* ipar = pA->ipar();
476  RootDataConnection* con = (RootDataConnection*)ipar[0];
477  if ( con ) {
478  RootObjectRefs refs;
479  const string* par = pA->par();
480  size_t len = par[1].find( '/', 1 );
481  string section = par[1].substr( 1, len == string::npos ? string::npos : len - 1 );
482  int nb = con->loadRefs( section, par[1], ipar[1], refs );
483  if ( nb >= 1 ) {
484  string npar[3];
485  unsigned long nipar[2];
486  IRegistry* pR = pObj->registry();
487  auto dataMgr = SmartIF<IDataManagerSvc>{ pR->dataSvc() };
488  LinkManager* mgr = pObj->linkMgr();
489  for ( const auto& i : refs.links ) mgr->addLink( con->getLink( i ), nullptr );
490  for ( auto& r : refs.refs ) {
491  npar[0] = con->getDb( r.dbase );
492  npar[1] = con->getCont( r.container );
493  npar[2] = con->getLink( r.link );
494  nipar[0] = 0;
495  nipar[1] = r.entry;
496  IOpaqueAddress* nPA = nullptr;
497  StatusCode sc = addressCreator()->createAddress( r.svc, r.clid, npar, nipar, nPA );
498  if ( sc.isSuccess() ) {
499  if ( log().level() <= MSG::VERBOSE )
500  log() << MSG::VERBOSE << dataMgr.as<IService>()->name() << " -> Register:" << pA->registry()->identifier()
501  << "#" << npar[2] << "[" << r.entry << "]" << endmsg;
502  sc = dataMgr->registerAddress( pA->registry(), npar[2], nPA );
503  if ( sc.isSuccess() ) continue;
504  }
505  log() << MSG::ERROR << con->fid() << ": Failed to create address!!!!" << endmsg;
506  return S_FAIL;
507  }
508  return pObj->update();
509  } else if ( nb < 0 ) {
510  string tag = par[0] + ":" + par[1];
511  if ( m_badFiles.find( tag ) == m_badFiles.end() ) {
512  m_badFiles.insert( tag );
513  return error( "createObj> Cannot access the object:" + tag + " [Corrupted file]" );
514  }
515  }
516  }
517  return S_FAIL;
518 }

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

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

◆ initialize()

StatusCode RootCnvSvc::initialize ( )
override

ConversionSvc overload: initialize Db service.

Definition at line 87 of file RootCnvSvc.cpp.

87  {
88  string cname;
90  if ( !status.isSuccess() ) { return error( "Failed to initialize ConversionSvc base class." ); }
91  m_log.reset( new MsgStream( msgSvc(), name() ) );
92  if ( !m_compression.empty() ) {
93  log() << MSG::INFO << "Setting global ROOT compression to:" << m_compression.value() << endmsg;
94  if ( !( status = RootConnectionSetup::setCompression( m_compression.value() ) ).isSuccess() ) {
95  return error( "Unable to interprete ROOT compression encoding:" + m_compression );
96  }
97  }
98  m_ioMgr = service( "IODataManager" );
99  if ( !m_ioMgr ) return error( "Unable to localize interface from service:IODataManager" );
100  m_incidentSvc = service( "IncidentSvc" );
101  if ( !m_incidentSvc ) return error( "Unable to localize interface from service:IncidentSvc" );
102  m_setup->setMessageSvc( new MsgStream( msgSvc(), name() ) );
103  m_setup->setIncidentSvc( m_incidentSvc.get() );
105  cname = System::typeinfoName( typeid( DataObject ) );
106  m_classDO = TClass::GetClass( cname.c_str() );
107  if ( !m_classDO ) return error( "Unable to load class description for DataObject" );
108  cname = System::typeinfoName( typeid( RootObjectRefs ) );
109  m_classRefs = TClass::GetClass( cname.c_str() );
110  if ( !m_classRefs ) return error( "Unable to load class description for ObjectRefs" );
111  return S_OK;
112 }

◆ loadConverter()

void RootCnvSvc::loadConverter ( DataObject pObj)
overridevirtual

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

Reimplemented from ConversionSvc.

Definition at line 157 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 }

◆ log()

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

Helper: Use message streamer.

Definition at line 107 of file RootCnvSvc.h.

107 { return *m_log; }

◆ updateServiceState()

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

Update state of the service.

Reimplemented from ConversionSvc.

Definition at line 114 of file RootCnvSvc.h.

114 { return StatusCode::SUCCESS; }

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

◆ m_badFiles

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

Set with bad files/tables.

Definition at line 99 of file RootCnvSvc.h.

◆ m_classDO

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

TClass pointer to DataObject class.

Definition at line 92 of file RootCnvSvc.h.

◆ m_classRefs

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

TClass pointer to reference class.

Definition at line 90 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 80 of file RootCnvSvc.h.

◆ m_current

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

On writing: reference to active output stream.

Definition at line 88 of file RootCnvSvc.h.

◆ m_currSection

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

Property: ROOT section name.

Definition at line 96 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 68 of file RootCnvSvc.h.

◆ m_incidentSvc

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

Reference to incident service.

Definition at line 86 of file RootCnvSvc.h.

◆ m_ioMgr

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

Reference to the I/O data manager.

Definition at line 84 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 64 of file RootCnvSvc.h.

◆ m_log

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

Message streamer.

Definition at line 102 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 75 of file RootCnvSvc.h.

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

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

◆ m_setup

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

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

Definition at line 94 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 66 of file RootCnvSvc.h.

◆ m_splitLevel

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

Definition at line 79 of file RootCnvSvc.h.


The documentation for this class was generated from the following files:
IOTest.evt
evt
Definition: IOTest.py:110
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:25
IService
Definition: IService.h:28
Gaudi::RootCnvSvc::m_maxBufferSize
Gaudi::Property< int > m_maxBufferSize
Definition: RootCnvSvc.h:75
MSG::hex
MsgStream & hex(MsgStream &log)
Definition: MsgStream.h:282
Gaudi::Units::pc
constexpr double pc
Definition: SystemOfUnits.h:116
Gaudi::RootCnvSvc::loadConverter
void loadConverter(DataObject *pObj) override
ConversionSvc overload: Load the class (dictionary) for the converter.
Definition: RootCnvSvc.cpp:157
std::exception
STL class.
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:300
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
MSG::INFO
@ INFO
Definition: IMessageSvc.h:25
Gaudi::RootCnvSvc::connectDatabase
StatusCode connectDatabase(const std::string &dataset, int mode, RootDataConnection **con)
Connect the output file to the service with open mode.
Definition: RootCnvSvc.cpp:207
Gaudi::IDataConnection
Definition: IIODataManager.h:34
Gaudi::RootCnvSvc::error
StatusCode error(const std::string &msg)
Standard way to print errors.
Definition: RootCnvSvc.cpp:76
std::pair
Gaudi::RootCnvSvc
Definition: RootCnvSvc.h:62
Properties.long
long
(c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations # # This software i...
Definition: Properties.py:15
IOpaqueAddress
Definition: IOpaqueAddress.h:33
Gaudi::RootCnvSvc::m_minBufferSize
Gaudi::Property< int > m_minBufferSize
Definition: RootCnvSvc.h:73
MBYTE
#define MBYTE
Definition: RootCnvSvc.cpp:57
std::vector
STL class.
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:96
std::string::find
T find(T... args)
Gaudi::RootDatabaseCnv
Definition: RootDatabaseCnv.h:38
Gaudi::RootDataConnection::getLink
const std::string & getLink(int which) const
Access link name from saved index.
Definition: RootDataConnection.h:344
ConversionSvc::ConversionSvc
ConversionSvc(const std::string &name, ISvcLocator *svc, long type)
Standard Constructor.
Definition: ConversionSvc.cpp:321
Gaudi::IDataConnection::RECREATE
@ RECREATE
Definition: IIODataManager.h:49
Gaudi::RootCnvSvc::m_incidentEnabled
Gaudi::Property< bool > m_incidentEnabled
Definition: RootCnvSvc.h:68
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:19
ContextIncident
Definition: DataIncident.h:26
Gaudi::RootDataConnection::saveObj
std::pair< int, unsigned long > saveObj(std::string_view section, std::string_view cnt, TClass *cl, DataObject *pObj, int minBufferSize, int maxBufferSize, int approxEventsPerBasket, int split_lvl, bool fill_missing=false)
Save object of a given class to section and container.
Definition: RootDataConnection.cpp:480
Gaudi::RootCnvSvc::m_log
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:102
gaudirun.c
c
Definition: gaudirun.py:525
IRegistry
Definition: IRegistry.h:32
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:310
Service::declareProperty
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
Definition: Service.h:134
std::unique_ptr::reset
T reset(T... args)
Gaudi::RootConverter
Definition: RootConverter.h:42
Gaudi::RootObjectRefs
Definition: RootRefs.h:68
Gaudi::RootDataConnection
Definition: RootDataConnection.h:107
std::vector::push_back
T push_back(T... args)
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:483
Gaudi::RootCnvSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition: RootCnvSvc.h:86
bug_34121.t
t
Definition: bug_34121.py:30
Gaudi::RootCnvSvc::m_badFiles
std::set< std::string > m_badFiles
Set with bad files/tables.
Definition: RootCnvSvc.h:99
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:352
Gaudi::RootDataConnection::getDb
const std::string & getDb(int which) const
Access database/file name from saved index.
Definition: RootDataConnection.cpp:468
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:444
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:47
Service::name
const std::string & name() const override
Retrieve name of the service
Definition: Service.cpp:332
StatusCode
Definition: StatusCode.h:65
Gaudi::RootNTupleCnv
Definition: RootNTupleCnv.h:45
HistoDumpEx.r
r
Definition: HistoDumpEx.py:20
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:108
MSG::dec
MsgStream & dec(MsgStream &log)
Definition: MsgStream.h:278
std::string::c_str
T c_str(T... args)
Gaudi::RootDataConnection::getCont
const std::string & getCont(int which) const
Access container name from saved index.
Definition: RootDataConnection.h:339
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:107
Gaudi::RootObjectRefs::links
std::vector< int > links
The links of the link manager.
Definition: RootRefs.h:70
Gaudi::IDataConnection::UPDATE
@ UPDATE
Definition: IIODataManager.h:49
Gaudi::Property::value
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:240
Gaudi::IDataConnection::READ
@ READ
Definition: IIODataManager.h:49
GaudiRoot::patchStreamers
bool patchStreamers(MsgStream &log)
Definition: RootIOHandler.cpp:211
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:961
Gaudi::RootRef
Definition: RootRefs.h:40
GaudiPython.Bindings.nullptr
nullptr
Definition: Bindings.py:93
Gaudi::RootConnectionSetup::setCompression
static StatusCode setCompression(std::string_view compression)
Set the global compression level.
Definition: RootDataConnection.cpp:122
Gaudi::IDataConnection::IoType
IoType
I/O Connection types.
Definition: IIODataManager.h:49
DataObject::update
virtual StatusCode update()
Provide empty placeholder for internal object reconfiguration callback.
Definition: DataObject.cpp:76
std::runtime_error
STL class.
Gaudi::RootCnvSvc::m_ioMgr
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:84
Gaudi::RootCnvSvc::m_splitLevel
Gaudi::Property< int > m_splitLevel
Definition: RootCnvSvc.h:79
SmartIF< IDataManagerSvc >
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
compareRootHistos.ref
string ref
Definition: compareRootHistos.py:28
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
Gaudi::RootDataConnection::makeRef
void makeRef(const IRegistry &pA, RootRef &ref)
Create reference object from registry entry.
Definition: RootDataConnection.cpp:628
ROOT_StorageType
const long ROOT_StorageType
Definition: ClassID.h:62
Gaudi::RootDirectoryCnv
Definition: RootDirectoryCnv.h:40
gaudirun.level
level
Definition: gaudirun.py:364
MsgStream
Definition: MsgStream.h:34
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:235
Gaudi::RootCnvSvc::m_ioPerfStats
Gaudi::Property< std::string > m_ioPerfStats
Definition: RootCnvSvc.h:64
Gaudi::RootDataConnection::makeLink
int makeLink(std::string_view p)
Convert path string to path index.
Definition: RootDataConnection.cpp:460
std::string::substr
T substr(T... args)
MSG::VERBOSE
@ VERBOSE
Definition: IMessageSvc.h:25
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
ConversionSvc::initialize
StatusCode initialize() override
Initialize the service.
Definition: ConversionSvc.cpp:237
Gaudi::RootConnectionSetup
Definition: RootDataConnection.h:55
Gaudi::RootCnvSvc::m_classDO
TClass * m_classDO
TClass pointer to DataObject class.
Definition: RootCnvSvc.h:92
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
Gaudi::RootDataConnection::loadRefs
int loadRefs(std::string_view section, std::string_view cnt, unsigned long entry, RootObjectRefs &refs)
Load references object.
Definition: RootDataConnection.cpp:585
Gaudi::RootCnvSvc::m_current
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:88
Gaudi::RootDataConnection::save
std::pair< int, unsigned long > save(std::string_view section, std::string_view cnt, TClass *cl, void *pObj, int minBufferSize, int maxBufferSize, int approxEventsPerBasket, int split_lvl, bool fill_missing=false)
Save object of a given class to section and container.
Definition: RootDataConnection.cpp:488
Gaudi::RootCnvSvc::getClass
TClass * getClass(DataObject *pObject)
Helper: Get TClass for a given DataObject pointer.
Definition: RootCnvSvc.cpp:174
Gaudi::RootCnvSvc::m_classRefs
TClass * m_classRefs
TClass pointer to reference class.
Definition: RootCnvSvc.h:90
ConversionSvc::finalize
StatusCode finalize() override
stop the service.
Definition: ConversionSvc.cpp:240
std::set::insert
T insert(T... args)
MSG::ERROR
@ ERROR
Definition: IMessageSvc.h:25
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
DataObject
Definition: DataObject.h:40
Gaudi::IDataConnection::fid
const std::string & fid() const
Access file id.
Definition: IIODataManager.h:63
std::string::empty
T empty(T... args)
Gaudi::RootCnvSvc::m_currSection
std::string m_currSection
Property: ROOT section name.
Definition: RootCnvSvc.h:96
Gaudi::RootCnvSvc::m_approxEventsPerBasket
Gaudi::Property< int > m_approxEventsPerBasket
Definition: RootCnvSvc.h:77
Gaudi::RootDataConnection::loadObj
int loadObj(std::string_view section, std::string_view cnt, unsigned long entry, DataObject *&pObj)
Load object.
Definition: RootDataConnection.cpp:535
std::set::end
T end(T... args)
Gaudi::RootObjectRefs::refs
std::vector< RootRef > refs
The references corresponding to the next layer of items in the data store.
Definition: RootRefs.h:72
Gaudi::RootCnvSvc::m_recordName
Gaudi::Property< std::string > m_recordName
Definition: RootCnvSvc.h:69
AsyncIncidents.msgSvc
msgSvc
Definition: AsyncIncidents.py:34
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
ConversionSvc::addressCreator
SmartIF< IAddressCreator > & addressCreator() const override
Retrieve address creator facility.
Definition: ConversionSvc.cpp:181
DataObject::linkMgr
LinkManager * linkMgr()
Retrieve Link manager.
Definition: DataObject.h:84
Gaudi::RootDataConnection::getBranch
TBranch * getBranch(std::string_view section, std::string_view branch_name)
Access data branch by name: Get existing branch in read only mode.
Definition: RootDataConnection.h:319
Incident
Definition: Incident.h:27
DataObject::clID
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:67
ConversionSvc::repSvcType
long repSvcType() const override
Retrieve the class type of the data store the converter uses.
Definition: ConversionSvc.cpp:286
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't already exist.
Definition: Service.h:88
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:82
Gaudi::RootCnvSvc::m_setup
std::shared_ptr< RootConnectionSetup > m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:94
MsgStream::level
MSG::Level level() const
Retrieve output level.
Definition: MsgStream.h:113
IRegistry::dataSvc
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
std::exception::what
T what(T... args)
S_FAIL
#define S_FAIL
Definition: RootCnvSvc.cpp:48
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator
Definition: Service.cpp:335
Gaudi::RootCnvSvc::m_compression
Gaudi::Property< std::string > m_compression
Definition: RootCnvSvc.h:80
Gaudi::RootAddress
Definition: RootAddress.h:46