28#include "MdcGeom/MdcSagTraj.h"
43#include "MdcGeom/Trajectory.h"
57 :
TrkGeomTraj( 0.0, start.distance( stop ) ), _sag(
sag ), _start( start ), _stop( stop ) {
59 _direction = ( (CLHEP::Hep3Vector)stop ) - ( (CLHEP::Hep3Vector)start );
60 _length = _direction.mag();
61 assert( _length != 0 );
63 _direction.setMag( 1.0 );
64 _a = _sag * 4. / ( _length * _length );
69 :
TrkGeomTraj( 0.0, other._start.distance( other._stop ) )
73 , _length( other._length )
74 , _start( other._start )
75 , _stop( other._stop )
76 , _direction( other._direction ) {}
91 for (
int iend = 0; iend < 2; iend++ )
flightrange[iend] = other.flightrange[iend];
92 _start = other._start;
97 _length = other._length;
98 _direction = other._direction;
103Hep3Vector MdcSagTraj::deviation(
double flightlen )
const {
108 return Hep3Vector( 0., ( _a * flightlen + _b ) * flightlen, 0. );
116 tmppos.setY( tmppos.y() + ( _a * flightlen + _b ) * flightlen );
121 if ( flightlen <= 0. )
return _direction;
123 static Hep3Vector tmpdir;
124 tmpdir = _direction * flightlen;
127 tmpdir.setY( tmpdir.y() + 2. * _a * flightlen + _b );
129 tmpdir.setMag( 1.0 );
134 return Hep3Vector( 0., 2. * _a, 0. );
145 if ( flightlen > 0. )
147 pos.setY( pos.y() +
deltaY( flightlen ) );
148 dir.setY( dir.y() + 2. * _a * flightlen + _b );
154 Hep3Vector& delDir )
const {
161 pos.setY( pos.y() + ( _a * flightlen + _b ) * flightlen );
164 dir.setY( dir.y() + 2 * _a * flightlen + _b );
168 delDir.setY( 2. * _a );
175 double dtmp = pathDir * 2. * _a * flightlen + _b;
177 return dtmp == 0. ? 9999.e4 : fabs( tol / dtmp );
187 std::cout <<
"ErrMsg(error)"
188 <<
"accept visitor NOT implemented yet" << std::endl;
HepGeom::Point3D< double > HepPoint3D
HepPoint3D position(double) const
double curvature(double f=0.) const
MdcSagTraj & operator=(const MdcSagTraj &)
MdcSagTraj * clone() const
Hep3Vector delDirect(double) const
void getInfo(double fltLen, HepPoint3D &, Hep3Vector &direction) const
virtual double distTo2ndError(double s, double tol, int pathDir) const
virtual double distTo1stError(double s, double tol, int pathDir) const
MdcSagTraj(const double sag, const HepPoint3D &point1, const HepPoint3D &point2)
double deltaY(double fltLen) const
Hep3Vector direction(double) const
void accept(TrkGeomTrajVisitor &visitor) const
TrkGeomTraj(double lowlim, double hilim)