CMS 3D CMS Logo

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 edm::EventSetup &)
 
 ~GsfConstraintAtVertex ()
 

Private Attributes

const TrackerGeometrygeometry_
 
GsfPropagatorAdaptergsfPropagator_
 
GsfMultiStateUpdator gsfUpdator_
 
const MagneticFieldmagField_
 
MultiTrajectoryStateTransform multiStateTransformer_
 
TransverseImpactPointExtrapolatortipExtrapolator_
 

Detailed Description

Definition at line 21 of file GsfConstraintAtVertex.h.

Constructor & Destructor Documentation

GsfConstraintAtVertex::GsfConstraintAtVertex ( const edm::EventSetup setup)
explicit

Definition at line 20 of file GsfConstraintAtVertex.cc.

References AnalyticalPropagator_cfi::AnalyticalPropagator, anyDirection, geometry_, edm::EventSetup::get(), gsfPropagator_, magField_, edm::ESHandle< T >::product(), and tipExtrapolator_.

20  {
21  edm::ESHandle<TrackerGeometry> geometryHandle;
22  setup.get<TrackerDigiGeometryRecord>().get(geometryHandle);
23  geometry_ = geometryHandle.product();
24 
25  edm::ESHandle<MagneticField> magFieldHandle;
26  setup.get<IdealMagneticFieldRecord>().get(magFieldHandle);
27  magField_ = magFieldHandle.product();
28 
29  // edm::ESHandle<Propagator> propagatorHandle;
30  // setup.get<TrackingComponentsRecord>().get(propagatorName_,propagatorHandle);
31  // propagator_ = propagatorHandle.product();
34 }
TransverseImpactPointExtrapolator * tipExtrapolator_
GsfPropagatorAdapter * gsfPropagator_
const MagneticField * magField_
const TrackerGeometry * geometry_
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
GsfConstraintAtVertex::~GsfConstraintAtVertex ( )

Definition at line 36 of file GsfConstraintAtVertex.cc.

References gsfPropagator_, and tipExtrapolator_.

36  {
37  delete tipExtrapolator_;
38  delete gsfPropagator_;
39 }
TransverseImpactPointExtrapolator * tipExtrapolator_
GsfPropagatorAdapter * gsfPropagator_

Member Function Documentation

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

(multi)TSOS after including the beamspot

Definition at line 41 of file GsfConstraintAtVertex.cc.

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

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

42  {
43  //
44  // Beamspot (global co-ordinates)
45  //
46  GlobalPoint bsPosGlobal(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
47  GlobalError bsCovGlobal(beamSpot.rotatedCovariance3D());
48  //
49  return constrainAtPoint(track, bsPosGlobal, bsCovGlobal);
50 }
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 63 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(), GsfMultiStateUpdator::update(), and TrackInfoProducer_cfi::updatedState.

Referenced by constrainAtBeamSpot(), and constrainAtVertex().

65  {
66  //
67  // Track on TIP plane
68  //
70  if (!innerState.isValid())
71  return TrajectoryStateOnSurface();
72  TrajectoryStateOnSurface tipState = tipExtrapolator_->extrapolate(innerState, globalPosition);
73  if (!tipState.isValid())
74  return TrajectoryStateOnSurface();
75  //
76  // RecHit from beam spot
77  //
78  LocalError bsCovLocal = ErrorFrameTransformer().transform(globalError, tipState.surface());
79  auto bsHit =
80  TRecHit2DPosConstraint::build(tipState.surface().toLocal(globalPosition), bsCovLocal, &tipState.surface());
81  //
82  // update with constraint
83  //
85  if (!updatedState.isValid()) {
86  edm::LogWarning("GsfConstraintAtVertex") << " GSF update with vertex constraint failed";
87  return TrajectoryStateOnSurface();
88  }
89 
90  return updatedState;
91 }
static GlobalError transform(const LocalError &le, const Surface &surf)
TransverseImpactPointExtrapolator * tipExtrapolator_
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_
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 52 of file GsfConstraintAtVertex.cc.

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

53  {
54  //
55  // Beamspot (global co-ordinates)
56  //
57  GlobalPoint vtxPosGlobal(vertex.position().x(), vertex.position().y(), vertex.position().z());
58  GlobalError vtxCovGlobal(vertex.covariance());
59  //
60  return constrainAtPoint(track, vtxPosGlobal, vtxCovGlobal);
61 }
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:134
const Point & position() const
position
Definition: Vertex.h:113
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 38 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint(), and GsfConstraintAtVertex().

GsfPropagatorAdapter* GsfConstraintAtVertex::gsfPropagator_
private

Definition at line 40 of file GsfConstraintAtVertex.h.

Referenced by GsfConstraintAtVertex(), and ~GsfConstraintAtVertex().

GsfMultiStateUpdator GsfConstraintAtVertex::gsfUpdator_
private

Definition at line 37 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().

const MagneticField* GsfConstraintAtVertex::magField_
private

Definition at line 39 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint(), and GsfConstraintAtVertex().

MultiTrajectoryStateTransform GsfConstraintAtVertex::multiStateTransformer_
private

Definition at line 36 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().

TransverseImpactPointExtrapolator* GsfConstraintAtVertex::tipExtrapolator_
private