FairRoot/PandaRoot
PndEmcPSAFPGALinFitter.cxx
Go to the documentation of this file.
2 
4 {
5  reset();
6 }
7 
9 {
10 }
12 {
13  Np=0;
14  x=0.0; xx=0.0;
15  xy=0.0; y=0.0;
16 }
17 
18 void PndEmcPSAFPGALinFitter::putPoint(double ix,double iy)
19 {
20  x += ix;
21  xy += ix*iy;
22  xx += ix*ix;
23  y += iy;
24  Np++;
25 }
26 
28 {
29  if (Np >= 2) {
30  k = (Np*xy-y*x)/(Np*xx-x*x);
31  a = (y-k*x)/Np;
32  } else {
33  k=0; a=0;
34  }
35 }
36 
38 {
39  return a;
40 }
41 
43 {
44  return k;
45 }
46 
48 {
49  if (Np > 0)
50  return y/Np;
51  return 0.0;
52 }
54 {
55  if (Np > 0)
56  return x/Np;
57  return 0.0;
58 }
void putPoint(double ix, double iy)