File indexing completed on 2024-11-27 03:17:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 import FWCore.ParameterSet.Config as cms
0015
0016
0017
0018 import FWCore.ParameterSet.VarParsing as VarParsing
0019 options = VarParsing.VarParsing('analysis')
0020 options.register('skipEvents',
0021 0,
0022 VarParsing.VarParsing.multiplicity.singleton,
0023 VarParsing.VarParsing.varType.int,
0024 "Number of events to skip")
0025 options.register('streamer',
0026 False,
0027 VarParsing.VarParsing.multiplicity.singleton,
0028 VarParsing.VarParsing.varType.bool,
0029 "Read input from streamer file")
0030 options.register('debug',
0031 False,
0032 VarParsing.VarParsing.multiplicity.singleton,
0033 VarParsing.VarParsing.varType.bool,
0034 "Enable debug data")
0035 options.register('dumpRaw',
0036 False,
0037 VarParsing.VarParsing.multiplicity.singleton,
0038 VarParsing.VarParsing.varType.bool,
0039 "Print RAW data")
0040 options.register('dumpDigis',
0041 False,
0042 VarParsing.VarParsing.multiplicity.singleton,
0043 VarParsing.VarParsing.varType.bool,
0044 "Print digis")
0045 options.register('histos',
0046 False,
0047 VarParsing.VarParsing.multiplicity.singleton,
0048 VarParsing.VarParsing.varType.bool,
0049 "Produce standard histograms")
0050 options.register('edm',
0051 False,
0052 VarParsing.VarParsing.multiplicity.singleton,
0053 VarParsing.VarParsing.varType.bool,
0054 "Produce EDM file")
0055 options.register('valEvents',
0056 False,
0057 VarParsing.VarParsing.multiplicity.singleton,
0058 VarParsing.VarParsing.varType.bool,
0059 "Filter on validation events")
0060 options.register('process',
0061 '',
0062 VarParsing.VarParsing.multiplicity.singleton,
0063 VarParsing.VarParsing.varType.string,
0064 "Rename process if used")
0065 options.register('mps',
0066 '',
0067 VarParsing.VarParsing.multiplicity.list,
0068 VarParsing.VarParsing.varType.int,
0069 "List of MPs to process")
0070 options.register('json',
0071 '',
0072 VarParsing.VarParsing.multiplicity.singleton,
0073 VarParsing.VarParsing.varType.string,
0074 "JSON file with list of good lumi sections")
0075 options.register('newXML',
0076 False,
0077 VarParsing.VarParsing.multiplicity.singleton,
0078 VarParsing.VarParsing.varType.bool,
0079 "New XML Grammar")
0080
0081 options.parseArguments()
0082
0083 pname="Raw2Digi"
0084 if (options.process!=""):
0085 pname=options.process
0086
0087 process = cms.Process(pname)
0088
0089
0090 process.load('Configuration.StandardSequences.Services_cff')
0091 process.load('FWCore.MessageService.MessageLogger_cfi')
0092 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0093 process.load('Configuration.Geometry.GeometryDB_cff')
0094 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0095 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0096 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0097 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0098
0099 process.maxEvents = cms.untracked.PSet(
0100 input = cms.untracked.int32(options.maxEvents)
0101 )
0102
0103
0104 if (options.streamer) :
0105 process.source = cms.Source(
0106 "NewEventStreamFileReader",
0107 fileNames = cms.untracked.vstring (options.inputFiles),
0108 skipEvents=cms.untracked.uint32(options.skipEvents)
0109 )
0110 else :
0111 process.source = cms.Source (
0112 "PoolSource",
0113 fileNames = cms.untracked.vstring (options.inputFiles),
0114 skipEvents=cms.untracked.uint32(options.skipEvents)
0115 )
0116
0117 if (options.json):
0118 import FWCore.PythonUtilities.LumiList as LumiList
0119 process.source.lumisToProcess = LumiList.LumiList(filename = options.json).getVLuminosityBlockRange()
0120
0121 process.options = cms.untracked.PSet(
0122 SkipEvent = cms.untracked.vstring('ProductNotFound')
0123 )
0124
0125
0126
0127
0128 process.load("CommonTools.UtilAlgos.TFileService_cfi")
0129 process.TFileService.fileName = cms.string('l1tCalo_2016_histos.root')
0130
0131
0132 process.MessageLogger.L1TCaloEvents=dict()
0133
0134 process.MessageLogger.suppressInfo = cms.untracked.vstring('Geometry', 'AfterSource')
0135
0136 if (options.dumpRaw):
0137 process.MessageLogger.files.infos = cms.untracked.PSet(
0138 INFO = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0139 L1TCaloEvents = cms.untracked.PSet(
0140 limit = cms.untracked.int32(10000)
0141 )
0142 )
0143
0144 if (options.debug):
0145
0146 process.MessageLogger.debugModules = cms.untracked.vstring('*')
0147 process.MessageLogger.cerr.threshold = cms.untracked.string('DEBUG')
0148
0149
0150
0151 from Configuration.AlCa.GlobalTag import GlobalTag
0152 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '')
0153
0154
0155 process.load('EventFilter.L1TRawToDigi.validationEventFilter_cfi')
0156
0157
0158 process.load('EventFilter.L1TRawToDigi.tmtFilter_cfi')
0159 process.tmtFilter.mpList = cms.untracked.vint32(options.mps)
0160
0161
0162 process.dumpRaw = cms.EDAnalyzer(
0163 "DumpFEDRawDataProduct",
0164 token = cms.untracked.InputTag("rawDataCollector"),
0165 feds = cms.untracked.vint32 ( 1360, 1366, 1404 ),
0166 dumpPayload = cms.untracked.bool ( options.dumpRaw )
0167 )
0168
0169
0170 process.load('EventFilter.L1TRawToDigi.caloStage2Digis_cfi')
0171 process.caloStage2Digis.InputLabel = cms.InputTag('rawDataCollector')
0172 if (options.debug):
0173 process.caloStage2Digis.debug = cms.untracked.bool(True)
0174
0175 process.load('EventFilter.L1TRawToDigi.gtStage2Digis_cfi')
0176 process.gtStage2Digis.InputLabel = cms.InputTag('rawDataCollector')
0177
0178
0179
0180 process.load('L1Trigger.L1TGlobal.StableParametersConfig_cff')
0181
0182 process.load('L1Trigger.L1TGlobal.TriggerMenuXml_cfi')
0183 process.TriggerMenuXml.TriggerMenuLuminosity = 'startup'
0184
0185
0186 process.TriggerMenuXml.DefXmlFile = 'L1Menu_Collisions2015_25nsStage1_v6_uGT_v2a.xml'
0187
0188 process.TriggerMenuXml.newGrammar = cms.bool(options.newXML)
0189 if(options.newXML):
0190 print("Using new XML Grammar ")
0191
0192
0193 process.TriggerMenuXml.DefXmlFile = 'test_ext.xml'
0194
0195
0196 process.load('L1Trigger.L1TGlobal.TriggerMenuConfig_cff')
0197 process.es_prefer_l1GtParameters = cms.ESPrefer('l1t::TriggerMenuXmlProducer','TriggerMenuXml')
0198
0199
0200 process.load('L1Trigger.L1TGlobal.simGlobalStage2Digis_cff')
0201 process.simGlobalStage2Digis.caloInputTag = cms.InputTag("gtStage2Digis","GT")
0202 process.simGlobalStage2Digis.GmtInputTag = cms.InputTag("gtStage2Digis","GT")
0203 process.simGlobalStage2Digis.extInputTag = cms.InputTag("gtStage2Digis","GT")
0204 process.simGlobalStage2Digis.PrescaleSet = cms.uint32(1)
0205 process.simGlobalStage2Digis.Verbosity = cms.untracked.int32(0)
0206
0207
0208
0209
0210 process.l1tGlobalAnalyzer = cms.EDAnalyzer('L1TGlobalAnalyzer',
0211 doText = cms.untracked.bool(False),
0212 dmxEGToken = cms.InputTag("None"),
0213 dmxTauToken = cms.InputTag("None"),
0214 dmxJetToken = cms.InputTag("None"),
0215 dmxEtSumToken = cms.InputTag("None"),
0216 muToken = cms.InputTag("gtStage2Digis","GT"),
0217 egToken = cms.InputTag("gtStage2Digis","GT"),
0218 tauToken = cms.InputTag("gtStage2Digis","GT"),
0219 jetToken = cms.InputTag("gtStage2Digis","GT"),
0220 etSumToken = cms.InputTag("gtStage2Digis","GT"),
0221 gtAlgToken = cms.InputTag("gtStage2Digis","GT"),
0222 emulDxAlgToken = cms.InputTag("None"),
0223 emulGtAlgToken = cms.InputTag("simGlobalStage2Digis")
0224 )
0225
0226
0227
0228
0229
0230
0231
0232 process.dumpGTRecord = cms.EDAnalyzer("l1t::GtRecordDump",
0233 egInputTag = cms.InputTag("gtStage2Digis","GT"),
0234 muInputTag = cms.InputTag("gtStage2Digis","GT"),
0235 tauInputTag = cms.InputTag("gtStage2Digis","GT"),
0236 jetInputTag = cms.InputTag("gtStage2Digis","GT"),
0237 etsumInputTag = cms.InputTag("gtStage2Digis","GT"),
0238 uGtAlgInputTag = cms.InputTag("simGlobalStage2Digis"),
0239 uGtExtInputTag = cms.InputTag("gtStage2Digis","GT"),
0240 bxOffset = cms.int32(0),
0241 minBx = cms.int32(-2),
0242 maxBx = cms.int32(2),
0243 minBxVec = cms.int32(0),
0244 maxBxVec = cms.int32(0),
0245 dumpGTRecord = cms.bool(False),
0246 dumpTrigResults= cms.bool(True),
0247 dumpVectors = cms.bool(False),
0248 tvFileName = cms.string( "TestVector_Data.txt" ),
0249 psFileName = cms.string( "prescale_L1TGlobal.csv" ),
0250 psColumn = cms.int32(1)
0251 )
0252
0253
0254
0255
0256 process.path = cms.Path(
0257 process.validationEventFilter
0258 +process.dumpRaw
0259 +process.caloStage2Digis
0260 +process.gtStage2Digis
0261 +process.simGlobalStage2Digis
0262 +process.l1tGlobalAnalyzer
0263 +process.dumpGTRecord
0264
0265 )
0266
0267
0268 if (not options.valEvents):
0269 process.path.remove(process.validationEventFilter)
0270
0271
0272 if (len(options.mps)==0):
0273 process.path.remove(process.tmtFilter)
0274
0275
0276 if (not options.dumpRaw):
0277 process.path.remove(process.dumpRaw)
0278
0279
0280 if (options.edm):
0281 process.output = cms.OutputModule(
0282 "PoolOutputModule",
0283 outputCommands = cms.untracked.vstring("keep *"),
0284 SelectEvents = cms.untracked.PSet(
0285 SelectEvents = cms.vstring('path')
0286 ),
0287 fileName = cms.untracked.string('l1tCalo_2016_EDM.root')
0288 )
0289
0290 process.out = cms.EndPath(
0291 process.output
0292 )
0293
0294
0295