CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrajectoryStateClosestToBeamLine.cc
Go to the documentation of this file.
2 
4  (const FreeTrajectoryState& stateAtPCA, const GlobalPoint & pointOnBeamLine,
5  const reco::BeamSpot& beamSpot) :
6  valid(true), theFTS(stateAtPCA) , thePointOnBeamLine(pointOnBeamLine),
7  theBeamSpot(beamSpot)
8 {}
9 
11 {
12  if (!isValid()) throw TrajectoryStateException(
13  "TrajectoryStateClosestToBeamLine is invalid.");
16 
17  GlobalPoint impactPoint=theFTS.position();
18  AlgebraicVector3 transverseFlightPath(
19  impactPoint.x()-thePointOnBeamLine.x(),impactPoint.y()-thePointOnBeamLine.y(),0.);
20  double length = ROOT::Math::Mag(transverseFlightPath);
21  // Warning: after the transverseFlightPath.Unit() statement, the
22  // transverseFlightPath vector is CHANGED to a UNIT vector.
23  double ipError = sqrt( ROOT::Math::Similarity(transverseFlightPath.Unit(),error) );
24  return Measurement1D (length, ipError);
25 }
26 
CartesianTrajectoryError cartesianError() const
T y() const
Definition: PV3DBase.h:62
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
T sqrt(T t)
Definition: SSEVec.h:46
ROOT::Math::SVector< double, 3 > AlgebraicVector3
const AlgebraicSymMatrix66 & matrix() const
GlobalPoint position() const
Covariance3DMatrix rotatedCovariance3D() const
Definition: BeamSpot.cc:79
T x() const
Definition: PV3DBase.h:61