From c9784a45dd3e1cc3ba4635e36bc7c127e410d9df Mon Sep 17 00:00:00 2001
From: John Kenneth Anders <john.kenneth.anders@cern.ch>
Date: Wed, 13 Mar 2019 15:42:33 +0000
Subject: [PATCH] Merge branch '21.0-fix-dcsc' into '21.0'

Fix failure on invalid LumiAccounting data (affected 301915 and 301918)

See merge request atlas/athena!21859

(cherry picked from commit 17869351050366564c42cf6547ba3f255b45053e)

ac49dc79 Fix failure on invalid LumiAccounting data (affected 301915 and 301918)
---
 .../python/subdetectors/global_system.py               | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/DataQuality/DCSCalculator2/python/subdetectors/global_system.py b/DataQuality/DCSCalculator2/python/subdetectors/global_system.py
index d63ec4023b96..7d4b02bf0e41 100644
--- a/DataQuality/DCSCalculator2/python/subdetectors/global_system.py
+++ b/DataQuality/DCSCalculator2/python/subdetectors/global_system.py
@@ -48,10 +48,14 @@ class TDAQ_Busy(DCSC_Defect_Global_Variable):
 	counter=0
 
         for since, until, (state,) in events:
-            if state.Run == 0: continue
+            if state.Run == 0 or state.Run is None: continue
 	    #print state
             if state is not None:
-                deadfrac = 1-state.LiveFraction
+                if state.LiveFraction is None:
+                    deadfrac=1
+                    print 'WARNING: LiveFraction is "None" for', state.Run, state.LumiBlock 
+                else:
+                    deadfrac = 1-state.LiveFraction
                 if deadfrac < self.deadfraction_threshold:
                     continue
                 yield DefectIOV(RunLumi(state.Run, state.LumiBlock), 
@@ -65,7 +69,7 @@ class TDAQ_Busy(DCSC_Defect_Global_Variable):
 	#print counter_max
 	events = process_iovs(iovs)
         for since, until, (state,) in events:
-	    if state is not None:
+	    if state is not None and state.Run is not None:
                 deadfrac = 1-state.LiveFraction
                 if deadfrac < self.deadfraction_threshold:
                     continue
-- 
GitLab