The Gaudi Framework  master (ff829712)
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
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 */
36namespace Gaudi {
37
48 class GAUDI_API RootPerfMonSvc : public extends<Service, IIncidentListener> {
49 protected:
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
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
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
#define GAUDI_API
Definition Kernel.h:49
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
Gaudi::Property< std::string > m_setStreams
MsgStream & log() const
Helper: Use message streamer.
std::set< std::string > m_outputs
SmartIF< IIncidentSvc > m_incidentSvc
Reference to incident service.
Gaudi::Property< std::string > m_splitLevel
Gaudi::Property< std::string > m_ioPerfStats
Gaudi::Property< std::string > m_basketSize
std::unique_ptr< TFile > m_perfFile
Gaudi::Property< std::string > m_bufferSize
std::unique_ptr< MsgStream > m_log
Message streamer.
Base class for all Incidents (computing events).
Definition Incident.h:24
Definition of the MsgStream class used to transmit messages.
Definition MsgStream.h:29
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
Base class used to extend a class implementing other interfaces.
Definition extends.h:19
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1