Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:10

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 
0009 
0010 # options
0011 import FWCore.ParameterSet.VarParsing as VarParsing
0012 options = VarParsing.VarParsing('analysis')
0013 options.register('skipEvents',
0014                  0,
0015                  VarParsing.VarParsing.multiplicity.singleton,
0016                  VarParsing.VarParsing.varType.int,
0017                  "Number of events to skip")
0018 options.register('framesPerEvent',
0019                  6,
0020                  VarParsing.VarParsing.multiplicity.singleton,
0021                  VarParsing.VarParsing.varType.int,
0022                  "N frames per event")
0023 options.register('offset',
0024                  0,
0025                  VarParsing.VarParsing.multiplicity.singleton,
0026                  VarParsing.VarParsing.varType.int,
0027                  "Jet board offset (frames)")
0028 options.register('egLatency',
0029                  0,
0030                  VarParsing.VarParsing.multiplicity.singleton,
0031                  VarParsing.VarParsing.varType.int,
0032                  "EG board latency (frames)")
0033 options.register('jetLatency',
0034                  40,
0035                  VarParsing.VarParsing.multiplicity.singleton,
0036                  VarParsing.VarParsing.varType.int,
0037                  "Jet board latency (frames)")
0038 options.register('egDelay',
0039                  54,
0040                  VarParsing.VarParsing.multiplicity.singleton,
0041                  VarParsing.VarParsing.varType.int,
0042                  "EG input delay wrt regions (frames)")
0043 options.register('dump',
0044                  False,
0045                  VarParsing.VarParsing.multiplicity.singleton,
0046                  VarParsing.VarParsing.varType.bool,
0047                  "Print RAW data")
0048 
0049                  
0050 options.parseArguments()
0051 
0052 if (options.maxEvents == -1):
0053     options.maxEvents = 1
0054 
0055 
0056 process = cms.Process('Raw2Digi')
0057 
0058 # import of standard configurations
0059 process.load('Configuration.StandardSequences.Services_cff')
0060 process.load('FWCore.MessageService.MessageLogger_cfi')
0061 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0062 process.load('Configuration.Geometry.GeometryDB_cff')
0063 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0064 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0065 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0066 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0067 
0068 process.maxEvents = cms.untracked.PSet(
0069     input = cms.untracked.int32(options.maxEvents)
0070 )
0071 
0072 # Input source
0073 process.source = cms.Source("EmptySource")
0074 
0075 process.options = cms.untracked.PSet(
0076     SkipEvent = cms.untracked.vstring('ProductNotFound')
0077 )
0078 
0079 
0080 # Output definition
0081 process.output = cms.OutputModule(
0082     "PoolOutputModule",
0083     outputCommands = cms.untracked.vstring("keep *"),
0084     fileName = cms.untracked.string('l1tCalo_2015_EDM.root')
0085 )
0086 
0087 # Additional output definition
0088 # TTree output file
0089 process.load("CommonTools.UtilAlgos.TFileService_cfi")
0090 process.TFileService.fileName = cms.string('l1tCalo_2015_histos.root')
0091 
0092 
0093 # enable debug message logging for our modules
0094 process.MessageLogger = cms.Service(
0095     "MessageLogger",
0096     threshold  = cms.untracked.string('DEBUG'),
0097     categories = cms.untracked.vstring('L1T'),
0098     debugModules = cms.untracked.vstring('*')
0099 #        'mp7BufferDumpToRaw',
0100 #        'l1tDigis',
0101 #        'caloStage1Digis'
0102 #    )
0103 )
0104 
0105 
0106 # Other statements
0107 from Configuration.AlCa.GlobalTag import GlobalTag
0108 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '')
0109 
0110 
0111 # buffer dump to RAW
0112 process.load('EventFilter.L1TRawToDigi.stage1MP7BufferRaw_cfi')
0113 
0114 # skip events
0115 jetOffset = options.offset + (options.skipEvents * options.framesPerEvent)
0116 egOffset  = jetOffset + options.egDelay
0117 
0118 
0119 # print some debug info
0120 print("egOffset      = ", egOffset)
0121 print("jetOffset     = ", jetOffset)
0122 print(" ")
0123 
0124 
0125 # pack into arrays
0126 latencies = [ options.jetLatency, options.egLatency ]
0127 offsets   = [ jetOffset,  egOffset ]
0128 
0129 process.stage1Raw.nFramesPerEvent    = cms.untracked.int32(options.framesPerEvent)
0130 process.stage1Raw.nFramesOffset    = cms.untracked.vuint32(offsets)
0131 process.stage1Raw.nFramesLatency   = cms.untracked.vuint32(latencies)
0132 process.stage1Raw.rxFile = cms.untracked.string("rx_summary.txt")
0133 process.stage1Raw.txFile = cms.untracked.string("tx_summary.txt")
0134 
0135 # dump raw data
0136 process.dumpRaw = cms.EDAnalyzer( 
0137     "DumpFEDRawDataProduct",
0138     label = cms.untracked.string("stage1Raw"),
0139     feds = cms.untracked.vint32 ( 1352 ),
0140     dumpPayload = cms.untracked.bool ( options.dump )
0141 )
0142 
0143 # raw to digi
0144 process.load('EventFilter.L1TRawToDigi.caloStage1Digis_cfi')
0145 process.caloStage1Digis.InputLabel = cms.InputTag('stage1Raw')
0146 
0147 # Path and EndPath definitions
0148 process.path = cms.Path(
0149     process.stage1Raw
0150     +process.dumpRaw
0151     +process.caloStage1Digis
0152 
0153 )
0154 
0155 process.out = cms.EndPath(
0156     process.output
0157 )
0158