BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/TrkReco/include/TrkReco/TLine2D.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TLine2D.h,v 1.5 2010/03/31 09:58:59 liucy Exp $
3//-----------------------------------------------------------------------------
4// Filename : TLine2D.h
5// Section : Tracking
6// Owner : Yoshi Iwasaki
7// Email : yoshihito.iwasaki@kek.jp
8//-----------------------------------------------------------------------------
9// Description : A class to represent a line in 2D.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifndef TLINE2D_FLAG_
14#define TLINE2D_FLAG_
15
16#ifdef TRKRECO_DEBUG_DETAIL
17# ifndef TRKRECO_DEBUG
18# define TRKRECO_DEBUG
19# endif
20#endif
21
22#include "CLHEP/Alist/AList.h"
23#include "CLHEP/Alist/ConstAList.h"
24
25class TPoint2D;
26
27/// A class to represent a line in 2D.
28class TLine2D {
29
30public:
31 /// Constructors
33 TLine2D( double slope, double yOffset );
35
36 /// Destructor
37 virtual ~TLine2D();
38
39public: // Selectors
40 double slope( void ) const;
41 double yOffset( void ) const;
42 double xOffset( void ) const;
43
44public: // Modifiers
45 double slope( double );
46 double yOffset( double );
47
48public: // Fitting
49 int fit( void );
50 double det( void ) const;
51
52public: // Geometry
53 double distance( const TPoint2D& ) const;
54
55public: // Point members
56 void append( const TPoint2D& );
57 void remove( const TPoint2D& );
58 const CAList<TPoint2D>& list( void ) const;
59
60private:
61 double _slope;
62 double _yOffset;
63 double _det;
64 mutable CAList<TPoint2D>* _list;
65};
66
67//-----------------------------------------------------------------------------
68
69#ifdef TLINE2D_NO_INLINE
70# define inline
71#else
72# undef inline
73# define TLINE2D_INLINE_DEFINE_HERE
74#endif
75#ifdef TLINE2D_INLINE_DEFINE_HERE
76
77inline double TLine2D::slope( void ) const { return _slope; }
78
79inline double TLine2D::yOffset( void ) const { return _yOffset; }
80
81inline double TLine2D::xOffset( void ) const { return -_yOffset / _slope; }
82
83inline double TLine2D::slope( double a ) { return _slope = a; }
84
85inline double TLine2D::yOffset( double a ) { return _yOffset = a; }
86
87#endif
88#undef inline
89
90#endif /* TLINE2D_FLAG_ */
TLine2D()
Constructors.
TLine2D(double slope, double yOffset)
double distance(const TPoint2D &) const
virtual ~TLine2D()
Destructor.
const CAList< TPoint2D > & list(void) const
double xOffset(void) const
void append(const TPoint2D &)
double det(void) const
double yOffset(double)
void remove(const TPoint2D &)
TLine2D(const AList< TPoint2D > &)
int fit(void)
double slope(double)