9#ifndef SGCOMPS_SGAUDSVC_H
10#define SGCOMPS_SGAUDSVC_H
21#include "GaudiKernel/ServiceHandle.h"
22#include "GaudiKernel/IIncidentListener.h"
23#include "GaudiKernel/IClassIDSvc.h"
43 ISGAudSvc, IIncidentListener>
48 SGAudSvc(
const std::string& name, ISvcLocator* pSvcLocator );
53 virtual StatusCode
finalize()
override;
58 virtual void handle(
const Incident& incident )
override;
61 virtual void SGAudit(
const std::string& key,
const CLID&
id,
62 const int& fnc,
const int& store_id)
override;
86 void getNobj(
const std::string& name);
100 Gaudi::Property<std::string>
m_outFileName{
this,
"OutFileName",
"SGAudSvc.out",
101 "Name of the output file to hold SGAudSvc data"};
104 "Name of the output file to hold the full SG aud data"};
107 "Name of the output file to hold the summary output in json format"};
110 "Set to ignore any attempts to override current-alg"};
113 "Event number to start recording data"};
116 "Use CLID or DataObj name in Summary File"};
138 typedef std::map<std::string, std::set<std::string> >
DataMap;
uint32_t CLID
The Class ID type.
Gaudi::Property< std::string > m_outFileName
std::string m_fakeCurrAlg
virtual void setFakeCurrentAlg(const std::string &) override
For implementing custom increased granularity auditing of for instance tools.
std::map< int, int > m_timesWritten
map counting Writes of each object by each algorithm.
void SGAudRECORD(std::string SGobject)
std::map< int, int > m_timesRead
map counting Reads of each object by each algorithm.
virtual void SGAudit(const std::string &key, const CLID &id, const int &fnc, const int &store_id) override
void monitor()
just counts events. called at EndEvent incident
bool SGGetCurrentAlg()
Gets name of curently running algorithm from AlgContextSvc.
void SGAudRETRIEVE(std::string SGobject)
Gaudi::Property< bool > m_useCLID
virtual StatusCode initialize() override
Gaudi Service Implementation.
SGAudSvc()
Default constructor:
virtual void clearFakeCurrentAlg() override
For implementing custom increased granularity auditing of for instance tools.
ServiceHandle< IClassIDSvc > m_pCID
std::vector< std::string > m_vAlg
Vector of names of algorithms accessing SG.
Gaudi::Property< std::string > m_sumFileName
virtual void handle(const Incident &incident) override
incident service handle for EndEvent.
SGAudSvc(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
std::map< std::string, std::set< std::string > > DataMap
Gaudi::Property< int > m_startEvent
void getNobj(const std::string &name)
virtual StatusCode finalize() override
Gaudi::Property< bool > m_ignoreFakeAlgs
std::vector< std::string > m_vObj
Vector of accessed SG objects names.
Gaudi::Property< std::string > m_allFileName
ServiceHandle< IAlgContextSvc > p_algCtxSvc
Pointer to the AlgContextScv.