CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GsfConstraintAtVertex.cc
Go to the documentation of this file.
2 
4 
11 // #include "TrackingTools/GsfTools/interface/GaussianSumUtilities1D.h"
12 // #include "TrackingTools/GsfTools/interface/MultiGaussianState1D.h"
13 // #include "TrackingTools/GsfTools/interface/MultiGaussianStateTransform.h"
18 
20  : geometry_(geometry),
21  magField_(magField),
22  gsfPropagator_(AnalyticalPropagator(magField, anyDirection)),
23  tipExtrapolator_(gsfPropagator_) {}
24 
26  const reco::BeamSpot& beamSpot) const {
27  //
28  // Beamspot (global co-ordinates)
29  //
30  GlobalPoint bsPosGlobal(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
31  GlobalError bsCovGlobal(beamSpot.rotatedCovariance3D());
32  //
33  return constrainAtPoint(track, bsPosGlobal, bsCovGlobal);
34 }
35 
37  const reco::Vertex& vertex) const {
38  //
39  // Beamspot (global co-ordinates)
40  //
41  GlobalPoint vtxPosGlobal(vertex.position().x(), vertex.position().y(), vertex.position().z());
42  GlobalError vtxCovGlobal(vertex.covariance());
43  //
44  return constrainAtPoint(track, vtxPosGlobal, vtxCovGlobal);
45 }
46 
48  const GlobalPoint& globalPosition,
49  const GlobalError& globalError) const {
50  //
51  // Track on TIP plane
52  //
54  if (!innerState.isValid())
55  return TrajectoryStateOnSurface();
56  TrajectoryStateOnSurface tipState = tipExtrapolator_.extrapolate(innerState, globalPosition);
57  if (!tipState.isValid())
58  return TrajectoryStateOnSurface();
59  //
60  // RecHit from beam spot
61  //
62  LocalError bsCovLocal = ErrorFrameTransformer().transform(globalError, tipState.surface());
63  auto bsHit =
64  TRecHit2DPosConstraint::build(tipState.surface().toLocal(globalPosition), bsCovLocal, &tipState.surface());
65  //
66  // update with constraint
67  //
68  TrajectoryStateOnSurface updatedState = gsfUpdator_.update(tipState, *bsHit);
69  if (!updatedState.isValid()) {
70  edm::LogWarning("GsfConstraintAtVertex") << " GSF update with vertex constraint failed";
71  return TrajectoryStateOnSurface();
72  }
73 
74  return updatedState;
75 }
TrajectoryStateOnSurface constrainAtBeamSpot(const reco::GsfTrack &, const reco::BeamSpot &) const
(multi)TSOS after including the beamspot
GsfConstraintAtVertex(const TrackerGeometry *geometry, const MagneticField *magField)
double z0() const
z coordinate
Definition: BeamSpot.h:65
static GlobalError transform(const LocalError &le, const Surface &surf)
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const Surface *surface)
const auto & magField
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:148
const Point & position() const
position
Definition: Vertex.h:127
TrajectoryStateOnSurface constrainAtPoint(const reco::GsfTrack &, const GlobalPoint &globalPosition, const GlobalError &globalError) const
(multi)TSOS after including a point with covariance matrix
const SurfaceType & surface() const
LocalPoint toLocal(const GlobalPoint &gp) const
MultiTrajectoryStateTransform multiStateTransformer_
const MagneticField * magField_
const TrackerGeometry * geometry_
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
extrapolation with default (=geometrical) propagator
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
GsfMultiStateUpdator gsfUpdator_
TransverseImpactPointExtrapolator tipExtrapolator_
TrajectoryStateOnSurface constrainAtVertex(const reco::GsfTrack &, const reco::Vertex &) const
(multi)TSOS after include a vertex
double y0() const
y coordinate
Definition: BeamSpot.h:63
Covariance3DMatrix rotatedCovariance3D() const
Definition: BeamSpot.cc:73
Log< level::Warning, false > LogWarning
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
double x0() const
x coordinate
Definition: BeamSpot.h:61