Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions run-cafmaker/gen_cafmaker_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ def get_path(base_dir, step, name, ftype, ext, file_id: int):


def write_ghep_files(outf, base_dir, name, hadd_factor, file_id: int, no_final_comma=False):
files = []
for ghep_id in range(file_id * hadd_factor, (file_id+1) * hadd_factor):
path = get_path(base_dir, 'run-genie', name, 'GHEP', 'root', ghep_id)
is_last = ghep_id == (file_id+1) * hadd_factor - 1
try:
path = get_path(base_dir, 'run-genie', name, 'GHEP', 'root', ghep_id)
except:
continue
files.append(path)
for i in range(len(files)):
is_last = i == len(files) - 1
maybe_comma = '' if (no_final_comma and is_last) else ','
outf.write(f' "{path}"{maybe_comma}\n')
outf.write(f' "{files[i]}"{maybe_comma}\n')


def main():
Expand Down