ATLAS Offline Software
|
This is a Athena service which manages detector description tag information. It maintains a TagInfo object in the Detector Store with current tag values. More...
#include <TagInfoMgr.h>
Classes | |
class | SvcFactory |
Allow the factory class access to the constructor. More... | |
Public Member Functions | |
TagInfoMgr (const std::string &name, ISvcLocator *pSvcLocator) | |
Constructor with parameters: More... | |
~TagInfoMgr () | |
MsgStream & | msg () const |
MsgStream & | msg (const MSG::Level lvl) const |
bool | msgLvl (const MSG::Level lvl) const |
Basic service methods | |
virtual StatusCode | initialize () override |
virtual StatusCode | start () override |
virtual StatusCode | finalize () override |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) override |
Query the interfaces. More... | |
Method to allow clients add in tags as: tag name, tag value | |
virtual StatusCode | addTag (const std::string &tagName, const std::string &tagValue) override |
Method to allow clients add in tags as: tag name, tag value. More... | |
virtual StatusCode | removeTagFromInput (const std::string &tagName) override |
Method to allow clients to remove a tag which may have come in on the input. More... | |
virtual std::string | findTag (const std::string &name) const override final |
Find tag by name, return by value. More... | |
virtual std::string | findInputTag (const std::string &name) const override final |
Find tag by its name - for input tags, return by value. More... | |
virtual NameTagPairVec | getInputTags () const override final |
Return a vector with all current input tags. More... | |
virtual std::string | dumpTagInfoToStr () const override final |
Dump the content of the current TagInfo to std::string for debug. More... | |
virtual void | printTags (MsgStream &log) const override final |
Printout method. More... | |
virtual void | addListener (Listener *listener) override final |
Add a Listener to the notification list for TagInfo changes. More... | |
virtual void | removeListener (Listener *listener) override final |
Remove a Listener from the notification list for TagInfo changes. More... | |
typedefs: (a copy from TagInfo, to avoid dependencies) | |
typedef std::pair< std::string, std::string > | NameTagPair |
typedef std::vector< NameTagPair > | NameTagPairVec |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. More... | |
TagInfo management methods: | |
class | SvcFactory< TagInfoMgr > |
forward declaration More... | |
Gaudi::Property< std::map< std::string, std::string > > | m_extraTagValuePairs { this, "ExtraTagValuePairs", {}, "key/value pairs to be added", "mapMergeNoReplace<T,T>" } |
Extra tags/values pairs added in my jobOptions. More... | |
std::map< std::string, std::string > | m_extraTagValuePairsViaInterface |
Extra tags/values pairs added in via interface. More... | |
std::set< std::string > | m_tagsToBeRemoved |
Extra tags to be removed. More... | |
ServiceHandle< StoreGateSvc > | m_storeGate { this, "StoreGateSvc", "StoreGateSvc" } |
The event store. More... | |
ServiceHandle< StoreGateSvc > | m_detStore { this, "DetectorStore", "DetectorStore" } |
The detector store. More... | |
ServiceHandle< IIOVDbSvc > | m_iovDbSvc { this, "IOVDbSvc", "IOVDbSvc" } |
Access to IOVDbSvc interface - used to register callback. More... | |
PublicToolHandle< IIOVDbMetaDataTool > | m_metaDataTool { this, "IOVDbMetaDataTool", "IOVDbMetaDataTool" } |
Access to iov meta data tool. More... | |
bool | m_isFirstBeginRun { true } |
Flag to identify the first BeginRun incident. More... | |
EventIDBase::number_type | m_conditionsRun { EventIDBase::UNDEFNUM } |
conditionsRun from the first BeginRun incident (HLT) More... | |
EventIDBase::number_type | m_currentRun { EventIDBase::UNDEFNUM } |
current run number from BeginRun incident More... | |
IOVRange | m_lastIOVRange { IOVRange(IOVTime(), IOVTime()) } |
IOVRange of last TagInfo added to the file meta data. More... | |
TagInfo | m_tagInfo |
The Tags. More... | |
std::set< Listener * > | m_listeners |
List of listeners notified when the TagInfo changed. More... | |
std::shared_mutex m_mutex | ATLAS_THREAD_SAFE |
mutex to protect internal data in MT More... | |
void | handle (const Incident &incident) override final |
StatusCode | updateTagInfo () |
Update Tags when input tags (/TagInfo in-file metadata) change. More... | |
void | notifyListeners () const |
Notify all listeners that the Tags were updated. More... | |
TagInfoMgr () | |
TagInfoMgr (const TagInfoMgr &) | |
TagInfoMgr & | operator= (const TagInfoMgr &) |
StatusCode | getRunNumber (unsigned int &runNumber) |
StatusCode | fillTagInfo (const CondAttrListCollection *tagInfoCond) |
StatusCode | fillMetaData (const CondAttrListCollection *tagInfoCond) |
This is a Athena service which manages detector description tag information. It maintains a TagInfo object in the Detector Store with current tag values.
The tags to fill the TagInfo object may come from a variety of sources: i.e. the tags specified by the GeoModelSvc and IOVDbSvc, or the tags stored in the incoming EventInfo object, or the TagInfo object itself may be in the IOV DB. The TagInfoMgr itself only adds in tags from the incoming event. Others are added by external clients.
The interface provides a 'input' method to allow client to add in their own tags:
virtual StatusCode addTag(const std::string& tagName, const std::string& tagValue) = 0;
The full set of tags in TagInfo are copied each event into EventInfo (specifically EventType) to be written out in the event stream. Currently, the tags are NOT written to the IOV DB via the TagInfoMgr.
Definition at line 67 of file TagInfoMgr.h.
|
inherited |
Definition at line 62 of file ITagInfoMgr.h.
|
inherited |
Definition at line 63 of file ITagInfoMgr.h.
TagInfoMgr::TagInfoMgr | ( | const std::string & | name, |
ISvcLocator * | pSvcLocator | ||
) |
Constructor with parameters:
Definition at line 42 of file TagInfoMgr.cxx.
TagInfoMgr::~TagInfoMgr | ( | ) |
Definition at line 46 of file TagInfoMgr.cxx.
|
private |
|
private |
|
finaloverridevirtual |
Add a Listener to the notification list for TagInfo changes.
Implements ITagInfoMgr.
Definition at line 709 of file TagInfoMgr.cxx.
|
overridevirtual |
Method to allow clients add in tags as: tag name, tag value.
Implements ITagInfoMgr.
Definition at line 643 of file TagInfoMgr.cxx.
|
finaloverridevirtual |
Dump the content of the current TagInfo to std::string for debug.
Implements ITagInfoMgr.
Definition at line 693 of file TagInfoMgr.cxx.
|
private |
Register folder in the IOV Db MetaData
Definition at line 296 of file TagInfoMgr.cxx.
|
private |
Definition at line 111 of file TagInfoMgr.cxx.
|
overridevirtual |
Definition at line 103 of file TagInfoMgr.cxx.
|
finaloverridevirtual |
Find tag by its name - for input tags, return by value.
Implements ITagInfoMgr.
Definition at line 677 of file TagInfoMgr.cxx.
|
finaloverridevirtual |
Find tag by name, return by value.
Implements ITagInfoMgr.
Definition at line 666 of file TagInfoMgr.cxx.
|
finaloverridevirtual |
Return a vector with all current input tags.
Implements ITagInfoMgr.
Definition at line 685 of file TagInfoMgr.cxx.
|
private |
Definition at line 407 of file TagInfoMgr.cxx.
|
finaloverride |
This method is called at the both the BeginRun and BeginInputFile incidents:
1) For the first begin run, we retrieve the TagInfo and set up IOVDbSvc so that is can use TagInfo to define its hierarchical tags. The member m_currentRun is saved to be used for the IOV in fillMetaData.
2) Then whenever a new file is opened (BeginInputFile), we use the TagInfo object from the detector store to "re-fill" and overwrite the newly merged TagInfo meta data in the output meta data store. We receive BeginInputFile AFTER the IOVDbMetaDataTool has done this automatic merging, so that we can safely overwrite with the desired TagInfo information for this job/run. As well, if there is a second BeginRun during the processing, here we update m_currentRun and overwrite again the TagInfo in the
meta store with the new run which will just extend the IOV of the TagInfo meta data.
Definition at line 469 of file TagInfoMgr.cxx.
|
overridevirtual |
Definition at line 65 of file TagInfoMgr.cxx.
|
inlinestaticinherited |
Retrieve interface ID.
Definition at line 113 of file ITagInfoMgr.h.
|
inlineinherited |
Definition at line 24 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 27 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 30 of file AthCommonMsg.h.
void TagInfoMgr::notifyListeners | ( | ) | const |
|
private |
|
finaloverridevirtual |
|
overridevirtual |
Query the interfaces.
Identify interfaces to which this service is responsive.
Definition at line 52 of file TagInfoMgr.cxx.
|
finaloverridevirtual |
Remove a Listener from the notification list for TagInfo changes.
Implements ITagInfoMgr.
Definition at line 716 of file TagInfoMgr.cxx.
|
overridevirtual |
Method to allow clients to remove a tag which may have come in on the input.
Implements ITagInfoMgr.
Definition at line 656 of file TagInfoMgr.cxx.
|
overridevirtual |
Definition at line 96 of file TagInfoMgr.cxx.
StatusCode TagInfoMgr::updateTagInfo | ( | ) |
Update Tags when input tags (/TagInfo in-file metadata) change.
Definition at line 594 of file TagInfoMgr.cxx.
|
friend |
forward declaration
Definition at line 127 of file TagInfoMgr.h.
|
mutableprivate |
mutex to protect internal data in MT
Definition at line 197 of file TagInfoMgr.h.
|
private |
conditionsRun from the first BeginRun incident (HLT)
Definition at line 182 of file TagInfoMgr.h.
|
private |
current run number from BeginRun incident
Definition at line 185 of file TagInfoMgr.h.
|
private |
The detector store.
Definition at line 170 of file TagInfoMgr.h.
|
private |
Extra tags/values pairs added in my jobOptions.
Definition at line 158 of file TagInfoMgr.h.
|
private |
Extra tags/values pairs added in via interface.
Definition at line 161 of file TagInfoMgr.h.
|
private |
Access to IOVDbSvc interface - used to register callback.
Definition at line 173 of file TagInfoMgr.h.
|
private |
Flag to identify the first BeginRun incident.
Definition at line 179 of file TagInfoMgr.h.
IOVRange of last TagInfo added to the file meta data.
Definition at line 188 of file TagInfoMgr.h.
|
private |
List of listeners notified when the TagInfo changed.
Definition at line 194 of file TagInfoMgr.h.
|
private |
Access to iov meta data tool.
Definition at line 176 of file TagInfoMgr.h.
|
private |
The event store.
Definition at line 167 of file TagInfoMgr.h.
|
private |
The Tags.
Definition at line 191 of file TagInfoMgr.h.
|
private |
Extra tags to be removed.
Definition at line 164 of file TagInfoMgr.h.