ATLAS Offline Software
Loading...
Searching...
No Matches
IOVDbCrestTag Class Reference

#include <IOVDbCrestTag.h>

Inheritance diagram for IOVDbCrestTag:
Collaboration diagram for IOVDbCrestTag:

Classes

struct  Resident

Public Types

enum class  source_t { COOLDB =0 , CRESTDB }

Public Member Functions

 IOVDbCrestTag (IOVDbConn *conn, const IOVDbParser &folderprop, MsgStream &msg, IClassIDSvc *clidsvc, IIOVDbMetaDataTool *metadatatool, chai::Database &db, const std::string &crestTagName)
 ~IOVDbCrestTag ()
const std::string & key () const override
const source_t & source () const override
IOVDbConn * conn () override
bool multiVersion () const override
bool timeStamp () const override
bool tagOverride () const override
bool retrieved () const override
bool noOverride () const override
IOVDbNamespace::FolderType folderType () const override
bool readMeta () const override
bool writeMeta () const override
bool fromMetaDataOnly () const override
bool extensible () const override
bool dropped () const override
bool iovOverridden () const override
const std::string & joTag () const override
const std::string & resolvedTag () const override
const std::string & eventStore () const override
CLID clid () const override
unsigned long long bytesRead () const override
float readTime () const override
const IOVRange & currentRange () const override
void useFileMetaData () override
void setFolderDescription (const std::string &description) override
void setTagOverride (const std::string &tag, const bool setFlag) override
void setWriteMeta () override
void setIOVOverride (const unsigned int run, const unsigned int lumiblock, const unsigned int time) override
void setDropped (const bool dropped) override
cool::ValidityKey iovTime (const IOVTime &reftime) const override
bool isResident (const cool::ValidityKey reftime) const override
bool loadAt (const cool::ValidityKey vkey) override
void reset () override
bool getAddress (const cool::ValidityKey reftime, IAddressCreator *persSvc, const unsigned int poolSvcContext, std::unique_ptr< IOpaqueAddress > &address, IOVRange &range, bool &poolPayloadRequested) override
void summary () override
std::unique_ptr< SG::TransientAddress > preload (ITagInfoMgr *tagInfoMgr, const unsigned int cacheRun, const unsigned int cacheTime) override
std::string dumpChannelsAsJson (cool::ValidityKey reftime) const
void printState () override
bool loadCacheIfDbChanged (const cool::ValidityKey vkey, const cool::IDatabasePtr &dbPtr, const ServiceHandle< IIOVSvc > &iovSvc) override
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.
const std::string & folderName () const

Protected Attributes

std::string m_foldername
 Folder name, as it appears in COOL or as a CREST tag label.
std::string m_key
 SG key where data is loaded (unique).

Private Member Functions

IOVDbNamespace::FolderType determineFolderType () const
std::unique_ptr< SG::TransientAddress > createTransientAddress (const std::vector< std::string > &symlinks)
bool addMetaAttrList (const coral::AttributeList &atrlist, const IOVRange &range)
bool addMetaAttrListColl (const CondAttrListCollection *coll)
bool channelInSelection (cool::ChannelId chan) const
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

IClassIDSvc * p_clidSvc {nullptr}
IIOVDbMetaDataTool * p_metaDataTool {nullptr}
IOVDbConn * m_conn {nullptr}
 Unused for CREST I/O; kept for per-connection usage counting.
chai::Database * m_db {nullptr}
 Non-owning pointer to the shared chai::Database.
chai::TagPtr m_tag
 Resolved in preload(). Stays null for a metadata-only folder.
std::string m_folderDescription
bool m_timestamp {false}
 Indexed by timestamp (else runLB), from <timeStamp>.
bool m_tagoverride {false}
 Unused on the CREST path. Present to satisfy IOVDbConditionsSource.
bool m_notagoverride {false}
 Unused on the CREST path. Present to satisfy IOVDbConditionsSource.
bool m_writemeta {false}
bool m_useFileMetaData {false}
bool m_fromMetaDataOnly {false}
bool m_extensible {false}
bool m_named {false}
bool m_iovoverridden {false}
bool m_jokey {false}
bool m_dropped {false}
cool::ValidityKey m_iovoverride {0}
IOVDbNamespace::FolderType m_foldertype {IOVDbNamespace::UNKNOWN}
std::string m_jotag
 Explicit <tag>/<ctag> from job options. Used only for /TagInfo.
std::string m_resolvedTagName
 The CREST tag name actually used for lookup.
std::string m_eventstore
std::string m_addrheader
std::string m_typename
CLID m_clid {0}
unsigned int m_ncacheread {0}
unsigned int m_ndbread {0}
unsigned int m_nobjread {0}
unsigned long long m_nbytesread {0}
float m_readtime {0}
unsigned int m_nchan {0}
std::vector< cool::ChannelId > m_channums
std::vector< std::string > m_channames
std::vector< std::pair< cool::ChannelId, cool::ChannelId > > m_chanrange
bool m_retrieved {false}
IOVRange m_currange
coral::AttributeListSpecification * m_cachespec {nullptr}
std::optional< Resident > m_resident
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels).
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging).

Detailed Description

Definition at line 51 of file IOVDbCrestTag.h.

Member Enumeration Documentation

◆ source_t

enum class IOVDbConditionsSource::source_t
stronginherited
Enumerator
COOLDB 
CRESTDB 

Definition at line 36 of file IOVDbConditionsSource.h.

36 {
37 COOLDB=0,
38 CRESTDB,
39 };

Constructor & Destructor Documentation

◆ IOVDbCrestTag()

IOVDbCrestTag::IOVDbCrestTag ( IOVDbConn * conn,
const IOVDbParser & folderprop,
MsgStream & msg,
IClassIDSvc * clidsvc,
IIOVDbMetaDataTool * metadatatool,
chai::Database & db,
const std::string & crestTagName )

Definition at line 43 of file IOVDbCrestTag.cxx.

45 :
46 AthMessaging("IOVDbCrestTag"),
47 p_clidSvc(clidsvc),
48 p_metaDataTool(metadatatool),
49 m_conn(conn),
50 m_db(&db),
51 m_resolvedTagName(crestTagName)
52{
53 setLevel(msg.level());
54 m_foldername = folderprop.folderName();
55 m_key = folderprop.key();
56 m_jokey = folderprop.hasKey();
57 m_eventstore = folderprop.eventStoreName();
58 m_notagoverride = folderprop.noTagOverride();
59 ATH_MSG_DEBUG("Created CREST folder " << m_foldername << " tag " << m_resolvedTagName);
60 if (m_notagoverride) {
61 ATH_MSG_INFO("Inputfile tag override disabled for " << m_foldername);
62 }
63
64 // <tag> is not used to resolve the CREST tag but is still recorded into
65 // m_jotag for fillTagInfo(). <ctag> is the fallback when there is no <tag>.
66 if (!folderprop.tag().empty()) {
67 ATH_MSG_INFO("<tag> is ignored on the CREST path for folder " << m_foldername
68 << ". Use <ctag> to override the CREST tag name instead");
70 } else {
71 std::string ctag;
72 if (folderprop.getKey("ctag","",ctag) && !ctag.empty()) {
74 }
75 }
76
77 // No CHAI equivalent of COOL's server-side channelSelection. Parsed here
78 // and applied client-side by channelInSelection().
79 std::string chanspec;
80 if (folderprop.getKey("channelSelection","",chanspec) && !chanspec.empty()) {
82 }
83
84 if (folderprop.overridesIov(msg)) {
85 m_iovoverridden = true;
87 }
88
91 ATH_MSG_INFO("Read from meta data only for folder " << m_foldername);
92 }
93
94 m_extensible = folderprop.extensible();
95 if (m_extensible) {
96 ATH_MSG_INFO("Extensible folder " << m_foldername);
97 }
98}
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_INFO(x,...)
void setLevel(MSG::Level lvl)
Change the current logging level.
AthMessaging()
Default constructor:
MsgStream & msg() const
The standard message stream.
std::string m_foldername
Folder name, as it appears in COOL or as a CREST tag label.
std::string m_key
SG key where data is loaded (unique).
std::string m_eventstore
IOVDbConn * m_conn
Unused for CREST I/O; kept for per-connection usage counting.
IIOVDbMetaDataTool * p_metaDataTool
cool::ValidityKey m_iovoverride
bool m_notagoverride
Unused on the CREST path. Present to satisfy IOVDbConditionsSource.
IOVDbConn * conn() override
IClassIDSvc * p_clidSvc
chai::Database * m_db
Non-owning pointer to the shared chai::Database.
std::vector< std::pair< cool::ChannelId, cool::ChannelId > > m_chanrange
std::string m_jotag
Explicit <tag>/<ctag> from job options. Used only for /TagInfo.
std::string m_resolvedTagName
The CREST tag name actually used for lookup.
std::string key() const
bool onlyReadMetadata() const
bool getKey(const std::string &key, const std::string &devvalue, std::string &value) const
original 'getKey' method, now implemented using 'at'
std::string eventStoreName() const
bool hasKey() const
unsigned long long iovOverrideValue(MsgStream &msg) const
bool overridesIov(MsgStream &msg) const
return true if this description overrides the timestamp or runlumi
bool extensible() const
bool noTagOverride() const
std::string folderName() const
give the folder name contained in the parsed description
std::string tag() const
std::vector< std::pair< IntType, IntType > > parseChannelSpec(const std::string &chanspecString)
Parse a channel specification string of the format ":3, 65:67,100:120, 130: " into a vector of pairs.
std::string spaceStrip(const std::string &input)
Trim leading and trailing spaces,return a new trimmed string.

◆ ~IOVDbCrestTag()

IOVDbCrestTag::~IOVDbCrestTag ( )

Definition at line 100 of file IOVDbCrestTag.cxx.

100 {
101 if (m_cachespec != nullptr) {
102 m_cachespec->release();
103 }
104}
coral::AttributeListSpecification * m_cachespec

Member Function Documentation

◆ addMetaAttrList()

bool IOVDbCrestTag::addMetaAttrList ( const coral::AttributeList & atrlist,
const IOVRange & range )
private

Definition at line 408 of file IOVDbCrestTag.cxx.

408 {
409 CondAttrListCollection tmpColl(!m_timestamp);
410 tmpColl.add(0xFFFF, atrlist);
411 tmpColl.add(0xFFFF, range);
412 return addMetaAttrListColl(&tmpColl);
413}
bool m_timestamp
Indexed by timestamp (else runLB), from <timeStamp>.
bool addMetaAttrListColl(const CondAttrListCollection *coll)

◆ addMetaAttrListColl()

bool IOVDbCrestTag::addMetaAttrListColl ( const CondAttrListCollection * coll)
private

Definition at line 415 of file IOVDbCrestTag.cxx.

415 {
416 if (!coll) {
417 return false;
418 }
419 CondAttrListCollection* flmdColl = new CondAttrListCollection(*coll);
420 if (StatusCode::SUCCESS != p_metaDataTool->addPayload(m_foldername, flmdColl)) {
421 ATH_MSG_ERROR("addMetaAttrList: Failed to write metadata for folder " << m_foldername);
422 return false;
423 }
424 ATH_MSG_DEBUG("addMetaAttrList: write metadata for folder " << m_foldername);
425 return true;
426}
#define ATH_MSG_ERROR(x,...)

◆ bytesRead()

unsigned long long IOVDbCrestTag::bytesRead ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 263 of file IOVDbCrestTag.h.

263{ return m_nbytesread; }
unsigned long long m_nbytesread

◆ channelInSelection()

bool IOVDbCrestTag::channelInSelection ( cool::ChannelId chan) const
private

Definition at line 428 of file IOVDbCrestTag.cxx.

428 {
429 if (m_chanrange.empty()) {
430 return true;
431 }
432 for (const auto& range : m_chanrange) {
433 if (chan >= range.first && chan <= range.second) {
434 return true;
435 }
436 }
437 return false;
438}

◆ clid()

CLID IOVDbCrestTag::clid ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 261 of file IOVDbCrestTag.h.

261{ return m_clid; }

◆ conn()

IOVDbConn * IOVDbCrestTag::conn ( )
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 225 of file IOVDbCrestTag.h.

225{ return m_conn; }

◆ createTransientAddress()

std::unique_ptr< SG::TransientAddress > IOVDbCrestTag::createTransientAddress ( const std::vector< std::string > & symlinks)
private

Definition at line 191 of file IOVDbCrestTag.cxx.

191 {
192 auto tad = std::make_unique<SG::TransientAddress>(m_clid, m_key);
193 for (const auto& linkname : symlinks) {
194 if (not linkname.empty()) {
195 CLID sclid = 0;
196 if (StatusCode::SUCCESS == p_clidSvc->getIDOfTypeName(linkname, sclid)) {
197 tad->setTransientID(sclid);
198 ATH_MSG_DEBUG("Setup symlink " << linkname << " CLID " << sclid << " for folder " << m_foldername);
199 } else {
200 ATH_MSG_ERROR("Could not get clid for symlink: " << linkname);
201 return nullptr;
202 }
203 }
204 }
205 return tad;
206}
uint32_t CLID
The Class ID type.

◆ currentRange()

const IOVRange & IOVDbCrestTag::currentRange ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 267 of file IOVDbCrestTag.h.

267{ return m_currange; }
IOVRange m_currange

◆ determineFolderType()

IOVDbNamespace::FolderType IOVDbCrestTag::determineFolderType ( ) const
private

Definition at line 157 of file IOVDbCrestTag.cxx.

157 {
158 // Check for CoraCool (not supported in CREST)
159 if (m_folderDescription.find("<coracool>") != std::string::npos) {
160 ATH_MSG_FATAL("Folder " << m_foldername << " is CoraCool and is not representable with CREST");
162 }
163
165
166 // If the type is CondAttrListVec, and is not CoraCool, it must be a CoolVector
167 if (typeName == "CondAttrListVec") {
169 }
170
171 // A string type "PoolRef" column in field 0 indicates a POOL-compatible tag
172 const auto& fields = m_tag->getFieldSpec();
173 const bool poolCompatible = ((fields.size() > 0) && (fields[0].name == "PoolRef") &&
174 (fields[0].type == chai::String));
175 if (poolCompatible) {
176 const auto& channels = m_tag->getChannelSpec().channels();
177 const bool onlyChannelZero = (channels.size() == 1 && channels[0].id == 0);
178 return onlyChannelZero ? IOVDbNamespace::PoolRef : IOVDbNamespace::PoolRefColl;
179 }
180
181 // CondAttrListCollection -> AttrListColl
182 if (typeName == "CondAttrListCollection") {
184 }
185
186 // Otherwise AttrList
188}
#define ATH_MSG_FATAL(x,...)
chai::TagPtr m_tag
Resolved in preload(). Stays null for a metadata-only folder.
std::string m_folderDescription
bool poolCompatible(const cool::IRecordSpecification &rspec)
Is the folder type compatible with Pool storage type?
std::string parseTypename(const std::string &description)
Extract the typename from a folder description.

◆ dropped()

bool IOVDbCrestTag::dropped ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 251 of file IOVDbCrestTag.h.

251{ return m_dropped; }

◆ dumpChannelsAsJson()

std::string IOVDbCrestTag::dumpChannelsAsJson ( cool::ValidityKey reftime) const

Definition at line 654 of file IOVDbCrestTag.cxx.

654 {
655 std::ostringstream os;
656 os << "[";
657 std::string sep;
658 if (isResident(reftime) && !std::holds_alternative<std::monostate>(m_resident->payload)) {
659 const cool::ValidityKey since = m_resident->since;
660 const cool::ValidityKey until = m_resident->until;
661 if (m_foldertype == CoolVector) {
662 const auto& payloadResult = std::get<chai::PayloadResult<chai::VectorContainer>>(m_resident->payload);
663 for (const auto channelId : payloadResult.payload.channelIds()) {
664 const auto& rows = payloadResult.payload.rows(channelId);
665 if (rows.empty()) {
666 continue;
667 }
668 std::ostringstream payload;
669 payload << "[";
670 std::string rowSep;
671 for (const auto& row : rows) {
672 const coral::AttributeList al = ChaiCoralConverter::toAttributeList(*m_cachespec, *row);
675 }
676 payload << "]";
677 os << sep << IOVDbNamespace::s_openJson << "\"" << channelId << "\" : "
679 << "\"since\" : " << since << IOVDbNamespace::s_delimiterJson
680 << "\"until\" : " << until << IOVDbNamespace::s_delimiterJson
681 << "\"payload\" : " << payload.str()
684 }
685 } else {
686 const auto& payloadResult = std::get<chai::PayloadResult<chai::Container>>(m_resident->payload);
687 for (const auto channelId : payloadResult.payload.channelIds()) {
688 const coral::AttributeList al =
689 ChaiCoralConverter::toAttributeList(*m_cachespec, payloadResult.payload[channelId]);
690 os << sep << IOVDbNamespace::s_openJson << "\"" << channelId << "\" : "
692 << "\"since\" : " << since << IOVDbNamespace::s_delimiterJson
693 << "\"until\" : " << until << IOVDbNamespace::s_delimiterJson
694 << "\"payload\" : [" << IOVDbNamespace::jsonAttributeList(al) << "]"
697 }
698 }
699 }
700 os << "]";
701 return os.str();
702}
static Double_t al
static coral::AttributeList toAttributeList(const coral::AttributeListSpecification &spec, const chai::Values &values)
Convert one channel's CHAI Values to a coral::AttributeList, one attribute per field in spec order.
IOVDbNamespace::FolderType m_foldertype
std::optional< Resident > m_resident
bool isResident(const cool::ValidityKey reftime) const override
std::string jsonAttributeList(const coral::AttributeList &atrlist)
Produce a representation of a coral::AttributeList as a json string.
static const std::string s_delimiterJson
json standard delimiter ', '
static const std::string s_closeJson
json close tag, '}'
static const std::string s_openJson
json open tag, '{'

◆ eventStore()

const std::string & IOVDbCrestTag::eventStore ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 259 of file IOVDbCrestTag.h.

259{ return m_eventstore; }

◆ extensible()

bool IOVDbCrestTag::extensible ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 249 of file IOVDbCrestTag.h.

249{ return m_extensible; }

◆ folderName()

const std::string & IOVDbConditionsSource::folderName ( ) const
inlineinherited

Definition at line 62 of file IOVDbConditionsSource.h.

62{return m_foldername;};

◆ folderType()

IOVDbNamespace::FolderType IOVDbCrestTag::folderType ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 237 of file IOVDbCrestTag.h.

237{ return m_foldertype; }

◆ fromMetaDataOnly()

bool IOVDbCrestTag::fromMetaDataOnly ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 247 of file IOVDbCrestTag.h.

247{ return m_fromMetaDataOnly; }

◆ getAddress()

bool IOVDbCrestTag::getAddress ( const cool::ValidityKey reftime,
IAddressCreator * persSvc,
const unsigned int poolSvcContext,
std::unique_ptr< IOpaqueAddress > & address,
IOVRange & range,
bool & poolPayloadRequested )
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 440 of file IOVDbCrestTag.cxx.

443 {
444 ++m_ncacheread;
445 std::string strAddress;
446 // Owned here until released into the address object below, to avoid leaking in case of failure
447 std::unique_ptr<AthenaAttributeList> attrList;
448 std::unique_ptr<CondAttrListCollection> attrListColl;
449 std::unique_ptr<CondAttrListVec> attrListVec;
450
451 // Read from metadata if flag is set
452 if (m_useFileMetaData) {
453 IOVDbNamespace::SafeReadFromFileMetaData readFromMetaData(m_foldername, p_metaDataTool, reftime, m_timestamp);
454 if (not readFromMetaData.isValid()) {
455 ATH_MSG_ERROR("read:Could not find IOVPayloadContainer for folder " << m_foldername);
456 return false;
457 }
458 m_foldertype = readFromMetaData.folderType();
459 m_nobjread += readFromMetaData.numberOfObjects();
460 poolPayloadReq = readFromMetaData.poolPayloadRequested();
461 strAddress = readFromMetaData.stringAddress();
462 range = readFromMetaData.range();
463 attrList.reset(readFromMetaData.attributeList());
464 attrListColl.reset(readFromMetaData.attrListCollection());
465 ATH_MSG_DEBUG("Read file metadata for folder " << m_foldername << " foldertype is " << m_foldertype);
466 }
467
468 // Otherwise convert the resident CHAI payload directly
469 else {
470 if (!m_resident) {
471 ATH_MSG_ERROR("No resident payload for folder " << m_foldername << " at IOV " << reftime);
472 return false;
473 }
475
476 unsigned int nchan = 0;
477 std::optional<coral::AttributeList> singleAl;
478 try {
479 switch (m_foldertype) {
480 case AttrList:
481 case PoolRef: {
482 // A single-channel folder with no payload is an error
483 if (std::holds_alternative<std::monostate>(m_resident->payload)) {
484 ATH_MSG_ERROR("Empty resident for single-channel folder " << m_foldername);
485 return false;
486 }
487 const auto& payloadResult = std::get<chai::PayloadResult<chai::Container>>(m_resident->payload);
488 // Only channel 0 is read, as on the COOL path. Any other populated channel is ignored
489 if (!payloadResult.payload.hasChannel(0)) {
490 ATH_MSG_ERROR("No channel 0 for single-channel folder " << m_foldername << " currentTime "
491 << reftime << " (" << payloadResult.payload.channelIds().size()
492 << " channels populated)");
493 return false;
494 }
495 nchan = 1;
496 // Convert CHAI payload to attribute list
497 singleAl.emplace(ChaiCoralConverter::toAttributeList(*m_cachespec, payloadResult.payload[0]));
498 if (m_foldertype == AttrList) {
499 attrList = std::make_unique<AthenaAttributeList>(*singleAl);
500 strAddress = "POOLContainer_AthenaAttributeList][CLID=x";
501 } else {
502 strAddress = (*singleAl)["PoolRef"].data<std::string>();
503 }
504 break;
505 }
506 case AttrListColl:
507 case PoolRefColl: {
508 attrListColl = std::make_unique<CondAttrListCollection>(!m_timestamp);
509 // Empty resident means zero channels. Just leave it empty, matching IOVDbFolder.
510 if (!std::holds_alternative<std::monostate>(m_resident->payload)) {
511 const auto& payloadResult = std::get<chai::PayloadResult<chai::Container>>(m_resident->payload);
512 const auto channelIds = payloadResult.payload.channelIds();
513 for (const auto channelId : channelIds) {
514 const auto chan = static_cast<cool::ChannelId>(channelId);
515 if (!channelInSelection(chan)) {
516 continue;
517 }
518 // Convert each row to an attribute list and add to collection
519 attrListColl->addShared(chan, ChaiCoralConverter::toAttributeList(*m_cachespec, payloadResult.payload[channelId]));
520 attrListColl->add(chan, range);
521 ++nchan;
522 }
523 }
524 if (m_named) {
525 auto nitr = m_channames.begin();
526 for (auto chitr = m_channums.begin(); chitr != m_channums.end(); ++chitr, ++nitr) {
527 attrListColl->add(*chitr, *nitr);
528 }
529 }
530 strAddress = "POOLContainer_CondAttrListCollection][CLID=x";
531 break;
532 }
533 case CoolVector: {
534 attrListVec = std::make_unique<CondAttrListVec>(!m_timestamp);
535 // Empty resident means zero channels. Just leave it empty, matching IOVDbFolder.
536 if (!std::holds_alternative<std::monostate>(m_resident->payload)) {
537 const auto& payloadResult = std::get<chai::PayloadResult<chai::VectorContainer>>(m_resident->payload);
538 const auto channelIds = payloadResult.payload.channelIds();
539 for (const auto channelId : channelIds) {
540 const auto chan = static_cast<cool::ChannelId>(channelId);
541 if (!channelInSelection(chan)) {
542 continue;
543 }
544 // Convert each set of rows (per channel ID) to an attribute list vec
545 const auto rows = ChaiCoralConverter::toAttributeListVec(*m_cachespec, payloadResult.payload.rows(channelId));
546 attrListVec->addSlice(range, chan, rows, 0, rows.size());
547 ++nchan;
548 }
549 }
550 strAddress = "POOLContainer_CondAttrListVec][CLID=x";
551 break;
552 }
553 default:
554 ATH_MSG_ERROR("Unhandled folder type " << m_foldertype << " for folder " << m_foldername);
555 return false;
556 }
557 } catch (const std::exception& e) {
558 ATH_MSG_ERROR("Conversion failed for folder " << m_foldername << ": " << e.what());
559 return false;
560 }
561
563 if (!addMetaAttrList(*singleAl, range)) {
564 return false;
565 }
566 }
567
568 // CoolVector folders cannot be written to file metadata
570 ATH_MSG_ERROR("Writing of CoolVector folders to file metadata not implemented");
571 return false;
572 }
573
574 // Don't change wording here, getProblemFoldersFromLogs.py relies on this.
575 ATH_MSG_DEBUG("Retrieved object: folder " << m_foldername << " at IOV " << reftime
576 << " channels " << nchan << " has range " << range);
577 }
578
580 m_retrieved = true;
581
583 if (!addMetaAttrListColl(attrListColl.get())) {
584 return false;
585 }
586 }
587
588 strAddress = m_addrheader + strAddress;
589 IOpaqueAddress* addrp = nullptr;
590 if (StatusCode::SUCCESS != persSvc->createAddress(0, 0, strAddress, addrp)) {
591 ATH_MSG_ERROR("Could not get IOpaqueAddress from string address " << strAddress);
592 return false;
593 }
594 address = std::unique_ptr<IOpaqueAddress>(addrp);
595 GenericAddress* gAddr = dynamic_cast<GenericAddress*>(address.get());
596 if (!gAddr) {
597 ATH_MSG_ERROR("Could not cast IOpaqueAddress to GenericAddress");
598 return false;
599 }
600 if (m_foldertype == AttrListColl) {
601 auto addr = std::make_unique<CondAttrListCollAddress>(*gAddr);
602 addr->setAttrListColl(attrListColl.release());
603 address = std::move(addr);
604 } else if (m_foldertype == PoolRefColl || m_foldertype == PoolRef) {
605 auto addr = std::make_unique<CondAttrListCollAddress>(gAddr->svcType(),
606 gAddr->clID(), gAddr->par()[0],
607 gAddr->par()[1], poolSvcContext,
608 gAddr->ipar()[1]);
609 if (m_foldertype == PoolRefColl) {
610 addr->setAttrListColl(attrListColl.release());
611 }
612 address = std::move(addr);
613 poolPayloadReq = true;
614 } else if (m_foldertype == AttrList) {
615 auto addr = std::make_unique<AthenaAttrListAddress>(*gAddr);
616 addr->setAttrList(attrList.release());
617 address = std::move(addr);
618 } else if (m_foldertype == CoolVector) {
619 auto addr = std::make_unique<CondAttrListVecAddress>(*gAddr);
620 addr->setAttrListVec(attrListVec.release());
621 address = std::move(addr);
622 }
623 return true;
624}
static std::vector< coral::AttributeList > toAttributeListVec(const coral::AttributeListSpecification &spec, const std::vector< chai::ValuesPtr > &rows)
Convert one channel's CHAI vector-payload rows to a coral::AttributeList per row, in row order,...
std::vector< cool::ChannelId > m_channums
unsigned int m_ncacheread
bool addMetaAttrList(const coral::AttributeList &atrlist, const IOVRange &range)
std::vector< std::string > m_channames
bool channelInSelection(cool::ChannelId chan) const
unsigned int m_nobjread
std::string m_addrheader
IOVRange makeRange(const cool::ValidityKey since, const cool::ValidityKey until, const bool timeIsEpoch)
Make an IOVRange from two validity keys.

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)
int outputLevel(const IMessageSvc *ims, const std::string &source)

◆ iovOverridden()

bool IOVDbCrestTag::iovOverridden ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 253 of file IOVDbCrestTag.h.

253{ return m_iovoverridden; }

◆ iovTime()

cool::ValidityKey IOVDbCrestTag::iovTime ( const IOVTime & reftime) const
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 146 of file IOVDbCrestTag.cxx.

146 {
147 if (m_iovoverridden) {
148 return m_iovoverride;
149 }
150 return (m_timestamp ? reftime.timestamp() : reftime.re_time());
151}
uint64_t timestamp() const noexcept
Definition IOVTime.h:109
uint64_t re_time() const noexcept
Definition IOVTime.h:108

◆ isResident()

bool IOVDbCrestTag::isResident ( const cool::ValidityKey reftime) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 269 of file IOVDbCrestTag.h.

269 {
270 // Unlike IOVDbFolder::isResident's strict ">", the bounds here are the IOV's
271 // own [since, until), so reftime landing on since counts as resident.
272 // Otherwise every such vkey forces a redundant CHAI refetch.
273 return m_resident && reftime>=m_resident->since && reftime<m_resident->until;
274}

◆ joTag()

const std::string & IOVDbCrestTag::joTag ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 255 of file IOVDbCrestTag.h.

255{ return m_jotag; }

◆ key()

const std::string & IOVDbCrestTag::key ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 219 of file IOVDbCrestTag.h.

219{ return m_key; }

◆ loadAt()

bool IOVDbCrestTag::loadAt ( const cool::ValidityKey vkey)
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 305 of file IOVDbCrestTag.cxx.

305 {
306 TStopwatch cachetimer;
307 // A bad EventInfo timestamp can produce vkey==0xFFFF... which a floor
308 // lookup would resolve to the last IOV. Reset to 0 with a warning.
309 cool::ValidityKey vkey = requestedVkey;
310 if (vkey > cool::ValidityKeyMax) {
311 ATH_MSG_WARNING("Requested validity key " << vkey << " is out of range, reset to 0");
312 vkey = 0;
313 }
314 ATH_MSG_DEBUG("Load cache for folder " << m_foldername << " validitykey " << vkey);
315
316 m_resident.reset();
317
318 // An IOVTime above cool::ValidityKeyMax is invalid so clamp at the max
319 const auto clampedKey = [this](uint64_t key, const char* which) {
320 if (key > cool::ValidityKeyMax) {
321 ATH_MSG_WARNING("CREST " << which << " " << key << " for folder " << m_foldername
322 << " exceeds cool::ValidityKeyMax; clamped");
323 return cool::ValidityKeyMax;
324 }
325 return static_cast<cool::ValidityKey>(key);
326 };
327
328 unsigned int nchan = 0;
329 try {
330 // Caches the payload and returns the channel count
331 auto storeResident = [this, &clampedKey](auto&& payloadResult) {
332 if (m_cachespec == nullptr) {
333 m_cachespec = ChaiCoralConverter::toCoralSpec(payloadResult.payload.fieldSpec());
334 }
335 const unsigned int channelCount = payloadResult.payload.channelIds().size();
336 m_nbytesread += ChaiCoralConverter::payloadSize(payloadResult.payload);
337 const cool::ValidityKey sinceKey = clampedKey(payloadResult.since, "since");
338 const cool::ValidityKey untilKey = payloadResult.until.has_value()
339 ? clampedKey(*payloadResult.until, "until") : cool::ValidityKeyMax;
340 m_resident = Resident{sinceKey, untilKey, std::move(payloadResult)};
341 return channelCount;
342 };
343
344 // CHAI needs to know if it's a vector or scalar payload to call the correct getXPayloadAt method.
345 // This is what actually loads the payload at the desired time and caches it.
346 nchan = (m_foldertype == IOVDbNamespace::CoolVector) ? storeResident(m_tag->getVectorPayloadAt(vkey))
347 : storeResident(m_tag->getPayloadAt(vkey));
348 } catch (const chai::NotFoundError& e) {
349 // IOVDbFolder returns an empty collection when a collection-type folder has
350 // zero matching objects and when the query time precedes the first IOV.
351 // Any other NotFoundError is a real error.
352 const bool isCollectionType = (m_foldertype == AttrListColl || m_foldertype == PoolRefColl || m_foldertype == CoolVector);
353
354 if (isCollectionType) {
355 try {
356 // getIovs() is lazy, so begin() fetches only the first page and returns the first element
357 auto iovs = m_tag->getIovs(0);
358 auto firstIt = iovs.begin();
359 if (firstIt != iovs.end() && firstIt->getSince() > vkey) {
360 const cool::ValidityKey firstSince = clampedKey(firstIt->getSince(), "first since");
361 ATH_MSG_WARNING("No covering IOV for folder " << m_foldername << " validityKey " << vkey
362 << " (tag " << m_resolvedTagName << "'s first IOV starts at "
363 << firstSince << "); treating the folder as empty");
364 m_resident = Resident{cool::ValidityKeyMin, firstSince, std::monostate{}};
365 ++m_ndbread;
366 const float timeinc = cachetimer.RealTime();
367 m_readtime += timeinc;
368 ATH_MSG_DEBUG("Cache retrieve done for " << m_foldername
369 << " with 0 channels (no coverage) " << "in " << std::fixed << std::setw(8)
370 << std::setprecision(2) << timeinc << " s");
371 return true;
372 }
373 } catch (const std::exception& probeErr) {
374 // A failure here is not the empty-collection case. Fall through to the real error below.
375 ATH_MSG_DEBUG("Coverage probe for " << m_foldername << " failed: " << probeErr.what());
376 }
377 }
378 ATH_MSG_ERROR("No covering IOV for folder " << m_foldername << " validityKey " << vkey << ": " << e.what());
379 reset();
380 return false;
381 } catch (const chai::Error& e) {
382 ATH_MSG_ERROR("CHAI error for folder " << m_foldername << ": " << e.what());
383 reset();
384 return false;
385 } catch (const std::exception& e) {
386 ATH_MSG_ERROR("Failed for folder " << m_foldername << ": " << e.what());
387 reset();
388 return false;
389 }
390
391 ++m_ndbread;
392 m_nobjread += nchan;
393 const float timeinc = cachetimer.RealTime();
394 m_readtime += timeinc;
395 ATH_MSG_DEBUG("Cache retrieve done for " << m_foldername << " with " << nchan
396 << " channels stored in " << std::fixed << std::setw(8) << std::setprecision(2)
397 << timeinc << " s");
398 return true;
399}
#define ATH_MSG_WARNING(x,...)
static unsigned int payloadSize(const chai::Container &container)
Total byte size of every populated channel in a scalar payload.
static coral::AttributeListSpecification * toCoralSpec(const chai::FieldSpec &fields)
Build a coral::AttributeListSpecification from a CHAI FieldSpec, one attribute per field in field ord...
void reset() override
const std::string & key() const override
unsigned int m_ndbread
which(filename, env=os.environ)
UNIX-style which ---------------------------------------------------------—.
Definition unixtools.py:39

◆ loadCacheIfDbChanged()

bool IOVDbCrestTag::loadCacheIfDbChanged ( const cool::ValidityKey vkey,
const cool::IDatabasePtr & dbPtr,
const ServiceHandle< IIOVSvc > & iovSvc )
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 401 of file IOVDbCrestTag.cxx.

403 {
404 // COOL-specific online-reload path. No-op for CREST.
405 return true;
406}

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 167 of file AthMessaging.h.

168{
169 MsgStream* ms = m_msg_tls.get();
170 if (!ms) {
171 if (!m_initialized.test_and_set()) initMessaging();
172 ms = new MsgStream(m_imsg,m_nm);
173 m_msg_tls.reset( ms );
174 }
175
176 ms->setLevel (m_lvl);
177 return *ms;
178}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels).
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 182 of file AthMessaging.h.

183{ return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 // If user did not set explicit message level we have to initialize
154 // the messaging and retrieve the default via the MessageSvc.
155 if (m_lvl==MSG::NIL && !m_initialized.test_and_set()) initMessaging();
156
157 if (m_lvl <= lvl) {
158 msg() << lvl;
159 return true;
160 } else {
161 return false;
162 }
163}

◆ multiVersion()

bool IOVDbCrestTag::multiVersion ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 227 of file IOVDbCrestTag.h.

227{ return false; }

◆ noOverride()

bool IOVDbCrestTag::noOverride ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 233 of file IOVDbCrestTag.h.

233{ return m_notagoverride; }

◆ preload()

std::unique_ptr< SG::TransientAddress > IOVDbCrestTag::preload ( ITagInfoMgr * tagInfoMgr,
const unsigned int cacheRun,
const unsigned int cacheTime )
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 209 of file IOVDbCrestTag.cxx.

209 {
210 if (not m_useFileMetaData) {
211 if (m_resolvedTagName.empty()) {
212 ATH_MSG_FATAL("Folder " << m_foldername << " has no CREST tag and is not read from file metadata");
213 return nullptr;
214 }
215
216 // Attempt to resolve the tag and set the folder description
217 try {
218 m_tag = m_db->getTag(m_resolvedTagName);
219 } catch (const std::exception& e) {
220 ATH_MSG_FATAL("Failed to resolve CHAI tag '" << m_resolvedTagName
221 << "' for folder " << m_foldername << ": " << e.what());
222 return nullptr;
223 }
224 m_folderDescription = m_tag->getNodeDescription();
225
226 // A description without <timeStamp> takes the timebase from the tag's IovType.
227 // An existing element is used as is.
228 if (chai::extractNodeDescTimeStampToken(m_folderDescription).empty()) {
229 const std::string token = chai::iovTypeToNodeDescTimeStampToken(m_tag->getIovType());
230 ATH_MSG_INFO("Folder " << m_foldername << "'s CREST description for tag "
231 << m_tag->getName() << " has no <timeStamp> element; inserting '" << token
232 << "' from the tag's IovType");
233 m_folderDescription = "<timeStamp>" + token + "</timeStamp>" + m_folderDescription;
234 }
235 }
236
237 // Otherwise the folder description was already set from file metadata
238 ATH_MSG_DEBUG("Folder description for " << m_foldername << ": " << m_folderDescription);
239
240 if (m_writemeta) {
241 if (StatusCode::SUCCESS != p_metaDataTool->registerFolder(m_foldername, m_folderDescription)) {
242 ATH_MSG_ERROR("Failed to register folder " << m_foldername << " for meta-data write");
243 return nullptr;
244 }
245 }
246
247 // Read timestamp-indexing straight from the description string so this
248 // works even when no chai::Tag is resolved (a metadata-only folder).
249 IOVDbParser folderpar(m_folderDescription, msg());
250 m_timestamp = folderpar.timebaseIs_nsOfEpoch();
251
252 // Reported here rather than in the constructor because the timebase
253 // decides how the override key reads
254 if (m_iovoverridden) {
255 if (m_timestamp) {
256 ATH_MSG_INFO("Override timestamp to " << m_iovoverride << " for folder " << m_foldername);
257 } else {
259 ATH_MSG_INFO("Override run/LB number to [" << run << ":" << lumi << "] for folder " << m_foldername);
260 }
261 }
262
263 IOVDbNamespace::FolderAddressSpec resolved;
265 return nullptr;
266 }
267
268 m_key = std::move(resolved.key);
269 m_named = resolved.named;
270 m_addrheader = std::move(resolved.addrheader);
271 m_typename = std::move(resolved.typeName);
272 m_clid = resolved.clid;
273
274 if (not m_useFileMetaData) {
275 // Get all channel IDs and names from the tag's channel spec
276 const auto& channels = m_tag->getChannelSpec().channels();
277 m_channums.clear();
278 m_channames.clear();
279 for (const auto& ch : channels) {
280 m_channums.push_back(static_cast<cool::ChannelId>(ch.id));
281 m_channames.push_back(ch.name);
282 }
283
286 return nullptr;
287 }
288 }
289
290 // For folders read from metadata, folder-type identification is
291 // done in getAddress(). Channel number/name info is never read.
292 m_nchan = m_channums.size();
293 ATH_MSG_DEBUG("Folder identified as type " << m_foldertype);
294
295 // Get the transient address while handling any symlinks
296 const auto& linknameVector = folderpar.symLinks();
297 auto tad{createTransientAddress(linknameVector)};
298 if (not tad) {
299 ATH_MSG_WARNING("Transient address is null in " << __func__);
300 return nullptr;
301 }
302 return tad;
303}
static const Attributes_t empty
std::unique_ptr< SG::TransientAddress > createTransientAddress(const std::vector< std::string > &symlinks)
unsigned int m_nchan
IOVDbNamespace::FolderType determineFolderType() const
std::string m_typename
std::pair< unsigned long long, unsigned long long > runLumiFromIovTime(const unsigned long long iovTime)
Return a [run,lumi] pair from an IOV time.
bool resolveFolderAddress(MsgStream &log, const IOVDbParser &parsedDescription, const std::string &folderName, bool jokey, const std::string &currentKey, IClassIDSvc *clidSvc, FolderAddressSpec &result)
std::string addrheader
Address header string from the description. Empty if it has none.
bool named
Folder has named channels.
std::string typeName
Primary type name, read from the description.
std::string key
SG key (unchanged unless the description overrides it).
CLID clid
CLID, read from the description or resolved via IClassIDSvc.
int run(int argc, char *argv[])

◆ printState()

void IOVDbCrestTag::printState ( )
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 636 of file IOVDbCrestTag.cxx.

636 {
637 ATH_MSG_DEBUG("folder cache printout -------------------");
638 if (m_resident) {
639 unsigned int nchan = 0;
640 if (!std::holds_alternative<std::monostate>(m_resident->payload)) {
642 ? std::get<chai::PayloadResult<chai::VectorContainer>>(m_resident->payload).payload.channelIds().size()
643 : std::get<chai::PayloadResult<chai::Container>>(m_resident->payload).payload.channelIds().size();
644 }
645 ATH_MSG_DEBUG(m_foldername << "\tsince: " << m_resident->since << "\tuntil: "
646 << m_resident->until << "\tchannels: " << nchan);
647 } else {
648 ATH_MSG_DEBUG(m_foldername << "\tno resident payload");
649 }
650 ATH_MSG_DEBUG("current range: " << m_currange);
651 ATH_MSG_DEBUG("folder cache printout -------------------");
652}

◆ readMeta()

bool IOVDbCrestTag::readMeta ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 243 of file IOVDbCrestTag.h.

243{ return m_useFileMetaData; }

◆ readTime()

float IOVDbCrestTag::readTime ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 265 of file IOVDbCrestTag.h.

265{ return m_readtime; }

◆ reset()

void IOVDbCrestTag::reset ( )
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 153 of file IOVDbCrestTag.cxx.

153 {
154 m_resident.reset();
155}

◆ resolvedTag()

const std::string & IOVDbCrestTag::resolvedTag ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 257 of file IOVDbCrestTag.h.

257{ return m_resolvedTagName; }

◆ retrieved()

bool IOVDbCrestTag::retrieved ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 235 of file IOVDbCrestTag.h.

235{ return m_retrieved; }

◆ setDropped()

void IOVDbCrestTag::setDropped ( const bool dropped)
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 276 of file IOVDbCrestTag.h.

bool dropped() const override

◆ setFolderDescription()

void IOVDbCrestTag::setFolderDescription ( const std::string & description)
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 239 of file IOVDbCrestTag.h.

239 {
241}
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:93

◆ setIOVOverride()

void IOVDbCrestTag::setIOVOverride ( const unsigned int run,
const unsigned int lumiblock,
const unsigned int time )
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 127 of file IOVDbCrestTag.cxx.

127 {
128 if (m_iovoverridden) {
129 return;
130 }
131 if (m_timestamp) {
132 if (time != 0) {
134 ATH_MSG_INFO("Override timestamp to " << m_iovoverride << " for folder " << m_foldername);
135 m_iovoverridden = true;
136 }
137 } else {
138 if (run != 0 || lumiblock != 0) {
140 ATH_MSG_INFO("Override run/LB number to [" << run << ":" << lumiblock << "] for folder " << m_foldername);
141 m_iovoverridden = true;
142 }
143 }
144}
unsigned long long iovTimeFromSeconds(const unsigned long long seconds)
Create a long long time in ns from s.
unsigned long long iovTimeFromRunLumi(const unsigned long long run, const unsigned long long lumi)
Create a long long representing the IOV from run, lumi.

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ setTagOverride()

void IOVDbCrestTag::setTagOverride ( const std::string & tag,
const bool setFlag )
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 114 of file IOVDbCrestTag.cxx.

114 {
115 // Never reached for CREST tags (IOVDbSvc::processTagInfo skips them).
116 // CREST tags come from the GlobalTag mapping or <ctag>, not TagInfo.
117 if (setFlag) {
118 m_tagoverride = true;
119 }
121}
bool m_tagoverride
Unused on the CREST path. Present to satisfy IOVDbConditionsSource.

◆ setWriteMeta()

void IOVDbCrestTag::setWriteMeta ( )
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 123 of file IOVDbCrestTag.cxx.

123 {
124 m_writemeta = true;
125}

◆ source()

const IOVDbCrestTag::source_t & IOVDbCrestTag::source ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 220 of file IOVDbCrestTag.h.

220 {
221 static constexpr source_t s_source{source_t::CRESTDB};
222 return s_source;
223}

◆ summary()

void IOVDbCrestTag::summary ( )
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 626 of file IOVDbCrestTag.cxx.

626 {
628 << ") db-read " << m_ndbread << "/" << m_ncacheread << " objs/chan/bytes "
629 << m_nobjread << "/" << m_nchan << "/" << m_nbytesread << " (( " << std::fixed
630 << std::setw(8) << std::setprecision(2) << m_readtime << " ))s");
631 if (m_ncacheread == 0 && m_ndbread > 0) {
632 ATH_MSG_WARNING("Folder " << m_foldername << " is requested but no data retrieved");
633 }
634}
std::string folderTypeName(const FolderType f)
Give a string name for the folder type.

◆ tagOverride()

bool IOVDbCrestTag::tagOverride ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 231 of file IOVDbCrestTag.h.

231{ return m_tagoverride; }

◆ timeStamp()

bool IOVDbCrestTag::timeStamp ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 229 of file IOVDbCrestTag.h.

229{ return m_timestamp; }

◆ useFileMetaData()

void IOVDbCrestTag::useFileMetaData ( )
overridevirtual

Implements IOVDbConditionsSource.

Definition at line 106 of file IOVDbCrestTag.cxx.

106 {
107 m_useFileMetaData = true;
108 if (m_conn != nullptr) {
109 m_conn->decUsage();
110 m_conn = nullptr;
111 }
112}

◆ writeMeta()

bool IOVDbCrestTag::writeMeta ( ) const
inlineoverridevirtual

Implements IOVDbConditionsSource.

Definition at line 245 of file IOVDbCrestTag.h.

245{ return m_writemeta; }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging).

Definition at line 141 of file AthMessaging.h.

◆ m_addrheader

std::string IOVDbCrestTag::m_addrheader
private

Definition at line 191 of file IOVDbCrestTag.h.

◆ m_cachespec

coral::AttributeListSpecification* IOVDbCrestTag::m_cachespec {nullptr}
private

Definition at line 214 of file IOVDbCrestTag.h.

214{nullptr};

◆ m_channames

std::vector<std::string> IOVDbCrestTag::m_channames
private

Definition at line 203 of file IOVDbCrestTag.h.

◆ m_channums

std::vector<cool::ChannelId> IOVDbCrestTag::m_channums
private

Definition at line 202 of file IOVDbCrestTag.h.

◆ m_chanrange

std::vector<std::pair<cool::ChannelId, cool::ChannelId> > IOVDbCrestTag::m_chanrange
private

Definition at line 207 of file IOVDbCrestTag.h.

◆ m_clid

CLID IOVDbCrestTag::m_clid {0}
private

Definition at line 193 of file IOVDbCrestTag.h.

193{0};

◆ m_conn

IOVDbConn* IOVDbCrestTag::m_conn {nullptr}
private

Unused for CREST I/O; kept for per-connection usage counting.

Definition at line 167 of file IOVDbCrestTag.h.

167{nullptr};

◆ m_currange

IOVRange IOVDbCrestTag::m_currange
private

Definition at line 210 of file IOVDbCrestTag.h.

◆ m_db

chai::Database* IOVDbCrestTag::m_db {nullptr}
private

Non-owning pointer to the shared chai::Database.

Definition at line 168 of file IOVDbCrestTag.h.

168{nullptr};

◆ m_dropped

bool IOVDbCrestTag::m_dropped {false}
private

Definition at line 184 of file IOVDbCrestTag.h.

184{false};

◆ m_eventstore

std::string IOVDbCrestTag::m_eventstore
private

Definition at line 190 of file IOVDbCrestTag.h.

◆ m_extensible

bool IOVDbCrestTag::m_extensible {false}
private

Definition at line 180 of file IOVDbCrestTag.h.

180{false};

◆ m_folderDescription

std::string IOVDbCrestTag::m_folderDescription
private

Definition at line 171 of file IOVDbCrestTag.h.

◆ m_foldername

std::string IOVDbConditionsSource::m_foldername
protectedinherited

Folder name, as it appears in COOL or as a CREST tag label.

Definition at line 123 of file IOVDbConditionsSource.h.

◆ m_foldertype

IOVDbNamespace::FolderType IOVDbCrestTag::m_foldertype {IOVDbNamespace::UNKNOWN}
private

Definition at line 186 of file IOVDbCrestTag.h.

◆ m_fromMetaDataOnly

bool IOVDbCrestTag::m_fromMetaDataOnly {false}
private

Definition at line 179 of file IOVDbCrestTag.h.

179{false};

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_iovoverridden

bool IOVDbCrestTag::m_iovoverridden {false}
private

Definition at line 182 of file IOVDbCrestTag.h.

182{false};

◆ m_iovoverride

cool::ValidityKey IOVDbCrestTag::m_iovoverride {0}
private

Definition at line 185 of file IOVDbCrestTag.h.

185{0};

◆ m_jokey

bool IOVDbCrestTag::m_jokey {false}
private

Definition at line 183 of file IOVDbCrestTag.h.

183{false};

◆ m_jotag

std::string IOVDbCrestTag::m_jotag
private

Explicit <tag>/<ctag> from job options. Used only for /TagInfo.

Definition at line 188 of file IOVDbCrestTag.h.

◆ m_key

std::string IOVDbConditionsSource::m_key
protectedinherited

SG key where data is loaded (unique).

Definition at line 124 of file IOVDbConditionsSource.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels).

Definition at line 132 of file AthMessaging.h.

◆ m_named

bool IOVDbCrestTag::m_named {false}
private

Definition at line 181 of file IOVDbCrestTag.h.

181{false};

◆ m_nbytesread

unsigned long long IOVDbCrestTag::m_nbytesread {0}
private

Definition at line 198 of file IOVDbCrestTag.h.

198{0};

◆ m_ncacheread

unsigned int IOVDbCrestTag::m_ncacheread {0}
private

Definition at line 195 of file IOVDbCrestTag.h.

195{0};

◆ m_nchan

unsigned int IOVDbCrestTag::m_nchan {0}
private

Definition at line 201 of file IOVDbCrestTag.h.

201{0};

◆ m_ndbread

unsigned int IOVDbCrestTag::m_ndbread {0}
private

Definition at line 196 of file IOVDbCrestTag.h.

196{0};

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_nobjread

unsigned int IOVDbCrestTag::m_nobjread {0}
private

Definition at line 197 of file IOVDbCrestTag.h.

197{0};

◆ m_notagoverride

bool IOVDbCrestTag::m_notagoverride {false}
private

Unused on the CREST path. Present to satisfy IOVDbConditionsSource.

Definition at line 175 of file IOVDbCrestTag.h.

175{false};

◆ m_readtime

float IOVDbCrestTag::m_readtime {0}
private

Definition at line 199 of file IOVDbCrestTag.h.

199{0};

◆ m_resident

std::optional<Resident> IOVDbCrestTag::m_resident
private

Definition at line 216 of file IOVDbCrestTag.h.

◆ m_resolvedTagName

std::string IOVDbCrestTag::m_resolvedTagName
private

The CREST tag name actually used for lookup.

Definition at line 189 of file IOVDbCrestTag.h.

◆ m_retrieved

bool IOVDbCrestTag::m_retrieved {false}
private

Definition at line 209 of file IOVDbCrestTag.h.

209{false};

◆ m_tag

chai::TagPtr IOVDbCrestTag::m_tag
private

Resolved in preload(). Stays null for a metadata-only folder.

Definition at line 169 of file IOVDbCrestTag.h.

◆ m_tagoverride

bool IOVDbCrestTag::m_tagoverride {false}
private

Unused on the CREST path. Present to satisfy IOVDbConditionsSource.

Definition at line 174 of file IOVDbCrestTag.h.

174{false};

◆ m_timestamp

bool IOVDbCrestTag::m_timestamp {false}
private

Indexed by timestamp (else runLB), from <timeStamp>.

Definition at line 172 of file IOVDbCrestTag.h.

172{false};

◆ m_typename

std::string IOVDbCrestTag::m_typename
private

Definition at line 192 of file IOVDbCrestTag.h.

◆ m_useFileMetaData

bool IOVDbCrestTag::m_useFileMetaData {false}
private

Definition at line 178 of file IOVDbCrestTag.h.

178{false};

◆ m_writemeta

bool IOVDbCrestTag::m_writemeta {false}
private

Definition at line 177 of file IOVDbCrestTag.h.

177{false};

◆ p_clidSvc

IClassIDSvc* IOVDbCrestTag::p_clidSvc {nullptr}
private

Definition at line 165 of file IOVDbCrestTag.h.

165{nullptr};

◆ p_metaDataTool

IIOVDbMetaDataTool* IOVDbCrestTag::p_metaDataTool {nullptr}
private

Definition at line 166 of file IOVDbCrestTag.h.

166{nullptr};

The documentation for this class was generated from the following files: