#include <TLineFitter.h>
Inheritance diagram for TLineFitter:
Public Member Functions | |
double | a (void) const |
double | a (void) const |
double | b (void) const |
double | b (void) const |
double | det (void) const |
double | det (void) const |
void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
dumps debug information. | |
void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
dumps debug information. | |
virtual int | fit (TTrackBase &) const |
virtual int | fit (TTrackBase &) const |
const std::string & | name (void) const |
returns name. | |
const std::string & | name (void) const |
returns name. | |
TLineFitter (const std::string &name) | |
Constructor. | |
TLineFitter (const std::string &name) | |
Constructor. | |
virtual | ~TLineFitter () |
Destructor. | |
virtual | ~TLineFitter () |
Destructor. | |
Protected Member Functions | |
void | fitDone (TTrackBase &) const |
sets the fitted flag. (Bad implementation) | |
void | fitDone (TTrackBase &) const |
sets the fitted flag. (Bad implementation) | |
Private Attributes | |
double | _a |
double | _b |
double | _det |
|
Constructor.
|
|
Destructor.
00022 { 00023 }
|
|
Constructor.
|
|
Destructor.
|
|
Reimplemented in TRobustLineFitter, and TRobustLineFitter. |
|
Reimplemented in TRobustLineFitter, and TRobustLineFitter. 00067 {
00068 return _a;
00069 }
|
|
Reimplemented in TRobustLineFitter, and TRobustLineFitter. |
|
Reimplemented in TRobustLineFitter, and TRobustLineFitter. 00073 {
00074 return _b;
00075 }
|
|
Reimplemented in TRobustLineFitter, and TRobustLineFitter. |
|
Reimplemented in TRobustLineFitter, and TRobustLineFitter. 00079 {
00080 return _det;
00081 }
|
|
dumps debug information.
Reimplemented from TMFitter. Reimplemented in TRobustLineFitter, and TRobustLineFitter. |
|
dumps debug information.
Reimplemented from TMFitter. Reimplemented in TRobustLineFitter, and TRobustLineFitter. |
|
Implements TMFitter. Reimplemented in TRobustLineFitter, and TRobustLineFitter. |
|
Implements TMFitter. Reimplemented in TRobustLineFitter, and TRobustLineFitter. 00026 { 00027 00028 //...Already fitted ?... 00029 if (t.fitted()) return TFitAlreadyFitted; 00030 00031 //...Check # of hits... 00032 if (t.links().length() < 2) return TFitErrorFewHits; 00033 00034 unsigned n = t.links().length(); 00035 if (_det == 0. && n == 2) { 00036 double x0 = t.links()[0]->position().x(); 00037 double y0 = t.links()[0]->position().y(); 00038 double x1 = t.links()[1]->position().x(); 00039 double y1 = t.links()[1]->position().y(); 00040 if (x0 == x1) return TFitFailed; 00041 _a = (y0 - y1) / (x0 - x1); 00042 _b = - _a * x1 + y1; 00043 } 00044 else { 00045 double sum = (double) n; 00046 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.; 00047 for (unsigned i = 0; i < n; i++) { 00048 const HepPoint3D & p = t.links()[i]->position(); 00049 double x = p.x(); 00050 double y = p.y(); 00051 sumX += x; 00052 sumY += y; 00053 sumX2 += x * x; 00054 sumXY += x * y; 00055 sumY2 += y * y; 00056 } 00057 00058 _det = sum * sumX2 - sumX * sumX; 00059 #ifdef TRKRECO_DEBUG_DETAIL 00060 cout << " TLineFitter::fit ... det=" << _det << std::endl; 00061 #endif 00062 if (_det == 0.) { 00063 return TFitFailed; 00064 } 00065 else { 00066 _a = (sumXY * sum - sumX * sumY) / _det; 00067 _b = (sumX2 * sumY - sumX * sumXY) / _det; 00068 } 00069 } 00070 00071 if (t.objectType() == Line) 00072 ((TMLine &) t).property(_a, _b, _det); 00073 fitDone(t); 00074 return 0; 00075 }
|
|
sets the fitted flag. (Bad implementation)
|
|
sets the fitted flag. (Bad implementation)
|
|
returns name.
|
|
returns name.
00073 {
00074 return _name;
00075 }
|
|
Reimplemented in TRobustLineFitter. |
|
Reimplemented in TRobustLineFitter. |
|
Reimplemented in TRobustLineFitter. |