15#include "GaudiKernel/MsgStream.h"
16#include "GaudiKernel/IToolSvc.h"
17#include "GaudiKernel/StatusCode.h"
18#include "GaudiKernel/TypeNameString.h"
29 MsgStream log(msgSvc(),
"AthenaMon");
47 MsgStream log(msgSvc(), name());
48 log << MSG::INFO <<
"initialize AthenaMon algorithm" <<
endmsg;
51 SmartIF<IToolSvc> p_toolSvc{service(
"ToolSvc")};
56 std::string toolname(*it);
59 Gaudi::Utils::TypeNameString mytool(toolname);
61 StatusCode
sc = p_toolSvc->retrieveTool(mytool.type(), mytool.name(), p_tool);
63 log << MSG::FATAL <<
"Unable to create " << toolname
65 return StatusCode::FAILURE;
69 <<
"Tool Name = " << toolname
74 log << MSG::WARNING <<
"Unable to setup the OutPutStreams in "
85 log << MSG::WARNING <<
"Unable to book in " << toolname <<
endmsg;
92 return StatusCode::SUCCESS;
98 MsgStream log(msgSvc(), name());
100 log << MSG::DEBUG <<
"executing AthenaMon algorithm" <<
endmsg;
103 std::vector<IMonitorToolBase*>::iterator it =
m_monTools.begin();
106 if((*it)->preSelector())
107 if((*it)->fillHists().isFailure()) {
108 log << MSG::WARNING <<
"Error Filling Histograms" <<
endmsg;
117 log << MSG::INFO <<
"calling checkHists of tool " <<
endmsg;
118 StatusCode
sc = (*it)->checkHists(
false);
120 log << MSG::WARNING <<
"Can\'t call checkHists of tool." <<
endmsg;
127 return StatusCode::SUCCESS;
133 MsgStream log(msgSvc(), name());
135 log << MSG::INFO <<
"finalizing AthenaMon algorithm" <<
endmsg;
138 std::vector<IMonitorToolBase*>::iterator it =
m_monTools.begin();
141 log << MSG::INFO <<
"finalizing tool " <<
endmsg;
142 StatusCode
sc = (*it)->finalHists();
144 log << MSG::WARNING <<
"Can\'t finalize a tool." <<
endmsg;
152 log << MSG::INFO <<
"calling checkHists of tool " <<
endmsg;
153 StatusCode
sc = (*it)->checkHists(
true);
155 log << MSG::WARNING <<
"Can\'t call checkHists of tool." <<
endmsg;
160 return StatusCode::SUCCESS;
166 MsgStream log(msgSvc(), name());
167 log << MSG::INFO <<
"start()" <<
endmsg;
171 return StatusCode::SUCCESS;
173 std::vector<IMonitorToolBase*>::iterator it =
m_monTools.begin();
175 if((*it)->bookHists().isFailure())
176 log << MSG::WARNING <<
"Error Filling Histograms" <<
endmsg;
178 return StatusCode::SUCCESS;
184 MsgStream log(msgSvc(), name());
185 log << MSG::INFO <<
"stop()" <<
endmsg;
187 std::vector<IMonitorToolBase*>::iterator it =
m_monTools.begin();
189 if((*it)->runStat().isFailure())
190 log << MSG::WARNING <<
"Error calling runStat" <<
endmsg;
192 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode finalize()
AthenaMon(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< IMonitorToolBase * > m_monTools
virtual StatusCode initialize()
std::vector< std::string > m_THistSvc_streamnameMapping
virtual StatusCode execute()
virtual StatusCode stop()
std::vector< std::string > m_monToolNames
bool m_bookHistsinInitialize
virtual StatusCode start()