CMS 3D CMS Logo

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

#include <SingleTrackVertexConstraint.h>

Public Types

typedef std::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

Definition at line 23 of file SingleTrackVertexConstraint.h.

Definition at line 22 of file SingleTrackVertexConstraint.h.

Constructor & Destructor Documentation

SingleTrackVertexConstraint::SingleTrackVertexConstraint ( bool  doTrackerBoundCheck = true)
inline

Definition at line 25 of file SingleTrackVertexConstraint.h.

25 : 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 21 of file SingleTrackVertexConstraint.cc.

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

23  {
24  VertexState priorVertexState(priorPos, priorError);
25  return constrain(track, priorVertexState);
26 }
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 62 of file SingleTrackVertexConstraint.cc.

64  {
65  return constrain(ttFactory.build(fts), priorPos, priorError);
66 }
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 28 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(), CachingVertex< N >::position(), and HLT_FULL_cff::track.

29  {
30  // Linearize tracks
31 
32  typedef CachingVertex<5>::RefCountedVertexTrack RefCountedVertexTrack;
33  typedef VertexTrack<5>::RefCountedLinearizedTrackState RefCountedLinearizedTrackState;
34 
35  double field = track.field()->inInverseGeV(track.impactPointState().globalPosition()).z();
36  int nominalBfield = track.field()->nominalValue();
37  if ((fabs(field) < 1e-4) && (fabs(nominalBfield) != 0)) { //protection for the case where the magnet is off
38  LogDebug("RecoVertex/SingleTrackVertexConstraint")
39  << "Initial state is very far, field is close to zero (<1e-4): " << field << "\n";
40  return BTFtuple(false, TransientTrack(), 0.);
41  }
42 
43  RefCountedLinearizedTrackState lTrData = theLTrackFactory.linearizedTrackState(priorVertexState.position(), track);
44  RefCountedVertexTrack vertexTrack = theVTrackFactory.vertexTrack(lTrData, priorVertexState);
45 
46  // Fit vertex
47 
48  std::vector<RefCountedVertexTrack> initialTracks;
49  CachingVertex<5> vertex(priorVertexState, priorVertexState, initialTracks, 0);
50  vertex = vertexUpdator.add(vertex, vertexTrack);
51  if (!vertex.isValid()) {
52  return BTFtuple(false, TransientTrack(), 0.);
53  } else if (doTrackerBoundCheck_ && (!insideTrackerBounds(vertex.position()))) {
54  LogDebug("RecoVertex/SingleTrackVertexConstraint") << "Fitted position is out of tracker bounds.\n";
55  return BTFtuple(false, TransientTrack(), 0.);
56  }
57 
58  RefCountedVertexTrack nTrack = theVertexTrackUpdator.update(vertex, vertexTrack);
59  return BTFtuple(true, nTrack->refittedState()->transientTrack(), nTrack->smoothedChi2());
60 }
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, const reco::TransientTrack &track) const override
std::tuple< bool, reco::TransientTrack, float > BTFtuple
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:49
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:36
RefCountedVertexTrack update(const CachingVertex< N > &vertex, RefCountedVertexTrack track) const override
KalmanVertexUpdator< 5 > vertexUpdator
LinearizedTrackStateFactory theLTrackFactory
CachingVertex< N > add(const CachingVertex< N > &oldVertex, const RefCountedVertexTrack track) const override
TrajectoryStateOnSurface impactPointState() const
#define LogDebug(id)
SingleTrackVertexConstraint::BTFtuple SingleTrackVertexConstraint::constrain ( const reco::TransientTrack track,
const reco::BeamSpot spot 
) const

Constaint of a TransientTrack with a BeamSpot.

Definition at line 68 of file SingleTrackVertexConstraint.cc.

69  {
70  VertexState priorVertexState(spot);
71  return constrain(track, priorVertexState);
72 }
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 74 of file SingleTrackVertexConstraint.cc.

75  {
76  VertexState priorVertexState(spot);
77  return constrain(ttFactory.build(fts), priorVertexState);
78 }
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 64 of file SingleTrackVertexConstraint.h.

LinearizedTrackStateFactory SingleTrackVertexConstraint::theLTrackFactory
private

Definition at line 61 of file SingleTrackVertexConstraint.h.

KalmanVertexTrackUpdator<5> SingleTrackVertexConstraint::theVertexTrackUpdator
private

Definition at line 59 of file SingleTrackVertexConstraint.h.

VertexTrackFactory<5> SingleTrackVertexConstraint::theVTrackFactory
private

Definition at line 62 of file SingleTrackVertexConstraint.h.

TransientTrackFromFTSFactory SingleTrackVertexConstraint::ttFactory
private

Definition at line 63 of file SingleTrackVertexConstraint.h.

KalmanVertexUpdator<5> SingleTrackVertexConstraint::vertexUpdator
private

Definition at line 58 of file SingleTrackVertexConstraint.h.