8 #include "GaudiKernel/DataObject.h"
9 #include "GaudiKernel/LinkManager.h"
10 #include "GaudiKernel/IDataProviderSvc.h"
11 #include "GaudiKernel/IDataManagerSvc.h"
12 #include "GaudiKernel/SmartDataPtr.h"
13 #include "GaudiKernel/Algorithm.h"
14 #include "GaudiKernel/IRegistry.h"
15 #include "GaudiKernel/MsgStream.h"
16 #include "GaudiKernel/SmartIF.h"
54 vector<IRegistry*> leaves;
57 for (
auto& pReg : leaves ) {
59 if ( !pReg->address() || !pReg->object() )
continue;
60 const string&
id = pReg->identifier();
61 auto j=m_info.find(
id);
62 if ( j == m_info.end() ) {
66 j->second.id = m_info.size();
67 j->second.clid = pReg->object()->clID();
69 m_curr[id].id = m_info[id].id;
70 m_curr[id].count = explore(pReg);
89 log <<
MSG::ALWAYS <<
"== BEGIN ============= Access list content:" << m_info.size() <<
endmsg;
90 for(
const auto&
i : m_info) {
92 log <<
"== ITEM == " << right << setw(4) << dec << info.
id <<
" clid:"
93 << right << setw(8) << hex << info.
clid <<
" Count:"
94 << right << setw(6) << dec << info.
count <<
" "
97 auto c=m_corr.find(
i.first);
98 if (
c != m_corr.end() ) {
100 log <<
"== CORRELATIONS:" << (*c).second.size() <<
endmsg;
101 for(
const auto& k :
c->second) {
102 if ( k.second > 0 ) {
103 log << dec << k.first <<
":" << k.second <<
" ";
110 if ( cnt > 0 ) log <<
endmsg;
112 auto l=m_links.find(
i.first);
113 if (
l != m_links.end() ) {
115 log <<
"== LINKS:" <<
l->second.size() <<
endmsg;
116 for(
const auto& k :
l->second) {
117 if ( k.second > 0 ) {
118 log << dec << k.first <<
":" << k.second <<
" ";
125 if ( cnt > 0 ) log <<
endmsg;
128 log <<
MSG::ALWAYS <<
"== END =============== Access list content:" << m_info.size() <<
endmsg;
139 auto& evnt = m_curr[
"/Event"];
140 evnt.count = explore(root->
registry());
141 evnt.clid = root->
clID();
142 evnt.id = m_curr.size();
143 for(
const auto &
i : m_curr ) m_info[
i.first].count++;
144 for(
const auto &
i : m_info ) {
145 const string& nam =
i.first;
147 auto c=m_corr.find(nam);
148 if (
c == m_corr.end() ) {
150 c = m_corr.find(nam);
152 for(
const auto&
l : m_curr) {
153 const auto&
id =
l.second.id;
154 auto k =
c->second.find(
id);
155 if ( k==
c->second.end() ) k =
c->second.emplace(
id, 0 ).first;
160 if (
c == m_links.end() )
c = m_links.emplace( nam, std::map<int,int>{} ).first;
161 if ( m_curr.find(nam) == m_curr.end() )
continue;
164 if ( !obj )
continue;
167 for(
long l=0;
l<m->
size(); ++
l) {
168 auto* lnk=m->
link(
l);
169 auto il=m_curr.find(lnk->path());
171 if ( il == m_curr.end() )
continue;
172 if ( ! lnk->object() )
continue;
173 const auto&
id = il->second.id;
174 auto k =
c->second.find(
id);
175 if ( k==
c->second.end() ) k =
c->second.emplace(
id, 0 ).first;
Definition of the MsgStream class used to transmit messages.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
bool isSuccess() const
Test for a status code of SUCCESS.
Small algorithm, which traverses the data store and prints a summary of the leafs accessed during the...
IRegistry * registry() const
Get pointer to Registry.
LinkManager * linkMgr() const
Retrieve Link manager.
SmartIF< IDataManagerSvc > m_mgr
virtual const CLID & clID() const
Retrieve reference to class definition structure.
This class is used for returning status codes from appropriate routines.
void clear(STATE_TYPE _i=std::ios_base::failbit)
#define DECLARE_COMPONENT(type)
Link * link(long id)
Retrieve symbolic link identified by ID.
StatusCode finalize() override
Finalize.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
StatusCode execute() override
Execute procedure.
map< string, LeafInfo > SniffInfo
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by its ...
Base class from which all concrete algorithm classes should be derived.
A small class used to access easily (and efficiently) data items residing in data stores...
size_t explore(IRegistry *pObj)
unsigned int CLID
Class ID definition.
map< string, map< int, int > > Correlations
StatusCode initialize() override
Initialize.
A LinkManager is the object aggregated into a DataObject, which is responsible for the handling of no...
StoreSnifferAlg(const string &name, ISvcLocator *pSvc)
Standard algorithm constructor.
long size() const
Retrieve number of link present.