FairRoot/PandaRoot
PndEmcPSAFPGAMLinFitter.cxx
Go to the documentation of this file.
2 
3 void PndEmcPSAFPGAMLinFitter::set(int newBufferSize)
4 {
5  Np =newBufferSize;
6  mx.set(newBufferSize);
7  mxx.set(newBufferSize);
8  mxy.set(newBufferSize);
9  my.set(newBufferSize);
10  return;
11 }
12 
13 void PndEmcPSAFPGAMLinFitter::putPoint(double ix, double iy)
14 {
15  x = mx.put(ix);
16  xy = mxy.put(ix*iy);
17  xx = mxx.put(ix*ix);
18  y = my.put(iy);
19 }
20 
22 {
23  k = (Np*xy - y*x) / (Np*xx - x*x);
24  a = (y- k*x) / Np;
25 }
26 
28 {
29  return a;
30 }
31 
33 {
34  return k;
35 }
36 
38 {
39  if (Np > 0)
40  return y/Np;
41  return 0.0;
42 }
float put(float valueToStore)
void set(int newBufferSize)
void set(unsigned int newBufferSize)
void putPoint(double ix, double iy)