File indexing completed on 2024-04-06 12:20:26
0001 import FWCore.ParameterSet.Config as cms
0002
0003
0004 import FWCore.ParameterSet.VarParsing as VarParsing
0005 options = VarParsing.VarParsing('analysis')
0006 options.register('skipEvents',
0007 0,
0008 VarParsing.VarParsing.multiplicity.singleton,
0009 VarParsing.VarParsing.varType.int,
0010 "Number of events to skip")
0011 options.register('selMPBx',
0012 0,
0013 VarParsing.VarParsing.multiplicity.singleton,
0014 VarParsing.VarParsing.varType.int,
0015 "Select MP readout Bx")
0016 options.register('selDemuxBx',
0017 0,
0018 VarParsing.VarParsing.multiplicity.singleton,
0019 VarParsing.VarParsing.varType.int,
0020 "Select Demux readout Bx")
0021 options.register('selAllBx',
0022 False,
0023 VarParsing.VarParsing.multiplicity.singleton,
0024 VarParsing.VarParsing.varType.bool,
0025 "Run over all Bx in readout for MP and demux")
0026 options.register('evtDisp',
0027 False,
0028 VarParsing.VarParsing.multiplicity.singleton,
0029 VarParsing.VarParsing.varType.bool,
0030 'Produce histos for individual events')
0031 options.register('dumpTowers',
0032 False,
0033 VarParsing.VarParsing.multiplicity.singleton,
0034 VarParsing.VarParsing.varType.bool,
0035 'Dump all towers in text form when a problem is found')
0036 options.register('dumpWholeEvent',
0037 False,
0038 VarParsing.VarParsing.multiplicity.singleton,
0039 VarParsing.VarParsing.varType.bool,
0040 'Dump all event contents in text when a problem is found')
0041
0042 options.parseArguments()
0043
0044
0045 process = cms.Process('CaloLayer2MPFWValidation')
0046
0047
0048 process.load('Configuration.StandardSequences.Services_cff')
0049 process.load('FWCore.MessageService.MessageLogger_cfi')
0050 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0051 process.load('Configuration.Geometry.GeometryDB_cff')
0052 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0053 process.load('Configuration.StandardSequences.RawToDigi_cff')
0054 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0055 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0056 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0057
0058 process.maxEvents = cms.untracked.PSet(
0059 input = cms.untracked.int32(options.maxEvents)
0060 )
0061
0062
0063
0064 process.source = cms.Source("PoolSource",
0065 fileNames=cms.untracked.vstring(options.inputFiles),
0066 skipEvents=cms.untracked.uint32(options.skipEvents)
0067 )
0068
0069 process.options = cms.untracked.PSet(
0070 SkipEvent = cms.untracked.vstring('ProductNotFound')
0071 )
0072
0073
0074 process.output = cms.OutputModule(
0075 "PoolOutputModule",
0076 outputCommands = cms.untracked.vstring(
0077 "drop *",
0078 "keep *_*_dataJet_*",
0079 "keep *_*_emulJet_*",
0080 "keep *_*_dataEg_*",
0081 "keep *_*_emulEg_*",
0082 "keep *_*_dataTau_*",
0083 "keep *_*_emulTau_*",
0084 "keep *_*_dataEtSum_*",
0085 "keep *_*_emulEtSum_*",
0086 "keep *_*_dataCaloTower_*",
0087 "keep *_*_emulCaloTower_*",
0088 ),
0089 fileName = cms.untracked.string('l1tCaloLayer2CompEDM.root')
0090 )
0091
0092
0093
0094 process.load("CommonTools.UtilAlgos.TFileService_cfi")
0095 process.TFileService.fileName = cms.string('l1tCalo_2016_simHistos.root')
0096
0097
0098
0099 process.MessageLogger = cms.Service(
0100 "MessageLogger",
0101 threshold = cms.untracked.string('ERROR'),
0102 categories = cms.untracked.vstring('L1T'),
0103 destinations = cms.untracked.vstring('calol2_mp_fw_emul_differences'),
0104 debugModules = cms.untracked.vstring('L1Trigger.L1TCalorimeter.l1tStage2CaloLayer2Comp_cfi')
0105 )
0106
0107
0108
0109 from Configuration.AlCa.GlobalTag import GlobalTag
0110 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '')
0111
0112
0113 process.load('L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi')
0114 process.simCaloStage2Digis.useStaticConfig = True
0115 process.simCaloStage2Digis.towerToken = cms.InputTag("caloStage2Digis","CaloTower")
0116
0117
0118 process.load('L1Trigger.L1TCalorimeter.caloParams_2019_v1_0_cfi')
0119
0120
0121 process.load('L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi')
0122 process.l1tStage2CaloAnalyzer.doEvtDisp = options.evtDisp
0123 process.l1tStage2CaloAnalyzer.mpBx = options.selMPBx
0124 process.l1tStage2CaloAnalyzer.dmxBx = options.selDemuxBx
0125 process.l1tStage2CaloAnalyzer.allBx = options.selAllBx
0126 process.l1tStage2CaloAnalyzer.clusterToken = cms.InputTag("None")
0127 process.l1tStage2CaloAnalyzer.towerToken = cms.InputTag("l1tStage2CaloLayer2Comp","emulCaloTower")
0128 process.l1tStage2CaloAnalyzer.mpEGToken = cms.InputTag("l1tStage2CaloLayer2Comp", "emulEg")
0129 process.l1tStage2CaloAnalyzer.mpTauToken = cms.InputTag("l1tStage2CaloLayer2Comp", "emulTau")
0130 process.l1tStage2CaloAnalyzer.mpJetToken = cms.InputTag("l1tStage2CaloLayer2Comp", "emulJet")
0131 process.l1tStage2CaloAnalyzer.mpEtSumToken = cms.InputTag("l1tStage2CaloLayer2Comp", "emulEtSum")
0132
0133 import L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi
0134 process.l1tCaloStage2HwHistos = L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi.l1tStage2CaloAnalyzer.clone()
0135 process.l1tStage2CaloAnalyzer.doEvtDisp = options.evtDisp
0136 process.l1tStage2CaloAnalyzer.mpBx = options.selMPBx
0137 process.l1tStage2CaloAnalyzer.dmxBx = options.selDemuxBx
0138 process.l1tStage2CaloAnalyzer.allBx = options.selAllBx
0139 process.l1tCaloStage2HwHistos.clusterToken = cms.InputTag("None")
0140 process.l1tCaloStage2HwHistos.towerToken = cms.InputTag("l1tStage2CaloLayer2Comp", "dataCaloTower")
0141 process.l1tCaloStage2HwHistos.mpEGToken = cms.InputTag("l1tStage2CaloLayer2Comp", "dataEg")
0142 process.l1tCaloStage2HwHistos.mpTauToken = cms.InputTag("l1tStage2CaloLayer2Comp", "dataTau")
0143 process.l1tCaloStage2HwHistos.mpJetToken = cms.InputTag("l1tStage2CaloLayer2Comp", "dataJet")
0144 process.l1tCaloStage2HwHistos.mpEtSumToken = cms.InputTag("l1tStage2CaloLayer2Comp", "dataEtSum")
0145
0146
0147 process.load('L1Trigger.L1TCalorimeter.l1tStage2CaloLayer2Comp_cfi')
0148 process.l1tStage2CaloLayer2Comp.dumpTowers = options.dumpTowers
0149 process.l1tStage2CaloLayer2Comp.dumpWholeEvent = options.dumpWholeEvent
0150
0151
0152 process.path = cms.Path(
0153 process.simCaloStage2Digis
0154 + process.l1tStage2CaloLayer2Comp
0155 + process.l1tStage2CaloAnalyzer
0156 + process.l1tCaloStage2HwHistos
0157 )
0158
0159
0160
0161
0162
0163
0164
0165 process.out = cms.EndPath(
0166 process.output
0167 )
0168