|
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include "CoralBase/AttributeListException.h"
21 #include "CTPfragment/CTPfragment.h"
22 #include "CTPfragment/CTPExtraWordsFormat.h"
23 #include "CTPfragment/Issue.h"
32 const std::string &
name,
35 m_robDataProviderSvc(
"ROBDataProviderSvc",
name)
47 return StatusCode::SUCCESS;
54 return StatusCode::SUCCESS;
59 std::ostringstream pending;
62 if (
f.second.needsUpdate) pending <<
"[" <<
f.second.lumiBlock <<
"," <<
f.second.folderIndex <<
"]";
65 if (pending.str().empty()) pending <<
"NONE";
66 ATH_MSG_INFO(
"[LB,Folder] with pending COOL updates: " << pending.str());
68 return StatusCode::SUCCESS;
75 StatusCode TrigCOOLUpdateHelper::readFolderInfo()
97 not
info.extensible) {
98 ATH_MSG_ERROR(
"IOVDBSvc folder " <<
info.folderName <<
" is not marked as </extensible>. "
99 "Remove it from the allowed 'Folders' property or mark it as extensible.");
100 return StatusCode::FAILURE;
110 for (
auto const& [
idx, attr] : *folderMapHandle) {
115 return StatusCode::SUCCESS;
120 if (
folders.empty())
return StatusCode::SUCCESS;
123 for (
const std::string&
f :
folders) {
125 sc = StatusCode::FAILURE;
140 return StatusCode::SUCCESS;
143 const CLID& clid =
f->second.clid;
144 const std::string&
key =
f->second.key;
149 if (
iov.start().isTimestamp() ||
iov.start().isBoth() ) {
151 return StatusCode::FAILURE;
155 if (
m_iovSvc->dropObjectFromDB(clid,
key,
"StoreGateSvc").isFailure() ) {
157 return StatusCode::FAILURE;
161 ATH_MSG_INFO(
"Invalidated IOV and dropped payload of folder " <<
164 return StatusCode::SUCCESS;
176 return StatusCode::FAILURE;
185 ATH_MSG_DEBUG(
"Request to reload COOL folder ID " <<
idx <<
" for IOV change in lumiblock "
186 <<
f.lumiBlock <<
" but running without IOVSvc. Current event: " << ctx.eventID());
187 f.needsUpdate =
false;
197 <<
f.lumiBlock <<
". Current event: " << ctx.eventID());
201 return StatusCode::FAILURE;
204 f.needsUpdate =
false;
208 return StatusCode::SUCCESS;
215 <<
"' but this folder is not in the allowed list:" <<
m_folders);
216 return StatusCode::FAILURE;
225 return StatusCode::FAILURE;
228 return StatusCode::SUCCESS;
236 <<
". Existing folders are:");
240 return StatusCode::FAILURE;
244 return StatusCode::SUCCESS;
253 using CTPfragment::FolderIndex;
264 ATH_MSG_ERROR(
"Cannot retrieve CTP ROB 0x" << MSG::hex <<
m_ctpRobId.value() << MSG::dec <<
" due to exception: " << ex.what());
265 return StatusCode::FAILURE;
268 if ( ctpRobs.empty() ) {
270 return StatusCode::FAILURE;
274 std::vector<uint32_t> l1_extraPayload = CTPfragment::extraPayloadWords( ctpRobs[0] );
279 catch (CTPfragment::ExtraPayloadTooLong& ex) {
280 ATH_MSG_ERROR(
"Invalid CTP fragment. Exception = " << ex.what());
281 return StatusCode::FAILURE;
285 msg() <<
MSG::DEBUG <<
"CTP extra payload (" << l1_extraPayload.size() <<
" words): ";
286 for (std::size_t
i=0;
i<l1_extraPayload.size(); ++
i) {
287 msg() <<
" " << l1_extraPayload[
i];
289 std::ostringstream
out;
295 for (
const std::pair<const FolderIndex, FolderEntry>& kv : ctp_payload.getFolderUpdates()) {
298 std::map<FolderIndex, FolderUpdate>::const_iterator
f =
m_folderUpdates.find(kv.first);
304 ATH_MSG_DEBUG(
"Conditions update for folder " << kv.second.folderIndex
305 <<
" on lumiblock " << kv.second.lumiBlock);
308 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.
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
SmartIF< IIOVSvc > m_iovSvc
StatusCode extractFolderUpdates(const EventContext &ctx)
Decode COOL folder updates according to extra payload in CTP fragment.
SmartIF< IIOVDbSvc > m_iovDbSvc
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.
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 start() override
StatusCode resetFolder(const std::string &folder)
Reset COOL folder.
#define ATH_MSG_WARNING(x)
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
virtual StatusCode stop() override
StatusCode hltCoolUpdate(const EventContext &ctx)
Perform COOL udpates if needed.
Filled by IIOVDbSvc::getKeyInfo.