From ca9c1716347ddbeb5ca6e4f558f85d405f4ef63c Mon Sep 17 00:00:00 2001 From: Matthias Plum Date: Tue, 9 Jun 2026 10:40:10 -0500 Subject: [PATCH 1/7] add 2 component GSF version for IceTop systematic data sets --- src/simweights/_fluxes.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/simweights/_fluxes.py b/src/simweights/_fluxes.py index f5b49f2..2dcee58 100644 --- a/src/simweights/_fluxes.py +++ b/src/simweights/_fluxes.py @@ -31,6 +31,7 @@ from numpy.typing import ArrayLike, NDArray +PDGID_2COMP = (PDGCode.PPlus, PDGCode.Fe56Nucleus) PDGID_4COMP = (PDGCode.PPlus, PDGCode.He4Nucleus, PDGCode.O16Nucleus, PDGCode.Fe56Nucleus) PDGID_5COMP = (PDGCode.PPlus, PDGCode.He4Nucleus, PDGCode.N14Nucleus, PDGCode.Al27Nucleus, PDGCode.Fe56Nucleus) PDGID_ALL = ( @@ -433,6 +434,19 @@ class GlobalSplineFit_IT(GlobalSplineFitBase): def __init__(self: GlobalSplineFit_IT) -> None: super().__init__() + +class GlobalSplineFit_IT_2comp(GlobalSplineFitBase): + r"""Sum of the flux of the GSF model for the standard 4 components injected by IceCube. + + [(H, He), (Li, Be, B, C, N, O, F, Ne, Na, Mg, Al, Si, P, S, Cl, Ar, K, Ca, Sc, Ti, V, Cr, Mn, Fe, Co, Ni)] + GSF is a Data-driven spline fit of the cosmic ray spectrum by Dembinski et. al. \ [#GSFDembinski]_. + """ + + pdgids = PDGID_4COMP + groups = ((1, 2), (3, 28)) + + def __init__(self: GlobalSplineFit_IT_2comp) -> None: + super().__init__() class FixedFractionFlux(CosmicRayFlux): From 8c0d0fbca4f35ea197c624cd590a6de39db18317 Mon Sep 17 00:00:00 2001 From: Matthias Plum Date: Tue, 9 Jun 2026 10:43:13 -0500 Subject: [PATCH 2/7] Update and minor fixes --- src/simweights/__init__.py | 2 ++ src/simweights/_fluxes.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/simweights/__init__.py b/src/simweights/__init__.py index cb6a56c..5fe6ca5 100644 --- a/src/simweights/__init__.py +++ b/src/simweights/__init__.py @@ -33,6 +33,7 @@ "GlobalSplineFit", "GlobalSplineFit5Comp", "GlobalSplineFit_IT", + "GlobalSplineFit2Comp_IT", "Hoerandel", "Hoerandel5", "Hoerandel_IT", @@ -63,6 +64,7 @@ GlobalSplineFit, GlobalSplineFit5Comp, GlobalSplineFit_IT, + GlobalSplineFit2Comp_IT, Hoerandel, Hoerandel5, Hoerandel_IT, diff --git a/src/simweights/_fluxes.py b/src/simweights/_fluxes.py index 2dcee58..37d77c2 100644 --- a/src/simweights/_fluxes.py +++ b/src/simweights/_fluxes.py @@ -435,17 +435,17 @@ class GlobalSplineFit_IT(GlobalSplineFitBase): def __init__(self: GlobalSplineFit_IT) -> None: super().__init__() -class GlobalSplineFit_IT_2comp(GlobalSplineFitBase): +class GlobalSplineFit2Comp_IT(GlobalSplineFitBase): r"""Sum of the flux of the GSF model for the standard 4 components injected by IceCube. [(H, He), (Li, Be, B, C, N, O, F, Ne, Na, Mg, Al, Si, P, S, Cl, Ar, K, Ca, Sc, Ti, V, Cr, Mn, Fe, Co, Ni)] GSF is a Data-driven spline fit of the cosmic ray spectrum by Dembinski et. al. \ [#GSFDembinski]_. """ - pdgids = PDGID_4COMP + pdgids = PDGID_2COMP groups = ((1, 2), (3, 28)) - def __init__(self: GlobalSplineFit_IT_2comp) -> None: + def __init__(self: GlobalSplineFit2Comp_IT) -> None: super().__init__() From fbe265340860a683c52dd79703bb863bbe503282 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:55:57 +0000 Subject: [PATCH 3/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/simweights/__init__.py | 2 +- src/simweights/_fluxes.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/simweights/__init__.py b/src/simweights/__init__.py index 5fe6ca5..5a1b003 100644 --- a/src/simweights/__init__.py +++ b/src/simweights/__init__.py @@ -62,9 +62,9 @@ GlobalFitGST4Comp, GlobalFitGST_IT, GlobalSplineFit, + GlobalSplineFit2Comp_IT, GlobalSplineFit5Comp, GlobalSplineFit_IT, - GlobalSplineFit2Comp_IT, Hoerandel, Hoerandel5, Hoerandel_IT, diff --git a/src/simweights/_fluxes.py b/src/simweights/_fluxes.py index 37d77c2..51fabf0 100644 --- a/src/simweights/_fluxes.py +++ b/src/simweights/_fluxes.py @@ -434,7 +434,8 @@ class GlobalSplineFit_IT(GlobalSplineFitBase): def __init__(self: GlobalSplineFit_IT) -> None: super().__init__() - + + class GlobalSplineFit2Comp_IT(GlobalSplineFitBase): r"""Sum of the flux of the GSF model for the standard 4 components injected by IceCube. From 6d53f94b40846b5745f0afca080fd93592c70bba Mon Sep 17 00:00:00 2001 From: Kevin Meagher <11620178+kjmeagher@users.noreply.github.com> Date: Tue, 9 Jun 2026 14:30:51 -0500 Subject: [PATCH 4/7] add GSF2Comp to tests and drop _IT suffix --- src/simweights/__init__.py | 4 ++-- src/simweights/_fluxes.py | 4 ++-- tests/test_fluxes.py | 2 ++ .../test_flux_model_GlobalSplineFit2Comp_.npz | Bin 0 -> 550 bytes 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 tests/test_fluxes/test_flux_model_GlobalSplineFit2Comp_.npz diff --git a/src/simweights/__init__.py b/src/simweights/__init__.py index 5a1b003..0d53ae9 100644 --- a/src/simweights/__init__.py +++ b/src/simweights/__init__.py @@ -31,9 +31,9 @@ "GlobalFitGST4Comp", "GlobalFitGST_IT", "GlobalSplineFit", + "GlobalSplineFit2Comp", "GlobalSplineFit5Comp", "GlobalSplineFit_IT", - "GlobalSplineFit2Comp_IT", "Hoerandel", "Hoerandel5", "Hoerandel_IT", @@ -62,7 +62,7 @@ GlobalFitGST4Comp, GlobalFitGST_IT, GlobalSplineFit, - GlobalSplineFit2Comp_IT, + GlobalSplineFit2Comp, GlobalSplineFit5Comp, GlobalSplineFit_IT, Hoerandel, diff --git a/src/simweights/_fluxes.py b/src/simweights/_fluxes.py index 51fabf0..e25f70b 100644 --- a/src/simweights/_fluxes.py +++ b/src/simweights/_fluxes.py @@ -436,7 +436,7 @@ def __init__(self: GlobalSplineFit_IT) -> None: super().__init__() -class GlobalSplineFit2Comp_IT(GlobalSplineFitBase): +class GlobalSplineFit2Comp(GlobalSplineFitBase): r"""Sum of the flux of the GSF model for the standard 4 components injected by IceCube. [(H, He), (Li, Be, B, C, N, O, F, Ne, Na, Mg, Al, Si, P, S, Cl, Ar, K, Ca, Sc, Ti, V, Cr, Mn, Fe, Co, Ni)] @@ -446,7 +446,7 @@ class GlobalSplineFit2Comp_IT(GlobalSplineFitBase): pdgids = PDGID_2COMP groups = ((1, 2), (3, 28)) - def __init__(self: GlobalSplineFit2Comp_IT) -> None: + def __init__(self: GlobalSplineFit2Comp) -> None: super().__init__() diff --git a/tests/test_fluxes.py b/tests/test_fluxes.py index 9d3e8e7..04d04e8 100755 --- a/tests/test_fluxes.py +++ b/tests/test_fluxes.py @@ -27,6 +27,7 @@ simweights.GlobalFitGST_IT(), simweights.GlobalFitGST4Comp(), simweights.GlobalSplineFit(), + simweights.GlobalSplineFit2Comp(), simweights.GlobalSplineFit5Comp(), simweights.GlobalSplineFit_IT(), simweights.FixedFractionFlux({2212: 0.1, 1000020040: 0.2, 1000080160: 0.3, 1000260560: 0.4}), @@ -43,6 +44,7 @@ def test_flux_model(flux, ndarrays_regression): gsfmodels = [ simweights.GlobalSplineFit(), + simweights.GlobalSplineFit2Comp(), simweights.GlobalSplineFit5Comp(), simweights.GlobalSplineFit_IT(), ] diff --git a/tests/test_fluxes/test_flux_model_GlobalSplineFit2Comp_.npz b/tests/test_fluxes/test_flux_model_GlobalSplineFit2Comp_.npz new file mode 100644 index 0000000000000000000000000000000000000000..b02f62cb787afae14b91852ad6523326cbdf81df GIT binary patch literal 550 zcmWIWW@gc4U|`??Vnv2$ohjD;p@5S?gdrdxr?glvub`5VL4e@|PzeZ3fKUvx--y4G z7C3n#;8?)gd6S~%#4O2Mx*%_I+QM~<7tEU$9}+ZWhWPyWDU-N_%DvBM`muJ2r>lr9 zVfraG&1#kv*H$hO2EA-?&f9wb*~^Z*?zc8N^Lg{_eJO{wuw7N&cK!R)!vB^TY1z}n z?Q7r86gB(G6B(YyRd_QdPB{DHYORY^=Qqk{AG+%o87qGA<653e+n5*vP`natA7cdb z3O~>*ZmFhbex=DdskHRax)w=oou>48TY_i5tUXe-fAieE3Fq2hzBj)emtd6bnQ>{m zZOsS&C5N8uG<*I1)*6fQ2{(^j_6^euu(E(OMo{k8%UlB2upzU9I)8{ DitE6< literal 0 HcmV?d00001 From 71101ea0e7800ab8fe4378cb841ee26d09e4049c Mon Sep 17 00:00:00 2001 From: Matthias Plum Date: Tue, 9 Jun 2026 18:41:27 -0500 Subject: [PATCH 5/7] add h4a 2 component --- src/simweights/__init__.py | 2 ++ src/simweights/_fluxes.py | 26 ++++++++++++++++++ tests/test_fluxes.py | 1 + .../test_flux_model_GaisserH4a2Comp_.npz | Bin 0 -> 550 bytes 4 files changed, 29 insertions(+) mode change 100755 => 100644 tests/test_fluxes.py create mode 100644 tests/test_fluxes/test_flux_model_GaisserH4a2Comp_.npz diff --git a/src/simweights/__init__.py b/src/simweights/__init__.py index 0d53ae9..ef1dffe 100644 --- a/src/simweights/__init__.py +++ b/src/simweights/__init__.py @@ -22,6 +22,7 @@ "FixedFractionFlux", "GaisserH3a", "GaisserH4a", + "GaisserH4a2Comp", "GaisserH4a_IT", "GaisserHillas", "GenerationSurface", @@ -56,6 +57,7 @@ FixedFractionFlux, GaisserH3a, GaisserH4a, + GaisserH4a2Comp, GaisserH4a_IT, GaisserHillas, GlobalFitGST, diff --git a/src/simweights/_fluxes.py b/src/simweights/_fluxes.py index e25f70b..cfc7852 100644 --- a/src/simweights/_fluxes.py +++ b/src/simweights/_fluxes.py @@ -232,6 +232,32 @@ class GaisserH4a(CosmicRayFlux): ) +class GaisserH4a2Comp(CosmicRayFlux): + r"""Variation of Gaisser's H4a flux using only two components. + + *This is not a very physical flux*: The light group is the sum of H4a's proton and helium groups. Heavy group is the rest. + """ + + pdgids = PDGID_2COMP + _funcs = ( + lambda E: ( + 0.7860 * E**-2.66 * exp(-E / (4e6 * 1)) + + 0.0020 * E**-2.4 * exp(-E / (3e7 * 1)) + + 0.0200 * E**-2.6 * exp(-E / 6e10) + + 0.3550 * E**-2.58 * exp(-E / (4e6 * 2)) + + 0.0020 * E**-2.4 * exp(-E / (3e7 * 2)) + ), + lambda E: ( + 0.2200 * E**-2.63 * exp(-E / (4e6 * 7)) + + 0.00134 * E**-2.4 * exp(-E / (3e7 * 7)) + + 0.1430 * E**-2.67 * exp(-E / (4e6 * 13)) + + 0.00134 * E**-2.4 * exp(-E / (3e7 * 13)) + + 0.2120 * E**-2.63 * exp(-E / (4e6 * 26)) + + 0.00134 * E**-2.4 * exp(-E / (3e7 * 26)) + ), + ) + + class GaisserH4a_IT(CosmicRayFlux): r"""Variation of Gaisser's H4a flux using only four components. diff --git a/tests/test_fluxes.py b/tests/test_fluxes.py old mode 100755 new mode 100644 index 04d04e8..df12153 --- a/tests/test_fluxes.py +++ b/tests/test_fluxes.py @@ -20,6 +20,7 @@ simweights.GaisserHillas(), simweights.GaisserH3a(), simweights.GaisserH4a(), + simweights.GaisserH4a2Comp(), simweights.GaisserH4a_IT(), simweights.Honda2004(), simweights.TIG1996(), diff --git a/tests/test_fluxes/test_flux_model_GaisserH4a2Comp_.npz b/tests/test_fluxes/test_flux_model_GaisserH4a2Comp_.npz new file mode 100644 index 0000000000000000000000000000000000000000..2f328f54b4e759a93684202209985f5c21ccbdfc GIT binary patch literal 550 zcmWIWW@gc4U|`??VnqhUO7nC7p@5S?gdrdxr?glvub`5VL4e@|PzeZ3fKUvx--y4G z7C3n#;8?)gd6S~%#4O2Mx*%_I+QM~<7tEU$9}+ZWhWPyWDU-N_%DvBM`muJ2r>lr9 zVfraG&1#kv*H$hOhIQGqr@i}M{(sus@_2>A8;>wp-#;y5beX6B#yf3`kIP>6wywRh zv0gpSKQ^~mt9XG@`qx#EBbsZ$4RJJ3GhQWnYYUQuy}0 zb%(suPIp&mXP_3s`vO>bYLVmjT`XGcZ~C(uKTOuEdd zu>%TxP(*M-BLPG;FoH;UT%l_Ng#=6+KS(7MG%%h9ve3dMz?+o~B+mqdB|v%(*lYmS C`N5q4 literal 0 HcmV?d00001 From 58f33a8a1f7c9648fdddc52f6bc42c381f983b2d Mon Sep 17 00:00:00 2001 From: Matthias Plum Date: Tue, 9 Jun 2026 17:50:15 -0600 Subject: [PATCH 6/7] Update _fluxes.py clearify the description for the GSF 2 component model --- src/simweights/_fluxes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simweights/_fluxes.py b/src/simweights/_fluxes.py index cfc7852..85c84d1 100644 --- a/src/simweights/_fluxes.py +++ b/src/simweights/_fluxes.py @@ -463,7 +463,7 @@ def __init__(self: GlobalSplineFit_IT) -> None: class GlobalSplineFit2Comp(GlobalSplineFitBase): - r"""Sum of the flux of the GSF model for the standard 4 components injected by IceCube. + r"""Sum of the flux of the GSF model for a 2-component dataset injected by IceCube. [(H, He), (Li, Be, B, C, N, O, F, Ne, Na, Mg, Al, Si, P, S, Cl, Ar, K, Ca, Sc, Ti, V, Cr, Mn, Fe, Co, Ni)] GSF is a Data-driven spline fit of the cosmic ray spectrum by Dembinski et. al. \ [#GSFDembinski]_. From 41f85c7e397e5da9ac2d21db107c1497111a0d06 Mon Sep 17 00:00:00 2001 From: Kevin Meagher <11620178+kjmeagher@users.noreply.github.com> Date: Tue, 9 Jun 2026 22:14:58 -0500 Subject: [PATCH 7/7] make test_fluxes executable not sure how it wasnt --- tests/test_fluxes.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tests/test_fluxes.py diff --git a/tests/test_fluxes.py b/tests/test_fluxes.py old mode 100644 new mode 100755