Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-27 03:17:54

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