test
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 68 of file SingleTrackVertexConstraint.cc.

71 {
72  return constrain(ttFactory.build(fts), priorPos, priorError);
73 }
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, MagneticField::nominalValue(), VertexState::position(), and CachingVertex< N >::position().

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  int nominalBfield = track.field()->nominalValue();
41  if ((fabs(field) < 1e-4)&&(fabs(nominalBfield)!=0)) { //protection for the case where the magnet is off
42  LogDebug("RecoVertex/SingleTrackVertexConstraint")
43  << "Initial state is very far, field is close to zero (<1e-4): " << field << "\n";
44  return BTFtuple(false, TransientTrack(), 0.);
45  }
46 
47  RefCountedLinearizedTrackState lTrData
48  = theLTrackFactory.linearizedTrackState(priorVertexState.position(), track);
49  RefCountedVertexTrack vertexTrack = theVTrackFactory.vertexTrack(lTrData, priorVertexState);
50 
51  // Fit vertex
52 
53  std::vector<RefCountedVertexTrack> initialTracks;
54  CachingVertex<5> vertex(priorVertexState,priorVertexState,initialTracks,0);
55  vertex = vertexUpdator.add(vertex, vertexTrack);
56  if (!vertex.isValid()) {
57  return BTFtuple(false, TransientTrack(), 0.);
58  } else if (doTrackerBoundCheck_ && (!insideTrackerBounds(vertex.position()))) {
59  LogDebug("RecoVertex/SingleTrackVertexConstraint")
60  << "Fitted position is out of tracker bounds.\n";
61  return BTFtuple(false, TransientTrack(), 0.);
62  }
63 
64  RefCountedVertexTrack nTrack = theVertexTrackUpdator.update(vertex, vertexTrack);
65  return BTFtuple(true, nTrack->refittedState()->transientTrack(), nTrack->smoothedChi2());
66 }
#define LogDebug(id)
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:56
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
GlobalPoint globalPosition() const
const MagneticField * field() const
KalmanVertexTrackUpdator< 5 > theVertexTrackUpdator
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 75 of file SingleTrackVertexConstraint.cc.

77 {
78  VertexState priorVertexState(spot);
79  return constrain(track, priorVertexState);
80 }
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 82 of file SingleTrackVertexConstraint.cc.

84 {
85  VertexState priorVertexState(spot);
86  return constrain(ttFactory.build(fts), priorVertexState);
87 }
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.