Skip to content

Commit

Permalink
cms-2016-simulated-datasets: JHUGen mcfm option and simpler gridpack …
Browse files Browse the repository at this point in the history
…path search

Closes #238
  • Loading branch information
Kati Lassila-Perini authored and tiborsimko committed Jun 10, 2024
1 parent 94243c4 commit 0773566
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions cms-2016-simulated-datasets/code/lhe_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -280,6 +274,8 @@ def create_lhe_generator(
[
"./readInput.DAT",
"readInput.DAT",
"./JHUGen.input",
"JHUGen.input",
]
)

Expand Down

0 comments on commit 0773566

Please sign in to comment.