Ejemplo n.º 1
0
options.register('runNumber', 0, VarParsing.multiplicity.singleton, VarParsing.varType.int, 'Run to analyze')
options.register('lumis', '1-max', VarParsing.multiplicity.singleton, VarParsing.varType.string, 'Lumis')
options.register('dataStream', '/ExpressPhysics/Run2015D-Express-v4/FEVT', VarParsing.multiplicity.singleton, VarParsing.varType.string, 'Dataset to look for run in')
options.register('inputFiles', [], VarParsing.multiplicity.list, VarParsing.varType.string, 'Manual file list input, will query DAS if empty')
options.register('inputFileList', '', VarParsing.multiplicity.singleton, VarParsing.varType.string, 'Manual file list input, will query DAS if empty')
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')
options.parseArguments()

def formatLumis(lumistring, run) :
    lumis = (lrange.split('-') for lrange in lumistring.split(','))
    runlumis = (['%d:%s' % (run,lumi) for lumi in lrange] for lrange in lumis)
    return ['-'.join(l) for l in runlumis]

print('Getting files for run %d...' % options.runNumber)
if len(options.inputFiles) is 0 and options.inputFileList is '' :
    inputFiles = util.getFilesForRun(options.runNumber, options.dataStream)
elif len(options.inputFileList) > 0 :
    with open(options.inputFileList) as f :
        inputFiles = list((line.strip() for line in f))
else :
    inputFiles = cms.untracked.vstring(options.inputFiles)
if len(inputFiles) is 0 :
    raise Exception('No files found for dataset %s run %d' % (options.dataStream, options.runNumber))
print('Ok, time to analyze')

process = cms.Process("L1TCaloLayer1Test")

# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('FWCore.MessageService.MessageLogger_cfi')
    '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'
)
options.parseArguments()


def formatLumis(lumistring, run):
    lumis = (lrange.split('-') for lrange in lumistring.split(','))
    runlumis = (['%d:%s' % (run, lumi) for lumi in lrange] for lrange in lumis)
    return ['-'.join(l) for l in runlumis]


print('Getting files for run %d...' % options.runNumber)
if len(options.inputFiles) is 0 and options.inputFileList is '':
    inputFiles = util.getFilesForRun(options.runNumber, options.dataStream)
elif len(options.inputFileList) > 0:
    with open(options.inputFileList) as f:
        inputFiles = list((line.strip() for line in f))
else:
    inputFiles = cms.untracked.vstring(options.inputFiles)
if len(inputFiles) is 0:
    raise Exception('No files found for dataset %s run %d' %
                    (options.dataStream, options.runNumber))
print('Ok, time to analyze')

process = cms.Process("L1TCaloLayer1Test")

process.load("FWCore.MessageService.MessageLogger_cfi")
process.load('EventFilter.L1TXRawToDigi.caloLayer1Stage2Digis_cfi')