BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
T3DLine.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: T3DLine.h,v 1.11 2010/03/31 09:58:59 liucy Exp $
3//-----------------------------------------------------------------------------
4// Filename : T3DLine.h
5// Section : Tracking
6// Owner : Kenji Inami
7// Email : [email protected]
8//-----------------------------------------------------------------------------
9// Description : A class to represent a 3D line in tracking
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#ifdef TRKRECO_DEBUG_DETAIL
14#ifndef TRKRECO_DEBUG
15#define TRKRECO_DEBUG
16#endif
17#endif
18#ifndef T3DLine_FLAG_
19#define T3DLine_FLAG_
20
21#define Line3D 32
22// This must be writen in TTrackBase.h
23
24#include <string>
25
26#define HEP_SHORT_NAMES
27#ifndef CLHEP_POINT3D_H
28#include "CLHEP/Geometry/Point3D.h"
29#endif
30#ifndef ENABLE_BACKWARDS_COMPATIBILITY
32#endif
33#ifndef CLHEP_VECTOR3D_H
34#include "CLHEP/Geometry/Vector3D.h"
35#endif
36#ifndef ENABLE_BACKWARDS_COMPATIBILITY
38#endif
39
40//#include "helix/Helix.h"
41#include "TrackUtil/Helix.h"
42//#include "TrkReco/Helix.h"
43#include "TrkReco/TTrackBase.h"
44
45class T3DLineFitter;
46class TTrack;
47class TMLink;
48
49/// A class to represent a track in tracking.
50class T3DLine : public TTrackBase {
51
52public:
53 /// Constructors
54 T3DLine();
55 T3DLine(const TTrack&);
56 T3DLine(const T3DLine&);
57
58 /// Destructor
59 virtual ~T3DLine();
60
61public:// Extractors
62 /// Track parameters
63 double dr(void) const;
64 double phi0(void) const;
65 double dz(void) const;
66 double tanl(void) const;
67
68 double cosPhi0(void) const;
69 double sinPhi0(void) const;
70
71 Vector a(void) const; //dr,phi0,dz,tanl
72
73 /// returns error matrix
74 const SymMatrix& Ea(void) const;
75
76 /// pivot position
77 const HepPoint3D & pivot(void) const;
78
79 /// approximated helix class
80 Helix helix(void) const;
81
82 /// returns NDF
83 unsigned ndf(void) const;
84
85 /// returns chi2.
86 double chi2(void) const;
87
88 /// returns reduced-chi2
89 double reducedchi2(void) const;
90
91 /// returns object type
92 unsigned objectType(void) const;
93
94public:// Executors
95
96public:// Utilities
97 /// returns position on 3D line
98 HepPoint3D x(double) const;
99
100 /// returns 3D line component x(t)=x0 + t * k
101 HepPoint3D x0(void) const;
102//zsl Vector3 k(void) const;
103 HepVector3D k(void) const;
104
105 /// calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.
106 int approach(TMLink &, bool sagCorrection = true) const;
107
108 /// caluculate closest points between a line and this track
109 int approach_line(const HepPoint3D&,const HepVector3D&,
110 HepPoint3D& onLine,HepPoint3D& onTrack) const;
111
112 /// caluculate closest point between a point and this track
113 int approach_point(const HepPoint3D&,HepPoint3D& onTrack) const;
114
115public:// Modifiers
116 /// set new pivot
117 const HepPoint3D & pivot(const HepPoint3D&);
118
119 /// set track parameters,pivot
120 void set(const HepPoint3D&,double t_dr,double t_phi0,double t_dz,double t_tanl);
121
122 /// set track parameters
123 Vector a(const Vector&);
124
125 /// set error matrix
126 const SymMatrix& Ea(const SymMatrix&);
127
128private:
129 HepPoint3D _pivot;
130 // Updated when fitted
131 double _dr;
132 double _phi0;
133 double _dz;
134 double _tanl;
135
136 SymMatrix _Ea;
137
138 double _chi2;
139 unsigned _ndf;
140
141 //Cashe
142 double _cos_phi0;
143 double _sin_phi0;
144
145 static const T3DLineFitter _fitter;
146
147 friend class T3DLineFitter;
148};
149
150inline unsigned T3DLine::objectType(void) const{
151 return Line3D;
152}
153
154#endif /* T3DLine_FLAG_ */
HepGeom::Point3D< double > HepPoint3D
Definition: T3DLine.h:31
HepGeom::Vector3D< double > HepVector3D
Definition: T3DLine.h:37
#define Line3D
Definition: T3DLine.h:21
A class to fit a TTrackBase object to a 3D line.
Definition: T3DLineFitter.h:41
A class to represent a track in tracking.
Definition: T3DLine.h:50
void set(const HepPoint3D &, double t_dr, double t_phi0, double t_dz, double t_tanl)
set track parameters,pivot
Definition: T3DLine.cxx:175
double sinPhi0(void) const
Definition: T3DLine.cxx:99
HepPoint3D x(double) const
returns position on 3D line
Definition: T3DLine.cxx:143
double cosPhi0(void) const
Definition: T3DLine.cxx:95
double dr(void) const
Track parameters.
Definition: T3DLine.cxx:79
unsigned objectType(void) const
returns object type
Definition: T3DLine.h:150
double phi0(void) const
Definition: T3DLine.cxx:83
double reducedchi2(void) const
returns reduced-chi2
Definition: T3DLine.cxx:135
int approach_point(const HepPoint3D &, HepPoint3D &onTrack) const
caluculate closest point between a point and this track
Definition: T3DLine.cxx:266
HepPoint3D x0(void) const
returns 3D line component x(t)=x0 + t * k
Definition: T3DLine.cxx:151
Helix helix(void) const
approximated helix class
Definition: T3DLine.cxx:120
int approach(TMLink &, bool sagCorrection=true) const
calculates the closest approach to a wire in real space. Results are stored in TMLink....
Definition: T3DLine.cxx:202
double tanl(void) const
Definition: T3DLine.cxx:91
double dz(void) const
Definition: T3DLine.cxx:87
double chi2(void) const
returns chi2.
Definition: T3DLine.cxx:131
int approach_line(const HepPoint3D &, const HepVector3D &, HepPoint3D &onLine, HepPoint3D &onTrack) const
caluculate closest points between a line and this track
Definition: T3DLine.cxx:243
HepVector3D k(void) const
Definition: T3DLine.cxx:158
const HepPoint3D & pivot(void) const
pivot position
Definition: T3DLine.cxx:103
const SymMatrix & Ea(void) const
returns error matrix
Definition: T3DLine.cxx:116
unsigned ndf(void) const
returns NDF
Definition: T3DLine.cxx:127
virtual ~T3DLine()
Destructor.
Definition: T3DLine.cxx:56
Vector a(void) const
Definition: T3DLine.cxx:107
T3DLine()
Constructors.
Definition: T3DLine.cxx:21
A virtual class for a track class in tracking.
Definition: TTrackBase.h:46
A class to represent a track in tracking.
Definition: TTrack.h:129