| The Gaudi Framework v27r1

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

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

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

Description: More...

`#include <src/RootCnvSvc.h>`

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

## Public Member Functions
| RootCnvSvc (const std::string &name, ISvcLocator *svc)
| Standard constructor. More...
virtual | ~RootCnvSvc ()
| Standard destructor. More...
virtual StatusCode | updateServiceState (IOpaqueAddress *)
| Update state of the service. More...
StatusCode | error (const std::string &msg)
| Standard way to print errors. More...
StatusCode | connectDatabase (const std::string &dataset, int mode, RootDataConnection **con)
| Connect the output file to the service with open mode. More...
virtual StatusCode | initialize ()
| ConversionSvc overload: initialize Db service. More...
virtual StatusCode | finalize ()
| ConversionSvc overload: Finalize Db service. More...
virtual IConverter * | createConverter (long typ, const CLID &wanted, const ICnvFactory *fac)
| ConversionSvc overload: Create new Converter using factory. More...
virtual void | loadConverter (DataObject *pObj)
| ConversionSvc overload: Load the class (dictionary) for the converter. More...
virtual StatusCode | connectOutput (const std::string &outputFile, const std::string &openMode)
| Connect the output file to the service with open mode. More...
virtual StatusCode | connectOutput (const std::string &outputFile)
| Connect the output file to the service. More...
virtual StatusCode | commitOutput (const std::string &outputFile, bool do_commit)
| Commit pending output. More...
virtual StatusCode | disconnect (const std::string &dbName)
| Disconnect from an existing data stream. More...
virtual StatusCode | createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
| IAddressCreator implementation: Address creation. More...
virtual StatusCode | createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress)
| IAddressCreator implementation: Creates an address in string form to object form. More...
virtual StatusCode | createNullRep (const std::string &path)
| Insert null marker for not existent transient object. More...
virtual StatusCode | createNullRef (const std::string &path)
| Insert null marker for not existent transient object. More...
virtual StatusCode | i__createRep (DataObject *pObj, IOpaqueAddress *&refpAddr)
| Convert the transient object to the requested persistent representation. More...
virtual StatusCode | i__fillRepRefs (IOpaqueAddress *pAddr, DataObject *pObj)
| Resolve the references of the converted object. More...
virtual StatusCode | i__createObj (IOpaqueAddress *pAddr, DataObject *&refpObj)
| Create transient object from persistent data. More...
virtual StatusCode | i__fillObjRefs (IOpaqueAddress *pAddr, DataObject *pObj)
| Resolve the references of the created transient object. More...
Public Member Functions inherited from ConversionSvc
virtual long | repSvcType () const
| Retrieve the class type of the data store the converter uses. More...
const CLID & | objType () const
| Implementation of IConverter: dummy call. More...
virtual StatusCode | setDataProvider (IDataProviderSvc *pService)
| Implementation of IConverter: Set Data provider service. More...
virtual SmartIF< IDataProviderSvc > & | dataProvider () const
| Implementation of IConverter: Get Data provider service. More...
virtual StatusCode | setConversionSvc (IConversionSvc *svc)
| Implementation of IConverter: Set conversion service the converter is connected to. More...
virtual SmartIF< IConversionSvc > & | conversionSvc () const
| Implementation of IConverter: Get conversion service the converter is connected to. More...
virtual StatusCode | setAddressCreator (IAddressCreator *creator)
| Set address creator facility. More...
virtual SmartIF< IAddressCreator > & | addressCreator () const
| Retrieve address creator facility. More...
virtual StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject)
| Implementation of IConverter: Create the transient representation of an object. More...
virtual StatusCode | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
| Implementation of IConverter: Resolve the references of the created transient object. More...
virtual StatusCode | updateObj (IOpaqueAddress *pAddress, DataObject *refpObject)
| Implementation of IConverter: Update the transient object from the other representation. More...
virtual StatusCode | updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
| Implementation of IConverter: Update the references of an updated transient object. More...
virtual StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
| Implementation of IConverter: Convert the transient object to the requested representation. More...
virtual StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
| Implementation of IConverter: Resolve the references of the converted object. More...
virtual StatusCode | updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
| Implementation of IConverter: Update the converted representation of a transient object. More...
virtual StatusCode | updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
| Implementation of IConverter: Update the references of an already converted object. More...
virtual StatusCode | addConverter (const CLID &clid)
| Add converter object to conversion service. More...
virtual StatusCode | addConverter (IConverter *pConverter)
| Add converter object to conversion service. More...
virtual StatusCode | removeConverter (const CLID &clid)
| Remove converter object from conversion service (if present). More...
virtual IConverter * | converter (const CLID &wanted)
| Retrieve converter from list. More...
virtual StatusCode | convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress)
| Convert an address to string form. More...
| ConversionSvc (const std::string &name, ISvcLocator *svc, long type)
| Standard Constructor. More...
Public Member Functions inherited from extends< Service, IConversionSvc, IAddressCreator >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| ~extends () override=default
| Virtual destructor. More...
Public Member Functions inherited from Service
const std::string & | name () const override
| Retrieve name of the service. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
| Initialize Service. More...
StatusCode | sysStart () override
| Initialize Service. More...
StatusCode | sysStop () override
| Initialize Service. More...
StatusCode | sysFinalize () override
| Finalize Service. More...
StatusCode | sysReinitialize () override
| Re-initialize the Service. More...
StatusCode | sysRestart () override
| Re-initialize the Service. More...
StatusCode | setProperty (const Property &p) override
StatusCode | setProperty (const std::string &s) override
StatusCode | setProperty (const std::string &n, const std::string &v) override
StatusCode | getProperty (Property *p) const override
const Property & | getProperty (const std::string &name) const override
StatusCode | getProperty (const std::string &n, std::string &v) const override
const std::vector< Property * > & | getProperties () const override
bool | hasProperty (const std::string &name) const override
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
| Service (std::string name, ISvcLocator *svcloc)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job. More...
template<class T >
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<typename IFace = IService>
SmartIF< IFace > | service (const std::string &name, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist. More...
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties. More...
template<class T >
StatusCode | declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used Private tool. More...
template<class T >
StatusCode | declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used Public tool. More...
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces...>
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected Member Functions
TClass * | getClass (DataObject *pObject)
| Helper: Get TClass for a given DataObject pointer. More...
MsgStream & | log () const
| Helper: Use message streamer. More...
Protected Member Functions inherited from ConversionSvc
virtual | ~ConversionSvc ()
| Standard Destructor. More...
virtual StatusCode | configureConverter (long typ, const CLID &clid, IConverter *cnv)
| Configure the new converter before initialize is called. More...
virtual StatusCode | initializeConverter (long typ, const CLID &clid, IConverter *cnv)
| Initialize the new converter. More...
virtual StatusCode | activateConverter (long typ, const CLID &clid, IConverter *cnv)
| Activate the new converter after initialization. More...
virtual SmartIF< IAddressCreator > & | addressCreator ()
| Retrieve address creation interface. More...
StatusCode | makeCall (int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
Protected Member Functions inherited from Service
| ~Service () override
| Standard Destructor. More...
int | outputLevel () const
| get the `Service's` output level More...
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
SmartIF< Gaudi::IIODataManager > | m_ioMgr
| Reference to the I/O data manager. More...
SmartIF< IIncidentSvc > | m_incidentSvc
| Reference to incident service. More...
Gaudi::RootDataConnection * | m_current = nullptr
| On writing: reference to active output stream. More...
TClass * | m_classRefs
| TClass pointer to reference class. More...
TClass * | m_classDO
| TClass pointer to DataObject class. More...
std::shared_ptr< RootConnectionSetup > | m_setup
| Setup structure (ref-counted) and passed to data connections. More...
std::string | m_currSection
| Property: ROOT section name. More...
bool | m_incidentEnabled
| Property: Flag to enable incidents on FILE_OPEN. More...
std::string | m_shareFiles
| Property: Share files ? If set to YES, files will not be closed on finalize. More...
std::string | m_recordName
| Property: Records name to fire incident for file records. More...
std::string | m_ioPerfStats
| Property: Enable TTree IOperfStats if not empty; otherwise perf stat file name. More...
std::string | m_compression
| Property: Compression-algorithm:compression-level. More...
int | m_autoFlush
| Property: AutoFlush parameter for ROOT TTree (Number of events between auto flushes) More...
int | m_basketSize
| Property: Basket optimization parameter for ROOT TTree (total basket size) More...
int | m_bufferSize
| Property: Buffer size optimization parameter for ROOT TTree. More...
int | m_splitLevel
| Property: Split level optimization parameter for ROOT TTree. More...
std::set< std::string > | m_badFiles
| Set with bad files/tables. More...
std::unique_ptr< MsgStream > | m_log
| Message streamer. More...
Protected Attributes inherited from ConversionSvc
SmartIF< IDataProviderSvc > | m_dataSvc
| Pointer to data provider service. More...
SmartIF< IAddressCreator > | m_addressCreator
| Pointer to the address creation service interface. More...
SmartIF< IConversionSvc > | m_cnvSvc
| Pointer to the IConversionSvc interface of this. More...
long | m_type
| Conversion service type. More...
std::vector< WorkerEntry > | m_workers
| List of conversion workers. More...
Protected Attributes inherited from Service
IntegerProperty | m_outputLevel = MSG::NIL
| Service output level. More...
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. More...

## Additional Inherited Members
Public Types inherited from extends< Service, IConversionSvc, IAddressCreator >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces...>
| Typedef to the base of this class. More...
Public Types inherited from Service
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from 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 52 of file RootCnvSvc.h.

## Constructor & Destructor Documentation

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

Standard constructor.

Definition at line 49 of file RootCnvSvc.cpp.

50 : ConversionSvc( nam, svc, ROOT_StorageType),
51 m_setup{ new RootConnectionSetup() }
52 {
53 m_classRefs = m_classDO = nullptr;
54 m_setup->cacheBranches.push_back("*");
55 declareProperty("IOPerfStats", m_ioPerfStats);
56 declareProperty("ShareFiles", m_shareFiles = "NO");
57 declareProperty("EnableIncident", m_incidentEnabled = true);
58 declareProperty("RecordsName", m_recordName = "/FileRecords");
59 declareProperty("LoadSection", m_setup->loadSection = "Event");
60
61 // ROOT Write parameters
62 declareProperty("AutoFlush", m_autoFlush = 100);
63 declareProperty("BasketSize", m_basketSize = 2*MBYTE);
64 declareProperty("BufferSize", m_bufferSize = 2*kBYTE);
65 declareProperty("SplitLevel", m_splitLevel = 0);
66 declareProperty("GlobalCompression",m_compression); // empty: do nothing
67
68 // ROOT Read parameters: must be shared for the entire file!
69 declareProperty("CacheSize", m_setup->cacheSize = 10*MBYTE);
70 declareProperty("LearnEntries", m_setup->learnEntries = 10);
71 declareProperty("CacheBranches", m_setup->cacheBranches);
72 declareProperty("VetoBranches", m_setup->vetoBranches);
73 }
Gaudi::RootCnvSvc::m_basketSize
int m_basketSize
Property: Basket optimization parameter for ROOT TTree (total basket size)
Definition: RootCnvSvc.h:84
ConversionSvc::ConversionSvc
ConversionSvc(const std::string &name, ISvcLocator *svc, long type)
Standard Constructor.
Definition: ConversionSvc.cpp:379
Gaudi::RootCnvSvc::m_setup
std::shared_ptr< RootConnectionSetup > m_setup
Setup structure (ref-counted) and passed to data connections.
Definition: RootCnvSvc.h:66
Gaudi::RootCnvSvc::m_splitLevel
int m_splitLevel
Property: Split level optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:88
Gaudi::RootCnvSvc::m_classDO
TClass * m_classDO
TClass pointer to DataObject class.
Definition: RootCnvSvc.h:64
ROOT_StorageType
const long ROOT_StorageType
Definition: ClassID.h:52
Gaudi::RootCnvSvc::m_incidentEnabled
bool m_incidentEnabled
Property: Flag to enable incidents on FILE_OPEN.
Definition: RootCnvSvc.h:71
MBYTE
#define MBYTE
Definition: RootCnvSvc.cpp:46
Gaudi::RootCnvSvc::m_shareFiles
std::string m_shareFiles
Property: Share files ? If set to YES, files will not be closed on finalize.
Definition: RootCnvSvc.h:73
Gaudi::RootCnvSvc::m_compression
std::string m_compression
Property: Compression-algorithm:compression-level.
Definition: RootCnvSvc.h:79
Gaudi::RootCnvSvc::m_recordName
std::string m_recordName
Property: Records name to fire incident for file records.
Definition: RootCnvSvc.h:75
Gaudi::RootConnectionSetup
Definition: RootDataConnection.h:43
Service::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:215
Gaudi::RootCnvSvc::m_ioPerfStats
std::string m_ioPerfStats
Property: Enable TTree IOperfStats if not empty; otherwise perf stat file name.
Definition: RootCnvSvc.h:77
kBYTE
#define kBYTE
Definition: RootCnvSvc.cpp:47
Gaudi::RootCnvSvc::m_bufferSize
int m_bufferSize
Property: Buffer size optimization parameter for ROOT TTree.
Definition: RootCnvSvc.h:86
Gaudi::RootCnvSvc::m_autoFlush
int m_autoFlush
Property: AutoFlush parameter for ROOT TTree (Number of events between auto flushes) ...
Definition: RootCnvSvc.h:82
Gaudi::RootCnvSvc::m_classRefs
TClass * m_classRefs
TClass pointer to reference class.
Definition: RootCnvSvc.h:62

RootCnvSvc::~RootCnvSvc | ( |  | ) |
| virtual

Standard destructor.

Definition at line 76 of file RootCnvSvc.cpp.

76 {
77 }

## Member Function Documentation

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

Commit pending output.

Parameters

  outputFile | String containig output file
  do_commit | if true commit the output and flush eventually pending items to the database if false, discard pending buffers. Note: The possibility to commit or rollback depends on the database technology used!

Returns
  Status code indicating success or failure.

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

Reimplemented from ConversionSvc.

Definition at line 329 of file RootCnvSvc.cpp.

329 {
330 if ( m_current ) {
331 size_t len = m_currSection.find('/',1);
332 string section = m_currSection.substr(1,len==string::npos ? string::npos : len-1);
333 TBranch* b = m_current->getBranch(section, m_currSection);
334 if ( b ) {
335 Long64_t evt = b->GetEntries();
336 TTree* t = b->GetTree();
337 TObjArray* a = t->GetListOfBranches();
338 Int_t nb = a->GetEntriesFast();
340 for(Int_t i=0; i<nb; ++i) {
341 TBranch* br_ptr = (TBranch*)a->UncheckedAt(i);
342 Long64_t br_evt = br_ptr->GetEntries();
343 if ( br_evt < evt ) {
344 Long64_t num = evt-br_evt;
345 br_ptr->SetAddress(nullptr);
346 while(num>0) {
347 br_ptr->Fill();
348 --num;
349 }
350 if( log().level() <= MSG::DEBUG ) log() << MSG::DEBUG
351 << "commit: Added " << long(evt-br_evt)
352 << " Section: " << evt << " Branch: " << br_ptr->GetEntries()
353 << " RefNo: " << br_ptr->GetEntries()-1
354 << " NULL entries to:" << br_ptr->GetName() << endmsg;
355 }
356 }
357
358 b->GetTree()->SetEntries(evt);
359 if ( evt == 1 ) {
360 b->GetTree()->OptimizeBaskets(m_basketSize,1.1,"");
361 }
362 if ( evt > 0 && (evt%m_autoFlush)==0 ) {
363 if ( evt == m_autoFlush ) {
364 b->GetTree()->SetAutoFlush(m_autoFlush);
365 b->GetTree()->OptimizeBaskets(m_basketSize,1.,"");
366 }
367 else {
368 b->GetTree()->FlushBaskets();
369 }
370 }
371 if( log().level() <= MSG::DEBUG )
372 log() << MSG::DEBUG << "Set section entries of " << m_currSection
373 << " to " << long(evt) << " entries." << endmsg;
374 }
375 else {
376 return error("commitOutput> Failed to update entry numbers on "+dsn);
377 }
378 }
379 return S_OK;
380 }
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
Gaudi::RootCnvSvc::m_currSection
std::string m_currSection
Property: ROOT section name.
Definition: RootCnvSvc.h:68
Gaudi::RootCnvSvc::m_basketSize
int m_basketSize
Property: Basket optimization parameter for ROOT TTree (total basket size)
Definition: RootCnvSvc.h:84
MSG::DEBUG
Definition: IMessageSvc.h:18
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:38
Gaudi::RootDataConnection::getBranch
TBranch * getBranch(const std::string &section, const std::string &branch_name)
Access data branch by name: Get existing branch in read only mode.
Definition: RootDataConnection.h:307
std::string::find
T find(T...args)
std::string::substr
T substr(T...args)
gaudirun.level
level
Definition: gaudirun.py:261
ana.i
list i
Definition: ana.py:128
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
Gaudi::RootCnvSvc::m_current
Gaudi::RootDataConnection * m_current
On writing: reference to active output stream.
Definition: RootCnvSvc.h:60
Gaudi::RootCnvSvc::m_autoFlush
int m_autoFlush
Property: AutoFlush parameter for ROOT TTree (Number of events between auto flushes) ...
Definition: RootCnvSvc.h:82

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

Connect the output file to the service with open mode.

Parameters

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

Returns
  Status code indicating success or failure.

Definition at line 223 of file RootCnvSvc.cpp.

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

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

Connect the output file to the service with open mode.

Parameters

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

Returns
  Status code indicating success or failure.

Reimplemented from ConversionSvc.

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

Connect the output file to the service.

Parameters

  outputFile | String containig output file

Returns
  Status code indicating success or failure.

Reimplemented from ConversionSvc.

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

IAddressCreator implementation: Address creation.

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

Parameters

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

Returns
  StatusCode indicating SUCCESS or failure

Reimplemented from ConversionSvc.

Definition at line 389 of file RootCnvSvc.cpp.

394 {
395 refpAddress = new RootAddress(typ,clid,par[0],par[1],ip[0],ip[1]);
396 return S_OK;
397 }
Gaudi::RootAddress
Description:
Definition: RootAddress.h:36
S_OK
#define S_OK
Definition: RootCnvSvc.cpp:38

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

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

Parameters

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

Returns
  Status code indicating success or failure.

Reimplemented from ConversionSvc.

Definition at line 204 of file RootCnvSvc.h.

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

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

ConversionSvc overload: Create new Converter using factory.

Reimplemented from ConversionSvc.

Definition at line 156 of file RootCnvSvc.cpp.

156 {
157 if ( wanted == CLID_StatisticsFile )
158 return new RootDatabaseCnv(typ,wanted,serviceLocator().get(),this);
159 else if ( wanted == CLID_StatisticsDirectory )
160 return new RootDirectoryCnv(typ,wanted,serviceLocator().get(),this);
161 else if ( wanted == CLID_RowWiseTuple )
162 return new RootNTupleCnv(typ,wanted,serviceLocator().get(),this);
163 else if ( wanted == CLID_ColumnWiseTuple )
164 return new RootNTupleCnv(typ,wanted,serviceLocator().get(),this);
165 else
166 return new RootConverter(typ,wanted,serviceLocator().get(),this);
167 }
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
Gaudi::RootDatabaseCnv
Statistics file converter class definition.
Definition: RootDatabaseCnv.h:28
Gaudi::RootNTupleCnv
NTuple converter class definition for NTuples writted/read using ROOT.
Definition: RootNTupleCnv.h:34
Gaudi::RootDirectoryCnv
Description: NTuple directory converter class definition Definition of the converter to manage the di...
Definition: RootDirectoryCnv.h:30
Gaudi::RootConverter
Description: Definition of the ROOT data converter.
Definition: RootConverter.h:32

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

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

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

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

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

Disconnect from an existing data stream.

Parameters

  dbName | String containing name of the database

Returns
  Status code indicating success or failure.

Definition at line 383 of file RootCnvSvc.cpp.

383 {
384 IDataConnection* c = m_ioMgr->connection(dataset);
385 return c ? m_ioMgr->disconnect(c) : S_FAIL;
386 }
gaudirun.c
tuple c
Definition: gaudirun.py:391
Gaudi::IDataConnection
ABC describing basic data connection.
Definition: IIODataManager.h:24
Gaudi::RootCnvSvc::m_ioMgr
SmartIF< Gaudi::IIODataManager > m_ioMgr
Reference to the I/O data manager.
Definition: RootCnvSvc.h:56
S_FAIL
#define S_FAIL
Definition: RootCnvSvc.cpp:39

StatusCode RootCnvSvc::error | ( | const std::string & | msg | ) |

Standard way to print errors.

after the printout an exception is thrown.

Parameters

  msg | [IN] Message string to be printed.

Returns
  Status code returning failure.

Definition at line 80 of file RootCnvSvc.cpp.

80 {
81 if ( m_log ) {
82 log() << MSG::ERROR << "Error: " << msg << endmsg;
83 return S_FAIL;
84 }
85 MsgStream m(msgSvc(),name());
86 m << MSG::ERROR << "Error: " << msg << endmsg;
87 return S_FAIL;
88 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi::RootCnvSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition: RootCnvSvc.h:99
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
Gaudi::RootCnvSvc::m_log
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition: RootCnvSvc.h:94
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:93
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
MSG::ERROR
Definition: IMessageSvc.h:21
S_FAIL
#define S_FAIL
Definition: RootCnvSvc.cpp:39
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode RootCnvSvc::finalize | ( |  | ) |
| virtual

ConversionSvc overload: Finalize Db service.

Reimplemented from ConversionSvc.

Definition at line 125 of file RootCnvSvc.cpp.

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

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

Helper: Get TClass for a given DataObject pointer.

Definition at line 187 of file RootCnvSvc.cpp.

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

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

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

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

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

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

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

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

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

StatusCode RootCnvSvc::initialize | ( |  | ) |
| virtual

ConversionSvc overload: initialize Db service.

Reimplemented from ConversionSvc.

Definition at line 91 of file RootCnvSvc.cpp.

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

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

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

Reimplemented from ConversionSvc.

Definition at line 170 of file RootCnvSvc.cpp.

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

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

Helper: Use message streamer.

Definition at line 99 of file RootCnvSvc.h.

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

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

Update state of the service.

Reimplemented from ConversionSvc.

Definition at line 110 of file RootCnvSvc.h.

111 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:30

## Member Data Documentation

int Gaudi::RootCnvSvc::m_autoFlush
| protected

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

Definition at line 82 of file RootCnvSvc.h.

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

Set with bad files/tables.

Definition at line 91 of file RootCnvSvc.h.

int Gaudi::RootCnvSvc::m_basketSize
| protected

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

Definition at line 84 of file RootCnvSvc.h.

int Gaudi::RootCnvSvc::m_bufferSize
| protected

Property: Buffer size optimization parameter for ROOT TTree.

Definition at line 86 of file RootCnvSvc.h.

TClass* Gaudi::RootCnvSvc::m_classDO
| protected

TClass pointer to DataObject class.

Definition at line 64 of file RootCnvSvc.h.

TClass* Gaudi::RootCnvSvc::m_classRefs
| protected

TClass pointer to reference class.

Definition at line 62 of file RootCnvSvc.h.

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

Property: Compression-algorithm:compression-level.

Definition at line 79 of file RootCnvSvc.h.

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

On writing: reference to active output stream.

Definition at line 60 of file RootCnvSvc.h.

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

Property: ROOT section name.

Definition at line 68 of file RootCnvSvc.h.

bool Gaudi::RootCnvSvc::m_incidentEnabled
| protected

Property: Flag to enable incidents on FILE_OPEN.

Definition at line 71 of file RootCnvSvc.h.

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

Reference to incident service.

Definition at line 58 of file RootCnvSvc.h.

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

Reference to the I/O data manager.

Definition at line 56 of file RootCnvSvc.h.

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

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

Definition at line 77 of file RootCnvSvc.h.

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

Message streamer.

Definition at line 94 of file RootCnvSvc.h.

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

Property: Records name to fire incident for file records.

Definition at line 75 of file RootCnvSvc.h.

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

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

Definition at line 66 of file RootCnvSvc.h.

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

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

Definition at line 73 of file RootCnvSvc.h.

int Gaudi::RootCnvSvc::m_splitLevel
| protected

Property: Split level optimization parameter for ROOT TTree.

Definition at line 88 of file RootCnvSvc.h.

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

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