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