CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
DirectionType direction() const
Definition: Line.h:25
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
Definition: Line.h:10
DeepCopyPointerByClone< Propagator > thePropagator
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
double dydz() const
dydz slope
Definition: BeamSpot.h:80
FreeTrajectoryState const * freeState(bool withErrors=true) const
T z() const
Definition: PV3DBase.h:61
double dxdz() const
dxdz slope
Definition: BeamSpot.h:78
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
const Point & position() const
position
Definition: BeamSpot.h:59
T x() const
Definition: PV3DBase.h:59
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const Line &L, const Propagator &p) const
extrapolation with user-supplied propagator