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