CMS 3D CMS Logo

GsfConstraintAtVertex.cc
Go to the documentation of this file.
2 
4 
12 // #include "TrackingTools/GsfTools/interface/GaussianSumUtilities1D.h"
13 // #include "TrackingTools/GsfTools/interface/MultiGaussianState1D.h"
14 // #include "TrackingTools/GsfTools/interface/MultiGaussianStateTransform.h"
19 
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 }
35 
37  delete tipExtrapolator_;
38  delete gsfPropagator_;
39 }
40 
42  const reco::BeamSpot& beamSpot) const {
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 }
51 
53  const reco::Vertex& vertex) const {
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 }
62 
64  const GlobalPoint& globalPosition,
65  const GlobalError& globalError) const {
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  //
84  TrajectoryStateOnSurface updatedState = gsfUpdator_.update(tipState, *bsHit);
85  if (!updatedState.isValid()) {
86  edm::LogWarning("GsfConstraintAtVertex") << " GSF update with vertex constraint failed";
87  return TrajectoryStateOnSurface();
88  }
89 
90  return updatedState;
91 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
GsfConstraintAtVertex::constrainAtBeamSpot
TrajectoryStateOnSurface constrainAtBeamSpot(const reco::GsfTrack &, const reco::BeamSpot &) const
(multi)TSOS after including the beamspot
Definition: GsfConstraintAtVertex.cc:41
TrajectoryStateOnSurface.h
GsfConstraintAtVertex::gsfUpdator_
GsfMultiStateUpdator gsfUpdator_
Definition: GsfConstraintAtVertex.h:37
anyDirection
Definition: PropagationDirection.h:4
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
MessageLogger.h
ESHandle.h
GsfPropagatorAdapter.h
GsfConstraintAtVertex::magField_
const MagneticField * magField_
Definition: GsfConstraintAtVertex.h:39
GsfConstraintAtVertex::multiStateTransformer_
MultiTrajectoryStateTransform multiStateTransformer_
Definition: GsfConstraintAtVertex.h:36
GsfConstraintAtVertex::GsfConstraintAtVertex
GsfConstraintAtVertex(const edm::EventSetup &)
Definition: GsfConstraintAtVertex.cc:20
TransverseImpactPointExtrapolator
Definition: TransverseImpactPointExtrapolator.h:26
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
reco::GsfTrack
Definition: GsfTrack.h:12
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
ErrorFrameTransformer
Definition: ErrorFrameTransformer.h:12
Surface.h
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:16
reco::BeamSpot
Definition: BeamSpot.h:21
IdealMagneticFieldRecord.h
edm::ESHandle< TrackerGeometry >
Point3DBase< float, GlobalTag >
AnalyticalPropagator_cfi.AnalyticalPropagator
AnalyticalPropagator
Definition: AnalyticalPropagator_cfi.py:3
GsfConstraintAtVertex::tipExtrapolator_
TransverseImpactPointExtrapolator * tipExtrapolator_
Definition: GsfConstraintAtVertex.h:41
TrackerDigiGeometryRecord.h
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
GsfConstraintAtVertex::~GsfConstraintAtVertex
~GsfConstraintAtVertex()
Definition: GsfConstraintAtVertex.cc:36
LocalError
Definition: LocalError.h:12
GsfConstraintAtVertex::constrainAtPoint
TrajectoryStateOnSurface constrainAtPoint(const reco::GsfTrack &, const GlobalPoint &globalPosition, const GlobalError &globalError) const
(multi)TSOS after including a point with covariance matrix
Definition: GsfConstraintAtVertex.cc:63
GsfConstraintAtVertex::constrainAtVertex
TrajectoryStateOnSurface constrainAtVertex(const reco::GsfTrack &, const reco::Vertex &) const
(multi)TSOS after include a vertex
Definition: GsfConstraintAtVertex.cc:52
GlobalErrorBase< double, ErrorMatrixTag >
edm::EventSetup
Definition: EventSetup.h:58
AnalyticalPropagator.h
GsfConstraintAtVertex::geometry_
const TrackerGeometry * geometry_
Definition: GsfConstraintAtVertex.h:38
get
#define get
TRecHit2DPosConstraint::build
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const Surface *surface)
Definition: TRecHit2DPosConstraint.h:59
ErrorFrameTransformer.h
GloballyPositioned::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition: GloballyPositioned.h:98
TrackingComponentsRecord.h
GsfMultiStateUpdator.h
TransverseImpactPointExtrapolator.h
TransverseImpactPointExtrapolator::extrapolate
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
extrapolation with default (=geometrical) propagator
Definition: TransverseImpactPointExtrapolator.cc:23
MultiTrajectoryStateTransform::innerStateOnSurface
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
Definition: MultiTrajectoryStateTransform.cc:23
TrajectoryStateOnSurface::surface
const SurfaceType & surface() const
Definition: TrajectoryStateOnSurface.h:78
GsfConstraintAtVertex::gsfPropagator_
GsfPropagatorAdapter * gsfPropagator_
Definition: GsfConstraintAtVertex.h:40
GsfMultiStateUpdator::update
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Definition: GsfMultiStateUpdator.cc:13
ErrorFrameTransformer::transform
static GlobalError transform(const LocalError &le, const Surface &surf)
Definition: ErrorFrameTransformer.h:16
GsfPropagatorAdapter
Definition: GsfPropagatorAdapter.h:14
GsfConstraintAtVertex.h
reco::Vertex
Definition: Vertex.h:35
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54