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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

leptonweighter-1.1.4-cp312-cp312-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

leptonweighter-1.1.4-cp311-cp311-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

leptonweighter-1.1.4-cp310-cp310-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

leptonweighter-1.1.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: leptonweighter-1.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 14af12fccee3b24d834bdfc74c2c0d932a1cfc4aeb52fbfb4a6a7d4f50514512
MD5 2e070cd7f6a457b6c6a0ec18806ec86a
BLAKE2b-256 db17f12ba7e4506f3fb6521276744ad300efba10a35f1a2f965cbbac514d95f5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f38323f9e1afbab950b1b8cd4da335e11e6cded4e8a41b25a2e6c450e1e9e6bc
MD5 dfec97cf73243121a0cd23ab69faa7ec
BLAKE2b-256 8f48f4ccb07bd8c5a8ec9ab55b0aacec14d3f77f0392cf0ea042e646f8e86e46

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ad8cb631ff5b4e51df562903ee7fed7e586d35697c41002d740319ffa2d2ccfd
MD5 3ffe13ea944ec3dad5c66773f1e60eaf
BLAKE2b-256 e3b75e23c58e2cba1483d44e3548949a164180006206d2c45dd53bb1cf762b2e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b144a2dda0a4ab72b2729b90a2d7ddb93167a157a2d079f38e4145dc30f13b95
MD5 fda1878434eaa5a72b31add43f81a173
BLAKE2b-256 c18ef8cb6ecf573e61dbea01102b8b91caa89a198996e332298e929c09f02a69

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f663e5ef15234a33dfed663b870d9ebcf270858942dcda3ff11dc5e72ce15db1
MD5 ae4e32b9d8e6d69cf4ea09c5d3c80a37
BLAKE2b-256 e752e3fa18d6133c38adf327a9872b0190779e5a061ccb76231d5a76099b1d43

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3ffee0138ff9d958c5e63299186c95647548c68fe6ab670ee59df253ec59e0b6
MD5 a4f9885259943e1cddb3f54eff17f690
BLAKE2b-256 20e4cc72c9155bbde9dc5089746294f4ee9b2516fec83167b1f86269d98ef1cf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 54801902ff55a703a5ff29b01dbd46268a1958970c19c92c42b7a8ad63ab8b87
MD5 b304fb68152dc6083fad908c7b5dc320
BLAKE2b-256 b8cf0afe8a911aa6de4e1e0b7e7da59dc1533f77ed46bea616d9155cd3988534

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dacf22d502b51a02bee51ae13637e9705b0ea5155f89aa7497a37d6f207be178
MD5 b8ffa970cc00d8321865bcdb9396102e
BLAKE2b-256 b77dac4f408bdb5b7a623d3b3857601a8ac0dbf7bbe755ae8d8019400e0b4518

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d7e4aec22bff5ea825e3936e114dd189201f1edbbaaae698a7721ae05ebd54fc
MD5 c0bf712d4cee152e8a0c4f5f39417989
BLAKE2b-256 d8e3598a4f299a844882197ccf29e8a84893c8d18ec941c3ce6086dc16440779

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 626e0cea04628fa185b959351722cec9a539f70067ceecb266c17eec6a33c14b
MD5 68c68c159386237ece735a25b27b891f
BLAKE2b-256 221fc9167bab3e6a6225560b06e15d494d672c64acd7c9cb0cfb620c6c730381

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 49c7c3b454cc62f50d11d10dc7beef2075a5e856d20d6a9ff9d1230371040ddd
MD5 5084647ccf7ecf64f8fff861fa090931
BLAKE2b-256 1086c34885927d42b307ed9c088df3d5555a20053fbe4b25f98d20eb0c06a22f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for leptonweighter-1.1.4-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 99138756fff90d8bde2187a30336f2c0dfbb420e3b5c4cbb0e36c8a72cc33ab2
MD5 89e99771c00f3aba9ea5db092c7215ea
BLAKE2b-256 0e5543766f56e91af3ee7c585eeefe5dc9a4ffb5d842e000e55cfa22dc3a74f2

See more details on using hashes here.

Provenance

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