Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:07:41

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 import sys
0004 from Configuration.Eras.Era_Run3_cff import Run3
0005 process = cms.Process("L1TStage2EmulatorDQM", Run3)
0006 
0007 unitTest = False
0008 if 'unitTest=True' in sys.argv:
0009     unitTest=True
0010 
0011 #--------------------------------------------------
0012 # Event Source and Condition
0013 
0014 if unitTest:
0015     process.load("DQM.Integration.config.unittestinputsource_cfi")
0016     from DQM.Integration.config.unittestinputsource_cfi import options
0017 else:
0018     # Live Online DQM in P5
0019     process.load("DQM.Integration.config.inputsource_cfi")
0020     from DQM.Integration.config.inputsource_cfi import options
0021 
0022 # Testing in lxplus
0023 #process.load("DQM.Integration.config.fileinputsource_cfi")
0024 #from DQM.Integration.config.fileinputsource_cfi import options
0025 
0026 # Required to load Global Tag
0027 process.load("DQM.Integration.config.FrontierCondition_GT_cfi")
0028 
0029 # required for EMTF emulator
0030 process.load('Configuration.StandardSequences.MagneticField_cff')
0031 # Required to load EcalMappingRecord
0032 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0033 
0034 #--------------------------------------------------
0035 # DQM Environment
0036 
0037 process.load("DQM.Integration.config.environment_cfi")
0038 
0039 process.dqmEnv.subSystemFolder = "L1TEMU"
0040 process.dqmSaver.tag = "L1TEMU"
0041 process.dqmSaver.runNumber = options.runNumber
0042 process.dqmSaverPB.tag = "L1TEMU"
0043 process.dqmSaverPB.runNumber = options.runNumber
0044 
0045 process.dqmEndPath = cms.EndPath(
0046     process.dqmEnv *
0047     process.dqmSaver *
0048     process.dqmSaverPB
0049 )
0050 
0051 #--------------------------------------------------
0052 # Standard Unpacking Path
0053 
0054 process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0055 
0056 # remove unneeded unpackers
0057 process.RawToDigi.remove(process.ecalDigis)
0058 process.RawToDigi.remove(process.ecalPreshowerDigis)
0059 process.RawToDigi.remove(process.hcalDigis)
0060 process.RawToDigi.remove(process.muonDTDigis)
0061 process.RawToDigi.remove(process.siPixelDigis)
0062 process.RawToDigi.remove(process.siStripDigis)
0063 process.RawToDigi.remove(process.castorDigis)
0064 process.RawToDigi.remove(process.scalersRawToDigi)
0065 process.RawToDigi.remove(process.tcdsDigis)
0066 process.RawToDigi.remove(process.totemRPRawToDigi)
0067 process.RawToDigi.remove(process.ctppsDiamondRawToDigi)
0068 process.RawToDigi.remove(process.ctppsPixelDigis)
0069 
0070 process.rawToDigiPath = cms.Path(process.RawToDigi)
0071 
0072 #--------------------------------------------------
0073 # Stage2 DQM Paths
0074 
0075 # Filter fat events
0076 from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
0077 process.hltFatEventFilter = hltHighLevel.clone(
0078    throw = False,
0079 # HLT_Physics now has the event % 107 filter as well as L1FatEvents
0080    HLTPaths = ['HLT_L1FatEvents_v*', 'HLT_Physics_v*']
0081 )
0082 
0083 # This can be used if HLT filter not available in a run
0084 process.selfFatEventFilter = cms.EDFilter("HLTL1NumberFilter",
0085         invert = cms.bool(False),
0086         period = cms.uint32(107),
0087         rawInput = cms.InputTag("rawDataCollector"),
0088         fedId = cms.int32(1024)
0089         )
0090 
0091 process.load("DQM.L1TMonitor.L1TStage2Emulator_cff")
0092 
0093 process.l1tEmulatorMonitorPath = cms.Path(
0094     process.Stage2L1HardwareValidation +
0095     process.l1tStage2EmulatorOnlineDQM +
0096     process.hltFatEventFilter +
0097 #    process.selfFatEventFilter +
0098     process.Stage2L1HardwareValidationForValidationEvents +
0099     process.l1tStage2EmulatorOnlineDQMValidationEvents
0100     )
0101 
0102 # To get L1 conditions that are not in GlobalTag / O2O yet
0103 #process.load("L1Trigger.L1TCalorimeter.hackConditions_cff")
0104 #process.load("L1Trigger.L1TMuon.hackConditions_cff")
0105 #process.gmtParams.caloInputsMasked = cms.bool(True) # Disable uGMT calo inputs like in the online configuration
0106 #process.load("L1Trigger.L1TGlobal.hackConditions_cff")
0107 process.load("L1Trigger.L1TGlobal.GlobalParameters_cff")
0108 
0109 # To get CaloTPGTranscoder
0110 process.load('SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff')
0111 process.HcalTPGCoderULUT.LUTGenerationMode = False
0112 
0113 #--------------------------------------------------
0114 # TODO: Stage2 Emulator Quality Tests
0115 process.load("DQM.L1TMonitorClient.L1TStage2EmulatorMonitorClient_cff")
0116 process.l1tStage2EmulatorMonitorClientPath = cms.Path(process.l1tStage2EmulatorMonitorClient)
0117 
0118 #--------------------------------------------------
0119 # Customize for other type of runs
0120 
0121 # Cosmic run
0122 if process.runType.getRunType() == process.runType.cosmic_run:
0123     pass
0124 
0125 # Heavy-Ion run
0126 if process.runType.getRunType() == process.runType.hi_run:
0127     process.hltFatEventFilter.HLTPaths.append('HLT_HIPhysics_v*')
0128     rawDataRepackerLabel = 'rawDataRepacker'
0129     process.onlineMetaDataDigis.onlineMetaDataInputLabel = rawDataRepackerLabel
0130     process.onlineMetaDataRawToDigi.onlineMetaDataInputLabel = rawDataRepackerLabel
0131     process.castorDigis.InputLabel = rawDataRepackerLabel
0132     process.ctppsDiamondRawToDigi.rawDataTag = rawDataRepackerLabel
0133     process.ctppsPixelDigis.inputLabel = rawDataRepackerLabel
0134     process.ecalDigisCPU.InputLabel = rawDataRepackerLabel
0135     process.ecalPreshowerDigis.sourceTag = rawDataRepackerLabel
0136     process.hcalDigis.InputLabel = rawDataRepackerLabel
0137     process.muonCSCDigis.InputObjects = rawDataRepackerLabel
0138     process.muonDTDigis.inputLabel = rawDataRepackerLabel
0139     process.muonRPCDigis.InputLabel = rawDataRepackerLabel
0140     process.muonGEMDigis.InputLabel = rawDataRepackerLabel
0141     process.scalersRawToDigi.scalersInputTag = rawDataRepackerLabel
0142     process.siPixelDigis.cpu.InputLabel = rawDataRepackerLabel
0143     process.siStripDigis.ProductLabel = rawDataRepackerLabel
0144     process.tcdsDigis.InputLabel = rawDataRepackerLabel
0145     process.tcdsRawToDigi.InputLabel = rawDataRepackerLabel
0146     process.totemRPRawToDigi.rawDataTag = rawDataRepackerLabel
0147     process.totemTimingRawToDigi.rawDataTag = rawDataRepackerLabel
0148     process.csctfDigis.producer = rawDataRepackerLabel
0149     process.dttfDigis.DTTF_FED_Source = rawDataRepackerLabel
0150     process.gctDigis.inputLabel = rawDataRepackerLabel
0151     process.gtDigis.DaqGtInputTag = rawDataRepackerLabel
0152     process.twinMuxStage2Digis.DTTM7_FED_Source = rawDataRepackerLabel
0153     process.bmtfDigis.InputLabel = rawDataRepackerLabel
0154     process.valBmtfAlgoSel.feds = rawDataRepackerLabel
0155     process.omtfStage2Digis.inputLabel = rawDataRepackerLabel
0156     process.emtfStage2Digis.InputLabel = rawDataRepackerLabel
0157     process.gmtStage2Digis.InputLabel = rawDataRepackerLabel
0158     process.caloLayer1Digis.InputLabel = rawDataRepackerLabel
0159     process.caloStage1Digis.InputLabel = rawDataRepackerLabel
0160     process.caloStage2Digis.InputLabel = rawDataRepackerLabel
0161     process.simHcalTriggerPrimitiveDigis.InputTagFEDRaw = rawDataRepackerLabel
0162     process.l1tdeStage2CaloLayer1.fedRawDataLabel = rawDataRepackerLabel
0163     process.gtStage2Digis.InputLabel = rawDataRepackerLabel
0164     process.selfFatEventFilter.rawInput = rawDataRepackerLabel
0165     process.rpcTwinMuxRawToDigi.inputTag = rawDataRepackerLabel
0166     process.rpcCPPFRawToDigi.inputTag = rawDataRepackerLabel
0167 
0168 #--------------------------------------------------
0169 # L1T Emulator Online DQM Schedule
0170 
0171 process.schedule = cms.Schedule(
0172     process.rawToDigiPath,
0173     process.l1tEmulatorMonitorPath,
0174     process.l1tStage2EmulatorMonitorClientPath,
0175     process.dqmEndPath
0176 )
0177 
0178 #--------------------------------------------------
0179 # Process Customizations
0180 
0181 from DQM.Integration.config.online_customizations_cfi import *
0182 process = customise(process)
0183 print("Final Source settings:", process.source)