The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
TagCollectionSvc Class Reference

Gaudi tag collection service definition. More...

#include </builds/gaudi/Gaudi/GaudiSvc/src/NTupleSvc/TagCollectionSvc.h>

Inheritance diagram for TagCollectionSvc:
Collaboration diagram for TagCollectionSvc:

Public Member Functions

 TagCollectionSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor.
 
StatusCode connect (const std::string &ident) override
 unhides some NTupleSvc methods
 
- Public Member Functions inherited from NTupleSvc
StatusCode initialize () override
 DataSvc overrides: Initialize the service.
 
StatusCode reinitialize () override
 DataSvc overrides: reinitialize service.
 
StatusCode finalize () override
 DataSvc overrides: stop the service.
 
IConversionSvcgetDataLoader (IRegistry *pReg) override
 DataSvc overrides: Retrieve data loader.
 
NTuple::DirectorycreateDirectory (DataObject *pParent, const std::string &title) override
 Create Ntuple directory and register it with the data store.
 
NTuple::DirectorycreateDirectory (DataObject *pParent, long id) override
 Create Ntuple directory and register it with the data store.
 
NTuple::DirectorycreateDirectory (const std::string &dirPath, long id) override
 Create Ntuple directory and register it with the data store.
 
NTuple::DirectorycreateDirectory (const std::string &dirPath, const std::string &title) override
 Create Ntuple directory and register it with the data store.
 
NTuple::DirectorycreateDirectory (const std::string &fullPath) override
 Create Ntuple directory and register it with the data store.
 
StatusCode create (const CLID &typ, const std::string &title, NTuple::Tuple *&refpTuple) override
 Create requested N tuple (Hide constructor)
 
NTuple::Tuplebook (const std::string &fullPath, const CLID &type, const std::string &title) override
 Book Ntuple and register it with the data store.
 
NTuple::Tuplebook (const std::string &dirPath, const std::string &relPath, const CLID &type, const std::string &title) override
 Book Ntuple and register it with the data store.
 
NTuple::Tuplebook (const std::string &dirPath, long id, const CLID &type, const std::string &title) override
 Book Ntuple and register it with the data store.
 
NTuple::Tuplebook (DataObject *pParent, const std::string &relPath, const CLID &type, const std::string &title) override
 Book Ntuple and register it with the data store.
 
NTuple::Tuplebook (DataObject *pParent, long id, const CLID &type, const std::string &title) override
 Book Ntuple and register it with the data store.
 
NTuple::Tupleaccess (const std::string &fullPath, const std::string &filename) override
 Access N tuple on disk.
 
StatusCode save (const std::string &fullPath) override
 Save N tuple to disk. Must be called in order to close the ntuple file properly.
 
StatusCode save (NTuple::Tuple *tuple) override
 Save N tuple to disk. Must be called in order to close the ntuple file properly.
 
StatusCode save (DataObject *pParent, const std::string &relPath) override
 Save N tuple to disk. Must be called in order to close the ntuple file properly.
 
StatusCode writeRecord (NTuple::Tuple *tuple) override
 Write single record to N tuple.
 
StatusCode writeRecord (const std::string &fullPath) override
 Write single record to N tuple.
 
StatusCode writeRecord (DataObject *pParent, const std::string &relPath) override
 Write single record to N tuple.
 
StatusCode readRecord (NTuple::Tuple *tuple) override
 Read single record from N tuple.
 
StatusCode readRecord (const std::string &fullPath) override
 Read single record from N tuple.
 
StatusCode readRecord (DataObject *pParent, const std::string &relPath) override
 Read single record from N tuple.
 
bool isConnected (const std::string &identifier) const override
 Check if a datasource is connected.
 
StatusCode connect (const std::string &ident) override
 Add file to list I/O list.
 
StatusCode connect (const std::string &ident, std::string &logname) override
 Add file to list I/O list.
 
StatusCode disconnect (const std::string &nam) override
 Close open connection.
 
StatusCode disconnectAll () override
 Close all open connections.
 
 NTupleSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor.
 
- Public Member Functions inherited from extends< DataSvc, INTupleSvc, IDataSourceMgr >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
- Public Member Functions inherited from DataSvc
CLID rootCLID () const override
 IDataManagerSvc: Accessor for root event CLID.
 
const std::string & rootName () const override
 IDataManagerSvc: Accessor for root event name.
 
StatusCode registerAddress (std::string_view fullPath, IOpaqueAddress *pAddress) override
 IDataManagerSvc: Register object address with the data store.
 
StatusCode registerAddress (IRegistry *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress) override
 IDataManagerSvc: Register object address with the data store.
 
StatusCode unregisterAddress (std::string_view fullPath) override
 IDataManagerSvc: Unregister object address from the data store.
 
StatusCode unregisterAddress (IRegistry *pParent, std::string_view objPath) override
 IDataManagerSvc: Unregister object address from the data store.
 
StatusCode objectLeaves (const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
 
StatusCode objectLeaves (const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves) override
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
 
StatusCode objectParent (const DataObject *pObject, IRegistry *&refpParent) override
 IDataManagerSvc: Explore the object store: retrieve the object's parent.
 
StatusCode objectParent (const IRegistry *pRegistry, IRegistry *&refpParent) override
 IDataManagerSvc: Explore the object store: retrieve the object's parent.
 
StatusCode clearSubTree (std::string_view sub_tree_path) override
 IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name.
 
StatusCode clearSubTree (DataObject *pObject) override
 IDataManagerSvc: Remove all data objects below the sub tree identified by the object.
 
StatusCode clearStore () override
 IDataManagerSvc: Remove all data objects in the data store.
 
StatusCode traverseSubTree (std::string_view sub_tree_path, IDataStoreAgent *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name.
 
StatusCode traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
 
StatusCode traverseTree (IDataStoreAgent *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects in the data store.
 
StatusCode setRoot (std::string root_name, DataObject *pRootObj) override
 Initialize data store for new event by giving new event path and root object.
 
virtual StatusCode i_setRoot (std::string root_name, DataObject *pRootObj)
 Initialize data store for new event by giving new event path and root object.
 
StatusCode setRoot (std::string root_path, IOpaqueAddress *pRootAddr) override
 Initialize data store for new event by giving new event path and address of root object.
 
virtual StatusCode i_setRoot (std::string root_path, IOpaqueAddress *pRootAddr)
 Initialize data store for new event by giving new event path and address of root object.
 
StatusCode setDataLoader (IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
 IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data provider.
 
StatusCode addPreLoadItem (const DataStoreItem &item) override
 Add an item to the preload list.
 
StatusCode removePreLoadItem (const DataStoreItem &item) override
 Remove an item from the preload list.
 
StatusCode resetPreLoad () override
 Clear the preload list.
 
virtual StatusCode preLoad (int depth, int load_depth, DataObject *pObject)
 Execute one level of preloading and recursively load until the final level is reached.
 
StatusCode preLoad () override
 load all preload items of the list
 
StatusCode registerObject (std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
 Register object with the data store.
 
StatusCode registerObject (DataObject *parentObj, std::string_view objPath, DataObject *pObject) override
 Register object with the data store.
 
StatusCode unregisterObject (std::string_view fullPath) override
 Unregister object from the data store.
 
StatusCode unregisterObject (DataObject *pObject) override
 Unregister object from the data store.
 
StatusCode unregisterObject (DataObject *pObject, std::string_view objectPath) override
 Unregister object from the data store.
 
StatusCode retrieveObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
 Retrieve object from data store.
 
StatusCode findObject (std::string_view fullPath, DataObject *&pObject) override
 Find object identified by its full path in the data store.
 
StatusCode findObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
 Find object identified by its full path in the data store.
 
StatusCode linkObject (IRegistry *from, std::string_view objPath, DataObject *to) override
 Add a link to another object.
 
StatusCode linkObject (std::string_view fullPath, DataObject *to) override
 Add a link to another object.
 
StatusCode unlinkObject (IRegistry *from, std::string_view objPath) override
 Remove a link to another object.
 
StatusCode unlinkObject (DataObject *fromObj, std::string_view objPath) override
 Remove a link to another object.
 
StatusCode unlinkObject (std::string_view fullPath) override
 Remove a link to another object.
 
StatusCode updateObject (IRegistry *pDirectory) override
 Update object identified by its directory entry.
 
StatusCode updateObject (DataObject *toUpdate) override
 Update object.
 
StatusCode initialize () override
 Service initialization.
 
StatusCode reinitialize () override
 Service initialization.
 
StatusCode finalize () override
 Service initialization.
 
 DataSvc (const DataSvc &)=delete
 copy constructor disabled
 
DataSvcoperator= (const DataSvc &)=delete
 Fake assignment operator (never implemented).
 
StatusCode registerAddress (DataObject *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)
 Register object address with the data store.
 
StatusCode unregisterAddress (DataObject *pParent, std::string_view objPath)
 Unregister object address from the data store.
 
StatusCode registerObject (std::string_view fullPath, DataObject *pObject)
 Register object with the data store.
 
StatusCode registerObject (std::string_view parentPath, int item, DataObject *pObject)
 Register object with the data store.
 
StatusCode registerObject (DataObject *parentObj, int item, DataObject *pObject)
 Register object with the data store.
 
StatusCode retrieveObject (std::string_view fullPath, DataObject *&pObject)
 Retrieve object identified by its full path from the data store.
 
StatusCode retrieveObject (std::string_view parentPath, std::string_view objectPath, DataObject *&pObject)
 Retrieve object from data store.
 
StatusCode retrieveObject (std::string_view parentPath, int item, DataObject *&pObject)
 Retrieve object from data store.
 
StatusCode retrieveObject (DataObject *parentObj, std::string_view objectPath, DataObject *&pObject)
 Retrieve object from data store.
 
StatusCode retrieveObject (DataObject *parentObj, int item, DataObject *&pObject)
 Retrieve object from data store.
 
StatusCode findObject (std::string_view parentPath, std::string_view objectPath, DataObject *&pObject)
 Find object identified by its parent object and the path to the object relative to the parent.
 
StatusCode findObject (std::string_view parentPath, int item, DataObject *&pObject)
 Find object identified by its parent object and an integer identifier in the data store.
 
StatusCode findObject (DataObject *parentObj, std::string_view objectPath, DataObject *&pObject)
 Find object identified by its parent object and the path to the object relative to the parent.
 
StatusCode findObject (DataObject *parentObj, int item, DataObject *&pObject)
 Find object identified by its parent object and an integer identifier in the data store.
 
StatusCode linkObject (std::string_view fromPath, std::string_view objPath, DataObject *toObj)
 Add a link to another object.
 
StatusCode linkObject (DataObject *fromObj, std::string_view objPath, DataObject *toObj)
 Add a link to another object.
 
StatusCode unlinkObject (std::string_view fromPath, std::string_view objPath)
 Remove a link to another object.
 
- Public Member Functions inherited from extends< Service, IDataProviderSvc, IDataManagerSvc >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
- Public Member Functions inherited from Service
const std::string & name () const override
 Retrieve name of the service.
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 Initialize Service.
 
StatusCode sysStart () override
 Initialize Service.
 
StatusCode sysStop () override
 Initialize Service.
 
StatusCode sysFinalize () override
 Finalize Service.
 
StatusCode sysReinitialize () override
 Re-initialize the Service.
 
StatusCode sysRestart () override
 Re-initialize the Service.
 
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor.
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator.
 
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, bool createIf=true)
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
 Declare used tool.
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
 
template<class T>
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked.
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation.
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property.
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name.
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream)
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor.
 
const SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream.
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS)
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL)
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING)
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO)
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG)
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO)
 

Protected Member Functions

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

Additional Inherited Members

- Public Types inherited from extends< DataSvc, INTupleSvc, IDataSourceMgr >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from extends< Service, IDataProviderSvc, IDataManagerSvc >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from Service
using Factory = Gaudi::PluginService::Factory<IService*( const std::string&, ISvcLocator* )>
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using PropertyHolderImpl
 Typedef used to refer to this class from derived classes, as in.
 
- Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 
- Protected Types inherited from NTupleSvc
typedef std::vector< std::string > DBaseEntries
 
typedef std::pair< std::string, std::string > Prop
 
- Protected Attributes inherited from NTupleSvc
Gaudi::Property< DBaseEntriesm_input { this, "Input", {}, "input streams" }
 
Gaudi::Property< DBaseEntriesm_output { this, "Output", {}, "output streams" }
 
Gaudi::Property< int > m_basketsize { this, "BasketSize", 32000, "BasketSize" }
 
std::map< std::string, Connectionm_connections
 Container of connection points.
 
- Protected Attributes inherited from DataSvc
SmartIF< IIncidentSvcm_incidentSvc = nullptr
 Pointer to incident service.
 
Gaudi::Property< CLIDm_rootCLID { this, "RootCLID", 110 , "CLID of root entry" }
 
Gaudi::Property< std::string > m_rootName { this, "RootName", "/Event", "name of root entry" }
 
std::unique_ptr< DataSvcHelpers::RegistryEntrym_root
 Pointer to root entry.
 
- Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state.
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state.
 
Gaudi::Property< int > m_outputLevel { this, "OutputLevel", MSG::NIL, "output level" }
 flag indicating whether ToolHandle tools have been added to m_tools
 
Gaudi::Property< bool > m_auditorInitialize { this, "AuditInitialize", false, "trigger auditor on initialize()" }
 
Gaudi::Property< bool > m_auditorStart { this, "AuditStart", false, "trigger auditor on start()" }
 
Gaudi::Property< bool > m_auditorStop { this, "AuditStop", false, "trigger auditor on stop()" }
 
Gaudi::Property< bool > m_auditorFinalize { this, "AuditFinalize", false, "trigger auditor on finalize()" }
 
Gaudi::Property< bool > m_auditorReinitialize { this, "AuditReinitialize", false, "trigger auditor on reinitialize()" }
 
Gaudi::Property< bool > m_auditorRestart { this, "AuditRestart", false, "trigger auditor on restart()" }
 
Gaudi::Property< bool > m_autoRetrieveTools
 
Gaudi::Property< bool > m_checkToolDeps
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service.
 

Detailed Description

Gaudi tag collection service definition.

Description: See the base class definition files for more detailed documentation of the implementing class. The basic functionality of the implementation is enhanced to allow for more general N-tuples, which can be used also as event tag collections.

@Author M.Frank @Version 1.0

Definition at line 35 of file TagCollectionSvc.h.

Constructor & Destructor Documentation

◆ TagCollectionSvc()

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

Standard Constructor.

Definition at line 56 of file TagCollectionSvc.cpp.

56: NTupleSvc( name, svc ) {}
NTupleSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Definition NTupleSvc.cpp:61
const std::string & name() const override
Retrieve name of the service.
Definition Service.cpp:333

Member Function Documentation

◆ connect() [1/2]

StatusCode NTupleSvc::connect ( const std::string & ident)
override

unhides some NTupleSvc methods

Definition at line 102 of file NTupleSvc.cpp.

187 {
188 std::string logName;
189 return connect( ident, logName );
190}
StatusCode connect(const std::string &ident, std::string &logname) override
Add file to list I/O list.

◆ connect() [2/2]

StatusCode TagCollectionSvc::connect ( const std::string & ident,
std::string & logname )
overrideprotected

Add file to list I/O list.

Definition at line 59 of file TagCollectionSvc.cpp.

59 {
60 DataObject* pO = nullptr;
61 StatusCode status = findObject( m_rootName.value(), pO );
62 if ( status.isSuccess() ) {
63 status = Status::INVALID_ROOT;
64 if ( pO->registry() ) {
65 char typ = 0;
66 std::vector<Prop> props;
67 long loc = ident.find( " " );
68 std::string filename, svc = "DbCnvSvc";
69 logname = ident.substr( 0, loc );
70 using Parser = Gaudi::Utils::AttribStringParser;
71 // we assume that there is always a " "
72 // (but if it is not there, we probably will not match the pattern)
73 for ( auto attrib : Parser( ident.substr( loc + 1 ) ) ) {
74 switch ( ::toupper( attrib.tag[0] ) ) {
75 case 'A':
76 props.emplace_back( "Server", attrib.value );
77 break;
78 case 'F': /* FILE='<file name>' */
79 case 'D': /* DATAFILE='<file name>' */
80 filename = std::move( attrib.value );
81 break;
82 case 'O': /* OPT='<NEW<CREATE,WRITE>, UPDATE, READ>' */
83 switch ( ::toupper( attrib.value[0] ) ) {
84 case 'C':
85 case 'N':
86 case 'W':
87 typ = 'N';
88 break;
89 case 'U':
90 typ = 'U';
91 break;
92 case 'O':
93 case 'R':
94 switch ( ::toupper( attrib.value[2] ) ) {
95 case 'C': /* RECREATE */
96 typ = 'R';
97 break;
98 case 'A': /* READ */
99 default:
100 typ = 'O';
101 break;
102 }
103 break;
104 default:
105 typ = 0;
106 break;
107 }
108 break;
109 case 'S': // SVC='<service type>'
110 switch ( ::toupper( attrib.tag[1] ) ) {
111 case 'V':
112 svc = std::move( attrib.value );
113 break;
114 case 'H':
115 switch ( ::toupper( attrib.value[0] ) ) {
116 case 'Y':
117 props.emplace_back( "ShareFiles", attrib.value );
118 break;
119 }
120 break;
121 }
122 break;
123 case 'T': // TYP='<HBOOK,ROOT,OBJY,...>'
124 switch ( ::toupper( attrib.value[0] ) ) {
125 case 'H':
126 svc = "HbookCnv::ConvSvc";
127 break;
128 case 'P':
129 props.emplace_back( "DbType", attrib.value );
130 svc = "PoolDbCnvSvc";
131 break;
132 default:
133 props.emplace_back( "DbType", attrib.value );
134 svc = "DbCnvSvc";
135 break;
136 }
137 break;
138 default:
139 props.emplace_back( attrib.tag, attrib.value );
140 break;
141 }
142 }
143 if ( 0 != typ ) {
144 IConversionSvc* pSvc = nullptr;
145 status = createService( name() + '.' + logname, svc, props, pSvc );
146 if ( status.isSuccess() ) {
147 status = attachTuple( filename, logname, typ, pSvc->repSvcType() );
148 if ( status.isSuccess() ) {
149 m_connections.emplace( m_rootName + '/' + logname, Connection( pSvc ) );
150 return StatusCode::SUCCESS;
151 }
152 }
153 }
154 }
155 }
156 error() << "Cannot add " << ident << " invalid filename!" << endmsg;
157 return StatusCode::FAILURE;
158}
void toupper(std::string &s)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
IRegistry * registry() const
Get pointer to Registry.
Definition DataObject.h:79
Gaudi::Property< std::string > m_rootName
Definition DataSvc.h:53
StatusCode findObject(std::string_view fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition DataSvc.cpp:623
virtual long repSvcType() const =0
Retrieve the class type of the data store the converter uses.
StatusCode attachTuple(const std::string &filename, const std::string &logname, const char typ, const long t)
Attach output/input file.
std::map< std::string, Connection > m_connections
Container of connection points.
Definition NTupleSvc.h:129
bool isSuccess() const
Definition StatusCode.h:314
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr static const auto FAILURE
Definition StatusCode.h:100
virtual StatusCode createService(const std::string &nam, const std::string &typ, const std::vector< Prop > &props, IConversionSvc *&pSvc)
Create conversion service.

◆ createService()

StatusCode TagCollectionSvc::createService ( const std::string & nam,
const std::string & typ,
const std::vector< Prop > & props,
IConversionSvc *& pSvc )
protectedvirtual

Create conversion service.

Parameters
namName of the service to be created
svcService type if sepecified in the options
props

Definition at line 161 of file TagCollectionSvc.cpp.

162 {
163 pSvc = nullptr;
164 using Gaudi::Utils::TypeNameString;
165 auto mgr = serviceLocator()->as<ISvcManager>();
166
167 // TagCollectionSvc has to directly create a ConversionSvc to manage it directly.
168 StatusCode status = IInterface::Status::NO_INTERFACE;
169 if ( mgr ) {
170 SmartIF<IService> isvc = mgr->createService( TypeNameString( nam, typ ) );
171 if ( isvc ) {
172 auto icsvc = isvc.as<IConversionSvc>();
173 if ( icsvc ) {
174 auto iprop = isvc.as<IProperty>();
175 if ( iprop ) {
176 for ( const auto& p : props ) { iprop->setProperty( p.first, p.second ).ignore(); }
177 // NTupleSvc has to directly create a ConversionSvc to manage it directly.
178 status = isvc->sysInitialize();
179 if ( status.isSuccess() ) {
180 status = icsvc->setDataProvider( this );
181 if ( status.isSuccess() ) {
182 pSvc = icsvc.get();
183 pSvc->addRef();
184 }
185 }
186 }
187 }
188 }
189 }
190 return status;
191}
@ NO_INTERFACE
Requested interface is not available.
Definition IInterface.h:306
virtual unsigned long addRef() const =0
Increment the reference count of Interface instance.
SmartIF< IFace > as()
Definition ISvcLocator.h:64
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition Service.cpp:336
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition SmartIF.h:110

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