CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
GsfConstraintAtVertex Class Reference

#include <GsfConstraintAtVertex.h>

Public Member Functions

TrajectoryStateOnSurface constrainAtBeamSpot (const reco::GsfTrack &, const reco::BeamSpot &) const
 (multi)TSOS after including the beamspot More...
 
TrajectoryStateOnSurface constrainAtPoint (const reco::GsfTrack &, const GlobalPoint &globalPosition, const GlobalError &globalError) const
 (multi)TSOS after including a point with covariance matrix More...
 
TrajectoryStateOnSurface constrainAtVertex (const reco::GsfTrack &, const reco::Vertex &) const
 (multi)TSOS after include a vertex More...
 
 GsfConstraintAtVertex (const TrackerGeometry *geometry, const MagneticField *magField)
 

Private Attributes

const TrackerGeometrygeometry_
 
GsfPropagatorAdapter gsfPropagator_
 
GsfMultiStateUpdator gsfUpdator_
 
const MagneticFieldmagField_
 
MultiTrajectoryStateTransform multiStateTransformer_
 
TransverseImpactPointExtrapolator tipExtrapolator_
 

Detailed Description

Definition at line 23 of file GsfConstraintAtVertex.h.

Constructor & Destructor Documentation

GsfConstraintAtVertex::GsfConstraintAtVertex ( const TrackerGeometry geometry,
const MagneticField magField 
)
explicit

Definition at line 19 of file GsfConstraintAtVertex.cc.

20  : geometry_(geometry),
21  magField_(magField),
const MagneticField * magField_
const TrackerGeometry * geometry_
GsfPropagatorAdapter gsfPropagator_
TransverseImpactPointExtrapolator tipExtrapolator_

Member Function Documentation

TrajectoryStateOnSurface GsfConstraintAtVertex::constrainAtBeamSpot ( const reco::GsfTrack track,
const reco::BeamSpot beamSpot 
) const

(multi)TSOS after including the beamspot

Definition at line 25 of file GsfConstraintAtVertex.cc.

References constrainAtPoint(), reco::BeamSpot::rotatedCovariance3D(), reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

Referenced by GsfElectronAlgo::ElectronData::calculateTSOS().

26  {
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 }
double z0() const
z coordinate
Definition: BeamSpot.h:65
TrajectoryStateOnSurface constrainAtPoint(const reco::GsfTrack &, const GlobalPoint &globalPosition, const GlobalError &globalError) const
(multi)TSOS after including a point with covariance matrix
double y0() const
y coordinate
Definition: BeamSpot.h:63
Covariance3DMatrix rotatedCovariance3D() const
Definition: BeamSpot.cc:73
double x0() const
x coordinate
Definition: BeamSpot.h:61
TrajectoryStateOnSurface GsfConstraintAtVertex::constrainAtPoint ( const reco::GsfTrack track,
const GlobalPoint globalPosition,
const GlobalError globalError 
) const

(multi)TSOS after including a point with covariance matrix

Definition at line 47 of file GsfConstraintAtVertex.cc.

References TRecHit2DPosConstraint::build(), TransverseImpactPointExtrapolator::extrapolate(), geometry_, gsfUpdator_, MultiTrajectoryStateTransform::innerStateOnSurface(), TrajectoryStateOnSurface::isValid(), magField_, multiStateTransformer_, TrajectoryStateOnSurface::surface(), tipExtrapolator_, GloballyPositioned< T >::toLocal(), ErrorFrameTransformer::transform(), and GsfMultiStateUpdator::update().

Referenced by constrainAtBeamSpot(), and constrainAtVertex().

49  {
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 }
static GlobalError transform(const LocalError &le, const Surface &surf)
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const Surface *surface)
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_
Log< level::Warning, false > LogWarning
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
TrajectoryStateOnSurface GsfConstraintAtVertex::constrainAtVertex ( const reco::GsfTrack track,
const reco::Vertex vertex 
) const

(multi)TSOS after include a vertex

Definition at line 36 of file GsfConstraintAtVertex.cc.

References constrainAtPoint(), reco::Vertex::covariance(), and reco::Vertex::position().

37  {
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 }
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

Member Data Documentation

const TrackerGeometry* GsfConstraintAtVertex::geometry_
private

Definition at line 39 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().

GsfPropagatorAdapter GsfConstraintAtVertex::gsfPropagator_
private

Definition at line 41 of file GsfConstraintAtVertex.h.

GsfMultiStateUpdator GsfConstraintAtVertex::gsfUpdator_
private

Definition at line 38 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().

const MagneticField* GsfConstraintAtVertex::magField_
private

Definition at line 40 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().

MultiTrajectoryStateTransform GsfConstraintAtVertex::multiStateTransformer_
private

Definition at line 37 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().

TransverseImpactPointExtrapolator GsfConstraintAtVertex::tipExtrapolator_
private

Definition at line 42 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().