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.1.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.1-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.1-cp312-cp312-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

leptonweighter-1.1.1-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.1-cp311-cp311-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

leptonweighter-1.1.1-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.1-cp310-cp310-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10macOS 14.0+ ARM64

leptonweighter-1.1.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: leptonweighter-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 e6db3e9e5893132045061e79a119416de14595529d569d11149c8d3b688265ef
MD5 e9476d5ef006cf3afef7ff90fff3885b
BLAKE2b-256 5f0328f5f64526cbc56f9b7f8534b396a8462a9c6bedf2483947888cffb5e0c7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b05e57c67ff331f3ac02a9174032fed4a4b92031bbb9a9c0ccfa1d641f5a6d7a
MD5 95053f1ee8819f233f11a910b37ee28b
BLAKE2b-256 c00ea9d31f898ea3181c6d6733dda5f020bfa513d87b0e0c19b81d20bdf7dcc1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 afb5ed0f3fa871f887fe35a56b8e5b9e3c3c6ae979db21e910125bc78d9a3d3c
MD5 2d3292096a7f464fe24abfac7c9ac2d6
BLAKE2b-256 961b27d1628f2ba3cbd91c22373398f2f3d83fed1b859b6c1bfb829cf8a11b2c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 687e9f15f2f46b41484464b104946ad2e7ce81fb88d901658d16f252eeab8ede
MD5 accf1cfc1ac2cb1dfd8951719463166a
BLAKE2b-256 f9b55f6b070a11009af8075b42cd38227da98b20f27ec4b6ce98cdbd9fc1d945

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b2910403a5022d2daf8ebf835c667db313a95f93f0eb0acf97386131f5c48acb
MD5 31c9848a65f92fdfe69fe301229f09a6
BLAKE2b-256 680d93c32630e82882921c9bf1d22bfa4c51a3c9afa48f884bc836869c40661b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3bf7733a7ef0e5200df8cb04536eff806b338d0e3e5702b24474607408476ec1
MD5 1fab9e432853bfae2f175ed63d31d6e6
BLAKE2b-256 5d61f0e980bd13ef5a8b56621312aa93d0f4eb3ad425930bbcd3afc511f57770

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f53edf3f7ceb2ef51887c37a532aec4266bac35c6041e4b5950f30fc1ad030fd
MD5 97fc95938c89f5333de8ce30238105e2
BLAKE2b-256 eb2a784101e2707438bf7f5a6b29b9b0cd64705ec9dedd911ecc241798f22b7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 681975b01155d984b25cc85445635c37c5596d2443424980fd5966bba36db7eb
MD5 892ff1f06fd8a939c1723c7d17b53617
BLAKE2b-256 46e562fa3ec1071beb96b01e79abbed9cc67936ba77f1e36002d4ff89f02dc53

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d74742f3a35801eb2618c4fce9a6f63d7e759bfe33cb000d306b217b6cdfda06
MD5 c6bb7b3d73391069e010f277a80efb34
BLAKE2b-256 e7a9ff428bf346bfb8110c7f9e41bda401cc860861f3ee402d659ef9447a12db

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2f828bac543365135899cda85451cdc06ad532e8c0e7f9c7c096d329dcd8917b
MD5 7c311de3ff55ef6abf39927ce689da46
BLAKE2b-256 c99d92c445dde4ee7f7b7895259d58e3a2e1999ded1ffab4f1f6448b1ed3c084

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8c2c63b98542396512eb77425abf36f8292c699f302d301eeaa1a54af0ac78a5
MD5 2f40343e725337e1ad1c6aa1b6e027e3
BLAKE2b-256 3cd9e6cc066fac1ec678a25600a81da9c8d966e65b435b92e2bb827e0a2498c2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.1-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6104e626ac6c608895039d939d476a5d9b20899752e14f50da40809b9fccb1c4
MD5 36a9f038f9696b9d647ba54b7bdb5c57
BLAKE2b-256 659bacd27989d1a2d92328d31c268fe3e99561510e53cdef3558305924697d74

See more details on using hashes here.

Provenance

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