gluex-core

Crates.iogluex-core
lib.rsgluex-core
version0.1.2
created_at2025-12-14 22:10:16.956538+00
updated_at2026-01-22 18:32:24.46368+00
descriptionCore crate related to the GlueX experiment and various projects which handle GlueX data
homepagehttps://github.com/denehoffman/gluex-rs
repositoryhttps://github.com/denehoffman/gluex-rs
max_upload_size
id1985182
size101,405
Nathaniel D. Hoffman (denehoffman)

documentation

https://docs.rs/gluex-core

README

gluex-core

Foundational types shared by the GlueX crate ecosystem, including histogram utilities, physics constants, REST metadata, and helpers for parsing run-period information.

Installation

cargo add gluex-core

Example

use gluex_core::{
    histograms::Histogram,
    run_periods::{coherent_peak, RunPeriod},
};

fn main() {
    let edges = vec![8.0, 8.2, 8.4, 8.6];
    let hist = Histogram::empty(&edges);
    let (peak_low, peak_high) = coherent_peak(55_000);
    println!(
        "{} runs from {} to {} with a {:.1}-{:.1} GeV coherent peak range",
        RunPeriod::RP2018_08.short_name(),
        RunPeriod::RP2018_08.min_run(),
        RunPeriod::RP2018_08.max_run(),
        peak_low,
        peak_high
    );
    println!("Histogram bins: {}", hist.bins());
}

License

Dual-licensed under Apache-2.0 or MIT.

Commit count: 77

cargo fmt