14#include "CLHEP/Vector/ThreeVector.h"
15#include "CLHEP/Geometry/Point3D.h"
16#ifndef ENABLE_BACKWARDS_COMPATIBILITY
24using CLHEP::Hep3Vector;
30 _beamTraj(FindBeamTrajectory(ip,size)),
38 _beamTraj(hot._beamTraj),
63#ifdef MDCPATREC_WARNING
64 std::cout<<
"ErrMsg(warning) TrkBmSpotOnTrk::updateMeasurement failed" << std::endl;
113 double Mxx = 1.0/_size.fast(1,1);
114 double Myy = 1.0/_size.fast(2,2);
119 double vx = trkDir[0];
120 double vy = trkDir[1];
121 double normxy = (vx*vx + vy*vy);
122 if (normxy <= 0)
return 999.9;
123 normxy = sqrt(normxy);
131 double s = vx*vy*(Mxx-Myy)/(vx*vx*Mxx + vy*vy*Myy);
133 double dx = (-vy +
s*vx);
134 double dy = (+vx +
s*vy);
136 double chi2 = dx*dx*Mxx + dy*dy*Myy;
138 return chi2 <= 0 ? 0.0 : (1.0/sqrt(chi2));
157 const HepSymMatrix &error )
160 HepSymMatrix cover(error.inverse(ifail));
163#ifdef MDCPATREC_FATAL
164 std::cout<<
"ErrMsg(fatal) TrkLineTraj: "
165 <<
"Error inverting beamspot error matrix" << std::endl;
168 double dx = -cover.fast(3,1)/cover.fast(1,1);
169 double dy = -cover.fast(3,2)/cover.fast(2,2);
171 HepPoint3D p1 = point + Hep3Vector(-dx,-dy,-1);
HepGeom::Point3D< double > HepPoint3D
static HepPoint3D dum2(0, 0, 1)
virtual Hep3Vector direction(double) const =0
virtual const TrkDifTraj & traj() const =0
TrkBmSpotOnTrk * clone(TrkRep *, const TrkDifTraj *t=0) const
const HepPoint3D & ip() const
static const TrkLineTraj FindBeamTrajectory(const HepPoint3D &point, const HepSymMatrix &error)
virtual TrkEnums::TrkViewInfo whatView() const
const Trajectory * hitTraj() const
TrkBmSpotOnTrk(const HepPoint3D &ip, const HepSymMatrix &size)
void setHitResid(double newResid)
friend class TrkBase::Functors::updateMeasurement
TrkErrCode updatePoca(const TrkDifTraj *trkTraj, bool maintainAmbiguity)
void setHitRms(double newRms)
const TrkRep * getParentRep() const
const TrkDifTraj * trkTraj() const