|
ATLAS Offline Software
|
Go to the documentation of this file.
19 #include "CoralBase/AttributeListException.h"
23 #include "CTPfragment/CTPfragment.h"
24 #include "CTPfragment/CTPExtraWordsFormat.h"
25 #include "CTPfragment/Issue.h"
34 const std::string &
name,
37 m_robDataProviderSvc(
"ROBDataProviderSvc",
name)
44 service(
"IOVSvc",
m_iovSvc,
false).ignore();
45 service(
"IOVDbSvc",
m_iovDbSvc,
false).ignore();
49 return StatusCode::SUCCESS;
56 return StatusCode::SUCCESS;
61 std::ostringstream pending;
64 if (
f.second.needsUpdate) pending <<
"[" <<
f.second.lumiBlock <<
"," <<
f.second.folderIndex <<
"]";
67 if (pending.str().empty()) pending <<
"NONE";
68 ATH_MSG_INFO(
"[LB,Folder] with pending COOL updates: " << pending.str());
70 return StatusCode::SUCCESS;
77 StatusCode TrigCOOLUpdateHelper::readFolderInfo()
79 if (
m_iovDbSvc==
nullptr)
return StatusCode::SUCCESS;
99 not
info.extensible) {
100 ATH_MSG_ERROR(
"IOVDBSvc folder " <<
info.folderName <<
" is not marked as </extensible>. "
101 "Remove it from the allowed 'Folders' property or mark it as extensible.");
102 return StatusCode::FAILURE;
112 for (
auto const& [
idx, attr] : *folderMapHandle) {
117 return StatusCode::SUCCESS;
122 if (
folders.empty())
return StatusCode::SUCCESS;
125 for (
const std::string&
f :
folders) {
127 sc = StatusCode::FAILURE;
142 return StatusCode::SUCCESS;
145 const CLID& clid =
f->second.clid;
146 const std::string&
key =
f->second.key;
151 if (
iov.start().isTimestamp() ||
iov.start().isBoth() ) {
153 return StatusCode::FAILURE;
159 return StatusCode::FAILURE;
163 ATH_MSG_INFO(
"Invalidated IOV and dropped payload of folder " <<
166 return StatusCode::SUCCESS;
178 return StatusCode::FAILURE;
187 ATH_MSG_DEBUG(
"Request to reload COOL folder ID " <<
idx <<
" for IOV change in lumiblock "
188 <<
f.lumiBlock <<
" but running without IOVSvc. Current event: " << ctx.eventID());
189 f.needsUpdate =
false;
199 <<
f.lumiBlock <<
". Current event: " << ctx.eventID());
203 return StatusCode::FAILURE;
206 f.needsUpdate =
false;
210 return StatusCode::SUCCESS;
217 <<
"' but this folder is not in the allowed list:" <<
m_folders);
218 return StatusCode::FAILURE;
227 return StatusCode::FAILURE;
230 return StatusCode::SUCCESS;
238 <<
". Existing folders are:");
242 return StatusCode::FAILURE;
246 return StatusCode::SUCCESS;
255 using CTPfragment::FolderIndex;
266 ATH_MSG_ERROR(
"Cannot retrieve CTP ROB 0x" << MSG::hex <<
m_ctpRobId.value() << MSG::dec <<
" due to exception: " << ex.what());
267 return StatusCode::FAILURE;
270 if ( ctpRobs.empty() ) {
272 return StatusCode::FAILURE;
276 std::vector<uint32_t> l1_extraPayload = CTPfragment::extraPayloadWords( ctpRobs[0] );
281 catch (CTPfragment::ExtraPayloadTooLong& ex) {
282 ATH_MSG_ERROR(
"Invalid CTP fragment. Exception = " << ex.what());
283 return StatusCode::FAILURE;
287 msg() <<
MSG::DEBUG <<
"CTP extra payload (" << l1_extraPayload.size() <<
" words): ";
288 for (std::size_t
i=0;
i<l1_extraPayload.size(); ++
i) {
289 msg() <<
" " << l1_extraPayload[
i];
291 std::ostringstream
out;
297 for (
const std::pair<const FolderIndex, FolderEntry>& kv : ctp_payload.getFolderUpdates()) {
300 std::map<FolderIndex, FolderUpdate>::const_iterator
f =
m_folderUpdates.find(kv.first);
306 ATH_MSG_DEBUG(
"Conditions update for folder " << kv.second.folderIndex
307 <<
" on lumiblock " << kv.second.lumiBlock);
310 return StatusCode::SUCCESS;
std::map< CTPfragment::FolderIndex, std::string > m_folderNames
Map to store the folder update index -> name mapping.
StatusCode resetFolders(const std::vector< std::string > &folders)
Reset list of COOL folders.
Validity Range object. Holds two IOVTimes (start and stop)
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
std::string find(const std::string &s)
return a remapped string
Validity Range object. Holds two IOVTime instances (start and stop)
Gaudi::Property< std::vector< std::string > > m_folders
Group of local monitoring quantities and retain correlation when filling histograms
std::map< std::string, FolderInfo > m_folderInfo
CLID/name mapping of COOL folders.
Abstract interface to IOVDbSvc to access IOVRange and tag information.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
virtual StatusCode initialize() override
ToolHandle< GenericMonitoringTool > m_monTool
StatusCode extractFolderUpdates(const EventContext &ctx)
Decode COOL folder updates according to extra payload in CTP fragment.
std::map< CTPfragment::FolderIndex, FolderUpdate > m_folderUpdates
Map to store scheduled/done COOL folder updates.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode getFolderName(CTPfragment::FolderIndex idx, std::string &folderName) const
Return folder name to index.
virtual bool getKeyInfo(const std::string &key, IIOVDbSvc::KeyInfo &info)=0
Return information about SG key return false if this key is not known to IOVDbSvc.
std::vector< const ROBF * > VROBFRAG
uint32_t CLID
The Class ID type.
TrigCOOLUpdateHelper(const std::string &type, const std::string &name, const IInterface *parent)
Struct to hold CLID <-> folder name mapping.
Gaudi::Property< uint32_t > m_ctpRobId
Helper tool for COOL updates.
Gaudi::Property< std::string > m_coolFolderName
Helpers for checking error return status codes and reporting errors.
virtual StatusCode getRange(const CLID &clid, const std::string &key, IOVRange &iov) const =0
virtual StatusCode start() override
StatusCode resetFolder(const std::string &folder)
Reset COOL folder.
#define ATH_MSG_WARNING(x)
virtual StatusCode dropObjectFromDB(const CLID &clid, const std::string &key, const std::string &storeName)=0
Drop the associated object from the db and trigger reload.
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
virtual StatusCode stop() override
StatusCode hltCoolUpdate(const EventContext &ctx)
Perform COOL udpates if needed.
virtual std::vector< std::string > getKeyList()=0
return list of SG keys being provided by IOVDbSvc
Filled by IIOVDbSvc::getKeyInfo.