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 () 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...
 
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::stringname () const override
 The identifying name of the algorithm object. More...
 
const Gaudi::StringKeynameKey () const override
 
const std::stringtype () const override
 The type of the algorithm object. More...
 
void setType (const std::string &type) override
 
const std::stringversion () 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< 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
 
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 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 setProperties ()
 Set the algorithm's properties. More...
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (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...
 
const EventContextgetContext () const override
 get the context More...
 
void setContext (const EventContext *context) override
 set the context More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 
virtual const DataObjIDCollextraInputDeps () const override
 
virtual const DataObjIDCollextraOutputDeps () const override
 
virtual void acceptDHVisitor (IDataHandleVisitor *) const override
 
const DataObjIDCollinputDataObjs () const override
 
const DataObjIDColloutputDataObjs () const override
 
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 isIOBound () const
 
void setIOBound (bool value)
 
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 PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
 PropertyHolder ()=default
 
 ~PropertyHolder () override=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (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::PropertyBasegetProperty (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
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< TYPE > &ref, const std::string &doc="none")
 Specializations for various GaudiHandles. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ServiceHandle< TYPE > &ref, const std::string &doc="none")
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< TYPE > &ref, const std::string &doc="none")
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ServiceHandleArray< TYPE > &ref, const std::string &doc="none")
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, DataObjectHandle< TYPE > &ref, const std::string &doc="none")
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
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

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::stringm_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< IDataProviderSvcm_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 Algorithm
typedef Gaudi::PluginService::Factory< IAlgorithm *, const std::string &, ISvcLocator * > Factory
 
- 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
 
- 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...
 
int maxErrors () const
 
- Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
Gaudi::Details::PropertyBaseproperty (const std::string &name) const
 
- 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
const EventContextm_event_context
 Event specific data for multiple event processing. More...
 
std::unique_ptr< IDataHandleVisitorm_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 33 of file StoreExplorerAlg.cpp.

Constructor & Destructor Documentation

StoreExplorerAlg::~StoreExplorerAlg ( )
overridedefault

Standard Destructor.

Member Function Documentation

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

Definition at line 63 of file StoreExplorerAlg.cpp.

64  {
65  if ( !p ) return "Access FAILED.";
66  std::string result =
68  [&]( std::string s, typename T::const_reference i ) {
69  return s + std::to_string( p->index( i ) ) + ":" + std::to_string( i->clID() ) + ",";
70  } );
71  return result.substr( 0, result.length() - 2 );
72  }
T to_string(T...args)
T end(T...args)
STL class.
T length(T...args)
T begin(T...args)
string s
Definition: gaudirun.py:245
T substr(T...args)
T accumulate(T...args)
StatusCode StoreExplorerAlg::execute ( )
inlineoverride

Execute procedure.

Definition at line 206 of file StoreExplorerAlg.cpp.

207  {
209  if ( ( ( m_print > m_total++ ) || ( m_frequency * m_total > m_frqPrint ) ) && root ) {
211  std::string store_name = "Unknown";
212  IRegistry* pReg = root->registry();
213  if ( pReg ) {
214  auto isvc = SmartIF<IService>{pReg->dataSvc()};
215  if ( isvc ) store_name = isvc->name();
216  }
217  info() << "========= " << m_rootName << "[" << std::showbase << std::hex << (unsigned long)root.ptr() << std::dec
218  << "@" << store_name << "]:" << endmsg;
219  std::vector<bool> flg( 1, true );
220  explore( root->registry(), flg );
221  return StatusCode::SUCCESS;
222  } else if ( root ) {
223  return StatusCode::SUCCESS;
224  }
225  error() << "Cannot retrieve \"/Event\"!" << endmsg;
226  return StatusCode::FAILURE;
227  }
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
T showbase(T...args)
long m_total
Internal counter to trigger printouts.
Gaudi::Property< double > m_frequency
STL class.
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
std::string m_rootName
Name of the root leaf (obtained at initialize)
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
Gaudi::Property< long > m_print
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
T hex(T...args)
long m_frqPrint
Internal counter to adjust printout frequency.
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 138 of file StoreExplorerAlg.cpp.

139  {
140  printObj( pObj, flg );
141  if ( pObj ) {
142  auto mgr = eventSvc().as<IDataManagerSvc>();
143  if ( mgr ) {
145  StatusCode sc = mgr->objectLeaves( pObj, leaves );
146  const std::string* par0 = nullptr;
147  if ( pObj->address() ) par0 = pObj->address()->par();
148  if ( sc.isSuccess() ) {
149  for ( auto i = leaves.begin(); i != leaves.end(); i++ ) {
150  const std::string& id = ( *i )->identifier();
151  DataObject* p = nullptr;
152  if ( !m_accessForeign && ( *i )->address() ) {
153  if ( par0 ) {
154  const std::string* par1 = ( *i )->address()->par();
155  if ( par1 && par0[0] != par1[0] ) continue;
156  }
157  }
158  if ( m_load ) {
159  sc = eventSvc()->retrieveObject( id, p );
160  } else {
161  sc = eventSvc()->findObject( id, p );
162  }
163  if ( sc.isSuccess() ) {
164  if ( id != "/Event/Rec/Relations" || m_exploreRelations ) {
165  flg.push_back( i + 1 == leaves.end() );
166  explore( *i, flg );
167  flg.pop_back();
168  }
169  } else {
170  flg.push_back( i + 1 == leaves.end() );
171  printObj( *i, flg );
172  flg.pop_back();
173  }
174  }
175  }
176  }
177  }
178  }
Gaudi::Property< bool > m_exploreRelations
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
Definition: Algorithm.cpp:823
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
Gaudi::Property< bool > m_accessForeign
T end(T...args)
virtual const std::string * par() const =0
Retrieve String parameters.
STL class.
T push_back(T...args)
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
T pop_back(T...args)
void printObj(IRegistry *pReg, std::vector< bool > &flg)
Print datastore leaf.
void explore(IRegistry *pObj, std::vector< bool > &flg)
T begin(T...args)
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
Gaudi::Property< bool > m_load
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 199 of file StoreExplorerAlg.cpp.

200  {
201  m_dataSvc.reset();
202  return StatusCode::SUCCESS;
203  }
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 181 of file StoreExplorerAlg.cpp.

182  {
183  m_rootName.clear();
184  m_dataSvc = service( m_dataSvcName, true );
185  if ( !m_dataSvc ) {
186  error() << "Failed to access service \"" << m_dataSvcName << "\"." << endmsg;
187  return StatusCode::FAILURE;
188  }
189  auto mgr = m_dataSvc.as<IDataManagerSvc>();
190  if ( !mgr ) {
191  error() << "Failed to retrieve IDataManagerSvc interface." << endmsg;
192  return StatusCode::FAILURE;
193  }
194  m_rootName = mgr->rootName();
195  return StatusCode::SUCCESS;
196  }
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
Gaudi::Property< std::string > m_dataSvcName
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
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)
T clear(T...args)
StatusCode service(const std::string &name, T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn&#39;t already exist.
Definition: Algorithm.h:227
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 75 of file StoreExplorerAlg.cpp.

76  {
77  auto& log = info();
78  for ( size_t j = 1; j < flg.size(); j++ ) {
79  if ( !flg[j - 1] && flg[j] )
80  log << "| ";
81  else if ( flg[j] )
82  log << " ";
83  else
84  log << "| ";
85  }
86  log << "+--> " << pReg->name();
87  if ( pReg->address() ) {
88  log << " [Address: CLID=" << std::showbase << std::hex << pReg->address()->clID()
89  << " Type=" << (void*)pReg->address()->svcType() << "]";
90  } else {
91  log << " [No Address]";
92  }
93  DataObject* p = pReg->object();
94  if ( p ) {
95  try {
96  std::string typ = System::typeinfoName( typeid( *p ) );
97  if ( m_testAccess ) p->clID();
98  log << " " << typ.substr( 0, 32 );
99  } catch ( ... ) {
100  log << "Access test FAILED";
101  }
102  } else {
103  log << " (Unloaded) ";
104  }
105  ObjectContainerBase* base = dynamic_cast<ObjectContainerBase*>( p );
106  if ( base ) {
107  try {
108  int numObj = base->numberOfObjects();
109  const CLID id = p->clID();
110  log << " [" << numObj << "]";
111  if ( m_testAccess ) {
112  CLID idd = id >> 16;
113  switch ( idd ) {
114  case CLID_ObjectList >> 16: /* ObjectList */
116  break;
117  case CLID_ObjectVector >> 16: /* ObjectVector */
119  break;
120  case ( CLID_ObjectVector + 0x00030000 ) >> 16: /* Keyed Map */
122  break;
123  case ( CLID_ObjectVector + 0x00040000 ) >> 16: /* Keyed Hashmap */
125  break;
126  case ( CLID_ObjectVector + 0x00050000 ) >> 16: /* Keyed array */
128  break;
129  }
130  }
131  } catch ( ... ) {
132  log << "Access test FAILED";
133  }
134  }
135  log << endmsg;
136  }
virtual const CLID & clID() const =0
Retrieve class information from link.
Definition of the templated KeyedObject class.
Definition: KeyedObject.h:28
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
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)
T showbase(T...args)
ObjectList is one of the basic Gaudi container classes capable of being registered in Data Stores...
STL class.
Gaudi::Property< bool > m_testAccess
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:68
virtual long svcType() const =0
Retrieve service type.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
virtual DataObject * object() const =0
Retrieve object behind the link.
T size(T...args)
KeyedObjectManager Class to manage keyed objects.
T hex(T...args)
T substr(T...args)
ObjectContainerBase is the base class for Gaudi container classes.
virtual size_type numberOfObjects() const =0
Number of objects in the container.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::string access(T *p)

Member Data Documentation

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

Definition at line 44 of file StoreExplorerAlg.cpp.

SmartIF<IDataProviderSvc> StoreExplorerAlg::m_dataSvc
private

Reference to data provider service.

Definition at line 51 of file StoreExplorerAlg.cpp.

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

Definition at line 41 of file StoreExplorerAlg.cpp.

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

Definition at line 40 of file StoreExplorerAlg.cpp.

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

Definition at line 39 of file StoreExplorerAlg.cpp.

long StoreExplorerAlg::m_frqPrint = 0
private

Internal counter to adjust printout frequency.

Definition at line 49 of file StoreExplorerAlg.cpp.

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

Definition at line 36 of file StoreExplorerAlg.cpp.

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

Definition at line 37 of file StoreExplorerAlg.cpp.

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

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

Gaudi::Property<bool> StoreExplorerAlg::m_testAccess
private
Initial value:
{this, "TestAccess", false,
"test access to objects (DataObject and ContainedObject)"}

Definition at line 42 of file StoreExplorerAlg.cpp.

long StoreExplorerAlg::m_total = 0
private

Internal counter to trigger printouts.

Definition at line 47 of file StoreExplorerAlg.cpp.


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