ATLAS Offline Software
Loading...
Searching...
No Matches
TrigCOOLUpdateHelper.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 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
27#include "GaudiKernel/EventIDBase.h"
29
30// TDAQ includes
31#include "CTPfragment/CTPExtraWordsFormat.h"
32
36struct FolderInfo {
37 CLID clid{CLID_NULL};
38 std::string key;
39};
40
46 explicit FolderUpdate(const CTPfragment::FolderEntry& entry) :
47 lumiBlock(entry.lumiBlock),
49 needsUpdate(true) {}
50
51 EventIDBase::number_type lumiBlock;
52 CTPfragment::FolderIndex folderIndex;
54};
55
60public:
61 TrigCOOLUpdateHelper(const std::string& type, const std::string& name, const IInterface* parent);
62
63 virtual StatusCode initialize() override;
64 virtual StatusCode start() override;
65 virtual StatusCode stop() override;
66
71 StatusCode hltCoolUpdate(const EventContext& ctx);
72
77 StatusCode hltCoolUpdate(const std::string& folder);
78
84 StatusCode getFolderName(CTPfragment::FolderIndex idx, std::string& folderName) const;
85
89 StatusCode extractFolderUpdates(const EventContext& ctx);
90
94 StatusCode readFolderInfo ATLAS_NOT_THREAD_SAFE ();
95
96private:
101 StatusCode resetFolder(const std::string& folder);
102
107 StatusCode resetFolders(const std::vector<std::string>& folders);
108
110 std::map<std::string, FolderInfo> m_folderInfo;
111
113 std::map<CTPfragment::FolderIndex, FolderUpdate> m_folderUpdates;
114
116 std::map<CTPfragment::FolderIndex, std::string> m_folderNames;
117
118 // Services and Tools
119 SmartIF<IIOVSvc> m_iovSvc;
120 SmartIF<IIOVDbSvc> m_iovDbSvc;
122
123 // Properties
124 ToolHandle<GenericMonitoringTool> m_monTool{this, "MonTool", {}, "Monitoring tool"};
125
126 Gaudi::Property<std::string> m_coolFolderName{
127 this, "CoolFolderMap", {}, "Name of COOL folder containing folder map"};
128
129 Gaudi::Property<std::vector<std::string>> m_folders{
130 this, "Folders", {}, "List of folders that can be updated during the run"};
131
132 Gaudi::Property<uint32_t> m_ctpRobId{
133 this, "CtpRobId", 0x770001, "ROB ID of CTP fragment containing the extra payload"};
134};
135
136#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.
Define macros for attributes used to control the static checker.
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 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
StatusCode readFolderInfo ATLAS_NOT_THREAD_SAFE()
Read information about existing COOL folders.
Struct to hold CLID <-> folder name mapping.
FolderUpdate(const CTPfragment::FolderEntry &entry)
EventIDBase::number_type lumiBlock
CTPfragment::FolderIndex folderIndex