Skip to main content

Weights injected neutrino final states to neutrino fluxes

Project description

LeptonWeighter

Weights injected neutrino final states to neutrino fluxes.

Author: C.A. Arg"uelles

Reviewer: A. Schneider, B. Smithers

If there are any problems do not hesitate to email: carguelles@fas.harvard.edu

Prerequisites

The following libraries are required:

Optional (recommended):

For Python bindings, you also need:

Configuration

Use the provided configure script:

./configure --help

Basic configuration:

./configure --with-squids=/path/to/squids --with-nusquids=/path/to/nusquids

The configure script will automatically detect most dependencies via pkg-config. You can manually specify paths if needed:

./configure --with-gsl=/path/to/gsl \
            --with-hdf5=/path/to/hdf5 \
            --with-squids=/path/to/squids \
            --with-nusquids=/path/to/nusquids \
            --with-photospline-config=/path/to/photospline-config

Building

Once configuration is complete, compile the library:

make

Compile example programs:

make examples

The examples can be found in resources/example/.

Installing

Install the library (default location: /usr/local):

make install

To change the installation prefix:

./configure --prefix=$HOME/local

Python Bindings

LeptonWeighter supports two Python binding backends:

pybind11 (default, recommended)

To build Python bindings using pybind11:

./configure --with-python-bindings
make
make python

pybind11 is detected automatically via pip. If not installed:

pip install pybind11

Additional options:

# Specify pybind11 headers location
./configure --with-python-bindings --with-pybind-incdir=/path/to/pybind11/include

# Specify Python executable
./configure --with-python-bindings --python-bin=/path/to/python

Boost.Python (legacy)

To use Boost.Python instead:

./configure --with-boost-python-bindings --with-boost=/path/to/boost
make
make python

Installing Python bindings

Install to the system Python path:

make python-install

Or add the library directory to your PYTHONPATH:

export PYTHONPATH=/path/to/LeptonWeighter/lib:$PYTHONPATH

Using the Python module

After installation:

import LeptonWeighter as LW

# Create a flux model
flux = LW.PowerLawFlux(1e-18, 2.0, 1e5)

# Load cross sections from splines
xs = LW.CrossSectionFromSpline("cc_nu.fits", "cc_nubar.fits",
                                "nc_nu.fits", "nc_nubar.fits")

# Load generators from LIC file
generators = LW.MakeGeneratorsFromLICFile("simulation.lic")

# Create weighter
weighter = LW.Weighter(flux, xs, generators)

# Weight an event
event = LW.Event()
event.energy = 1e5  # GeV
event.zenith = 1.0  # radians
# ... set other event properties
weight = weighter.weight(event)

Optional Dependencies

nuSQuIDS

nuSQuIDS provides advanced neutrino physics functionality. When nuSQuIDS is available, the following features are enabled:

C++ library:

  • GlashowResonanceCrossSection class - Glashow resonance cross section calculations
  • Weighter::get_effective_tau_weight() - Effective tau neutrino weighting with tau decay corrections
  • Weighter::get_effective_tau_oneweight() - Effective tau neutrino one-weight calculation

Python bindings:

  • nuSQUIDSAtmFlux - Atmospheric neutrino flux from nuSQuIDS
  • nuSQUIDSFlux - General nuSQuIDS flux interface
  • GlashowResonanceCrossSection - Glashow resonance cross section

To enable nuSQuIDS support:

./configure --with-nusquids=/path/to/nusquids

nuflux

nuflux provides conventional and prompt atmospheric neutrino flux models. When nuflux is available, the NFluxInterface class is enabled for using nuflux flux models.

Note: nuflux requires Boost headers (for boost::shared_ptr).

To enable nuflux support:

./configure --with-nuflux=/path/to/nuflux

Citation

If you use LeptonWeighter in your research, please cite:

@article{IceCube:2020tcq,
    author = "{IceCube Collaboration}",
    title = "{LeptonInjector and LeptonWeighter: A neutrino event generator and weighter for neutrino observatories}",
    eprint = "2012.10449",
    archivePrefix = "arXiv",
    primaryClass = "physics.comp-ph",
    doi = "10.1016/j.cpc.2021.108018",
    journal = "Comput. Phys. Commun.",
    volume = "263",
    pages = "107894",
    year = "2021"
}

Detailed Author Contributions

The LeptonInjector and LeptonWeighter modules were motivated by the high-energy light sterile neutrino search performed by B. Jones and C. Arguelles. C. Weaver wrote the first implementation of LeptonInjector using the IceCube internal software framework, icetray, and wrote the specifications for LeptonWeighter. In doing so, he also significantly enhanced the functionality of IceCube's Earth-model service. These weighting specifications were turned into code by C. Arguelles in LeptonWeighter. B. Jones performed the first detailed Monte Carlo comparisons that showed that this code had similar performance to the standard IceCube neutrino generator at the time for throughgoing muon neutrinos.

It was realized that these codes could have use beyond IceCube and could benefit the broader neutrino community. The codes were copied from IceCube internal subversion repositories to this GitHub repository; unfortunately, the code commit history was not preserved in this process. Thus the current commits do not represent the contributions from the original authors, particularly from the initial work by C. Weaver and C. Arguelles.

The transition to this public version of the code has been spearheaded by A. Schneider and B. Smithers, with significant input and contributions from C. Weaver and C. Arguelles. B. Smithers isolated the components of the code needed to make the code public, edited the examples, and improved the interface of the code. A. Schneider contributed to improving the weighting algorithm, particularly to making it work for volume mode cascades, as well as in writing the general weighting formalism that enables joint weighting of volume and range mode.

This project also received contributions and suggestions from internal IceCube reviewers and the collaboration as a whole.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leptonweighter-1.1.5.tar.gz (4.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

leptonweighter-1.1.5-cp312-cp312-manylinux_2_28_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

leptonweighter-1.1.5-cp312-cp312-manylinux_2_28_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

leptonweighter-1.1.5-cp312-cp312-macosx_14_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

leptonweighter-1.1.5-cp311-cp311-manylinux_2_28_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

leptonweighter-1.1.5-cp311-cp311-manylinux_2_28_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

leptonweighter-1.1.5-cp311-cp311-macosx_14_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

leptonweighter-1.1.5-cp310-cp310-manylinux_2_28_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

leptonweighter-1.1.5-cp310-cp310-manylinux_2_28_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

leptonweighter-1.1.5-cp310-cp310-macosx_14_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

leptonweighter-1.1.5-cp39-cp39-manylinux_2_28_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

leptonweighter-1.1.5-cp39-cp39-manylinux_2_28_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

File details

Details for the file leptonweighter-1.1.5.tar.gz.

File metadata

  • Download URL: leptonweighter-1.1.5.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for leptonweighter-1.1.5.tar.gz
Algorithm Hash digest
SHA256 60d31608e64b2333da39be3a08c608138d47683e679de1b3f59c88dc1814d125
MD5 3fa5f5187569ede6aa8a0377e258c829
BLAKE2b-256 3e9a5dcbfbf230bedc0831a204b75ec4f451dc70020909bdcb468cb743bfd6e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5.tar.gz:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5be335343c0c8e918a158ea00aa129afcf551f9bcf1d27f99a1b8352dde8fd58
MD5 fc58497169fa316f18efc96ea685977b
BLAKE2b-256 d8062acc5a5569feb60979af1956705e67276cdd2c6819d4afb3275c3d887ccd

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a973142d5351314494857dbd0660656c82695db268cd229647937a66b85d6466
MD5 696345e21e687f2abdbcc42af41ca141
BLAKE2b-256 88ba122d2e0c69fa6ee4bb418314b86b82132b84a6a1eb30a8e8241380bf8405

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 091de0b2aa3d4d26d1730c81dd6eeb4575c0dc3e196284d5606007f6ede92e88
MD5 5ff544b51086f38bf4888fc83a4589df
BLAKE2b-256 3654e62f09e470a9a50fb7bca2513eaf69489d033e79aab6e6df76db2bf03539

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 08b12dca2ec91071d4b34f317e8a2bf7df49119d6252eeeea975e9a25821a779
MD5 ee0ed92673de4296da1621796ebbc3db
BLAKE2b-256 d24a2694b33e15ef451fc96a70eb666b8732be6c1aeffc660c27559a99a2b6a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1b5854767b10902eecf68fe8caaf23bf56564fadbeb91ad98e26e56a1306d2ec
MD5 5bb8e74662c9c4691a7b862fd1a0a5ac
BLAKE2b-256 e9bbbf40eb3d2d37cdd6cfc5a8be77f7178778834c947e4c83ad31bfb4c2ff89

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp311-cp311-manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 81a7f4de166627c0bc54dbf4f3d3efdb2ba405560b2bc85c004e19fa20b62e21
MD5 eb30efe0a50b659e2706685426ac32e3
BLAKE2b-256 9fa704f86054b7f99e5d6534379ea3225aa8232c38698f0438859076aebfe0ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a0c7d504551b495196b43355afb8b9e3fb4be286fe0eb00ffb8ab4df3233bd7b
MD5 731d1a465415601ab7cf83e377dae562
BLAKE2b-256 c80925478d50d45a75f07117b4079095d19cdb54fc65676a157d519568f66e8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7e57c37f351c33c5cf21385874db3e1e046b455296ff6e7ea9dc6bf3e1936ac1
MD5 0eeed3c072b1ae16815381d82cf2cdef
BLAKE2b-256 669fb9a4c27acae5a2493f9293904228369ef0d68adf1a2f64278f4d6dddd7b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp310-cp310-manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c63b43b378a88c764fef8f8e4874d2dec94926c77490b1a5db75b59d19b08e73
MD5 b8c417a0586de8d9875f543125804ff2
BLAKE2b-256 8e90f4ff80d196877a1a934166e25a75664bbc4cc0884425ebf744019ca63a1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4f74acb34c96f74a5df95471225aea3ea540886079350dd4558e52c5bd47271e
MD5 78499a2c3518df3f1792114fa13095cf
BLAKE2b-256 de4d20901e8235d2b49f395ce2f2f2d69c829160f77ad437c2f8877aaba4b062

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp39-cp39-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leptonweighter-1.1.5-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.5-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a8846e2477b9fd12d70d5cc3deb728be563c3ac4dbc3553ddf2c6b064a25098a
MD5 f72c7bdcdfb6f0df08e3ba1a5500927f
BLAKE2b-256 c66004fd27b45bd6c5410f51f2848c811c6812488f73b3561341432993133abe

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.5-cp39-cp39-manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yml on icecube/LeptonWeighter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page