Skip to content

Commit

Permalink
Merge pull request #11817 from mark-grimes/rearrangeStage1ConfigFiles
Browse files Browse the repository at this point in the history
Make the L1REPACK step work with the Run 2 eras
  • Loading branch information
davidlange6 committed Oct 16, 2015
2 parents 3814818 + ef8cf18 commit 05c1670
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import FWCore.ParameterSet.Config as cms

## L1REPACK: redo GCT,GT, using Run-1 or Run-2 input, making Run-2 output

# If the Stage 1 trigger is running, there is also some different configuration.
# Note that this next file does nothing if the stage1L1Trigger era is not active, so
# it is safe to import even if the Stage 1 trigger is not required. It *MUST* be
# imported into this namespace, i.e. "from <module> import *".
from L1Trigger.Configuration.ConditionalStage1Configuration_cff import *

##
## run the L1 unpackers
##
Expand Down
11 changes: 6 additions & 5 deletions FastSimulation/Configuration/python/L1Reco_cff.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import FWCore.ParameterSet.Config as cms

# the only thing FastSim runs from L1Reco is l1extraParticles
from L1Trigger.Configuration.L1Reco_cff import l1extraParticles, _customiseForStage1
from L1Trigger.Configuration.L1Reco_cff import l1extraParticles

# These next few lines copy the L1 era changes to FastSim
from Configuration.StandardSequences.Eras import eras
# A unique name is required so I'll use "modify<python filename>ForStage1Trigger_"
modifyFastSimulationConfigurationL1RecoForStage1Trigger_ = eras.stage1L1Trigger.makeProcessModifier( _customiseForStage1 )
# If the Stage 1 trigger is running, there is also some different configuration.
# Note that this next file does nothing if the stage1L1Trigger era is not active, so
# it is safe to import even if the Stage 1 trigger is not required. It *MUST* be
# imported into this namespace, i.e. "from <module> import *".
from L1Trigger.Configuration.ConditionalStage1Configuration_cff import *

# some collections have different labels
def _changeLabelForFastSim( object ) :
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import FWCore.ParameterSet.Config as cms

#
# The purpose of this file is to make configuration changes for the Stage1
# L1 trigger, but *ONLY* if the era is active. If it is not, this file should
# do nothing.
# Hence it is safe to import this file all the time, and the changes will only
# be triggered when required.
#
# DO NOT add anything to this file that is not conditional on eras.stage1L1Trigger
# being active. Files importing this one assume that is safe to do so all the
# time.
#
# This file MUST be imported with the "*" format, i.e.
# from L1Trigger.Configuration.ConditionalStage1Configuration_cff import *
# If you import with just a plain "import", i.e.
# import L1Trigger.Configuration.ConditionalStage1Configuration_cff
# then the ProcessModifier will be in the wrong namespace and it will not be
# run, so the era customisations will not be applied.
#

from Configuration.StandardSequences.Eras import eras

def _loadStage1Fragments( processObject ) :
processObject.load('L1Trigger.L1TCalorimeter.caloStage1Params_cfi')
processObject.load('L1Trigger.L1TCalorimeter.L1TCaloStage1_cff')
processObject.load('L1Trigger.L1TCalorimeter.caloConfigStage1PP_cfi')

# A unique name is required so I'll use make sure the name includes the filename
modifyL1TriggerConfigurationConditionalStage1Configuration_cff_ = eras.stage1L1Trigger.makeProcessModifier( _loadStage1Fragments )
14 changes: 4 additions & 10 deletions L1Trigger/Configuration/python/L1Reco_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@
# L1GtTriggerMenuLite
from EventFilter.L1GlobalTriggerRawToDigi.l1GtTriggerMenuLite_cfi import *

#
# If the Stage 1 trigger is running, there is also some different configuration than
# the general Run 2 stuff.
#
def _customiseForStage1( processObject ) :
processObject.load('L1Trigger.L1TCalorimeter.L1TCaloStage1_cff')
processObject.load('L1Trigger.L1TCalorimeter.caloConfigStage1PP_cfi')
# A unique name is required so I'll use "modify<python filename>ForStage1Trigger_"
from Configuration.StandardSequences.Eras import eras
modifyL1TriggerConfigurationL1RecoForStage1Trigger_ = eras.stage1L1Trigger.makeProcessModifier( _customiseForStage1 )
# If the Stage 1 trigger is running, there is also some different configuration.
# Note that this file does nothing if the stage1L1Trigger era is not active, so
# it is safe to import even if the Stage 1 trigger is not required.
from L1Trigger.Configuration.ConditionalStage1Configuration_cff import *

# conditions in edm
import EventFilter.L1GlobalTriggerRawToDigi.conditionDumperInEdm_cfi
Expand Down
26 changes: 8 additions & 18 deletions L1Trigger/Configuration/python/SimL1Emulator_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@


# This object is used to make changes for different running scenarios. In
# this case for Run 2
# this case for the Stage 1 trigger in run 2
from Configuration.StandardSequences.Eras import eras
# Note that this next file does nothing if the stage1L1Trigger era is not active, so
# it is safe to import even if the Stage 1 trigger is not required. It *MUST* be
# imported into this namespace, i.e. "from <file> import *".
from L1Trigger.Configuration.ConditionalStage1Configuration_cff import *

# ECAL TPG emulator and HCAL TPG run in the simulation sequence in order to be able
# to use unsuppressed digis produced by ECAL and HCAL simulation, respectively
Expand Down Expand Up @@ -160,20 +164,6 @@
##
## Make changes for Run 2
##
def _extendForStage1Trigger( theProcess ) :
"""
ProcessModifier that loads config fragments required for Run 2 into the process object.
Also switches the GCT digis for the Stage1 digis in the SimL1Emulator sequence
"""
theProcess.load('L1Trigger.L1TCalorimeter.caloStage1Params_cfi')
theProcess.load('L1Trigger.L1TCalorimeter.L1TCaloStage1_cff')
theProcess.load('L1Trigger.L1TCalorimeter.caloConfigStage1PP_cfi')
# Note that this function is applied before the objects in this file are added
# to the process. So things declared in this file should be used "bare", i.e.
# not with "theProcess." in front of them. L1TCaloStage1 is an exception because
# it is not declared in this file but loaded into the process in one of the "load"
# statements above.
SimL1Emulator.replace( simGctDigis, theProcess.L1TCaloStage1 )

# A unique name is required for this object, so I'll call it "modify<python filename>ForRun2_"
modifyL1TriggerConfigurationSimL1EmulatorForRun2_ = eras.stage1L1Trigger.makeProcessModifier( _extendForStage1Trigger )
if eras.stage1L1Trigger.isChosen() :
from L1Trigger.L1TCalorimeter.L1TCaloStage1_cff import L1TCaloStage1
SimL1Emulator.replace( simGctDigis, L1TCaloStage1 )

0 comments on commit 05c1670

Please sign in to comment.