options.parseArguments()
options.cmssw = ''.join([d for d in list((re.search("/?([^/]*)$", options.cmssw)).group(1)) if d.isdigit()])		# Format the "cmssw" option, so "CMSSW_7_3_2_patch2" turns into "7322" if necessary.
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(options.maxEvents))		# Set up the number of events to run over.

### Input:
in_files = ["{0}/{1}".format(options.inDir, f) for f in options.inFile]
if (not in_files) and (not options.crab):
	assert options.dataset
	result = dataset.get_datasets(name=options.dataset, generation=options.generation, set_info=True)
	print result
	ds = result.values()[0][0]
	print ds.miniaod_path
	in_files = ds.miniaod_path
	assert hasattr(ds, "subprocess")
	options.subprocess = ds.subprocess

if (not in_files) and (not options.crab):
	print "ERROR: You're not running over any files!"
	sys.exit()

### Output:
if not options.outFile:
	options.outFile = "{0}_{1}_jets.root".format(options.subprocess, options.cmssw)
# /SET UP

# CONFIGURATION:
## Process options:
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.options = cms.untracked.PSet(
	wantSummary=cms.untracked.bool(False),		# Turn off long summary after job.