File indexing completed on 2024-12-01 23:40:29
0001
0002
0003
0004
0005
0006 import FWCore.ParameterSet.Config as cms
0007 import FWCore.Utilities.FileUtils as FileUtils
0008
0009 import os
0010
0011
0012 import FWCore.ParameterSet.VarParsing as VarParsing
0013 options = VarParsing.VarParsing('analysis')
0014 options.register('filename',
0015 "rx_summary",
0016 VarParsing.VarParsing.multiplicity.singleton,
0017 VarParsing.VarParsing.varType.string,
0018 "Filename string")
0019 options.register('outDir',
0020 "rxFiles",
0021 VarParsing.VarParsing.multiplicity.singleton,
0022 VarParsing.VarParsing.varType.string,
0023 "Output directory for buffer files")
0024 options.register('nPayloadFrames',
0025 13,
0026 VarParsing.VarParsing.multiplicity.singleton,
0027 VarParsing.VarParsing.varType.int,
0028 "N payload frames per event")
0029 options.register('nHeaderFrames',
0030 0,
0031 VarParsing.VarParsing.multiplicity.singleton,
0032 VarParsing.VarParsing.varType.int,
0033 "N header frames per event")
0034 options.register('nClearFrames',
0035 0,
0036 VarParsing.VarParsing.multiplicity.singleton,
0037 VarParsing.VarParsing.varType.int,
0038 "N clear frames between events")
0039 options.register('dump',
0040 True,
0041 VarParsing.VarParsing.multiplicity.singleton,
0042 VarParsing.VarParsing.varType.bool,
0043 "Dump messages")
0044 options.register('pattern',
0045 True,
0046 VarParsing.VarParsing.multiplicity.singleton,
0047 VarParsing.VarParsing.varType.bool,
0048 "Save pattern file")
0049 options.register('edm',
0050 False,
0051 VarParsing.VarParsing.multiplicity.singleton,
0052 VarParsing.VarParsing.varType.bool,
0053 "Save EDM file")
0054 options.register('debug',
0055 False,
0056 VarParsing.VarParsing.multiplicity.singleton,
0057 VarParsing.VarParsing.varType.bool,
0058 "Enable debug data")
0059
0060 options.parseArguments()
0061
0062 if (options.maxEvents == -1):
0063 options.maxEvents = 1
0064
0065 fileList = FileUtils.loadListFromFile('ttbar.list')
0066 readFiles = cms.untracked.vstring(*fileList)
0067
0068
0069 if not os.path.isdir(options.outDir): os.mkdir(options.outDir)
0070
0071 process = cms.Process('L1Emulator')
0072
0073
0074 process.load('FWCore.MessageService.MessageLogger_cfi')
0075 process.load('Configuration.Geometry.GeometryDB_cff')
0076 process.load('Configuration.StandardSequences.Digi_cff')
0077 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0078 process.load('Configuration.StandardSequences.RawToDigi_cff')
0079
0080 process.maxEvents = cms.untracked.PSet(
0081 input = cms.untracked.int32(options.maxEvents)
0082 )
0083
0084
0085 process.source = cms.Source("PoolSource",
0086 fileNames = readFiles,
0087 )
0088
0089 process.options = cms.untracked.PSet(
0090
0091 )
0092
0093 from Configuration.AlCa.GlobalTag import GlobalTag
0094 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '')
0095
0096
0097
0098 process.output = cms.OutputModule("PoolOutputModule",
0099 splitLevel = cms.untracked.int32(0),
0100 eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0101 outputCommands = cms.untracked.vstring("keep *",
0102 "drop *_mix_*_*"),
0103 fileName = cms.untracked.string('SingleElectronPt10_cfi_py_GEN_SIM_DIGI_L1.root'),
0104 dataset = cms.untracked.PSet(
0105 filterName = cms.untracked.string(''),
0106 dataTier = cms.untracked.string('')
0107 ),
0108 SelectEvents = cms.untracked.PSet(
0109 SelectEvents = cms.vstring('generation_step')
0110 )
0111 )
0112
0113
0114
0115 process.MessageLogger.categories.append('L1TCaloEvents')
0116
0117 process.MessageLogger.suppressInfo = cms.untracked.vstring('Geometry', 'AfterSource')
0118
0119 if (options.dump):
0120 process.MessageLogger.infos.placeholder = cms.untracked.bool(False)
0121 process.MessageLogger.infos.INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
0122 process.MessageLogger.infos.L1TCaloEvents = cms.untracked.PSet(
0123 optionalPSet = cms.untracked.bool(True),
0124 limit = cms.untracked.int32(10000)
0125 )
0126
0127 if (options.debug):
0128 process.MessageLogger.debugModules = cms.untracked.vstring('*')
0129 process.MessageLogger.cerr.threshold = cms.untracked.string('DEBUG')
0130
0131
0132
0133 process.load("CommonTools.UtilAlgos.TFileService_cfi")
0134 process.TFileService.fileName = cms.string('l1tCalo_2019_histos.root')
0135
0136 process.load('L1Trigger.L1CaloTrigger.l1tS2PFJetInputPatternWriter_cfi')
0137 process.l1tS2PFJetInputPatternWriter.pfTag = cms.InputTag("l1pfCandidates", "Puppi", "IN")
0138 process.l1tS2PFJetInputPatternWriter.filename = cms.untracked.string(options.filename)
0139 process.l1tS2PFJetInputPatternWriter.outDir = cms.untracked.string(options.outDir)
0140 process.l1tS2PFJetInputPatternWriter.nPayloadFrames = cms.untracked.uint32(options.nPayloadFrames)
0141 process.l1tS2PFJetInputPatternWriter.nHeaderFrames = cms.untracked.uint32(options.nHeaderFrames)
0142 process.l1tS2PFJetInputPatternWriter.nClearFrames = cms.untracked.uint32(options.nClearFrames)
0143
0144
0145 process.path = cms.Path(
0146 process.l1tS2PFJetInputPatternWriter)
0147
0148 if (options.edm):
0149 process.output_step = cms.EndPath(process.output)
0150