CMS 3D CMS Logo

Public Member Functions | Private Attributes

GsfConstraintAtVertex Class Reference

#include <GsfConstraintAtVertex.h>

List of all members.

Public Member Functions

TrajectoryStateOnSurface constrainAtBeamSpot (const reco::GsfTrack &, const reco::BeamSpot &) const
 (multi)TSOS after including the beamspot
TrajectoryStateOnSurface constrainAtPoint (const reco::GsfTrack &, const GlobalPoint &globalPosition, const GlobalError &globalError) const
 (multi)TSOS after including a point with covariance matrix
TrajectoryStateOnSurface constrainAtVertex (const reco::GsfTrack &, const reco::Vertex &) const
 (multi)TSOS after include a vertex
 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_.

{
  edm::ESHandle<TrackerGeometry> geometryHandle;
  setup.get<TrackerDigiGeometryRecord>().get(geometryHandle);
  geometry_ = geometryHandle.product();

  edm::ESHandle<MagneticField> magFieldHandle;
  setup.get<IdealMagneticFieldRecord>().get(magFieldHandle);
  magField_ = magFieldHandle.product();

//   edm::ESHandle<Propagator> propagatorHandle;
//   setup.get<TrackingComponentsRecord>().get(propagatorName_,propagatorHandle);
//   propagator_ = propagatorHandle.product();
  gsfPropagator_ = new GsfPropagatorAdapter(AnalyticalPropagator(magField_,anyDirection));
  tipExtrapolator_  = new TransverseImpactPointExtrapolator(*gsfPropagator_);
}
GsfConstraintAtVertex::~GsfConstraintAtVertex ( )

Definition at line 37 of file GsfConstraintAtVertex.cc.

References gsfPropagator_, and tipExtrapolator_.

{
  delete tipExtrapolator_;
  delete 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::covariance3D(), reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

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

{
  //
  // Beamspot (global co-ordinates)
  //
  GlobalPoint bsPosGlobal(beamSpot.x0(),beamSpot.y0(),beamSpot.z0());
  GlobalError bsCovGlobal(beamSpot.covariance3D());
  //
  return constrainAtPoint(track,bsPosGlobal,bsCovGlobal);
}
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 newFWLiteAna::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().

{
  //
  // Track on TIP plane
  //
  TrajectoryStateOnSurface innerState = 
    multiStateTransformer_.innerStateOnSurface(track,*geometry_,magField_);
  if ( !innerState.isValid() )  return TrajectoryStateOnSurface();
  TrajectoryStateOnSurface tipState = tipExtrapolator_->extrapolate(innerState,globalPosition);
  if ( !tipState.isValid() )  return TrajectoryStateOnSurface();
  //
  // RecHit from beam spot
  //
  LocalError bsCovLocal = ErrorFrameTransformer().transform(globalError,tipState.surface());
  TransientTrackingRecHit::RecHitPointer bsHit = 
    TRecHit2DPosConstraint::build(tipState.surface().toLocal(globalPosition),
                                  bsCovLocal,&tipState.surface());
  //
  // update with constraint
  //
  TrajectoryStateOnSurface updatedState = gsfUpdator_.update(tipState,*bsHit);
  if ( !updatedState.isValid() ) {
    edm::LogWarning("GsfConstraintAtVertex") << " GSF update with vertex constraint failed";
    return TrajectoryStateOnSurface();
  }

  return updatedState;
}
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().

{
  //
  // Beamspot (global co-ordinates)
  //
  GlobalPoint vtxPosGlobal(vertex.position().x(),vertex.position().y(),vertex.position().z());
  GlobalError vtxCovGlobal(vertex.covariance());
  //
  return constrainAtPoint(track,vtxPosGlobal,vtxCovGlobal);
}

Member Data Documentation

Definition at line 41 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint(), and GsfConstraintAtVertex().

Definition at line 43 of file GsfConstraintAtVertex.h.

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

Definition at line 40 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().

Definition at line 42 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint(), and GsfConstraintAtVertex().

Definition at line 39 of file GsfConstraintAtVertex.h.

Referenced by constrainAtPoint().