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 > &v, const RefCountedLinearizedTrackState track, unsigned int hint=UINT_MAX) const override
 
BDpair estimate (const CachingVertex< 5 > &vrt, const RefCountedVertexTrack 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.

28 {}

Referenced by clone().

◆ ~GsfVertexTrackCompatibilityEstimator()

GsfVertexTrackCompatibilityEstimator::~GsfVertexTrackCompatibilityEstimator ( )
inlineoverride

Definition at line 30 of file GsfVertexTrackCompatibilityEstimator.h.

30 {}

Member Function Documentation

◆ clone()

GsfVertexTrackCompatibilityEstimator* GsfVertexTrackCompatibilityEstimator::clone ( void  ) const
inlineoverridevirtual

Clone method

Implements VertexTrackCompatibilityEstimator< 5 >.

Definition at line 50 of file GsfVertexTrackCompatibilityEstimator.h.

50  {
51  return new GsfVertexTrackCompatibilityEstimator(*this);
52  }

References GsfVertexTrackCompatibilityEstimator().

◆ estimate() [1/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.

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

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

◆ estimate() [2/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.

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 }

References tracks, and bphysicsOniaDQM_cfi::vertex.

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

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 }

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

◆ estimateFittedTrack()

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

Definition at line 65 of file GsfVertexTrackCompatibilityEstimator.cc.

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 }

References HLT_FULL_cff::track.

◆ estimateNFittedTrack()

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

Definition at line 81 of file GsfVertexTrackCompatibilityEstimator.cc.

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 }

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

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.

HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
VertexException
Common base class.
Definition: VertexException.h:12
CachingVertex< 5 >
pos
Definition: PixelAliasList.h:18
GsfVertexTrackCompatibilityEstimator::GsfVertexTrackCompatibilityEstimator
GsfVertexTrackCompatibilityEstimator()
Definition: GsfVertexTrackCompatibilityEstimator.h:28
GsfVertexTrackCompatibilityEstimator::RefCountedVertexTrack
CachingVertex< 5 >::RefCountedVertexTrack RefCountedVertexTrack
Definition: GsfVertexTrackCompatibilityEstimator.h:26
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
VertexTrackCompatibilityEstimator< 5 >::RefCountedLinearizedTrackState
VertexTrack< N >::RefCountedLinearizedTrackState RefCountedLinearizedTrackState
Definition: VertexTrackCompatibilityEstimator.h:18
GsfVertexTrackCompatibilityEstimator::lTrackFactory
MultiPerigeeLTSFactory lTrackFactory
Definition: GsfVertexTrackCompatibilityEstimator.h:60
GsfVertexTrackCompatibilityEstimator::estimateNFittedTrack
BDpair estimateNFittedTrack(const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const
Definition: GsfVertexTrackCompatibilityEstimator.cc:81
Point3DBase< float, GlobalTag >
CachingVertex::totalChiSquared
float totalChiSquared() const
Definition: CachingVertex.h:159
GsfVertexUpdator::add
CachingVertex< 5 > add(const CachingVertex< 5 > &oldVertex, const RefCountedVertexTrack track) const override
Definition: GsfVertexUpdator.cc:11
GsfVertexTrackCompatibilityEstimator::estimate
BDpair estimate(const CachingVertex< 5 > &vrt, const RefCountedVertexTrack track, unsigned int hint=UINT_MAX) const override
Definition: GsfVertexTrackCompatibilityEstimator.cc:20
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
VertexTrackCompatibilityEstimator< 5 >::BDpair
std::pair< bool, double > BDpair
Definition: VertexTrackCompatibilityEstimator.h:19
GlobalErrorBase< double, ErrorMatrixTag >
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
VertexTrackFactory::vertexTrack
RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt, const VertexState vs, float weight=1.0) const
Definition: VertexTrackFactory.h:27
MultiPerigeeLTSFactory::linearizedTrackState
RefCountedLinearizedTrackState linearizedTrackState(const GlobalPoint &linP, const reco::TransientTrack &track) const override
Definition: MultiPerigeeLTSFactory.cc:16
VertexState
Definition: VertexState.h:13
CachingVertex::isValid
bool isValid() const
Definition: CachingVertex.h:154
GsfVertexTrackCompatibilityEstimator::vTrackFactory
VertexTrackFactory< 5 > vTrackFactory
Definition: GsfVertexTrackCompatibilityEstimator.h:61
VertexTrackEqual
Definition: VertexTrack.h:114
GsfVertexTrackCompatibilityEstimator::updator
GsfVertexUpdator updator
Definition: GsfVertexTrackCompatibilityEstimator.h:58
GsfVertexTrackCompatibilityEstimator::estimateFittedTrack
BDpair estimateFittedTrack(const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const
Definition: GsfVertexTrackCompatibilityEstimator.cc:65
Basic3DVector< float >