CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
SingleTrackVertexConstraint Class Reference

#include <SingleTrackVertexConstraint.h>

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 GlobalPoint &priorPos, const GlobalError &priorError) const
 
BTFtuple constrain (const reco::TransientTrack &track, const VertexState priorVertex) const
 
BTFtuple constrain (const reco::TransientTrack &track, const reco::BeamSpot &spot) const
 
BTFtuple constrain (const FreeTrajectoryState &fts, const reco::BeamSpot &spot) 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.

27  :
28  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().

25 {
26  VertexState priorVertexState(priorPos, priorError);
27  return constrain(track, priorVertexState);
28 }
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
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.

70 {
71  return constrain(ttFactory.build(fts), priorPos, priorError);
72 }
TransientTrackFromFTSFactory ttFactory
reco::TransientTrack build(const FreeTrajectoryState &fts) const
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
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 alignCSCRings::e, reco::TransientTrack::field(), TrajectoryStateOnSurface::globalPosition(), reco::TransientTrack::impactPointState(), MagneticField::inInverseGeV(), CachingVertex< N >::isValid(), LogDebug, VertexState::position(), CachingVertex< N >::position(), and detailsBasic3DVector::z.

33 {
34  // Linearize tracks
35 
36  typedef CachingVertex<5>::RefCountedVertexTrack RefCountedVertexTrack;
37  typedef VertexTrack<5>::RefCountedLinearizedTrackState RefCountedLinearizedTrackState;
38 
39  double field = track.field()->inInverseGeV(track.impactPointState().globalPosition()).z();
40  if (fabs(field) < 1e-4) {
41  LogDebug("RecoVertex/SingleTrackVertexConstraint")
42  << "Initial state is very far, field is close to zero (<1e-4): " << field << "\n";
43  return BTFtuple(false, TransientTrack(), 0.);
44  }
45 
46  RefCountedLinearizedTrackState lTrData
47  = theLTrackFactory.linearizedTrackState(priorVertexState.position(), track);
48  RefCountedVertexTrack vertexTrack = theVTrackFactory.vertexTrack(lTrData, priorVertexState);
49 
50  // Fit vertex
51 
52  std::vector<RefCountedVertexTrack> initialTracks;
53  CachingVertex<5> vertex(priorVertexState,priorVertexState,initialTracks,0);
54  vertex = vertexUpdator.add(vertex, vertexTrack);
55  if (!vertex.isValid()) {
56  return BTFtuple(false, TransientTrack(), 0.);
57  } else if (doTrackerBoundCheck_ && (!insideTrackerBounds(vertex.position()))) {
58  LogDebug("RecoVertex/SingleTrackVertexConstraint")
59  << "Fitted position is out of tracker bounds.\n";
60  return BTFtuple(false, TransientTrack(), 0.);
61  }
62 
63  RefCountedVertexTrack nTrack = theVertexTrackUpdator.update(vertex, vertexTrack);
64  return BTFtuple(true, nTrack->refittedState()->transientTrack(), nTrack->smoothedChi2());
65 }
#define LogDebug(id)
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
GlobalPoint globalPosition() const
const MagneticField * field() const
KalmanVertexTrackUpdator< 5 > theVertexTrackUpdator
float float float z
VertexTrackFactory< 5 > theVTrackFactory
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:39
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, const reco::TransientTrack &track) const
KalmanVertexUpdator< 5 > vertexUpdator
LinearizedTrackStateFactory theLTrackFactory
RefCountedVertexTrack update(const CachingVertex< N > &vertex, RefCountedVertexTrack track) const
boost::tuple< bool, reco::TransientTrack, float > BTFtuple
TrajectoryStateOnSurface impactPointState() const
CachingVertex< N > add(const CachingVertex< N > &oldVertex, const RefCountedVertexTrack track) const
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.

76 {
77  VertexState priorVertexState(spot);
78  return constrain(track, priorVertexState);
79 }
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
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.

83 {
84  VertexState priorVertexState(spot);
85  return constrain(ttFactory.build(fts), priorVertexState);
86 }
TransientTrackFromFTSFactory ttFactory
reco::TransientTrack build(const FreeTrajectoryState &fts) const
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const

Member Data Documentation

bool SingleTrackVertexConstraint::doTrackerBoundCheck_
private

Definition at line 73 of file SingleTrackVertexConstraint.h.

LinearizedTrackStateFactory SingleTrackVertexConstraint::theLTrackFactory
private

Definition at line 70 of file SingleTrackVertexConstraint.h.

KalmanVertexTrackUpdator<5> SingleTrackVertexConstraint::theVertexTrackUpdator
private

Definition at line 68 of file SingleTrackVertexConstraint.h.

VertexTrackFactory<5> SingleTrackVertexConstraint::theVTrackFactory
private

Definition at line 71 of file SingleTrackVertexConstraint.h.

TransientTrackFromFTSFactory SingleTrackVertexConstraint::ttFactory
private

Definition at line 72 of file SingleTrackVertexConstraint.h.

KalmanVertexUpdator<5> SingleTrackVertexConstraint::vertexUpdator
private

Definition at line 67 of file SingleTrackVertexConstraint.h.