From e31cb01d9f27f27f1368f3d4c061ec2ec58e6344 Mon Sep 17 00:00:00 2001 From: Jakob van Santen Date: Wed, 22 May 2024 16:30:49 +0200 Subject: [PATCH] Switch to real Gen2 classification efficiency (#57) Co-authored-by: Neha Lad --- toise/classification_efficiency.py | 13 +++ ...parsecube_doublecascade_NL_efficiency.json | 87 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 toise/data/selection_efficiency/sparsecube_doublecascade_NL_efficiency.json diff --git a/toise/classification_efficiency.py b/toise/classification_efficiency.py index c3473de..0b4b0bb 100644 --- a/toise/classification_efficiency.py +++ b/toise/classification_efficiency.py @@ -7,6 +7,7 @@ from .util import data_dir import json import os +import warnings def get_classification_efficiency(geometry="IceCube", spacing=125): @@ -56,7 +57,14 @@ def get_classification_efficiency(geometry="IceCube", spacing=125): return ClassificationEfficiency.load( "icecube_doublecascade_efficiency.json", (6e4, 1e7) ) + elif geometry == "Sunflower" and spacing == 240: + return ClassificationEfficiency.load( + "sparsecube_doublecascade_NL_efficiency.json", (6e4, 1e7) + ) elif 240 <= spacing <= 260: + warnings.warn( + f"Falling back to SparseCube classification efficiency for {geometry=} and {spacing=}" + ) return ClassificationEfficiency.load( "sparsecube_doublecascade_efficiency.json", (6e4, 1e7) ) @@ -93,6 +101,11 @@ def sigmoid(x, a, b, c, d, m): """ return ((a - d) / (1 + (np.exp(b * np.log(x / 1e3) - c)) ** m)) + d + @staticmethod + def sigmoid_updated(x, L, x0, k, b): + y = (L) / (1 + np.exp(-k * (x - x0))) + b + return y + @classmethod def load(cls, filename, energy_range=(0, np.inf)): if not filename.startswith("/"): diff --git a/toise/data/selection_efficiency/sparsecube_doublecascade_NL_efficiency.json b/toise/data/selection_efficiency/sparsecube_doublecascade_NL_efficiency.json new file mode 100644 index 0000000..f701c34 --- /dev/null +++ b/toise/data/selection_efficiency/sparsecube_doublecascade_NL_efficiency.json @@ -0,0 +1,87 @@ +{ + "nue": { + "cascades": [ + "logpoly", + [ + 211.08562334, + -40.24929496, + 2.79896331 + ] + ], + "starting_tracks": [ + "logpoly", + [ + -251.7835465, + 117.63929112, + -16.83418227, + 0.80111839 + ] + ], + "double_cascades": [ + "logpoly", + [ + -63.83109032, + 25.42909962, + -2.99231194, + 0.12524589 + ] + ] + }, + "numu": { + "cascades": [ + "logpoly", + [ + -65.51433012, + 27.46710645, + -2.25716057 + ] + ], + "starting_tracks": [ + "logpoly", + [ + 454.6150171, + -167.52327515, + 24.56073741, + -1.18053345 + ] + ], + "double_cascades": [ + "logpoly", + [ + -139.05608984, + 61.46406983, + -8.76234556, + 0.41181181 + ] + ] + }, + "nutau": { + "cascades": [ + "sigmoid_updated", + [ + 42.7778948, + 5.83830578, + -3.54578634, + 30.37678602 + ] + ], + "starting_tracks": [ + "sigmoid_updated", + [ + 30.57598051, + 6.17941948, + 3.58992146, + 21.87159307 + ] + ], + "double_cascades": [ + "logpoly", + [ + -418.10648932, + 159.28011746, + -17.77677905, + 0.5634169 + ] + ] + } +} \ No newline at end of file