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  if (!tsosfinal.isValid())
34 
35  //Compute point on beamline of closest approach
36  GlobalPoint tp = tsosfinal.globalPosition(); //position of trajectory closest approach
37  GlobalVector hyp(tp.x() - bspos.x(),tp.y() - bspos.y(),tp.z() - bspos.z()); //difference between traj and beamline reference
38  double l=bsline.direction().dot(hyp); //length along beamline away from reference point
39  GlobalPoint closepoint = bspos + l*bsvec;
40 
41  //Get the free state and return the TSCBL
42  const FreeTrajectoryState theFTS = *tsosfinal.freeState();
43  return TrajectoryStateClosestToBeamLine(theFTS, closepoint, beamSpot);
44 }
DirectionType direction() const
Definition: Line.h:27
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:144
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
FreeTrajectoryState const * freeState(bool withErrors=true) const
T z() const
Definition: PV3DBase.h:64
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
TSCBLBuilderWithPropagator(const MagneticField *field)
constructor with default geometrical propagator
T x() const
Definition: PV3DBase.h:62
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const Line &L, const Propagator &p) const
extrapolation with user-supplied propagator