Skip to main content

Sampling and Injection for Rare EveNts: A neutrino and rare-process injection toolkit

Project description

Build

SIREN

SIREN (Sampling and Injection for Rare EveNts) is a framework for injecting and weighting interaction final states of complex topology, with specific concern for the detector geometry. SIREN is designed to support a wide variety of neutrino experimental setups, including atmospheric neutrinos, accelerator beam decay-in-flight neutrinos, and neutrinos from decay-at-rest sources. SIREN grew out of LeptonInjector, a neutrino injection code developed within the IceCube collaboration to study atmospheric and astrophysical neutrino interactions in the IceCube detector.

SIREN provides a generic interface for user-defined BSM processes (and includes several pre-defined processes). It also supports generation of any number of secondary processes, e.g. the decay of a BSM particle after it has been created by an initial process. SIREN also includes detector geometry definitions for a number of existing HEP experiments, although contributions are always appreciated!

Python installation of SIREN

SIREN is distributed on pypi as siren, and can be installed via pip with:

pip install siren

For development of SIREN as a python project, simply clone the repository:

git clone https://github.com/Harvard-Neutrino/SIREN.git
cd SIREN

and run the following command to build and install SIREN:

pip install . --config-settings='build-dir=build'

After the python bindings are installed, you should be able to import the siren python library. Open a python interpreter by running python, and then run

import siren

To use SIREN, you will

  1. Define a primary process and a list of secondary processes by specifying a particle type and which interactions (cross sections or decays) each particle can undergo

  2. For each (primary or secondary) process, define a set of distributions from which to sample when injecting that particle (e.g. energy, position, direction)

  3. Combine this information to define an InjectorBase object

  4. Generate interaction trees using the InjectorBase object

  5. Create a TreeWeighter object using a list of primary and secondary physical processes

  6. Calculate the event weight for each interaction tree using the TreeWeighter object

For an example of this in action, see resources/DipoleInjection/inject_HNLs_CCM.{py,ipynb}

Dependencies

For local installations, you need the following:

  • A C++ compiler with C++14 support.

  • Some classes also require Photospline to create and to read cross sections. Read more about it, and its installation at github.com/icecube/photospline. Note that Photospline has dependencies that you will need that are not listed here.

  • SIREN requires Photospline's SuiteSparse capabilities, whose dependencies are available here.

For building py-bindings,

  • Python > 3.8

  • That's it! We use pybind11 to generate our pybindings, which is automatically included in SIREN as a submodule

Included External Dependencies

These are not ostensibly a part of SIREN, but are included automatically as submodules for its functionality.

  • cereal: for serialization

  • delabella: for Delaunay triangulation in our interpolation classes

  • googletest: for constructing our tests

  • pybind11: for compiling our python bindings

  • rk: a relativistic kinematics library used mostly in the CrossSection and Decay subclasses

  • photospline: a library that uses the penalized spline technique to efficiently compute, store, and evaluate B-spline representations of such large multi-dimensional tables

C++ installation of SIREN

To use SIREN in a C++ project, there are a few more steps.

We will be trying to keep our source, build, and install directories separate. To this end, these instructions will assume the following directory structure:

| local (for installing built libraries, headers, and binaries)
|  --lib
|  --include
|  --bin
| source (source code for SIREN and other dependencies)
|  --SIREN
|     --build (for building SIREN)
|  --(SIREN dependencies...)

git clone git@github.com:Harvard-Neutrino/SIREN.git

or

git clone https://github.com/Harvard-Neutrino/SIREN.git

to download the source code. To download the submodules, run

git submodule update --init

Now cd SIREN/build to get to the build directory. We call cmake

cmake ../ -DCMAKE_INSTALL_PREFIX=../../local

This tells cmake to install the shared objects in the local directory. CMake prepares a Makefile which calls the g++ compiler with the necessary instructions to compile. So now you'll call

make -j4 && make install

to build the project and install the project. Now you need to set all the environmental variables so this actually works. We recommend putting the followig commands into a env.sh script that can load the environment.

export PROJECTSPACE=/path/to/parent/directory
export PROJECTBUILDPATH=$PROJECTSPACE/local
export PROJECTSOURCEPATH=$PROJECTSPACE/source
export PREFIX=$PROJECTBUILDPATH
# On linux:
export LD_LIBRARY_PATH=$PROJECTBUILDPATH/lib/:$LD_LIBRARY_PATH
# On mac:
export DYLD_FALLBACK_LIBRARY_PATH=$PROJECTBUILDPATH/lib/:$DYLD_FALLBACK_LIBRARY_PATH

Now you should be good to go!

Making Contributions

If you would like to make contributions to this project, please create a branch off of the main branch and name it something following the template: $YourLastName/$YourSubProject. Work on this branch until you have made the changes you wished to see and your branch is stable. Then, pull from main, and create a pull request to merge your branch back into main.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

siren-0.0.1-cp312-cp312-musllinux_1_1_x86_64.whl (14.1 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

siren-0.0.1-cp312-cp312-musllinux_1_1_i686.whl (14.3 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

siren-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.0 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

siren-0.0.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (14.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

siren-0.0.1-cp312-cp312-macosx_11_0_arm64.whl (15.6 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

siren-0.0.1-cp312-cp312-macosx_10_9_x86_64.whl (13.7 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

siren-0.0.1-cp311-cp311-musllinux_1_1_x86_64.whl (14.1 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

siren-0.0.1-cp311-cp311-musllinux_1_1_i686.whl (14.3 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

siren-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.0 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

siren-0.0.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (14.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

siren-0.0.1-cp311-cp311-macosx_11_0_arm64.whl (15.6 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

siren-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl (13.7 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

siren-0.0.1-cp310-cp310-musllinux_1_1_x86_64.whl (14.1 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

siren-0.0.1-cp310-cp310-musllinux_1_1_i686.whl (14.3 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

siren-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

siren-0.0.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (14.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

siren-0.0.1-cp310-cp310-macosx_11_0_arm64.whl (15.6 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

siren-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl (13.7 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

siren-0.0.1-cp39-cp39-musllinux_1_1_x86_64.whl (14.1 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

siren-0.0.1-cp39-cp39-musllinux_1_1_i686.whl (14.3 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

siren-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

siren-0.0.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (14.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

siren-0.0.1-cp39-cp39-macosx_11_0_arm64.whl (15.6 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

siren-0.0.1-cp39-cp39-macosx_10_9_x86_64.whl (13.7 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

siren-0.0.1-cp38-cp38-musllinux_1_1_x86_64.whl (14.1 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

siren-0.0.1-cp38-cp38-musllinux_1_1_i686.whl (14.3 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

siren-0.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

siren-0.0.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (14.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

siren-0.0.1-cp38-cp38-macosx_11_0_arm64.whl (15.6 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

siren-0.0.1-cp38-cp38-macosx_10_9_x86_64.whl (13.7 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

Supported by

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