Skip to content
Snippets Groups Projects
Commit ad6d98b9 authored by R D Schaffer's avatar R D Schaffer
Browse files

put back in logic for fillMetaData which has no incoming...

put back in logic for fillMetaData which has no incoming CondAttrListCollection which happens when no TagInfo is on the input. This is of course standard for the first job in a sequence
parent f06f4a5a
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!35308removed use of BeginEvent incident
......@@ -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")) {
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment