The Gaudi Framework
master (53dee381)
Toggle main menu visibility
Loading...
Searching...
No Matches
RootPerfMonSvc.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
//====================================================================
12
// RootPerfMonSvc definition
13
//--------------------------------------------------------------------
14
//
15
// Author : M.Frank
16
//====================================================================
17
#pragma once
18
19
#include <memory>
20
// Framework include files
21
#include <
GaudiKernel/IIncidentListener.h
>
22
#include <
GaudiKernel/IIncidentSvc.h
>
23
#include <
GaudiKernel/Service.h
>
24
25
#include <TFile.h>
26
#include <TTree.h>
27
28
#include <
RootCnv/SysProcStat.h
>
29
30
// C/C++ include files
31
#include <set>
32
33
/*
34
* Gaudi namespace declaration
35
*/
36
namespace
Gaudi
{
37
48
class
GAUDI_API
RootPerfMonSvc
:
public
extends
<Service, IIncidentListener> {
49
protected
:
50
Gaudi::Property<std::string>
m_ioPerfStats
{
51
this
,
"IOPerfStats"
,
""
,
"Enable TTree IOperfStats if not empty; otherwise perf stat file name"
};
52
// Passed parameters
53
Gaudi::Property<std::string>
m_setStreams
{
this
,
"Streams"
,
""
,
""
};
54
Gaudi::Property<std::string>
m_basketSize
{
this
,
"BasketSize"
,
""
,
""
};
55
Gaudi::Property<std::string>
m_bufferSize
{
this
,
"BufferSize"
,
""
,
""
};
56
Gaudi::Property<std::string>
m_splitLevel
{
this
,
"SplitLevel"
,
""
,
""
};
57
59
SmartIF<IIncidentSvc>
m_incidentSvc
;
61
std::unique_ptr<MsgStream>
m_log
;
62
// Reference to a tree with statistics
63
TTree*
m_perfTree
;
64
// Reference to a file where statistics are persisted
65
std::unique_ptr<TFile>
m_perfFile
;
66
// Reference to all connected output files
67
std::set<std::string>
m_outputs
;
68
// The newest observed values
69
Int_t
m_eventType
;
70
ULong_t
m_utime
,
m_stime
,
m_vsize
;
71
Long_t
m_eventNumber
,
m_rss
,
m_time
;
72
73
// Types of records
74
enum
EventType
{
EVENT
= 1,
FSR
= 2 };
75
76
// Adding newest observed values to the tree with statistics
77
virtual
void
record( EventType eventType );
78
80
MsgStream
&
log
()
const
{
return
*
m_log
; }
81
82
public
:
84
using
extends::extends;
85
91
StatusCode
error(
const
std::string& msg );
92
94
StatusCode
initialize()
override
;
95
97
StatusCode
finalize()
override
;
98
100
void
handle(
const
Incident
& incident )
override
;
101
102
// Service overload: Stop the service
103
StatusCode
stop()
override
;
104
};
105
}
// namespace Gaudi
IIncidentListener.h
IIncidentSvc.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
Service.h
SysProcStat.h
Gaudi::Property
Implementation of property with value of concrete type.
Definition
Property.h:35
Gaudi::RootPerfMonSvc
Description:
Definition
RootPerfMonSvc.h:48
Gaudi::RootPerfMonSvc::m_setStreams
Gaudi::Property< std::string > m_setStreams
Definition
RootPerfMonSvc.h:53
Gaudi::RootPerfMonSvc::m_rss
Long_t m_rss
Definition
RootPerfMonSvc.h:71
Gaudi::RootPerfMonSvc::log
MsgStream & log() const
Helper: Use message streamer.
Definition
RootPerfMonSvc.h:80
Gaudi::RootPerfMonSvc::m_outputs
std::set< std::string > m_outputs
Definition
RootPerfMonSvc.h:67
Gaudi::RootPerfMonSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Definition
RootPerfMonSvc.h:59
Gaudi::RootPerfMonSvc::m_time
Long_t m_time
Definition
RootPerfMonSvc.h:71
Gaudi::RootPerfMonSvc::m_utime
ULong_t m_utime
Definition
RootPerfMonSvc.h:70
Gaudi::RootPerfMonSvc::m_eventType
Int_t m_eventType
Definition
RootPerfMonSvc.h:69
Gaudi::RootPerfMonSvc::m_splitLevel
Gaudi::Property< std::string > m_splitLevel
Definition
RootPerfMonSvc.h:56
Gaudi::RootPerfMonSvc::m_eventNumber
Long_t m_eventNumber
Definition
RootPerfMonSvc.h:71
Gaudi::RootPerfMonSvc::m_ioPerfStats
Gaudi::Property< std::string > m_ioPerfStats
Definition
RootPerfMonSvc.h:50
Gaudi::RootPerfMonSvc::m_basketSize
Gaudi::Property< std::string > m_basketSize
Definition
RootPerfMonSvc.h:54
Gaudi::RootPerfMonSvc::m_vsize
ULong_t m_vsize
Definition
RootPerfMonSvc.h:70
Gaudi::RootPerfMonSvc::m_perfFile
std::unique_ptr< TFile > m_perfFile
Definition
RootPerfMonSvc.h:65
Gaudi::RootPerfMonSvc::m_bufferSize
Gaudi::Property< std::string > m_bufferSize
Definition
RootPerfMonSvc.h:55
Gaudi::RootPerfMonSvc::m_perfTree
TTree * m_perfTree
Definition
RootPerfMonSvc.h:63
Gaudi::RootPerfMonSvc::EventType
EventType
Definition
RootPerfMonSvc.h:74
Gaudi::RootPerfMonSvc::EVENT
@ EVENT
Definition
RootPerfMonSvc.h:74
Gaudi::RootPerfMonSvc::FSR
@ FSR
Definition
RootPerfMonSvc.h:74
Gaudi::RootPerfMonSvc::m_stime
ULong_t m_stime
Definition
RootPerfMonSvc.h:70
Gaudi::RootPerfMonSvc::m_log
std::unique_ptr< MsgStream > m_log
Message streamer.
Definition
RootPerfMonSvc.h:61
Incident
Base class for all Incidents (computing events).
Definition
Incident.h:24
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition
MsgStream.h:29
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition
SmartIF.h:28
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
extends
Base class used to extend a class implementing other interfaces.
Definition
extends.h:19
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
RootCnv
include
RootCnv
RootPerfMonSvc.h
Generated on
for The Gaudi Framework by
1.17.0