CMS 3D CMS Logo

TSCBLBuilderWithPropagator.cc
Go to the documentation of this file.
5 
6 using namespace std;
7 
9  : thePropagator(new AnalyticalPropagator(field, anyDirection)) {}
10 
13 }
14 
16  const reco::BeamSpot& beamSpot) const {
17  GlobalPoint bspos(beamSpot.position().x(), beamSpot.position().y(), beamSpot.position().z());
18  GlobalVector bsvec(beamSpot.dxdz(), beamSpot.dydz(), 1.);
19  Line bsline(bspos, bsvec);
20 
22 
23  TrajectoryStateOnSurface tsosfinal = tetl.extrapolate(originalFTS, bsline, *thePropagator);
24 
25  if (!tsosfinal.isValid())
27 
28  //Compute point on beamline of closest approach
29  GlobalPoint tp = tsosfinal.globalPosition(); //position of trajectory closest approach
30  GlobalVector hyp(
31  tp.x() - bspos.x(), tp.y() - bspos.y(), tp.z() - bspos.z()); //difference between traj and beamline reference
32  double l = bsline.direction().dot(hyp); //length along beamline away from reference point
33  GlobalPoint closepoint = bspos + l * bsvec;
34 
35  //Get the free state and return the TSCBL
36  const FreeTrajectoryState theFTS = *tsosfinal.freeState();
37  return TrajectoryStateClosestToBeamLine(theFTS, closepoint, beamSpot);
38 }
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
Definition: Line.h:10
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
DeepCopyPointerByClone< Propagator > thePropagator
DirectionType direction() const
Definition: Line.h:25
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const Line &L, const Propagator &p) const
extrapolation with user-supplied propagator
GlobalPoint globalPosition() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
TrajectoryStateClosestToBeamLine operator()(const FTS &originalFTS, const reco::BeamSpot &beamSpot) const override
TSCBLBuilderWithPropagator(const MagneticField *field)
constructor with default geometrical propagator
FreeTrajectoryState const * freeState(bool withErrors=true) const