| Crates.io | gluex-lumi |
| lib.rs | gluex-lumi |
| version | 0.1.5 |
| created_at | 2025-12-18 17:05:58.098998+00 |
| updated_at | 2026-01-22 18:33:04.805686+00 |
| description | A Rust crate to calculate luminosity data for the GlueX experiment |
| homepage | https://github.com/denehoffman/gluex-rs |
| repository | https://github.com/denehoffman/gluex-rs |
| max_upload_size | |
| id | 1992889 |
| size | 61,517 |
Luminosity calculators for GlueX analyses. This crate can take a set of runs (optionally selecting a REST version for each run period) and produce histogram distributions of luminosity and flux in the hodoscope/microscope. It ships with a CLI that has similar inputs but prints JSON data for the histograms to stdout to be read by other tools (plotters, etc.).
Add to an existing Rust project:
cargo add gluex-lumi
or install as a CLI tool:
cargo install gluex-lumi
use gluex_core::run_periods::RunPeriod;
use gluex_lumi::{get_flux_histograms, RestSelection};
use std::collections::HashMap;
fn main() -> Result<(), gluex_lumi::GlueXLumiError> {
let mut selection = HashMap::new();
selection.insert(RunPeriod::RP2018_08, RestSelection::Current); // uses current timestamp rather than REST version
let edges: Vec<f64> = (0..=20).map(|i| 7.5 + 0.05 * i as f64).collect();
let flux = get_flux_histograms(
selection,
&edges,
true, // coherent peak only
false, // false -> include AMO runs
"/path/to/rcdb.sqlite",
"/path/to/ccdb.sqlite",
None,
)?;
println!("Tagged luminosity in pb^{-1}: {:?}", flux.tagged_luminosity.counts);
Ok(())
}
Dual-licensed under Apache-2.0 or MIT.