CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TSCBLBuilderWithPropagator.cc
Go to the documentation of this file.
5 
6 using namespace std;
7 
9  thePropagator(new AnalyticalPropagator(field, anyDirection)) {}
10 
12  thePropagator(u.clone())
13 {
15 }
16 
17 
20  (const FreeTrajectoryState& originalFTS,
21  const reco::BeamSpot& beamSpot) const
22 {
23 
24  GlobalPoint bspos(beamSpot.position().x(), beamSpot.position().y(), beamSpot.position().z());
25  GlobalVector bsvec(beamSpot.dxdz(), beamSpot.dydz(), 1.);
26  Line bsline(bspos,bsvec);
27 
29 
30  TrajectoryStateOnSurface tsosfinal = tetl.extrapolate(originalFTS,bsline,*thePropagator);
31 
32  //Compute point on beamline of closest approach
33  GlobalPoint tp = tsosfinal.globalPosition(); //position of trajectory closest approach
34  GlobalVector hyp(tp.x() - bspos.x(),tp.y() - bspos.y(),tp.z() - bspos.z()); //difference between traj and beamline reference
35  double l=bsline.direction().dot(hyp); //length along beamline away from reference point
36  GlobalPoint closepoint = bspos + l*bsvec;
37 
38  //Get the free state and return the TSCBL
39  const FreeTrajectoryState theFTS = *tsosfinal.freeState();
40  return TrajectoryStateClosestToBeamLine(theFTS, closepoint, beamSpot);
41 }
DirectionType direction() const
Definition: Line.h:27
Definition: Line.h:10
DeepCopyPointerByClone< Propagator > thePropagator
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
tuple field
Definition: statics.py:62
FreeTrajectoryState const * freeState(bool withErrors=true) const
T z() const
Definition: PV3DBase.h:64
TSCBLBuilderWithPropagator(const MagneticField *field)
constructor with default geometrical propagator
tuple clone
Definition: statics.py:58
virtual void setPropagationDirection(PropagationDirection dir) const
Definition: Propagator.h:134
T x() const
Definition: PV3DBase.h:62
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const Line &L, const Propagator &p) const
extrapolation with user-supplied propagator