def main(): ds_helper = DatasetHelper() json_fpath = os.path.join(GIT_REPO_DIR, 'GenReader/data/JSON/datasets.json') ds_helper.load(json_fpath) if args.list: print "---Available Samples---" for name in sorted(ds_helper.list()): print "{name}".format(name=name) return if len(args.datasets) == 0: print "No datasets specified, exiting..." return for name in args.datasets: if not ds_helper.exists(name): print "Unknown dataset: {name}".format(name) continue ds_helper.dump(name) if args.nfiles: lst = ds_helper.getFiles(name) max_idx = len(lst) if args.nfiles < 0 else min( args.nfiles, len(lst)) for idx, fn in enumerate(lst): if idx >= args.nfiles and args.nfiles > 0: break print "[{0}/{1}] {fpath}".format(idx + 1, max_idx, fpath=fn)
def main(): if args.list: ds_helper = DatasetHelper() json_fpath = os.path.join(GIT_REPO_DIR, 'GenReader/data/JSON/datasets.json') ds_helper.load(json_fpath) print "---Available Samples---" for sample_name in sorted(ds_helper.list()): print "{name}".format(name=sample_name) return if len(args.datasets) == 0: print "No samples specified, exiting..." return lst = args.datasets if args.test and len(lst) > 1: print "WARNING: Only running over the first sample when in 'test' mode" lst = [lst[0]] max_events = args.nevents norm_type = 1 intg_lumi = 1.0 #base_cmd = ["cmsRun","EFTGenReader_cfg.py"] base_cmd = ["cmsRun", "EFTSelectionAnalyzer_cfg.py"] width = 1 if len(lst) >= 10: width = 2 for idx, ds_name in enumerate(lst): print "\nProcessing dataset {0}... [{1:0>{w}}/{2}]".format(ds_name, idx + 1, len(lst), w=width) full_cmd = [x for x in base_cmd] full_cmd.append("maxEvents={}".format(max_events)) full_cmd.append("normType={}".format(norm_type)) full_cmd.append("intgLumi={}".format(intg_lumi)) full_cmd.append("fnSuffix={}".format(args.out_suffix)) if args.test: full_cmd.append("test=True") # Add kinematic cut options if args.minptj: full_cmd.append("minPtJet={}".format(args.minptj)) if args.minptl: full_cmd.append("minPtLep={}".format(args.minptl)) if args.maxetaj: full_cmd.append("maxEtaJet={}".format(args.maxetaj)) if args.maxetal: full_cmd.append("maxEtaLep={}".format(args.maxetal)) full_cmd.append("dataset={}".format(ds_name)) print "Full Command: {}".format(" ".join(full_cmd)) subprocess.check_call(full_cmd)
VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.float, "max eta cut for genleptons (-1 means no cut)") # Get and parse the command line arguments options.parseArguments() nd_redirect = "root://ndcms.crc.nd.edu/" fnal_redirect = "root://cmsxrootd.fnal.gov/" global_redirect = "root://cms-xrd-global.cern.ch/" cmssw_base_dir = os.environ['CMSSW_BASE'] dataset_fpath = os.path.join( cmssw_base_dir, "src/EFTGenReader/GenReader/data/JSON/datasets.json") ds_helper = DatasetHelper() ds_helper.load(dataset_fpath) ds_helper.root_redirect = nd_redirect from Configuration.StandardSequences.Eras import eras process = cms.Process("Demo", eras.Run2_2017) process.load('FWCore.MessageService.MessageLogger_cfi') process.maxEvents = cms.untracked.PSet( input=cms.untracked.int32(options.maxEvents) # number of events ) process.MessageLogger.cerr.FwkReport.reportEvery = 500 ds_name = options.dataset
"gsiftp://T3_US_NotreDame" + output_path, "srm://T3_US_NotreDame" + output_path, ], ) processing = Category( name='processing', #mode='fixed', cores=1, memory=1200, #disk=1000 #disk=2900 disk=6000) wf = [] ds_helper = DatasetHelper() ds_helper.load(os.path.join(GIT_REPO_DIR, "GenReader/data/JSON/datasets.json")) width = 1 samples = [ #'central_tZq', #'central_tZq_new_pmx_v2', #'central_ttH', #'central_ttW', #'central_ttZ', #'tllq4fMatchedNoSchanW_fromMAOD_nJetMax1', #'tllq4fMatchedNoSchanW_fromGEN_nJetMax1', #'tllq4fMatchedNoSchanW_fromGEN_nJetMax2', #'tllq4fMatchedNoSchanW_fromGEN_nJetMax2doublecheck', #'tllq4fMatchedNoSchanW_fromMAOD_nJetMax2', #'tllq4fMatchedNoHiggs_fromMAOD',
"root://deepthought.crc.nd.edu/" + output_path, # Note the extra slash after the hostname! "gsiftp://T3_US_NotreDame" + output_path, "srm://T3_US_NotreDame" + output_path, "file:///hadoop" + output_path, ]) processing = Category(name='processing', cores=1, memory=1200, disk=1000, mode='fixed') wf = [] ds_helper = DatasetHelper() ds_helper.load(os.path.join(GIT_REPO_DIR, "GenReader/data/JSON/datasets.json")) width = 1 samples = ['central_tZq'] print "Generating workflows:" for idx, sample_name in enumerate(samples): if not ds_helper.exists(sample_name): print "[{0:0>{w}}/{1:0>{w}}] Skipping unknown sample: {sample}".format( idx + 1, len(samples), sample=sample_name, w=width) continue if not ds_helper.getData(sample_name, 'on_das'): print "[{0:0>{w}}/{1:0>{w}}] Skipping non-DAS sample: {sample}".format( idx + 1, len(samples), sample=sample_name, w=width) continue