ATLAS Offline Software
Loading...
Searching...
No Matches
TrigCOOLUpdateHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGSERVICES_TRIGCOOLUPDATEHELPER_H
6#define TRIGSERVICES_TRIGCOOLUPDATEHELPER_H
12
13// STL includes
14#include <map>
15#include <string>
16#include <vector>
17
18// Framework includes
19#include "GaudiKernel/ServiceHandle.h"
20#include "GaudiKernel/StatusCode.h"
21
26#include "GaudiKernel/EventIDBase.h"
28
29// TDAQ includes
30#include "CTPfragment/CTPExtraWordsFormat.h"
31
35struct FolderInfo {
36 CLID clid{CLID_NULL};
37 std::string key;
38};
39
45 explicit FolderUpdate(const CTPfragment::FolderEntry& entry) :
46 lumiBlock(entry.lumiBlock),
48 needsUpdate(true) {}
49
50 EventIDBase::number_type lumiBlock;
51 CTPfragment::FolderIndex folderIndex;
53};
54
59public:
60 TrigCOOLUpdateHelper(const std::string& type, const std::string& name, const IInterface* parent);
61
62 virtual StatusCode initialize() override;
63 virtual StatusCode start() override;
64 virtual StatusCode stop() override;
65
70 StatusCode hltCoolUpdate(const EventContext& ctx);
71
76 StatusCode hltCoolUpdate(const std::string& folder);
77
83 StatusCode getFolderName(CTPfragment::FolderIndex idx, std::string& folderName) const;
84
88 StatusCode extractFolderUpdates(const EventContext& ctx);
89
93 StatusCode readFolderInfo();
94
95private:
100 StatusCode resetFolder(const std::string& folder);
101
106 StatusCode resetFolders(const std::vector<std::string>& folders);
107
109 std::map<std::string, FolderInfo> m_folderInfo;
110
112 std::map<CTPfragment::FolderIndex, FolderUpdate> m_folderUpdates;
113
115 std::map<CTPfragment::FolderIndex, std::string> m_folderNames;
116
117 // Services and Tools
118 SmartIF<IIOVSvc> m_iovSvc;
119 SmartIF<IIOVDbSvc> m_iovDbSvc;
121
122 // Properties
123 ToolHandle<GenericMonitoringTool> m_monTool{this, "MonTool", {}, "Monitoring tool"};
124
125 Gaudi::Property<std::string> m_coolFolderName{
126 this, "CoolFolderMap", {}, "Name of COOL folder containing folder map"};
127
128 Gaudi::Property<std::vector<std::string>> m_folders{
129 this, "Folders", {}, "List of folders that can be updated during the run"};
130
131 Gaudi::Property<uint32_t> m_ctpRobId{
132 this, "CtpRobId", 0x770001, "ROB ID of CTP fragment containing the extra payload"};
133};
134
135#endif
uint32_t CLID
The Class ID type.
Abstract interface to IOVDbSvc to access IOVRange and tag information.
Header file to be included by clients of the Monitored infrastructure.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
TrigCOOLUpdateHelper(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode start() override
Gaudi::Property< std::vector< std::string > > m_folders
std::map< std::string, FolderInfo > m_folderInfo
CLID/name mapping of COOL folders.
virtual StatusCode stop() override
std::map< CTPfragment::FolderIndex, std::string > m_folderNames
Map to store the folder update index -> name mapping.
std::map< CTPfragment::FolderIndex, FolderUpdate > m_folderUpdates
Map to store scheduled/done COOL folder updates.
StatusCode resetFolder(const std::string &folder)
Reset COOL folder.
StatusCode hltCoolUpdate(const EventContext &ctx)
Perform COOL udpates if needed.
SmartIF< IIOVDbSvc > m_iovDbSvc
ToolHandle< GenericMonitoringTool > m_monTool
StatusCode readFolderInfo()
Read information about existing COOL folders.
StatusCode resetFolders(const std::vector< std::string > &folders)
Reset list of COOL folders.
Gaudi::Property< std::string > m_coolFolderName
virtual StatusCode initialize() override
Gaudi::Property< uint32_t > m_ctpRobId
StatusCode extractFolderUpdates(const EventContext &ctx)
Decode COOL folder updates according to extra payload in CTP fragment.
StatusCode getFolderName(CTPfragment::FolderIndex idx, std::string &folderName) const
Return folder name to index.
SmartIF< IIOVSvc > m_iovSvc
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
Struct to hold CLID <-> folder name mapping.
FolderUpdate(const CTPfragment::FolderEntry &entry)
EventIDBase::number_type lumiBlock
CTPfragment::FolderIndex folderIndex