CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
KalmanVertexTrackCompatibilityEstimator< N > Class Template Reference

#include <KalmanVertexTrackCompatibilityEstimator.h>

Inheritance diagram for KalmanVertexTrackCompatibilityEstimator< N >:
VertexTrackCompatibilityEstimator< N >

Public Types

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

Public Member Functions

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

Private Member Functions

BDpair estimateDifference (const CachingVertex< N > &more, const CachingVertex< N > &less, const RefCountedVertexTrack track) const
 
BDpair estimateFittedTrack (const CachingVertex< N > &v, const RefCountedVertexTrack track) const
 
BDpair estimateNFittedTrack (const CachingVertex< N > &v, const RefCountedVertexTrack track) const
 

Private Attributes

KVFHelper< Nhelper
 
KalmanVertexTrackUpdator< NtrackUpdator
 
KalmanVertexUpdator< Nupdator
 
VertexTrackFactory< NvTrackFactory
 

Detailed Description

template<unsigned int N>
class KalmanVertexTrackCompatibilityEstimator< N >

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 KalmanVertexTrackCompatibilityEstimator.h.

Member Typedef Documentation

◆ BDpair

template<unsigned int N>
typedef std::pair<bool, double> KalmanVertexTrackCompatibilityEstimator< N >::BDpair

Definition at line 29 of file KalmanVertexTrackCompatibilityEstimator.h.

◆ RefCountedLinearizedTrackState

Definition at line 27 of file KalmanVertexTrackCompatibilityEstimator.h.

◆ RefCountedRefittedTrackState

Definition at line 28 of file KalmanVertexTrackCompatibilityEstimator.h.

◆ RefCountedVertexTrack

Definition at line 26 of file KalmanVertexTrackCompatibilityEstimator.h.

Constructor & Destructor Documentation

◆ KalmanVertexTrackCompatibilityEstimator()

◆ ~KalmanVertexTrackCompatibilityEstimator()

template<unsigned int N>
KalmanVertexTrackCompatibilityEstimator< N >::~KalmanVertexTrackCompatibilityEstimator ( )
inlineoverride

Definition at line 33 of file KalmanVertexTrackCompatibilityEstimator.h.

33 {}

Member Function Documentation

◆ clone()

template<unsigned int N>
KalmanVertexTrackCompatibilityEstimator<N>* KalmanVertexTrackCompatibilityEstimator< N >::clone ( ) const
inlineoverridevirtual

◆ estimate() [1/3]

template<unsigned int N>
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimate ( const CachingVertex< N > &  v,
const RefCountedLinearizedTrackState  track,
unsigned int  hint = UINT_MAX 
) const
overridevirtual

Methods giving back the compatibility estimation

Implements VertexTrackCompatibilityEstimator< N >.

Definition at line 33 of file KalmanVertexTrackCompatibilityEstimator.cc.

34  {
35  RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(track, vertex.vertexState());
36  return estimate(vertex, vertexTrack, hint);
37 }

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

◆ estimate() [2/3]

template<unsigned int N>
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimate ( const CachingVertex< N > &  vrt,
const RefCountedVertexTrack  track,
unsigned int  hint = UINT_MAX 
) const
overridevirtual

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.

Implements VertexTrackCompatibilityEstimator< N >.

Definition at line 8 of file KalmanVertexTrackCompatibilityEstimator.cc.

9  {
10  //checking if the track passed really belongs to the vertex
11 
12  const std::vector<RefCountedVertexTrack> &tracks = vertex.tracksRef();
13 
14  if (tracks.empty())
15  return estimateNFittedTrack(vertex, tr);
16 
17  if (hint < tracks.size()) {
19  if (d(tracks[hint]))
20  return estimateFittedTrack(vertex, tracks[hint]);
21  }
22 
23  typename std::vector<RefCountedVertexTrack>::const_iterator pos =
24  find_if(tracks.begin(), tracks.end(), VertexTrackEqual<N>(tr));
25  if (pos != tracks.end()) {
26  return estimateFittedTrack(vertex, *pos);
27  } else {
28  return estimateNFittedTrack(vertex, tr);
29  }
30 }

References ztail::d, tracks, and bphysicsOniaDQM_cfi::vertex.

Referenced by MultiVertexFitter::updateWeights().

◆ estimate() [3/3]

template<unsigned int N>
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimate ( const reco::Vertex vertex,
const reco::TransientTrack track 
) const
overridevirtual

Implements VertexTrackCompatibilityEstimator< N >.

Definition at line 40 of file KalmanVertexTrackCompatibilityEstimator.cc.

41  {
42  // GlobalPoint linP(vertex.position().x(), vertex.position().z(),vertex.position().z());
43  GlobalPoint linP(Basic3DVector<float>(vertex.position()));
44 
45  LinearizedTrackStateFactory lTrackFactory;
46  RefCountedLinearizedTrackState linTrack = lTrackFactory.linearizedTrackState(linP, track);
47  GlobalError err(vertex.covariance());
48  VertexState vState(linP, err);
49  RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(linTrack, vState);
50 
51  std::vector<RefCountedVertexTrack> initialTracks(1, vertexTrack);
52  CachingVertex<N> cachingVertex(linP, err, initialTracks, vertex.chi2());
53  // FIXME: this should work also for tracks without a persistent ref.
54  // return estimateNFittedTrack(cachingVertex, vertexTrack);
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 }

References submitPVResolutionJobs::err, spr::find(), LinearizedTrackStateFactory::linearizedTrackState(), HLT_FULL_cff::track, and bphysicsOniaDQM_cfi::vertex.

◆ estimateDifference()

template<unsigned int N>
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimateDifference ( const CachingVertex< N > &  more,
const CachingVertex< N > &  less,
const RefCountedVertexTrack  track 
) const
private

Definition at line 95 of file KalmanVertexTrackCompatibilityEstimator.cc.

97  {
98  BDpair trackRes = helper.trackParameterChi2(track);
99  return BDpair(trackRes.first, trackRes.second + helper.vertexChi2(less, more));
100 }

References gpuVertexFinder::more, and HLT_FULL_cff::track.

◆ estimateFittedTrack()

template<unsigned int N>
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimateFittedTrack ( const CachingVertex< N > &  v,
const RefCountedVertexTrack  track 
) const
private

Definition at line 67 of file KalmanVertexTrackCompatibilityEstimator.cc.

68  {
69  //remove track from the vertex using the vertex updator
70  // Using the update instead of the remove methode, we can specify a weight which
71  // is different than then one which the vertex track has been defined with.
72  //CachingVertex rVert = updator.remove(v, track);
73  RefCountedVertexTrack newSmoothedTrack = trackUpdator.update(v, track);
74  // std::cout << newSmoothedTrack->smoothedChi2()<<" "<<estimateDifference(v,rVert,newSmoothedTrack)<<std::endl;
75  // return estimateDifference(v,rVert,newSmoothedTrack);
76  return BDpair(true, newSmoothedTrack->smoothedChi2());
77 }

References HLT_FULL_cff::track, and findQualityFiles::v.

◆ estimateNFittedTrack()

template<unsigned int N>
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimateNFittedTrack ( const CachingVertex< N > &  v,
const RefCountedVertexTrack  track 
) const
private

Definition at line 83 of file KalmanVertexTrackCompatibilityEstimator.cc.

84  {
85  // Using the update instead of the add methode, we can specify a weight which
86  // is different than then one which the vertex track has been defined with.
87  CachingVertex<N> rVert = updator.add(v, track);
88  if (!rVert.isValid())
89  return BDpair(false, -1.);
90  return BDpair(true, rVert.totalChiSquared() - v.totalChiSquared());
91 }

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

Member Data Documentation

◆ helper

template<unsigned int N>
KVFHelper<N> KalmanVertexTrackCompatibilityEstimator< N >::helper
private

Definition at line 66 of file KalmanVertexTrackCompatibilityEstimator.h.

◆ trackUpdator

template<unsigned int N>
KalmanVertexTrackUpdator<N> KalmanVertexTrackCompatibilityEstimator< N >::trackUpdator
private

Definition at line 64 of file KalmanVertexTrackCompatibilityEstimator.h.

◆ updator

template<unsigned int N>
KalmanVertexUpdator<N> KalmanVertexTrackCompatibilityEstimator< N >::updator
private

Definition at line 63 of file KalmanVertexTrackCompatibilityEstimator.h.

◆ vTrackFactory

template<unsigned int N>
VertexTrackFactory<N> KalmanVertexTrackCompatibilityEstimator< N >::vTrackFactory
private

Definition at line 65 of file KalmanVertexTrackCompatibilityEstimator.h.

HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
CachingVertex
Definition: CachingVertex.h:22
KalmanVertexTrackCompatibilityEstimator::estimateNFittedTrack
BDpair estimateNFittedTrack(const CachingVertex< N > &v, const RefCountedVertexTrack track) const
Definition: KalmanVertexTrackCompatibilityEstimator.cc:83
pos
Definition: PixelAliasList.h:18
KalmanVertexTrackCompatibilityEstimator::estimateFittedTrack
BDpair estimateFittedTrack(const CachingVertex< N > &v, const RefCountedVertexTrack track) const
Definition: KalmanVertexTrackCompatibilityEstimator.cc:67
findQualityFiles.v
v
Definition: findQualityFiles.py:179
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
LinearizedTrackStateFactory::linearizedTrackState
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, const reco::TransientTrack &track) const override
Definition: LinearizedTrackStateFactory.cc:9
gpuVertexFinder::more
bool more
Definition: gpuClusterTracksIterative.h:108
LinearizedTrackStateFactory
Definition: LinearizedTrackStateFactory.h:14
Point3DBase< float, GlobalTag >
CachingVertex::totalChiSquared
float totalChiSquared() const
Definition: CachingVertex.h:159
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
helper
Definition: helper.py:1
KalmanVertexTrackCompatibilityEstimator::estimate
BDpair estimate(const CachingVertex< N > &vrt, const RefCountedVertexTrack track, unsigned int hint=UINT_MAX) const override
Definition: KalmanVertexTrackCompatibilityEstimator.cc:8
GlobalErrorBase< double, ErrorMatrixTag >
KalmanVertexTrackCompatibilityEstimator::trackUpdator
KalmanVertexTrackUpdator< N > trackUpdator
Definition: KalmanVertexTrackCompatibilityEstimator.h:64
KalmanVertexTrackCompatibilityEstimator::vTrackFactory
VertexTrackFactory< N > vTrackFactory
Definition: KalmanVertexTrackCompatibilityEstimator.h:65
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
KalmanVertexTrackCompatibilityEstimator::RefCountedLinearizedTrackState
VertexTrack< N >::RefCountedLinearizedTrackState RefCountedLinearizedTrackState
Definition: KalmanVertexTrackCompatibilityEstimator.h:27
VertexState
Definition: VertexState.h:13
CachingVertex::isValid
bool isValid() const
Definition: CachingVertex.h:154
ztail.d
d
Definition: ztail.py:151
KalmanVertexTrackCompatibilityEstimator::KalmanVertexTrackCompatibilityEstimator
KalmanVertexTrackCompatibilityEstimator()
Definition: KalmanVertexTrackCompatibilityEstimator.h:31
KalmanVertexTrackCompatibilityEstimator::updator
KalmanVertexUpdator< N > updator
Definition: KalmanVertexTrackCompatibilityEstimator.h:63
VertexTrackEqual
Definition: VertexTrack.h:114
KalmanVertexTrackCompatibilityEstimator::BDpair
std::pair< bool, double > BDpair
Definition: KalmanVertexTrackCompatibilityEstimator.h:29
Basic3DVector< float >
KalmanVertexTrackCompatibilityEstimator::RefCountedVertexTrack
CachingVertex< N >::RefCountedVertexTrack RefCountedVertexTrack
Definition: KalmanVertexTrackCompatibilityEstimator.h:26