| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Private Attributes | List of all members
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:
[legend]
Collaboration diagram for StoreExplorerAlg:
[legend]

## Public Member Functions
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 Gaudi::details::LegacyAlgorithmAdapter
| LegacyAlgorithmAdapter (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
const EventContext & | getContext () const
bool | isExecuted () const
| Has this algorithm been executed since the last reset? More...
void | setExecuted (bool state) const
| Set the executed flag to the specified state. More...
void | resetExecuted ()
| Reset the executed state of the Algorithm for the duration of the current event. More...
bool | filterPassed () const
| Did this algorithm pass or fail its filter criterion for the last event? More...
void | setFilterPassed (bool state) const
| Set the filter passed flag to the specified state. More...
Public Member Functions inherited from Gaudi::Algorithm
| Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
| Constructor. 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 (const EventContext &ctx) 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 Gaudi::StringKey & | nameKey () const override
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 () const 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...
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 | isSequence () const override
| Are we a Sequence? More...
unsigned 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< IService > | service (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
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
SmartIF< IDataProviderSvc > & | detSvc () const
| The standard detector data service. More...
SmartIF< IDataProviderSvc > & | detDataService () const
SmartIF< IConversionSvc > & | detCnvSvc () const
| The standard detector data persistency conversion service. More...
SmartIF< IConversionSvc > & | detDataCnvService () const
SmartIF< IDataProviderSvc > & | eventSvc () const
| The standard event data service. More...
SmartIF< IDataProviderSvc > & | evtSvc () const
| shortcut for method eventSvc More...
SmartIF< IDataProviderSvc > & | eventDataService () const
SmartIF< IConversionSvc > & | eventCnvSvc () const
| The standard event data persistency conversion service. More...
SmartIF< IConversionSvc > & | eventDataCnvService () const
SmartIF< IHistogramSvc > & | histoSvc () const
| The standard histogram service. More...
SmartIF< IHistogramSvc > & | histogramDataService () const
SmartIF< INTupleSvc > & | ntupleSvc () const
| The standard N tuple service. More...
SmartIF< INTupleSvc > & | ntupleService () const
SmartIF< IRndmGenSvc > & | randSvc () const
| The standard RandomGen service, Return a pointer to the 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 override
| The standard service locator. More...
SmartIF< ISvcLocator > & | svcLoc () const
| shortcut for method serviceLocator More...
SmartIF< IHiveWhiteBoard > & | whiteboard () const
SmartIF< IAlgExecStateSvc > & | algExecStateSvc () const
bool | registerContext () const
| register for Algorithm Context Service? More...
StatusCode | setProperties ()
| Set the algorithm's properties. More...
template<class T >
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
template<class T >
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
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...
void | acceptDHVisitor (IDataHandleVisitor *) const override
void | registerTool (IAlgTool *tool) const
void | deregisterTool (IAlgTool *tool) const
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, bool createIf=true)
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
template<class T >
void | addToolsArray (ToolHandleArray< T > &hndlArr)
const std::vector< IAlgTool * > & | tools () const
bool | isIOBound () const
void | setIOBound (bool value)
unsigned int | cardinality () const override
| Return the cardinality. More...
const std::vector< std::string > & | neededResources () const override
AlgExecState & | execState (const EventContext &ctx) const override
| reference to AlgExecState of Alg More...
std::ostream & | toControlFlowExpression (std::ostream &os) const override
| Produce string represention of the control flow expression. More...
Public Member Functions inherited from DataHandleHolderBase< CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > > >
std::vector< Gaudi::DataHandle * > | inputHandles () const override
std::vector< Gaudi::DataHandle * > | outputHandles () const override
virtual const DataObjIDColl & | extraInputDeps () const override
virtual const DataObjIDColl & | extraOutputDeps () const override
void | declare (Gaudi::DataHandle &handle) override
void | renounce (Gaudi::DataHandle &handle) override
const DataObjIDColl & | inputDataObjs () const override
const DataObjIDColl & | outputDataObjs () const override
void | addDependency (const DataObjID &id, const Gaudi::DataHandle::Mode &mode) override
Public Member Functions inherited from extends< CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >, IDataHandleHolder >
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...
Public Member Functions inherited from CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >
void | declareCounter (const std::string &tag, Gaudi::Accumulators::PrintableCounter &r)
const Gaudi::Accumulators::PrintableCounter * | findCounter (const std::string &tag) const
void | forEachCounter (Callable &&f) const
int | nCounters () const
std::size_t | nOfCountersToBePrinted ()
void | clearCounters ()
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
| PropertyHolder ()=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Public Member Functions inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const
| Backward compatibility function for getting the output level. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...

## Private Attributes
Gaudi::Property< bool > | m_load {this, "Load", false, "load non existing items"}
Gaudi::Property< long > | m_print {this, "PrintEvt", 1, "limit printout to first N events"}
Gaudi::Property< long > | m_printMissing {this, "PrintMissing", 0, "indicate if missing entities should be printed"}
Gaudi::Property< double > | m_frequency {this, "PrintFreq", 0.0, "printout frequency"}
Gaudi::Property< bool > | m_exploreRelations {this, "ExploreRelations", false, "if relations should be followed"}
Gaudi::Property< std::string > | m_dataSvcName {this, "DataSvc", "EventDataSvc", "name of the data provider service"}
Gaudi::Property< bool > | m_testAccess
Gaudi::Property< bool > | m_accessForeign {this, "AccessForeign", false, "indicate if foreign files should be opened"}
long | m_total = 0
| Internal counter to trigger printouts. More...
long | m_frqPrint = 0
| Internal counter to adjust printout frequency. More...
SmartIF< IDataProviderSvc > | m_dataSvc
| Reference to data provider service. More...
std::string | m_rootName
| Name of the root leaf (obtained at initialize) More...

## Additional Inherited Members
Public Types inherited from Gaudi::Algorithm
typedef Gaudi::PluginService::Factory< IAlgorithm *(const std::string &, ISvcLocator *)> | Factory
Public Types inherited from extends< CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >, IDataHandleHolder >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
Public Types inherited from PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces... >
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
| take union of the ext_iids of all Interfaces... More...
Public Attributes inherited from Gaudi::Algorithm
friend | AlgorithmManager
Protected Member Functions inherited from Gaudi::details::LegacyAlgorithmAdapter
bool | isReEntrant () const override
Protected Member Functions inherited from Gaudi::Algorithm
std::vector< IAlgTool * > & | tools ()
bool | isInitialized () const override
| Has the Algorithm already been initialized? More...
bool | isFinalized () const override
| Has the Algorithm already been finalized? More...
void | setIndex (const unsigned int &idx) override
| set instantiation index of Alg More...
bool | isReEntrant () const override
Protected Member Functions inherited from DataHandleHolderBase< CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > > >
void | initDataHandleHolder ()
| initializes all handles - called by the sysInitialize method of any descendant of this More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
MSG::Level | setUpMessaging () const
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...
Protected Attributes inherited from Gaudi::Algorithm
std::unique_ptr< IDataHandleVisitor > | m_updateDataHandles
| Hook for for derived classes to provide a custom visitor for data handles. More...
Protected Attributes inherited from DataHandleHolderBase< CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > > >
DataObjIDColl | m_inputDataObjs
DataObjIDColl | m_outputDataObjs

## 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 32 of file StoreExplorerAlg.cpp.

## Member Function Documentation

## ◆ access()

template<class T >

std::string StoreExplorerAlg::access | ( | T * | p | ) |
| inline

Definition at line 58 of file StoreExplorerAlg.cpp.

58 {
59 if ( !p ) return "Access FAILED.";
60 std::string result = std::accumulate(
61 std::begin( *p ), std::end( *p ), std::string{}, [&]( std::string s, typename T::const_reference i ) {
62 return s + std::to_string( p->index( i ) ) + ":" + std::to_string( i->clID() ) + ",";
63 } );
64 return result.substr( 0, result.length() - 2 );
65 }
std::to_string
T to_string(T... args)
std::end
T end(T... args)
std::string
STL class.
std::string::length
T length(T... args)
std::begin
T begin(T... args)
gaudirun.s
string s
Definition: gaudirun.py:316
std::string::substr
T substr(T... args)
std::accumulate
T accumulate(T... args)

## ◆ execute()

StatusCode StoreExplorerAlg::execute | ( |  | ) |
| inline override virtual

Execute procedure.

Implements Algorithm.

Definition at line 191 of file StoreExplorerAlg.cpp.

191 {
192 SmartDataPtr<DataObject> root( m_dataSvc.get(), m_rootName );
193 if ( ( ( m_print > m_total++ ) || ( m_frequency * m_total > m_frqPrint ) ) && root ) {
194 if ( m_frequency * m_total > m_frqPrint ) m_frqPrint++;
195 std::string store_name = "Unknown";
196 IRegistry* pReg = root->registry();
197 if ( pReg ) {
198 auto isvc = SmartIF<IService>{pReg->dataSvc()};
199 if ( isvc ) store_name = isvc->name();
200 }
201 info() << "========= " << m_rootName << "[" << std::showbase << std::hex << (unsigned long)root.ptr() << std::dec
202 << "@" << store_name << "]:" << endmsg;
203 std::vector<bool> flg( 1, true );
204 explore( root->registry(), flg );
205 return StatusCode::SUCCESS;
206 } else if ( root ) {
207 return StatusCode::SUCCESS;
208 }
209 error() << "Cannot retrieve \"/Event\"!" << endmsg;
210 return StatusCode::FAILURE;
211 }
SmartIF< IService >
StoreExplorerAlg::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
Definition: StoreExplorerAlg.cpp:49
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
std::showbase
T showbase(T... args)
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:104
StoreExplorerAlg::m_total
long m_total
Internal counter to trigger printouts.
Definition: StoreExplorerAlg.cpp:45
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
StoreExplorerAlg::m_frequency
Gaudi::Property< double > m_frequency
Definition: StoreExplorerAlg.cpp:37
std::string
STL class.
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
StoreExplorerAlg::m_rootName
std::string m_rootName
Name of the root leaf (obtained at initialize)
Definition: StoreExplorerAlg.cpp:51
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
StoreExplorerAlg::m_print
Gaudi::Property< long > m_print
Definition: StoreExplorerAlg.cpp:35
StoreExplorerAlg::explore
void explore(IRegistry *pObj, std::vector< bool > &flg)
Definition: StoreExplorerAlg.cpp:126
std::vector< bool >
SmartDataPtr
A small class used to access easily (and efficiently) data items residing in data stores.
Definition: SmartDataPtr.h:47
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
std::hex
T hex(T... args)
IRegistry::dataSvc
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:27
StoreExplorerAlg::m_frqPrint
long m_frqPrint
Internal counter to adjust printout frequency.
Definition: StoreExplorerAlg.cpp:47
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ explore()

void StoreExplorerAlg::explore | ( | IRegistry * | pObj,
|  | std::vector< bool > & | flg
| ) |  |
| inline

Definition at line 126 of file StoreExplorerAlg.cpp.

126 {
127 printObj( pObj, flg );
128 if ( pObj ) {
129 auto mgr = eventSvc().as<IDataManagerSvc>();
130 if ( mgr ) {
131 std::vector<IRegistry*> leaves;
132 StatusCode sc = mgr->objectLeaves( pObj, leaves );
133 const std::string* par0 = nullptr;
134 if ( pObj->address() ) par0 = pObj->address()->par();
135 if ( sc.isSuccess() ) {
136 for ( auto i = leaves.begin(); i != leaves.end(); i++ ) {
137 const std::string& id = ( *i )->identifier();
138 DataObject* p = nullptr;
139 if ( !m_accessForeign && ( *i )->address() ) {
140 if ( par0 ) {
141 const std::string* par1 = ( *i )->address()->par();
142 if ( par1 && par0[0] != par1[0] ) continue;
143 }
144 }
145 if ( m_load ) {
146 sc = eventSvc()->retrieveObject( id, p );
147 } else {
148 sc = eventSvc()->findObject( id, p );
149 }
150 if ( sc.isSuccess() ) {
151 if ( id != "/Event/Rec/Relations" || m_exploreRelations ) {
152 flg.push_back( i + 1 == leaves.end() );
153 explore( *i, flg );
154 flg.pop_back();
155 }
156 } else {
157 flg.push_back( i + 1 == leaves.end() );
158 printObj( *i, flg );
159 flg.pop_back();
160 }
161 }
162 }
163 }
164 }
165 }
IOpaqueAddress::par
virtual const std::string * par() const =0
Retrieve String parameters.
StoreExplorerAlg::m_exploreRelations
Gaudi::Property< bool > m_exploreRelations
Definition: StoreExplorerAlg.cpp:38
IDataManagerSvc
Definition: IDataManagerSvc.h:45
StoreExplorerAlg::m_accessForeign
Gaudi::Property< bool > m_accessForeign
Definition: StoreExplorerAlg.cpp:42
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:107
std::vector::end
T end(T... args)
IDataProviderSvc::findObject
virtual StatusCode findObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Find object identified by its directory entry.
std::string
STL class.
Gaudi::Algorithm::eventSvc
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
Definition: Algorithm.cpp:678
std::vector::push_back
T push_back(T... args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
std::vector::pop_back
T pop_back(T... args)
StoreExplorerAlg::printObj
void printObj(IRegistry *pReg, std::vector< bool > &flg)
Print datastore leaf.
Definition: StoreExplorerAlg.cpp:68
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
StoreExplorerAlg::explore
void explore(IRegistry *pObj, std::vector< bool > &flg)
Definition: StoreExplorerAlg.cpp:126
std::vector< IRegistry * >
IDataProviderSvc::retrieveObject
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
std::vector::begin
T begin(T... args)
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
StoreExplorerAlg::m_load
Gaudi::Property< bool > m_load
Definition: StoreExplorerAlg.cpp:34

## ◆ finalize()

StatusCode StoreExplorerAlg::finalize | ( |  | ) |
| inline override

Finalize.

Definition at line 185 of file StoreExplorerAlg.cpp.

185 {
186 m_dataSvc.reset();
187 return StatusCode::SUCCESS;
188 }
StoreExplorerAlg::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
Definition: StoreExplorerAlg.cpp:49
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:86

## ◆ initialize()

StatusCode StoreExplorerAlg::initialize | ( |  | ) |
| inline override

Initialize.

Definition at line 168 of file StoreExplorerAlg.cpp.

168 {
169 m_rootName.clear();
170 m_dataSvc = service( m_dataSvcName, true );
171 if ( !m_dataSvc ) {
172 error() << "Failed to access service \"" << m_dataSvcName << "\"." << endmsg;
173 return StatusCode::FAILURE;
174 }
175 auto mgr = m_dataSvc.as<IDataManagerSvc>();
176 if ( !mgr ) {
177 error() << "Failed to retrieve IDataManagerSvc interface." << endmsg;
178 return StatusCode::FAILURE;
179 }
180 m_rootName = mgr->rootName();
181 return StatusCode::SUCCESS;
182 }
StoreExplorerAlg::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
Definition: StoreExplorerAlg.cpp:49
IDataManagerSvc
Definition: IDataManagerSvc.h:45
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:107
StoreExplorerAlg::m_dataSvcName
Gaudi::Property< std::string > m_dataSvcName
Definition: StoreExplorerAlg.cpp:39
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
Gaudi::Algorithm::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:215
StoreExplorerAlg::m_rootName
std::string m_rootName
Name of the root leaf (obtained at initialize)
Definition: StoreExplorerAlg.cpp:51
std::string::clear
T clear(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ printObj()

void StoreExplorerAlg::printObj | ( | IRegistry * | pReg,
|  | std::vector< bool > & | flg
| ) |  |
| inline

Print datastore leaf.

Definition at line 68 of file StoreExplorerAlg.cpp.

68 {
69 auto& log = info();
70 for ( size_t j = 1; j < flg.size(); j++ ) {
71 if ( !flg[j - 1] && flg[j] )
72 log << "| ";
73 else if ( flg[j] )
74 log << " ";
75 else
76 log << "| ";
77 }
78 log << "+--> " << pReg->name();
79 if ( pReg->address() ) {
80 log << " [Address: CLID=" << std::showbase << std::hex << pReg->address()->clID()
81 << " Type=" << (void*)pReg->address()->svcType() << "]";
82 } else {
83 log << " [No Address]";
84 }
85 DataObject* p = pReg->object();
86 if ( p ) {
87 try {
88 std::string typ = System::typeinfoName( typeid( *p ) );
89 if ( m_testAccess ) p->clID();
90 log << " " << typ.substr( 0, 32 );
91 } catch ( ... ) { log << "Access test FAILED"; }
92 } else {
93 log << " (Unloaded) ";
94 }
95 ObjectContainerBase* base = dynamic_cast<ObjectContainerBase*>( p );
96 if ( base ) {
97 try {
98 int numObj = base->numberOfObjects();
99 const CLID id = p->clID();
100 log << " [" << numObj << "]";
101 if ( m_testAccess ) {
102 CLID idd = id >> 16;
103 switch ( idd ) {
104 case CLID_ObjectList >> 16: /* ObjectList */
105 access( (ObjectList<ContainedObject>*)base );
106 break;
107 case CLID_ObjectVector >> 16: /* ObjectVector */
108 access( (ObjectVector<ContainedObject>*)base );
109 break;
110 case ( CLID_ObjectVector + 0x00030000 ) >> 16: /* Keyed Map */
111 access( (KeyedContainer<KeyedObject<int>, Containers::Map>*)base );
112 break;
113 case ( CLID_ObjectVector + 0x00040000 ) >> 16: /* Keyed Hashmap */
114 access( (KeyedContainer<KeyedObject<int>, Containers::HashMap>*)base );
115 break;
116 case ( CLID_ObjectVector + 0x00050000 ) >> 16: /* Keyed array */
117 access( (KeyedContainer<KeyedObject<int>, Containers::Array>*)base );
118 break;
119 }
120 }
121 } catch ( ... ) { log << "Access test FAILED"; }
122 }
123 log << endmsg;
124 }
KeyedObject
Definition of the templated KeyedObject class.
Definition: KeyedObject.h:29
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
ObjectContainerBase::numberOfObjects
virtual size_type numberOfObjects() const =0
Number of objects in the container.
ObjectVector
ObjectVector is one of the basic Gaudi container classes capable of being registered in Data Stores.
Definition: ContainedObject.h:12
KeyedContainer
template class KeyedContainer, KeyedContainer.h
Definition: KeyedContainer.h:64
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
std::showbase
T showbase(T... args)
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:104
IOpaqueAddress::svcType
virtual long svcType() const =0
Retrieve service type.
ObjectList
ObjectList is one of the basic Gaudi container classes capable of being registered in Data Stores.
Definition: ContainedObject.h:14
std::string
STL class.
StoreExplorerAlg::m_testAccess
Gaudi::Property< bool > m_testAccess
Definition: StoreExplorerAlg.cpp:40
IOpaqueAddress::clID
virtual const CLID & clID() const =0
Retrieve class information from link.
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
std::vector::size
T size(T... args)
DataObject::clID
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:56
Containers::KeyedObjectManager
KeyedObjectManager Class to manage keyed objects.
Definition: KeyedObjectManager.h:45
std::hex
T hex(T... args)
std::string::substr
T substr(T... args)
ObjectContainerBase
ObjectContainerBase is the base class for Gaudi container classes.
Definition: ObjectContainerBase.h:19
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
StoreExplorerAlg::access
std::string access(T *p)
Definition: StoreExplorerAlg.cpp:58
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## Member Data Documentation

## ◆ m_accessForeign

Gaudi::Property<bool> StoreExplorerAlg::m_accessForeign {this, "AccessForeign", false, "indicate if foreign files should be opened"}
| private

Definition at line 42 of file StoreExplorerAlg.cpp.

## ◆ m_dataSvc

SmartIF<IDataProviderSvc> StoreExplorerAlg::m_dataSvc
| private

Reference to data provider service.

Definition at line 49 of file StoreExplorerAlg.cpp.

## ◆ m_dataSvcName

Gaudi::Property<std::string> StoreExplorerAlg::m_dataSvcName {this, "DataSvc", "EventDataSvc", "name of the data provider service"}
| private

Definition at line 39 of file StoreExplorerAlg.cpp.

## ◆ m_exploreRelations

Gaudi::Property<bool> StoreExplorerAlg::m_exploreRelations {this, "ExploreRelations", false, "if relations should be followed"}
| private

Definition at line 38 of file StoreExplorerAlg.cpp.

## ◆ m_frequency

Gaudi::Property<double> StoreExplorerAlg::m_frequency {this, "PrintFreq", 0.0, "printout frequency"}
| private

Definition at line 37 of file StoreExplorerAlg.cpp.

## ◆ m_frqPrint

long StoreExplorerAlg::m_frqPrint = 0
| private

Internal counter to adjust printout frequency.

Definition at line 47 of file StoreExplorerAlg.cpp.

## ◆ m_load

Gaudi::Property<bool> StoreExplorerAlg::m_load {this, "Load", false, "load non existing items"}
| private

Definition at line 34 of file StoreExplorerAlg.cpp.

## ◆ m_print

Gaudi::Property<long> StoreExplorerAlg::m_print {this, "PrintEvt", 1, "limit printout to first N events"}
| private

Definition at line 35 of file StoreExplorerAlg.cpp.

## ◆ m_printMissing

Gaudi::Property<long> StoreExplorerAlg::m_printMissing {this, "PrintMissing", 0, "indicate if missing entities should be printed"}
| private

Definition at line 36 of file StoreExplorerAlg.cpp.

## ◆ m_rootName

std::string StoreExplorerAlg::m_rootName
| private

Name of the root leaf (obtained at initialize)

Definition at line 51 of file StoreExplorerAlg.cpp.

## ◆ m_testAccess

Gaudi::Property<bool> StoreExplorerAlg::m_testAccess
| private

Initial value:
{this, "TestAccess", false,
"test access to objects (DataObject and ContainedObject)"}

Definition at line 40 of file StoreExplorerAlg.cpp.

## ◆ m_total

long StoreExplorerAlg::m_total = 0
| private

Internal counter to trigger printouts.

Definition at line 45 of file StoreExplorerAlg.cpp.

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

- GaudiCommonSvc/src/DataSvc/StoreExplorerAlg.cpp