File indexing completed on 2024-04-06 12:20:37
0001 from __future__ import print_function
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 import FWCore.ParameterSet.Config as cms
0017
0018
0019
0020 import FWCore.ParameterSet.VarParsing as VarParsing
0021 options = VarParsing.VarParsing('analysis')
0022 options.register('skipEvents',
0023 0,
0024 VarParsing.VarParsing.multiplicity.singleton,
0025 VarParsing.VarParsing.varType.int,
0026 "Number of events to skip")
0027 options.register('dump',
0028 False,
0029 VarParsing.VarParsing.multiplicity.singleton,
0030 VarParsing.VarParsing.varType.bool,
0031 "Print RAW data")
0032 options.register('debug',
0033 False,
0034 VarParsing.VarParsing.multiplicity.singleton,
0035 VarParsing.VarParsing.varType.bool,
0036 "Enable debug data")
0037
0038 options.parseArguments()
0039
0040 if (options.maxEvents == -1):
0041 options.maxEvents = 1
0042
0043
0044 process = cms.Process('Raw2DigiuGTEmul')
0045
0046
0047 process.load('Configuration.StandardSequences.Services_cff')
0048 process.load('FWCore.MessageService.MessageLogger_cfi')
0049 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0050 process.load('Configuration.Geometry.GeometryDB_cff')
0051 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0052 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0053 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0054 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0055
0056 process.maxEvents = cms.untracked.PSet(
0057 input = cms.untracked.int32(options.maxEvents)
0058 )
0059
0060
0061
0062 process.source = cms.Source("PoolSource",
0063 secondaryFileNames = cms.untracked.vstring(),
0064
0065 fileNames = cms.untracked.vstring("file:l1tCalo_Test.root"),
0066 skipEvents = cms.untracked.uint32(options.skipEvents)
0067 )
0068
0069
0070
0071
0072
0073 process.load("CommonTools.UtilAlgos.TFileService_cfi")
0074 process.TFileService.fileName = cms.string('l1t_histos.root')
0075
0076
0077
0078
0079 process.MessageLogger.L1TCaloEvents=dict()
0080 process.MessageLogger.L1TGlobalEvents=dict()
0081
0082 process.MessageLogger.suppressInfo = cms.untracked.vstring('Geometry', 'AfterSource')
0083
0084 if (options.dump):
0085 process.MessageLogger.files.infos = cms.untracked.PSet(
0086 INFO = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0087 L1TCaloEvents = cms.untracked.PSet(
0088 limit = cms.untracked.int32(10000)
0089 )
0090 )
0091
0092 if (options.debug):
0093
0094 process.MessageLogger.debugModules = cms.untracked.vstring('*')
0095 process.MessageLogger.cerr.threshold = cms.untracked.string('DEBUG')
0096
0097
0098
0099
0100 from Configuration.AlCa.GlobalTag import GlobalTag
0101 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '')
0102
0103
0104 print("Job config :")
0105 print("maxEvents = ", options.maxEvents)
0106 print("skipEvents = ", options.skipEvents)
0107 print("dump = ", options.dump)
0108 print("debug = ", options.debug)
0109 print(" ")
0110
0111
0112
0113 process.dumpRaw = cms.EDAnalyzer(
0114 "DumpFEDRawDataProduct",
0115 label = cms.untracked.string("rawDataCollector"),
0116 feds = cms.untracked.vint32 ( 1360, 1366, 1404 ),
0117 dumpPayload = cms.untracked.bool ( options.dump )
0118 )
0119
0120
0121 process.load('EventFilter.L1TRawToDigi.caloStage2Digis_cfi')
0122 process.caloStage2Digis.InputLabel = cms.InputTag('rawDataCollector')
0123
0124 process.load('EventFilter.L1TRawToDigi.gtStage2Digis_cfi')
0125 process.gtStage2Digis.InputLabel = cms.InputTag('rawDataCollector')
0126
0127
0128
0129 process.load('L1Trigger.L1TGlobal.StableParametersConfig_cff')
0130 process.load('L1Trigger.L1TGlobal.TriggerMenuXml_cfi')
0131 process.TriggerMenuXml.TriggerMenuLuminosity = 'startup'
0132 process.TriggerMenuXml.DefXmlFile = 'L1Menu_CaloSliceTest_2015.xml'
0133
0134 process.load('L1Trigger.L1TGlobal.TriggerMenuConfig_cff')
0135 process.es_prefer_l1GtParameters = cms.ESPrefer('l1t::TriggerMenuXmlProducer','TriggerMenuXml')
0136
0137 process.emL1uGtFromGtInput = cms.EDProducer("L1TGlobalProducer",
0138 ProduceL1GtObjectMapRecord = cms.bool(False),
0139 AlgorithmTriggersUnmasked = cms.bool(False),
0140 EmulateBxInEvent = cms.int32(1),
0141 L1DataBxInEvent = cms.int32(1),
0142 AlgorithmTriggersUnprescaled = cms.bool(False),
0143 ProduceL1GtDaqRecord = cms.bool(True),
0144 GmtInputTag = cms.InputTag(""),
0145 caloInputTag = cms.InputTag("gtStage2Digis"),
0146 AlternativeNrBxBoardDaq = cms.uint32(0),
0147 BstLengthBytes = cms.int32(-1),
0148 Verbosity = cms.untracked.int32(5)
0149 )
0150
0151 process.emL1uGtFromDemuxOutput = cms.EDProducer("L1TGlobalProducer",
0152 ProduceL1GtObjectMapRecord = cms.bool(False),
0153 AlgorithmTriggersUnmasked = cms.bool(False),
0154 EmulateBxInEvent = cms.int32(1),
0155 L1DataBxInEvent = cms.int32(1),
0156 AlgorithmTriggersUnprescaled = cms.bool(False),
0157 ProduceL1GtDaqRecord = cms.bool(True),
0158 GmtInputTag = cms.InputTag(""),
0159 caloInputTag = cms.InputTag("caloStage2Digis"),
0160 AlternativeNrBxBoardDaq = cms.uint32(0),
0161 BstLengthBytes = cms.int32(-1),
0162 Verbosity = cms.untracked.int32(5)
0163 )
0164
0165
0166
0167
0168 process.load('L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi')
0169 process.l1tStage2CaloAnalyzer.doText = cms.untracked.bool(options.debug)
0170 process.l1tStage2CaloAnalyzer.towerToken = cms.InputTag("caloStage2Digis")
0171 process.l1tStage2CaloAnalyzer.clusterToken = cms.InputTag("None")
0172 process.l1tStage2CaloAnalyzer.mpEGToken = cms.InputTag("None")
0173 process.l1tStage2CaloAnalyzer.mpTauToken = cms.InputTag("None")
0174
0175
0176
0177 process.l1tGlobalAnalyzer = cms.EDAnalyzer('L1TGlobalAnalyzer',
0178 doText = cms.untracked.bool(options.debug),
0179 dmxEGToken = cms.InputTag("None"),
0180 dmxTauToken = cms.InputTag("None"),
0181 dmxJetToken = cms.InputTag("caloStage2Digis"),
0182 dmxEtSumToken = cms.InputTag("caloStage2Digis"),
0183 egToken = cms.InputTag("None"),
0184 tauToken = cms.InputTag("None"),
0185 jetToken = cms.InputTag("None"),
0186 etSumToken = cms.InputTag("None"),
0187 gtAlgToken = cms.InputTag("gtStage2Digis"),
0188 emulDxAlgToken = cms.InputTag("emL1uGtFromDemuxOutput"),
0189 emulGtAlgToken = cms.InputTag("None")
0190 )
0191
0192
0193
0194 process.path = cms.Path(
0195 process.dumpRaw
0196 +process.caloStage2Digis
0197 +process.gtStage2Digis
0198
0199 +process.emL1uGtFromDemuxOutput
0200 +process.l1tStage2CaloAnalyzer
0201 +process.l1tGlobalAnalyzer
0202 )
0203
0204
0205