From 212756e17c18c7a08ec871865f001d9a3ba398ac Mon Sep 17 00:00:00 2001
From: scott snyder <scott.snyder@cern.ch>
Date: Tue, 18 Jul 2017 14:28:19 +0200
Subject: [PATCH] IOVSvc: Conditions should be indexed by run+lbn, not
 run+event.

Run-based conditions should be indexed by run+lbn, but the condition handle
code was using run+event instead.  Fix so that run+lbn is used.



Former-commit-id: 7e74b3d05561e89f0fdba8dc5dcbd972499a1a43
---
 Control/IOVSvc/src/CondInputLoader.cxx | 6 ++++--
 Control/IOVSvc/src/IOVSvc.cxx          | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Control/IOVSvc/src/CondInputLoader.cxx b/Control/IOVSvc/src/CondInputLoader.cxx
index f6c11ee564b..8dede9f513e 100644
--- a/Control/IOVSvc/src/CondInputLoader.cxx
+++ b/Control/IOVSvc/src/CondInputLoader.cxx
@@ -218,6 +218,7 @@ CondInputLoader::execute()
     }
     now.set_run_number(thisEventInfo->runNumber());
     now.set_event_number(thisEventInfo->eventNumber());
+    now.set_lumi_block(thisEventInfo->lumiBlock());
     now.set_time_stamp(thisEventInfo->timeStamp());
     now.set_time_stamp_ns_offset(thisEventInfo->timeStampNSOffset());
   }
@@ -225,11 +226,13 @@ CondInputLoader::execute()
 #ifdef GAUDI_SYSEXECUTE_WITHCONTEXT
     now.set_run_number(getContext().eventID().run_number());
     now.set_event_number(getContext().eventID().event_number());
+    now.set_lumi_block(getContext().eventID().lumi_block());
     now.set_time_stamp(getContext().eventID().time_stamp());
     now.set_time_stamp_ns_offset(getContext().eventID().time_stamp_ns_offset());
 #else
     now.set_run_number(getContext()->eventID().run_number());
     now.set_event_number(getContext()->eventID().event_number());
+    now.set_lumi_block(getContext()->eventID().lumi_block());
     now.set_time_stamp(getContext()->eventID().time_stamp());
     now.set_time_stamp_ns_offset(getContext()->eventID().time_stamp_ns_offset());
 #endif
@@ -245,10 +248,9 @@ CondInputLoader::execute()
       now.set_run_number ((*input)["ConditionsRun"].data<unsigned int>());
   }
 
-  IOVTime t(now.run_number(), now.event_number(), now.time_stamp());
+  IOVTime t(now.run_number(), now.lumi_block(), now.time_stamp());
 
   StatusCode sc(StatusCode::SUCCESS);
-  EventIDRange r;
   std::string tag;
   for (auto &vhk: m_vhk) {
     ATH_MSG_DEBUG( "handling id: " << vhk.fullKey() << " key: " << vhk.key() );
diff --git a/Control/IOVSvc/src/IOVSvc.cxx b/Control/IOVSvc/src/IOVSvc.cxx
index fa611940d6a..54fb6b9fd8c 100755
--- a/Control/IOVSvc/src/IOVSvc.cxx
+++ b/Control/IOVSvc/src/IOVSvc.cxx
@@ -853,7 +853,7 @@ IOVSvc::createCondObj(CondContBase* ccb, const DataObjID& id,
     return StatusCode::SUCCESS;
   }
 
-  IOVTime t(now.run_number(), now.event_number(), (long long)now.time_stamp()*1000000000+now.time_stamp_ns_offset());
+  IOVTime t(now.run_number(), now.lumi_block(), (long long)now.time_stamp()*1000000000+now.time_stamp_ns_offset());
   IOVRange range;
   IOpaqueAddress* ioa;
   std::string tag;
-- 
GitLab