A class to fit a TTrackBase object to a line.
More...
#include <TLineFitter.h>
|
| | TLineFitter (const std::string &name) |
| | Constructor.
|
| virtual | ~TLineFitter () |
| | Destructor.
|
| void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
| | dumps debug information.
|
| double | a (void) const |
| double | b (void) const |
| double | det (void) const |
| virtual int | fit (TTrackBase &) const |
| | TLineFitter (const std::string &name) |
| | Constructor.
|
| virtual | ~TLineFitter () |
| | Destructor.
|
| void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
| | dumps debug information.
|
| double | a (void) const |
| double | b (void) const |
| double | det (void) const |
| virtual int | fit (TTrackBase &) const |
| | TLineFitter (const std::string &name) |
| | Constructor.
|
| virtual | ~TLineFitter () |
| | Destructor.
|
| void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
| | dumps debug information.
|
| double | a (void) const |
| double | b (void) const |
| double | det (void) const |
| virtual int | fit (TTrackBase &) const |
| | TMFitter (const std::string &name) |
| | Constructor.
|
| virtual | ~TMFitter () |
| | Destructor.
|
| const std::string & | name (void) const |
| | returns name.
|
| void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
| | TMFitter (const std::string &name) |
| | Constructor.
|
| virtual | ~TMFitter () |
| | Destructor.
|
| const std::string & | name (void) const |
| | returns name.
|
| void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
| | TMFitter (const std::string &name) |
| | Constructor.
|
| virtual | ~TMFitter () |
| | Destructor.
|
| const std::string & | name (void) const |
| | returns name.
|
| void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
◆ TLineFitter() [1/3]
| TLineFitter::TLineFitter |
( |
const std::string & | name | ) |
|
◆ ~TLineFitter() [1/3]
| TLineFitter::~TLineFitter |
( |
| ) |
|
|
virtual |
◆ TLineFitter() [2/3]
| TLineFitter::TLineFitter |
( |
const std::string & | name | ) |
|
◆ ~TLineFitter() [2/3]
| virtual TLineFitter::~TLineFitter |
( |
| ) |
|
|
virtual |
◆ TLineFitter() [3/3]
| TLineFitter::TLineFitter |
( |
const std::string & | name | ) |
|
◆ ~TLineFitter() [3/3]
| virtual TLineFitter::~TLineFitter |
( |
| ) |
|
|
virtual |
◆ a() [1/3]
| double TLineFitter::a |
( |
void | | ) |
const |
|
inline |
◆ a() [2/3]
| double TLineFitter::a |
( |
void | | ) |
const |
◆ a() [3/3]
| double TLineFitter::a |
( |
void | | ) |
const |
◆ b() [1/3]
| double TLineFitter::b |
( |
void | | ) |
const |
|
inline |
◆ b() [2/3]
| double TLineFitter::b |
( |
void | | ) |
const |
◆ b() [3/3]
| double TLineFitter::b |
( |
void | | ) |
const |
◆ det() [1/3]
| double TLineFitter::det |
( |
void | | ) |
const |
|
inline |
◆ det() [2/3]
| double TLineFitter::det |
( |
void | | ) |
const |
◆ det() [3/3]
| double TLineFitter::det |
( |
void | | ) |
const |
◆ dump() [1/3]
| void TLineFitter::dump |
( |
const std::string & | message = std::string(""), |
|
|
const std::string & | prefix = std::string("") ) const |
◆ dump() [2/3]
| void TLineFitter::dump |
( |
const std::string & | message = std::string(""), |
|
|
const std::string & | prefix = std::string("") ) const |
◆ dump() [3/3]
| void TLineFitter::dump |
( |
const std::string & | message = std::string(""), |
|
|
const std::string & | prefix = std::string("") ) const |
◆ fit() [1/3]
Implements TMFitter.
Reimplemented in TRobustLineFitter, TRobustLineFitter, and TRobustLineFitter.
Definition at line 23 of file TLineFitter.cxx.
23 {
24
25
27
28
30
31 unsigned n =
t.links().length();
32 if ( _det == 0. &&
n == 2 )
33 {
34 double x0 =
t.links()[0]->position().x();
35 double y0 =
t.links()[0]->position().y();
36 double x1 =
t.links()[1]->position().x();
37 double y1 =
t.links()[1]->position().y();
39 _a = ( y0 - y1 ) / ( x0 - x1 );
40 _b = -_a * x1 + y1;
41 }
42 else
43 {
44 double sum = (double)
n;
45 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.;
46 for (
unsigned i = 0; i <
n; i++ )
47 {
50 double y = p.y();
52 sumY += y;
55 sumY2 += y * y;
56 }
57
58 _det = sum * sumX2 - sumX * sumX;
59#ifdef TRKRECO_DEBUG_DETAIL
60 cout << " TLineFitter::fit ... det=" << _det << std::endl;
61#endif
63 else
64 {
65 _a = ( sumXY * sum - sumX * sumY ) / _det;
66 _b = ( sumX2 * sumY - sumX * sumXY ) / _det;
67 }
68 }
69
70 if (
t.objectType() ==
Line ) ( (TMLine&)
t ).property( _a, _b, _det );
72 return 0;
73}
HepGeom::Point3D< double > HepPoint3D
#define TFitAlreadyFitted
void fitDone(TTrackBase &) const
sets the fitted flag. (Bad implementation)
Referenced by TRobustLineFitter::fit().
◆ fit() [2/3]
| virtual int TLineFitter::fit |
( |
TTrackBase & | | ) |
const |
|
virtual |
◆ fit() [3/3]
| virtual int TLineFitter::fit |
( |
TTrackBase & | | ) |
const |
|
virtual |
The documentation for this class was generated from the following files: