Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:27

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 import os
0005 import sys
0006 ##############################################################################
0007 # customisations for L1T utilities
0008 #
0009 # customisations which add utilities features such as debugging of L1T,
0010 #    summary module, etc.
0011 #
0012 ##############################################################################
0013 
0014 # Unpack Stage-2 GT and GMT
0015 def L1TTurnOffGtAndGmtEmulation(process):
0016     cutlist=['simDtTriggerPrimitiveDigis','simCscTriggerPrimitiveDigis','simTwinMuxDigis','simBmtfDigis','simEmtfDigis','simOmtfDigis','simGmtCaloSumDigis','simMuonQualityAdjusterDigis','simGmtStage2Digis','simGtStage2Digis']
0017     for b in cutlist:
0018         process.SimL1Emulator.remove(getattr(process,b))
0019     return process
0020 
0021 # Unpack Stage-2 GT and GMT
0022 def L1TTurnOffUnpackStage2GtAndGmt(process):
0023     cutlist=['gtStage2Digis','gmtStage2Digis']
0024     for b in cutlist:
0025         process.L1TRawToDigi.remove(getattr(process,b))
0026     return process
0027 
0028 # Unpack Stage-2 GT and GMT
0029 def L1TTurnOffUnpackStage2GtGmtAndCalo(process):
0030     cutlist=['gtStage2Digis','gmtStage2Digis','caloStage2Digis']
0031     for b in cutlist:
0032         process.L1TRawToDigi.remove(getattr(process,b))
0033     return process
0034 
0035 def L1TStage1DigisSummary(process):
0036     print("L1T INFO:  will dump a summary of unpacked Stage1 content to screen.")
0037     process.load('L1Trigger.L1TCommon.l1tSummaryStage1Digis_cfi')
0038     process.l1tstage1summary = cms.Path(process.l1tSummaryStage1Digis)
0039     process.schedule.append(process.l1tstage1summary)
0040     return process
0041 
0042 def L1TStage2DigisSummary(process):
0043     print("L1T INFO:  will dump a summary of unpacked Stage2 content to screen.")
0044     process.load('L1Trigger.L1TCommon.l1tSummaryStage2Digis_cfi')
0045     process.l1tstage2summary = cms.Path(process.l1tSummaryStage2Digis)
0046     process.schedule.append(process.l1tstage2summary)
0047     return process
0048 
0049 def L1TStage1SimDigisSummary(process):
0050     print("L1T INFO:  will dump a summary of simulated Stage1 content to screen.")
0051     process.load('L1Trigger.L1TCommon.l1tSummaryStage1SimDigis_cfi')
0052     process.l1tsimstage1summary = cms.Path(process.l1tSummaryStage1SimDigis)
0053     process.schedule.append(process.l1tsimstage1summary)
0054     return process
0055 
0056 def L1TStage2SimDigisSummary(process):
0057     print("L1T INFO:  will dump a summary of simulated Stage2 content to screen.")
0058     process.load('L1Trigger.L1TCommon.l1tSummaryStage2SimDigis_cfi')
0059     process.l1tsimstage2summary = cms.Path(process.l1tSummaryStage2SimDigis)
0060     process.schedule.append(process.l1tsimstage2summary)
0061     return process
0062 
0063 def L1TGlobalDigisSummary(process):
0064     print("L1T INFO:  will dump a summary of unpacked L1T Global output to screen.")
0065     process.l1tGlobalSummary = cms.EDAnalyzer(
0066         'L1TGlobalSummary',
0067         AlgInputTag = cms.InputTag("gtStage2Digis"),
0068         ExtInputTag = cms.InputTag("gtStage2Digis"),
0069         DumpTrigResults = cms.bool(False), # per event dump of trig results
0070         DumpTrigSummary = cms.bool(True), # pre run dump of trig results
0071         )
0072     process.l1tglobalsummary = cms.Path(process.l1tGlobalSummary)
0073     process.schedule.append(process.l1tglobalsummary)
0074     return process
0075 
0076 def L1TGlobalMenuXML(process):
0077     process.load('L1Trigger.L1TGlobal.GlobalParameters_cff')
0078     process.load('L1Trigger.L1TGlobal.TriggerMenu_cff')
0079     process.TriggerMenu.L1TriggerMenuFile = cms.string('L1Menu_Collisions2022_v1_2_0.xml')
0080     return process
0081 
0082 def L1TGlobalSimDigisSummary(process):
0083     print("L1T INFO:  will dump a summary of simulated L1T Global output to screen.")
0084     process.l1tSimGlobalSummary = cms.EDAnalyzer(
0085         'L1TGlobalSummary',
0086         AlgInputTag = cms.InputTag("simGtStage2Digis"),
0087         ExtInputTag = cms.InputTag("simGtStage2Digis"),
0088         DumpTrigResults = cms.bool(False), # per event dump of trig results
0089         DumpTrigSummary = cms.bool(True), # pre run dump of trig results
0090         )
0091     process.l1tsimglobalsummary = cms.Path(process.l1tSimGlobalSummary)
0092     process.schedule.append(process.l1tsimglobalsummary)
0093     return process
0094 
0095 def L1TAddInfoOutput(process):
0096     process.MessageLogger = cms.Service(
0097         "MessageLogger",
0098         destinations = cms.untracked.vstring('cout','cerr'),
0099         cout = cms.untracked.PSet(threshold = cms.untracked.string('INFO')),
0100         cerr = cms.untracked.PSet(threshold  = cms.untracked.string('WARNING')),
0101         )
0102     return process
0103 
0104 
0105 def L1TAddDebugOutput(process):
0106     print("L1T INFO:  sending debugging ouput to file l1tdebug.log")
0107     print("L1T INFO:  add <flags CXXFLAGS=\"-g -D=EDM_ML_DEBUG\"/> in BuildFile.xml of any package you want to debug...")
0108     process.MessageLogger = cms.Service(
0109         "MessageLogger",
0110         destinations = cms.untracked.vstring('l1tdebug','cerr'),
0111         l1tdebug = cms.untracked.PSet(threshold = cms.untracked.string('DEBUG')),
0112         #debugModules = cms.untracked.vstring('caloStage1Digis'))
0113         cerr = cms.untracked.PSet(threshold  = cms.untracked.string('WARNING')),
0114         debugModules = cms.untracked.vstring('*'))
0115     return process
0116 
0117 def L1TDumpEventData(process):
0118     print("L1T INFO:  adding EventContentAnalyzer to process schedule")
0119     process.dumpED = cms.EDAnalyzer("EventContentAnalyzer")
0120     process.l1tdumpevent = cms.Path(process.dumpED)
0121     process.schedule.append(process.l1tdumpevent)
0122     return process
0123 
0124 def L1TDumpEventSummary(process):
0125     process.dumpES = cms.EDAnalyzer("PrintEventSetupContent")
0126     process.l1tdumpeventsetup = cms.Path(process.dumpES)
0127     process.schedule.append(process.l1tdumpeventsetup)
0128     return process
0129 
0130 def L1TStage2ComparisonRAWvsEMU(process):
0131     print("L1T INFO:  will dump a comparison of unpacked vs emulated Stage2 content to screen.")
0132     process.load('L1Trigger.L1TCommon.l1tComparisonStage2RAWvsEMU_cfi')
0133     process.l1tstage2comparison = cms.Path(process.l1tComparisonStage2RAWvsEMU)
0134     process.schedule.append(process.l1tstage2comparison)
0135     return process
0136 
0137 
0138 def L1TGtStage2ComparisonRAWvsEMU(process):
0139     print("L1T INFO:  will dump a comparison of unpacked vs emulated GT Stage2 content to screen.")
0140     process.load('L1Trigger.L1TCommon.l1tComparisonGtStage2RAWvsEMU_cfi')
0141     process.l1tgtstage2comparison = cms.Path(process.l1tComparisonGtStage2RAWvsEMU)
0142     process.schedule.append(process.l1tgtstage2comparison)
0143     return process
0144 
0145 def L1TStage2SetPrefireVetoBit(process):
0146     process.load('L1Trigger.L1TGlobal.simGtExtFakeProd_cfi')
0147     process.l1tstage2gtext = cms.Path(process.simGtExtUnprefireable)
0148     process.schedule.insert(0,process.l1tstage2gtext)
0149     return process