CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
GsfVertexTrackCompatibilityEstimator Class Reference

#include <GsfVertexTrackCompatibilityEstimator.h>

Inheritance diagram for GsfVertexTrackCompatibilityEstimator:
VertexTrackCompatibilityEstimator< 5 >

Public Types

typedef CachingVertex< 5 >::RefCountedVertexTrack RefCountedVertexTrack
 
- Public Types inherited from VertexTrackCompatibilityEstimator< 5 >
typedef std::pair< bool, double > BDpair
 
typedef VertexTrack< N >::RefCountedLinearizedTrackState RefCountedLinearizedTrackState
 
typedef CachingVertex< N >::RefCountedVertexTrack RefCountedVertexTrack
 

Public Member Functions

GsfVertexTrackCompatibilityEstimatorclone () const override
 
BDpair estimate (const CachingVertex< 5 > &vrt, const RefCountedVertexTrack track, unsigned int hint=UINT_MAX) const override
 
BDpair estimate (const CachingVertex< 5 > &v, const RefCountedLinearizedTrackState track, unsigned int hint=UINT_MAX) const override
 
BDpair estimate (const reco::Vertex &vertex, const reco::TransientTrack &track) const override
 
 GsfVertexTrackCompatibilityEstimator ()
 
 ~GsfVertexTrackCompatibilityEstimator () override
 
- Public Member Functions inherited from VertexTrackCompatibilityEstimator< 5 >
virtual BDpair estimate (const CachingVertex< N > &v, const RefCountedLinearizedTrackState track, unsigned int hint=UINT_MAX) const=0
 
virtual BDpair estimate (const CachingVertex< N > &v, const RefCountedVertexTrack track, unsigned int hint=UINT_MAX) const=0
 
 VertexTrackCompatibilityEstimator ()
 
virtual ~VertexTrackCompatibilityEstimator ()
 

Private Member Functions

BDpair estimateFittedTrack (const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const
 
BDpair estimateNFittedTrack (const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const
 

Private Attributes

MultiPerigeeLTSFactory lTrackFactory
 
GsfVertexUpdator updator
 
VertexTrackFactory< 5 > vTrackFactory
 

Detailed Description

Calculates the compatiblity of a track with respect to a vertex using the Kalman filter algorithms. The compatibility is computed from the squared standardized residuals between the track and the vertex. If track and vertex errors are Gaussian and correct, this quantity is distributed as chi**2(ndf=2)). Can be used to identify outlying tracks.

Definition at line 24 of file GsfVertexTrackCompatibilityEstimator.h.

Member Typedef Documentation

◆ RefCountedVertexTrack

Definition at line 26 of file GsfVertexTrackCompatibilityEstimator.h.

Constructor & Destructor Documentation

◆ GsfVertexTrackCompatibilityEstimator()

GsfVertexTrackCompatibilityEstimator::GsfVertexTrackCompatibilityEstimator ( )
inline

Definition at line 28 of file GsfVertexTrackCompatibilityEstimator.h.

Referenced by clone().

28 {}

◆ ~GsfVertexTrackCompatibilityEstimator()

GsfVertexTrackCompatibilityEstimator::~GsfVertexTrackCompatibilityEstimator ( )
inlineoverride

Definition at line 30 of file GsfVertexTrackCompatibilityEstimator.h.

30 {}

Member Function Documentation

◆ clone()

GsfVertexTrackCompatibilityEstimator* GsfVertexTrackCompatibilityEstimator::clone ( void  ) const
inlineoverridevirtual

◆ estimate() [1/3]

std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimate ( const CachingVertex< 5 > &  vrt,
const RefCountedVertexTrack  track,
unsigned int  hint = UINT_MAX 
) const
override

Track-to-vertex compatibility. The track weight is taken into account.

Parameters
trackThe track for which the chi**2 has to be estimated.
vThe vertex against which the chi**2 has to be estimated.
Returns
The chi**2.

Definition at line 20 of file GsfVertexTrackCompatibilityEstimator.cc.

References DiMuonV_cfg::tracks, and bphysicsOniaDQM_cfi::vertex.

22  {
23  //checking if the track passed really belongs to the vertex
24  std::vector<RefCountedVertexTrack> tracks = vertex.tracks();
25  std::vector<RefCountedVertexTrack>::iterator pos = find_if(tracks.begin(), tracks.end(), VertexTrackEqual<5>(tr));
26  if (pos != tracks.end()) {
27  return estimateFittedTrack(vertex, *pos);
28  } else {
29  return estimateNFittedTrack(vertex, tr);
30  }
31 }
BDpair estimateFittedTrack(const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const
BDpair estimateNFittedTrack(const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const

◆ estimate() [2/3]

std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimate ( const CachingVertex< 5 > &  v,
const RefCountedLinearizedTrackState  track,
unsigned int  hint = UINT_MAX 
) const
override

Definition at line 33 of file GsfVertexTrackCompatibilityEstimator.cc.

References HLT_2023v12_cff::track, and bphysicsOniaDQM_cfi::vertex.

35  {
36  RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(track, vertex.vertexState());
37  return estimate(vertex, vertexTrack);
38 }
CachingVertex< 5 >::RefCountedVertexTrack RefCountedVertexTrack
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
BDpair estimate(const CachingVertex< 5 > &vrt, const RefCountedVertexTrack track, unsigned int hint=UINT_MAX) const override

◆ estimate() [3/3]

std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimate ( const reco::Vertex vertex,
const reco::TransientTrack track 
) const
overridevirtual

Implements VertexTrackCompatibilityEstimator< 5 >.

Definition at line 40 of file GsfVertexTrackCompatibilityEstimator.cc.

References submitPVResolutionJobs::err, spr::find(), HLT_2023v12_cff::track, and bphysicsOniaDQM_cfi::vertex.

41  {
42  // GlobalPoint linP(vertex.position().x(), vertex.position().z(),vertex.position().z());
43  GlobalPoint linP(Basic3DVector<float>(vertex.position()));
44 
46  GlobalError err(vertex.covariance());
47  VertexState vState(linP, err);
48  RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(linTrack, vState);
49 
50  std::vector<RefCountedVertexTrack> initialTracks(1, vertexTrack);
51  CachingVertex<5> cachingVertex(linP, err, initialTracks, vertex.chi2());
52  // FIXME: this should work also for tracks without a persistent ref.
53  // const TrackTransientTrack* ttt = dynamic_cast<const TrackTransientTrack*>(track.basicTransientTrack());
54  // if ((ttt!=0) &&
55  if (find(vertex.tracks_begin(), vertex.tracks_end(), track.trackBaseRef()) != vertex.tracks_end()) {
56  return estimateFittedTrack(cachingVertex, vertexTrack);
57  } else {
58  return estimateNFittedTrack(cachingVertex, vertexTrack);
59  }
60 }
CachingVertex< 5 >::RefCountedVertexTrack RefCountedVertexTrack
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
VertexTrack< N >::RefCountedLinearizedTrackState RefCountedLinearizedTrackState
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
BDpair estimateFittedTrack(const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, const reco::TransientTrack &track) const override
BDpair estimateNFittedTrack(const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const

◆ estimateFittedTrack()

std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimateFittedTrack ( const CachingVertex< 5 > &  v,
const RefCountedVertexTrack  track 
) const
private

Definition at line 65 of file GsfVertexTrackCompatibilityEstimator.cc.

References HLT_2023v12_cff::track.

66  {
67  //remove track from the vertex using the vertex updator
68  // Using the update instead of the remove methode, we can specify a weight which
69  // is different than then one which the vertex track has been defined with.
70  if (track->refittedStateAvailable())
71  return BDpair(true, track->smoothedChi2());
72  throw VertexException("GsfVertexTrackCompatibilityEstimator::vertex has to be smoothed.");
73 
74  // CachingVertex rVert = updator.remove(v, track);
75  // RefCountedVertexTrack newSmoothedTrack = trackUpdator.update(v, track);
76  // return estimateDifference(v,rVert,newSmoothedTrack);
77 }
Common base class.

◆ estimateNFittedTrack()

std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimateNFittedTrack ( const CachingVertex< 5 > &  v,
const RefCountedVertexTrack  track 
) const
private

Definition at line 81 of file GsfVertexTrackCompatibilityEstimator.cc.

References CachingVertex< N >::isValid(), CachingVertex< N >::totalChiSquared(), HLT_2023v12_cff::track, HLT_2023v12_cff::updator, and findQualityFiles::v.

82  {
83  // Using the update instead of the add methode, we can specify a weight which
84  // is different than then one which the vertex track has been defined with.
86  if (!rVert.isValid())
87  return BDpair(false, -1.);
88  return BDpair(true, rVert.totalChiSquared() - v.totalChiSquared());
89 }
CachingVertex< 5 > add(const CachingVertex< 5 > &oldVertex, const RefCountedVertexTrack track) const override
float totalChiSquared() const
bool isValid() const

Member Data Documentation

◆ lTrackFactory

MultiPerigeeLTSFactory GsfVertexTrackCompatibilityEstimator::lTrackFactory
private

Definition at line 60 of file GsfVertexTrackCompatibilityEstimator.h.

◆ updator

GsfVertexUpdator GsfVertexTrackCompatibilityEstimator::updator
private

Definition at line 58 of file GsfVertexTrackCompatibilityEstimator.h.

◆ vTrackFactory

VertexTrackFactory<5> GsfVertexTrackCompatibilityEstimator::vTrackFactory
private

Definition at line 61 of file GsfVertexTrackCompatibilityEstimator.h.