Skip to content

Commit

Permalink
Merge pull request #6980 from Martin-Grunewald/L1RePack73X
Browse files Browse the repository at this point in the history
73X: L1REPACK for HLT and fixes
  • Loading branch information
davidlange6 committed Jan 13, 2015
2 parents f517b1e + 8c62983 commit 484a7a6
Show file tree
Hide file tree
Showing 11 changed files with 366 additions and 49 deletions.
17 changes: 9 additions & 8 deletions Configuration/Applications/python/ConfigBuilder.py
Expand Up @@ -1484,14 +1484,15 @@ def prepare_L1(self, sequence = None):

def prepare_L1REPACK(self, sequence = None):
""" Enrich the schedule with the L1 simulation step, running the L1 emulator on data unpacked from the RAW collection, and repacking the result in a new RAW collection"""
if sequence is not 'GT':
print 'Running the full L1 emulator is not supported yet'
raise Exception('unsupported feature')
if sequence is 'GT':
self.loadAndRemember('Configuration/StandardSequences/SimL1EmulatorRepack_GT_cff')
if self._options.scenario == 'HeavyIons':
self.renameInputTagsInSequence("SimL1Emulator","rawDataCollector","rawDataRepacker")
self.scheduleSequence('SimL1Emulator','L1simulation_step')
supported = ['GT','GT1','GT2','GCTGT']
if sequence in supported:
self.loadAndRemember('Configuration/StandardSequences/SimL1EmulatorRepack_%s_cff'%sequence)
if self._options.scenario == 'HeavyIons':
self.renameInputTagsInSequence("SimL1Emulator","rawDataCollector","rawDataRepacker")
self.scheduleSequence('SimL1Emulator','L1RePack_step')
else:
print "L1REPACK with '",sequence,"' is not supported! Supported choices are: ",supported
raise Exception('unsupported feature')


def prepare_HLT(self, sequence = None):
Expand Down
@@ -0,0 +1,99 @@
import FWCore.ParameterSet.Config as cms

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

import EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi
unpackGtDigis = EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi.l1GtUnpack.clone(
DaqGtInputTag = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)

import EventFilter.CastorRawToDigi.CastorRawToDigi_cfi
unpackCastorDigis = EventFilter.CastorRawToDigi.CastorRawToDigi_cfi.castorDigis.clone(
InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)

##
## run the L1 emulator
##

from L1Trigger.L1TCalorimeter.L1TCaloStage1_PPFromRaw_cff import *
ecalDigis.InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
hcalDigis.InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
simHcalTriggerPrimitiveDigis.InputTagFEDRaw = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())

import L1Trigger.GlobalTrigger.gtDigis_cfi
newGtDigis = L1Trigger.GlobalTrigger.gtDigis_cfi.gtDigis.clone(
AlgorithmTriggersUnprescaled= cms.bool(True),
TechnicalTriggersUnprescaled= cms.bool(True),
GmtInputTag = cms.InputTag( 'unpackGtDigis' ),
GctInputTag = cms.InputTag( 'simCaloStage1LegacyFormatDigis' ),
CastorInputTag = cms.InputTag( 'unpackCastorDigis' ),
TechnicalTriggersInputTags = cms.VInputTag()
)

##
## pack GCT FEDs
##

import EventFilter.GctRawToDigi.gctDigiToRaw_cfi
packGctDigis = EventFilter.GctRawToDigi.gctDigiToRaw_cfi.gctDigiToRaw.clone(
gctInputLabel = cms.InputTag( 'simCaloStage1LegacyFormatDigis' )
)

import L1Trigger.L1TCommon.l1tDigiToRaw_cfi
packL1tDigis = L1Trigger.L1TCommon.l1tDigiToRaw_cfi.l1tDigiToRaw.clone(
InputLabel = cms.InputTag("simCaloStage1FinalDigis"),
TauInputLabel = cms.InputTag("simCaloStage1FinalDigis", "rlxTaus"),
IsoTauInputLabel = cms.InputTag("simCaloStage1FinalDigis", "isoTaus"),
HFBitCountsInputLabel = cms.InputTag("simCaloStage1FinalDigis", "HFBitCounts"),
HFRingSumsInputLabel = cms.InputTag("simCaloStage1FinalDigis", "HFRingSums")
)

##
## repack FEDs 812 and 813
##

import EventFilter.L1GlobalTriggerRawToDigi.l1GtPack_cfi
packL1Gt = EventFilter.L1GlobalTriggerRawToDigi.l1GtPack_cfi.l1GtPack.clone(
DaqGtInputTag = 'newGtDigis',
MuGmtInputTag = 'unpackGtDigis'
)
import EventFilter.L1GlobalTriggerRawToDigi.l1GtEvmPack_cfi
packL1GtEvm = EventFilter.L1GlobalTriggerRawToDigi.l1GtEvmPack_cfi.l1GtEvmPack.clone(
EvmGtInputTag = 'newGtDigis'
)

##
## combine the new L1 RAW with existing RAW for other FEDs
##

import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi
rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone(
verbose = cms.untracked.int32(0),
RawCollectionList = cms.VInputTag(
cms.InputTag('packGctDigis'),
cms.InputTag('packL1tDigis'),
cms.InputTag('packL1Gt'),
cms.InputTag('packL1GtEvm'),
cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)
)

##
## construct SimL1Emulator sequence
##

SimL1Emulator = cms.Sequence(
unpackGtDigis +
unpackCastorDigis +
L1TCaloStage1_PPFromRaw +
newGtDigis +
packGctDigis +
packL1tDigis +
packL1Gt +
packL1GtEvm +
rawDataCollector
)
@@ -0,0 +1,78 @@
import FWCore.ParameterSet.Config as cms

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

##
## run the L1 unpackers
##

import EventFilter.GctRawToDigi.l1GctHwDigis_cfi
unpackGctDigis = EventFilter.GctRawToDigi.l1GctHwDigis_cfi.l1GctHwDigis.clone(
inputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)

import EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi
unpackGtDigis = EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi.l1GtUnpack.clone(
DaqGtInputTag = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)

import EventFilter.CastorRawToDigi.CastorRawToDigi_cfi
unpackCastorDigis = EventFilter.CastorRawToDigi.CastorRawToDigi_cfi.castorDigis.clone(
InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)

##
## run the L1 emulator
##

import L1Trigger.GlobalTrigger.gtDigis_cfi
newGtDigis = L1Trigger.GlobalTrigger.gtDigis_cfi.gtDigis.clone(
AlgorithmTriggersUnprescaled= cms.bool(True),
TechnicalTriggersUnprescaled= cms.bool(True),
GmtInputTag = cms.InputTag( 'unpackGtDigis' ),
GctInputTag = cms.InputTag( 'unpackGctDigis' ),
CastorInputTag = cms.InputTag( 'unpackCastorDigis' ),
TechnicalTriggersInputTags = cms.VInputTag()
)

##
## repack FEDs 812 and 813
##

import EventFilter.L1GlobalTriggerRawToDigi.l1GtPack_cfi
packL1Gt = EventFilter.L1GlobalTriggerRawToDigi.l1GtPack_cfi.l1GtPack.clone(
DaqGtInputTag = 'newGtDigis',
MuGmtInputTag = 'unpackGtDigis'
)
import EventFilter.L1GlobalTriggerRawToDigi.l1GtEvmPack_cfi
packL1GtEvm = EventFilter.L1GlobalTriggerRawToDigi.l1GtEvmPack_cfi.l1GtEvmPack.clone(
EvmGtInputTag = 'newGtDigis'
)

##
## combine the new L1 RAW with existing RAW for other FEDs
##

import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi
rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone(
verbose = cms.untracked.int32(0),
RawCollectionList = cms.VInputTag(
cms.InputTag('packL1Gt'),
cms.InputTag('packL1GtEvm'),
cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)
)

##
## construct SimL1Emulator sequence
##

SimL1Emulator = cms.Sequence(
unpackGctDigis +
unpackGtDigis +
unpackCastorDigis +
newGtDigis +
packL1Gt +
packL1GtEvm +
rawDataCollector
)
@@ -0,0 +1,88 @@
import FWCore.ParameterSet.Config as cms

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

##
## run the L1 unpackers
##

import L1Trigger.L1TCommon.l1tRawToDigi_cfi
unpackGctStage1 = L1Trigger.L1TCommon.l1tRawToDigi_cfi.caloStage1Digis.clone(
InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)

import L1Trigger.L1TCommon.caloStage1LegacyFormatDigis_cfi
unpackGctDigis = L1Trigger.L1TCommon.caloStage1LegacyFormatDigis_cfi.caloStage1LegacyFormatDigis.clone(
InputCollection = cms.InputTag("unpackGctStage1"),
InputRlxTauCollection = cms.InputTag("unpackGctStage1:rlxTaus"),
InputIsoTauCollection = cms.InputTag("unpackGctStage1:isoTaus"),
InputHFSumsCollection = cms.InputTag("unpackGctStage1:HFRingSums"),
InputHFCountsCollection = cms.InputTag("unpackGctStage1:HFBitCounts")
)

import EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi
unpackGtDigis = EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi.l1GtUnpack.clone(
DaqGtInputTag = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)

import EventFilter.CastorRawToDigi.CastorRawToDigi_cfi
unpackCastorDigis = EventFilter.CastorRawToDigi.CastorRawToDigi_cfi.castorDigis.clone(
InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)

##
## run the L1 emulator
##

import L1Trigger.GlobalTrigger.gtDigis_cfi
newGtDigis = L1Trigger.GlobalTrigger.gtDigis_cfi.gtDigis.clone(
AlgorithmTriggersUnprescaled= cms.bool(True),
TechnicalTriggersUnprescaled= cms.bool(True),
GmtInputTag = cms.InputTag( 'unpackGtDigis' ),
GctInputTag = cms.InputTag( 'unpackGctDigis' ),
CastorInputTag = cms.InputTag( 'unpackCastorDigis' ),
TechnicalTriggersInputTags = cms.VInputTag()
)

##
## repack FEDs 812 and 813
##

import EventFilter.L1GlobalTriggerRawToDigi.l1GtPack_cfi
packL1Gt = EventFilter.L1GlobalTriggerRawToDigi.l1GtPack_cfi.l1GtPack.clone(
DaqGtInputTag = 'newGtDigis',
MuGmtInputTag = 'unpackGtDigis'
)
import EventFilter.L1GlobalTriggerRawToDigi.l1GtEvmPack_cfi
packL1GtEvm = EventFilter.L1GlobalTriggerRawToDigi.l1GtEvmPack_cfi.l1GtEvmPack.clone(
EvmGtInputTag = 'newGtDigis'
)

##
## combine the new L1 RAW with existing RAW for other FEDs
##

import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi
rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone(
verbose = cms.untracked.int32(0),
RawCollectionList = cms.VInputTag(
cms.InputTag('packL1Gt'),
cms.InputTag('packL1GtEvm'),
cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)
)

##
## construct SimL1Emulator sequence
##

SimL1Emulator = cms.Sequence(
unpackGctStage1 +
unpackGctDigis +
unpackGtDigis +
unpackCastorDigis +
newGtDigis +
packL1Gt +
packL1GtEvm +
rawDataCollector
)
23 changes: 22 additions & 1 deletion HLTrigger/Configuration/python/CustomConfigs.py
Expand Up @@ -40,7 +40,10 @@ def L1T(process):
# modifications when running L1T only

process.load('L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi')
process.l1GtTrigReport.L1GtRecordInputTag = cms.InputTag( "simGtDigis" )
labels = ['gtDigis','simGtDigis','newGtDigis','hltGtDigis']
for label in labels:
if label in process.__dict__:
process.l1GtTrigReport.L1GtRecordInputTag = cms.InputTag( label )

process.L1AnalyzerEndpath = cms.EndPath( process.l1GtTrigReport )
process.schedule.append(process.L1AnalyzerEndpath)
Expand Down Expand Up @@ -94,3 +97,21 @@ def MassReplaceInputTag(process,old="rawDataCollector",new="rawDataRepacker"):
for s in process.paths_().keys():
massSearchReplaceAnyInputTag(getattr(process,s),old,new)
return(process)


def L1REPACK(process):
# Replace only the L1 parts and keep the rest
if 'DigiToRaw' in process.__dict__:
process.DigiToRaw = cms.Sequence(process.l1tDigiToRawSeq + process.l1GtPack + process.l1GtEvmPack + process.rawDataCollector)
if 'rawDataCollector' in process.__dict__:
process.rawDataCollector.RawCollectionList = cms.VInputTag(
cms.InputTag('gctDigiToRaw'),
cms.InputTag('l1tDigiToRaw'),
cms.InputTag('l1GtPack'),
cms.InputTag('l1GtEvmPack'),
cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess())
)

process=L1T(process)

return process
16 changes: 6 additions & 10 deletions HLTrigger/Configuration/test/cmsDriver.csh
Expand Up @@ -38,7 +38,6 @@ set NNHIRD = 25

set CustomRun1 = " "
set CustomRun2 = "SLHCUpgradeSimulations/Configuration/postLS1Customs.customisePostLS1"
set CustomHIon = "HLTrigger/Configuration/CustomConfigs.MassReplaceInputTag"

set XL1T = "" # syntax: tag,record[,connect,label]
set XL1TPP1 = "" # "L1GtTriggerMenu_L1Menu_Collisions2012_v1_mc,L1GtTriggerMenuRcd,frontier://FrontierProd/CMS_CONDITIONS"
Expand Down Expand Up @@ -98,7 +97,7 @@ foreach gtag ( MC DATA )
set InputLHCRaw = $InputLHCRawGRun
set Custom1 = $CustomRun2
set Custom2 = " "
set L1REPACK = NONE
set L1REPACK = L1REPACK:GCTGT
else if ( $table == Fake ) then
set XL1T = $XL1TPP3
set XHLT = HLT:Fake
Expand All @@ -110,7 +109,7 @@ foreach gtag ( MC DATA )
set InputLHCRaw = $InputLHCRawGRun
set Custom1 = $CustomRun1
set Custom2 = " "
set L1REPACK = L1REPACK
set L1REPACK = L1REPACK:GT1
else if ( $table == GRun ) then
set XL1T = $XL1TPP3
set XHLT = HLT:GRun
Expand All @@ -122,7 +121,7 @@ foreach gtag ( MC DATA )
set InputLHCRaw = $InputLHCRawGRun
set Custom1 = $CustomRun2
set Custom2 = " "
set L1REPACK = NONE
set L1REPACK = L1REPACK:GCTGT
else if ( $table == HIon ) then
set XL1T = $XL1THI
set XHLT = HLT:HIon
Expand All @@ -134,10 +133,7 @@ foreach gtag ( MC DATA )
set InputLHCRaw = $InputLHCRawHIon
set Custom1 = $CustomRun2
set Custom2 = " "
if ( $gtag == DATA ) then
set Custom2 = $CustomHIon
endif
set L1REPACK = NONE
set L1REPACK = L1REPACK:GCTGT
else if ( $table == PIon ) then
set XL1T = $XL1TPI
set XHLT = HLT:PIon
Expand All @@ -149,7 +145,7 @@ foreach gtag ( MC DATA )
set InputLHCRaw = $InputLHCRawPIon
set Custom1 = $CustomRun2
set Custom2 = " "
set L1REPACK = NONE
set L1REPACK = L1REPACK:GCTGT
else
# unsupported
continue
Expand All @@ -160,7 +156,7 @@ foreach gtag ( MC DATA )

echo
echo "Creating L1RePack $name"
cmsDriver.py RelVal --step=$L1REPACK --conditions=$GTAG --filein=$InputLHCRaw --custom_conditions=$XL1T --fileout=RelVal_L1RePack_$name.root --number=$NN $DATAMC --no_exec --datatier 'GEN-SIM-DIGI-RAW' --eventcontent=RAW --customise=HLTrigger/Configuration/CustomConfigs.L1T --customise=$Custom1 --customise=$Custom2 --scenario=$SCEN --python_filename=RelVal_L1RePack_$name.py
cmsDriver.py RelVal --step=$L1REPACK --conditions=$GTAG --filein=$InputLHCRaw --custom_conditions=$XL1T --fileout=RelVal_L1RePack_$name.root --number=$NN $DATAMC --no_exec --datatier 'GEN-SIM-DIGI-RAW' --eventcontent=RAW --customise=HLTrigger/Configuration/CustomConfigs.L1T --customise=$Custom1 --customise=$Custom2 --scenario=$SCEN --python_filename=RelVal_L1RePack_$name.py --customise=L1Trigger/Configuration/L1Trigger_custom.customiseResetPrescalesAndMasks

else

Expand Down

0 comments on commit 484a7a6

Please sign in to comment.