All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
NTupleSvc Class Reference

NTuple service. More...

#include <src/NTupleSvc/NTupleSvc.h>

Inheritance diagram for NTupleSvc:
Collaboration diagram for NTupleSvc:

Classes

struct  Connection
 

Public Member Functions

virtual StatusCode initialize ()
 DataSvc overrides: Initialize the service. More...
 
virtual StatusCode reinitialize ()
 DataSvc overrides: reinitialize service. More...
 
virtual StatusCode finalize ()
 DataSvc overrides: stop the service. More...
 
virtual IConversionSvcgetDataLoader (IRegistry *pReg)
 DataSvc overrides: Retrieve data loader. More...
 
virtual NTuple::DirectorycreateDirectory (DataObject *pParent, const std::string &title)
 Create Ntuple directory and register it with the data store. More...
 
virtual NTuple::DirectorycreateDirectory (DataObject *pParent, long id)
 Create Ntuple directory and register it with the data store. More...
 
virtual NTuple::DirectorycreateDirectory (const std::string &dirPath, long id)
 Create Ntuple directory and register it with the data store. More...
 
virtual NTuple::DirectorycreateDirectory (const std::string &dirPath, const std::string &title)
 Create Ntuple directory and register it with the data store. More...
 
virtual NTuple::DirectorycreateDirectory (const std::string &fullPath)
 Create Ntuple directory and register it with the data store. More...
 
virtual StatusCode create (const CLID &typ, const std::string &title, NTuple::Tuple *&refpTuple)
 Create requested N tuple (Hide constructor) More...
 
virtual NTuple::Tuplebook (const std::string &fullPath, const CLID &type, const std::string &title)
 Book Ntuple and register it with the data store. More...
 
virtual NTuple::Tuplebook (const std::string &dirPath, const std::string &relPath, const CLID &type, const std::string &title)
 Book Ntuple and register it with the data store. More...
 
virtual NTuple::Tuplebook (const std::string &dirPath, long id, const CLID &type, const std::string &title)
 Book Ntuple and register it with the data store. More...
 
virtual NTuple::Tuplebook (DataObject *pParent, const std::string &relPath, const CLID &type, const std::string &title)
 Book Ntuple and register it with the data store. More...
 
virtual NTuple::Tuplebook (DataObject *pParent, long id, const CLID &type, const std::string &title)
 Book Ntuple and register it with the data store. More...
 
virtual NTuple::Tupleaccess (const std::string &fullPath, const std::string &filename)
 Access N tuple on disk. More...
 
virtual StatusCode save (const std::string &fullPath)
 Save N tuple to disk. Must be called in order to close the ntuple file properly. More...
 
virtual StatusCode save (NTuple::Tuple *tuple)
 Save N tuple to disk. Must be called in order to close the ntuple file properly. More...
 
virtual StatusCode save (DataObject *pParent, const std::string &relPath)
 Save N tuple to disk. Must be called in order to close the ntuple file properly. More...
 
virtual StatusCode writeRecord (NTuple::Tuple *tuple)
 Write single record to N tuple. More...
 
virtual StatusCode writeRecord (const std::string &fullPath)
 Write single record to N tuple. More...
 
virtual StatusCode writeRecord (DataObject *pParent, const std::string &relPath)
 Write single record to N tuple. More...
 
virtual StatusCode readRecord (NTuple::Tuple *tuple)
 Read single record from N tuple. More...
 
virtual StatusCode readRecord (const std::string &fullPath)
 Read single record from N tuple. More...
 
virtual StatusCode readRecord (DataObject *pParent, const std::string &relPath)
 Read single record from N tuple. More...
 
virtual bool isConnected (const std::string &identifier) const
 Check if a datasource is connected. More...
 
virtual StatusCode connect (const std::string &ident)
 Add file to list I/O list. More...
 
virtual StatusCode connect (const std::string &ident, std::string &logname)
 Add file to list I/O list. More...
 
virtual StatusCode disconnect (const std::string &nam)
 Close open connection. More...
 
virtual StatusCode disconnectAll ()
 Close all open connections. More...
 
 NTupleSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor. More...
 
virtual ~NTupleSvc ()
 Standard Destructor. More...
 
- Public Member Functions inherited from extends2< DataSvc, INTupleSvc, IDataSourceMgr >
 extends2 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments. More...
 
 extends2 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends2 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends2 ()
 Default constructor. More...
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface. More...
 
virtual std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. More...
 
virtual ~extends2 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from DataSvc
virtual CLID rootCLID () const
 IDataManagerSvc: Accessor for root event CLID. More...
 
virtual std::string rootName () const
 IDataManagerSvc: Accessor for root event name. More...
 
virtual StatusCode registerAddress (const std::string &fullPath, IOpaqueAddress *pAddress)
 IDataManagerSvc: Register object address with the data store. More...
 
virtual StatusCode registerAddress (DataObject *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress)
 IDataManagerSvc: Register object address with the data store. More...
 
virtual StatusCode registerAddress (IRegistry *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress)
 IDataManagerSvc: Register object address with the data store. More...
 
virtual StatusCode unregisterAddress (const std::string &fullPath)
 IDataManagerSvc: Unregister object address from the data store. More...
 
virtual StatusCode unregisterAddress (DataObject *pParent, const std::string &objPath)
 IDataManagerSvc: Unregister object address from the data store. More...
 
virtual StatusCode unregisterAddress (IRegistry *pParent, const std::string &objPath)
 IDataManagerSvc: Unregister object address from the data store. More...
 
virtual StatusCode objectLeaves (const DataObject *pObject, std::vector< IRegistry * > &refLeaves)
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
 
virtual StatusCode objectLeaves (const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves)
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object. More...
 
virtual StatusCode objectParent (const DataObject *pObject, IRegistry *&refpParent)
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
virtual StatusCode objectParent (const IRegistry *pRegistry, IRegistry *&refpParent)
 IDataManagerSvc: Explore the object store: retrieve the object's parent. More...
 
virtual StatusCode clearSubTree (const std::string &sub_tree_path)
 IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name. More...
 
virtual StatusCode clearSubTree (DataObject *pObject)
 IDataManagerSvc: Remove all data objects below the sub tree identified by the object. More...
 
virtual StatusCode clearStore ()
 IDataManagerSvc: Remove all data objects in the data store. More...
 
virtual StatusCode traverseSubTree (const std::string &sub_tree_path, IDataStoreAgent *pAgent)
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name. More...
 
virtual StatusCode traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent)
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree. More...
 
virtual StatusCode traverseTree (IDataStoreAgent *pAgent)
 IDataManagerSvc: Analyze by traversing all data objects in the data store. More...
 
virtual StatusCode setRoot (const std::string &root_name, DataObject *pRootObj)
 Initialize data store for new event by giving new event path and root object. More...
 
virtual StatusCode i_setRoot (const std::string &root_name, DataObject *pRootObj)
 Initialize data store for new event by giving new event path and root object. More...
 
virtual StatusCode setRoot (const std::string &root_path, IOpaqueAddress *pRootAddr)
 Initialize data store for new event by giving new event path and address of root object. More...
 
virtual StatusCode i_setRoot (const std::string &root_path, IOpaqueAddress *pRootAddr)
 Initialize data store for new event by giving new event path and address of root object. More...
 
virtual StatusCode setDataLoader (IConversionSvc *svc)
 IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service. More...
 
virtual StatusCode addPreLoadItem (const DataStoreItem &item)
 Add an item to the preload list. More...
 
virtual StatusCode addPreLoadItem (const std::string &itemPath)
 Add an item to the preload list. More...
 
virtual StatusCode removePreLoadItem (const DataStoreItem &item)
 Remove an item from the preload list. More...
 
virtual StatusCode removePreLoadItem (const std::string &itemPath)
 Add an item to the preload list. More...
 
virtual StatusCode resetPreLoad ()
 Clear the preload list. More...
 
virtual StatusCode preLoad (int depth, int load_depth, DataObject *pObject)
 Execute one level of preloading and recursively load until the final level is reached. More...
 
virtual StatusCode preLoad ()
 load all preload items of the list More...
 
virtual StatusCode registerObject (const std::string &fullPath, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (const std::string &parentPath, const std::string &objPath, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (const std::string &parentPath, int item, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (DataObject *parentObj, const std::string &objPath, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode registerObject (DataObject *parentObj, int item, DataObject *pObject)
 Register object with the data store. More...
 
virtual StatusCode unregisterObject (const std::string &fullPath)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (const std::string &parentPath, const std::string &objectPath)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (const std::string &parentPath, int item)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (DataObject *pObject)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (DataObject *pObject, const std::string &objectPath)
 Unregister object from the data store. More...
 
virtual StatusCode unregisterObject (DataObject *pObject, int item)
 Unregister object from the data store. More...
 
virtual StatusCode retrieveObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (const std::string &fullPath, DataObject *&pObject)
 Retrieve object identified by its full path from the data store. More...
 
virtual StatusCode retrieveObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (const std::string &parentPath, int item, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (DataObject *parentObj, const std::string &objPath, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode retrieveObject (DataObject *parentObj, int item, DataObject *&pObject)
 Retrieve object from data store. More...
 
virtual StatusCode findObject (const std::string &fullPath, DataObject *&pObject)
 Find object identified by its full path in the data store. More...
 
virtual StatusCode findObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
 Find object identified by its full path in the data store. More...
 
virtual StatusCode findObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode findObject (const std::string &parentPath, int item, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode findObject (DataObject *parentObj, const std::string &objPath, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode findObject (DataObject *parentObj, int item, DataObject *&pObject)
 Find object in the data store. More...
 
virtual StatusCode linkObject (IRegistry *from, const std::string &objPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode linkObject (const std::string &fromPath, const std::string &objPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode linkObject (DataObject *from, const std::string &objPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode linkObject (const std::string &fullPath, DataObject *to)
 Add a link to another object. More...
 
virtual StatusCode unlinkObject (IRegistry *from, const std::string &objPath)
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (const std::string &fromPath, const std::string &objPath)
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (DataObject *fromObj, const std::string &objPath)
 Remove a link to another object. More...
 
virtual StatusCode unlinkObject (const std::string &fullPath)
 Remove a link to another object. More...
 
virtual StatusCode updateObject (IRegistry *pDirectory)
 Update object identified by its directory entry. More...
 
virtual StatusCode updateObject (const std::string &updatePath)
 Update object. More...
 
virtual StatusCode updateObject (DataObject *toUpdate)
 Update object. More...
 
virtual StatusCode updateObject (const std::string &parentPath, const std::string &updatePath)
 Update object. More...
 
virtual StatusCode updateObject (DataObject *pParent, const std::string &updatePath)
 Update object. More...
 
 DataSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor. More...
 
virtual ~DataSvc ()
 Standard Destructor. More...
 
- Public Member Functions inherited from extends2< Service, IDataProviderSvc, IDataManagerSvc >
 extends2 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments. More...
 
 extends2 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends2 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends2 ()
 Default constructor. More...
 
- Public Member Functions inherited from Service
virtual unsigned long release ()
 Release Interface instance. More...
 
virtual const std::string & name () const
 Retrieve name of the service. More...
 
virtual StatusCode configure ()
 Configuration (from OFFLINE to CONFIGURED). More...
 
virtual StatusCode start ()
 Start (from INITIALIZED to RUNNING). More...
 
virtual StatusCode stop ()
 Stop (from RUNNING to INITIALIZED). More...
 
virtual StatusCode terminate ()
 Initialization (from CONFIGURED to OFFLINE). More...
 
virtual Gaudi::StateMachine::State FSMState () const
 Get the current state. More...
 
virtual Gaudi::StateMachine::State targetFSMState () const
 When we are in the middle of a transition, get the state where the transition is leading us. More...
 
virtual StatusCode restart ()
 Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
 
virtual StatusCode sysInitialize ()
 Initialize Service. More...
 
virtual StatusCode sysStart ()
 Initialize Service. More...
 
virtual StatusCode sysStop ()
 Initialize Service. More...
 
virtual StatusCode sysFinalize ()
 Finalize Service. More...
 
virtual StatusCode sysReinitialize ()
 Re-initialize the Service. More...
 
virtual StatusCode sysRestart ()
 Re-initialize the Service. More...
 
virtual StatusCode setProperty (const Property &p)
 Set the property by property. More...
 
virtual StatusCode setProperty (const std::string &s)
 Set the property by string. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Set the property by std::string. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the property by property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Get the property by std::string. More...
 
virtual const std::vector
< Property * > & 
getProperties () const
 Get list of properties. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 Service (const std::string &name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 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<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 >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- Public Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
 CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
 Templated constructor with 3 arguments. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments. More...
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument. More...
 
 CommonMessaging ()
 Default constructor. More...
 
virtual ~CommonMessaging ()
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from extend_interfaces3< IService, IProperty, IStateful >
virtual ~extend_interfaces3 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IService
 DeclareInterfaceID (IService, 3, 0)
 InterfaceID. More...
 
virtual ~IService ()
 virtual destructor More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
- Public Member Functions inherited from IInterface
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from IStateful
 DeclareInterfaceID (IStateful, 1, 0)
 InterfaceID. More...
 
virtual ~IStateful ()
 
- Public Member Functions inherited from extend_interfaces2< IDataProviderSvc, IDataManagerSvc >
virtual ~extend_interfaces2 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IDataProviderSvc
 DeclareInterfaceID (IDataProviderSvc, 3, 0)
 InterfaceID. More...
 
virtual ~IDataProviderSvc ()
 virtual destructor More...
 
- Public Member Functions inherited from IDataManagerSvc
 DeclareInterfaceID (IDataManagerSvc, 2, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from extend_interfaces2< INTupleSvc, IDataSourceMgr >
virtual ~extend_interfaces2 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from INTupleSvc
 DeclareInterfaceID (INTupleSvc, 2, 0)
 InterfaceID. More...
 
virtual ~INTupleSvc ()
 virtual destructor More...
 
- Public Member Functions inherited from IDataSourceMgr
 DeclareInterfaceID (IDataSourceMgr, 2, 0)
 InterfaceID. More...
 

Protected Types

typedef std::vector< std::string > DBaseEntries
 
typedef std::map< std::string,
Connection
Connections
 
typedef std::pair< std::string,
std::string > 
Prop
 

Protected Member Functions

StatusCode createService (const std::string &nam, const std::string &typ, const std::vector< Prop > &props, IConversionSvc *&pSvc)
 Create conversion service. More...
 
void releaseConnection (Connection &c)
 Finalize single service. More...
 
StatusCode attachTuple (const std::string &filename, const std::string &logname, const char typ, const long t)
 Attach output/input file. More...
 
StatusCode updateDirectories ()
 Update directory data. More...
 
- Protected Member Functions inherited from DataSvc
bool checkRoot ()
 Check if root path is valid. More...
 
virtual DataObjectcreateDefaultObject () const
 Create default objects in case forced creation of leaves is requested. More...
 
virtual StatusCode loadObject (IRegistry *pNode)
 Invoke Persistency service to create transient object from its persistent representation. More...
 
virtual StatusCode loadObject (IConversionSvc *pLoader, IRegistry *pNode)
 Invoke Persistency service to create transient object from its persistent representation. More...
 
StatusCode retrieveEntry (DataSvcHelpers::RegistryEntry *pNode, const std::string &path, DataSvcHelpers::RegistryEntry *&pEntry)
 Retrieve registry entry from store. More...
 
DataObjecthandleDataFault (IRegistry *pReg, const std::string &path="")
 Invoke data fault handling if enabled. More...
 
- Protected Member Functions inherited from Service
virtual ~Service ()
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Protected Attributes

DBaseEntries m_output
 Output streams. More...
 
DBaseEntries m_input
 Input streams. More...
 
Connections m_connections
 Container of connection points. More...
 
- Protected Attributes inherited from DataSvc
CLID m_rootCLID
 Integer Property corresponding to CLID of root entry. More...
 
std::string m_rootName
 Name of root event. More...
 
IConversionSvcm_dataLoader
 Pointer to data loader service. More...
 
IIncidentSvcm_incidentSvc
 Pointer to incident service. More...
 
LoadItems m_preLoads
 Items to be pre-loaded. More...
 
bool m_forceLeaves
 Allow forced creation of default leaves on registerObject. More...
 
bool m_enableAccessHdlr
 Flag to enable interrupts on data access requests. More...
 
bool m_enableFaultHdlr
 Flag to enable interrupts on data creation requests. More...
 
DataSvcHelpers::RegistryEntrym_root
 Pointer to root entry. More...
 
DataSvcHelpers::InhibitMap * m_inhibitMap
 Map with object paths to be inhibited from loading. More...
 
std::vector< std::string > m_inhibitPathes
 Property for the inhibited leaves. More...
 
std::string m_accessName
 Name of the data access incident. More...
 
std::string m_faultName
 Name of the data fault incident. More...
 
- Protected Attributes inherited from Service
IntegerProperty m_outputLevel
 Service output level. More...
 
Gaudi::StateMachine::State m_state
 Service state. More...
 
Gaudi::StateMachine::State m_targetState
 Service state. More...
 
- Protected Attributes inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
SmartIF< IMessageSvcm_msgsvc
 Pointer to the message service;. More...
 
std::auto_ptr< MsgStreamm_msgStream
 The predefined message stream. More...
 
bool m_streamWithService
 Flag to create a new MsgStream if it was created without the message service. More...
 

Additional Inherited Members

- Public Types inherited from extends2< DataSvc, INTupleSvc, IDataSourceMgr >
typedef extends2 base_class
 Typedef to this class. More...
 
typedef extend_interfaces2
< INTupleSvc, IDataSourceMgr
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from DataSvc
typedef std::vector
< DataStoreItem
LoadItems
 Define set of load items. More...
 
- Public Types inherited from extends2< Service, IDataProviderSvc, IDataManagerSvc >
typedef extends2 base_class
 Typedef to this class. More...
 
typedef extend_interfaces2
< IDataProviderSvc,
IDataManagerSvc
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from Service
typedef
Gaudi::PluginService::Factory
< IService *, const
std::string &, ISvcLocator * > 
Factory
 
- Public Types inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
typedef CommonMessaging base_class
 
- Public Types inherited from implements3< IService, IProperty, IStateful >
typedef implements3 base_class
 Typedef to this class. More...
 
typedef extend_interfaces3
< IService, IProperty,
IStateful
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces3< IService, IProperty, IStateful >
typedef mpl::fold< typename
IService::iid::iids::type,
typename mpl::fold< typename
IProperty::iid::iids::type,
typename
IStateful::iid::iids::type,
mpl::insert< mpl::_1, mpl::_2 >
>::type, mpl::insert< mpl::_1,
mpl::_2 > >::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IInterface
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...
 
typedef Gaudi::InterfaceId
< IInterface, 0, 0 > 
iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
- Public Types inherited from extend_interfaces2< IDataProviderSvc, IDataManagerSvc >
typedef mpl::fold< typename
IDataProviderSvc::iid::iids::type,
typename
IDataManagerSvc::iid::iids::type,
mpl::insert< mpl::_1, mpl::_2 >
>::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IDataProviderSvc
enum  { SEPARATOR = '/' }
 
enum  Status {
  IDataProviderSvc_NO_ERROR = 1, DOUBL_OBJ_PATH, INVALID_OBJ_PATH, INVALID_ROOT,
  INVALID_OBJECT, INVALID_PARENT, OBJ_NOT_LOADED, NO_DATA_LOADER,
  INVALID_OBJ_ADDR, DIR_NOT_EMPTY, NO_MORE_LEVELS, NO_ACCESS,
  LAST
}
 Status code definitions. More...
 
- Public Types inherited from extend_interfaces2< INTupleSvc, IDataSourceMgr >
typedef mpl::fold< typename
INTupleSvc::iid::iids::type,
typename
IDataSourceMgr::iid::iids::type,
mpl::insert< mpl::_1, mpl::_2 >
>::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 

Detailed Description

NTuple service.

See the Interface definition files for more detailed documentation of the implementing class. Base class: Gaudi/DataSvc/DataSvc.h Generic N tuple service interface: Gaudi/Interfaces/INTupleSvc.h Generic IAddressCreator interface: Gaudi/Interfaces/IAddressCreator.h Generic IConversionSvc interface: Gaudi/Interfaces/IConversionSvc.h

Author
M.Frank

Definition at line 25 of file NTupleSvc.h.

Member Typedef Documentation

typedef std::map<std::string, Connection> NTupleSvc::Connections
protected

Definition at line 35 of file NTupleSvc.h.

typedef std::vector< std::string > NTupleSvc::DBaseEntries
protected

Definition at line 34 of file NTupleSvc.h.

typedef std::pair<std::string,std::string> NTupleSvc::Prop
protected

Definition at line 36 of file NTupleSvc.h.

Constructor & Destructor Documentation

NTupleSvc::NTupleSvc ( const std::string &  name,
ISvcLocator svc 
)

Standard Constructor.

Definition at line 62 of file NTupleSvc.cpp.

63  : base_class(name, svc)
64 {
65  declareProperty("Input", m_input);
66  declareProperty("Output", m_output);
67  m_rootName = "/NTUPLES";
68  m_rootCLID = CLID_DataObject;
69 }
extends2 base_class
Typedef to this class.
Definition: extends.h:77
std::string m_rootName
Name of root event.
Definition: DataSvc.h:49
DBaseEntries m_input
Input streams.
Definition: NTupleSvc.h:125
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
DBaseEntries m_output
Output streams.
Definition: NTupleSvc.h:123
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: DataSvc.h:47
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:211
NTupleSvc::~NTupleSvc ( )
virtual

Standard Destructor.

Definition at line 72 of file NTupleSvc.cpp.

72  {
73 }

Member Function Documentation

NTuple::Tuple * NTupleSvc::access ( const std::string &  fullPath,
const std::string &  filename 
)
virtual

Access N tuple on disk.

Implements INTupleSvc.

Definition at line 561 of file NTupleSvc.cpp.

561  {
562  MsgStream log ( msgSvc(), name() );
563  return 0;
564 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
StatusCode NTupleSvc::attachTuple ( const std::string &  filename,
const std::string &  logname,
const char  typ,
const long  t 
)
protected

Attach output/input file.

Definition at line 494 of file NTupleSvc.cpp.

494  {
495  MsgStream log(msgSvc(), name());
496  DataObject* p;
497  // First get the root object
498  StatusCode status = retrieveObject(m_rootName, p);
499  if ( status.isSuccess() ) {
500  // Now add the registry entry to the store
501  std::string entryname = m_rootName;
502  entryname += '/';
503  entryname += logname;
504  GenericAddress* pA =
505  new GenericAddress(t, CLID_NTupleFile, filename, entryname, 0, typ);
506  status = registerAddress(p, logname, pA);
507  if ( status.isSuccess() ) {
508  log << MSG::INFO << "Added stream file:" << filename << " as " << logname << endmsg;
509  return status;
510  }
511  pA->release();
512  }
513  log << MSG::ERROR << "Cannot add file:" << filename << " as " << logname << endmsg;
514  return status;
515 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
std::string m_rootName
Name of root event.
Definition: DataSvc.h:49
Generic Transient Address.
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)
IDataManagerSvc: Register object address with the data store.
Definition: DataSvc.cpp:262
virtual unsigned long release()
release reference to object
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:864
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
NTuple::Tuple * NTupleSvc::book ( const std::string &  fullPath,
const CLID type,
const std::string &  title 
)
virtual

Book Ntuple and register it with the data store.

Implements INTupleSvc.

Definition at line 387 of file NTupleSvc.cpp.

387  {
388  DataObject* pObj = 0;
389  std::string path = fullPath;
390  MsgStream log(msgSvc(), name());
391  if ( path[0] != SEPARATOR ) {
392  path = m_rootName;
393  path += SEPARATOR;
394  path += fullPath;
395  }
396  StatusCode status = retrieveObject(path, pObj);
397  if ( !status.isSuccess() ) {
398  int sep = path.rfind(SEPARATOR);
399  if ( sep > 0 ) {
400  std::string p_path (path, 0, sep);
401  std::string o_path (path, sep, path.length());
402  DataObject* dir = createDirectory(p_path);
403  if ( 0 != dir ) {
404  NTuple::Tuple* tup = book( dir, o_path, type, title);
405  if ( 0 == tup ) {
406  log << MSG::ERROR << "Cannot book N-tuple " << path << " (Unknown reason)" << endmsg;
407  }
408  return tup;
409  }
410  log << MSG::ERROR << "Cannot book N-tuple " << path << " (Invalid parent directory)" << endmsg;
411  return 0;
412  }
413  log << MSG::ERROR << "Cannot book N-tuple " << path << " (Invalid path)" << endmsg;
414  return 0;
415  }
416  log << MSG::ERROR << "Cannot book N-tuple " << path << " (Exists already)" << endmsg;
417  return 0;
418 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
std::string m_rootName
Name of root event.
Definition: DataSvc.h:49
virtual NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title)
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:462
string type
Definition: gaudirun.py:126
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
Retrieve object from data store.
Definition: DataSvc.cpp:864
virtual NTuple::Tuple * book(const std::string &fullPath, const CLID &type, const std::string &title)
Book Ntuple and register it with the data store.
Definition: NTupleSvc.cpp:387
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
NTuple::Tuple * NTupleSvc::book ( const std::string &  dirPath,
const std::string &  relPath,
const CLID type,
const std::string &  title 
)
virtual

Book Ntuple and register it with the data store.

Implements INTupleSvc.

Definition at line 421 of file NTupleSvc.cpp.

421  {
422  std::string full = dirPath;
423  if (relPath[0] != SEPARATOR) full += SEPARATOR;
424  full += relPath;
425  return book(full, type, title);
426 }
string type
Definition: gaudirun.py:126
virtual NTuple::Tuple * book(const std::string &fullPath, const CLID &type, const std::string &title)
Book Ntuple and register it with the data store.
Definition: NTupleSvc.cpp:387
NTuple::Tuple * NTupleSvc::book ( const std::string &  dirPath,
long  id,
const CLID type,
const std::string &  title 
)
virtual

Book Ntuple and register it with the data store.

Implements INTupleSvc.

Definition at line 429 of file NTupleSvc.cpp.

429  {
430  return book( dirPath, toStr(id), type, title);
431 }
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
string type
Definition: gaudirun.py:126
virtual NTuple::Tuple * book(const std::string &fullPath, const CLID &type, const std::string &title)
Book Ntuple and register it with the data store.
Definition: NTupleSvc.cpp:387
NTuple::Tuple * NTupleSvc::book ( DataObject pParent,
const std::string &  relPath,
const CLID type,
const std::string &  title 
)
virtual

Book Ntuple and register it with the data store.

Implements INTupleSvc.

Definition at line 434 of file NTupleSvc.cpp.

434  {
435  NTuple::Tuple* pObj = 0;
436  // Check if object is already present
437  StatusCode status = findObject(pParent, relPath, *pp_cast<DataObject>(&pObj));
438  // No ? Then create it!
439  if ( !status.isSuccess() ) {
440  status = create( type, title, pObj);
441  if ( status.isSuccess() ) {
442  // Finally register the created N tuple with the store
443  status = registerObject(pParent, relPath, pObj);
444  if ( status.isSuccess() ) {
445  return pObj;
446  }
447  pObj->release();
448  }
449  }
450  return 0;
451 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:937
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)
Register object with the data store.
Definition: DataSvc.cpp:412
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
string type
Definition: gaudirun.py:126
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:44
virtual StatusCode create(const CLID &typ, const std::string &title, NTuple::Tuple *&refpTuple)
Create requested N tuple (Hide constructor)
Definition: NTupleSvc.cpp:366
NTuple::Tuple * NTupleSvc::book ( DataObject pParent,
long  id,
const CLID type,
const std::string &  title 
)
virtual

Book Ntuple and register it with the data store.

Implements INTupleSvc.

Definition at line 454 of file NTupleSvc.cpp.

457  {
458  return book( pParent, toStr(id), type, title);
459 }
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
string type
Definition: gaudirun.py:126
virtual NTuple::Tuple * book(const std::string &fullPath, const CLID &type, const std::string &title)
Book Ntuple and register it with the data store.
Definition: NTupleSvc.cpp:387
StatusCode NTupleSvc::connect ( const std::string &  ident)
virtual

Add file to list I/O list.

Implements IDataSourceMgr.

Definition at line 225 of file NTupleSvc.cpp.

225  {
226  std::string logName;
227  return connect(ident, logName);
228 }
virtual StatusCode connect(const std::string &ident)
Add file to list I/O list.
Definition: NTupleSvc.cpp:225
StatusCode NTupleSvc::connect ( const std::string &  ident,
std::string &  logname 
)
virtual

Add file to list I/O list.

Implements IDataSourceMgr.

Reimplemented in TagCollectionSvc.

Definition at line 230 of file NTupleSvc.cpp.

230  {
231  MsgStream log ( msgSvc(), name() );
232  DataObject* pO = 0;
233  StatusCode status = findObject(m_rootName, pO);
234  if ( status.isSuccess() ) {
235  char typ=0;
236  Tokenizer tok(true);
237  std::vector<Prop> props;
238  long loc = ident.find(" ");
239  std::string filename, auth, svc = "", db_typ = "";
240  logname = ident.substr(0,loc);
241  tok.analyse(ident.substr(loc+1,ident.length()), " ", "", "", "=", "'", "'");
242  for ( Tokenizer::Items::iterator i = tok.items().begin(); i != tok.items().end(); ++i) {
243  const std::string& tag = (*i).tag();
244  switch( ::toupper(tag[0]) ) {
245  case 'A':
246  break;
247  case 'F': // FILE='<file name>'
248  case 'D': // DATAFILE='<file name>'
249  filename = (*i).value();
250  break;
251  case 'O': // OPT='<NEW<CREATE,WRITE>, UPDATE, READ>'
252  switch( ::toupper((*i).value()[0]) ) {
253  case 'C':
254  case 'N':
255  case 'W':
256  typ = 'N';
257  break;
258  case 'U':
259  typ = 'U';
260  break;
261  case 'O':
262  case 'R':
263  typ = 'O';
264  break;
265  default:
266  typ = 0;
267  break;
268  }
269  break;
270  case 'T': // TYP='<HBOOK,ROOT,OBJY,...>'
271  db_typ = (*i).value();
272  break;
273  default:
274  props.push_back( Prop((*i).tag(), (*i).value()));
275  break;
276  }
277  }
278  if ( 0 != typ ) {
279  IConversionSvc* pSvc = 0;
280  status = createService(name()+'.'+logname, db_typ, props, pSvc);
281  if ( status.isSuccess() ) {
282  status = attachTuple(filename, logname, typ, pSvc->repSvcType());
283  if ( status.isSuccess() ) {
284  m_connections.insert(Connections::value_type(m_rootName+'/'+logname,Connection(pSvc)));
285  return StatusCode::SUCCESS;
286  }
287  }
288  }
289  }
290  log << MSG::ERROR << "Cannot add " << ident << " invalid filename!" << endmsg;
291  return StatusCode::FAILURE;
292 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:937
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
std::string m_rootName
Name of root event.
Definition: DataSvc.h:49
StatusCode createService(const std::string &nam, const std::string &typ, const std::vector< Prop > &props, IConversionSvc *&pSvc)
Create conversion service.
Definition: NTupleSvc.cpp:294
std::pair< std::string, std::string > Prop
Definition: NTupleSvc.h:36
virtual long repSvcType() const =0
Retrieve the class type of the data store the converter uses.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
STL Include files.
Definition: Tokenizer.h:24
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
StatusCode attachTuple(const std::string &filename, const std::string &logname, const char typ, const long t)
Attach output/input file.
Definition: NTupleSvc.cpp:494
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
list i
Definition: ana.py:128
void toupper(std::string &s)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
Connections m_connections
Container of connection points.
Definition: NTupleSvc.h:127
StatusCode NTupleSvc::create ( const CLID typ,
const std::string &  title,
NTuple::Tuple *&  refpTuple 
)
virtual

Create requested N tuple (Hide constructor)

Eventually allow loading through factory?

Implements INTupleSvc.

Definition at line 366 of file NTupleSvc.cpp.

366  {
367  NTuple::TupleImp* pTuple = 0;
369  if ( typ == CLID_ColumnWiseTuple ) {
370  pTuple = new NTuple::ColumnWiseTuple( title );
371  }
372  else if ( typ == CLID_RowWiseTuple ) {
373  pTuple = new NTuple::RowWiseTuple( title );
374  }
375  else {
377  }
378  if ( 0 != pTuple ) {
379  pTuple->setTupleService(this);
380  status = StatusCode::SUCCESS;
381  }
382  refpTuple = pTuple;
383  return status;
384 }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
void setTupleService(INTupleSvc *svc)
Access conversion service.
NTuple::Directory * NTupleSvc::createDirectory ( DataObject pParent,
const std::string &  title 
)
virtual

Create Ntuple directory and register it with the data store.

Implements INTupleSvc.

Definition at line 462 of file NTupleSvc.cpp.

463  {
464  if ( 0 != pParent ) {
465  IRegistry* pDir = pParent->registry();
466  if ( 0 != pDir ) {
467  std::string full = pDir->identifier();
468  full += (relPath[0]=='/') ? "" : "/";
469  full += relPath;
470  return createDirectory(full);
471  }
472  }
473  return 0;
474 }
virtual NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title)
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:462
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual const id_type & identifier() const =0
Full identifier (or key)
NTuple::Directory * NTupleSvc::createDirectory ( DataObject pParent,
long  id 
)
virtual

Create Ntuple directory and register it with the data store.

Implements INTupleSvc.

Definition at line 477 of file NTupleSvc.cpp.

477  {
478  return createDirectory( pParent, toStr(id) );
479 }
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
virtual NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title)
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:462
NTuple::Directory * NTupleSvc::createDirectory ( const std::string &  dirPath,
long  id 
)
virtual

Create Ntuple directory and register it with the data store.

Implements INTupleSvc.

Definition at line 482 of file NTupleSvc.cpp.

482  {
483  return createDirectory( dirPath, toStr(id) );
484 }
const char * toStr(IAuditor::StandardEventType e)
Simple mapping function from IAuditor::StandardEventType to string.
Definition: IAuditor.h:106
virtual NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title)
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:462
NTuple::Directory * NTupleSvc::createDirectory ( const std::string &  dirPath,
const std::string &  title 
)
virtual

Create Ntuple directory and register it with the data store.

Implements INTupleSvc.

Definition at line 487 of file NTupleSvc.cpp.

487  {
488  std::string full = dirPath;
489  full += (relPath[0]=='/') ? "" : "/";
490  full += relPath;
491  return createDirectory(full);
492 }
virtual NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title)
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:462
NTuple::Directory * NTupleSvc::createDirectory ( const std::string &  fullPath)
virtual

Create Ntuple directory and register it with the data store.

Implements INTupleSvc.

Definition at line 518 of file NTupleSvc.cpp.

518  {
519  NTuple::Directory* p = 0;
520  StatusCode status = findObject(fullPath, *pp_cast<DataObject>(&p));
521  if ( !status.isSuccess() ) {
522  int sep2 = fullPath.rfind(SEPARATOR);
523  if ( sep2 > 0 ) {
524  std::string relPath = fullPath.substr(0, sep2);
525  p = createDirectory(relPath);
526  if ( 0 != p ) {
527  p = new NTuple::Directory();
528  // Finally register the created N tuple with the store
529  status = registerObject(fullPath, p);
530  if ( status.isSuccess() ) {
531  // ...starting from the file entries
533  if ( 0 != svc ) {
534  IOpaqueAddress* pAddr = 0;
535  status = svc->createRep (p, pAddr);
536  if ( status.isSuccess() ) {
537  p->registry()->setAddress(pAddr);
538  status = svc->fillRepRefs (pAddr, p);
539  if ( status.isSuccess() ) {
540  return p;
541  }
542  }
543  }
544  unregisterObject(p);
545  }
546  p->release();
547  p = 0;
548  }
549  }
550  }
551  try {
552  p = dynamic_cast<NTuple::Directory*>(p);
553  return p;
554  }
555  catch (...) {
556  }
557  return 0;
558 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:937
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)
Register object with the data store.
Definition: DataSvc.cpp:412
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
virtual NTuple::Directory * createDirectory(DataObject *pParent, const std::string &title)
Create Ntuple directory and register it with the data store.
Definition: NTupleSvc.cpp:462
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
DataSvc overrides: Retrieve data loader.
Definition: NTupleSvc.cpp:113
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:44
virtual void setAddress(IOpaqueAddress *pAddress)=0
Set/Update Opaque storage address.
virtual StatusCode unregisterObject(const std::string &fullPath)
Unregister object from the data store.
Definition: DataSvc.cpp:541
Opaque address interface definition.
Small class representing an N tuple directory in the transient store.
Definition: NTuple.h:1065
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
StatusCode NTupleSvc::createService ( const std::string &  nam,
const std::string &  typ,
const std::vector< Prop > &  props,
IConversionSvc *&  pSvc 
)
protected

Create conversion service.

CGL: set the storage type

Definition at line 294 of file NTupleSvc.cpp.

298 {
299  MsgStream log ( msgSvc(), name() );
301  // Get the value of the Stat persistancy mechanism from the AppMgr
302  IProperty* appPropMgr = 0;
303  StatusCode sts = serviceLocator()->queryInterface(IProperty::interfaceID(), pp_cast<void>(&appPropMgr) );
304  if( !sts.isSuccess() ) {
305  // Report an error and return the FAILURE status code
306  log << MSG::ERROR << "Could not get PropMgr" << endmsg;
307  return sts;
308  }
309 
310  StringProperty sp("HistogramPersistency","");
311  sts = appPropMgr->getProperty( &sp );
312  if ( !sts.isSuccess() ) {
313  log << MSG::ERROR << "Could not get NTuple Persistency format"
314  << " from ApplicationMgr properties" << endmsg;
315  return sts;
316  }
317 
318  long storage_typ = TEST_StorageType;
319  if ( sp.value() == "HBOOK" ) {
320  storage_typ = HBOOK_StorageType;
321  }
322  else if ( sp.value() == "ROOT" ) {
323  storage_typ = ROOT_StorageType;
324  }
325  else {
326  appPropMgr->release();
327  log << MSG::ERROR << "Unknown NTuple Persistency format: " << sp.value() << endmsg;
328  return StatusCode::FAILURE;
329  }
330  // Clean up
331  appPropMgr->release();
332 
333  if ( typ.length() > 0 && typ != sp.value() ) {
334  log << MSG::WARNING << "NTuple persistency type is "
335  << sp.value() << "." << endmsg
336  << "Type given by job option "
337  << "NTupleSvc.Input/Output ignored!" << endmsg;
338  }
339 
340  // log << MSG::DEBUG << "storage type: " << m_storageType << endmsg;
341 
342  // FIXME: (MCl) why NTupleSvc has to directly create a ConversionSvc?
343  IService* pService = 0;
344  IInterface* iface = new ConversionSvc(name()+"Conversions", serviceLocator(), storage_typ);
345  StatusCode status = iface->queryInterface(IService::interfaceID(), pp_cast<void>(&pService));
346  if ( status.isSuccess() ) {
347  status = iface->queryInterface(IConversionSvc::interfaceID(), pp_cast<void>(&pSvc));
348  if ( !status.isSuccess() ) {
349  pService->release();
350  return status;
351  }
352  }
353  status = pService->sysInitialize();
354  if ( !status.isSuccess() ) {
355  return status;
356  }
357  pService->release();
358  status = pSvc->setDataProvider(this);
359  if ( !status.isSuccess() ) {
360  return status;
361  }
362  return status;
363 }
const long TEST_StorageType
Definition: ClassID.h:50
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
const long HBOOK_StorageType
Definition: ClassID.h:57
virtual StatusCode getProperty(Property *p) const =0
Get the property by property.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
virtual StatusCode sysInitialize()=0
Initialize Service.
General service interface definition.
Definition: IService.h:19
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Definition of the basic interface.
Definition: IInterface.h:160
const long ROOT_StorageType
Definition: ClassID.h:53
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
virtual unsigned long release()=0
Release Interface instance.
Base class for all conversion services.
Definition: ConversionSvc.h:47
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:22
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Definition: IInterface.h:171
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Service.cpp:336
virtual StatusCode queryInterface(const InterfaceID &ti, void **pp)=0
Set the void** to the pointer to the requested interface of the instance.
StatusCode NTupleSvc::disconnect ( const std::string &  nam)
virtual

Close open connection.

Implements IDataSourceMgr.

Definition at line 197 of file NTupleSvc.cpp.

197  {
198  Connections::iterator i = m_connections.find(nam);
199  if ( i != m_connections.end() ) {
200  releaseConnection((*i).second);
201  m_connections.erase(i);
202  return StatusCode::SUCCESS;
203  }
204  return StatusCode::FAILURE;
205 }
void releaseConnection(Connection &c)
Finalize single service.
Definition: NTupleSvc.cpp:187
list i
Definition: ana.py:128
Connections m_connections
Container of connection points.
Definition: NTupleSvc.h:127
StatusCode NTupleSvc::disconnectAll ( )
virtual

Close all open connections.

Implements IDataSourceMgr.

Definition at line 208 of file NTupleSvc.cpp.

208  {
209  for(Connections::iterator i = m_connections.begin(); i != m_connections.end(); ++i) {
210  releaseConnection((*i).second);
211  }
212  m_connections.erase(m_connections.begin(), m_connections.end());
213  return StatusCode::SUCCESS;
214 }
void releaseConnection(Connection &c)
Finalize single service.
Definition: NTupleSvc.cpp:187
list i
Definition: ana.py:128
Connections m_connections
Container of connection points.
Definition: NTupleSvc.h:127
StatusCode NTupleSvc::finalize ( )
virtual

DataSvc overrides: stop the service.

stop the service.

Reimplemented from DataSvc.

Reimplemented in TagCollectionSvc.

Definition at line 217 of file NTupleSvc.cpp.

217  {
218  StatusCode status = updateDirectories();
219  status = clearStore();
220  status = DataSvc::finalize();
221  status = disconnectAll();
222  return status;
223 }
StatusCode updateDirectories()
Update directory data.
Definition: NTupleSvc.cpp:127
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode clearStore()
IDataManagerSvc: Remove all data objects in the data store.
Definition: DataSvc.cpp:108
virtual StatusCode disconnectAll()
Close all open connections.
Definition: NTupleSvc.cpp:208
virtual StatusCode finalize()
Service initialization.
Definition: DataSvc.cpp:1336
IConversionSvc * NTupleSvc::getDataLoader ( IRegistry pReg)
virtual

DataSvc overrides: Retrieve data loader.

DataSvc override: Retrieve data loader.

Reimplemented from DataSvc.

Definition at line 113 of file NTupleSvc.cpp.

113  {
114  if ( 0 != pRegistry ) {
115  std::string full = pRegistry->identifier();
116  size_t len = m_rootName.length();
117  size_t idx = full.find(SEPARATOR,len+1);
118  std::string path = (idx==std::string::npos) ? full : full.substr(0, idx);
119  Connections::iterator i = m_connections.find(path);
120  if ( i != m_connections.end() ) {
121  return (*i).second.service;
122  }
123  }
124  return 0;
125 }
std::string m_rootName
Name of root event.
Definition: DataSvc.h:49
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
list i
Definition: ana.py:128
Connections m_connections
Container of connection points.
Definition: NTupleSvc.h:127
StatusCode NTupleSvc::initialize ( )
virtual

DataSvc overrides: Initialize the service.

Initialize the service.

Reimplemented from DataSvc.

Reimplemented in TagCollectionSvc.

Definition at line 76 of file NTupleSvc.cpp.

76  {
78  if ( status.isSuccess() ) {
79  status = setProperties();
80  if ( status.isSuccess() ) {
83  status = setRoot(m_rootName, root);
84  for ( DBaseEntries::iterator i = m_output.begin(); i != m_output.end(); ++i ) {
85  iret = connect(*i);
86  if ( !iret.isSuccess() ) {
87  status = iret;
88  }
89  }
90  for ( DBaseEntries::iterator j = m_input.begin(); j != m_input.end(); ++j ) {
91  iret = connect(*j);
92  if ( !iret.isSuccess() ) {
93  status = iret;
94  }
95  }
96  }
97  }
98  return status;
99 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
std::string m_rootName
Name of root event.
Definition: DataSvc.h:49
virtual StatusCode setRoot(const std::string &root_name, DataObject *pRootObj)
Initialize data store for new event by giving new event path and root object.
Definition: DataSvc.cpp:155
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode connect(const std::string &ident)
Add file to list I/O list.
Definition: NTupleSvc.cpp:225
StatusCode setProperties()
Method for setting declared properties to the values specified for the job.
Definition: Service.cpp:371
DBaseEntries m_input
Input streams.
Definition: NTupleSvc.h:125
virtual StatusCode initialize()
Service initialization.
Definition: DataSvc.cpp:1295
DBaseEntries m_output
Output streams.
Definition: NTupleSvc.h:123
tuple root
Definition: IOTest.py:42
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
Small class representing an N tuple directory in the transient store.
Definition: NTuple.h:1065
list i
Definition: ana.py:128
bool NTupleSvc::isConnected ( const std::string &  identifier) const
virtual

Check if a datasource is connected.

Implements IDataSourceMgr.

Definition at line 107 of file NTupleSvc.cpp.

107  {
108  Connections::const_iterator i = m_connections.find(identifier);
109  return !(i==m_connections.end());
110 }
list i
Definition: ana.py:128
Connections m_connections
Container of connection points.
Definition: NTupleSvc.h:127
StatusCode NTupleSvc::readRecord ( NTuple::Tuple tuple)
virtual

Read single record from N tuple.

Implements INTupleSvc.

Definition at line 659 of file NTupleSvc.cpp.

659  {
660  StatusCode status = INVALID_OBJECT;
661  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
662  if ( 0 != tuple ) {
663  try {
664  IConversionSvc* pSvc = tuple->conversionService();
665  if ( 0 == pSvc ) {
666  pSvc = getDataLoader(n_tuple->registry());
667  tuple->setConversionService(pSvc);
668  }
669  if ( 0 != pSvc ) {
670  IRegistry* pReg = n_tuple->registry();
671  IOpaqueAddress* pAddr = pReg->address();
672  status = pSvc->updateObj(pAddr, n_tuple);
673  if ( status.isSuccess() ) {
674  status = pSvc->updateObjRefs(pAddr, n_tuple);
675  }
676  return status;
677  }
679  }
680  catch(...) {
681  status = INVALID_OBJECT;
682  }
683  }
684  return status;
685 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
No data loader available.
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an updated transient object.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
DataSvc overrides: Retrieve data loader.
Definition: NTupleSvc.cpp:113
Object pointer is invalid.
void setConversionService(IConversionSvc *svc)
Access conversion service.
Opaque address interface definition.
IConversionSvc * conversionService() const
Access conversion service.
StatusCode NTupleSvc::readRecord ( const std::string &  fullPath)
virtual

Read single record from N tuple.

Implements INTupleSvc.

Definition at line 688 of file NTupleSvc.cpp.

688  {
689  NTuple::Tuple* pObj = 0;
690  StatusCode status = findObject(fullPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
691  if ( status.isSuccess() ) {
692  return readRecord ( pObj );
693  }
694  return INVALID_OBJ_PATH;
695 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:937
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
virtual StatusCode readRecord(NTuple::Tuple *tuple)
Read single record from N tuple.
Definition: NTupleSvc.cpp:659
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
Invalid path from root to object request failed.
StatusCode NTupleSvc::readRecord ( DataObject pParent,
const std::string &  relPath 
)
virtual

Read single record from N tuple.

Implements INTupleSvc.

Definition at line 698 of file NTupleSvc.cpp.

698  {
699  NTuple::Tuple* pObj = 0;
700  StatusCode status = findObject(pParent, relPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
701  if ( status.isSuccess() ) {
702  return readRecord ( pObj );
703  }
704  return INVALID_OBJ_PATH;
705 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:937
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
virtual StatusCode readRecord(NTuple::Tuple *tuple)
Read single record from N tuple.
Definition: NTupleSvc.cpp:659
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
Invalid path from root to object request failed.
StatusCode NTupleSvc::reinitialize ( )
virtual

DataSvc overrides: reinitialize service.

Initialize the service.

Reimplemented from DataSvc.

Definition at line 102 of file NTupleSvc.cpp.

102  {
103  return StatusCode::SUCCESS;
104 }
void NTupleSvc::releaseConnection ( Connection c)
protected

Finalize single service.

Definition at line 187 of file NTupleSvc.cpp.

187  {
188  SmartIF<IService> isvc( c.service );
189  if ( isvc.isValid( ) ) {
190  isvc->finalize().ignore();
191  }
192  c.service->release();
193  c.service = 0;
194 }
tuple c
Definition: gaudirun.py:341
StatusCode NTupleSvc::save ( const std::string &  fullPath)
virtual

Save N tuple to disk. Must be called in order to close the ntuple file properly.

Implements INTupleSvc.

Definition at line 567 of file NTupleSvc.cpp.

567  {
568  MsgStream log ( msgSvc(), name() );
569  NTuple::Tuple* pObj = 0;
570  StatusCode status = findObject(fullPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
571  if ( status.isSuccess() ) {
572  return save ( pObj );
573  }
574  return INVALID_OBJ_PATH;
575 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:937
virtual StatusCode save(const std::string &fullPath)
Save N tuple to disk. Must be called in order to close the ntuple file properly.
Definition: NTupleSvc.cpp:567
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
Invalid path from root to object request failed.
StatusCode NTupleSvc::save ( NTuple::Tuple tuple)
virtual

Save N tuple to disk. Must be called in order to close the ntuple file properly.

Implements INTupleSvc.

Definition at line 578 of file NTupleSvc.cpp.

578  {
579  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
580  if ( 0 != tuple ) {
581  try {
582  IConversionSvc* pSvc = tuple->conversionService();
583  IRegistry* pReg = tuple->registry();
584  if ( 0 != pSvc && 0 != pReg ) {
585  IOpaqueAddress* pAddr = pReg->address();
586  StatusCode status = pSvc->updateRep(pAddr, n_tuple);
587  if ( status.isSuccess() ) {
588  status = pSvc->updateRepRefs(pAddr, n_tuple);
589  }
590  return status;
591  }
593  }
594  catch(...) {
595  }
596  }
597  return INVALID_OBJECT;
598 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
No data loader available.
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an already converted object.
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the converted representation of a transient object.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
Object pointer is invalid.
Opaque address interface definition.
IConversionSvc * conversionService() const
Access conversion service.
StatusCode NTupleSvc::save ( DataObject pParent,
const std::string &  relPath 
)
virtual

Save N tuple to disk. Must be called in order to close the ntuple file properly.

Implements INTupleSvc.

Definition at line 601 of file NTupleSvc.cpp.

601  {
602  NTuple::Tuple* pObj = 0;
603  StatusCode status = findObject(pParent, relPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
604  if ( status.isSuccess() ) {
605  return save ( pObj );
606  }
607  return INVALID_OBJ_PATH;
608 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:937
virtual StatusCode save(const std::string &fullPath)
Save N tuple to disk. Must be called in order to close the ntuple file properly.
Definition: NTupleSvc.cpp:567
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
Invalid path from root to object request failed.
StatusCode NTupleSvc::updateDirectories ( )
protected

Update directory data.

Definition at line 127 of file NTupleSvc.cpp.

127  {
128  typedef std::vector<IRegistry*> Leaves;
129  long need_update = 0;
130  DataObject* pO = 0;
131  StatusCode iret = findObject(m_rootName, pO);
132  MsgStream log ( msgSvc(), name() );
133  // log << MSG::DEBUG << "in finalize()" << endmsg;
134  if ( iret.isSuccess() ) {
135  Leaves leaves;
136  iret = objectLeaves(pO, leaves);
137  if ( iret.isSuccess() ) {
138  // Only traverse the tree below the files
139  for ( Leaves::iterator d = leaves.begin(); d != leaves.end(); d++ ) {
140  if ( (*d)->object() ) {
141  IOpaqueAddress* pA = (*d)->address();
142  if ( pA ) {
143  unsigned long typ = pA->ipar()[1];
144  if ( typ == 'R' || typ == 'N' || typ == 'U' ) {
145  // ...starting from the file entries: first save the directories/ntuples
146  IConversionSvc* svc = getDataLoader(*d);
147  if ( 0 != svc ) {
148  StatusCode status;
149  DataSelectionAgent agent;
150  IDataSelector* sel = agent.selectedObjects();
151  traverseSubTree ( (*d)->object(), &agent ).ignore();
152  for(int i = sel->size()-1; i >= 0; i-- ) {
153  DataObject* o = (*sel)[i];
154  IRegistry* r = o->registry();
155  status = svc->updateRep(r->address(), o);
156  if ( !status.isSuccess() ) {
157  iret = status;
158  }
159  }
160  for(int j = sel->size()-1; j >= 0; j-- ) {
161  DataObject* o = (*sel)[j];
162  IRegistry* r = o->registry();
163  status = svc->updateRepRefs(r->address(), o);
164  if ( !status.isSuccess() ) {
165  iret = status;
166  }
167  }
168  if ( iret.isSuccess() ) need_update += sel->size();
169  }
170  }
171  }
172  }
173  }
174  }
175  }
176  if ( !iret.isSuccess() ) {
177  log << MSG::ERROR << "ERROR while saving NTuples" << endmsg;
178  return iret;
179  }
180  else if ( need_update > 0 ) {
181  log << MSG::INFO << "NTuples saved successfully" << endmsg;
182  }
183  return iret;
184 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:937
DataSelectionAgent base in charge of collecting all the refereces to DataObjects in a transient store...
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)
IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
Definition: DataSvc.cpp:237
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
std::string m_rootName
Name of root event.
Definition: DataSvc.h:49
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an already converted object.
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:69
IDataSelector * selectedObjects()
Return the set of selected DataObjects.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the converted representation of a transient object.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
DataSvc overrides: Retrieve data loader.
Definition: NTupleSvc.cpp:113
virtual StatusCode traverseSubTree(const std::string &sub_tree_path, IDataStoreAgent *pAgent)
IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full pat...
Definition: DataSvc.cpp:120
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
list i
Definition: ana.py:128
std::vector< DataObject * > IDataSelector
This is only a placeholder to allow me compiling until the responsible guy does his work! M...
Definition: IDataSelector.h:8
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode NTupleSvc::writeRecord ( NTuple::Tuple tuple)
virtual

Write single record to N tuple.

Implements INTupleSvc.

Definition at line 611 of file NTupleSvc.cpp.

611  {
612  NTuple::TupleImp* tuple = (NTuple::TupleImp*)n_tuple;
613  if ( 0 != tuple ) {
614  try {
615  IConversionSvc* pSvc = tuple->conversionService();
616  if ( 0 == pSvc ) {
617  pSvc = getDataLoader(n_tuple->registry());
618  tuple->setConversionService(pSvc);
619  }
620  if ( 0 != pSvc ) {
621  IRegistry* pReg = n_tuple->registry();
622  IOpaqueAddress* pAddr = pReg->address();
623  StatusCode status = pSvc->createRep(n_tuple, pAddr);
624  if ( status.isSuccess() ) {
625  pReg->setAddress(pAddr);
626  status = pSvc->fillRepRefs(pAddr, n_tuple);
627  }
628  return status;
629  }
631  }
632  catch(...) {
633  }
634  }
635  return INVALID_OBJECT;
636 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
No data loader available.
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual IConversionSvc * getDataLoader(IRegistry *pReg)
DataSvc overrides: Retrieve data loader.
Definition: NTupleSvc.cpp:113
virtual void setAddress(IOpaqueAddress *pAddress)=0
Set/Update Opaque storage address.
Object pointer is invalid.
void setConversionService(IConversionSvc *svc)
Access conversion service.
Opaque address interface definition.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
IConversionSvc * conversionService() const
Access conversion service.
StatusCode NTupleSvc::writeRecord ( const std::string &  fullPath)
virtual

Write single record to N tuple.

Implements INTupleSvc.

Definition at line 639 of file NTupleSvc.cpp.

639  {
640  NTuple::Tuple* pObj = 0;
641  StatusCode status = findObject(fullPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
642  if ( status.isSuccess() ) {
643  return writeRecord ( pObj );
644  }
645  return INVALID_OBJ_PATH;
646 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:937
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
virtual StatusCode writeRecord(NTuple::Tuple *tuple)
Write single record to N tuple.
Definition: NTupleSvc.cpp:611
Invalid path from root to object request failed.
StatusCode NTupleSvc::writeRecord ( DataObject pParent,
const std::string &  relPath 
)
virtual

Write single record to N tuple.

Implements INTupleSvc.

Definition at line 649 of file NTupleSvc.cpp.

649  {
650  NTuple::Tuple* pObj = 0;
651  StatusCode status = findObject(pParent, relPath, *pp_cast<DataObject>(&pObj)); // Check if object is present
652  if ( status.isSuccess() ) {
653  return writeRecord ( pObj );
654  }
655  return INVALID_OBJ_PATH;
656 }
virtual StatusCode findObject(const std::string &fullPath, DataObject *&pObject)
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:937
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
virtual StatusCode writeRecord(NTuple::Tuple *tuple)
Write single record to N tuple.
Definition: NTupleSvc.cpp:611
Invalid path from root to object request failed.

Member Data Documentation

Connections NTupleSvc::m_connections
protected

Container of connection points.

Definition at line 127 of file NTupleSvc.h.

DBaseEntries NTupleSvc::m_input
protected

Input streams.

Definition at line 125 of file NTupleSvc.h.

DBaseEntries NTupleSvc::m_output
protected

Output streams.

Definition at line 123 of file NTupleSvc.h.


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