use crate::deconvolution::ls_deconvolution;
use alpha_g_detector::padwing::PWB_RATE;
use lazy_static::lazy_static;
const BIN_WIDTH: usize = (1.0e9 / PWB_RATE) as usize;
const RESPONSE_BYTES: &[u8] = include_bytes!("../../data/simulation/tpc_response/pads.json");
lazy_static! {
static ref PAD_RESPONSE: Vec<f64> = {
let raw: Vec<f64> = serde_json::from_slice(RESPONSE_BYTES).unwrap();
raw
.chunks_exact(BIN_WIDTH)
.map(|chunk| -chunk.iter().sum::<f64>())
.collect()
};
}
pub(crate) fn pad_deconvolution(signal: &[f64]) -> Vec<f64> {
ls_deconvolution(signal, &PAD_RESPONSE, 3..=5, 7..=12)
}
#[cfg(test)]
mod tests;