Skip to content
Snippets Groups Projects
Commit 4d109ca6 authored by Tamara Vazquez Schroeder's avatar Tamara Vazquez Schroeder
Browse files

Merge branch 'RunDependentSimPatch_ATLASSIM-3399_21.0' into '21.0'

Veto lumiblocks with zero events from being used by RunDMC code

See merge request !4007

Former-commit-id: 962f5b69ad4359cd03adc9d11fe9852638d5b3d4
parents 2f125620 cd4ef24e
No related branches found
No related tags found
No related merge requests found
......@@ -470,11 +470,18 @@ class RunAndLumiOverrideList(JobProperty):
def __setattr__(self, name, n_value):
KeysRequired=('run','lb','starttstamp','evts','mu','force_new')
if name=='StoredValue' and not(self._locked):
def noEventsInLumiBlock(element):
return element['evts'] == 0
for element in n_value:
if not type(element) == dict :
raise ValueError( ' %s is not the expected type (dict) for an element of RunAndLumiOverrideList' % (element.__str__()) )
if not set(element) >= set(KeysRequired):
raise ValueError( 'Not all required keys for RunAndLumiOverrideList (%s) were found in %s' % (KeysRequired.__repr__(), element.__repr__()) )
if noEventsInLumiBlock(element):
logDigitizationFlags.warning('Found lumiblock with no events! This lumiblock will not be used:\n (%s)' % (element.__str__()) )
from itertools import ifilterfalse
n_value[:] = ifilterfalse(noEventsInLumiBlock, n_value)
JobProperty.__setattr__(self, name, n_value)
def getEvtsMax(self): #todo -- check if locked first?
"""Get the total number of events requested by this fragment of the task"""
......
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