Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:10:23

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 = cms.untracked.PSet(
0024     input = cms.untracked.int32(int(argv[1]))
0025 )
0026 
0027 firstRun = int(argv[2])
0028 numberEventsInRun = int(argv[3])
0029 firstLuminosityBlock = int(argv[4])
0030 numberEventsInLuminosityBlock = int(argv[5])
0031 
0032 if len(argv) > 6:
0033   #have first run of second file continue the run
0034   runToLumi = ((2,1),(10,3),(20,5), (30, 7), (40, 9) )
0035 else:
0036   #have first run of second file be a new run
0037   runToLumi = ((2,1),(10,3),(20,5), (30, 6), (40, 9) )
0038 
0039 def findRunForLumi( lumi) :
0040   lastRun = runToLumi[0][0]
0041   for r,l in runToLumi:
0042     if l > lumi:
0043       break
0044     lastRun = r
0045   return lastRun
0046 
0047 ids = cms.VEventID()
0048 numberOfEventsInLumi = 0
0049 numberOfEventsPerLumi = numberEventsInLuminosityBlock
0050 lumi = 1
0051 event=0
0052 oldRun = 2
0053 numberOfFiles = len(argv[0].split(","))
0054 numberOfEventsInFile = int(argv[1])/numberOfFiles
0055 for i in range(process.maxEvents.input.value()):
0056    numberOfEventsInLumi +=1
0057    event += 1
0058    run = findRunForLumi(lumi)
0059    if event > numberOfEventsInFile:
0060     event = 1
0061    if numberOfEventsInLumi > numberOfEventsPerLumi:
0062       numberOfEventsInLumi=1
0063       lumi += 1
0064       run = findRunForLumi(lumi)
0065       if run != oldRun:
0066         oldRun = run
0067    ids.append(cms.EventID(run,lumi,event))
0068 process.check = cms.EDAnalyzer("EventIDChecker", eventSequence = cms.untracked(ids))
0069 
0070 
0071 process.source = cms.Source("PoolSource",
0072     firstLuminosityBlockForEachRun = cms.untracked.VLuminosityBlockID(*[cms.LuminosityBlockID(x,y) for x,y in runToLumi]),
0073     fileNames = cms.untracked.vstring(argv[0].split(","))
0074 )
0075 
0076 process.e = cms.EndPath(process.check)
0077