CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

SingleTrackVertexConstraint Class Reference

#include <SingleTrackVertexConstraint.h>

List of all members.

Public Types

typedef boost::tuple< bool,
reco::TransientTrack, float > 
BTFtuple
typedef std::pair
< reco::TransientTrack, float > 
TrackFloatPair

Public Member Functions

BTFtuple constrain (const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
BTFtuple constrain (const FreeTrajectoryState &fts, const reco::BeamSpot &spot) const
BTFtuple constrain (const reco::TransientTrack &track, const reco::BeamSpot &spot) const
BTFtuple constrain (const reco::TransientTrack &track, const VertexState priorVertex) const
BTFtuple constrain (const FreeTrajectoryState &fts, const GlobalPoint &priorPos, const GlobalError &priorError) const
 SingleTrackVertexConstraint (bool doTrackerBoundCheck=true)

Private Attributes

bool doTrackerBoundCheck_
LinearizedTrackStateFactory theLTrackFactory
KalmanVertexTrackUpdator< 5 > theVertexTrackUpdator
VertexTrackFactory< 5 > theVTrackFactory
TransientTrackFromFTSFactory ttFactory
KalmanVertexUpdator< 5 > vertexUpdator

Detailed Description

Class to re-estimate the parameters of the track at the vertex, with the vertex constraint or a BeamSpot, using the Kalman filter algorithms. This will only change the parameters of the track at the vertex, but NOT at other points along the track.

Definition at line 20 of file SingleTrackVertexConstraint.h.


Member Typedef Documentation

typedef boost::tuple<bool, reco::TransientTrack, float> SingleTrackVertexConstraint::BTFtuple

Definition at line 25 of file SingleTrackVertexConstraint.h.

Definition at line 24 of file SingleTrackVertexConstraint.h.


Constructor & Destructor Documentation

SingleTrackVertexConstraint::SingleTrackVertexConstraint ( bool  doTrackerBoundCheck = true) [inline]

Definition at line 27 of file SingleTrackVertexConstraint.h.

                                                               : 
        doTrackerBoundCheck_(doTrackerBoundCheck){}

Member Function Documentation

SingleTrackVertexConstraint::BTFtuple SingleTrackVertexConstraint::constrain ( const reco::TransientTrack track,
const GlobalPoint priorPos,
const GlobalError priorError 
) const

Constaint of a TransientTrack with a position and error. The track must NOT have been used in the vertex fit.

Definition at line 22 of file SingleTrackVertexConstraint.cc.

Referenced by KVFTrackUpdate::analyze(), and MuonUpdatorAtVertex::update().

{ 
  VertexState priorVertexState(priorPos, priorError);
  return constrain(track, priorVertexState);
}
SingleTrackVertexConstraint::BTFtuple SingleTrackVertexConstraint::constrain ( const FreeTrajectoryState fts,
const reco::BeamSpot spot 
) const

Constaint of a FreeTrajectoryState with a BeamSpot.

Definition at line 81 of file SingleTrackVertexConstraint.cc.

{ 
  VertexState priorVertexState(spot);
  return constrain(ttFactory.build(fts), priorVertexState);
}
SingleTrackVertexConstraint::BTFtuple SingleTrackVertexConstraint::constrain ( const reco::TransientTrack track,
const reco::BeamSpot spot 
) const

Constaint of a TransientTrack with a BeamSpot.

Definition at line 74 of file SingleTrackVertexConstraint.cc.

{
  VertexState priorVertexState(spot);
  return constrain(track, priorVertexState);
}
SingleTrackVertexConstraint::BTFtuple SingleTrackVertexConstraint::constrain ( const reco::TransientTrack track,
const VertexState  priorVertex 
) const

The method which does the constaint. The track must NOT have been used in the vertex fit.

Definition at line 31 of file SingleTrackVertexConstraint.cc.

References reco::TransientTrack::field(), TrajectoryStateOnSurface::globalPosition(), reco::TransientTrack::impactPointState(), MagneticField::inInverseGeV(), CachingVertex< N >::isValid(), LogDebug, VertexState::position(), CachingVertex< N >::position(), and z.

{
  // Linearize tracks

  typedef CachingVertex<5>::RefCountedVertexTrack RefCountedVertexTrack;
  typedef VertexTrack<5>::RefCountedLinearizedTrackState RefCountedLinearizedTrackState;

  double field  = track.field()->inInverseGeV(track.impactPointState().globalPosition()).z();
  if (fabs(field) < 1e-4) {
      LogDebug("RecoVertex/SingleTrackVertexConstraint") 
         << "Initial state is very far, field is close to zero (<1e-4): " << field << "\n";
      return BTFtuple(false, TransientTrack(), 0.);
  }

  RefCountedLinearizedTrackState lTrData 
      = theLTrackFactory.linearizedTrackState(priorVertexState.position(), track);
  RefCountedVertexTrack vertexTrack =  theVTrackFactory.vertexTrack(lTrData, priorVertexState);

  // Fit vertex

  std::vector<RefCountedVertexTrack> initialTracks;
  CachingVertex<5> vertex(priorVertexState,priorVertexState,initialTracks,0);
  vertex = vertexUpdator.add(vertex, vertexTrack);
  if (!vertex.isValid()) {
    return BTFtuple(false, TransientTrack(), 0.);
  } else  if (doTrackerBoundCheck_ && (!insideTrackerBounds(vertex.position()))) {
      LogDebug("RecoVertex/SingleTrackVertexConstraint") 
         << "Fitted position is out of tracker bounds.\n";
      return BTFtuple(false, TransientTrack(), 0.);
  }

  RefCountedVertexTrack nTrack = theVertexTrackUpdator.update(vertex, vertexTrack);
  return BTFtuple(true, nTrack->refittedState()->transientTrack(), nTrack->smoothedChi2());
}
SingleTrackVertexConstraint::BTFtuple SingleTrackVertexConstraint::constrain ( const FreeTrajectoryState fts,
const GlobalPoint priorPos,
const GlobalError priorError 
) const

Constaint of a FreeTrajectoryState with a position and error. The track must NOT have been used in the vertex fit.

Definition at line 67 of file SingleTrackVertexConstraint.cc.

{ 
  return constrain(ttFactory.build(fts), priorPos, priorError);
}

Member Data Documentation

Definition at line 73 of file SingleTrackVertexConstraint.h.

Definition at line 70 of file SingleTrackVertexConstraint.h.

Definition at line 68 of file SingleTrackVertexConstraint.h.

Definition at line 71 of file SingleTrackVertexConstraint.h.

Definition at line 72 of file SingleTrackVertexConstraint.h.

Definition at line 67 of file SingleTrackVertexConstraint.h.