Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 # input modules
0004 unpackerModule = "gmtStage2Digis"
0005 emulatorModule = "valGmtStage2Digis"
0006 showerEmulatorModule = "valGmtShowerDigis"
0007 
0008 # directories
0009 ugmtEmuDqmDir = "L1TEMU/L1TdeStage2uGMT"
0010 ugmtEmuImdMuDqmDir = ugmtEmuDqmDir+"/intermediate_muons"
0011 
0012 # List of bins to ignore
0013 ignoreFinalsBinsRun3 = [1]
0014 ignoreIntermediatesBins = [7, 8, 12, 13]
0015 ignoreIntermediatesBinsRun3 = [1, 7, 8, 12, 13]
0016 
0017 # fills histograms with all uGMT emulated muons
0018 # uGMT input muon histograms from track finders are not filled since they are identical to the data DQM plots
0019 from DQM.L1TMonitor.L1TStage2uGMT_cfi import *
0020 l1tStage2uGMTEmul = l1tStage2uGMT.clone(
0021     muonProducer = emulatorModule,
0022     monitorDir = ugmtEmuDqmDir,
0023     emulator = True
0024 )
0025 # the uGMT intermediate muon DQM modules
0026 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0027 l1tStage2uGMTIntermediateBMTFEmul = DQMEDAnalyzer(
0028     "L1TStage2uGMTMuon",
0029     muonProducer = cms.InputTag(emulatorModule, "imdMuonsBMTF"),
0030     monitorDir = cms.untracked.string(ugmtEmuImdMuDqmDir+"/BMTF"),
0031     titlePrefix = cms.untracked.string("uGMT intermediate muon from BMTF "),
0032     verbose = cms.untracked.bool(False),
0033     displacedQuantities = cms.untracked.bool(False),
0034 )
0035 
0036 ## Era: Run3_2021; Displaced muons from BMTF used in uGMT from Run-3
0037 from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021
0038 stage2L1Trigger_2021.toModify(l1tStage2uGMTIntermediateBMTFEmul, displacedQuantities = cms.untracked.bool(True))
0039 
0040 l1tStage2uGMTIntermediateOMTFNegEmul = DQMEDAnalyzer(
0041     "L1TStage2uGMTMuon",
0042     muonProducer = cms.InputTag(emulatorModule, "imdMuonsOMTFNeg"),
0043     monitorDir = cms.untracked.string(ugmtEmuImdMuDqmDir+"/OMTF_neg"),
0044     titlePrefix = cms.untracked.string("uGMT intermediate muon from OMTF neg. "),
0045     verbose = cms.untracked.bool(False),
0046 )
0047 
0048 l1tStage2uGMTIntermediateOMTFPosEmul = DQMEDAnalyzer(
0049     "L1TStage2uGMTMuon",
0050     muonProducer = cms.InputTag(emulatorModule, "imdMuonsOMTFPos"),
0051     monitorDir = cms.untracked.string(ugmtEmuImdMuDqmDir+"/OMTF_pos"),
0052     titlePrefix = cms.untracked.string("uGMT intermediate muon from OMTF pos. "),
0053     verbose = cms.untracked.bool(False),
0054 )
0055 
0056 l1tStage2uGMTIntermediateEMTFNegEmul = DQMEDAnalyzer(
0057     "L1TStage2uGMTMuon",
0058     muonProducer = cms.InputTag(emulatorModule, "imdMuonsEMTFNeg"),
0059     monitorDir = cms.untracked.string(ugmtEmuImdMuDqmDir+"/EMTF_neg"),
0060     titlePrefix = cms.untracked.string("uGMT intermediate muon from EMTF neg. "),
0061     verbose = cms.untracked.bool(False),
0062 )
0063 
0064 l1tStage2uGMTIntermediateEMTFPosEmul = DQMEDAnalyzer(
0065     "L1TStage2uGMTMuon",
0066     muonProducer = cms.InputTag(emulatorModule, "imdMuonsEMTFPos"),
0067     monitorDir = cms.untracked.string(ugmtEmuImdMuDqmDir+"/EMTF_pos"),
0068     titlePrefix = cms.untracked.string("uGMT intermediate muon from EMTF pos. "),
0069     verbose = cms.untracked.bool(False),
0070 )
0071 
0072 ## Era: Run3_2021; Displaced muons from EMTF used in uGMT from Run-3
0073 stage2L1Trigger_2021.toModify(l1tStage2uGMTIntermediateEMTFNegEmul, displacedQuantities = cms.untracked.bool(True))
0074 stage2L1Trigger_2021.toModify(l1tStage2uGMTIntermediateEMTFPosEmul, displacedQuantities = cms.untracked.bool(True))
0075 
0076 # compares the unpacked uGMT muon collection to the emulated uGMT muon collection
0077 # only muons that do not match are filled in the histograms
0078 l1tdeStage2uGMT = DQMEDAnalyzer(
0079     "L1TStage2MuonComp",
0080     muonCollection1 = cms.InputTag(unpackerModule, "Muon"),
0081     muonCollection2 = cms.InputTag(emulatorModule),
0082     monitorDir = cms.untracked.string(ugmtEmuDqmDir+"/data_vs_emulator_comparison"),
0083     muonCollection1Title = cms.untracked.string("uGMT data"),
0084     muonCollection2Title = cms.untracked.string("uGMT emulator"),
0085     summaryTitle = cms.untracked.string("Summary of comparison between uGMT muons and uGMT emulator muons"),
0086     verbose = cms.untracked.bool(False),
0087     enable2DComp = cms.untracked.bool(True), # When true eta-phi comparison plots are also produced
0088     displacedQuantities = cms.untracked.bool(False),
0089     ignoreBin = cms.untracked.vint32(),
0090 )
0091 
0092 ## Era: Run3_2021; Displaced muons used in uGMT from Run-3
0093  # Additionally: Ignore BX range mismatches. This is necessary because we only read out the central BX for the inputs, so that is what the emulator has to work on.
0094 from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021
0095 stage2L1Trigger_2021.toModify(l1tdeStage2uGMT, displacedQuantities = cms.untracked.bool(True), ignoreBin = ignoreFinalsBinsRun3)
0096 
0097 # compares the unpacked uGMT muon shower collection to the emulated uGMT muon shower collection
0098 # only showers that do not match are filled in the histograms
0099 l1tdeStage2uGMTShowers = DQMEDAnalyzer(
0100     "L1TStage2MuonShowerComp",
0101     muonShowerCollection1 = cms.InputTag(unpackerModule, "MuonShower"),
0102     muonShowerCollection2 = cms.InputTag(showerEmulatorModule),
0103     monitorDir = cms.untracked.string(ugmtEmuDqmDir+"/data_vs_emulator_comparison/Muon showers"),
0104     muonShowerCollection1Title = cms.untracked.string("uGMT data"),
0105     muonShowerCollection2Title = cms.untracked.string("uGMT emulator"),
0106     summaryTitle = cms.untracked.string("Summary of comparison between uGMT showers and uGMT emulator showers"),
0107     verbose = cms.untracked.bool(False),
0108     ignoreBin = cms.untracked.vint32(ignoreFinalsBinsRun3), # Ignore BX range mismatches. This is necessary because we only read out the central BX for the inputs, so that is what the emulator has to work on.
0109 )
0110 
0111 # compares the unpacked uGMT intermediate muon collection to the emulated uGMT intermediate muon collection
0112 # only muons that do not match are filled in the histograms
0113 l1tdeStage2uGMTIntermediateBMTF = l1tdeStage2uGMT.clone(
0114     muonCollection1 = (unpackerModule, "imdMuonsBMTF"),
0115     muonCollection2 = (emulatorModule, "imdMuonsBMTF"),
0116     monitorDir = ugmtEmuImdMuDqmDir+"/BMTF/data_vs_emulator_comparison",
0117     summaryTitle = "Summary of uGMT intermediate muon from BMTF comparison between unpacked and emulated",
0118     ignoreBin = ignoreIntermediatesBins
0119 )
0120 ## Era: Run3_2021; Ignore BX range mismatches. This is necessary because we only read out the central BX for the inputs, so that is what the emulator has to work on.
0121 from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021
0122 stage2L1Trigger_2021.toModify(l1tdeStage2uGMTIntermediateBMTF, ignoreBin = ignoreIntermediatesBinsRun3)
0123 
0124 l1tdeStage2uGMTIntermediateOMTFNeg = l1tdeStage2uGMTIntermediateBMTF.clone(
0125     displacedQuantities = False,
0126     muonCollection1 = (unpackerModule, "imdMuonsOMTFNeg"),
0127     muonCollection2 = (emulatorModule, "imdMuonsOMTFNeg"),
0128     monitorDir = (ugmtEmuImdMuDqmDir+"/OMTF_neg/data_vs_emulator_comparison"),
0129     summaryTitle = ("Summary of uGMT intermediate muon from OMTF- comparison between unpacked and emulated"),
0130 )
0131 l1tdeStage2uGMTIntermediateOMTFPos = l1tdeStage2uGMTIntermediateBMTF.clone(
0132     displacedQuantities = False,
0133     muonCollection1 = (unpackerModule, "imdMuonsOMTFPos"),
0134     muonCollection2 = (emulatorModule, "imdMuonsOMTFPos"),
0135     monitorDir = (ugmtEmuImdMuDqmDir+"/OMTF_pos/data_vs_emulator_comparison"),
0136     summaryTitle = "Summary of uGMT intermediate muon from OMTF+ comparison between unpacked and emulated",
0137 )
0138 l1tdeStage2uGMTIntermediateEMTFNeg = l1tdeStage2uGMTIntermediateBMTF.clone(
0139     displacedQuantities = False,
0140     muonCollection1 = (unpackerModule, "imdMuonsEMTFNeg"),
0141     muonCollection2 = (emulatorModule, "imdMuonsEMTFNeg"),
0142     monitorDir = (ugmtEmuImdMuDqmDir+"/EMTF_neg/data_vs_emulator_comparison"),
0143     summaryTitle = "Summary of uGMT intermediate muon from EMTF- comparison between unpacked and emulated",
0144 )
0145 l1tdeStage2uGMTIntermediateEMTFPos = l1tdeStage2uGMTIntermediateBMTF.clone(
0146     displacedQuantities = False,
0147     muonCollection1 = (unpackerModule, "imdMuonsEMTFPos"),
0148     muonCollection2 = (emulatorModule, "imdMuonsEMTFPos"),
0149     monitorDir = (ugmtEmuImdMuDqmDir+"/EMTF_pos/data_vs_emulator_comparison"),
0150     summaryTitle = "Summary of uGMT intermediate muon from EMTF+ comparison between unpacked and emulated",
0151 )
0152 # sequences
0153 l1tStage2uGMTEmulatorOnlineDQMSeq = cms.Sequence(
0154     l1tStage2uGMTEmul +
0155     l1tStage2uGMTIntermediateBMTFEmul +
0156     l1tStage2uGMTIntermediateOMTFNegEmul +
0157     l1tStage2uGMTIntermediateOMTFPosEmul +
0158     l1tStage2uGMTIntermediateEMTFNegEmul +
0159     l1tStage2uGMTIntermediateEMTFPosEmul +
0160     l1tdeStage2uGMT +
0161     l1tdeStage2uGMTIntermediateBMTF +
0162     l1tdeStage2uGMTIntermediateOMTFNeg +
0163     l1tdeStage2uGMTIntermediateOMTFPos +
0164     l1tdeStage2uGMTIntermediateEMTFNeg +
0165     l1tdeStage2uGMTIntermediateEMTFPos
0166 )
0167 
0168 _run3_l1tStage2uGMTEmulatorOnlineDQMSeq = cms.Sequence(l1tStage2uGMTEmulatorOnlineDQMSeq.copy() + l1tdeStage2uGMTShowers)
0169 stage2L1Trigger_2021.toReplaceWith(l1tStage2uGMTEmulatorOnlineDQMSeq, _run3_l1tStage2uGMTEmulatorOnlineDQMSeq)
0170