diff --git a/Configuration/Applications/python/ConfigBuilder.py b/Configuration/Applications/python/ConfigBuilder.py index 3ffc2d2cf626e..9862e90d937ce 100644 --- a/Configuration/Applications/python/ConfigBuilder.py +++ b/Configuration/Applications/python/ConfigBuilder.py @@ -1012,6 +1012,7 @@ def define_Configs(self): self.DIGIDefaultCFF="Configuration/StandardSequences/Digi_cff" self.DIGI2RAWDefaultCFF="Configuration/StandardSequences/DigiToRaw_cff" self.L1EMDefaultCFF='Configuration/StandardSequences/SimL1Emulator_cff' + self.L1P2GTDefaultCFF = 'Configuration/StandardSequences/SimPhase2L1GlobalTriggerEmulator_cff' self.L1MENUDefaultCFF="Configuration/StandardSequences/L1TriggerDefaultMenu_cff" self.HLTDefaultCFF="Configuration/StandardSequences/HLTtable_cff" self.RAW2DIGIDefaultCFF="Configuration/StandardSequences/RawToDigi_Data_cff" @@ -1050,6 +1051,7 @@ def define_Configs(self): self.DIGI2RAWDefaultSeq='DigiToRaw' self.HLTDefaultSeq='GRun' self.L1DefaultSeq=None + self.L1P2GTDefaultSeq=None self.L1REPACKDefaultSeq='GT' self.HARVESTINGDefaultSeq=None self.ALCAHARVESTDefaultSeq=None @@ -1572,6 +1574,40 @@ def prepare_REPACK(self, stepSpec = None): self.scheduleSequence(_repackSeq,'digi2repack_step') return + def loadPhase2GTMenu(self, menuFile: str): + import importlib + menuPath = f'L1Trigger.Configuration.Phase2GTMenus.{menuFile}' + menuModule = importlib.import_module(menuPath) + + theMenu = menuModule.menu + triggerPaths = [] #we get a list of paths in each of these files to schedule + + for triggerPathFile in theMenu: + self.loadAndRemember(triggerPathFile) #this load and remember will set the algo variable of the algoblock later + + triggerPathModule = importlib.import_module(triggerPathFile) + for objName in dir(triggerPathModule): + obj = getattr(triggerPathModule, objName) + objType = type(obj) + if objType == cms.Path: + triggerPaths.append(objName) + + triggerScheduleList = [getattr(self.process, name) for name in triggerPaths] #get the actual paths to put in the schedule + self.schedule.extend(triggerScheduleList) #put them in the schedule for later + + # create the L1 GT step + # We abuse the stepSpec a bit as a way to specify a menu + def prepare_L1P2GT(self, stepSpec=None): + """ Run the GT emulation sequence on top of the L1 emulation step """ + self.loadAndRemember(self.L1P2GTDefaultCFF) + self.scheduleSequence('l1tGTProducerSequence', 'Phase2L1GTProducer') + self.scheduleSequence('l1tGTAlgoBlockProducerSequence', 'Phase2L1GTAlgoBlockProducer') + if stepSpec == None: + defaultMenuFile = "prototype_2023_v1_0_0" + self.loadPhase2GTMenu(menuFile = defaultMenuFile) + else: + self.loadPhase2GTMenu(menuFile = stepSpec) + def prepare_L1(self, stepSpec = None): """ Enrich the schedule with the L1 simulation step""" assert(stepSpec == None) diff --git a/Configuration/StandardSequences/python/SimPhase2L1GlobalTriggerEmulator_cff.py b/Configuration/StandardSequences/python/SimPhase2L1GlobalTriggerEmulator_cff.py new file mode 100644 index 0000000000000..99a845f6d627f --- /dev/null +++ b/Configuration/StandardSequences/python/SimPhase2L1GlobalTriggerEmulator_cff.py @@ -0,0 +1,5 @@ +# Make the phase 2 GT book end configs available as standard sequences for the cmsDriver +# Written by: Andrew Loeliger +import FWCore.ParameterSet.Config as cms + +from L1Trigger.Configuration.SimPhase2L1GlobalTrigger_cff import * \ No newline at end of file diff --git a/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/prototypeSeeds.py b/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/prototypeSeeds.py new file mode 100644 index 0000000000000..5dc0c060a7eb4 --- /dev/null +++ b/L1Trigger/Configuration/python/Phase2GTMenus/SeedDefinitions/prototypeSeeds.py @@ -0,0 +1,4 @@ +# Concatenate prototype menu seeds somewhere easy to handle +from L1Trigger.Phase2L1GT.l1tGTMenu_hadr_metSeeds_cff import * + +from L1Trigger.Phase2L1GT.l1tGTMenu_lepSeeds_cff import * \ No newline at end of file diff --git a/L1Trigger/Configuration/python/Phase2GTMenus/prototype_2023_v1_0_0.py b/L1Trigger/Configuration/python/Phase2GTMenus/prototype_2023_v1_0_0.py new file mode 100644 index 0000000000000..4fe219c5995ec --- /dev/null +++ b/L1Trigger/Configuration/python/Phase2GTMenus/prototype_2023_v1_0_0.py @@ -0,0 +1,5 @@ +# The first prototype menu + +menu = [ + 'L1Trigger.Configuration.Phase2GTMenus.SeedDefinitions.prototypeSeeds' +] \ No newline at end of file diff --git a/L1Trigger/Configuration/python/SimPhase2L1GlobalTrigger_cff.py b/L1Trigger/Configuration/python/SimPhase2L1GlobalTrigger_cff.py new file mode 100644 index 0000000000000..1f68723008fcf --- /dev/null +++ b/L1Trigger/Configuration/python/SimPhase2L1GlobalTrigger_cff.py @@ -0,0 +1,20 @@ +# Make Phase 2 Global Trigger "book end" configurations available as an L1 Configuration file +# To be made available later in Configuration/StandardSequences. +# It's a little circuitous, I admit, but seems correct to be available _everywhere_ +# Written by: Andrew Loeliger + +import FWCore.ParameterSet.Config as cms + +# Get the GT Producer/first of the "book end"s, responsible for GT inputs +from L1Trigger.Phase2L1GT.l1tGTProducer_cff import l1tGTProducer + +l1tGTProducerSequence = cms.Sequence( + l1tGTProducer +) + +# Get the Algo Block/second of the "book end"s, responsible for trigger results +from L1Trigger.Phase2L1GT.l1tGTAlgoBlockProducer_cff import l1tGTAlgoBlockProducer + +l1tGTAlgoBlockProducerSequence = cms.Sequence( + l1tGTAlgoBlockProducer +) \ No newline at end of file