Skip to content
Snippets Groups Projects
Commit a7ffc841 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'taginfoFixes1' into 'master'

update tests for changes to TagInfoMgr output

See merge request atlas/athena!35464
parents 9638f1a7 d81fcea5
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ function (athenapooltest_run_test testName jo pattern)
@ONLY )
atlas_add_test( ${testName}
SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/athenapooltest_${testName}.sh
ENVIRONMENT "ATLAS_REFERENCE_TAG=AthenaPoolTest/AthenaPoolTest-01-00-08"
ENVIRONMENT "ATLAS_REFERENCE_TAG=AthenaPoolTest/AthenaPoolTest-01-00-09"
POST_EXEC_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/test/post_check_with_select.sh ${testName} ${pattern}"
PROPERTIES TIMEOUT 900
)
......@@ -49,7 +49,7 @@ endfunction (athenapooltest_run_test)
# Write/read out some simple objects:
athenapooltest_run_test( AthenaPoolTestWrite AthenaPoolTestWrite
"^..AthenaPoolTestD" )
"^AthenaPoolTestD" )
athenapooltest_run_test( AthenaPoolTestRead AthenaPoolTestRead
"AthenaPoolTestD"
DEPENDS AthenaPoolTestWrite )
......
......@@ -93,9 +93,6 @@ AthenaEventLoopMgr.OutputLevel = INFO
EventInfoReader.OutputLevel = DEBUG
svcMgr.TagInfoMgr.OutputLevel = DEBUG
svcMgr.IOVDbSvc.OutputLevel = DEBUG
svcMgr.IOVSvc.OutputLevel = DEBUG
#svcMgr.DetectorStore.Dump = TRUE
# No stats printout
......
......@@ -121,7 +121,7 @@ svcMgr.TagInfoMgr.OutputLevel = DEBUG
#--------------------------------------------------------------
from IOVDbMetaDataTools.IOVDbMetaDataToolsConf import IOVDbMetaDataTool
ToolSvc += IOVDbMetaDataTool( "IOVDbMetaDataTool" )
IOVDbMetaDataTool.OutputLevel = DEBUG
IOVDbMetaDataTool.OutputLevel = INFO
# No stats printout
include( "AthenaPoolTest/NoStats_jobOptions.py" )
......
......@@ -123,10 +123,10 @@ StatusCode TagInfoMgr::initialize()
ATH_MSG_DEBUG( "TagInfoKey " << m_tagInfoKey);
if (msgLvl(MSG::DEBUG)) {
msg(MSG::DEBUG) << "ExtraTagValuePairs " << endmsg;
for (auto& tv : m_extraTagValuePairs) {
msg(MSG::DEBUG) << " Value/tag pair: " << tv.first << " " << tv.second << endmsg;
}
ATH_MSG_DEBUG( "ExtraTagValuePairs " );
for (auto& tv : m_extraTagValuePairs) {
ATH_MSG_DEBUG( " Value/tag pair: " << tv.first << " " << tv.second );
}
}
// To copy TagInfo to EventInfo, we set listener to the
......@@ -138,10 +138,9 @@ StatusCode TagInfoMgr::initialize()
// file meta data
incSvc->addListener( this, "BeginRun", pri);
// Add BeginInputFile to trigger refilling meta data store after a new input
// file - priority has to be < 50 to be run after IOVDbMetaDataTool, which
// has mergeing into the output file medat data the input meta data of the
// new file.
// Add BeginInputFile to trigger refilling meta data store after a new input file - priority has
// to be < 50 to be run after IOVDbMetaDataTool (triggered by MetaDataSvc), which has mergeing
// into the output file medat data the input meta data of the new file.
incSvc->addListener(this, "BeginInputFile", 50); //
return StatusCode::SUCCESS;
......@@ -288,13 +287,11 @@ TagInfoMgr::fillTagInfo(const CondAttrListCollection* tagInfoCond, TagInfo* tagI
EventType::NameTagPairVec pairs1;
evtH->event_type()->get_detdescr_tags(pairs1);
if (msgLvl(MSG::DEBUG)) {
if(pairs1.size()) {
ATH_MSG_DEBUG( "fillTagInfo: Pairs from EventType:");
}
else {
ATH_MSG_DEBUG( "fillTagInfo: EventInfo/EventType has no tags");
}
if(pairs1.size()) {
ATH_MSG_DEBUG( "fillTagInfo: Pairs from EventType:");
}
else {
ATH_MSG_DEBUG( "fillTagInfo: EventInfo/EventType has no tags");
}
for (unsigned int i = 0; i < pairs1.size(); ++i) {
ATH_MSG_DEBUG( "fillTagInfo: " << pairs1[i].first << " : "
......@@ -342,10 +339,8 @@ TagInfoMgr::fillTagInfo(const CondAttrListCollection* tagInfoCond, TagInfo* tagI
}
// Dump out contents of TagInfo
if (msgLvl(MSG::DEBUG)) {
ATH_MSG_DEBUG( "fillTagInfo: print out tags before adding extra tags");
ATH_MSG_DEBUG(tagInfo->str());
}
ATH_MSG_DEBUG( "fillTagInfo: print out tags before adding extra tags");
ATH_MSG_DEBUG(tagInfo->str());
// Add in any extra tag value pairs if specified
......@@ -364,10 +359,8 @@ TagInfoMgr::fillTagInfo(const CondAttrListCollection* tagInfoCond, TagInfo* tagI
}
// Dump out contents of TagInfo
if (msgLvl(MSG::DEBUG)) {
ATH_MSG_DEBUG( "fillTagInfo: print out tags");
ATH_MSG_DEBUG(tagInfo->str());
}
ATH_MSG_DEBUG( "fillTagInfo: print out tags");
ATH_MSG_DEBUG(tagInfo->str());
return StatusCode::SUCCESS;
......@@ -394,23 +387,19 @@ TagInfoMgr::fillMetaData (const TagInfo* tagInfo, const CondAttrListCollection
ATH_MSG_DEBUG( "entering fillMetaData");
// Get run number for IOV
EventIDBase::number_type runNumber = 0;
const EventIDBase* evid = EventIDFromStore( m_storeGate );
if( evid ) {
runNumber = evid->run_number();
EventIDBase::number_type runNumber = EventIDBase::UNDEFNUM;
if( m_currentRun != EventIDBase::UNDEFNUM ) {
runNumber = m_currentRun;
}
else if( m_conditionsRun != EventIDBase::UNDEFNUM ) {
// For HLT use the conditionsRun retrieved from the first BeginRun incident
runNumber = m_conditionsRun;
} else {
// For simulation, we may be in the initialization phase and
// must get the run number from the event selector
if (StatusCode::SUCCESS != getRunNumber (runNumber)) {
// For HLT use the conditionsRun retrieved from the first BeginRun incident
if( m_conditionsRun != EventIDBase::UNDEFNUM ) {
runNumber = m_conditionsRun;
} else {
ATH_MSG_ERROR( "fillMetaData: Could not get event info neither via retrieve nor from the EventSelectror");
return (StatusCode::FAILURE);
}
}
ATH_MSG_ERROR( "fillMetaData: Could not get event info neither via retrieve nor from the EventSelector");
return (StatusCode::FAILURE);
}
// Copy tags to AttributeList
coral::AttributeList attrList;
EventType::NameTagPairVec pairs;
......@@ -480,65 +469,6 @@ TagInfoMgr::fillMetaData (const TagInfo* tagInfo, const CondAttrListCollection
}
StatusCode
TagInfoMgr::getRunNumber (unsigned int& runNumber)
{
// check if EventSelector is being used to override run numbers if
// so, we return the runNumber from the properties of the
// EventSelector
// Get run number parameter from the EventSelector
ATH_MSG_DEBUG( "getRunNumber: check if tag is set in jobOpts");
// Get name of event selector from the application manager to
// make sure we get the one for MC signal events
IProperty* propertyServer(0);
StatusCode sc = serviceLocator()->service("ApplicationMgr", propertyServer);
if (sc != StatusCode::SUCCESS ) {
ATH_MSG_ERROR( "getRunNumber: Cannot get ApplicationMgr ");
return StatusCode::FAILURE;
}
StringProperty property("EvtSel", "");
sc = propertyServer->getProperty(&property);
if (!sc.isSuccess()) {
ATH_MSG_ERROR( "getRunNumber: unable to get EvtSel: found " << property.value());
return StatusCode::FAILURE;
}
// Get EventSelector for ApplicationMgr
std::string eventSelector = property.value();
sc = serviceLocator()->service(eventSelector, propertyServer);
if (sc != StatusCode::SUCCESS ) {
ATH_MSG_ERROR( "getRunNumber: Cannot get EventSelector " << eventSelector);
return StatusCode::FAILURE;
}
BooleanProperty overrideRunNumber = BooleanProperty("OverrideRunNumber", false);
sc = propertyServer->getProperty(&overrideRunNumber);
if (!sc.isSuccess()) {
// Not all EventSelectors have this property, but we should
// not get here if the ES is not one for simulation => return failure
ATH_MSG_WARNING( "getRunNumber: unable to get OverrideRunNumber property from EventSelector ");
return StatusCode::FAILURE;
}
if (overrideRunNumber.value()) {
IntegerProperty runNumberProp = IntegerProperty("RunNumber", 0);
sc = propertyServer->getProperty(&runNumberProp);
if (!sc.isSuccess()) {
ATH_MSG_ERROR( "getRunNumber: unable to get RunNumber from EventSelector: found "
<< runNumberProp.value());
return StatusCode::FAILURE;
}
else {
runNumber = runNumberProp.value();
ATH_MSG_DEBUG( "getRunNumber: Run number: "
<< runNumber << " obtained from "
<< eventSelector);
}
}
else {
ATH_MSG_ERROR( "getRunNumber: OverrideRunNumber from EventSelector is false ");
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
void
......@@ -549,7 +479,10 @@ TagInfoMgr::handle(const Incident& inc) {
**
** 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.
** hierarchical tags.
** The member m_currentRun is saved to be used for the IOV
** in fillMetaData.
**
** Note: the detector store 'retrieve' of the TagInfo will call
** TagInfoMgr::createObj to do the first creation and filling it
** accordingly. And this also fills the output file metadata with
......@@ -557,11 +490,15 @@ TagInfoMgr::handle(const Incident& inc) {
**
** 2) Then whenever a new file is opened (BeginInputFile), we
** use the TagInfo object from the detector store to "re-fill"
** and override the newly merged TagInfo meta data in the output
** 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.
**
**/
......@@ -587,15 +524,18 @@ TagInfoMgr::handle(const Incident& inc) {
// can't use a ref here!
const EventIDBase eventID = inc.context().eventID();
if (msgLvl(MSG::DEBUG)) {
msg() << MSG::DEBUG << "handle: First BeginRun incident - Event ID: ["
<< eventID.run_number() << ","
<< eventID.event_number() << ":"
<< eventID.time_stamp() << "] ";
if( m_conditionsRun != EventIDBase::UNDEFNUM ) {
msg() << MSG::DEBUG <<"conditionsRun = " << m_conditionsRun;
}
msg() << MSG::DEBUG << endmsg;
// Set current run number to be used for fillMetaData
m_currentRun = eventID.run_number();
ATH_MSG_DEBUG( "handle: First BeginRun incident - Event ID: ["
<< eventID.run_number() << ","
<< eventID.lumi_block() << ":"
<< eventID.time_stamp() << "] ");
if( m_conditionsRun != EventIDBase::UNDEFNUM ) {
ATH_MSG_DEBUG( "handle: conditionsRun = " << m_conditionsRun);
}
if( m_currentRun != EventIDBase::UNDEFNUM ) {
ATH_MSG_DEBUG( "handle: currentRun = " << m_currentRun);
}
// For the moment, we must set IOVDbSvc into the BeginRun
......@@ -646,40 +586,70 @@ TagInfoMgr::handle(const Incident& inc) {
ATH_MSG_DEBUG( "handle: TagInfo successfully processed by IOVDbSvc to register callback");
}
}
else if (inc.type() == "BeginInputFile" && !m_isFirstBeginRun) {
// For a new file incident, we must "refill" the
// meta data store with the current value of the TagInfo
// folder in the detector store.
else if ((inc.type() == IncidentType::BeginInputFile || inc.type() == IncidentType::BeginRun)
&& !m_isFirstBeginRun) {
// For a new file incident or a subsequent begin run incident, we must "refill" the meta
// data store with the current value of the TagInfo folder in the detector store.
if (inc.type() == IncidentType::BeginRun) {
// For begin run, reset the current run number
// get conditionsRun from the Context - can be used if no EventID in the SG (for HLT)
m_conditionsRun = Atlas::getExtendedEventContext(inc.context()).conditionsRun();
// Get current run number
const EventIDBase eventID = inc.context().eventID();
// Set current run number to be used for fillMetaData
m_currentRun = eventID.run_number();
ATH_MSG_DEBUG( "handle: secondary BeginRun incident - Event ID: ["
<< eventID.run_number() << ","
<< eventID.lumi_block() << ":"
<< eventID.time_stamp() << "] ");
if( m_conditionsRun != EventIDBase::UNDEFNUM ) {
ATH_MSG_DEBUG( "handle: conditionsRun = " << m_conditionsRun);
}
if( m_currentRun != EventIDBase::UNDEFNUM ) {
ATH_MSG_DEBUG( "handle: currentRun = " << m_currentRun);
}
}
// Return if /TagInfo does NOT exists
const CondAttrListCollection* attrListColl = 0;
if (m_detStore->contains<CondAttrListCollection>("/TagInfo")) {
if (m_detStore->retrieve( attrListColl, "/TagInfo" ).isFailure() ) {
ATH_MSG_ERROR( "handle - BeginInputFile: No TagInfo meta data in DetectorStore");
throw GaudiException( "BeginInputFile - No TagInfo meta data in DetectorStore", "TagInfoMgr::handle", StatusCode::FAILURE );
ATH_MSG_ERROR( "handle - " << inc.type() << ": No TagInfo meta data in DetectorStore");
std::string excStr { inc.type() + " - No TagInfo meta data in DetectorStore" };
throw GaudiException( excStr , "TagInfoMgr::handle", StatusCode::FAILURE );
}
else {
ATH_MSG_DEBUG( "handle - BeginInputFile: Retrieved TagInfo meta data from detStore");
ATH_MSG_DEBUG( "handle - " << inc.type() << ": Retrieved TagInfo meta data from detStore");
}
}
else {
ATH_MSG_DEBUG( "handle - BeginInputFile: det store does NOT contain AttrListColl for TagInfo");
ATH_MSG_DEBUG( "handle - " << inc.type() << ": det store does NOT contain AttrListColl for TagInfo");
return;
}
const TagInfo* tagInfo = 0;
if (m_detStore->retrieve( tagInfo, m_tagInfoKeyValue ).isFailure() ) {
ATH_MSG_ERROR( "handle - BeginInputFile: Could not retrieve TagInfo object from the detector store");
throw GaudiException( "BeginInputFile - Could not retrieve TagInfo object from the detector store", "TagInfoMgr::handle", StatusCode::FAILURE );
ATH_MSG_ERROR( "handle - " << inc.type() << ": Could not retrieve TagInfo object from the detector store");
std::string excStr { inc.type() + " - Could not retrieve TagInfo object from the detector store" };
throw GaudiException( excStr, "TagInfoMgr::handle", StatusCode::FAILURE );
}
// Copy TagInfo to meta data store for writing to file meta data
if (StatusCode::SUCCESS != fillMetaData(tagInfo, attrListColl)) {
ATH_MSG_ERROR( "handle - BeginInputFile: Unable to write TagInfo to MetaDataStore !");
throw GaudiException( "BeginInputFile - Unable to write TagInfo to MetaDataStore !", "TagInfoMgr::handle", StatusCode::FAILURE );
ATH_MSG_ERROR( "handle - " << inc.type() << ": Unable to write TagInfo to MetaDataStore !");
std::string excStr { inc.type() + " - Unable to write TagInfo to MetaDataStore !" };
throw GaudiException( excStr, "TagInfoMgr::handle", StatusCode::FAILURE );
}
else {
ATH_MSG_DEBUG( "handle - BeginInputFile: Wrote TagInfo to MetaDataStore ");
ATH_MSG_DEBUG( "handle - " << inc.type() << ": Wrote TagInfo to MetaDataStore ");
}
}
}
......@@ -845,13 +815,8 @@ TagInfoMgr::createObj(IOpaqueAddress* addr, DataObject*& dataObj) {
// most likely not used anymore. RDS 08/2012).
if (attrListColl && attrListColl->size() == 0) {
tagInfo = std::make_unique<TagInfo>(m_lastTagInfo);
if (msgLvl(MSG::DEBUG)) {
ATH_MSG_DEBUG( "createObj: recreate tagInfo from saved info");
if (msgLevel()>=MSG::DEBUG) {
MsgStream log1(Athena::getMessageSvc(), "TagInfo");
tagInfo->printTags(log1);
}
}
ATH_MSG_DEBUG( "createObj: recreate tagInfo from saved info");
ATH_MSG_DEBUG(tagInfo->str());
}
else {
tagInfo = std::make_unique<TagInfo>();
......@@ -859,10 +824,8 @@ TagInfoMgr::createObj(IOpaqueAddress* addr, DataObject*& dataObj) {
ATH_MSG_DEBUG( "createObj: Unable to fill TagInfo !");
return StatusCode::FAILURE;
}
if (msgLvl(MSG::DEBUG)) {
if (attrListColl) ATH_MSG_DEBUG( "createObj: Filled TagInfo from file meta data ");
else ATH_MSG_DEBUG( "createObj: Filled TagInfo from input event ");
}
if (attrListColl) ATH_MSG_DEBUG( "createObj: Filled TagInfo from file meta data ");
else ATH_MSG_DEBUG( "createObj: Filled TagInfo from input event ");
}
// Copy TagInfo to meta data store for writing to file meta data
......@@ -877,9 +840,8 @@ TagInfoMgr::createObj(IOpaqueAddress* addr, DataObject*& dataObj) {
// Do standard conversion to data object
dataObj = SG::asStorable(std::move(tagInfo));
if (msgLvl(MSG::DEBUG)) {
ATH_MSG_DEBUG( "createObj: created new TagInfo object ");
}
ATH_MSG_DEBUG( "createObj: created new TagInfo object ");
return StatusCode::SUCCESS;
}
......
......@@ -175,7 +175,6 @@ private:
TagInfoMgr();
TagInfoMgr(const TagInfoMgr&);
TagInfoMgr &operator=(const TagInfoMgr&);
StatusCode getRunNumber (unsigned int& runNumber);
///////////////////////////////////////////////////////////////////
// Private data:
......@@ -226,6 +225,9 @@ private:
/// conditionsRun from the first BeginRun incident (HLT)
EventIDBase::number_type m_conditionsRun { EventIDBase::UNDEFNUM };
/// current run number from BeginRun incident
EventIDBase::number_type m_currentRun { EventIDBase::UNDEFNUM };
/// IOVRange of last TagInfo added to the file meta data
IOVRange m_lastIOVRange { IOVRange(IOVTime(), IOVTime()) };
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
......@@ -32,7 +32,6 @@ namespace MagField {
StatusCode initialize() override final;
StatusCode execute(const EventContext& ctx) const override final;
StatusCode finalize() override final;
private:
......@@ -49,7 +48,7 @@ namespace MagField {
EventIDRange m_condObjOutputRange {EventIDRange(EventIDBase(0,0), EventIDBase(EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFEVT-1))};
};
StatusCode updateCurrentFromConditions(const EventContext& ctx, Cache& cache) const;
StatusCode updateCurrentFromParameters(Cache& cache) const;
StatusCode updateCurrentFromParameters(const EventContext& ctx, Cache& cache) const;
void scaleField(Cache& cache, const MagField::AtlasFieldMap* fieldMap) const;
// threshold below which currents are considered zero
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
......@@ -33,7 +33,6 @@ namespace MagField {
StatusCode start() override final;
StatusCode initialize() override final;
StatusCode execute(const EventContext& ctx) const override final;
StatusCode finalize() override final;
private:
......
......@@ -35,7 +35,6 @@ MagField::AtlasFieldCacheCondAlg::~AtlasFieldCacheCondAlg()= default;
StatusCode
MagField::AtlasFieldCacheCondAlg::initialize() {
ATH_MSG_INFO ("Initialize");
// CondSvc
ATH_CHECK( m_condSvc.retrieve() );
......@@ -92,7 +91,7 @@ MagField::AtlasFieldCacheCondAlg::execute(const EventContext& ctx) const {
ATH_CHECK( updateCurrentFromConditions(ctx, cache) );
}
else {
ATH_CHECK( updateCurrentFromParameters(cache) );
ATH_CHECK( updateCurrentFromParameters(ctx, cache) );
}
// Must read map cond object to get previously created map
......@@ -129,7 +128,8 @@ MagField::AtlasFieldCacheCondAlg::execute(const EventContext& ctx) const {
}
ATH_MSG_INFO ( "execute: initialized AtlasFieldCacheCondObj and cache with SFs - sol/tor "
<< cache.m_solScaleFactor << "/" << cache.m_torScaleFactor );
<< cache.m_solScaleFactor << "/" << cache.m_torScaleFactor
<< ", EventRange " << cache.m_condObjOutputRange );
if (fieldMap) {
ATH_MSG_INFO ( "execute: solenoid zone id " << fieldMap->solenoidZoneId());
}
......@@ -143,7 +143,6 @@ MagField::AtlasFieldCacheCondAlg::execute(const EventContext& ctx) const {
StatusCode
MagField::AtlasFieldCacheCondAlg::updateCurrentFromConditions(const EventContext& ctx, Cache& cache) const
{
ATH_MSG_INFO ( "UpdateCurrentFromConditions " );
// readin current value
SG::ReadCondHandle<CondAttrListCollection> readHandle {m_currInputKey, ctx};
......@@ -234,10 +233,9 @@ MagField::AtlasFieldCacheCondAlg::updateCurrentFromConditions(const EventContext
StatusCode
MagField::AtlasFieldCacheCondAlg::updateCurrentFromParameters(Cache& cache) const
MagField::AtlasFieldCacheCondAlg::updateCurrentFromParameters(const EventContext& ctx, Cache& cache) const
{
ATH_MSG_INFO( "updateCurrentFromParameters" );
// take the current values from JobOptions
double solcur{m_useSoleCurrent};
double torcur{m_useToroCurrent};
......@@ -251,8 +249,17 @@ MagField::AtlasFieldCacheCondAlg::updateCurrentFromParameters(Cache& cache) cons
}
cache.m_solenoidCurrent = solcur;
cache.m_toroidCurrent = torcur;
ATH_MSG_INFO("updateCurrentFromParameters: Update from job options: Range of input/output is " << cache.m_condObjOutputRange);
ATH_MSG_INFO("updateCurrentFromParameters: Currents taken from jobOption parameters " );
// in case of reading from DB or from FILE, the EventID range is always the current run
EventIDBase start, stop;
start.set_run_number(ctx.eventID().run_number());
start.set_lumi_block(0);
stop.set_run_number(ctx.eventID().run_number()+1);
stop.set_lumi_block(0);
cache.m_condObjOutputRange = EventIDRange(start,stop);
ATH_MSG_INFO("updateCurrentFromParameters: Update from job options: Range of input/output is " << cache.m_condObjOutputRange);
return StatusCode::SUCCESS;
}
......@@ -294,13 +301,3 @@ MagField::AtlasFieldCacheCondAlg::scaleField(Cache& cache, const MagField::Atlas
<< cache.m_toroidCurrent << "," << ((fieldMap) ? fieldMap->toroidCurrent() : 0));
}
}
StatusCode
MagField::AtlasFieldCacheCondAlg::finalize() {
ATH_MSG_INFO ( " in finalize " );
return StatusCode::SUCCESS;
}
......@@ -38,7 +38,6 @@ MagField::AtlasFieldMapCondAlg::~AtlasFieldMapCondAlg()= default;
StatusCode
MagField::AtlasFieldMapCondAlg::initialize() {
ATH_MSG_INFO ("Initialize");
// CondSvc
ATH_CHECK( m_condSvc.retrieve() );
......@@ -59,7 +58,7 @@ MagField::AtlasFieldMapCondAlg::initialize() {
ATH_MSG_INFO ( "Initialize: Key " << m_mapCondObjOutputKey.fullKey() << " has been succesfully registered " );
if (m_useMapsFromCOOL) {
ATH_MSG_INFO ( "Initialize: Will update the field map from conditions"); //
ATH_MSG_INFO ( "Initialize: Will update the field map from conditions");
}
else {
ATH_MSG_INFO ( "Initialize: Will update the field map from jobOpt file name");
......@@ -82,7 +81,7 @@ MagField::AtlasFieldMapCondAlg::start() {
StatusCode
MagField::AtlasFieldMapCondAlg::execute(const EventContext& ctx) const {
ATH_MSG_DEBUG ( "execute: entering ");
ATH_MSG_DEBUG ( "execute: entering " << ctx.eventID() );
// Check if output conditions object with field map object is still valid, if not replace it
// with new map
......@@ -104,9 +103,7 @@ MagField::AtlasFieldMapCondAlg::execute(const EventContext& ctx) const {
else {
ATH_MSG_INFO ( "execute: no map read (currents == 0");
}
// Save newly created map in conditions object, and record it in the conditions store, with its
// own range
auto fieldMapCondObj = std::make_unique<AtlasFieldMapCondObj>();
......@@ -119,7 +116,7 @@ MagField::AtlasFieldMapCondAlg::execute(const EventContext& ctx) const {
<< " into Conditions Store");
return StatusCode::FAILURE;
}
ATH_MSG_INFO ( "execute: recored AtlasFieldMapCondObj with field map");
ATH_MSG_INFO ( "execute: recorded AtlasFieldMapCondObj with EventRange " << cache.m_mapCondObjOutputRange );
return StatusCode::SUCCESS;
}
......@@ -200,13 +197,16 @@ MagField::AtlasFieldMapCondAlg::updateFieldMap(const EventContext& ctx, Cache& c
cache.m_mapSoleCurrent = m_mapSoleCurrent;
cache.m_mapToroCurrent = m_mapToroCurrent;
// Create a range from 0 to inf in terms of run, LB
const EventIDBase::number_type UNDEFNUM = EventIDBase::UNDEFNUM;
const EventIDBase::event_number_t UNDEFEVT = EventIDBase::UNDEFEVT;
EventIDRange rangeW (EventIDBase (0, UNDEFEVT, UNDEFNUM, 0, 0),
EventIDBase (UNDEFNUM-1, UNDEFEVT, UNDEFNUM, UNDEFNUM, 0));
cache.m_mapCondObjOutputRange = rangeW;
ATH_MSG_INFO("updateFieldMap: useMapsFromCOOL == false, using default range " << rangeW);
// Create a range for the current run
EventIDBase start, stop;
start.set_run_number(ctx.eventID().run_number());
start.set_lumi_block(0);
stop.set_run_number(ctx.eventID().run_number()+1);
stop.set_lumi_block(0);
cache.m_mapCondObjOutputRange = EventIDRange(start,stop);
ATH_MSG_INFO("updateFieldMap: useMapsFromCOOL == false, using default range "
<< cache.m_mapCondObjOutputRange);
}
// We allow to set currents via the TagInfoMgr which adds tags to the TagInfo object - only allowed for offline
......@@ -312,10 +312,3 @@ MagField::AtlasFieldMapCondAlg::updateFieldMap(const EventContext& ctx, Cache& c
return StatusCode::SUCCESS;
}
StatusCode
MagField::AtlasFieldMapCondAlg::finalize() {
ATH_MSG_INFO ( " in finalize " );
return StatusCode::SUCCESS;
}
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