CMS 3D CMS Logo

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

◆ BTFtuple

Definition at line 23 of file SingleTrackVertexConstraint.h.

◆ TrackFloatPair

Definition at line 22 of file SingleTrackVertexConstraint.h.

Constructor & Destructor Documentation

◆ SingleTrackVertexConstraint()

SingleTrackVertexConstraint::SingleTrackVertexConstraint ( bool  doTrackerBoundCheck = true)
inline

Definition at line 25 of file SingleTrackVertexConstraint.h.

25 : doTrackerBoundCheck_(doTrackerBoundCheck) {}

Member Function Documentation

◆ constrain() [1/5]

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.

References HLT_2024v10_cff::track.

Referenced by KVFTrackUpdate::analyze(), MuonBeamspotConstraintValueMapProducer::produce(), 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

◆ constrain() [2/5]

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 }
reco::TransientTrack build(const FreeTrajectoryState &fts) const
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
TransientTrackFromFTSFactory ttFactory

◆ constrain() [3/5]

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 MillePedeFileConverter_cfg::e, LogDebug, l1ctLayer1_cff::nTrack, VertexState::position(), HLT_2024v10_cff::track, and bphysicsOniaDQM_cfi::vertex.

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
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
KalmanVertexTrackUpdator< 5 > theVertexTrackUpdator
VertexTrackFactory< 5 > theVTrackFactory
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
#define LogDebug(id)

◆ constrain() [4/5]

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.

References HLT_2024v10_cff::track.

69  {
70  VertexState priorVertexState(spot);
71  return constrain(track, priorVertexState);
72 }
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const

◆ constrain() [5/5]

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 }
reco::TransientTrack build(const FreeTrajectoryState &fts) const
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
TransientTrackFromFTSFactory ttFactory

Member Data Documentation

◆ doTrackerBoundCheck_

bool SingleTrackVertexConstraint::doTrackerBoundCheck_
private

Definition at line 64 of file SingleTrackVertexConstraint.h.

◆ theLTrackFactory

LinearizedTrackStateFactory SingleTrackVertexConstraint::theLTrackFactory
private

Definition at line 61 of file SingleTrackVertexConstraint.h.

◆ theVertexTrackUpdator

KalmanVertexTrackUpdator<5> SingleTrackVertexConstraint::theVertexTrackUpdator
private

Definition at line 59 of file SingleTrackVertexConstraint.h.

◆ theVTrackFactory

VertexTrackFactory<5> SingleTrackVertexConstraint::theVTrackFactory
private

Definition at line 62 of file SingleTrackVertexConstraint.h.

◆ ttFactory

TransientTrackFromFTSFactory SingleTrackVertexConstraint::ttFactory
private

Definition at line 63 of file SingleTrackVertexConstraint.h.

◆ vertexUpdator

KalmanVertexUpdator<5> SingleTrackVertexConstraint::vertexUpdator
private

Definition at line 58 of file SingleTrackVertexConstraint.h.