Skip to content

Commit

Permalink
Merge pull request #43210 from aloeliger/Phase2_GT_Menu_Workflow
Browse files Browse the repository at this point in the history
Phase 2 L1 cmsDriver/Menu Infrastructure
  • Loading branch information
cmsbuild authored Nov 9, 2023
2 parents c5852a7 + e00780c commit 95c6900
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Configuration/Applications/python/ConfigBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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 *
Original file line number Diff line number Diff line change
@@ -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 *
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# The first prototype menu

menu = [
'L1Trigger.Configuration.Phase2GTMenus.SeedDefinitions.prototypeSeeds'
]
20 changes: 20 additions & 0 deletions L1Trigger/Configuration/python/SimPhase2L1GlobalTrigger_cff.py
Original file line number Diff line number Diff line change
@@ -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
)

0 comments on commit 95c6900

Please sign in to comment.