21 #include "TDirectory.h"
27 using namespace Gaudi;
28 typedef const string&
CSTR;
30 #define S_OK StatusCode::SUCCESS
31 #define S_FAIL StatusCode::FAILURE
35 :
Service( nam, svc), m_incidentSvc(0)
64 return error(
"Failed to initialize Service base class.");
67 return error(
"Unable to localize interface from service:IncidentSvc");
74 return error(
"Performance monitoring file IOPerfStats was not defined.");
76 TDirectory::TContext ctxt(0);
78 return error(
"Could not create ROOT file.");
80 if (!(
m_perfTree =
new TTree(
"T",
"performance measurement")))
81 return error(
"Could not create tree.");
101 TMap *
map =
new TMap();
102 map->Add(
new TObjString(
"streams"),
new TObjString(
m_setStreams.c_str()));
103 map->Add(
new TObjString(
"basket_size"),
new TObjString(
m_basketSize.c_str()));
104 map->Add(
new TObjString(
"buffer_size"),
new TObjString(
m_bufferSize.c_str()));
105 map->Add(
new TObjString(
"split_level"),
new TObjString(
m_splitLevel.c_str()));
106 map->Write(
"params", TObject::kSingleKey);
122 std::string t = incident.
type();
128 if ( !t.compare(
"CONNECTED_OUTPUT") ) {
137 TMap *
map =
new TMap();
139 const char* fn = (*i).c_str();
140 Long_t id, siz, flags, tim;
141 if ( 0 == gSystem->GetPathInfo(fn,&
id,&siz,&flags,&tim) ) {
142 ::sprintf(text,
"%ld",siz);
143 map->Add(
new TObjString(fn),
new TObjString(text));
147 map->Write(
"Outputs", TObject::kSingleKey);
const std::string BeginEvent
Processing of a new event has started.
Definition of the MsgStream class used to transmit messages.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
const std::string & type() const
Access to the incident type.
const std::string & source() const
Access to the source of the incident.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual void handle(const Incident &incident)
IIncidentListener override: Inform that a new incident has occurred.
bool isSuccess() const
Test for a status code of SUCCESS.
virtual void record(EventType eventType)
MsgStream * m_log
Message streamer.
std::string m_ioPerfStats
Property: Enable TTree IOperfStats if not empty; otherwise perf stat file name.
virtual StatusCode stop()
Stop (from RUNNING to INITIALIZED).
struct GAUDI_API map
Parametrisation class for map-like implementation.
This class is used for returning status codes from appropriate routines.
IIncidentSvc * m_incidentSvc
Reference to incident service.
virtual const std::string & name() const
Retrieve name of the service.
MsgStream & log() const
Helper: Use message streamer.
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Base class for all Incidents (computing events).
virtual StatusCode initialize()
Service overload: initialize the service.
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
This is a number of static methods for bootstrapping the Gaudi framework.
std::set< std::string > m_outputs
Base class for all services.
virtual ~RootPerfMonSvc()
Standard destructor.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
virtual StatusCode finalize()
Service overload: Finalize the service.