BOSS 8.0.0
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 "TrkBase/TrkLineTraj.h"
14#include "CLHEP/Matrix/Matrix.h"
15#include "MdcGeom/TrkGeomTrajVisitor.h"
16
17TrkLineTraj::TrkLineTraj( const HepPoint3D& point, const Hep3Vector& direction, double length )
18 : TrkGeomTraj( 0.0, length ), _start( point ), _direction( direction ) {
19 _direction.setMag( 1.0 );
20}
21
22TrkLineTraj::TrkLineTraj( const HepPoint3D& point, const Hep3Vector& direction, double lorange,
23 double hirange )
24 : TrkGeomTraj( lorange, hirange ), _start( point ), _direction( direction ) {
25 _direction.setMag( 1.0 );
26}
27
28TrkLineTraj::TrkLineTraj( const HepPoint3D& point1, const HepPoint3D& point2 )
29 : TrkGeomTraj( 0.0, point1.distance2( point2 ) ), _start( point1 ) {
30 //_direction = point2 - point1;
31 _direction = ( (CLHEP::Hep3Vector)point2 ) - ( (CLHEP::Hep3Vector)point1 );
32 _direction.setMag( 1.0 );
33}
34
36 : TrkGeomTraj( other.lowRange(), other.hiRange() )
37 , _start( other._start )
38 , _direction( other._direction ) {}
39
41
43 if ( &other != this )
44 {
45 Trajectory::operator=( other );
46 _start = other._start;
47 _direction = other._direction;
48 }
49 return *this;
50}
51
52TrkLineTraj* TrkLineTraj::clone() const { return new TrkLineTraj( *this ); }
53
54HepPoint3D TrkLineTraj::position( double flightlen ) const {
55 return _start + _direction * flightlen;
56}
57
58Hep3Vector TrkLineTraj::direction( double ) const { return _direction; }
59
60Hep3Vector TrkLineTraj::delDirect( double ) const { return Hep3Vector( 0., 0., 0. ); }
61
62double TrkLineTraj::distTo1stError( double, double, int ) const { return 999.e4; }
63
64double TrkLineTraj::distTo2ndError( double, double, int ) const { return 999.e4; }
65
66double TrkLineTraj::curvature( double ) const { return 0.0; }
67
68void TrkLineTraj::getInfo( double fltLen, HepPoint3D& pos, Hep3Vector& dir ) const {
69 pos = position( fltLen );
70 dir = direction( fltLen );
71}
72
73void TrkLineTraj::getInfo( double fltLen, HepPoint3D& pos, Hep3Vector& dir,
74 Hep3Vector& delDir ) const {
75 pos = position( fltLen );
76 dir = direction( fltLen );
77 delDir = delDirect( fltLen );
78}
79
80void TrkLineTraj::accept( TrkGeomTrajVisitor& visitor ) const { visitor.visitLine( this ); }
HepGeom::Point3D< double > HepPoint3D
Trajectory & operator=(const Trajectory &)
virtual void visitLine(const TrkLineTraj *)=0
TrkGeomTraj(double lowlim, double hilim)
TrkLineTraj(const HepPoint3D &point, const Hep3Vector &direction, double length)
Hep3Vector direction(double) const
TrkLineTraj * clone() const
void accept(TrkGeomTrajVisitor &visitor) const
void getInfo(double fltLen, HepPoint3D &, Hep3Vector &direction) const
virtual double distTo1stError(double s, double tol, int pathDir) const
virtual double distTo2ndError(double s, double tol, int pathDir) const
TrkLineTraj & operator=(const TrkLineTraj &)
Hep3Vector delDirect(double) const
double curvature(double f=0.) const
HepPoint3D position(double) const