/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/TrkReco/TrkReco-00-08-59-patch4-slc6tag/TrkReco/TLine2D.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // $Id: TLine2D.h,v 1.5 2010/03/31 09:58:59 liucy Exp $
00003 //-----------------------------------------------------------------------------
00004 // Filename : TLine2D.h
00005 // Section  : Tracking
00006 // Owner    : Yoshi Iwasaki
00007 // Email    : yoshihito.iwasaki@kek.jp
00008 //-----------------------------------------------------------------------------
00009 // Description : A class to represent a line in 2D.
00010 //               See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
00011 //-----------------------------------------------------------------------------
00012 
00013 #ifndef TLINE2D_FLAG_
00014 #define TLINE2D_FLAG_
00015 
00016 #ifdef TRKRECO_DEBUG_DETAIL
00017 #ifndef TRKRECO_DEBUG
00018 #define TRKRECO_DEBUG
00019 #endif
00020 #endif
00021 class TPoint2D;
00022 template <class T> class CAList;
00023 
00025 class TLine2D {
00026 
00027   public:
00029     TLine2D();
00030     TLine2D(double slope, double yOffset);
00031     TLine2D(const AList<TPoint2D> &);
00032 
00034     virtual ~TLine2D();
00035 
00036   public:// Selectors
00037     double slope(void) const;
00038     double yOffset(void) const;
00039     double xOffset(void) const;
00040 
00041   public:// Modifiers
00042     double slope(double);
00043     double yOffset(double);
00044 
00045   public:// Fitting
00046     int fit(void);
00047     double det(void) const;
00048 
00049   public:// Geometry
00050     double distance(const TPoint2D &) const;
00051 
00052   public:// Point members
00053     void append(const TPoint2D &);
00054     void remove(const TPoint2D &);
00055     const CAList<TPoint2D> & list(void) const;
00056 
00057   private:
00058     double _slope;
00059     double _yOffset;
00060     double _det;
00061     mutable CAList<TPoint2D> * _list;
00062 };
00063 
00064 //-----------------------------------------------------------------------------
00065 
00066 #ifdef TLINE2D_NO_INLINE
00067 #define inline
00068 #else
00069 #undef inline
00070 #define TLINE2D_INLINE_DEFINE_HERE
00071 #endif
00072 #ifdef TLINE2D_INLINE_DEFINE_HERE
00073 
00074 inline
00075 double
00076 TLine2D::slope(void) const {
00077     return _slope;
00078 }
00079 
00080 inline
00081 double
00082 TLine2D::yOffset(void) const {
00083     return _yOffset;
00084 }
00085 
00086 inline
00087 double
00088 TLine2D::xOffset(void) const {
00089     return - _yOffset / _slope;
00090 }
00091 
00092 inline
00093 double
00094 TLine2D::slope(double a) {
00095     return _slope = a;
00096 }
00097 
00098 inline
00099 double
00100 TLine2D::yOffset(double a) {
00101     return _yOffset = a;
00102 }
00103 
00104 #endif
00105 #undef inline
00106 
00107 #endif /* TLINE2D_FLAG_ */

Generated on Tue Nov 29 23:14:17 2016 for BOSS_7.0.2 by  doxygen 1.4.7