CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/TrackingTools/TrajectoryState/src/TrajectoryStateClosestToBeamLine.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateClosestToBeamLine.h"
00002 
00003 
00004 Measurement1D TrajectoryStateClosestToBeamLine::transverseImpactParameter() const
00005 {
00006   AlgebraicSymMatrix33 error = theBeamSpot.rotatedCovariance3D() +
00007         theFTS.cartesianError().matrix().Sub<AlgebraicSymMatrix33>(0,0);
00008 
00009   GlobalPoint impactPoint=theFTS.position();
00010   AlgebraicVector3 transverseFlightPath(
00011         impactPoint.x()-thePointOnBeamLine.x(),impactPoint.y()-thePointOnBeamLine.y(),0.);
00012   double length = ROOT::Math::Mag(transverseFlightPath);
00013   // Warning: after the transverseFlightPath.Unit() statement, the
00014   // transverseFlightPath vector is CHANGED to a UNIT vector.
00015   double ipError = sqrt( ROOT::Math::Similarity(transverseFlightPath.Unit(),error) );
00016   return Measurement1D (length, ipError);
00017 }
00018