Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-31 04:19:32

0001 #from __future__ import print_function
0002 #from __future__ import absolute_import
0003 import FWCore.ParameterSet.Config as cms
0004 import FWCore.ParameterSet.VarParsing as VarParsing
0005 from FWCore.ParameterSet.Types import PSet
0006 
0007 process = cms.Process("DQMTEST")
0008 
0009 options = VarParsing.VarParsing('analysis')
0010 
0011 options.register('runNumber',
0012                  100101,
0013                  VarParsing.VarParsing.multiplicity.singleton,
0014                  VarParsing.VarParsing.varType.int,
0015                  "Run number.")
0016 
0017 options.register('runInputDir',
0018                  '/tmp',
0019                  VarParsing.VarParsing.multiplicity.singleton,
0020                  VarParsing.VarParsing.varType.string,
0021                  "Directory where the DQM files will appear.")
0022 options.register('eventsPerLS',
0023                  35,
0024                   VarParsing.VarParsing.multiplicity.singleton,
0025                   VarParsing.VarParsing.varType.int,          # string, int, or float
0026                   "Max LS to generate (0 to disable limit)")                 
0027 options.register ('maxLS',
0028                   2,
0029                   VarParsing.VarParsing.multiplicity.singleton,
0030                   VarParsing.VarParsing.varType.int,          # string, int, or float
0031                   "Max LS to generate (0 to disable limit)")
0032 
0033 options.parseArguments()
0034 
0035 
0036 process.MessageLogger = cms.Service("MessageLogger",
0037                                     destinations = cms.untracked.vstring('cout'),
0038                                     cout = cms.untracked.PSet(threshold = cms.untracked.string('WARNING'))
0039                                     )
0040 process.source = cms.Source("DQMStreamerReader",
0041         runNumber = cms.untracked.uint32(options.runNumber),
0042         runInputDir = cms.untracked.string(options.runInputDir),
0043         streamLabel = cms.untracked.string('streamDQM'),
0044         scanOnce = cms.untracked.bool(True),
0045         minEventsPerLumi = cms.untracked.int32(1),
0046         delayMillis = cms.untracked.uint32(500),
0047         nextLumiTimeoutMillis = cms.untracked.int32(0),
0048         skipFirstLumis = cms.untracked.bool(False),
0049         deleteDatFiles = cms.untracked.bool(False),
0050         endOfRunKills  = cms.untracked.bool(False),
0051         inputFileTransitionsEachEvent = cms.untracked.bool(False),
0052         SelectEvents = cms.untracked.vstring("HLT*Mu*","HLT_*Physics*")
0053 )
0054 
0055 #make a list of all the EventIDs that were seen by the previous job,
0056 # given the filter is semi-random we do not know which of these will
0057 # be the actual first event written
0058 rn = options.runNumber
0059 transitions = [cms.EventID(rn,0,0)]
0060 evid = 1
0061 for lumi in range(1, options.maxLS+1):
0062     transitions.append(cms.EventID(rn,lumi,0))
0063     for ev in range(0, options.eventsPerLS):
0064         transitions.append(cms.EventID(rn,lumi,evid))
0065         evid += 1
0066     transitions.append(cms.EventID(rn,lumi,0)) #end lumi
0067 transitions.append(cms.EventID(rn,0,0)) #end run
0068 
0069 
0070 #only see 1 event as process.source.minEventsPerLumi == 1
0071 process.test = cms.EDAnalyzer("RunLumiEventChecker",
0072                               eventSequence = cms.untracked.VEventID(*transitions),
0073                               unorderedEvents = cms.untracked.bool(True),
0074                               minNumberOfEvents = cms.untracked.uint32(1+2+2),
0075                               maxNumberOfEvents = cms.untracked.uint32(1+2+2)
0076 )
0077 if options.eventsPerLS == 0:
0078     process.test.eventSequence = []
0079     process.test.minNumberOfEvents = 0
0080     process.test.maxNumberOfEvents = 0
0081     
0082 process.p = cms.Path(process.test)
0083