File indexing completed on 2024-11-27 03:17:45
0001 import FWCore.ParameterSet.Config as cms
0002
0003 import EventFilter.L1TXRawToDigi.util as util
0004
0005 from FWCore.ParameterSet.VarParsing import VarParsing
0006
0007 options = VarParsing()
0008 options.register('runNumber', 0, VarParsing.multiplicity.singleton, VarParsing.varType.int, 'Run to analyze')
0009 options.register('lumis', '1-max', VarParsing.multiplicity.singleton, VarParsing.varType.string, 'Lumis')
0010 options.register('dataStream', '/ExpressPhysics/Run2015D-Express-v3/FEVT', VarParsing.multiplicity.singleton, VarParsing.varType.string, 'Dataset to look for run in')
0011 options.register('inputFiles', [], VarParsing.multiplicity.list, VarParsing.varType.string, 'Manual file list input, will query DAS if empty')
0012 options.register('inputFileList', '', VarParsing.multiplicity.singleton, VarParsing.varType.string, 'Manual file list input, will query DAS if empty')
0013 options.register('useORCON', False, VarParsing.multiplicity.singleton, VarParsing.varType.bool, 'Use ORCON for conditions. This is necessary for very recent runs where conditions have not propogated to Frontier')
0014 options.parseArguments()
0015
0016 def formatLumis(lumistring, run) :
0017 lumis = (lrange.split('-') for lrange in lumistring.split(','))
0018 runlumis = (['%d:%s' % (run,lumi) for lumi in lrange] for lrange in lumis)
0019 return ['-'.join(l) for l in runlumis]
0020
0021 print('Getting files for run %d...' % options.runNumber)
0022 if len(options.inputFiles) is 0 and options.inputFileList is '' :
0023 inputFiles = util.getFilesForRun(options.runNumber, options.dataStream)
0024 elif len(options.inputFileList) > 0 :
0025 with open(options.inputFileList) as f :
0026 inputFiles = list((line.strip() for line in f))
0027 else :
0028 inputFiles = cms.untracked.vstring(options.inputFiles)
0029 if len(inputFiles) is 0 :
0030 raise Exception('No files found for dataset %s run %d' % (options.dataStream, options.runNumber))
0031 print('Ok, time to analyze')
0032
0033 process = cms.Process("L1TCaloLayer1Test")
0034
0035 process.load("FWCore.MessageService.MessageLogger_cfi")
0036 process.load('EventFilter.L1TXRawToDigi.caloLayer1Stage2Digis_cfi')
0037
0038 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
0039
0040 process.source = cms.Source("PoolSource",
0041 fileNames = cms.untracked.vstring(
0042 inputFiles
0043 ),
0044
0045 )
0046
0047 process.out = cms.OutputModule("PoolOutputModule",
0048 fileName = cms.untracked.string('/data/dasu/l1tCaloLayer1Digis.root'),
0049 outputCommands = cms.untracked.vstring('drop *', 'keep *_*_*_L1TCaloLayer1Test')
0050 )
0051
0052 process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff')
0053 process.GlobalTag.globaltag = '74X_dataRun2_Express_v1'
0054
0055 process.p = cms.Path(process.l1tCaloLayer1Digis)
0056
0057 process.e = cms.EndPath(process.out)