ATLAS Offline Software
Loading...
Searching...
No Matches
TrigOpMonitor.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGONLINEMONITOR_TRIGOPMONITOR_H
6#define TRIGONLINEMONITOR_TRIGOPMONITOR_H
7
14
18#include "GaudiKernel/EventIDBase.h"
19#include "GaudiKernel/ITHistSvc.h"
20#include "GaudiKernel/ServiceHandle.h"
21#include "GaudiKernel/ToolHandle.h"
25
26#include "TH1I.h"
27#include "TH2I.h"
28#include "TProfile.h"
29
30#include <unordered_map>
31#include <string>
32#include <vector>
33
34// Forward declarations
35class IIncidentSvc;
36
37class TrigOpMonitor : public extends<AthAlgorithm, IIncidentListener> {
38public:
39 TrigOpMonitor(const std::string& name, ISvcLocator* pSvcLocator);
40
41 virtual StatusCode initialize() override;
42 virtual StatusCode start() override;
43 virtual StatusCode execute() override;
44 virtual void handle( const Incident& incident ) override;
45
46 /* Ensure this algorithm is a singleton.
47 This should not cause any bottle-necks as the algorithm does very
48 minimal work. */
49 virtual unsigned int cardinality() const override { return 1; }
50
51private:
52 void fillMagFieldHist();
54 void fillProcThreadHist(int workerID);
55 void fillSubDetHist();
56 void fillIOVDbHist();
57 void fillIOVDbChangeHist(const EventContext& ctx);
58 void fillLumiHist(const EventContext& ctx);
59
60 StatusCode bookHists();
61
63 struct FolderHist {
64 TH1F* h_time{nullptr};
65 TH1F* h_bytes{nullptr};
66 float total_time{0};
67 float total_bytes{0};
68 };
69
70 ServiceHandle<IIncidentSvc> m_incidentSvc{ this, "IncidentSvc", "IncidentSvc", "Incident service"};
71 ServiceHandle<ITHistSvc> m_histSvc{this, "THistSvc", "THistSvc"};
72
73 SmartIF<IIOVDbSvc> m_IOVDbSvc;
74
75 TH2I* m_magFieldHist{nullptr};
76 TH2I* m_iovChangeHist{nullptr};
77 TH1I* m_releaseHist{nullptr};
78 TH2I* m_mtConfigHist{nullptr};
79 TH1I* m_workersHist{nullptr};
80 TH2I* m_subdetHist{nullptr};
81 TProfile* m_lumiHist{nullptr};
82 TProfile* m_muHist{nullptr};
83
84 EventIDBase::number_type m_previousLB{0};
85 std::unordered_map<std::string, IOVRange> m_currentIOVs;
86 std::unordered_map<std::string, FolderHist> m_folderHist;
87 std::string m_histPath;
88
89 /* Properties */
90 SG::ReadCondHandleKey<LuminosityCondData> m_lumiDataKey{this, "LuminosityCondDataKey", ""};
91 SG::ReadCondHandleKey<AtlasFieldMapCondObj> m_fieldMapKey {this, "AtlasFieldMapCondDataKey", ""};
92
93 Gaudi::Property<std::string> m_releaseData{
94 this, "ReleaseDataFile", "../ReleaseData",
95 "Path to ReleaseData file (relative to LD_LIBRARY_PATH entries"};
96
97 Gaudi::Property<bool> m_detailedHists{this, "DetailedFolderHists", true,
98 "Detailed histograms for COOL folder updates during run"};
99
100 Gaudi::Property<unsigned short int> m_maxLB{this, "MaxLumiblocks", 3000,
101 "Number of lumiblocks for histograms"};
102};
103
104#endif // TRIGSTEERMONITOR_TRIGOPMONI_H
Abstract interface to IOVDbSvc to access IOVRange and tag information.
Validity Range object.
Hold luminosity data produced by LuminosityCondAlg.
void fillProcThreadHist(int workerID)
virtual unsigned int cardinality() const override
TH1I * m_releaseHist
std::string m_histPath
histogram booking path
std::unordered_map< std::string, IOVRange > m_currentIOVs
current IOVs managed by IOVDbSvc
ServiceHandle< ITHistSvc > m_histSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
virtual StatusCode initialize() override
void fillReleaseDataHist()
virtual StatusCode execute() override
TrigOpMonitor(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< bool > m_detailedHists
TH2I * m_magFieldHist
TProfile * m_lumiHist
virtual StatusCode start() override
TProfile * m_muHist
void fillIOVDbChangeHist(const EventContext &ctx)
Gaudi::Property< unsigned short int > m_maxLB
Gaudi::Property< std::string > m_releaseData
SG::ReadCondHandleKey< AtlasFieldMapCondObj > m_fieldMapKey
virtual void handle(const Incident &incident) override
std::unordered_map< std::string, FolderHist > m_folderHist
histograms for COOL folders
SG::ReadCondHandleKey< LuminosityCondData > m_lumiDataKey
void fillLumiHist(const EventContext &ctx)
EventIDBase::number_type m_previousLB
LB of previous event.
StatusCode bookHists()
SmartIF< IIOVDbSvc > m_IOVDbSvc
TH2I * m_subdetHist
TH2I * m_iovChangeHist
TH2I * m_mtConfigHist
TH1I * m_workersHist
Histograms for COOL folders.