Skip to content

Commit

Permalink
Merge pull request #120 from ats2008/2015MiniAOD
Browse files Browse the repository at this point in the history
Adding Option parser customization to the configuration
  • Loading branch information
jmhogan authored Dec 20, 2023
2 parents c643a71 + 3ead8aa commit b5cf02c
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions PhysObjectExtractor/python/poet_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@
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 <isData (default=False)>
#---- e.g: cmsRun PhysObjectExtractor/python/poet_cfg.py True
#---- 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

Expand Down Expand Up @@ -230,4 +237,14 @@
process.looseAK8Jets+process.patJetCorrFactorsReapplyJECAK8+process.slimmedJetsAK8NewJEC+process.myfatjets+
process.uncorrectedMet+process.uncorrectedPatMet+process.Type1CorrForNewJEC+process.slimmedMETsNewJEC+process.mymets
# +process.mypackedcandidate
)
)
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

0 comments on commit b5cf02c

Please sign in to comment.