Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 23:30:20

0001 from __future__ import print_function
0002 # Auto generated configuration file
0003 # using: 
0004 # Revision: 1.19 
0005 # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v 
0006 # with command line options: SingleElectronPt10_cfi.py -s GEN,SIM,DIGI,L1 --pileup=NoPileUp --geometry DB --conditions=auto:startup -n 1 --no_exec
0007 import FWCore.ParameterSet.Config as cms
0008 import os
0009 
0010 # options
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012 options = VarParsing.VarParsing('analysis')
0013 options.register('filename',
0014                  "rx_summary",
0015                  VarParsing.VarParsing.multiplicity.singleton,
0016                  VarParsing.VarParsing.varType.string,
0017                  "Filename string")
0018 options.register('outDir',
0019                  "mpRxFiles",
0020                  VarParsing.VarParsing.multiplicity.singleton,
0021                  VarParsing.VarParsing.varType.string,
0022                  "Output directory for buffer files")
0023 options.register('mpPayloadFrames',
0024                  40,
0025                  VarParsing.VarParsing.multiplicity.singleton,
0026                  VarParsing.VarParsing.varType.int,
0027                  "N payload frames per event")
0028 options.register('mpHeaderFrames',
0029                  1,
0030                  VarParsing.VarParsing.multiplicity.singleton,
0031                  VarParsing.VarParsing.varType.int,
0032                  "N header frames per event")
0033 options.register('mpClearFrames',
0034                  13,
0035                  VarParsing.VarParsing.multiplicity.singleton,
0036                  VarParsing.VarParsing.varType.int,
0037                  "N clear frames between events")
0038 options.register('dump',
0039                  True,
0040                  VarParsing.VarParsing.multiplicity.singleton,
0041                  VarParsing.VarParsing.varType.bool,
0042                  "Dump messages")
0043 options.register('pattern',
0044                  True,
0045                  VarParsing.VarParsing.multiplicity.singleton,
0046                  VarParsing.VarParsing.varType.bool,
0047                  "Save pattern file")
0048 options.register('edm',
0049                  False,
0050                  VarParsing.VarParsing.multiplicity.singleton,
0051                  VarParsing.VarParsing.varType.bool,
0052                  "Save EDM file")
0053 options.register('debug',
0054                  False,
0055                  VarParsing.VarParsing.multiplicity.singleton,
0056                  VarParsing.VarParsing.varType.bool,
0057                  "Enable debug data")
0058 #options.register('doMP',
0059 #                 True,
0060 #                 VarParsing.VarParsing.multiplicity.singleton,
0061 #                 VarParsing.VarParsing.varType.bool,
0062 #                 "Generate MP pattern")
0063 #options.register('doDemux',
0064 #                 True,
0065 #                 VarParsing.VarParsing.multiplicity.singleton,
0066 #                 VarParsing.VarParsing.varType.bool,
0067 #                 "Read demux data")
0068 #options.register('nMP',
0069 #                 1,
0070 #                 VarParsing.VarParsing.multiplicity.singleton,
0071 #                 VarParsing.VarParsing.varType.int,
0072 #                 "Number of MPs")
0073 
0074 options.parseArguments()
0075 
0076 if (options.maxEvents == -1):
0077     options.maxEvents = 1
0078 
0079 # make output directory if it doesn't already exist
0080 try:
0081     os.stat(options.outDir)
0082 except:
0083     print('Output directory does not exist. Creating directory: ' + options.outDir)
0084     os.mkdir(options.outDir)
0085 
0086 process = cms.Process('L1Emulator')
0087 
0088 # import of standard configurations
0089 process.load('Configuration.StandardSequences.Services_cff')
0090 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0091 process.load('FWCore.MessageService.MessageLogger_cfi')
0092 process.load('Configuration.EventContent.EventContent_cff')
0093 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0094 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0095 process.load('Configuration.Geometry.GeometryDB_cff')
0096 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0097 process.load('Configuration.StandardSequences.Generator_cff')
0098 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic8TeVCollision_cfi')
0099 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0100 process.load('Configuration.StandardSequences.SimIdeal_cff')
0101 process.load('Configuration.StandardSequences.Digi_cff')
0102 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0103 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0104 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0105 
0106 # import of standard configurations
0107 process.load('Configuration.StandardSequences.RawToDigi_cff')
0108 
0109 process.maxEvents = cms.untracked.PSet(
0110     input = cms.untracked.int32(options.maxEvents)
0111 )
0112 
0113 # Input source
0114 process.source = cms.Source("PoolSource",
0115                             fileNames = cms.untracked.vstring(options.inputFiles)
0116 #        '/store/relval/CMSSW_7_4_0/RelValSingleElectronPt35_UP15/GEN-SIM-DIGI-RAW-HLTDEBUG/MCRUN2_74_V7_GENSIM_7_1_15-v1/00000/1E628CEB-7ADD-E411-ACF3-0025905A609E.root'
0117 #        )
0118 )
0119 
0120 process.options = cms.untracked.PSet(
0121 
0122 )
0123 
0124 from Configuration.AlCa.GlobalTag import GlobalTag
0125 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '')
0126 
0127 
0128 # Output definition
0129 process.output = cms.OutputModule("PoolOutputModule",
0130     splitLevel = cms.untracked.int32(0),
0131     eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0132     outputCommands = cms.untracked.vstring("keep *",
0133                        "drop *_mix_*_*"),
0134     fileName = cms.untracked.string('SingleElectronPt10_cfi_py_GEN_SIM_DIGI_L1.root'),
0135     dataset = cms.untracked.PSet(
0136         filterName = cms.untracked.string(''),
0137         dataTier = cms.untracked.string('')
0138     ),
0139     SelectEvents = cms.untracked.PSet(
0140         SelectEvents = cms.vstring('generation_step')
0141     )
0142 )
0143 
0144 
0145 # enable debug message logging for our modules
0146 process.MessageLogger.L1TCaloEvents=dict()
0147 
0148 process.MessageLogger.suppressInfo = cms.untracked.vstring('Geometry', 'AfterSource')
0149 
0150 if (options.dump):
0151     process.MessageLogger.files.infos = cms.untracked.PSet(
0152         INFO = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0153         L1TCaloEvents = cms.untracked.PSet(
0154             limit = cms.untracked.int32(10000)
0155         )
0156     )
0157 
0158 if (options.debug):
0159 #    process.MessageLogger.debugModules = cms.untracked.vstring('L1TRawToDigi:caloStage2Digis', 'MP7BufferDumpToRaw:stage2MPRaw', 'MP7BufferDumpToRaw:stage2DemuxRaw')
0160     process.MessageLogger.debugModules = cms.untracked.vstring('*')
0161     process.MessageLogger.cerr.threshold = cms.untracked.string('DEBUG')
0162 
0163 
0164 # TTree output file
0165 process.load("CommonTools.UtilAlgos.TFileService_cfi")
0166 process.TFileService.fileName = cms.string('l1tCalo_2016_histos.root')
0167 
0168 # upgrade calo stage 2
0169 process.load('L1Trigger.L1TCalorimeter.caloStage2Params_2017_v1_4_cfi')
0170 process.caloStage2Params.towerEncoding    = cms.bool(True)
0171 process.load('L1Trigger.L1TCalorimeter.simCaloStage2Layer1Digis_cfi')
0172 process.load('L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi')
0173 process.simCaloStage2Digis.useStaticConfig = True
0174 process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("ecalDigis:EcalTriggerPrimitives")
0175 process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag("hcalDigis")
0176 
0177 process.load('L1Trigger.L1TCalorimeter.l1tStage2InputPatternWriter_cfi')
0178 process.l1tStage2InputPatternWriter.filename = cms.untracked.string(options.filename)
0179 process.l1tStage2InputPatternWriter.outDir = cms.untracked.string(options.outDir)
0180 process.l1tStage2InputPatternWriter.mpPayloadFrames = cms.untracked.uint32(options.mpPayloadFrames)
0181 process.l1tStage2InputPatternWriter.mpHeaderFrames = cms.untracked.uint32(options.mpHeaderFrames)
0182 process.l1tStage2InputPatternWriter.mpClearFrames = cms.untracked.uint32(options.mpClearFrames)
0183 
0184 # Path and EndPath definitions
0185 process.path = cms.Path(
0186     process.ecalDigis
0187     +process.hcalDigis
0188     +process.simCaloStage2Layer1Digis
0189     +process.simCaloStage2Digis
0190     +process.l1tStage2InputPatternWriter)
0191 
0192 if (options.edm):
0193     process.output_step = cms.EndPath(process.output)
0194