BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/TrkReco/include/TrkReco/TLine0.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TLine0.h,v 1.5 2010/03/31 09:58:59 liucy Exp $
3//-----------------------------------------------------------------------------
4// Filename : TLine0.h
5// Section : Tracking
6// Owner : Yoshi Iwasaki
7// Email : yoshihito.iwasaki@kek.jp
8//-----------------------------------------------------------------------------
9// Description : A class to represent a line in tracking.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifndef TLine0_FLAG_
14#define TLine0_FLAG_
15
16#ifdef TRKRECO_DEBUG_DETAIL
17# ifndef TRKRECO_DEBUG
18# define TRKRECO_DEBUG
19# endif
20#endif
21
22#include <string>
23
24// #define HEP_SHORT_NAMES
25#include "TrkReco/TLineFitter.h"
26#include "TrkReco/TMLink.h"
27#include "TrkReco/TTrackBase.h"
28
29/// A class to represent a track in tracking.
30class TLine0 : public TTrackBase {
31
32public:
33 /// Constructor.
35
36 /// Constructor.
38
39 /// Destructor
40 virtual ~TLine0();
41
42public: // Selectors
43 /// returns type.
44 virtual unsigned objectType( void ) const;
45
46 /// dumps debug information.
47 void dump( const std::string& message = std::string( "" ),
48 const std::string& prefix = std::string( "" ) ) const;
49
50 /// returns coefficient a.
51 double a( void ) const;
52
53 /// returns coefficient b.
54 double b( void ) const;
55
56 /// returns chi2.
57 double chi2( void ) const;
58
59 /// returns reduced-chi2.
60 double reducedChi2( void ) const;
61
62public: // Utilities
63 /// returns distance to a position of TMLink itself. (not to a wire)
64 double distance( const TMLink& ) const;
65
66public: // Modifiers
67 /// fits itself. Error was happened if return value is not zero.
68 // int fitx(void);
69
70 /// fits itself using isolated hits. Error was happened if return value is not zero.
71 int fit2();
72
73 /// fits itself using single hits in a wire-layer. Error was happened if return value is not
74 /// zero.
75 int fit2s();
76
77 /// fits itself using isolated hits. Error was happened if return value is not zero.
78 int fit2p();
79
80 /// fits itself using single hits in a wire-layer. Error was happened if return value is not
81 /// zero.
82 int fit2sp();
83
84 /// remove extremly bad points.
86
87 /// remove bad points by chi2. Bad points are returned in a 'list'. fit() should be called
88 /// before calling this function.
89 void refine( AList<TMLink>& list, float maxSigma );
90
91 ///
92 void removeSLY( AList<TMLink>& list );
93
94 ///
95 void appendSLY( AList<TMLink>& list );
96
97 ///
98 void appendByszdistance( AList<TMLink>& list, unsigned isl, float maxSigma );
99
100 /// sets circle properties.
101 void property( double a, double b, double det );
102
103private: // Always updated
104 mutable bool _fittedUpdated;
105
106private: // Updated when fitted
107 double _a;
108 double _b;
109 double _det;
110 static const TLineFitter _fitter;
111
112private: // Updated when fitted and accessed
113 mutable double _chi2;
114 mutable double _reducedChi2;
115};
116
117//-----------------------------------------------------------------------------
118
119#ifdef TLine0_NO_INLINE
120# define inline
121#else
122# undef inline
123# define TLine0_INLINE_DEFINE_HERE
124#endif
125
126#ifdef TLine0_INLINE_DEFINE_HERE
127
128inline double TLine0::a( void ) const {
129# ifdef TRKRECO_DEBUG
130 if ( !_fitted ) std::cout << "TLine0::a !!! fit not performed" << std::endl;
131# endif
132 return _a;
133}
134
135inline double TLine0::b( void ) const {
136# ifdef TRKRECO_DEBUG
137 if ( !_fitted ) std::cout << "TLine0::b !!! fit not performed" << std::endl;
138# endif
139 return _b;
140}
141
142inline double TLine0::distance( const TMLink& l ) const {
143# ifdef TRKRECO_DEBUG
144 if ( !_fitted ) std::cout << "TLine0::distance !!! fit not performed" << std::endl;
145# endif
146 double dy = fabs( _a * l.position().x() + _b - l.position().y() );
147 double invCos = sqrt( 1. + _a * _a );
148 return dy / invCos;
149}
150
151inline void TLine0::property( double a, double b, double det ) {
152 _a = a;
153 _b = b;
154 _det = det;
155}
156
157inline unsigned TLine0::objectType( void ) const { return Line; }
158
159#endif
160
161#undef inline
162
163#endif /* TLine0_FLAG_ */
A class to represent a track in tracking.
void appendSLY(AList< TMLink > &list)
int fit2sp()
double chi2(void) const
returns chi2.
double distance(const TMLink &) const
returns distance to a position of TMLink itself. (not to a wire)
void appendByszdistance(AList< TMLink > &list, unsigned isl, float maxSigma)
double b(void) const
returns coefficient b.
virtual ~TLine0()
Destructor.
void property(double a, double b, double det)
sets circle properties.
double reducedChi2(void) const
returns reduced-chi2.
int fit2()
fits itself. Error was happened if return value is not zero.
void removeChits()
remove extremly bad points.
void removeSLY(AList< TMLink > &list)
TLine0(const AList< TMLink > &)
Constructor.
int fit2p()
fits itself using isolated hits. Error was happened if return value is not zero.
virtual unsigned objectType(void) const
returns type.
void refine(AList< TMLink > &list, float maxSigma)
int fit2s()
virtual unsigned objectType(void) const
returns type.
TLine0()
Constructor.
double a(void) const
returns coefficient a.
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
A class to fit a TTrackBase object to a line.
A virtual class for a track class in tracking.