CMS 3D CMS Logo

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

Member Typedef Documentation

◆ BTFtuple

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

Definition at line 22 of file SingleTrackVertexConstraint.h.

◆ TrackFloatPair

Definition at line 21 of file SingleTrackVertexConstraint.h.

Constructor & Destructor Documentation

◆ SingleTrackVertexConstraint()

SingleTrackVertexConstraint::SingleTrackVertexConstraint ( bool  doTrackerBoundCheck = true)
inline

Definition at line 24 of file SingleTrackVertexConstraint.h.

24 : doTrackerBoundCheck_(doTrackerBoundCheck) {}

Member Function Documentation

◆ constrain() [1/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 }

◆ constrain() [2/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 }

◆ constrain() [3/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.

23  {
24  VertexState priorVertexState(priorPos, priorError);
25  return constrain(track, priorVertexState);
26 }

References HLT_2018_cff::track.

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

◆ 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.

69  {
70  VertexState priorVertexState(spot);
71  return constrain(track, priorVertexState);
72 }

References HLT_2018_cff::track.

◆ constrain() [5/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.

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 }

References MillePedeFileConverter_cfg::e, LogDebug, VertexState::position(), HLT_2018_cff::track, and bphysicsOniaDQM_cfi::vertex.

Member Data Documentation

◆ doTrackerBoundCheck_

bool SingleTrackVertexConstraint::doTrackerBoundCheck_
private

Definition at line 63 of file SingleTrackVertexConstraint.h.

◆ theLTrackFactory

LinearizedTrackStateFactory SingleTrackVertexConstraint::theLTrackFactory
private

Definition at line 60 of file SingleTrackVertexConstraint.h.

◆ theVertexTrackUpdator

KalmanVertexTrackUpdator<5> SingleTrackVertexConstraint::theVertexTrackUpdator
private

Definition at line 58 of file SingleTrackVertexConstraint.h.

◆ theVTrackFactory

VertexTrackFactory<5> SingleTrackVertexConstraint::theVTrackFactory
private

Definition at line 61 of file SingleTrackVertexConstraint.h.

◆ ttFactory

TransientTrackFromFTSFactory SingleTrackVertexConstraint::ttFactory
private

Definition at line 62 of file SingleTrackVertexConstraint.h.

◆ vertexUpdator

KalmanVertexUpdator<5> SingleTrackVertexConstraint::vertexUpdator
private

Definition at line 57 of file SingleTrackVertexConstraint.h.

CachingVertex
Definition: CachingVertex.h:22
SingleTrackVertexConstraint::BTFtuple
boost::tuple< bool, reco::TransientTrack, float > BTFtuple
Definition: SingleTrackVertexConstraint.h:22
ReferenceCountingPointer< LinearizedTrackState< N > >
LinearizedTrackStateFactory::linearizedTrackState
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, const reco::TransientTrack &track) const override
Definition: LinearizedTrackStateFactory.cc:9
KalmanVertexUpdator::add
CachingVertex< N > add(const CachingVertex< N > &oldVertex, const RefCountedVertexTrack track) const override
Definition: KalmanVertexUpdator.cc:56
SingleTrackVertexConstraint::theLTrackFactory
LinearizedTrackStateFactory theLTrackFactory
Definition: SingleTrackVertexConstraint.h:60
SingleTrackVertexConstraint::constrain
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
Definition: SingleTrackVertexConstraint.cc:21
DDAxes::z
SingleTrackVertexConstraint::ttFactory
TransientTrackFromFTSFactory ttFactory
Definition: SingleTrackVertexConstraint.h:62
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
TransientTrackFromFTSFactory::build
reco::TransientTrack build(const FreeTrajectoryState &fts) const
Definition: TransientTrackFromFTSFactory.cc:7
KalmanVertexTrackUpdator::update
RefCountedVertexTrack update(const CachingVertex< N > &vertex, RefCountedVertexTrack track) const override
Definition: KalmanVertexTrackUpdator.cc:12
SingleTrackVertexConstraint::doTrackerBoundCheck_
bool doTrackerBoundCheck_
Definition: SingleTrackVertexConstraint.h:63
SingleTrackVertexConstraint::theVTrackFactory
VertexTrackFactory< 5 > theVTrackFactory
Definition: SingleTrackVertexConstraint.h:61
VertexTrackFactory::vertexTrack
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
Definition: VertexTrackFactory.h:27
reco::TransientTrack
Definition: TransientTrack.h:19
SingleTrackVertexConstraint::theVertexTrackUpdator
KalmanVertexTrackUpdator< 5 > theVertexTrackUpdator
Definition: SingleTrackVertexConstraint.h:58
VertexState
Definition: VertexState.h:13
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
SingleTrackVertexConstraint::vertexUpdator
KalmanVertexUpdator< 5 > vertexUpdator
Definition: SingleTrackVertexConstraint.h:57
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37