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.
	allowUnscheduled=cms.untracked.bool(True),
#	SkipEvent=cms.untracked.vstring('ProductNotFound')		# Dangerous.
)

## Input:
if options.crab:
	process.source = cms.Source("PoolSource")
else:
Exemplo n.º 2
0
if (not in_files) and (not options.crab):
	assert miniaod
	if miniaod.files:
		in_files = miniaod.files
	else:
		print "ERROR (tuplizer): What files should be run over?"
		sys.exit()
#		in_files = dataset.get_paths(ds.miniaod_name)

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

### Output:
if not options.outFile:
	options.outFile = "tuple_{0}_{1}_{2}_{3}.root".format(options.subprocess, options.generation, options.suffix, cmssw_version)
# /SET UP

# CONFIGURATION:
## Process options:
process.load("FWCore.MessageLogger.MessageLogger_cfi")
if options.maxEvents > 1000 or options.maxEvents < 0:
	process.MessageLogger.cerr.FwkReport.reportEvery = 100
process.options = cms.untracked.PSet(
	wantSummary=cms.untracked.bool(False),		# Turn off long summary after job.
	allowUnscheduled=cms.untracked.bool(True),
	IgnoreCompletely=cms.untracked.vstring('InvalidReference')		# Dangerous.
#	SkipEvent=cms.untracked.vstring('ProductNotFound')		# Dangerous.
)

## Input:
Exemplo n.º 3
0
	VarParsing.varType.string,
	"Input LHE file"
)
options.register ('auto',
	0,
	VarParsing.multiplicity.singleton,
	VarParsing.varType.int,
	"Turn on auto file finding."
)
options.maxEvents = 2
options.parseArguments()
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(options.maxEvents))		# Set up the number of events to run over.

### Output:
if not options.outFile:
	options.outFile = "{0}_{1}_aodsim.root".format(options.subprocess, cmssw)
if options.crab:
	out_location = "{0}".format(options.outFile)
else:
	out_location = "{0}/{1}".format(options.outDir, options.outFile)
	
### Input:
if not options.inFile:
	options.inFile = "{0}.lhe".format(options.subprocess)
if options.crab:
	if "/" not in options.inFile:
		in_file = "file:{0}".format(options.inFile)
	else:
		in_file = options.inFile
else:
	in_file = "{0}/{1}".format(options.inDir, options.inFile)
	VarParsing.varType.int,
	"The number of events in the input dataset. (Not needed when using \"dataset\".)"
)
options.register ('data',
	False,
	VarParsing.multiplicity.singleton,
	VarParsing.varType.bool,
	"Set to true if running over data."
)

options.parseArguments()
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(options.maxEvents))		# Set up the number of events to run over.

### Output:
if not options.outFile:
	options.outFile = "{0}_ntuple.root".format(("b2g", "fatjets")[options.inType == 1])

### Input:
if options.inDir:
	in_files = ["file:{0}/{1}".format(options.inDir, f) for f in options.inFile]
else:
	in_files = ["file:{0}".format(f) for f in options.inFile]
#### Auto:
if options.dataset:
	in_files = []
	ds = samples.get_dataset(name=options.dataset, flavor="fatjets", generation=options.generation)
	if ds:
		if ds.set_info():
			print "Getting info about the {0} dataset ...".format(ds.name)
			if options.sigma < 0:
				options.sigma = ds.sigma
	VarParsing.varType.string,
	"Input LHE file"
)
options.register ('auto',
	0,
	VarParsing.multiplicity.singleton,
	VarParsing.varType.int,
	"Turn on auto file finding."
)
options.maxEvents = 2
options.parseArguments()
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(options.maxEvents))		# Set up the number of events to run over.

### Output:
if not options.outFile:
	options.outFile = "{0}_{1}_miniaod.root".format(options.subprocess, cmssw_version)
if options.crab:
	out_location = "{0}".format(options.outFile)
else:
	out_location = "{0}/{1}".format(options.outDir, options.outFile)
	
### Input:
if not options.inFile:
	options.inFile = "{0}.lhe".format(options.subprocess)
if options.crab:
	if "/" not in options.inFile:
		in_file = "file:{0}".format(options.inFile)
	else:
		in_file = options.inFile
else:
	in_file = "{0}/{1}".format(options.inDir, options.inFile)