Skip to content

Commit 7e57b4a

Browse files
authored
Cleaning hepmc files as well (#44)
- Setting seed to run_number + 1 so as to be consistent for all runs
1 parent 37dabe0 commit 7e57b4a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/scripts/createO2tables.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ def copy_and_link(file_name):
261261
write_to_runner("#! /usr/bin/env bash\n")
262262
delphes_file = f"delphes.{run_number}.root"
263263
delphes_log_file = delphes_file.replace(".root", ".log")
264+
hepmc_file = None
264265
if custom_gen: # Using HEPMC
265266
gen_log_file = f"gen.{run_number}.log"
266267
hepmc_file = f"hepmcfile.{run_number}.hepmc"
@@ -280,7 +281,7 @@ def copy_and_link(file_name):
280281
f_cfg.write(f"\n\n\n#### Additional part ###\n\n\n\n")
281282
f_cfg.write(f"Main:numberOfEvents {nevents}\n")
282283
f_cfg.write(f"Random:setSeed = on\n")
283-
f_cfg.write(f"Random:seed = {run_number}\n")
284+
f_cfg.write(f"Random:seed = {run_number + 1}\n")
284285
# collision time spread [mm/c]
285286
f_cfg.write("Beams:allowVertexSpread on \n")
286287
f_cfg.write("Beams:sigmaTime 60.\n")
@@ -297,9 +298,13 @@ def copy_and_link(file_name):
297298
check_status=True)
298299
if not clean_delphes_files:
299300
copy_and_link(delphes_file)
301+
if hepmc_file is not None:
302+
copy_and_link(hepmc_file)
300303
copy_and_link(aod_file)
301304
if clean_delphes_files:
302305
write_to_runner(f"rm {delphes_file}")
306+
if hepmc_file is not None:
307+
write_to_runner(f"rm {hepmc_file}")
303308
write_to_runner("exit 0\n")
304309
for i in run_list:
305310
configure_run(i)

0 commit comments

Comments
 (0)