Skip to content

Commit ee8b435

Browse files
matthiasplumpre-commit-ci[bot]kjmeagher
authored
gsf flux 2comp for IT (#81)
* add 2 component GSF version for IceTop systematic data sets * Update and minor fixes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add GSF2Comp to tests and drop _IT suffix * add h4a 2 component * Update _fluxes.py clearify the description for the GSF 2 component model * make test_fluxes executable not sure how it wasnt --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kevin Meagher <11620178+kjmeagher@users.noreply.github.com>
1 parent 8590448 commit ee8b435

5 files changed

Lines changed: 48 additions & 0 deletions

File tree

src/simweights/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"FixedFractionFlux",
2323
"GaisserH3a",
2424
"GaisserH4a",
25+
"GaisserH4a2Comp",
2526
"GaisserH4a_IT",
2627
"GaisserHillas",
2728
"GenerationSurface",
@@ -31,6 +32,7 @@
3132
"GlobalFitGST4Comp",
3233
"GlobalFitGST_IT",
3334
"GlobalSplineFit",
35+
"GlobalSplineFit2Comp",
3436
"GlobalSplineFit5Comp",
3537
"GlobalSplineFit_IT",
3638
"Hoerandel",
@@ -55,12 +57,14 @@
5557
FixedFractionFlux,
5658
GaisserH3a,
5759
GaisserH4a,
60+
GaisserH4a2Comp,
5861
GaisserH4a_IT,
5962
GaisserHillas,
6063
GlobalFitGST,
6164
GlobalFitGST4Comp,
6265
GlobalFitGST_IT,
6366
GlobalSplineFit,
67+
GlobalSplineFit2Comp,
6468
GlobalSplineFit5Comp,
6569
GlobalSplineFit_IT,
6670
Hoerandel,

src/simweights/_fluxes.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
from numpy.typing import ArrayLike, NDArray
3333

34+
PDGID_2COMP = (PDGCode.PPlus, PDGCode.Fe56Nucleus)
3435
PDGID_4COMP = (PDGCode.PPlus, PDGCode.He4Nucleus, PDGCode.O16Nucleus, PDGCode.Fe56Nucleus)
3536
PDGID_5COMP = (PDGCode.PPlus, PDGCode.He4Nucleus, PDGCode.N14Nucleus, PDGCode.Al27Nucleus, PDGCode.Fe56Nucleus)
3637
PDGID_ALL = (
@@ -231,6 +232,32 @@ class GaisserH4a(CosmicRayFlux):
231232
)
232233

233234

235+
class GaisserH4a2Comp(CosmicRayFlux):
236+
r"""Variation of Gaisser's H4a flux using only two components.
237+
238+
*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.
239+
"""
240+
241+
pdgids = PDGID_2COMP
242+
_funcs = (
243+
lambda E: (
244+
0.7860 * E**-2.66 * exp(-E / (4e6 * 1))
245+
+ 0.0020 * E**-2.4 * exp(-E / (3e7 * 1))
246+
+ 0.0200 * E**-2.6 * exp(-E / 6e10)
247+
+ 0.3550 * E**-2.58 * exp(-E / (4e6 * 2))
248+
+ 0.0020 * E**-2.4 * exp(-E / (3e7 * 2))
249+
),
250+
lambda E: (
251+
0.2200 * E**-2.63 * exp(-E / (4e6 * 7))
252+
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 7))
253+
+ 0.1430 * E**-2.67 * exp(-E / (4e6 * 13))
254+
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 13))
255+
+ 0.2120 * E**-2.63 * exp(-E / (4e6 * 26))
256+
+ 0.00134 * E**-2.4 * exp(-E / (3e7 * 26))
257+
),
258+
)
259+
260+
234261
class GaisserH4a_IT(CosmicRayFlux):
235262
r"""Variation of Gaisser's H4a flux using only four components.
236263
@@ -435,6 +462,20 @@ def __init__(self: GlobalSplineFit_IT) -> None:
435462
super().__init__()
436463

437464

465+
class GlobalSplineFit2Comp(GlobalSplineFitBase):
466+
r"""Sum of the flux of the GSF model for a 2-component dataset injected by IceCube.
467+
468+
[(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)]
469+
GSF is a Data-driven spline fit of the cosmic ray spectrum by Dembinski et. al. \ [#GSFDembinski]_.
470+
"""
471+
472+
pdgids = PDGID_2COMP
473+
groups = ((1, 2), (3, 28))
474+
475+
def __init__(self: GlobalSplineFit2Comp) -> None:
476+
super().__init__()
477+
478+
438479
class FixedFractionFlux(CosmicRayFlux):
439480
"""Total energy per particle flux flux split among mass groups with a constant fraction.
440481

tests/test_fluxes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@
2020
simweights.GaisserHillas(),
2121
simweights.GaisserH3a(),
2222
simweights.GaisserH4a(),
23+
simweights.GaisserH4a2Comp(),
2324
simweights.GaisserH4a_IT(),
2425
simweights.Honda2004(),
2526
simweights.TIG1996(),
2627
simweights.GlobalFitGST(),
2728
simweights.GlobalFitGST_IT(),
2829
simweights.GlobalFitGST4Comp(),
2930
simweights.GlobalSplineFit(),
31+
simweights.GlobalSplineFit2Comp(),
3032
simweights.GlobalSplineFit5Comp(),
3133
simweights.GlobalSplineFit_IT(),
3234
simweights.FixedFractionFlux({2212: 0.1, 1000020040: 0.2, 1000080160: 0.3, 1000260560: 0.4}),
@@ -43,6 +45,7 @@ def test_flux_model(flux, ndarrays_regression):
4345

4446
gsfmodels = [
4547
simweights.GlobalSplineFit(),
48+
simweights.GlobalSplineFit2Comp(),
4649
simweights.GlobalSplineFit5Comp(),
4750
simweights.GlobalSplineFit_IT(),
4851
]
550 Bytes
Binary file not shown.
550 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)