diff --git a/benchmarks/imaging_shower_ML/sim_rec_tag.py b/benchmarks/imaging_shower_ML/sim_rec_tag.py index 370e2ca3df36d554203b69b3549e16869dd1528d..13e67afa93160a8b525646221f9ee6f5b99b05d4 100755 --- a/benchmarks/imaging_shower_ML/sim_rec_tag.py +++ b/benchmarks/imaging_shower_ML/sim_rec_tag.py @@ -38,6 +38,7 @@ tag_dir = os.path.join('tag_data', '{nametag}_{pmin}_{pmax}'.format(**kwargs)) os.makedirs(tag_dir, exist_ok=True) procs = [p.strip() for p in args.process.split(',')] +sdir = os.path.dirname(os.path.realpath(__file__)) if 'sim' in procs: # generate particles @@ -60,6 +61,7 @@ if 'sim' in procs: if args.seed > 0: sim_cmd += ['--random.seed', args.seed] return_code = subprocess.run(sim_cmd).returncode + print(return_code) if return_code is not None and return_code < 0: print("ERROR running simulation!") exit(return_code) @@ -76,8 +78,9 @@ if 'rec' in procs: os.environ['IMCAL_ML_N_HITS'] = '{}'.format(args.nhit) juggler_xenv = os.path.join(os.environ.get('JUGGLER_INTALL_PREFIX', '../local'), 'Juggler.xenv') - rec_cmd = ['xenv', '-x', juggler_xenv, 'gaudirun.py', 'options/imaging_ml_data.py'] + rec_cmd = ['xenv', '-x', juggler_xenv, 'gaudirun.py', os.path.join(sdir, 'options', 'imaging_ml_data.py')] return_code = subprocess.run(rec_cmd).returncode + print(return_code) if return_code is not None and return_code < 0: print("ERROR running juggler (reconstruction)!") exit(return_code) @@ -85,10 +88,11 @@ if 'rec' in procs: if 'tag' in procs: - tag_cmd = ['python', 'scripts/prepare_tf_dataset.py', rec_file, + tag_cmd = ['python', os.path.join(sdir, 'scripts', 'prepare_tf_dataset.py'), rec_file, '-o', tag_dir, '--shape', '{nlayer},{nhit},3'.format(**kwargs)] return_code = subprocess.run(tag_cmd).returncode + print(return_code) if return_code is not None and return_code < 0: print("ERROR running ML data tagging!") exit(return_code)