Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:16

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 import sys
0009 
0010 #ignore script name and anything before it
0011 argv = []
0012 foundpy = False
0013 for a in sys.argv:
0014     if foundpy:
0015         argv.append(a)
0016     if ".py" in a:
0017         foundpy = True
0018 
0019 
0020 process = cms.Process("TESTRECO")
0021 process.load("FWCore.Framework.test.cmsExceptionsFatal_cff")
0022 
0023 process.maxEvents.input = -1
0024 
0025 #have first run of second file be a new run
0026 runToLumi = ((2,1),(10,3),(20,5))
0027 
0028 def findRunForLumi( lumi) :
0029   lastRun = runToLumi[0][0]
0030   for r,l in runToLumi:
0031     if l > lumi:
0032       break
0033     lastRun = r
0034   return lastRun
0035 
0036 ids = cms.VEventID()
0037 numberOfEventsInLumi = 0
0038 numberOfEventsPerLumi = 5
0039 lumi = int(argv[1])
0040 event= numberOfEventsPerLumi*(lumi-1)
0041 oldRun = 2
0042 numberOfFiles = 1
0043 numberOfEventsInFile = 15
0044 for i in range(numberOfEventsPerLumi*(6-lumi)):
0045    numberOfEventsInLumi +=1
0046    event += 1
0047    run = findRunForLumi(lumi)
0048 #   if event > numberOfEventsInFile:
0049 #    event = 1
0050    if numberOfEventsInLumi > numberOfEventsPerLumi:
0051       numberOfEventsInLumi=1
0052       lumi += 1
0053       run = findRunForLumi(lumi)
0054       if run != oldRun:
0055         oldRun = run
0056    ids.append(cms.EventID(run,lumi,event))
0057 process.check = cms.EDAnalyzer("EventIDChecker", eventSequence = cms.untracked(ids))
0058 
0059 
0060 process.source = cms.Source("PoolSource",
0061                             firstLuminosityBlock = cms.untracked.uint32(int(argv[1])),
0062     firstLuminosityBlockForEachRun = cms.untracked.VLuminosityBlockID(*[cms.LuminosityBlockID(x,y) for x,y in runToLumi]),
0063     fileNames = cms.untracked.vstring(argv[0].split(","))
0064 )
0065 
0066 process.e = cms.EndPath(process.check)
0067