13#include "CLHEP/Geometry/Point3D.h"
14#include "CLHEP/Vector/ThreeVector.h"
16#ifndef ENABLE_BACKWARDS_COMPATIBILITY
19#include "TrkBase/TrkDifPoca.h"
20#include "TrkBase/TrkDifTraj.h"
21#include "TrkBase/TrkPoca.h"
22#include "TrkBase/TrkRep.h"
23#include "TrkFitter/TrkBmSpotOnTrk.h"
24using CLHEP::Hep3Vector;
38 , _beamTraj( hot._beamTraj )
40 , _size( hot._size ) {}
58#ifdef MDCPATREC_WARNING
59 std::cout <<
"ErrMsg(warning) TrkBmSpotOnTrk::updateMeasurement failed" << std::endl;
94 double Mxx = 1.0 / _size.fast( 1, 1 );
95 double Myy = 1.0 / _size.fast( 2, 2 );
100 double vx = trkDir[0];
101 double vy = trkDir[1];
102 double normxy = ( vx * vx + vy * vy );
103 if ( normxy <= 0 )
return 999.9;
104 normxy = sqrt( normxy );
112 double s = vx * vy * ( Mxx - Myy ) / ( vx * vx * Mxx + vy * vy * Myy );
114 double dx = ( -vy +
s * vx );
115 double dy = ( +vx +
s * vy );
117 double chi2 = dx * dx * Mxx + dy * dy * Myy;
119 return chi2 <= 0 ? 0.0 : ( 1.0 / sqrt( chi2 ) );
137 const HepSymMatrix& error ) {
139 HepSymMatrix cover( error.inverse( ifail ) );
143#ifdef MDCPATREC_FATAL
144 std::cout <<
"ErrMsg(fatal) TrkLineTraj: "
145 <<
"Error inverting beamspot error matrix" << std::endl;
148 double dx = -cover.fast( 3, 1 ) / cover.fast( 1, 1 );
149 double dy = -cover.fast( 3, 2 ) / cover.fast( 2, 2 );
HepGeom::Point3D< double > HepPoint3D
static HepPoint3D dum2(0, 0, 1)
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)
TrkErrCode updatePoca(const TrkDifTraj *trkTraj, bool maintainAmbiguity)
void setHitRms(double newRms)
TrkHitOnTrk(const TrkFundHit *, double tolerance)
const TrkRep * getParentRep() const
friend class TrkBase::Functors::updateMeasurement
const TrkDifTraj * trkTraj() const