 |
ATLAS Offline Software
|
Go to the documentation of this file.
21 #include "Gaudi/Property.h"
22 #include "GaudiKernel/IIncidentSvc.h"
23 #include "GaudiKernel/Incident.h"
24 #include "GaudiKernel/IAlgContextSvc.h"
40 base_class (
name, pSvcLocator ),
41 p_algCtxSvc(
"AlgContextSvc",
name),
42 m_pCID(
"ClassIDSvc",
name)
71 incSvc->addListener(
this, IncidentType::BeginRun );
72 incSvc->addListener(
this, IncidentType::BeginEvent );
73 incSvc->addListener(
this, IncidentType::EndEvent );
75 return StatusCode::SUCCESS;
84 ATH_MSG_WARNING(
"No data gathered. This might be because you did not run over at least 3 events.");
85 return StatusCode::SUCCESS;
91 f <<
"Algs: " <<
m_vAlg.size() << std::endl;
94 f << (*i) << std::endl;
97 f <<
"Obj: "<<
m_vObj.size()<<std::endl;
99 f << (*i) << std::endl;
103 for (
unsigned int w=0;
w<
m_vAlg.size();
w++){
104 for(
unsigned int q=0;
q<
m_vObj.size();
q++){
105 int oaHash=
q*1000 +
w;
122 if (
m_ofs.is_open()) {
130 return StatusCode::SUCCESS;
139 " from: " << inc.source());
141 if (inc.type() == IncidentType::BeginEvent) {
143 m_ofa <<
"---- BEGIN EVENT " <<
m_nEvents <<
" ----" << std::endl;
149 if ( inc.type() == IncidentType::EndEvent ) {
162 if ( inc.type() == IncidentType::BeginRun ) {
183 if (SGobject==
"") SGobject=
"noKey";
185 for (
unsigned int i = 0;
i < SGobject.length();
i++)
186 if (!std::isdigit(SGobject[
i])){
207 if (SGobject==
"") SGobject=
"noKey";
208 for (
unsigned int i = 0;
i < SGobject.length();
i++)
209 if (!std::isdigit(SGobject[
i])){
227 const int& typ,
const int& store_id) {
230 if (
m_pCID == 0) {
return; }
245 if( !
m_pCID->getTypeNameOfID(
id,idname).isSuccess()) {
246 std::ostringstream
ost;
252 if (
m_ofa.is_open()) {
253 m_ofa << ( (typ == 1) ?
"RECORD" :
"RETRIEVE" ) <<
" clid: " <<
id
259 <<
" store: " << store_id
265 if (!
m_ofs.is_open())
return;
273 std::ostringstream
ost;
277 kk = idname +
"/" +
key;
283 if (itr !=
m_read.end()) {
284 itr->second.insert(std::move(
kk));
291 itr->second.insert(std::move(
kk));
309 std::string
name = asdf->name();
362 std::pair<int,int>
p(oaHash,1);
377 std::pair<int,int>
p(oaHash,1);
398 DataMap::const_iterator itr;
399 std::set<std::string>::const_iterator it2;
400 std::vector<std::string>::const_iterator ia;
402 m_ofs <<
"{ \"algorithms\" : [" << std::endl;
404 m_ofs <<
" {" << std::endl;
405 m_ofs <<
" \"name\" : \"" << *ia <<
"\"," << std::endl;
406 m_ofs <<
" \"inputs\" : [";
409 if (itr !=
m_read.end()) {
410 for (it2 = itr->second.begin(); it2 != itr->second.end(); ++it2) {
411 if (it2 != itr->second.begin())
m_ofs <<
",";
412 m_ofs <<
"\"" << *it2 <<
"\"";
415 m_ofs <<
"]," << std::endl;
417 m_ofs <<
" \"outputs\" : [";
421 for (it2 = itr->second.begin(); it2 != itr->second.end(); ++it2) {
422 if (it2 != itr->second.begin())
m_ofs <<
",";
423 m_ofs <<
"\"" << *it2 <<
"\"";
426 m_ofs <<
"]," << std::endl;
427 m_ofs <<
" }," << std::endl;
429 m_ofs <<
" ]" << std::endl <<
"}" << std::endl;
JetConstituentVector::iterator iterator
bool SGGetCurrentAlg()
Gets name of curently running algorithm from AlgContextSvc.
ServiceHandle< IClassIDSvc > m_pCID
std::map< int, int > m_timesWritten
map counting Writes of each object by each algorithm.
void monitor()
just counts events. called at EndEvent incident
void SGAudRECORD(std::string SGobject)
virtual void clearFakeCurrentAlg() override
For implementing custom increased granularity auditing of for instance tools.
Gaudi::Property< std::string > m_allFileName
void getNobj(const std::string &name)
Gaudi::Property< int > m_startEvent
SGAudSvc()
Default constructor:
Gaudi::Property< bool > m_useCLID
virtual StatusCode initialize() override
Gaudi Service Implementation.
#define ATH_MSG_VERBOSE(x)
virtual StatusCode finalize() override
virtual void handle(const Incident &incident) override
incident service handle for EndEvent.
virtual void setFakeCurrentAlg(const std::string &) override
For implementing custom increased granularity auditing of for instance tools.
std::map< int, int > m_timesRead
map counting Reads of each object by each algorithm.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< std::string > m_outFileName
virtual void SGAudit(const std::string &key, const CLID &id, const int &fnc, const int &store_id) override
void SGAudRETRIEVE(std::string SGobject)
std::vector< std::string > m_vAlg
Vector of names of algorithms accessing SG.
uint32_t CLID
The Class ID type.
Gaudi::Property< bool > m_ignoreFakeAlgs
Gaudi::Property< std::string > m_sumFileName
ServiceHandle< IAlgContextSvc > p_algCtxSvc
Pointer to the AlgContextScv.
#define ATH_MSG_WARNING(x)
std::vector< std::string > m_vObj
Vector of accessed SG objects names.
std::string m_fakeCurrAlg