CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkLineTraj.cxx
Go to the documentation of this file.
1// ----------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkLineTraj.cxx,v 1.3 2006/03/28 01:02:36 zhangy Exp $
4//
5// Description:
6// Single line segment trajectory class
7//
8// Copyright Information:
9// Copyright (C) 1996 Lawrence Berkeley Laboratory
10//
11// Authors: Dave Brown, 11/15/96
12//-----------------------------------------------------------------------------
13#include "CLHEP/Matrix/Matrix.h"
14#include "TrkBase/TrkLineTraj.h"
15#include "MdcGeom/TrkGeomTrajVisitor.h"
16
17TrkLineTraj::TrkLineTraj(const HepPoint3D& point, const Hep3Vector& direction,
18 double length) :
19 TrkGeomTraj(0.0,length) , _start(point),
20 _direction(direction)
21{
22 _direction.setMag(1.0);
23}
24
26(const HepPoint3D& point,
27 const Hep3Vector& direction,
28 double lorange,
29 double hirange):
30 TrkGeomTraj(lorange,hirange),
31 _start(point),
32 _direction(direction)
33{
34 _direction.setMag(1.0);
35}
36
37
38
39TrkLineTraj::TrkLineTraj(const HepPoint3D& point1, const HepPoint3D& point2)
40 : TrkGeomTraj(0.0,point1.distance2(point2)), _start(point1)
41{
42 //_direction = point2 - point1;
43 _direction = ((CLHEP::Hep3Vector) point2) - ((CLHEP::Hep3Vector) point1);
44 _direction.setMag(1.0);
45}
46
48 TrkGeomTraj(other.lowRange(),other.hiRange()), _start(other._start),
49 _direction(other._direction)
50{
51}
52
54{
55}
56
58{
59 if(&other != this){
61 _start = other._start;
62 _direction = other._direction;
63 }
64 return *this;
65}
66
69{
70 return new TrkLineTraj(*this);
71}
72
74TrkLineTraj::position(double flightlen) const
75{
76 return _start + _direction*flightlen;
77}
78
79Hep3Vector
81{
82 return _direction;
83}
84
85Hep3Vector
87{
88 return Hep3Vector(0.,0.,0.);
89}
90
91double
92TrkLineTraj::distTo1stError(double , double, int ) const
93{
94 return 999.e4;
95}
96
97double
98TrkLineTraj::distTo2ndError(double, double, int ) const
99{
100 return 999.e4;
101}
102
103double
105{
106 return 0.0;
107}
108
109void
110TrkLineTraj::getInfo(double fltLen, HepPoint3D& pos, Hep3Vector& dir) const
111{
112 pos = position(fltLen);
113 dir = direction(fltLen);
114}
115
116void
117TrkLineTraj::getInfo(double fltLen, HepPoint3D& pos, Hep3Vector& dir,
118 Hep3Vector& delDir) const
119{
120 pos = position(fltLen);
121 dir = direction(fltLen);
122 delDir = delDirect(fltLen);
123}
124
125void
127{
128 visitor.visitLine(this);
129}
Trajectory & operator=(const Trajectory &)
Definition: Trajectory.cxx:86
virtual void visitLine(const TrkLineTraj *)=0
TrkLineTraj(const HepPoint3D &point, const Hep3Vector &direction, double length)
Definition: TrkLineTraj.cxx:17
Hep3Vector direction(double) const
Definition: TrkLineTraj.cxx:80
TrkLineTraj * clone() const
Definition: TrkLineTraj.cxx:68
void accept(TrkGeomTrajVisitor &visitor) const
void getInfo(double fltLen, HepPoint3D &, Hep3Vector &direction) const
virtual double distTo1stError(double s, double tol, int pathDir) const
Definition: TrkLineTraj.cxx:92
virtual double distTo2ndError(double s, double tol, int pathDir) const
Definition: TrkLineTraj.cxx:98
TrkLineTraj & operator=(const TrkLineTraj &)
Definition: TrkLineTraj.cxx:57
Hep3Vector delDirect(double) const
Definition: TrkLineTraj.cxx:86
double curvature(double f=0.) const
HepPoint3D position(double) const
Definition: TrkLineTraj.cxx:74