Skip to content

Commit

Permalink
Merge pull request #13056 from Dr15Jones/applyProcessModifiersLast
Browse files Browse the repository at this point in the history
Process.extend now applies ProcessModifiers last
  • Loading branch information
cmsbuild committed Jan 26, 2016
2 parents a19a704 + 9ed79a6 commit 807e5b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
8 changes: 7 additions & 1 deletion FWCore/ParameterSet/python/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ def extend(self,other,items=()):
self.__dict__['_Process__InExtendCall'] = True

seqs = dict()
mods = []
for name in dir(other):
#'from XX import *' ignores these, and so should we.
if name.startswith('_'):
Expand All @@ -536,7 +537,7 @@ def extend(self,other,items=()):
elif isinstance(item,_Unlabelable):
self.add_(item)
elif isinstance(item,ProcessModifier):
item.apply(self)
mods.append(item)
elif isinstance(item,ProcessFragment):
self.extend(item)

Expand All @@ -553,6 +554,11 @@ def extend(self,other,items=()):
self.__setObjectLabel(newSeq, name)
#now put in proper bucket
newSeq._place(name,self)

#apply modifiers now that all names have been added
for item in mods:
item.apply(self)

self.__dict__['_Process__InExtendCall'] = False

def _dumpConfigNamedList(self,items,typeName,options):
Expand Down
16 changes: 10 additions & 6 deletions L1Trigger/Configuration/python/SimL1Emulator_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,16 @@
##
## Make changes for Run 2
##
if eras.stage1L1Trigger.isChosen() :
from L1Trigger.L1TCalorimeter.L1TCaloStage1_cff import L1TCaloStage1
SimL1Emulator.replace( simGctDigis, L1TCaloStage1 )
def _modifyStage1L1Trigger(process):
import L1Trigger.L1TCalorimeter.L1TCaloStage1_cff
if not hasattr(process, "L1TCaloStage1"):
process.L1TCaloStage1 = L1Trigger.L1TCalorimeter.L1TCaloStage1_cff.L1TCaloStage1
process.SimL1Emulator.replace( process.simGctDigis, process.L1TCaloStage1 )
modifyStage1L1Trigger = eras.stage1L1Trigger.makeProcessModifier(_modifyStage1L1Trigger)

# fastsim doesn't have the technical triggers
if eras.fastSim.isChosen():
for _entry in [SimL1TechnicalTriggers]:
SimL1Emulator.remove(_entry)
def _modifyFastSim(process):
for _entry in [process.SimL1TechnicalTriggers]:
process.SimL1Emulator.remove(_entry)
modifyFastSim_SimL1Emulator = eras.fastSim.makeProcessModifier(_modifyFastSim)

0 comments on commit 807e5b9

Please sign in to comment.