Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:48

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 import os
0005 
0006 ##############################################################################
0007 # customisations for L1T demos
0008 #
0009 # Add demonstration modules to cmsDriver customs.
0010 #
0011 ##############################################################################
0012 
0013 def L1TBasicDemo(process):
0014     print("L1T INFO:  adding basic demo module to the process.")
0015     process.load('L1Trigger.L1TCommon.l1tBasicDemo_cfi')
0016     process.l1tBasicDemoPath = cms.Path(process.l1tBasicDemo)
0017     process.schedule.append(process.l1tBasicDemoPath)
0018     return process
0019 
0020 def L1THLTDemo(process):
0021     #process.load('L1Trigger.Configuration.SimL1Emulator_cff')
0022     process.load('L1Trigger.L1TGlobal.hackConditions_cff')
0023     print("L1T INFO:  adding HLT demo module to the process.")
0024     #
0025     # BEGIN HLT UNPACKER SEQUENCE FOR STAGE 2
0026     #
0027 
0028     process.hltGtStage2Digis = cms.EDProducer(
0029         "L1TRawToDigi",
0030         Setup           = cms.string("stage2::GTSetup"),
0031         FedIds          = cms.vint32( 1404 ),
0032         )
0033     
0034     process.hltCaloStage2Digis = cms.EDProducer(
0035         "L1TRawToDigi",
0036         Setup           = cms.string("stage2::CaloSetup"),
0037         FedIds          = cms.vint32( 1360, 1366 ),
0038         )
0039     
0040     process.hltGmtStage2Digis = cms.EDProducer(
0041         "L1TRawToDigi",
0042         Setup = cms.string("stage2::GMTSetup"),
0043         FedIds = cms.vint32(1402),
0044         )
0045     
0046     process.hltGtStage2ObjectMap = cms.EDProducer(
0047         "L1TGlobalProducer",
0048         MuonInputTag = cms.InputTag("hltGmtStage2Digis","Muon"),
0049         ExtInputTag = cms.InputTag("hltGtStage2Digis"), # (external conditions are not emulated, use unpacked)
0050         EtSumInputTag = cms.InputTag("hltCaloStage2Digis", "EtSum"),
0051         EGammaInputTag = cms.InputTag("hltCaloStage2Digis", "EGamma"),
0052         TauInputTag = cms.InputTag("hltCaloStage2Digis", "Tau"),
0053         JetInputTag = cms.InputTag("hltCaloStage2Digis", "Jet"),
0054         AlgorithmTriggersUnprescaled = cms.bool(True),
0055         AlgorithmTriggersUnmasked = cms.bool(True),
0056         )
0057 
0058     # keeping same sequence name as for legacy system:
0059     process.HLTL1UnpackerSequence = cms.Sequence(
0060         process.hltGtStage2Digis +
0061         process.hltCaloStage2Digis +
0062         process.hltGmtStage2Digis +
0063         process.hltGtStage2ObjectMap
0064         )
0065 
0066     #
0067     # END HLT UNPACKER SEQUENCE FOR STAGE 2
0068     #
0069 
0070     #
0071     # BEGIN L1T SEEDS EXAMPLE FOR STAGE 2
0072     #
0073     process.hltL1TSeed = cms.EDFilter( 
0074         "HLTL1TSeed",
0075         L1SeedsLogicalExpression = cms.string( "L1_DoubleMu0er1p6_dEta_Max1p8 OR L1_DoubleMu0er1p6_dEta_Max1p8_OS " ),
0076         saveTags             = cms.bool( True ),
0077         L1ObjectMapInputTag  = cms.InputTag("hltGtStage2ObjectMap"),
0078         L1GlobalInputTag     = cms.InputTag("hltGtStage2Digis"),
0079         L1MuonInputTag       = cms.InputTag("hltGmtStage2Digis","Muon"),
0080         L1EGammaInputTag     = cms.InputTag("hltCaloStage2Digis","EGamma"),
0081         L1JetInputTag        = cms.InputTag("hltCaloStage2Digis","Jet"),
0082         L1TauInputTag        = cms.InputTag("hltCaloStage2Digis","Tau"),
0083         L1EtSumInputTag      = cms.InputTag("hltCaloStage2Digis","EtSum"),
0084         )
0085 
0086     # HLT Seed sequence
0087     process.HLTL1TSeedSequence  = cms.Sequence( 
0088         process.hltL1TSeed 
0089         )
0090 
0091     #
0092     # END L1T SEEDS EXAMPLE FOR STAGE 2
0093     #
0094 
0095     print("L1T INFO:  will dump a summary of Stage2 content as unpacked by HLT to screen.")    
0096     process.load('L1Trigger.L1TCommon.l1tSummaryStage2HltDigis_cfi')
0097 
0098     # gt analyzer
0099     process.l1tGlobalSummary = cms.EDAnalyzer(
0100         'L1TGlobalSummary',
0101         AlgInputTag = cms.InputTag("hltGtStage2ObjectMap"),
0102         ExtInputTag = cms.InputTag("hltGtStage2ObjectMap"),
0103         # DumpTrigResults = cms.bool(True), # per event dump of trig results
0104         DumpTrigSummary = cms.bool(True), # job summary... not yet implemented...
0105         )
0106 
0107     process.HLTL1TDebugSequence  = cms.Sequence(process.l1tSummaryStage2HltDigis + process.l1tGlobalSummary)
0108 
0109 
0110 
0111     print("L1T Input:  HLTL1UnpackerSequence:  ")
0112     print(process.HLTL1UnpackerSequence)
0113     print("L1T Input:  HLTL1TSeedSequence:  ")
0114     print(process.HLTL1TSeedSequence)
0115     print("L1T Input:  HLTL1TDebugSequence:  ")
0116     print(process.HLTL1TDebugSequence)
0117     process.l1tHLTDemoPath = cms.Path(process.HLTL1UnpackerSequence + process.HLTL1TSeedSequence + process.HLTL1TDebugSequence)
0118     process.schedule.append(process.l1tHLTDemoPath)
0119     return process