| The Gaudi Framework v27r1

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

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

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
| 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 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...
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< 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
| 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< 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 override
| 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 Property & | getProperty (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...
PropertyMgr * | getPropertyMgr ()
StatusCode | setProperties ()
| Set the algorithm's properties. More...
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties. More...
template<class T >
Property * | declareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none") const
template<class T >
Property * | declareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none") const
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...
EventContext * | getContext () const
| get the context More...
void | setContext (EventContext *context)
| set the context More...
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override
virtual const DataObjIDColl & | extraInputDeps () const override
virtual const DataObjIDColl & | extraOutputDeps () const override
virtual void | acceptDHVisitor (IDataHandleVisitor *) const override
const DataObjIDColl & | inputDataObjs () const
const DataObjIDColl & | outputDataObjs () const
void | commitHandles () override
void | registerTool (IAlgTool *tool) const
void | deregisterTool (IAlgTool *tool) const
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
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 CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...

## 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< IDataProviderSvc > | m_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
Public Types inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
using | base_class = CommonMessaging
Protected Member Functions inherited from Algorithm
virtual void | declareInput (Gaudi::DataHandle *im) override
virtual void | declareOutput (Gaudi::DataHandle *im) override
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...
Protected Member Functions inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...
Protected Attributes inherited from Algorithm
EventContext * | m_event_context
| Event specific data for multiple event processing. More...
SmartIF< PropertyMgr > | m_propertyMgr
| For management of properties. More...
std::unique_ptr< IDataHandleVisitor > | m_updateDataHandles
| Hook for for derived classes to provide a custom visitor for data handles. 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 }
StoreExplorerAlg::m_printMissing
long m_printMissing
Flag to indicate if missing entities should be printed.
Definition: StoreExplorerAlg.cpp:38
StoreExplorerAlg::m_accessForeign
bool m_accessForeign
Flag to indicate if foreign files should be opened.
Definition: StoreExplorerAlg.cpp:48
Algorithm::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Algorithm.h:426
StoreExplorerAlg::m_load
bool m_load
Flag to load non existing items.
Definition: StoreExplorerAlg.cpp:44
StoreExplorerAlg::m_frequency
double m_frequency
Job option to set the printout frequency.
Definition: StoreExplorerAlg.cpp:34
StoreExplorerAlg::m_print
long m_print
Job option to limit printout to first nnn events.
Definition: StoreExplorerAlg.cpp:32
Algorithm::Algorithm
Algorithm(const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
Constructor.
Definition: Algorithm.cpp:43
StoreExplorerAlg::m_dataSvcName
std::string m_dataSvcName
Name of the data provider service.
Definition: StoreExplorerAlg.cpp:52
StoreExplorerAlg::m_exploreRelations
bool m_exploreRelations
Flag to check if relations should be followed.
Definition: StoreExplorerAlg.cpp:36
StoreExplorerAlg::m_testAccess
bool m_testAccess
Flag to test access to objects (DataObject and ContainedObject)
Definition: StoreExplorerAlg.cpp:46

StoreExplorerAlg::~StoreExplorerAlg | ( |  | ) |
| override default

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 }
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:245
std::string::substr
T substr(T...args)
std::accumulate
T accumulate(T...args)
ana.i
list i
Definition: ana.py:128

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

Execute procedure.

Definition at line 215 of file StoreExplorerAlg.cpp.

215 {
216 SmartDataPtr<DataObject> root(m_dataSvc.get(),m_rootName);
217 if ( ((m_print > m_total++) || (m_frequency*m_total > m_frqPrint)) && root ) {
218 if ( m_frequency*m_total > m_frqPrint ) m_frqPrint++;
219 std::string store_name = "Unknown";
220 IRegistry* pReg = root->registry();
221 if ( pReg ) {
222 auto isvc = SmartIF<IService>{pReg->dataSvc()};
223 if ( isvc ) store_name = isvc->name();
224 }
225 info() << "========= " << m_rootName << "["
226 << std::showbase << std::hex << (unsigned long) root.ptr() << std::dec
227 << "@" << store_name << "]:" << endmsg;
228 std::vector<bool> flg(1,true);
229 explore(root->registry(), flg);
230 return StatusCode::SUCCESS;
231 } else if ( root ) {
232 return StatusCode::SUCCESS;
233 }
234 error() << "Cannot retrieve \"/Event\"!" << endmsg;
235 return StatusCode::FAILURE;
236 }
SmartIF< IService >
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:124
StoreExplorerAlg::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
Definition: StoreExplorerAlg.cpp:50
std::showbase
T showbase(T...args)
StoreExplorerAlg::m_total
long m_total
Internal counter to trigger printouts.
Definition: StoreExplorerAlg.cpp:40
StoreExplorerAlg::m_frequency
double m_frequency
Job option to set the printout frequency.
Definition: StoreExplorerAlg.cpp:34
std::string
STL class.
StoreExplorerAlg::m_print
long m_print
Job option to limit printout to first nnn events.
Definition: StoreExplorerAlg.cpp:32
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StoreExplorerAlg::m_rootName
std::string m_rootName
Name of the root leaf (obtained at initialize)
Definition: StoreExplorerAlg.cpp:54
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
StoreExplorerAlg::explore
void explore(IRegistry *pObj, std::vector< bool > &flg)
Definition: StoreExplorerAlg.cpp:149
std::vector< bool >
SmartDataPtr
A small class used to access easily (and efficiently) data items residing in data stores...
Definition: SmartDataPtr.h:46
std::hex
T hex(T...args)
IOTest.root
tuple root
Definition: IOTest.py:42
IRegistry::dataSvc
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
StoreExplorerAlg::m_frqPrint
long m_frqPrint
Internal counter to adjust printout frequency.
Definition: StoreExplorerAlg.cpp:42
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Definition at line 149 of file StoreExplorerAlg.cpp.

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

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

Finalize.

Definition at line 209 of file StoreExplorerAlg.cpp.

209 {
210 m_dataSvc.reset();
211 return StatusCode::SUCCESS;
212 }
StoreExplorerAlg::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
Definition: StoreExplorerAlg.cpp:50
StatusCode::SUCCESS
Definition: StatusCode.h:30
SmartIF::reset
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 | ( |  | ) |
| inline override

Initialize.

Definition at line 191 of file StoreExplorerAlg.cpp.

191 {
192 m_rootName.clear();
193 m_dataSvc = service(m_dataSvcName,true);
194 if ( !m_dataSvc ) {
195 error() << "Failed to access service \""
196 << m_dataSvcName << "\"." << endmsg;
197 return StatusCode::FAILURE;
198 }
199 auto mgr = m_dataSvc.as<IDataManagerSvc>();
200 if ( !mgr ) {
201 error() << "Failed to retrieve IDataManagerSvc interface." << endmsg;
202 return StatusCode::FAILURE;
203 }
204 m_rootName = mgr->rootName();
205 return StatusCode::SUCCESS;
206 }
StoreExplorerAlg::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
Definition: StoreExplorerAlg.cpp:50
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StoreExplorerAlg::m_rootName
std::string m_rootName
Name of the root leaf (obtained at initialize)
Definition: StoreExplorerAlg.cpp:54
std::string::clear
T clear(T...args)
StoreExplorerAlg::m_dataSvcName
std::string m_dataSvcName
Name of the data provider service.
Definition: StoreExplorerAlg.cpp:52
IDataManagerSvc
Definition: IDataManagerSvc.h:45
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:232
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Print datastore leaf.

Definition at line 85 of file StoreExplorerAlg.cpp.

85 {
86 auto& log = info();
87 for (size_t j = 1; j < flg.size(); j++ ) {
88 if ( !flg[j-1] && flg[j] ) log << "| ";
89 else if ( flg[j] ) log << " ";
90 else log << "| ";
91 }
92 log << "+--> " << pReg->name();
93 if ( pReg->address() ) {
94 log << " [Address: CLID="
95 << std::showbase << std::hex << pReg->address()->clID()
96 << " Type=" << (void*)pReg->address()->svcType() << "]";
97 }
98 else {
99 log << " [No Address]";
100 }
101 DataObject* p = pReg->object();
102 if ( p ) {
103 try {
104 std::string typ = System::typeinfoName(typeid(*p));
105 if ( m_testAccess ) p->clID();
106 log << " " << typ.substr(0,32);
107 }
108 catch (...) {
109 log << "Access test FAILED";
110 }
111 }
112 else {
113 log << " (Unloaded) ";
114 }
115 ObjectContainerBase* base = dynamic_cast<ObjectContainerBase*>(p);
116 if ( base ) {
117 try {
118 int numObj = base->numberOfObjects();
119 const CLID id = p->clID();
120 log << " [" << numObj << "]";
121 if ( m_testAccess ) {
122 CLID idd = id>>16;
123 switch(idd) {
124 case CLID_ObjectList>>16: /* ObjectList */
125 access((ObjectList<ContainedObject>*)base);
126 break;
127 case CLID_ObjectVector>>16: /* ObjectVector */
128 access((ObjectVector<ContainedObject>*)base);
129 break;
130 case (CLID_ObjectVector+0x00030000)>>16: /* Keyed Map */
131 access((KeyedContainer<KeyedObject<int>,Containers::Map>*)base);
132 break;
133 case (CLID_ObjectVector+0x00040000)>>16: /* Keyed Hashmap */
134 access((KeyedContainer<KeyedObject<int>,Containers::HashMap>*)base);
135 break;
136 case (CLID_ObjectVector+0x00050000)>>16: /* Keyed array */
137 access((KeyedContainer<KeyedObject<int>,Containers::Array>*)base);
138 break;
139 }
140 }
141 }
142 catch (...) {
143 log << "Access test FAILED";
144 }
145 }
146 log << endmsg;
147 }
KeyedObject< int >
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:124
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
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:11
KeyedContainer
template class KeyedContainer, KeyedContainer.h
Definition: KeyedContainer.h:63
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
std::showbase
T showbase(T...args)
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:12
std::string
STL class.
DataObject::clID
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:68
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)
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
StoreExplorerAlg::m_testAccess
bool m_testAccess
Flag to test access to objects (DataObject and ContainedObject)
Definition: StoreExplorerAlg.cpp:46
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StoreExplorerAlg::access
std::string access(T *p)
Definition: StoreExplorerAlg.cpp:74

## 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:

- GaudiCommonSvc/src/DataSvc/StoreExplorerAlg.cpp