#!/usr/bin/env python
from Utils.DBHandler import getDBPath
from Utils.TextFileHandler import ReadEventList
from Core.InputParser import parser
import sys

parser.add_option("-p", "--dataset", action="store", default=1, type="string", help="Primary Dataset")
parser.add_option("-t", "--textFile", action="store", default=None, type="string", help="input text file")

(options, args) = parser.parse_args(sys.argv)

datasetName = options.dataset
textFileName = options.textFile

eventList = ReadEventList(textFileName)

fileList = []
for run, lumi, evt in eventList:
    fileName = getDBPath(datasetName, run, lumi)
    if fileName not in fileList:
        fileList.append(fileName)

print fileList
Exemplo n.º 2
0
#!/usr/bin/env python
from Utils.DBHandler import getDBPath,getFilesFromPD
from Core.InputParser import parser
import sys

parser.add_option("-r","--run", action = "store", default = 1, type = 'long',help ="run number")
parser.add_option("-l","--lumi", action = "store", default = 1, type = 'long',help="lumi section")
parser.add_option("-e","--evt", action = "store", default = 1, type = 'long',help="event number")
parser.add_option("-p","--dataset", action = "store", default = 1, type = 'string',help="Primary Dataset")

(options,args) = parser.parse_args(sys.argv)

run = options.run
ls = options.lumi
evt = options.evt
datasetName = options.dataset

inputFile = getDBPath(datasetName,run,ls)

print "All Files with Run Number %d, Lumi %d in this PD %s:"%(run,ls,datasetName)
print inputFile
#____________________________________________________________________________||

options.parseArguments()

#____________________________________________________________________________||

eventList = ReadEventList(options.textFilePath)
inputEvtList = [ ":".join(event) for event in eventList ]
print inputEvtList

#____________________________________________________________________________||

if options.allFiles:
    fileList = getFilesFromPD(options.dataset) 
else:
    fileList = [ getDBPath(options.dataset,run,lumi) for (run,lumi,evt) in eventList ]

#____________________________________________________________________________||

process = cms.Process('SKIM')

#____________________________________________________________________________||

process.source = cms.Source("PoolSource")

#____________________________________________________________________________||

inputFileNames = cms.untracked.vstring()
inputFileNames.extend( fileList )
process.source.fileNames = inputFileNames
Exemplo n.º 4
0
options.parseArguments()

#____________________________________________________________________________||

eventList = ReadEventList(options.textFilePath)
inputEvtList = [":".join(event) for event in eventList]
print inputEvtList

#____________________________________________________________________________||

if options.allFiles:
    fileList = getFilesFromPD(options.dataset)
else:
    fileList = [
        getDBPath(options.dataset, run, lumi) for (run, lumi, evt) in eventList
    ]

#____________________________________________________________________________||

process = cms.Process('SKIM')

#____________________________________________________________________________||

process.source = cms.Source("PoolSource")

#____________________________________________________________________________||

inputFileNames = cms.untracked.vstring()
inputFileNames.extend(fileList)
print inputFileNames
Exemplo n.º 5
0
from Core.InputParser import parser
import sys

parser.add_option("-p",
                  "--dataset",
                  action="store",
                  default=1,
                  type='string',
                  help="Primary Dataset")
parser.add_option("-t",
                  "--textFile",
                  action="store",
                  default=None,
                  type='string',
                  help="input text file")

(options, args) = parser.parse_args(sys.argv)

datasetName = options.dataset
textFileName = options.textFile

eventList = ReadEventList(textFileName)

fileList = []
for run, lumi, evt in eventList:
    fileName = getDBPath(datasetName, run, lumi)
    if fileName not in fileList:
        fileList.append(fileName)

print fileList