BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/TrkReco/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 : [email protected]
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/TTrackBase.h"
26#include "TrkReco/TMLink.h"
27#include "TrkReco/TLineFitter.h"
28
29/// A class to represent a track in tracking.
30class TLine0 : public TTrackBase {
31
32 public:
33 /// Constructor.
34 TLine0();
35
36 /// Constructor.
37 TLine0(const AList<TMLink> &);
38
39 /// Destructor
40 virtual ~TLine0();
41
42 public:// 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
62 public:// Utilities
63 /// returns distance to a position of TMLink itself. (not to a wire)
64 double distance(const TMLink &) const;
65
66 public:// 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 zero.
74 int fit2s();
75
76 /// fits itself using isolated hits. Error was happened if return value is not zero.
77 int fit2p();
78
79 /// fits itself using single hits in a wire-layer. Error was happened if return value is not zero.
80 int fit2sp();
81
82 /// remove extremly bad points.
83 void removeChits();
84
85 /// remove bad points by chi2. Bad points are returned in a 'list'. fit() should be called before calling this function.
86 void refine(AList<TMLink> & list, float maxSigma);
87
88 ///
89 void removeSLY(AList<TMLink> & list);
90
91 ///
92 void appendSLY(AList<TMLink> & list);
93
94 ///
95 void appendByszdistance(AList<TMLink> & list, unsigned isl, float maxSigma);
96
97 /// sets circle properties.
98 void property(double a, double b, double det);
99
100 private:// Always updated
101 mutable bool _fittedUpdated;
102
103 private:// Updated when fitted
104 double _a;
105 double _b;
106 double _det;
107 static const TLineFitter _fitter;
108
109 private:// Updated when fitted and accessed
110 mutable double _chi2;
111 mutable double _reducedChi2;
112};
113
114//-----------------------------------------------------------------------------
115
116#ifdef TLine0_NO_INLINE
117#define inline
118#else
119#undef inline
120#define TLine0_INLINE_DEFINE_HERE
121#endif
122
123#ifdef TLine0_INLINE_DEFINE_HERE
124
125inline
126double
127TLine0::a(void) const {
128#ifdef TRKRECO_DEBUG
129 if (! _fitted) std::cout << "TLine0::a !!! fit not performed" << std::endl;
130#endif
131 return _a;
132}
133
134inline
135double
136TLine0::b(void) const {
137#ifdef TRKRECO_DEBUG
138 if (! _fitted) std::cout << "TLine0::b !!! fit not performed" << std::endl;
139#endif
140 return _b;
141}
142
143inline
144double
145TLine0::distance(const TMLink & l) const {
146#ifdef TRKRECO_DEBUG
147 if (! _fitted) std::cout << "TLine0::distance !!! fit not performed" << std::endl;
148#endif
149 double dy = fabs(_a * l.position().x() + _b - l.position().y());
150 double invCos = sqrt(1. + _a * _a);
151 return dy / invCos;
152}
153
154inline
155void
156TLine0::property(double a, double b, double det) {
157 _a = a;
158 _b = b;
159 _det = det;
160}
161
162inline
163unsigned
165 return Line;
166}
167
168#endif
169
170#undef inline
171
172#endif /* TLine0_FLAG_ */
A class to represent a track in tracking.
void appendSLY(AList< TMLink > &list)
Definition: TLine0.cxx:558
int fit2sp()
fits itself using single hits in a wire-layer. Error was happened if return value is not zero.
Definition: TLine0.cxx:323
double chi2(void) const
returns chi2.
Definition: TLine0.cxx:113
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)
Definition: TLine0.cxx:565
double b(void) const
returns coefficient b.
void property(double a, double b, double det)
sets circle properties.
double reducedChi2(void) const
returns reduced-chi2.
Definition: TLine0.cxx:604
int fit2()
fits itself. Error was happened if return value is not zero.
Definition: TLine0.cxx:173
virtual ~TLine0()
Destructor.
Definition: TLine0.cxx:49
void removeChits()
remove extremly bad points.
Definition: TLine0.cxx:508
void removeSLY(AList< TMLink > &list)
Definition: TLine0.cxx:551
int fit2p()
fits itself using isolated hits. Error was happened if return value is not zero.
Definition: TLine0.cxx:401
virtual unsigned objectType(void) const
returns type.
void refine(AList< TMLink > &list, float maxSigma)
remove bad points by chi2. Bad points are returned in a 'list'. fit() should be called before calling...
Definition: TLine0.cxx:134
int fit2s()
fits itself using single hits in a wire-layer. Error was happened if return value is not zero.
Definition: TLine0.cxx:263
TLine0()
Constructor.
Definition: TLine0.cxx:23
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.
Definition: TLine0.cxx:53
A class to fit a TTrackBase object to a line.
A virtual class for a track class in tracking.