Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:53:44

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.input = -1
0012 
0013 #have first run of second file be a new run
0014 runToLumi = ((2,1),(10,3),(20,5))
0015 
0016 def findRunForLumi( lumi) :
0017   lastRun = runToLumi[0][0]
0018   for r,l in runToLumi:
0019     if l > lumi:
0020       break
0021     lastRun = r
0022   return lastRun
0023 
0024 ids = cms.VEventID()
0025 numberOfEventsInLumi = 0
0026 numberOfEventsPerLumi = 5
0027 lumi = int(sys.argv[2])
0028 event= numberOfEventsPerLumi*(lumi-1)
0029 oldRun = 2
0030 numberOfFiles = 1
0031 numberOfEventsInFile = 15
0032 for i in range(numberOfEventsPerLumi*(6-lumi)):
0033    numberOfEventsInLumi +=1
0034    event += 1
0035    run = findRunForLumi(lumi)
0036 #   if event > numberOfEventsInFile:
0037 #    event = 1
0038    if numberOfEventsInLumi > numberOfEventsPerLumi:
0039       numberOfEventsInLumi=1
0040       lumi += 1
0041       run = findRunForLumi(lumi)
0042       if run != oldRun:
0043         oldRun = run
0044    ids.append(cms.EventID(run,lumi,event))
0045 process.check = cms.EDAnalyzer("EventIDChecker", eventSequence = cms.untracked(ids))
0046 
0047 
0048 process.source = cms.Source("PoolSource",
0049                             firstLuminosityBlock = cms.untracked.uint32(int(sys.argv[2])),
0050     firstLuminosityBlockForEachRun = cms.untracked.VLuminosityBlockID(*[cms.LuminosityBlockID(x,y) for x,y in runToLumi]),
0051     fileNames = cms.untracked.vstring(sys.argv[1].split(","))
0052 )
0053 
0054 process.e = cms.EndPath(process.check)
0055