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('fwVersion',
0019                  268501043,
0020                  VarParsing.VarParsing.multiplicity.singleton,
0021                  VarParsing.VarParsing.varType.int,
0022                  "Firmware version for unpacker configuration")
0023 options.register('demuxFWVersion',
0024                  268501079,
0025                  VarParsing.VarParsing.multiplicity.singleton,
0026                  VarParsing.VarParsing.varType.int,
0027                  "Firmware version for demux unpacker configuration")
0028 options.register('mpFramesPerEvent',
0029                  40,
0030                  VarParsing.VarParsing.multiplicity.singleton,
0031                  VarParsing.VarParsing.varType.int,
0032                  "MP frames per event")
0033 options.register('mpLatency',
0034                  0,
0035                  VarParsing.VarParsing.multiplicity.singleton,
0036                  VarParsing.VarParsing.varType.int,
0037                  "MP latency (frames)")
0038 options.register('mpOffset',
0039                  0,
0040                  VarParsing.VarParsing.multiplicity.singleton,
0041                  VarParsing.VarParsing.varType.int,
0042                  "MP offset (frames)")
0043 options.register('mpHeaderFrames',
0044                  0,
0045                  VarParsing.VarParsing.multiplicity.singleton,
0046                  VarParsing.VarParsing.varType.int,
0047                  "MP header frames in tx")
0048 options.register('mpKeyLinkRx',
0049                  0,
0050                  VarParsing.VarParsing.multiplicity.singleton,
0051                  VarParsing.VarParsing.varType.int,
0052                  "MP packet key link (Rx)")
0053 options.register('mpKeyLinkTx',
0054                  0,
0055                  VarParsing.VarParsing.multiplicity.singleton,
0056                  VarParsing.VarParsing.varType.int,
0057                  "MP packet key link (Tx)")
0058 options.register('dmFramesPerEvent',
0059                  6,
0060                  VarParsing.VarParsing.multiplicity.singleton,
0061                  VarParsing.VarParsing.varType.int,
0062                  "Demux frames per event")
0063 options.register('dmLatency',
0064                  0,
0065                  VarParsing.VarParsing.multiplicity.singleton,
0066                  VarParsing.VarParsing.varType.int,
0067                  "Demux latency (frames)")
0068 options.register('dmOffset',
0069                  29,
0070                  VarParsing.VarParsing.multiplicity.singleton,
0071                  VarParsing.VarParsing.varType.int,
0072                  "Demux offset (frames)")
0073 options.register('gtFramesPerEvent',
0074                  6,
0075                  VarParsing.VarParsing.multiplicity.singleton,
0076                  VarParsing.VarParsing.varType.int,
0077                  "GT frames per event")
0078 options.register('gtLatency',
0079                  47,
0080                  VarParsing.VarParsing.multiplicity.singleton,
0081                  VarParsing.VarParsing.varType.int,
0082                  "GT latency (frames)")
0083 options.register('gtOffset',
0084                  15,
0085                  VarParsing.VarParsing.multiplicity.singleton,
0086                  VarParsing.VarParsing.varType.int,
0087                  "GT offset (frames)")
0088 options.register('dump',
0089                  False,
0090                  VarParsing.VarParsing.multiplicity.singleton,
0091                  VarParsing.VarParsing.varType.bool,
0092                  "Print RAW data")
0093 options.register('debug',
0094                  True,
0095                  VarParsing.VarParsing.multiplicity.singleton,
0096                  VarParsing.VarParsing.varType.bool,
0097                  "Enable debug data")
0098 options.register('doMP',
0099                  True,
0100                  VarParsing.VarParsing.multiplicity.singleton,
0101                  VarParsing.VarParsing.varType.bool,
0102                  "Read MP data")
0103 options.register('doDemux',
0104                  True,
0105                  VarParsing.VarParsing.multiplicity.singleton,
0106                  VarParsing.VarParsing.varType.bool,
0107                  "Read demux data")
0108 options.register('doGT',
0109                  False,
0110                  VarParsing.VarParsing.multiplicity.singleton,
0111                  VarParsing.VarParsing.varType.bool,
0112                  "Read GT data")
0113 options.register('nMP',
0114                  9,#11,
0115                  VarParsing.VarParsing.multiplicity.singleton,
0116                  VarParsing.VarParsing.varType.int,
0117                  "Number of MPs")
0118                  
0119 options.parseArguments()
0120 
0121 if (options.maxEvents == -1):
0122     options.maxEvents = 1
0123 
0124 
0125 process = cms.Process('Raw2Digi')
0126 
0127 # import of standard configurations
0128 process.load('Configuration.StandardSequences.Services_cff')
0129 process.load('FWCore.MessageService.MessageLogger_cfi')
0130 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0131 process.load('Configuration.Geometry.GeometryDB_cff')
0132 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0133 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0134 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0135 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0136 
0137 process.maxEvents = cms.untracked.PSet(
0138     input = cms.untracked.int32(options.maxEvents)
0139 )
0140 
0141 # Input source
0142 process.source = cms.Source("EmptySource")
0143 
0144 process.options = cms.untracked.PSet(
0145     SkipEvent = cms.untracked.vstring('ProductNotFound')
0146 )
0147 
0148 
0149 # Output definition
0150 process.output = cms.OutputModule(
0151     "PoolOutputModule",
0152     outputCommands = cms.untracked.vstring("keep *"),
0153     fileName = cms.untracked.string('l1tCalo_2016_EDM.root')
0154 )
0155 
0156 # Additional output definition
0157 # TTree output file
0158 process.load("CommonTools.UtilAlgos.TFileService_cfi")
0159 process.TFileService.fileName = cms.string('l1tCalo_2016_histos.root')
0160 
0161 
0162 # enable debug message logging for our modules
0163 process.MessageLogger.L1TCaloEvents=dict()
0164 
0165 process.MessageLogger.suppressInfo = cms.untracked.vstring('Geometry', 'AfterSource')
0166 
0167 if (options.dump):
0168     process.MessageLogger.files.infos = cms.untracked.PSet(
0169                                                      INFO = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0170                                                      L1TCaloEvents = cms.untracked.PSet(
0171                                                          limit = cms.untracked.int32(10000)
0172                                                      )
0173     )
0174 
0175 if (options.debug):
0176 #    process.MessageLogger.debugModules = cms.untracked.vstring('L1TRawToDigi:caloStage2Digis', 'MP7BufferDumpToRaw:stage2MPRaw', 'MP7BufferDumpToRaw:stage2DemuxRaw')
0177     process.MessageLogger.debugModules = cms.untracked.vstring('*')
0178     process.MessageLogger.cerr.threshold = cms.untracked.string('DEBUG')
0179 
0180 
0181 
0182 # Other statements
0183 from Configuration.AlCa.GlobalTag import GlobalTag
0184 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '')
0185 
0186 
0187 # buffer dump to RAW
0188 process.load('EventFilter.L1TRawToDigi.stage2MP7BufferRaw_cff')
0189 
0190 # skip events
0191 dmOffset = options.dmOffset + (options.skipEvents * options.dmFramesPerEvent)
0192 
0193 mpOffsets = cms.untracked.vint32()
0194 for i in range (0,options.nMP):
0195     offset = options.mpOffset + (options.skipEvents / options.nMP)
0196     if (i < options.skipEvents % options.nMP):
0197         offset = offset + 1    
0198     mpOffsets.append(offset)
0199 
0200 mpLatencies = cms.untracked.vint32()
0201 for i in range (0,options.nMP):
0202     mpLatencies.append(0)
0203 
0204 boardIds = cms.untracked.vint32(range(0,options.nMP))
0205 
0206 boardOffset = options.skipEvents % options.nMP
0207 
0208 gtOffset = options.gtOffset + (options.skipEvents * options.gtFramesPerEvent)
0209 
0210 # print some debug info
0211 print("Job config :")
0212 print("maxEvents     = ", options.maxEvents)
0213 print("skipEvents    = ", options.skipEvents)
0214 print(" ")
0215 
0216 # MP config
0217 if (options.doMP):
0218     print("MP config :")
0219     print("nBoards       = ", options.nMP)
0220     print("mpBoardOffset = ", boardOffset)
0221     print("mpOffset      = ", mpOffsets)
0222     print(" ")
0223 
0224 mpBlock = cms.untracked.PSet(
0225     rxBlockLength    = cms.untracked.vint32(40,40,40,40, # q0 0-3
0226                                             40,40,40,40, # q1 4-7
0227                                             40,40,40,40, # q2 8-11
0228                                             40,40,40,40, # q3 12-15
0229                                             40,40,40,40, # q4 16-19
0230                                             40,40,40,40, # q5 20-23
0231                                             40,40,40,40, # q6 24-27
0232                                             40,40,40,40, # q7 28-31
0233                                             40,40,40,40, # q8 32-35
0234                                             40,40,40,40, # q9 36-39
0235                                             40,40,40,40, # q10 40-43
0236                                             40,40,40,40, # q11 44-47
0237                                             40,40,40,40, # q12 48-51
0238                                             40,40,40,40, # q13 52-55
0239                                             40,40,40,40, # q14 56-59
0240                                             40,40,40,40, # q15 60-63
0241                                             40,40,40,40, # q16 64-67
0242                                             40,40,40,40), # q17 68-71
0243 
0244     txBlockLength    = cms.untracked.vint32(0,0,0,0, # q0 0-3
0245                                             0,0,0,0, # q1 4-7
0246                                             0,0,0,0, # q2 8-11
0247                                             0,0,0,0, # q3 12-15
0248                                             0,0,0,0, # q4 16-19
0249                                             0,0,0,0, # q5 20-23
0250                                             0,0,0,0, # q6 24-27
0251                                             0,0,0,0, # q7 28-31
0252                                             0,0,0,0, # q8 32-35
0253                                             0,0,0,0, # q9 36-39
0254                                             0,0,0,0, # q10 40-43
0255                                             0,0,0,0, # q11 44-47
0256                                             0,0,0,0, # q12 48-51
0257                                             0,0,0,0, # q13 52-55
0258                                             0,0,0,0, # q14 56-59
0259                                             11,11,11,11, # q15 60-63
0260                                             11,11,0,0, # q16 64-67
0261                                             0,0,0,0) # q17 68-71
0262 )
0263 
0264 mpBlocks = cms.untracked.VPSet()
0265 
0266 for block in range(0,options.nMP):
0267         mpBlocks.append(mpBlock)
0268 
0269 process.stage2MPRaw.nFramesPerEvent    = cms.untracked.int32(options.mpFramesPerEvent)
0270 process.stage2MPRaw.nFramesOffset    = cms.untracked.vuint32(mpOffsets)
0271 process.stage2MPRaw.nFramesLatency   = cms.untracked.vuint32(mpLatencies)
0272 process.stage2MPRaw.boardOffset    = cms.untracked.int32(boardOffset)
0273 process.stage2MPRaw.rxKeyLink    = cms.untracked.int32(options.mpKeyLinkRx)
0274 process.stage2MPRaw.txKeyLink    = cms.untracked.int32(options.mpKeyLinkTx)
0275 process.stage2MPRaw.boardId = cms.untracked.vint32(boardIds)
0276 process.stage2MPRaw.nHeaderFrames = cms.untracked.int32(options.mpHeaderFrames)
0277 process.stage2MPRaw.rxFile = cms.untracked.string("mp_rx_summary.txt")
0278 process.stage2MPRaw.txFile = cms.untracked.string("mp_tx_summary.txt")
0279 process.stage2MPRaw.blocks = cms.untracked.VPSet(mpBlocks)
0280 process.stage2MPRaw.fwVersion = cms.untracked.int32(options.fwVersion)
0281 
0282 # Demux config
0283 if (options.doDemux):
0284     print("Demux config :")
0285     print("dmOffset      = ", dmOffset)
0286     print("dmLatency     = ", options.dmLatency)
0287     print(" ")
0288 
0289 process.stage2DemuxRaw.nFramesPerEvent    = cms.untracked.int32(options.dmFramesPerEvent)
0290 process.stage2DemuxRaw.nFramesOffset    = cms.untracked.vuint32(dmOffset)
0291 # add 1 to demux latency to take account of header, match online definition of latency
0292 process.stage2DemuxRaw.nFramesLatency   = cms.untracked.vuint32(options.dmLatency+1)
0293 process.stage2DemuxRaw.rxFile = cms.untracked.string("demux_rx_summary.txt")
0294 process.stage2DemuxRaw.txFile = cms.untracked.string("demux_tx_summary.txt")
0295 process.stage2DemuxRaw.fwVersion = cms.untracked.int32(options.demuxFWVersion)
0296 
0297 # GT config
0298 if (options.doGT):
0299     print("GT config :")
0300     print("gtOffset      = ", gtOffset)
0301     print("gtLatency     = ", options.gtLatency)
0302 
0303 process.stage2GTRaw.nFramesPerEvent    = cms.untracked.int32(options.gtFramesPerEvent)
0304 process.stage2GTRaw.nFramesOffset    = cms.untracked.vuint32(gtOffset)
0305 process.stage2GTRaw.nFramesLatency   = cms.untracked.vuint32(options.gtLatency)
0306 process.stage2GTRaw.rxFile = cms.untracked.string("uGT/rx_summary.txt")
0307 process.stage2GTRaw.txFile = cms.untracked.string("uGT/tx_summary.txt")
0308 
0309 
0310 process.rawDataCollector.verbose = cms.untracked.int32(2)
0311 
0312 
0313 # dump raw data
0314 process.dumpRaw = cms.EDAnalyzer( 
0315     "DumpFEDRawDataProduct",
0316     token = cms.untracked.InputTag("rawDataCollector"),
0317     feds = cms.untracked.vint32 ( 1360, 1366, 1404 ),
0318     dumpPayload = cms.untracked.bool ( options.dump )
0319 )
0320 
0321 # raw to digi
0322 process.load('EventFilter.L1TRawToDigi.caloStage2Digis_cfi')
0323 process.caloStage2Digis.InputLabel = cms.InputTag('rawDataCollector')
0324 process.caloStage2Digis.debug      = cms.untracked.bool(options.debug)
0325 process.caloStage2Digis.FWId  = cms.uint32(options.fwVersion)
0326 process.caloStage2Digis.DmxFWId = cms.uint32(options.demuxFWVersion)
0327 process.caloStage2Digis.FWOverride = cms.bool(True)
0328 process.caloStage2Digis.TMTCheck   = cms.bool(False)
0329 
0330 process.load('EventFilter.L1TRawToDigi.gtStage2Digis_cfi')
0331 process.gtStage2Digis.InputLabel = cms.InputTag('rawDataCollector')
0332 
0333 # object analyser
0334 process.load('L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi')
0335 process.l1tStage2CaloAnalyzer.clusterToken = cms.InputTag("None")
0336 
0337 
0338 # Path and EndPath definitions
0339 process.path = cms.Path(
0340     process.stage2MPRaw
0341     +process.stage2DemuxRaw
0342     +process.stage2GTRaw
0343     +process.rawDataCollector
0344     #+process.dumpRaw
0345     +process.caloStage2Digis
0346     +process.gtStage2Digis
0347     +process.l1tStage2CaloAnalyzer
0348 )
0349 
0350 if (not options.doMP):
0351     process.path.remove(process.stage2MPRaw)
0352 
0353 if (not options.doDemux):
0354     process.path.remove(process.stage2DemuxRaw)
0355 
0356 if (not options.doGT):
0357     process.path.remove(process.stage2GTRaw)
0358 
0359 process.out = cms.EndPath(
0360     process.output
0361 )
0362 
0363