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.2.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.2-cp312-cp312-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

leptonweighter-1.1.2-cp312-cp312-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

leptonweighter-1.1.2-cp312-cp312-macosx_14_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

leptonweighter-1.1.2-cp311-cp311-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

leptonweighter-1.1.2-cp311-cp311-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

leptonweighter-1.1.2-cp311-cp311-macosx_14_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

leptonweighter-1.1.2-cp310-cp310-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

leptonweighter-1.1.2-cp310-cp310-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

leptonweighter-1.1.2-cp310-cp310-macosx_14_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

leptonweighter-1.1.2-cp39-cp39-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

leptonweighter-1.1.2-cp39-cp39-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

File details

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

File metadata

  • Download URL: leptonweighter-1.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 582b961abbd1ca9c68039ea261926ad876f1dd4e8b6b5d217b978be7da5c1286
MD5 c2b936015a9bcf388a5cfbb468a2038e
BLAKE2b-256 96fc4190a7f73ddb86b1dda7210ef6352cdbc44d7b374931b5a252fbf05e3680

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2.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.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f98edfc4343a1e04beb8614e46c1ac7fff5b9c8def3d01299c8b981675584af0
MD5 6c8a25bd18a1d44aee1026f7648f66d0
BLAKE2b-256 baf9c86077cff35bc7017eddc8ea14e28234bfdada79ac6cd3c76bb9f9db6060

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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.2-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3aa28f10f140017b68c6c9bc6d91d4646a29c1ecce5b3fcb640418c71933ae10
MD5 f30fe6b2cd3d2ec50cf3526f56d5b8a0
BLAKE2b-256 7396e71f74a0cff0a9f27c9db293a4c2fadd46aff015a31ee57c825cdd7e386c

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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.2-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1dabfb6e96e7bfa2115d2ec073a7c5390f93fb33812fdbef5e95d2b49c326160
MD5 69f753235212f1a587885aa3df7aed9a
BLAKE2b-256 68c0654bbc6acfe89955b6ebe5c9d38e1637925abd6440fb7853eaaf230800f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4be3a3bbc3b1261073f438e490438ac012a9dc75b8d08b345c458956351fc6cb
MD5 3d6b31dd475d9d887709c950fcc4fcfa
BLAKE2b-256 2d6e7adc33e6a46575e6fea485a11486f9ace376b278003d0bad42edaa508c33

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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.2-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3395ea94b12fe6672a9a348e953134681c6284190cca16c5dd8f6a1b55202504
MD5 9b1358dcdb732111133ec611864a8aea
BLAKE2b-256 7393045931ad352a31fd5bb218c49d03cb49f78a625d92dce1feda24549ffb51

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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.2-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 719de88fabd9dcde5f4cf6ca4e1a129302e17245d997db4ad5735217e9e40409
MD5 9504a4abddc13232d29e2f1877618057
BLAKE2b-256 843f966692348d2a18af0b86ee5f52b00f69cc365f91cd66b8f0a6a18f41d8a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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.2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8d4b9e83383b05f56d00b1c058f699a3224b662b74541a50aee1c9750c27c959
MD5 05431b88c3a478ba4818333602619e97
BLAKE2b-256 fb6708d579c288d2f857dab406d64cdc0659a43830bf7257e4c662c9ee315fad

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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.2-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7c332c0cd69e11a63b04343e46ac1a7a87ad88c58a1046d2776ecf1e4be06649
MD5 ef23a25e908a331562c069011fd38fe5
BLAKE2b-256 9a1ceaefc45d07c0066296ad8abea107e1c4297a1c809569630c14ca8d1b7652

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 39c61315019ecc5e83ffde5d2fc2130187882816c70ec09f13d04bca937767f0
MD5 5899dfb6dd8513514769072c56bed868
BLAKE2b-256 b9fb439bcf9781c143d0a3e28066560ec15807445138267d825504248753b6ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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.2-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 650b3c7435d905405c39aaed961df24aebbe15d06fb9809cdeb62a28b134a257
MD5 b74dd0d8ff96aa8cd13a11f8bdc61c54
BLAKE2b-256 5b7aec291e0ec584c125c3938e72271fcaa20abf130353c69f14c3e5903eccd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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.2-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for leptonweighter-1.1.2-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8060e2d6df7d39e2d983a7e2c7285bdfca8a34efdf1791b8b24970389e3da905
MD5 3b086e274b71204cbefdce50b9147626
BLAKE2b-256 28a22f6aa1009476bea51b7a771a469948127c1377aff070d5ced0af4ee04dbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for leptonweighter-1.1.2-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