CMS 3D CMS Logo

TrajectoryStateClosestToBeamLine.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateClosestToBeamLine.h"
00002 
00003 TrajectoryStateClosestToBeamLine::TrajectoryStateClosestToBeamLine
00004         (const FreeTrajectoryState& stateAtPCA, const GlobalPoint & pointOnBeamLine,
00005          const reco::BeamSpot& beamSpot) :
00006         theFTS(stateAtPCA) , thePointOnBeamLine(pointOnBeamLine),
00007         theBeamSpot(beamSpot), valid(true)
00008 {}
00009 
00010 Measurement1D TrajectoryStateClosestToBeamLine::transverseImpactParameter() const
00011 {
00012   if (!isValid()) throw TrajectoryStateException(
00013     "TrajectoryStateClosestToBeamLine is invalid.");
00014   AlgebraicSymMatrix33 error = theBeamSpot.covariance3D() +
00015         theFTS.cartesianError().matrix().Sub<AlgebraicSymMatrix33>(0,0);
00016 
00017   GlobalPoint impactPoint=theFTS.position();
00018   AlgebraicVector3 transverseFlightPath(
00019         impactPoint.x()-thePointOnBeamLine.x(),impactPoint.y()-thePointOnBeamLine.y(),0.);
00020   double length = ROOT::Math::Mag(transverseFlightPath);
00021   // Warning: after the transverseFlightPath.Unit() statement, the
00022   // transverseFlightPath vector is CHANGED to a UNIT vector.
00023   double ipError = sqrt( ROOT::Math::Similarity(transverseFlightPath.Unit(),error) );
00024   return Measurement1D (length, ipError);
00025 }
00026 

Generated on Tue Jun 9 17:48:36 2009 for CMSSW by  doxygen 1.5.4