#include <SGAudSvc.h>
|
typedef std::map< std::string, std::set< std::string > > | DataMap |
|
Definition at line 40 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.
51 "Name of the output file to hold SGAudSvc data" );
54 "Name of the output file to hold the full SG aud data");
57 "Name of the output file to hold the summary output in json format");
60 "Set to ignore any attempts to override current-alg" );
63 "Event number to start recording data" );
66 "Use CLID or DataObj name in Summary File" );
◆ ~SGAudSvc()
◆ SGAudSvc() [2/2]
◆ addRead()
void SGAudSvc::addRead |
( |
| ) |
|
|
private |
Definition at line 447 of file SGAudSvc.cxx.
453 std::pair<int,int>
p(oaHash,1);
◆ addWrite()
void SGAudSvc::addWrite |
( |
| ) |
|
|
private |
Definition at line 462 of file SGAudSvc.cxx.
468 std::pair<int,int>
p(oaHash,1);
◆ clearFakeCurrentAlg()
void SGAudSvc::clearFakeCurrentAlg |
( |
| ) |
|
|
virtual |
For implementing custom increased granularity auditing of for instance tools.
Reimplemented from ISGAudSvc.
Definition at line 482 of file SGAudSvc.cxx.
◆ finalize()
StatusCode SGAudSvc::finalize |
( |
| ) |
|
Definition at line 132 of file SGAudSvc.cxx.
137 m_msg << MSG::WARNING<<
"No data gathered. This might be because you did not run over at least 3 events."<<
endmsg;
138 return StatusCode::SUCCESS;
144 f <<
"Algs: " <<
m_vAlg.size() << std::endl;
147 f << (*i) << std::endl;
150 f <<
"Obj: "<<
m_vObj.size()<<std::endl;
152 f << (*i) << std::endl;
156 for (
unsigned int w=0;
w<
m_vAlg.size();
w++){
157 for(
unsigned int q=0;
q<
m_vObj.size();
q++){
158 int oaHash=
q*1000 +
w;
175 if (
m_ofs.is_open()) {
183 return StatusCode::SUCCESS;
◆ getNobj()
void SGAudSvc::getNobj |
( |
std::string |
name | ) |
|
|
private |
◆ handle()
void SGAudSvc::handle |
( |
const Incident & |
incident | ) |
|
incident service handle for EndEvent.
Calls monitor. There should be more elegant way to get number of events passed.
Definition at line 213 of file SGAudSvc.cxx.
217 <<
" Incidence type: " << inc.type() <<
endmsg
218 <<
" from: " << inc.source() <<
endmsg;
221 if (inc.type() == IncidentType::BeginEvent) {
223 m_ofa <<
"---- BEGIN EVENT " <<
m_nEvents <<
" ----" << std::endl;
229 if ( inc.type() == IncidentType::EndEvent ) {
242 if ( inc.type() == IncidentType::BeginRun ) {
◆ initialize()
StatusCode SGAudSvc::initialize |
( |
| ) |
|
Gaudi Service Implementation.
Definition at line 82 of file SGAudSvc.cxx.
85 m_msg.setLevel( m_outputLevel.value() );
90 m_msg << MSG::ERROR <<
"Could not intialize base class !!" <<
endmsg;
91 return StatusCode::FAILURE;
94 static const bool CREATEIF(
true);
96 if ( service(
"AlgContextSvc",
p_algCtxSvc,CREATEIF).isFailure() ) {
97 m_msg << MSG::ERROR <<
"Unable to retrieve the AlgContextSvc" <<
endmsg;
98 return StatusCode::FAILURE;
103 if ( service(
"ClassIDSvc",
m_pCID,CREATEIF).isFailure() ) {
104 m_msg << MSG::ERROR <<
"Unable to retrieve the ClassIDSvc" <<
endmsg;
105 return StatusCode::FAILURE;
118 if ( !incSvc.retrieve().isSuccess() ) {
119 m_msg << MSG::ERROR <<
"Unable to get the IncidentSvc" <<
endmsg;
120 return StatusCode::FAILURE;
122 incSvc->addListener(
this, IncidentType::BeginRun );
123 incSvc->addListener(
this, IncidentType::BeginEvent );
124 incSvc->addListener(
this, IncidentType::EndEvent );
126 return StatusCode::SUCCESS;
◆ interfaceID()
const InterfaceID & SGAudSvc::interfaceID |
( |
| ) |
|
|
inlinestatic |
◆ monitor()
void SGAudSvc::monitor |
( |
| ) |
|
|
private |
just counts events. called at EndEvent incident
Definition at line 264 of file SGAudSvc.cxx.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ queryInterface()
StatusCode SGAudSvc::queryInterface |
( |
const InterfaceID & |
riid, |
|
|
void ** |
ppvInterface |
|
) |
| |
|
virtual |
Definition at line 190 of file SGAudSvc.cxx.
193 *ppvInterface =
dynamic_cast<ISGAudSvc*
>(
this);
196 return AthService::queryInterface(riid, ppvInterface);
199 return StatusCode::SUCCESS;
◆ setFakeCurrentAlg()
void SGAudSvc::setFakeCurrentAlg |
( |
const std::string & |
s | ) |
|
|
virtual |
For implementing custom increased granularity auditing of for instance tools.
Reimplemented from ISGAudSvc.
Definition at line 477 of file SGAudSvc.cxx.
◆ SGAudit()
Reimplemented from ISGAudSvc.
Definition at line 317 of file SGAudSvc.cxx.
321 if (
m_pCID == 0) {
return; }
336 if( !
m_pCID->getTypeNameOfID(
id,idname).isSuccess()) {
337 std::ostringstream
ost;
343 if (
m_ofa.is_open()) {
344 m_ofa << ( (typ == 1) ?
"RECORD" :
"RETRIEVE" ) <<
" clid: " <<
id
350 <<
" store: " << store_id
356 if (!
m_ofs.is_open())
return;
364 std::ostringstream
ost;
368 kk = idname +
"/" +
key;
374 if (itr !=
m_read.end()) {
375 itr->second.insert(
kk);
382 itr->second.insert(
kk);
◆ SGAudRECORD()
void SGAudSvc::SGAudRECORD |
( |
std::string |
SGobject | ) |
|
|
private |
Definition at line 296 of file SGAudSvc.cxx.
298 if (SGobject==
"") SGobject=
"noKey";
299 for (
unsigned int i = 0;
i < SGobject.length();
i++)
300 if (!std::isdigit(SGobject[
i])){
◆ SGAudRETRIEVE()
void SGAudSvc::SGAudRETRIEVE |
( |
std::string |
SGobject | ) |
|
|
private |
Definition at line 272 of file SGAudSvc.cxx.
274 if (SGobject==
"") SGobject=
"noKey";
276 for (
unsigned int i = 0;
i < SGobject.length();
i++)
277 if (!std::isdigit(SGobject[
i])){
◆ SGGetCurrentAlg()
bool SGAudSvc::SGGetCurrentAlg |
( |
| ) |
|
Gets name of curently running algorithm from AlgContextSvc.
Definition at line 392 of file SGAudSvc.cxx.
400 std::string
name = asdf->name();
◆ SGSetCurrentAlg()
virtual bool ISGAudSvc::SGSetCurrentAlg |
( |
| ) |
|
|
inlinevirtualinherited |
◆ writeJSON()
void SGAudSvc::writeJSON |
( |
| ) |
|
|
private |
Definition at line 487 of file SGAudSvc.cxx.
489 DataMap::const_iterator itr;
490 std::set<std::string>::const_iterator it2;
491 std::vector<std::string>::const_iterator ia;
493 m_ofs <<
"{ \"algorithms\" : [" << std::endl;
495 m_ofs <<
" {" << std::endl;
496 m_ofs <<
" \"name\" : \"" << *ia <<
"\"," << std::endl;
497 m_ofs <<
" \"inputs\" : [";
500 if (itr !=
m_read.end()) {
501 for (it2 = itr->second.begin(); it2 != itr->second.end(); ++it2) {
502 if (it2 != itr->second.begin())
m_ofs <<
",";
503 m_ofs <<
"\"" << *it2 <<
"\"";
506 m_ofs <<
"]," << std::endl;
508 m_ofs <<
" \"outputs\" : [";
512 for (it2 = itr->second.begin(); it2 != itr->second.end(); ++it2) {
513 if (it2 != itr->second.begin())
m_ofs <<
",";
514 m_ofs <<
"\"" << *it2 <<
"\"";
517 m_ofs <<
"]," << std::endl;
518 m_ofs <<
" }," << std::endl;
520 m_ofs <<
" ]" << std::endl <<
"}" << std::endl;
◆ SvcFactory< SGAudSvc >
◆ 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 123 of file SGAudSvc.h.
◆ m_inExec
◆ m_msg
MsgStream SGAudSvc::m_msg |
|
private |
MsgStream for talking with the outside world.
Definition at line 113 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 120 of file SGAudSvc.h.
◆ m_pCID
IClassIDSvc* SGAudSvc::m_pCID |
|
private |
◆ 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 133 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 135 of file SGAudSvc.h.
◆ m_useCLID
Whether to use CLID or Data Obj Name in JSON output file.
Definition at line 126 of file SGAudSvc.h.
◆ m_vAlg
std::vector<std::string> SGAudSvc::m_vAlg |
|
private |
Vector of names of algorithms accessing SG.
Definition at line 131 of file SGAudSvc.h.
◆ m_vObj
std::vector<std::string> SGAudSvc::m_vObj |
|
private |
Vector of accessed SG objects names.
Definition at line 129 of file SGAudSvc.h.
◆ m_write
◆ p_algCtxSvc
IAlgContextSvc* SGAudSvc::p_algCtxSvc |
|
private |
Pointer to the AlgContextScv
.
Definition at line 116 of file SGAudSvc.h.
The documentation for this class was generated from the following files: