use crate::io::lptf3::Lptf3UncertaintyModel;
pub struct DiffTanModel {
detector_z_dist: f64,
detector_y_dist: f64,
scale: f64,
}
impl DiffTanModel {
pub fn new(detector_z_dist: f64, detector_y_dist: f64, scale: f64) -> Self {
Self {
detector_z_dist,
detector_y_dist,
scale,
}
}
}
impl Lptf3UncertaintyModel for DiffTanModel {
fn value(&self, _x: f64, z: f64) -> f64 {
let theta = (self.detector_z_dist - z).atan2(self.detector_y_dist);
self.scale / theta.cos().powi(2)
}
}