diff --git a/cms-2016-simulated-datasets/code/lhe_generators.py b/cms-2016-simulated-datasets/code/lhe_generators.py index c50dfb94b..8cdbc7c6e 100644 --- a/cms-2016-simulated-datasets/code/lhe_generators.py +++ b/cms-2016-simulated-datasets/code/lhe_generators.py @@ -156,14 +156,7 @@ def create_lhe_generator( ) # Find fragment - fragment_url = get_genfragment_url(dataset, mcm_dir) - if fragment_url: - fragment_url = fragment_url[0] - fragment = requests.get(fragment_url, verify=False).text - if not fragment: - fragment = get_from_deep_json(get_mcm_dict(dataset, mcm_dir), "fragment") - else: - fragment = get_from_deep_json(get_mcm_dict(dataset, mcm_dir), "fragment") + fragment = get_from_deep_json(get_mcm_dict(dataset, mcm_dir), "fragment") if not fragment: log( recid, @@ -173,16 +166,17 @@ def create_lhe_generator( return # Find gridpack path - path = re.search(r"cms.vstring\(['\"\[]\s*(/cvmfs.*?)['\"]", fragment) + # path = re.search(r"cms.vstring\(['\"\[]\s*(/cvmfs.*?)['\"]", fragment) + path = re.search(r"(/cvmfs/cms.cern.ch/phys_generator/gridpacks[^']*)", fragment) if not path: log( recid, "ERROR", - f"No 'cms.vstring(/cvmfs' found in fragment; skipping.", + f"No '/cvmfs/cms.cern.ch/phys_generator/gridpacks' found in fragment; skipping.", ) return - path = path.group(1) + path = path.groups()[0] log(recid, "INFO", f"Found path {path}") outfilepath = "{gen_store}/gridpacks/{recid}".format( gen_store=gen_store, recid=recid @@ -280,6 +274,8 @@ def create_lhe_generator( [ "./readInput.DAT", "readInput.DAT", + "./JHUGen.input", + "JHUGen.input", ] )