Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-21 04:25:29

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.totemTriggerRawToDigi)
0067 process.RawToDigi.remove(process.totemRPRawToDigi)
0068 process.RawToDigi.remove(process.ctppsDiamondRawToDigi)
0069 process.RawToDigi.remove(process.ctppsPixelDigis)
0070 
0071 process.rawToDigiPath = cms.Path(process.RawToDigi)
0072 
0073 #--------------------------------------------------
0074 # Stage2 DQM Paths
0075 
0076 # Filter fat events
0077 from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
0078 process.hltFatEventFilter = hltHighLevel.clone(
0079    throw = False,
0080 # HLT_Physics now has the event % 107 filter as well as L1FatEvents
0081    HLTPaths = ['HLT_L1FatEvents_v*', 'HLT_Physics_v*']
0082 )
0083 
0084 # This can be used if HLT filter not available in a run
0085 process.selfFatEventFilter = cms.EDFilter("HLTL1NumberFilter",
0086         invert = cms.bool(False),
0087         period = cms.uint32(107),
0088         rawInput = cms.InputTag("rawDataCollector"),
0089         fedId = cms.int32(1024)
0090         )
0091 
0092 process.load("DQM.L1TMonitor.L1TStage2Emulator_cff")
0093 
0094 process.l1tEmulatorMonitorPath = cms.Path(
0095     process.Stage2L1HardwareValidation +
0096     process.l1tStage2EmulatorOnlineDQM +
0097     process.hltFatEventFilter +
0098 #    process.selfFatEventFilter +
0099     process.Stage2L1HardwareValidationForValidationEvents +
0100     process.l1tStage2EmulatorOnlineDQMValidationEvents
0101     )
0102 
0103 # To get L1 conditions that are not in GlobalTag / O2O yet
0104 #process.load("L1Trigger.L1TCalorimeter.hackConditions_cff")
0105 #process.load("L1Trigger.L1TMuon.hackConditions_cff")
0106 #process.gmtParams.caloInputsMasked = cms.bool(True) # Disable uGMT calo inputs like in the online configuration
0107 #process.load("L1Trigger.L1TGlobal.hackConditions_cff")
0108 process.load("L1Trigger.L1TGlobal.GlobalParameters_cff")
0109 
0110 # To get CaloTPGTranscoder
0111 process.load('SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff')
0112 process.HcalTPGCoderULUT.LUTGenerationMode = False
0113 
0114 #--------------------------------------------------
0115 # TODO: Stage2 Emulator Quality Tests
0116 process.load("DQM.L1TMonitorClient.L1TStage2EmulatorMonitorClient_cff")
0117 process.l1tStage2EmulatorMonitorClientPath = cms.Path(process.l1tStage2EmulatorMonitorClient)
0118 
0119 #--------------------------------------------------
0120 # Customize for other type of runs
0121 
0122 # Cosmic run
0123 #if (process.runType.getRunType() == process.runType.cosmic_run):
0124 
0125 # Heavy-Ion run
0126 if (process.runType.getRunType() == process.runType.hi_run):
0127     process.onlineMetaDataDigis.onlineMetaDataInputLabel = "rawDataRepacker"
0128     process.onlineMetaDataRawToDigi.onlineMetaDataInputLabel = "rawDataRepacker"
0129     process.castorDigis.InputLabel = "rawDataRepacker"
0130     process.ctppsDiamondRawToDigi.rawDataTag = "rawDataRepacker"
0131     process.ctppsPixelDigis.inputLabel = "rawDataRepacker"
0132     process.ecalDigis.cpu.InputLabel = "rawDataRepacker"
0133     process.ecalPreshowerDigis.sourceTag = "rawDataRepacker"
0134     process.hcalDigis.InputLabel = "rawDataRepacker"
0135     process.muonCSCDigis.InputObjects = "rawDataRepacker"
0136     process.muonDTDigis.inputLabel = "rawDataRepacker"
0137     process.muonRPCDigis.InputLabel = "rawDataRepacker"
0138     process.muonGEMDigis.InputLabel = "rawDataRepacker"
0139     process.scalersRawToDigi.scalersInputTag = "rawDataRepacker"
0140     process.siPixelDigis.cpu.InputLabel = "rawDataRepacker"
0141     process.siStripDigis.ProductLabel = "rawDataRepacker"
0142     process.tcdsDigis.InputLabel = "rawDataRepacker"
0143     process.tcdsRawToDigi.InputLabel = "rawDataRepacker"
0144     process.totemRPRawToDigi.rawDataTag = "rawDataRepacker"
0145     process.totemTriggerRawToDigi.rawDataTag = "rawDataRepacker"
0146     process.totemTimingRawToDigi.rawDataTag = "rawDataRepacker"
0147     process.csctfDigis.producer = "rawDataRepacker"
0148     process.dttfDigis.DTTF_FED_Source = "rawDataRepacker"
0149     process.gctDigis.inputLabel = "rawDataRepacker"
0150     process.gtDigis.DaqGtInputTag = "rawDataRepacker"
0151     process.twinMuxStage2Digis.DTTM7_FED_Source = "rawDataRepacker"
0152     process.bmtfDigis.InputLabel = "rawDataRepacker"
0153     process.valBmtfAlgoSel.feds = "rawDataRepacker"
0154     process.omtfStage2Digis.inputLabel = "rawDataRepacker"
0155     process.emtfStage2Digis.InputLabel = "rawDataRepacker"
0156     process.gmtStage2Digis.InputLabel = "rawDataRepacker"
0157     process.caloLayer1Digis.InputLabel = "rawDataRepacker"
0158     process.caloStage1Digis.InputLabel = "rawDataRepacker"
0159     process.caloStage2Digis.InputLabel = "rawDataRepacker"
0160     process.simHcalTriggerPrimitiveDigis.InputTagFEDRaw = "rawDataRepacker"
0161     process.l1tdeStage2CaloLayer1.fedRawDataLabel = "rawDataRepacker"
0162     process.gtStage2Digis.InputLabel = "rawDataRepacker"
0163     process.selfFatEventFilter.rawInput = "rawDataRepacker"
0164     process.rpcTwinMuxRawToDigi.inputTag = "rawDataRepacker"
0165     process.rpcCPPFRawToDigi.inputTag = "rawDataRepacker"
0166     process.hltFatEventFilter.HLTPaths.append('HLT_HIPhysics_v*')
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)