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;
99 MsgStream log(msgSvc(), name());
101 log << MSG::DEBUG <<
"executing AthenaMon algorithm" <<
endmsg;
104 std::vector<IMonitorToolBase*>::iterator it =
m_monTools.begin();
107 if((*it)->preSelector())
108 if((*it)->fillHists(ctx).isFailure()) {
109 log << MSG::WARNING <<
"Error Filling Histograms" <<
endmsg;
118 log << MSG::INFO <<
"calling checkHists of tool " <<
endmsg;
119 StatusCode
sc = (*it)->checkHists(
false);
121 log << MSG::WARNING <<
"Can\'t call checkHists of tool." <<
endmsg;
128 return StatusCode::SUCCESS;
134 MsgStream log(msgSvc(), name());
136 log << MSG::INFO <<
"finalizing AthenaMon algorithm" <<
endmsg;
139 std::vector<IMonitorToolBase*>::iterator it =
m_monTools.begin();
142 log << MSG::INFO <<
"finalizing tool " <<
endmsg;
143 StatusCode
sc = (*it)->finalHists();
145 log << MSG::WARNING <<
"Can\'t finalize a tool." <<
endmsg;
153 log << MSG::INFO <<
"calling checkHists of tool " <<
endmsg;
154 StatusCode
sc = (*it)->checkHists(
true);
156 log << MSG::WARNING <<
"Can\'t call checkHists of tool." <<
endmsg;
161 return StatusCode::SUCCESS;
167 MsgStream log(msgSvc(), name());
168 log << MSG::INFO <<
"start()" <<
endmsg;
172 return StatusCode::SUCCESS;
174 std::vector<IMonitorToolBase*>::iterator it =
m_monTools.begin();
176 if((*it)->bookHists().isFailure())
177 log << MSG::WARNING <<
"Error Filling Histograms" <<
endmsg;
179 return StatusCode::SUCCESS;
185 MsgStream log(msgSvc(), name());
186 log << MSG::INFO <<
"stop()" <<
endmsg;
188 std::vector<IMonitorToolBase*>::iterator it =
m_monTools.begin();
190 if((*it)->runStat().isFailure())
191 log << MSG::WARNING <<
"Error calling runStat" <<
endmsg;
193 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 stop()
std::vector< std::string > m_monToolNames
bool m_bookHistsinInitialize
virtual StatusCode execute(const EventContext &ctx)
Execute method.
virtual StatusCode start()