BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/TrkReco/include/TrkReco/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 : inami@bmail.kek.jp
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
31typedef HepGeom::Point3D<double> HepPoint3D;
32# endif
33# ifndef CLHEP_VECTOR3D_H
34# include "CLHEP/Geometry/Vector3D.h"
35# endif
36# ifndef ENABLE_BACKWARDS_COMPATIBILITY
37typedef HepGeom::Vector3D<double> HepVector3D;
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
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
95public: // Utilities
96 /// returns position on 3D line
97 HepPoint3D x( double ) const;
98
99 /// returns 3D line component x(t)=x0 + t * k
100 HepPoint3D x0( void ) const;
101 // zsl Vector3 k(void) const;
102 HepVector3D k( void ) const;
103
104 /// calculates the closest approach to a wire in real space. Results are stored in TMLink.
105 /// 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&, HepPoint3D& onLine,
110 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 { return Line3D; }
151
152#endif /* T3DLine_FLAG_ */
HepGeom::Vector3D< double > HepVector3D
HepGeom::Point3D< double > HepPoint3D
HepGeom::Point3D< double > HepPoint3D
HepGeom::Vector3D< double > HepVector3D
A class to fit a TTrackBase object to a 3D line.
A class to represent a track in tracking.
void set(const HepPoint3D &, double t_dr, double t_phi0, double t_dz, double t_tanl)
set track parameters,pivot
double sinPhi0(void) const
HepPoint3D x(double) const
returns position on 3D line
const HepPoint3D & pivot(const HepPoint3D &)
set new pivot
double cosPhi0(void) const
double dr(void) const
Track parameters.
unsigned objectType(void) const
returns object type
double phi0(void) const
T3DLine(const T3DLine &)
double reducedchi2(void) const
returns reduced-chi2
int approach_point(const HepPoint3D &, HepPoint3D &onTrack) const
caluculate closest point between a point and this track
HepPoint3D x0(void) const
returns 3D line component x(t)=x0 + t * k
Helix helix(void) const
approximated helix class
int approach(TMLink &, bool sagCorrection=true) const
T3DLine(const TTrack &)
double tanl(void) const
double dz(void) const
double chi2(void) const
returns chi2.
int approach_line(const HepPoint3D &, const HepVector3D &, HepPoint3D &onLine, HepPoint3D &onTrack) const
caluculate closest points between a line and this track
HepVector3D k(void) const
const HepPoint3D & pivot(void) const
pivot position
const SymMatrix & Ea(void) const
returns error matrix
unsigned ndf(void) const
returns NDF
Vector a(const Vector &)
set track parameters
Vector a(void) const
T3DLine()
Constructors.
const SymMatrix & Ea(const SymMatrix &)
set error matrix
virtual ~T3DLine()
Destructor.
A virtual class for a track class in tracking.
A class to represent a track in tracking.