Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:08

0001 # The following comments couldn't be translated into the new config version:
0002 
0003 # Configuration file for PoolInputTest
0004 
0005 import FWCore.ParameterSet.Config as cms
0006 import sys
0007 
0008 process = cms.Process("TESTRECO")
0009 process.load("FWCore.Framework.test.cmsExceptionsFatal_cff")
0010 
0011 process.maxEvents = cms.untracked.PSet(
0012     input = cms.untracked.int32(int(sys.argv[2]))
0013 )
0014 
0015 firstRun = int(sys.argv[3])
0016 numberEventsInRun = int(sys.argv[4])
0017 firstLuminosityBlock = int(sys.argv[5])
0018 numberEventsInLuminosityBlock = int(sys.argv[6])
0019 
0020 if len(sys.argv) > 7:
0021   #have first run of second file continue the run
0022   runToLumi = ((2,1),(10,3),(20,5), (30, 7), (40, 9) )
0023 else:
0024   #have first run of second file be a new run
0025   runToLumi = ((2,1),(10,3),(20,5), (30, 6), (40, 9) )
0026 
0027 def findRunForLumi( lumi) :
0028   lastRun = runToLumi[0][0]
0029   for r,l in runToLumi:
0030     if l > lumi:
0031       break
0032     lastRun = r
0033   return lastRun
0034 
0035 ids = cms.VEventID()
0036 numberOfEventsInLumi = 0
0037 numberOfEventsPerLumi = numberEventsInLuminosityBlock
0038 lumi = 1
0039 event=0
0040 oldRun = 2
0041 numberOfFiles = len(sys.argv[1].split(","))
0042 numberOfEventsInFile = int(sys.argv[2])/numberOfFiles
0043 for i in range(process.maxEvents.input.value()):
0044    numberOfEventsInLumi +=1
0045    event += 1
0046    run = findRunForLumi(lumi)
0047    if event > numberOfEventsInFile:
0048     event = 1
0049    if numberOfEventsInLumi > numberOfEventsPerLumi:
0050       numberOfEventsInLumi=1
0051       lumi += 1
0052       run = findRunForLumi(lumi)
0053       if run != oldRun:
0054         oldRun = run
0055    ids.append(cms.EventID(run,lumi,event))
0056 process.check = cms.EDAnalyzer("EventIDChecker", eventSequence = cms.untracked(ids))
0057 
0058 
0059 process.source = cms.Source("PoolSource",
0060     firstLuminosityBlockForEachRun = cms.untracked.VLuminosityBlockID(*[cms.LuminosityBlockID(x,y) for x,y in runToLumi]),
0061     fileNames = cms.untracked.vstring(sys.argv[1].split(","))
0062 )
0063 
0064 process.e = cms.EndPath(process.check)
0065