CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 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< class >::product(), and tipExtrapolator_.

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

Definition at line 37 of file GsfConstraintAtVertex.cc.

References gsfPropagator_, and tipExtrapolator_.

38 {
39  delete tipExtrapolator_;
40  delete gsfPropagator_;
41 }
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 45 of file GsfConstraintAtVertex.cc.

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

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

47 {
48  //
49  // Beamspot (global co-ordinates)
50  //
51  GlobalPoint bsPosGlobal(beamSpot.x0(),beamSpot.y0(),beamSpot.z0());
52  GlobalError bsCovGlobal(beamSpot.rotatedCovariance3D());
53  //
54  return constrainAtPoint(track,bsPosGlobal,bsCovGlobal);
55 }
double z0() const
z coordinate
Definition: BeamSpot.h:68
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:66
Covariance3DMatrix rotatedCovariance3D() const
Definition: BeamSpot.cc:78
double x0() const
x coordinate
Definition: BeamSpot.h:64
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 71 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().

74 {
75  //
76  // Track on TIP plane
77  //
78  TrajectoryStateOnSurface innerState =
80  if ( !innerState.isValid() ) return TrajectoryStateOnSurface();
81  TrajectoryStateOnSurface tipState = tipExtrapolator_->extrapolate(innerState,globalPosition);
82  if ( !tipState.isValid() ) return TrajectoryStateOnSurface();
83  //
84  // RecHit from beam spot
85  //
86  LocalError bsCovLocal = ErrorFrameTransformer().transform(globalError,tipState.surface());
88  TRecHit2DPosConstraint::build(tipState.surface().toLocal(globalPosition),
89  bsCovLocal,&tipState.surface());
90  //
91  // update with constraint
92  //
93  TrajectoryStateOnSurface updatedState = gsfUpdator_.update(tipState,*bsHit);
94  if ( !updatedState.isValid() ) {
95  edm::LogWarning("GsfConstraintAtVertex") << " GSF update with vertex constraint failed";
96  return TrajectoryStateOnSurface();
97  }
98 
99  return updatedState;
100 }
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_
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const
const TrackerGeometry * geometry_
std::shared_ptr< TrackingRecHit const > RecHitPointer
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
extrapolation with default (=geometrical) propagator
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
GsfMultiStateUpdator gsfUpdator_
TrajectoryStateOnSurface GsfConstraintAtVertex::constrainAtVertex ( const reco::GsfTrack track,
const reco::Vertex vertex 
) const

(multi)TSOS after include a vertex

Definition at line 58 of file GsfConstraintAtVertex.cc.

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

60 {
61  //
62  // Beamspot (global co-ordinates)
63  //
64  GlobalPoint vtxPosGlobal(vertex.position().x(),vertex.position().y(),vertex.position().z());
65  GlobalError vtxCovGlobal(vertex.covariance());
66  //
67  return constrainAtPoint(track,vtxPosGlobal,vtxCovGlobal);
68 }
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:116
const Point & position() const
position
Definition: Vertex.h:99
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 41 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint(), and GsfConstraintAtVertex().

GsfPropagatorAdapter* GsfConstraintAtVertex::gsfPropagator_
private

Definition at line 43 of file GsfConstraintAtVertex.h.

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

GsfMultiStateUpdator GsfConstraintAtVertex::gsfUpdator_
private

Definition at line 40 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().

const MagneticField* GsfConstraintAtVertex::magField_
private

Definition at line 42 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint(), and GsfConstraintAtVertex().

MultiTrajectoryStateTransform GsfConstraintAtVertex::multiStateTransformer_
private

Definition at line 39 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().

TransverseImpactPointExtrapolator* GsfConstraintAtVertex::tipExtrapolator_
private