StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFastCircleFitter.hh
1 /***************************************************************************
2  *
3  * $Id: StFastCircleFitter.hh,v 1.1 1999/12/21 16:28:50 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, Dec 1999
6  ***************************************************************************
7  *
8  * Description:
9  *
10  * Fast fitting routine using a iterational linear regression
11  * method (ILRM). Reference: N.Chernov, G.A.Ososkov, Computer
12  * Physics Communication 33 (1984) 329-333.
13  *
14  * Return codes: 0 fit ok
15  * 1-4 error occured, no results
16  *
17  * StFastCircleFitter::fit() returns true only if rc = 0
18  *
19  ***************************************************************************
20  *
21  * $Log: StFastCircleFitter.hh,v $
22  * Revision 1.1 1999/12/21 16:28:50 ullrich
23  * Initial Revision
24  *
25  **************************************************************************/
26 #ifndef ST_FAST_CIRCLE_FITTER_HH
27 #define ST_FAST_CIRCLE_FITTER_HH
28 
29 #include <vector>
30 #if !defined(ST_NO_NAMESPACES)
31 using std::vector;
32 #endif
33 
35 public:
38 
39  bool fit();
40  void clear(); // full reset
41 
42  void addPoint(double x, double y);
43 
44  double radius() const; // returns fitted radius
45  double xcenter() const; // returns x of fitted center
46  double ycenter() const; // returns y of fitted center
47  double variance() const; // variance estimate
48  int rc() const; // return code of fit
49  unsigned int numberOfPoints() const;
50 
51 private:
52 #if defined(ST_NO_TEMPLATE_DEF_ARGS)
53  vector<double, allocator<double> > mX; // x-coordinates of points
54  vector<double, allocator<double> > mY; // y-coordinates of points
55 #else
56  vector<double> mX; // x-coordinates of points
57  vector<double> mY; // y-coordinates of points
58 #endif
59  double mRadius;
60  double mXCenter;
61  double mYCenter;
62  double mVariance; // the estimate of variance
63  int mRC;
64 };
65 
66 #endif