31#include <TDirectory.h>
33#include <TObjString.h>
40#define S_OK StatusCode::SUCCESS
41#define S_FAIL StatusCode::FAILURE
58 if ( !status.
isSuccess() )
return error(
"Failed to initialize Service base class." );
61 if ( !
m_incidentSvc )
return error(
"Unable to localize interface from service:IncidentSvc" );
63 m_incidentSvc->addListener(
this, IncidentType::BeginEvent, 1,
false,
false );
64 m_incidentSvc->addListener(
this,
"NEW_STREAM", 1,
false,
false );
65 m_incidentSvc->addListener(
this,
"CONNECTED_OUTPUT", 1,
false,
false );
67 if (
m_ioPerfStats.empty() )
return error(
"Performance monitoring file IOPerfStats was not defined." );
69 TDirectory::TContext ctxt(
nullptr );
73 if ( !(
m_perfTree =
new TTree(
"T",
"performance measurement" ) ) )
return error(
"Could not create tree." );
89 auto map =
new TMap();
90 map->Add(
new TObjString(
"streams" ),
new TObjString(
m_setStreams.value().c_str() ) );
91 map->Add(
new TObjString(
"basket_size" ),
new TObjString(
m_basketSize.value().c_str() ) );
92 map->Add(
new TObjString(
"buffer_size" ),
new TObjString(
m_bufferSize.value().c_str() ) );
93 map->Add(
new TObjString(
"split_level" ),
new TObjString(
m_splitLevel.value().c_str() ) );
94 map->Write(
"params", TObject::kSingleKey );
110 std::string t = incident.
type();
111 if ( !t.compare( IncidentType::BeginEvent ) ) {
116 if ( !t.compare(
"CONNECTED_OUTPUT" ) ) {
m_outputs.insert( incident.
source() ); }
123 auto map =
new TMap();
125 const char* fn = i.c_str();
126 Long_t id, siz, flags, tim;
127 if ( 0 == gSystem->GetPathInfo( fn, &
id, &siz, &flags, &tim ) ) {
128 ::sprintf( text,
"%ld", siz );
129 map->Add(
new TObjString( fn ),
new TObjString( text ) );
132 TDirectory::TContext ctxt(
m_perfFile.get() );
133 map->Write(
"Outputs", TObject::kSingleKey );
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
StatusCode stop() override
Gaudi::Property< std::string > m_setStreams
StatusCode finalize() override
Service overload: Finalize the service.
MsgStream & log() const
Helper: Use message streamer.
std::set< std::string > m_outputs
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
void handle(const Incident &incident) override
IIncidentListener override: Inform that a new incident has occurred.
virtual void record(EventType eventType)
Gaudi::Property< std::string > m_splitLevel
Gaudi::Property< std::string > m_ioPerfStats
Gaudi::Property< std::string > m_basketSize
std::unique_ptr< TFile > m_perfFile
StatusCode initialize() override
Service overload: initialize the service.
Gaudi::Property< std::string > m_bufferSize
StatusCode error(const std::string &msg)
Standard way to print errors.
std::unique_ptr< MsgStream > m_log
Message streamer.
Base class for all Incidents (computing events).
const std::string & type() const
Access to the incident type.
const std::string & source() const
Access to the source of the incident.
Definition of the MsgStream class used to transmit messages.
StatusCode finalize() override
const std::string & name() const override
Retrieve name of the service.
SmartIF< IFace > service(const std::string &name, bool createIf=true) const
StatusCode initialize() override
This class is used for returning status codes from appropriate routines.
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...