#include <SGAudSvc.h>
|
typedef std::map< std::string, std::set< std::string > > | DataMap |
|
Definition at line 39 of file SGAudSvc.h.
◆ DataMap
◆ SGAudSvc() [1/2]
SGAudSvc::SGAudSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Constructor with parameters:
Definition at line 39 of file SGAudSvc.cxx.
40 base_class (
name, pSvcLocator ),
52 declareProperty(
"OutFileName",
m_outFileName =
"SGAudSvc.out",
53 "Name of the output file to hold SGAudSvc data" );
56 "Name of the output file to hold the full SG aud data");
59 "Name of the output file to hold the summary output in json format");
62 "Set to ignore any attempts to override current-alg" );
65 "Event number to start recording data" );
67 declareProperty(
"UseCLID",
m_useCLID =
true,
68 "Use CLID or DataObj name in Summary File" );
◆ ~SGAudSvc()
◆ SGAudSvc() [2/2]
◆ addRead()
void SGAudSvc::addRead |
( |
| ) |
|
|
private |
Definition at line 412 of file SGAudSvc.cxx.
418 std::pair<int,int>
p(oaHash,1);
◆ addWrite()
void SGAudSvc::addWrite |
( |
| ) |
|
|
private |
Definition at line 427 of file SGAudSvc.cxx.
433 std::pair<int,int>
p(oaHash,1);
◆ clearFakeCurrentAlg()
void SGAudSvc::clearFakeCurrentAlg |
( |
| ) |
|
|
overridevirtual |
For implementing custom increased granularity auditing of for instance tools.
Definition at line 447 of file SGAudSvc.cxx.
◆ finalize()
StatusCode SGAudSvc::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 121 of file SGAudSvc.cxx.
126 m_msg << MSG::WARNING<<
"No data gathered. This might be because you did not run over at least 3 events."<<
endmsg;
127 return StatusCode::SUCCESS;
133 f <<
"Algs: " <<
m_vAlg.size() << std::endl;
136 f << (*i) << std::endl;
139 f <<
"Obj: "<<
m_vObj.size()<<std::endl;
141 f << (*i) << std::endl;
145 for (
unsigned int w=0;
w<
m_vAlg.size();
w++){
146 for(
unsigned int q=0;
q<
m_vObj.size();
q++){
147 int oaHash=
q*1000 +
w;
164 if (
m_ofs.is_open()) {
172 return StatusCode::SUCCESS;
◆ getNobj()
void SGAudSvc::getNobj |
( |
std::string |
name | ) |
|
|
private |
◆ handle()
void SGAudSvc::handle |
( |
const Incident & |
incident | ) |
|
|
overridevirtual |
incident service handle for EndEvent.
Calls monitor. There should be more elegant way to get number of events passed.
Definition at line 178 of file SGAudSvc.cxx.
182 <<
" Incidence type: " << inc.type() <<
endmsg
183 <<
" from: " << inc.source() <<
endmsg;
186 if (inc.type() == IncidentType::BeginEvent) {
188 m_ofa <<
"---- BEGIN EVENT " <<
m_nEvents <<
" ----" << std::endl;
194 if ( inc.type() == IncidentType::EndEvent ) {
207 if ( inc.type() == IncidentType::BeginRun ) {
◆ initialize()
StatusCode SGAudSvc::initialize |
( |
| ) |
|
|
overridevirtual |
Gaudi Service Implementation.
Definition at line 84 of file SGAudSvc.cxx.
87 m_msg.setLevel( m_outputLevel.value() );
92 m_msg << MSG::ERROR <<
"Could not intialize base class !!" <<
endmsg;
93 return StatusCode::FAILURE;
111 incSvc->addListener(
this, IncidentType::BeginRun );
112 incSvc->addListener(
this, IncidentType::BeginEvent );
113 incSvc->addListener(
this, IncidentType::EndEvent );
115 return StatusCode::SUCCESS;
◆ monitor()
void SGAudSvc::monitor |
( |
| ) |
|
|
private |
just counts events. called at EndEvent incident
Definition at line 229 of file SGAudSvc.cxx.
◆ setFakeCurrentAlg()
void SGAudSvc::setFakeCurrentAlg |
( |
const std::string & |
s | ) |
|
|
overridevirtual |
For implementing custom increased granularity auditing of for instance tools.
Definition at line 442 of file SGAudSvc.cxx.
◆ SGAudit()
Definition at line 282 of file SGAudSvc.cxx.
286 if (
m_pCID == 0) {
return; }
301 if( !
m_pCID->getTypeNameOfID(
id,idname).isSuccess()) {
302 std::ostringstream
ost;
308 if (
m_ofa.is_open()) {
309 m_ofa << ( (typ == 1) ?
"RECORD" :
"RETRIEVE" ) <<
" clid: " <<
id
315 <<
" store: " << store_id
321 if (!
m_ofs.is_open())
return;
329 std::ostringstream
ost;
333 kk = idname +
"/" +
key;
339 if (itr !=
m_read.end()) {
340 itr->second.insert(
kk);
347 itr->second.insert(
kk);
◆ SGAudRECORD()
void SGAudSvc::SGAudRECORD |
( |
std::string |
SGobject | ) |
|
|
private |
Definition at line 261 of file SGAudSvc.cxx.
263 if (SGobject==
"") SGobject=
"noKey";
264 for (
unsigned int i = 0;
i < SGobject.length();
i++)
265 if (!std::isdigit(SGobject[
i])){
◆ SGAudRETRIEVE()
void SGAudSvc::SGAudRETRIEVE |
( |
std::string |
SGobject | ) |
|
|
private |
Definition at line 237 of file SGAudSvc.cxx.
239 if (SGobject==
"") SGobject=
"noKey";
241 for (
unsigned int i = 0;
i < SGobject.length();
i++)
242 if (!std::isdigit(SGobject[
i])){
◆ SGGetCurrentAlg()
bool SGAudSvc::SGGetCurrentAlg |
( |
| ) |
|
Gets name of curently running algorithm from AlgContextSvc.
Definition at line 357 of file SGAudSvc.cxx.
365 std::string
name = asdf->name();
◆ writeJSON()
void SGAudSvc::writeJSON |
( |
| ) |
|
|
private |
Definition at line 452 of file SGAudSvc.cxx.
454 DataMap::const_iterator itr;
455 std::set<std::string>::const_iterator it2;
456 std::vector<std::string>::const_iterator ia;
458 m_ofs <<
"{ \"algorithms\" : [" << std::endl;
460 m_ofs <<
" {" << std::endl;
461 m_ofs <<
" \"name\" : \"" << *ia <<
"\"," << std::endl;
462 m_ofs <<
" \"inputs\" : [";
465 if (itr !=
m_read.end()) {
466 for (it2 = itr->second.begin(); it2 != itr->second.end(); ++it2) {
467 if (it2 != itr->second.begin())
m_ofs <<
",";
468 m_ofs <<
"\"" << *it2 <<
"\"";
471 m_ofs <<
"]," << std::endl;
473 m_ofs <<
" \"outputs\" : [";
477 for (it2 = itr->second.begin(); it2 != itr->second.end(); ++it2) {
478 if (it2 != itr->second.begin())
m_ofs <<
",";
479 m_ofs <<
"\"" << *it2 <<
"\"";
482 m_ofs <<
"]," << std::endl;
483 m_ofs <<
" }," << std::endl;
485 m_ofs <<
" ]" << std::endl <<
"}" << std::endl;
◆ m_allFileName
std::string SGAudSvc::m_allFileName |
|
private |
◆ m_currAlg
std::string SGAudSvc::m_currAlg |
|
private |
◆ m_currObj
std::string SGAudSvc::m_currObj |
|
private |
◆ m_fakeCurrAlg
std::string SGAudSvc::m_fakeCurrAlg |
|
private |
◆ m_ignoreFakeAlgs
bool SGAudSvc::m_ignoreFakeAlgs |
|
private |
Whether to ignore fake current algs.
Definition at line 111 of file SGAudSvc.h.
◆ m_inExec
◆ m_msg
MsgStream SGAudSvc::m_msg |
|
private |
MsgStream for talking with the outside world.
Definition at line 101 of file SGAudSvc.h.
◆ m_nCurrAlg
◆ m_nCurrObj
◆ m_nEvents
◆ m_ofa
std::ofstream SGAudSvc::m_ofa |
|
private |
◆ m_ofs
std::ofstream SGAudSvc::m_ofs |
|
private |
◆ m_outFileName
std::string SGAudSvc::m_outFileName |
|
private |
Name of the output file.
Definition at line 108 of file SGAudSvc.h.
◆ m_pCID
◆ m_read
◆ m_startEvent
int SGAudSvc::m_startEvent |
|
private |
◆ m_sumFileName
std::string SGAudSvc::m_sumFileName |
|
private |
◆ m_timesRead
std::map<int,int> SGAudSvc::m_timesRead |
|
private |
map counting Reads of each object by each algorithm.
Definition at line 121 of file SGAudSvc.h.
◆ m_timesWritten
std::map<int,int> SGAudSvc::m_timesWritten |
|
private |
map counting Writes of each object by each algorithm.
Definition at line 123 of file SGAudSvc.h.
◆ m_useCLID
Whether to use CLID or Data Obj Name in JSON output file.
Definition at line 114 of file SGAudSvc.h.
◆ m_vAlg
std::vector<std::string> SGAudSvc::m_vAlg |
|
private |
Vector of names of algorithms accessing SG.
Definition at line 119 of file SGAudSvc.h.
◆ m_vObj
std::vector<std::string> SGAudSvc::m_vObj |
|
private |
Vector of accessed SG objects names.
Definition at line 117 of file SGAudSvc.h.
◆ m_write
◆ p_algCtxSvc
Pointer to the AlgContextScv
.
Definition at line 104 of file SGAudSvc.h.
The documentation for this class was generated from the following files: