diff --git a/Event/EventInfoMgt/src/TagInfoMgr.cxx b/Event/EventInfoMgt/src/TagInfoMgr.cxx index b8701500a35a012cf2963d1806aa9a05fc106092..dc50fbc4fad928af2f18d62bebe232c92cd7a708 100755 --- a/Event/EventInfoMgt/src/TagInfoMgr.cxx +++ b/Event/EventInfoMgt/src/TagInfoMgr.cxx @@ -48,15 +48,7 @@ long TagInfoMgr_StorageType = 0x50; // Constructor with parameters: TagInfoMgr::TagInfoMgr(const std::string &name, ISvcLocator *pSvcLocator) : - AthCnvSvc(name, pSvcLocator, TagInfoMgr_StorageType), - m_storeGate("StoreGateSvc", name), - m_detStore("DetectorStore", name), - m_iovDbSvc("IOVDbSvc", name), - m_metaDataTool("IOVDbMetaDataTool"), - m_isFirstBeginRun(true), - m_conditionsRun(EventIDBase::UNDEFNUM), - m_newFileIncidentSeen(false), - m_lastIOVRange(IOVRange(IOVTime(),IOVTime())) + AthCnvSvc(name, pSvcLocator, TagInfoMgr_StorageType) {} TagInfoMgr::~TagInfoMgr() @@ -435,35 +427,42 @@ TagInfoMgr::fillMetaData (const TagInfo* tagInfo, const CondAttrListCollection attrListColl->add(0, attrList); // Set IOV: - // set to the IOV of the incoming conditions - // if run num is in previous IOV, set new IOV to be [runNum, lastStop) - IOVTime testTime(runNumber, 0); - IOVTime start = m_lastIOVRange.start(); - IOVTime stop = m_lastIOVRange.stop(); - bool isFirstIOVCheck = false; - if (!start.isValid() || !stop.isValid()) { - // Start of job, set lastIOVRange to the incoming IOV - IOVRange minRange = tagInfoCond->minRange(); - start = minRange.start(); - stop = minRange.stop(); + if (tagInfoCond) { + // set to the IOV of the incoming conditions + // if run num is in previous IOV, set new IOV to be [runNum, lastStop) + IOVTime testTime(runNumber, 0); + IOVTime start = m_lastIOVRange.start(); + IOVTime stop = m_lastIOVRange.stop(); + bool isFirstIOVCheck = false; + if (!start.isValid() || !stop.isValid()) { + // Start of job, set lastIOVRange to the incoming IOV + IOVRange minRange = tagInfoCond->minRange(); + start = minRange.start(); + stop = minRange.stop(); + m_lastIOVRange = IOVRange(start, stop); + isFirstIOVCheck = true; // + } + if (m_lastIOVRange.isInRange(testTime)) { + // set start to runNumber after the + if (!isFirstIOVCheck) start = testTime; + ATH_MSG_DEBUG( "fillMetaData: run number is in previous IOVRange: " << runNumber << " " << m_lastIOVRange); + } + else { + // Out of range + start = testTime; + stop = IOVTime(runNumber + 1, 0); + ATH_MSG_DEBUG( "fillMetaData: run number is outside of previous IOVRange: " << runNumber << " " << m_lastIOVRange << ". Reset range to run number."); + } + attrListColl->addNewStart(start); + attrListColl->addNewStop (stop); m_lastIOVRange = IOVRange(start, stop); - isFirstIOVCheck = true; // - } - if (m_lastIOVRange.isInRange(testTime)) { - // set start to runNumber after the - if (!isFirstIOVCheck) start = testTime; - ATH_MSG_DEBUG( "fillMetaData: run number is in previous IOVRange: " << runNumber << " " << m_lastIOVRange); + ATH_MSG_DEBUG( "fillMetaData: start, stop: " << start << " " << stop); } else { - // Out of range - start = testTime; - stop = IOVTime(runNumber + 1, 0); - ATH_MSG_DEBUG( "fillMetaData: run number is outside of previous IOVRange: " << runNumber << " " << m_lastIOVRange << ". Reset range to run number."); - } - attrListColl->addNewStart(start); - attrListColl->addNewStop (stop); - m_lastIOVRange = IOVRange(start, stop); - ATH_MSG_DEBUG( "fillMetaData: start, stop: " << start << " " << stop); + // set to the IOV of this run to run+1 + attrListColl->addNewStart(IOVTime(runNumber, 0)); + attrListColl->addNewStop(IOVTime(runNumber + 1, 0)); + } /// Register folder in the IOV Db MetaData if (StatusCode::SUCCESS != m_metaDataTool->registerFolder("/TagInfo")) { diff --git a/Event/EventInfoMgt/src/TagInfoMgr.h b/Event/EventInfoMgt/src/TagInfoMgr.h index 09a29d7c3125f202b14266f37feb6d227096ac74..32aab1c333270b9b4c3a9441fbccb0f61470c0f2 100755 --- a/Event/EventInfoMgt/src/TagInfoMgr.h +++ b/Event/EventInfoMgt/src/TagInfoMgr.h @@ -28,17 +28,16 @@ #include "GaudiKernel/IIncidentListener.h" #include "AthenaKernel/IAddressProvider.h" #include "AthenaKernel/IOVRange.h" +#include "AthenaKernel/IIOVDbSvc.h" #include "GaudiKernel/MsgStream.h" #include "EventInfo/TagInfo.h" +#include "IOVDbMetaDataTools/IIOVDbMetaDataTool.h" #include <map> //<<<<<< PUBLIC TYPES >>>>>> class StoreGateSvc; -class TagInfo; -class IIOVDbSvc; -class IIOVDbMetaDataTool; class CondAttrListCollection; //<<<<<< CLASS DECLARATIONS >>>>>> @@ -192,11 +191,11 @@ private: /// Flag to add override the tags from EventInfo from other /// sources - Gaudi::Property<bool> m_overrideEventInfoTags{this,"OverrideEventInfoTags",true,"Override tags yes/no"}; + Gaudi::Property<bool> m_overrideEventInfoTags { this, "OverrideEventInfoTags", true, "Override tags yes/no" }; /// Extra tags/values pairs added in my jobOptions Gaudi::Property<std::map<std::string,std::string> > - m_extraTagValuePairs{this,"ExtraTagValuePairs",{},"key/value pairs to be added", "mapMergeNoReplace<T,T>"}; + m_extraTagValuePairs { this, "ExtraTagValuePairs", {}, "key/value pairs to be added", "mapMergeNoReplace<T,T>" }; /// Extra tags/values pairs added in via interface std::map<std::string,std::string> m_extraTagValuePairsViaInterface; @@ -205,33 +204,30 @@ private: std::set<std::string> m_tagsToBeRemoved; /// The StoreGate key for the TagInfo - Gaudi::Property<std::string> m_tagInfoKey{this,"TagInfoKey","ProcessingTags","SG key for TagInfo"}; + Gaudi::Property<std::string> m_tagInfoKey{ this, "TagInfoKey", "ProcessingTags", "SG key for TagInfo" }; std::string m_tagInfoKeyValue; /// The event store - ServiceHandle<StoreGateSvc> m_storeGate; + ServiceHandle<StoreGateSvc> m_storeGate { this, "StoreGateSvc", "StoreGateSvc" }; /// The detector store - ServiceHandle<StoreGateSvc> m_detStore; + ServiceHandle<StoreGateSvc> m_detStore { this, "DetectorStore", "DetectorStore" }; /// Access to IOVDbSvc interface - used to register callback - ServiceHandle<IIOVDbSvc> m_iovDbSvc; + ServiceHandle<IIOVDbSvc> m_iovDbSvc { this, "IOVDbSvc", "IOVDbSvc" }; /// Access to iov meta data tool - ToolHandle<IIOVDbMetaDataTool> m_metaDataTool; + ToolHandle<IIOVDbMetaDataTool> m_metaDataTool { this, "IOVDbMetaDataTool", "IOVDbMetaDataTool" }; /// Flag to identify the first BeginRun incident - bool m_isFirstBeginRun; + bool m_isFirstBeginRun { true }; /// conditionsRun from the first BeginRun incident (HLT) - EventIDBase::number_type m_conditionsRun; - - /// Flag to identify a new file incident - bool m_newFileIncidentSeen; + EventIDBase::number_type m_conditionsRun { EventIDBase::UNDEFNUM }; /// IOVRange of last TagInfo added to the file meta data - IOVRange m_lastIOVRange; + IOVRange m_lastIOVRange { IOVRange(IOVTime(), IOVTime()) }; /// Last TagInfo added to the detector store TagInfo m_lastTagInfo;