00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef TLine0_FLAG_
00014 #define TLine0_FLAG_
00015
00016 #ifdef TRKRECO_DEBUG_DETAIL
00017 #ifndef TRKRECO_DEBUG
00018 #define TRKRECO_DEBUG
00019 #endif
00020 #endif
00021
00022 #include <string>
00023
00024 #define HEP_SHORT_NAMES
00025 #include "TrkReco/TTrackBase.h"
00026 #include "TrkReco/TMLink.h"
00027 #include "TrkReco/TLineFitter.h"
00028
00030 class TLine0 : public TTrackBase {
00031
00032 public:
00034 TLine0();
00035
00037 TLine0(const AList<TMLink> &);
00038
00040 virtual ~TLine0();
00041
00042 public:
00044 virtual unsigned objectType(void) const;
00045
00047 void dump(const std::string & message = std::string(""),
00048 const std::string & prefix = std::string("")) const;
00049
00051 double a(void) const;
00052
00054 double b(void) const;
00055
00057 double chi2(void) const;
00058
00060 double reducedChi2(void) const;
00061
00062 public:
00064 double distance(const TMLink &) const;
00065
00066 public:
00068
00069
00071 int fit2();
00072
00074 int fit2s();
00075
00077 int fit2p();
00078
00080 int fit2sp();
00081
00083 void removeChits();
00084
00086 void refine(AList<TMLink> & list, float maxSigma);
00087
00089 void removeSLY(AList<TMLink> & list);
00090
00092 void appendSLY(AList<TMLink> & list);
00093
00095 void appendByszdistance(AList<TMLink> & list, unsigned isl, float maxSigma);
00096
00098 void property(double a, double b, double det);
00099
00100 private:
00101 mutable bool _fittedUpdated;
00102
00103 private:
00104 double _a;
00105 double _b;
00106 double _det;
00107 static const TLineFitter _fitter;
00108
00109 private:
00110 mutable double _chi2;
00111 mutable double _reducedChi2;
00112 };
00113
00114
00115
00116 #ifdef TLine0_NO_INLINE
00117 #define inline
00118 #else
00119 #undef inline
00120 #define TLine0_INLINE_DEFINE_HERE
00121 #endif
00122
00123 #ifdef TLine0_INLINE_DEFINE_HERE
00124
00125 inline
00126 double
00127 TLine0::a(void) const {
00128 #ifdef TRKRECO_DEBUG
00129 if (! _fitted) std::cout << "TLine0::a !!! fit not performed" << std::endl;
00130 #endif
00131 return _a;
00132 }
00133
00134 inline
00135 double
00136 TLine0::b(void) const {
00137 #ifdef TRKRECO_DEBUG
00138 if (! _fitted) std::cout << "TLine0::b !!! fit not performed" << std::endl;
00139 #endif
00140 return _b;
00141 }
00142
00143 inline
00144 double
00145 TLine0::distance(const TMLink & l) const {
00146 #ifdef TRKRECO_DEBUG
00147 if (! _fitted) std::cout << "TLine0::distance !!! fit not performed" << std::endl;
00148 #endif
00149 double dy = fabs(_a * l.position().x() + _b - l.position().y());
00150 double invCos = sqrt(1. + _a * _a);
00151 return dy / invCos;
00152 }
00153
00154 inline
00155 void
00156 TLine0::property(double a, double b, double det) {
00157 _a = a;
00158 _b = b;
00159 _det = det;
00160 }
00161
00162 inline
00163 unsigned
00164 TLine0::objectType(void) const {
00165 return Line;
00166 }
00167
00168 #endif
00169
00170 #undef inline
00171
00172 #endif