7#include "GaudiKernel/Kernel.h"
8#include "GaudiKernel/IInterface.h"
9#include "GaudiKernel/StatusCode.h"
11#include "GaudiKernel/SvcFactory.h"
12#include "GaudiKernel/MsgStream.h"
20 std::vector < BesTimer* >::iterator it = m_itemList.begin();
21 for (; it != m_itemList.end(); it++) {
36 MsgStream log(messageService(), name());
37 log << MSG::INFO << name() <<
": Start of run initialisation" << endreq;
39 StatusCode sc = Service::initialize();
40 if ( sc.isFailure() )
return sc;
44 return StatusCode::SUCCESS;
49 MsgStream log(messageService(), name());
50 log << MSG::INFO << name() <<
": End of Run Statistics" << endreq;
52 return StatusCode::SUCCESS;
63 MsgStream log(messageService(), name());
64 log << MSG::DEBUG << name() <<
" adding " << itemName << endreq;
67 m_itemList.push_back(item);
72 MsgStream log(messageService(), name());
74 log << MSG::INFO <<
"==============================BesTimerSvc::Print===============================" << endreq;
75 unsigned int maxname=0;
76 std::vector < BesTimer* >::iterator it = m_itemList.begin();
77 for (; it != m_itemList.end(); it++) {
78 if ((*it)->name().length() > maxname) maxname =
static_cast<int>((*it)->name().length());
79 if (!(*it)->propName().empty()) {
80 if ((*it)->propName().length() > maxname) maxname =
static_cast<int>((*it)->propName().length());
84 it = m_itemList.begin();
85 for (; it != m_itemList.end(); it++) {
86 std::string nam = (*it)->name();
87 for (
unsigned int i =
static_cast<int>(nam.length()); i<maxname; i++) nam.insert(i,
" ");
88 log << MSG::INFO << nam <<
" mean(t) : " << std::setw(12) << (*it)->mean()<<
89 " ms rms : " << std::setw(12) << (*it)->rms() <<
" ms " << endreq;
91 log << MSG::INFO <<
"------------------------------------------------------------------------------" << endreq;
92 it = m_itemList.begin();
93 for (; it != m_itemList.end(); it++) {
94 if (!(*it)->propName().empty()) {
95 std::string nam = (*it)->name();
96 for (
unsigned int i =
static_cast<int>(nam.length()); i<maxname; i++) nam.insert(i,
" ");
97 log << MSG::INFO << nam <<
" mean(t) : " << std::setw(12) << (*it)->mean()<<
98 " ms rms : " << std::setw(12) << (*it)->rms() <<
" ms " << endreq;
100 nam = (*it)->propName();
101 for (
unsigned int i =
static_cast<int>(nam.length()); i<maxname; i++) nam.insert(i,
" ");
102 if ((*it)->meanPropVal() == 0) {
103 log << MSG::INFO << nam <<
" mean(N) : " << std::setw(12) << endreq;
105 log << MSG::INFO << nam <<
" mean(N) : " << std::setw(12) << (*it)->meanPropVal() <<
107 << 1000.*(*it)->meanTimePerObject() <<
" us " << endreq;
112 log << MSG::INFO <<
"==============================BesTimerSvc::Print===============================" << endreq;
116 return m_itemList.begin();
119 return m_itemList.end();
virtual std::vector< BesTimer * >::iterator begin(void)
virtual BesTimer * addItem(const std::string &name)
virtual StatusCode initialize()
virtual StatusCode finalize()
virtual std::vector< BesTimer * >::iterator end(void)