StoreExplorerAlg Class Reference

Small algorith, which traverses the data store and prints generic information about all leaves, which can be loaded/accessed. More...

Inheritance diagram for StoreExplorerAlg:
Collaboration diagram for StoreExplorerAlg:

Public Member Functions

 StoreExplorerAlg (const std::string &name, ISvcLocator *pSvcLocator)
 Standard algorithm constructor. More...
 
 ~StoreExplorerAlg () override=default
 Standard Destructor. More...
 
template<class T >
std::string access (T *p)
 
void printObj (IRegistry *pReg, std::vector< bool > &flg)
 Print datastore leaf. More...
 
void explore (IRegistry *pObj, std::vector< bool > &flg)
 
StatusCode initialize () override
 Initialize. More...
 
StatusCode finalize () override
 Finalize. More...
 
StatusCode execute () override
 Execute procedure. More...
 
- Public Member Functions inherited from Algorithm
 Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
 Constructor. More...
 
 ~Algorithm () override=default
 Destructor. More...
 
StatusCode sysStart () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysInitialize () override
 Initialization method invoked by the framework. More...
 
StatusCode sysReinitialize () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysRestart () override
 Restart method invoked by the framework. More...
 
StatusCode sysExecute () override
 The actions to be performed by the algorithm on an event. More...
 
StatusCode sysStop () override
 System stop. More...
 
StatusCode sysFinalize () override
 System finalization. More...
 
StatusCode sysBeginRun () override
 beginRun method invoked by the framework. More...
 
StatusCode sysEndRun () override
 endRun method invoked by the framework. More...
 
const std::string & name () const override
 The identifying name of the algorithm object. More...
 
const std::string & type () const override
 The type of the algorithm object. More...
 
void setType (const std::string &type) override
 
const std::string & version () const override
 
unsigned int index () override
 
StatusCode configure () override
 Dummy implementation of IStateful::configure() method. More...
 
StatusCode terminate () override
 Dummy implementation of IStateful::terminate() method. More...
 
StatusCode initialize () override
 the default (empty) implementation of IStateful::initialize() method More...
 
StatusCode start () override
 the default (empty) implementation of IStateful::start() method More...
 
StatusCode stop () override
 the default (empty) implementation of IStateful::stop() method More...
 
StatusCode finalize () override
 the default (empty) implementation of IStateful::finalize() method More...
 
StatusCode reinitialize () override
 the default (empty) implementation of IStateful::reinitialize() method More...
 
StatusCode restart () override
 the default (empty) implementation of IStateful::restart() method More...
 
Gaudi::StateMachine::State FSMState () const override
 returns the current state of the algorithm More...
 
Gaudi::StateMachine::State targetFSMState () const override
 returns the state the algorithm will be in after the ongoing transition More...
 
bool isExecuted () const override
 Has this algorithm been executed since the last reset? More...
 
void setExecuted (bool state) override
 Set the executed flag to the specified state. More...
 
void resetExecuted () override
 Reset the executed state of the Algorithm for the duration of the current event. More...
 
StatusCode beginRun () override
 Algorithm begin run. More...
 
StatusCode endRun () override
 Algorithm end run. This method is called at the end of the event loop. More...
 
bool isEnabled () const override
 Is this algorithm enabled or disabled? More...
 
bool filterPassed () const override
 Did this algorithm pass or fail its filter criterion for the last event? More...
 
void setFilterPassed (bool state) override
 Set the filter passed flag to the specified state. More...
 
int errorCount () const
 Get the number of failures of the algorithm. More...
 
template<class T >
StatusCode service (const std::string &name, 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 &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
SmartIF< IServiceservice (const std::string &name, const bool createIf=true, const bool quiet=false) const
 Return a pointer to the service identified by name (or "type/name") More...
 
template<class T >
SmartIF< T > service (const std::string &name, bool createIf=true, bool quiet=false) const
 
void setOutputLevel (int level)
 Set the output level for current algorithm. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
SmartIF< IChronoStatSvc > & chronoSvc () const
 The standard Chrono & Stat service, Return a pointer to the service if present. More...
 
SmartIF< IChronoStatSvc > & chronoStatService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & detSvc () const
 The standard detector data service. More...
 
SmartIF< IDataProviderSvc > & detDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & detCnvSvc () const
 The standard detector data persistency conversion service. More...
 
SmartIF< IConversionSvc > & detDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & eventSvc () const
 The standard event data service. More...
 
SmartIF< IDataProviderSvc > & evtSvc () const
 shortcut for method eventSvc More...
 
SmartIF< IDataProviderSvc > & eventDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & eventCnvSvc () const
 The standard event data persistency conversion service. More...
 
SmartIF< IConversionSvc > & eventDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IHistogramSvc > & histoSvc () const
 The standard histogram service. More...
 
SmartIF< IHistogramSvc > & histogramDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
SmartIF< IMessageSvc > & messageService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< INTupleSvc > & ntupleSvc () const
 The standard N tuple service. More...
 
SmartIF< INTupleSvc > & ntupleService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IRndmGenSvc > & randSvc () const
 AIDA-based NTuple service Returns a pointer to the AIDATuple service if present. More...
 
SmartIF< IToolSvc > & toolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present. More...
 
SmartIF< IExceptionSvc > & exceptionSvc () const
 Get the exception Service. More...
 
SmartIF< IAlgContextSvc > & contextSvc () const
 get Algorithm Context Service More...
 
SmartIF< ITimelineSvc > & timelineSvc () const
 
SmartIF< ISvcLocator > & serviceLocator () const
 The standard service locator. More...
 
SmartIF< ISvcLocator > & svcLoc () const
 shortcut for method serviceLocator More...
 
SmartIF< IHiveWhiteBoard > & whiteboard () const
 
bool registerContext () const
 register for Algorithm Context Service? More...
 
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
 Create a sub algorithm. More...
 
const std::vector< Algorithm * > * subAlgorithms () const
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
std::vector< Algorithm * > * subAlgorithms ()
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
StatusCode setProperty (const Property &p) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &s) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 Implementation of IProperty::setProperty. More...
 
StatusCode getProperty (Property *p) const override
 Implementation of IProperty::getProperty. More...
 
const PropertygetProperty (const std::string &name) const override
 Implementation of IProperty::getProperty. More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const override
 Implementation of IProperty::getProperties. More...
 
bool hasProperty (const std::string &name) const override
 Implementation of IProperty::hasProperty. More...
 
StatusCode setProperties ()
 Set the algorithm's properties. 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< IMonitorSvc > & monitorSvc () const
 Access the monitor service. More...
 
template<class T >
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information. More...
 
void declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
 Declare monitoring information (special case) More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
EventContextgetContext ()
 get the context More...
 
void setContext (EventContext *context)
 set the context More...
 
template<typename T >
 __attribute__ ((deprecated)) StatusCode declareDataObj(const std
 Declare data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::vector< std::string > &addresses, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareOutput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::WRITE)
 Declare output data object. More...
 
__attribute__((deprecated)) const std const DataObjectDescriptorCollectioninputDataObjects () const override
 Return the handles declared in the algorithm. More...
 
const DataObjectDescriptorCollectionoutputDataObjects () const override
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
template<class T >
StatusCode declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Private tool. More...
 
template<class T >
StatusCode declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Public tool. More...
 
const std::vector< IAlgTool * > & tools () const
 
bool isClonable () const override
 Specifies the clonability of the algorithm. More...
 
unsigned int cardinality () const override
 Return the cardinality. More...
 
const std::vector< std::string > & neededResources () const override
 
 Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
 Constructor. More...
 
 ~Algorithm () override=default
 Destructor. More...
 
StatusCode sysStart () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysInitialize () override
 Initialization method invoked by the framework. More...
 
StatusCode sysReinitialize () override
 Reinitialization method invoked by the framework. More...
 
StatusCode sysRestart () override
 Restart method invoked by the framework. More...
 
StatusCode sysExecute () override
 The actions to be performed by the algorithm on an event. More...
 
StatusCode sysStop () override
 System stop. More...
 
StatusCode sysFinalize () override
 System finalization. More...
 
StatusCode sysBeginRun () override
 beginRun method invoked by the framework. More...
 
StatusCode sysEndRun () override
 endRun method invoked by the framework. More...
 
const std::string & name () const override
 The identifying name of the algorithm object. More...
 
const std::string & type () const override
 The type of the algorithm object. More...
 
void setType (const std::string &type) override
 
const std::string & version () const override
 
unsigned int index () override
 
StatusCode configure () override
 Dummy implementation of IStateful::configure() method. More...
 
StatusCode terminate () override
 Dummy implementation of IStateful::terminate() method. More...
 
StatusCode initialize () override
 the default (empty) implementation of IStateful::initialize() method More...
 
StatusCode start () override
 the default (empty) implementation of IStateful::start() method More...
 
StatusCode stop () override
 the default (empty) implementation of IStateful::stop() method More...
 
StatusCode finalize () override
 the default (empty) implementation of IStateful::finalize() method More...
 
StatusCode reinitialize () override
 the default (empty) implementation of IStateful::reinitialize() method More...
 
StatusCode restart () override
 the default (empty) implementation of IStateful::restart() method More...
 
Gaudi::StateMachine::State FSMState () const override
 returns the current state of the algorithm More...
 
Gaudi::StateMachine::State targetFSMState () const override
 returns the state the algorithm will be in after the ongoing transition More...
 
bool isExecuted () const override
 Has this algorithm been executed since the last reset? More...
 
void setExecuted (bool state) override
 Set the executed flag to the specified state. More...
 
void resetExecuted () override
 Reset the executed state of the Algorithm for the duration of the current event. More...
 
StatusCode beginRun () override
 Algorithm begin run. More...
 
StatusCode endRun () override
 Algorithm end run. This method is called at the end of the event loop. More...
 
bool isEnabled () const override
 Is this algorithm enabled or disabled? More...
 
bool filterPassed () const override
 Did this algorithm pass or fail its filter criterion for the last event? More...
 
void setFilterPassed (bool state) override
 Set the filter passed flag to the specified state. More...
 
int errorCount () const
 Get the number of failures of the algorithm. More...
 
template<class T >
StatusCode service (const std::string &name, 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 &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
SmartIF< IServiceservice (const std::string &name, const bool createIf=true, const bool quiet=false) const
 Return a pointer to the service identified by name (or "type/name") More...
 
template<class T >
SmartIF< T > service (const std::string &name, bool createIf=true, bool quiet=false) const
 
void setOutputLevel (int level)
 Set the output level for current algorithm. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
SmartIF< IChronoStatSvc > & chronoSvc () const
 The standard Chrono & Stat service, Return a pointer to the service if present. More...
 
SmartIF< IChronoStatSvc > & chronoStatService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & detSvc () const
 The standard detector data service. More...
 
SmartIF< IDataProviderSvc > & detDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & detCnvSvc () const
 The standard detector data persistency conversion service. More...
 
SmartIF< IConversionSvc > & detDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IDataProviderSvc > & eventSvc () const
 The standard event data service. More...
 
SmartIF< IDataProviderSvc > & evtSvc () const
 shortcut for method eventSvc More...
 
SmartIF< IDataProviderSvc > & eventDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IConversionSvc > & eventCnvSvc () const
 The standard event data persistency conversion service. More...
 
SmartIF< IConversionSvc > & eventDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IHistogramSvc > & histoSvc () const
 The standard histogram service. More...
 
SmartIF< IHistogramSvc > & histogramDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
SmartIF< IMessageSvc > & messageService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< INTupleSvc > & ntupleSvc () const
 The standard N tuple service. More...
 
SmartIF< INTupleSvc > & ntupleService () const
 Obsoleted name, kept due to the backwards compatibility. More...
 
SmartIF< IRndmGenSvc > & randSvc () const
 AIDA-based NTuple service Returns a pointer to the AIDATuple service if present. More...
 
SmartIF< IToolSvc > & toolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present. More...
 
SmartIF< IExceptionSvc > & exceptionSvc () const
 Get the exception Service. More...
 
SmartIF< IAlgContextSvc > & contextSvc () const
 get Algorithm Context Service More...
 
SmartIF< ITimelineSvc > & timelineSvc () const
 
SmartIF< ISvcLocator > & serviceLocator () const
 The standard service locator. More...
 
SmartIF< ISvcLocator > & svcLoc () const
 shortcut for method serviceLocator More...
 
SmartIF< IHiveWhiteBoard > & whiteboard () const
 
bool registerContext () const
 register for Algorithm Context Service? More...
 
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
 Create a sub algorithm. More...
 
const std::vector< Algorithm * > * subAlgorithms () const
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
std::vector< Algorithm * > * subAlgorithms ()
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...
 
StatusCode setProperty (const Property &p) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &s) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 Implementation of IProperty::setProperty. More...
 
StatusCode getProperty (Property *p) const override
 Implementation of IProperty::getProperty. More...
 
const PropertygetProperty (const std::string &name) const override
 Implementation of IProperty::getProperty. More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const override
 Implementation of IProperty::getProperties. More...
 
bool hasProperty (const std::string &name) const override
 Implementation of IProperty::hasProperty. More...
 
StatusCode setProperties ()
 Set the algorithm's properties. 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< IMonitorSvc > & monitorSvc () const
 Access the monitor service. More...
 
template<class T >
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information. More...
 
void declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
 Declare monitoring information (special case) More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
EventContextgetContext ()
 get the context More...
 
void setContext (EventContext *context)
 set the context More...
 
template<typename T >
 __attribute__ ((deprecated)) StatusCode declareDataObj(const std
 Declare data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareInput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::vector< std::string > &addresses, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::READ)
 Declare input data object. More...
 
template<class T >
StatusCode declareOutput (const std::string &propertyName, DataObjectHandle< T > &handle, const std::string &address=DataObjectDescriptor::NULL_, bool optional=false, MinimalDataObjectHandle::AccessType accessType=MinimalDataObjectHandle::WRITE)
 Declare output data object. More...
 
__attribute__((deprecated)) const std const DataObjectDescriptorCollectioninputDataObjects () const override
 Return the handles declared in the algorithm. More...
 
const DataObjectDescriptorCollectionoutputDataObjects () const override
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
template<class T >
StatusCode declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Private tool. More...
 
template<class T >
StatusCode declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Public tool. More...
 
const std::vector< IAlgTool * > & tools () const
 
bool isClonable () const override
 Specifies the clonability of the algorithm. More...
 
unsigned int cardinality () const override
 Return the cardinality. More...
 
const std::vector< std::string > & neededResources () const override
 
- Public Member Functions inherited from implements< Interfaces >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 implements ()=default
 Default constructor. More...
 
 implements (const implements &)
 Copy constructor (zero the reference count) More...
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count). More...
 
 ~implements () override=default
 Virtual destructor. More...
 
unsigned long addRef () override
 Reference Interface instance. More...
 
unsigned long release () override
 Release Interface instance. More...
 
unsigned long refCount () const override
 Current reference count. More...
 
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 implements ()=default
 Default constructor. More...
 
 implements (const implements &)
 Copy constructor (zero the reference count) More...
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count). More...
 
 ~implements () override=default
 Virtual destructor. More...
 
unsigned long addRef () override
 Reference Interface instance. More...
 
unsigned long release () override
 Release Interface instance. More...
 
unsigned long refCount () const override
 Current reference count. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Private Attributes

long m_print
 Job option to limit printout to first nnn events. More...
 
double m_frequency
 Job option to set the printout frequency. More...
 
bool m_exploreRelations
 Flag to check if relations should be followed. More...
 
long m_printMissing
 Flag to indicate if missing entities should be printed. More...
 
long m_total = 0
 Internal counter to trigger printouts. More...
 
long m_frqPrint = 0
 Internal counter to adjust printout frequency. More...
 
bool m_load
 Flag to load non existing items. More...
 
bool m_testAccess
 Flag to test access to objects (DataObject and ContainedObject) More...
 
bool m_accessForeign
 Flag to indicate if foreign files should be opened. More...
 
SmartIF< IDataProviderSvcm_dataSvc
 Reference to data provider service. More...
 
std::string m_dataSvcName
 Name of the data provider service. More...
 
std::string m_rootName
 Name of the root leaf (obtained at initialize) More...
 

Additional Inherited Members

- Public Types inherited from Algorithm
typedef Gaudi::PluginService::Factory< IAlgorithm *, const std::string &, ISvcLocator * > Factory
 
typedef Gaudi::PluginService::Factory< IAlgorithm *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from implements< Interfaces >
using base_class = implements< Interfaces...>
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using iids = typename extend_interfaces_base::ext_iids
 
using base_class = implements< Interfaces...>
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using iids = typename extend_interfaces_base::ext_iids
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
- Protected Member Functions inherited from Algorithm
DataObjectDescriptorCollectioninputDataObjects ()
 
DataObjectDescriptorCollectionoutputDataObjects ()
 
std::vector< IAlgTool * > & tools ()
 
void addSubAlgorithmDataObjectHandles ()
 
bool isInitialized () const override
 Has the Algorithm already been initialized? More...
 
bool isFinalized () const override
 Has the Algorithm already been finalized? More...
 
int outputLevel () const
 retrieve the Algorithm output level More...
 
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property. More...
 
void initOutputLevel (Property &prop)
 Callback for output level property. More...
 
DataObjectDescriptorCollectioninputDataObjects ()
 
DataObjectDescriptorCollectionoutputDataObjects ()
 
std::vector< IAlgTool * > & tools ()
 
void addSubAlgorithmDataObjectHandles ()
 
bool isInitialized () const override
 Has the Algorithm already been initialized? More...
 
bool isFinalized () const override
 Has the Algorithm already been finalized? More...
 
int outputLevel () const
 retrieve the Algorithm output level More...
 
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property. More...
 
void initOutputLevel (Property &prop)
 Callback for output level property. More...
 
- Protected Attributes inherited from Algorithm
EventContextm_event_context
 Event specific data for multiple event processing. More...
 
- Protected Attributes inherited from implements< Interfaces >
std::atomic_ulong m_refCount = {0}
 Reference counter. More...
 

Detailed Description

Small algorith, which traverses the data store and prints generic information about all leaves, which can be loaded/accessed.

Author
: M.Frank
Version
: 1.0

Definition at line 30 of file StoreExplorerAlg.cpp.

Constructor & Destructor Documentation

StoreExplorerAlg::StoreExplorerAlg ( const std::string &  name,
ISvcLocator pSvcLocator 
)
inline

Standard algorithm constructor.

Definition at line 58 of file StoreExplorerAlg.cpp.

59  : Algorithm(name, pSvcLocator)
60  {
61  declareProperty("Load", m_load = false);
62  declareProperty("PrintEvt", m_print = 1);
63  declareProperty("PrintMissing", m_printMissing = 0);
64  declareProperty("PrintFreq", m_frequency = 0.0);
65  declareProperty("ExploreRelations", m_exploreRelations = false);
66  declareProperty("DataSvc", m_dataSvcName="EventDataSvc");
67  declareProperty("TestAccess", m_testAccess = false);
68  declareProperty("AccessForeign", m_accessForeign = false);
69  }
long m_printMissing
Flag to indicate if missing entities should be printed.
bool m_accessForeign
Flag to indicate if foreign files should be opened.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Algorithm.h:435
bool m_load
Flag to load non existing items.
double m_frequency
Job option to set the printout frequency.
long m_print
Job option to limit printout to first nnn events.
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
Algorithm(const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
Constructor.
Definition: Algorithm.cpp:39
std::string m_dataSvcName
Name of the data provider service.
bool m_exploreRelations
Flag to check if relations should be followed.
bool m_testAccess
Flag to test access to objects (DataObject and ContainedObject)
StoreExplorerAlg::~StoreExplorerAlg ( )
overridedefault

Standard Destructor.

Member Function Documentation

template<class T >
std::string StoreExplorerAlg::access ( T *  p)
inline

Definition at line 74 of file StoreExplorerAlg.cpp.

74  {
75  if ( !p ) return "Access FAILED.";
76  std::string result = std::accumulate(std::begin(*p),std::end(*p),std::string{},
77  [&](std::string s,typename T::const_reference i) {
78  return s+std::to_string(p->index(i)) + ":" + std::to_string(i->clID()) + ",";
79  });
80  return result.substr(0, result.length()-2);
81  }
string to_string(const T &value)
Definition: mergesort.cpp:40
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
string s
Definition: gaudirun.py:245
list i
Definition: ana.py:128
StatusCode StoreExplorerAlg::execute ( )
inlineoverride

Execute procedure.

Definition at line 217 of file StoreExplorerAlg.cpp.

217  {
218  MsgStream log(msgSvc(), name());
220  if ( ((m_print > m_total++) || (m_frequency*m_total > m_frqPrint)) && root ) {
222  std::string store_name = "Unknown";
223  IRegistry* pReg = root->registry();
224  if ( pReg ) {
225  auto isvc = SmartIF<IService>{pReg->dataSvc()};
226  if ( isvc ) store_name = isvc->name();
227  }
228  log << MSG::INFO << "========= " << m_rootName << "["
229  << "0x" << std::hex << (unsigned long) root.ptr() << std::dec
230  << "@" << store_name << "]:" << endmsg;
231  std::vector<bool> flg(1,true);
232  explore(root->registry(), flg);
233  return StatusCode::SUCCESS;
234  } else if ( root ) {
235  return StatusCode::SUCCESS;
236  }
237  log << MSG::ERROR << "Cannot retrieve \"/Event\"!" << endmsg;
238  return StatusCode::FAILURE;
239  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
long m_total
Internal counter to trigger printouts.
double m_frequency
Job option to set the printout frequency.
long m_print
Job option to limit printout to first nnn events.
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
std::string m_rootName
Name of the root leaf (obtained at initialize)
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
void explore(IRegistry *pObj, std::vector< bool > &flg)
A small class used to access easily (and efficiently) data items residing in data stores...
Definition: SmartDataPtr.h:46
tuple root
Definition: IOTest.py:42
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
long m_frqPrint
Internal counter to adjust printout frequency.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
void StoreExplorerAlg::explore ( IRegistry pObj,
std::vector< bool > &  flg 
)
inline

Definition at line 150 of file StoreExplorerAlg.cpp.

150  {
151  printObj(pObj, flg);
152  if ( pObj ) {
153  auto mgr = eventSvc().as<IDataManagerSvc>();
154  if ( mgr ) {
155  std::vector<IRegistry*> leaves;
156  StatusCode sc = mgr->objectLeaves(pObj, leaves);
157  const std::string* par0 = nullptr;
158  if ( pObj->address() ) par0 = pObj->address()->par();
159  if ( sc.isSuccess() ) {
160  for ( auto i=leaves.begin(); i != leaves.end(); i++ ) {
161  const std::string& id = (*i)->identifier();
162  DataObject* p = nullptr;
163  if ( !m_accessForeign && (*i)->address() ) {
164  if ( par0 ) {
165  const std::string* par1 = (*i)->address()->par();
166  if ( par1 && par0[0] != par1[0] ) continue;
167  }
168  }
169  if ( m_load ) {
170  sc = eventSvc()->retrieveObject(id, p);
171  } else {
172  sc = eventSvc()->findObject(id, p);
173  }
174  if ( sc.isSuccess() ) {
175  if ( id != "/Event/Rec/Relations" || m_exploreRelations ) {
176  flg.push_back(i+1 == leaves.end());
177  explore(*i, flg);
178  flg.pop_back();
179  }
180  } else {
181  flg.push_back(i+1 == leaves.end());
182  printObj(*i, flg);
183  flg.pop_back();
184  }
185  }
186  }
187  }
188  }
189  }
virtual const std::string * par() const =0
Retrieve String parameters.
bool m_accessForeign
Flag to indicate if foreign files should be opened.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
bool m_load
Flag to load non existing items.
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
virtual StatusCode findObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Find object identified by its directory entry.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
void printObj(IRegistry *pReg, std::vector< bool > &flg)
Print datastore leaf.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
void explore(IRegistry *pObj, std::vector< bool > &flg)
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
bool m_exploreRelations
Flag to check if relations should be followed.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
list i
Definition: ana.py:128
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
StatusCode StoreExplorerAlg::finalize ( )
inlineoverride

Finalize.

Definition at line 211 of file StoreExplorerAlg.cpp.

211  {
212  m_dataSvc.reset();
213  return StatusCode::SUCCESS;
214  }
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
StatusCode StoreExplorerAlg::initialize ( )
inlineoverride

Initialize.

Definition at line 192 of file StoreExplorerAlg.cpp.

192  {
193  MsgStream log(msgSvc(), name());
194  m_rootName.clear();
196  if ( !m_dataSvc ) {
197  log << MSG::ERROR << "Failed to access service \""
198  << m_dataSvcName << "\"." << endmsg;
199  return StatusCode::FAILURE;
200  }
201  auto mgr = m_dataSvc.as<IDataManagerSvc>();
202  if ( !mgr ) {
203  log << MSG::ERROR << "Failed to retrieve IDataManagerSvc interface." << endmsg;
204  return StatusCode::FAILURE;
205  }
206  m_rootName = mgr->rootName();
207  return StatusCode::SUCCESS;
208  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
std::string m_rootName
Name of the root leaf (obtained at initialize)
std::string m_dataSvcName
Name of the data provider service.
StatusCode service(const std::string &name, T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Algorithm.h:231
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
void StoreExplorerAlg::printObj ( IRegistry pReg,
std::vector< bool > &  flg 
)
inline

Print datastore leaf.

Definition at line 85 of file StoreExplorerAlg.cpp.

85  {
86  MsgStream log(msgSvc(), name());
87  log << MSG::INFO;
88  for (size_t j = 1; j < flg.size(); j++ ) {
89  if ( !flg[j-1] && flg[j] ) log << "| ";
90  else if ( flg[j] ) log << " ";
91  else log << "| ";
92  }
93  log << "+--> " << pReg->name();
94  if ( pReg->address() ) {
95  log << " [Address: CLID="
96  << std::showbase << std::hex << pReg->address()->clID()
97  << " Type=" << (void*)pReg->address()->svcType() << "]";
98  }
99  else {
100  log << " [No Address]";
101  }
102  DataObject* p = pReg->object();
103  if ( p ) {
104  try {
105  std::string typ = System::typeinfoName(typeid(*p));
106  if ( m_testAccess ) p->clID();
107  log << " " << typ.substr(0,32);
108  }
109  catch (...) {
110  log << "Access test FAILED";
111  }
112  }
113  else {
114  log << " (Unloaded) ";
115  }
116  ObjectContainerBase* base = dynamic_cast<ObjectContainerBase*>(p);
117  if ( base ) {
118  try {
119  int numObj = base->numberOfObjects();
120  const CLID id = p->clID();
121  log << " [" << numObj << "]";
122  if ( m_testAccess ) {
123  CLID idd = id>>16;
124  switch(idd) {
125  case CLID_ObjectList>>16: /* ObjectList */
127  break;
128  case CLID_ObjectVector>>16: /* ObjectVector */
130  break;
131  case (CLID_ObjectVector+0x00030000)>>16: /* Keyed Map */
133  break;
134  case (CLID_ObjectVector+0x00040000)>>16: /* Keyed Hashmap */
136  break;
137  case (CLID_ObjectVector+0x00050000)>>16: /* Keyed array */
139  break;
140  }
141  }
142  }
143  catch (...) {
144  log << "Access test FAILED";
145  }
146  }
147  log << endmsg;
148  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
virtual size_type numberOfObjects() const =0
Number of objects in the container.
ObjectVector is one of the basic Gaudi container classes capable of being registered in Data Stores...
template class KeyedContainer, KeyedContainer.h
virtual const name_type & name() const =0
Name of the directory (or key)
virtual long svcType() const =0
Retrieve service type.
ObjectList is one of the basic Gaudi container classes capable of being registered in Data Stores...
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:919
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:68
virtual const CLID & clID() const =0
Retrieve class information from link.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual DataObject * object() const =0
Retrieve object behind the link.
KeyedObjectManager Class to manage keyed objects.
ObjectContainerBase is the base class for Gaudi container classes.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:1001
bool m_testAccess
Flag to test access to objects (DataObject and ContainedObject)
std::string access(T *p)

Member Data Documentation

bool StoreExplorerAlg::m_accessForeign
private

Flag to indicate if foreign files should be opened.

Definition at line 48 of file StoreExplorerAlg.cpp.

SmartIF<IDataProviderSvc> StoreExplorerAlg::m_dataSvc
private

Reference to data provider service.

Definition at line 50 of file StoreExplorerAlg.cpp.

std::string StoreExplorerAlg::m_dataSvcName
private

Name of the data provider service.

Definition at line 52 of file StoreExplorerAlg.cpp.

bool StoreExplorerAlg::m_exploreRelations
private

Flag to check if relations should be followed.

Definition at line 36 of file StoreExplorerAlg.cpp.

double StoreExplorerAlg::m_frequency
private

Job option to set the printout frequency.

Definition at line 34 of file StoreExplorerAlg.cpp.

long StoreExplorerAlg::m_frqPrint = 0
private

Internal counter to adjust printout frequency.

Definition at line 42 of file StoreExplorerAlg.cpp.

bool StoreExplorerAlg::m_load
private

Flag to load non existing items.

Definition at line 44 of file StoreExplorerAlg.cpp.

long StoreExplorerAlg::m_print
private

Job option to limit printout to first nnn events.

Definition at line 32 of file StoreExplorerAlg.cpp.

long StoreExplorerAlg::m_printMissing
private

Flag to indicate if missing entities should be printed.

Definition at line 38 of file StoreExplorerAlg.cpp.

std::string StoreExplorerAlg::m_rootName
private

Name of the root leaf (obtained at initialize)

Definition at line 54 of file StoreExplorerAlg.cpp.

bool StoreExplorerAlg::m_testAccess
private

Flag to test access to objects (DataObject and ContainedObject)

Definition at line 46 of file StoreExplorerAlg.cpp.

long StoreExplorerAlg::m_total = 0
private

Internal counter to trigger printouts.

Definition at line 40 of file StoreExplorerAlg.cpp.


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