gondola_core/calibration/
tracker.rs

1//! The following file is part of gaps-online-software and published 
2//! under the GPLv3 license
3//!
4//! Calibration routines for the GAPS tracker system
5
6/// Provide an interface to convert the 
7/// ADC values for the Si(Li) modules
8/// to a voltage drop. (Reversal of the 
9/// ASIC digitization). This voltage drop
10/// can then be further used to calculate the 
11/// energy deposition in the tracker strip.
12/// 
13/// The function fn(ADC) -> voltage is 
14/// commonly called "TransferFunction"
15/// 
16/// The actual function is piecewise defined
17/// for different ranges of the ADC value 
18/// and can be represented by a polynomial fit
19pub struct TrackerTransferFn {
20  /// Each strip has its own transer function. 
21  /// Identifier for the strip (hardware id)
22  pub strip_id     : u32,
23  /// 2nd order poly on ADC  [0,190)   
24  pub pol_a_params : [f32;3],
25  /// 3rd order poly on ADC  [190,500) 
26  pub pol_b_params : [f32;4],
27  /// 3rd order poly on ADC  [500,900) 
28  pub pol_c_params : [f32;4],
29  /// 3rd order poly on ADC  [9001600) 
30  pub pol_d_params : [f32;4],
31}
32
33impl TrackerTransferFn {
34
35  pub fn new() -> Self {
36    Self {
37      strip_id     : 0,
38      pol_a_params : [0.0;3],
39      pol_b_params : [0.0;4],
40      pol_c_params : [0.0;4],
41      pol_d_params : [0.0;4],
42    }
43  }
44}
45
46//use pyo3::prelude::*;
47//use pyo3::exceptions::{
48//  PyKeyError,
49//  PyValueError,
50//  PyIOError,
51//};
52//
53//
54///// Representation of all information to convert 
55///// Tracker ADC to energy. This is commonly 
56///// summarized under the umbrella term
57///// "TrackerTransferFunction"
58//#[pyclass]
59//#[pyo3(name="TrkTransferFn")]
60//pub struct PyTrkTransferFn {
61//  pub ydata : Vec<f32>,
62//  pub xdata : Vec<f32>,
63//}
64//
65//#[pymethods]
66//impl PyTrkTransferFn {
67//
68//  #[new]
69//  pub fn new() -> Self {
70//    Self {
71//      ydata : Vec::<f32>::new(),
72//      xdata : Vec::<f32>::new(),
73//    }
74//  }
75//
76//  #[getter]
77//  fn get_xmin(&self) -> f32 {
78//    0.0
79//  }
80//  
81//  #[getter]
82//  fn get_xmax(&self) -> f32 {
83//    0.0
84//  }
85//  
86//  #[getter]
87//  fn get_ymin(&self) -> f32 {
88//    0.0
89//  }
90//  
91//  #[getter]
92//  fn get_ymax(&self) -> f32 {
93//    0.0
94//  }
95//
96//  fn get_response(&self, x : f32) -> f32 {
97//    0.0
98//  }
99//}
100//
101//