diff --git a/PhysObjectExtractor/python/poet_cfg.py b/PhysObjectExtractor/python/poet_cfg.py index 5e0fb23..5b951d8 100644 --- a/PhysObjectExtractor/python/poet_cfg.py +++ b/PhysObjectExtractor/python/poet_cfg.py @@ -2,6 +2,7 @@ import FWCore.Utilities.FileUtils as FileUtils import FWCore.PythonUtilities.LumiList as LumiList import FWCore.ParameterSet.Types as CfgTypes +from FWCore.ParameterSet.VarParsing import VarParsing import sys #---- sys.argv takes the parameters given as input cmsRun PhysObjectExtractor/python/poet_cfg.py @@ -9,10 +10,16 @@ #---- NB the first two parameters are always "cmsRun" and the config file name #---- Work with data (if False, assumed MC simulations) #---- This needs to be in agreement with the input files/datasets below. +options = VarParsing ('analysis') +isData = False if len(sys.argv) > 2: - isData = eval(sys.argv[2]) -else: - isData = False + try: + isData = eval(sys.argv[2]) + sys.argv.pop( 2 ) + print "isData is set to ",isData + except: + pass +options.parseArguments() isMC = True if isData: isMC = False @@ -230,4 +237,14 @@ process.looseAK8Jets+process.patJetCorrFactorsReapplyJECAK8+process.slimmedJetsAK8NewJEC+process.myfatjets+ process.uncorrectedMet+process.uncorrectedPatMet+process.Type1CorrForNewJEC+process.slimmedMETsNewJEC+process.mymets # +process.mypackedcandidate - ) \ No newline at end of file + ) +process.maxEvents.input = options.maxEvents +process.TFileService.fileName = options.outputFile +if len(options.inputFiles) > 0: + process.source.fileNames=options.inputFiles + +print "Processing for maxEvents = ",process.maxEvents.input +print "Processing input files " +for fl in process.source.fileNames: + print " > ",fl +print "Output filename : ",process.TFileService.fileName