diff --git a/benchmarks/imaging_shower_ML/config.yml b/benchmarks/imaging_shower_ML/config.yml index 5d4429b835ec4a99085885fd59ce57bee48f92e4..bb410998321e57b91b6a575e6ff26f06a33644c4 100644 --- a/benchmarks/imaging_shower_ML/config.yml +++ b/benchmarks/imaging_shower_ML/config.yml @@ -7,7 +7,7 @@ ml_shower:epi_separation: - | if [[ ${DETECTOR} =~ athena || ${DETECTOR} =~ ecce && ${DETECTOR_CONFIG} =~ imaging ]] ; then - pip3 install -r rbenchmarks/imaging_shower_ML/equirements.txt + pip3 install -r benchmarks/imaging_shower_ML/requirements.txt python3 benchmarks/imaging_shower_ML/run_benchmark.py -t imcal_epi -n 1000 --pmin 1.8 --pmax 2.2 --nocut-samples fi diff --git a/benchmarks/imaging_shower_ML/scripts/epcut_scan.py b/benchmarks/imaging_shower_ML/scripts/epcut_scan.py index 30dddbe42155afebb81fbedc3b231045734e3c45..4340f31f7106ea25db29b7f527e8d36d6d5428ad 100644 --- a/benchmarks/imaging_shower_ML/scripts/epcut_scan.py +++ b/benchmarks/imaging_shower_ML/scripts/epcut_scan.py @@ -1,7 +1,7 @@ """ A script to scan the optimized cut on layer and E/p. - It scan all the possible ScFi layers (20 in the EPIC brycecanyon configuration) - The results give the best cut (highest pion rejection) on [layer, E/p] with a targeted electron efficiency + It groups [event, layer] and scan the E/p cut layer-wise (e.g., EPIC brycecanyon configuration has 16 ScFi layers) + The best 2D cut (highest rejection power) on [layer, E/p] that satisfies required effiiency will be given Chao Peng (ANL) 2022/11/13 diff --git a/benchmarks/imaging_shower_ML/scripts/ml_training.py b/benchmarks/imaging_shower_ML/scripts/ml_training.py index 6955ac24c6b79be4caad515d1802fd20423ee5a6..5720dc197c151d31c9f0f75cf4e84687334252ba 100644 --- a/benchmarks/imaging_shower_ML/scripts/ml_training.py +++ b/benchmarks/imaging_shower_ML/scripts/ml_training.py @@ -131,7 +131,7 @@ if __name__ == '__main__': if args.seed > 0: np.random.seed(args.seed) - tf.random.seed(args.seed) + tf.random.set_seed(args.seed) df = pd.read_hdf(args.data_store, key=imcal_info.ml_data_key) # NOTE: assumed event index is exactly the same as df @@ -274,7 +274,8 @@ if __name__ == '__main__': ), test=OrderedDict( sample_size=count_pid_labels(ytest, pids), - efficiencies=OrderedDict([(labels.name, eff) for labels, eff in effs]) + efficiencies=OrderedDict([(labels.name, eff) for labels, eff in effs]), + rejections=OrderedDict([(labels.name, 1./eff) for labels, eff in effs]), ), ) res_json = json.dumps(result, indent=4, cls=NpEncoder)