CMS 3D CMS Logo

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

#include <SequentialVertexSmoother.h>

Inheritance diagram for SequentialVertexSmoother< N >:
VertexSmoother< N >

Public Types

typedef ReferenceCountingPointer< LinearizedTrackState< N > > RefCountedLinearizedTrackState
 
typedef ReferenceCountingPointer< RefittedTrackState< N > > RefCountedRefittedTrackState
 
typedef ReferenceCountingPointer< VertexTrack< N > > RefCountedVertexTrack
 

Public Member Functions

SequentialVertexSmoother< N > * clone () const override
 
 SequentialVertexSmoother (const VertexTrackUpdator< N > &vtu, const VertexSmoothedChiSquaredEstimator< N > &vse, const TrackToTrackCovCalculator< N > &covCalc)
 
 SequentialVertexSmoother (const SequentialVertexSmoother< N > &smoother)
 
CachingVertex< Nsmooth (const CachingVertex< N > &vertex) const override
 
const TrackToTrackCovCalculator< N > * trackToTrackCovCalculator () const
 
const VertexSmoothedChiSquaredEstimator< N > * vertexSmoothedChiSquaredEstimator () const
 
const VertexTrackUpdator< N > * vertexTrackUpdator () const
 
 ~SequentialVertexSmoother () override
 
- Public Member Functions inherited from VertexSmoother< N >
 VertexSmoother ()
 
virtual ~VertexSmoother ()
 

Private Attributes

TrackToTrackCovCalculator< N > * theTrackToTrackCovCalculator
 
VertexSmoothedChiSquaredEstimator< N > * theVertexSmoothedChiSquaredEstimator
 
VertexTrackUpdator< N > * theVertexTrackUpdator
 

Detailed Description

template<unsigned int N>
class SequentialVertexSmoother< N >

The class which handles the track-refit, smoothed chi**2 and track-to-track covariance matrix calculations.

Definition at line 15 of file SequentialVertexSmoother.h.

Member Typedef Documentation

Definition at line 19 of file SequentialVertexSmoother.h.

Definition at line 17 of file SequentialVertexSmoother.h.

Definition at line 18 of file SequentialVertexSmoother.h.

Constructor & Destructor Documentation

template<unsigned int N>
SequentialVertexSmoother< N >::SequentialVertexSmoother ( const VertexTrackUpdator< N > &  vtu,
const VertexSmoothedChiSquaredEstimator< N > &  vse,
const TrackToTrackCovCalculator< N > &  covCalc 
)

The constructor, where the different components to be used are specified.

Parameters
vtuThe algorithm to refit the tracks with the vertex constraint (or smoothing)
vseThe algorithm to calculate the smoothed chi**2
Returns
covCalc The algorithm the track-to-track covariance matrix. If this option is not required, this pointer should be 0.

Definition at line 4 of file SequentialVertexSmoother.cc.

Referenced by SequentialVertexSmoother< 5 >::clone().

virtual VertexSmoothedChiSquaredEstimator< N > * clone() const =0
virtual VertexTrackUpdator * clone() const =0
virtual TrackToTrackCovCalculator * clone() const =0
TrackToTrackCovCalculator< N > * theTrackToTrackCovCalculator
VertexTrackUpdator< N > * theVertexTrackUpdator
VertexSmoothedChiSquaredEstimator< N > * theVertexSmoothedChiSquaredEstimator
template<unsigned int N>
SequentialVertexSmoother< N >::~SequentialVertexSmoother ( )
override
template<unsigned int N>
SequentialVertexSmoother< N >::SequentialVertexSmoother ( const SequentialVertexSmoother< N > &  smoother)

Special copy constructor cloning the private data

Definition at line 19 of file SequentialVertexSmoother.cc.

References SequentialVertexSmoother< N >::theTrackToTrackCovCalculator, SequentialVertexSmoother< N >::theVertexSmoothedChiSquaredEstimator, SequentialVertexSmoother< N >::theVertexTrackUpdator, SequentialVertexSmoother< N >::trackToTrackCovCalculator(), SequentialVertexSmoother< N >::vertexSmoothedChiSquaredEstimator(), and SequentialVertexSmoother< N >::vertexTrackUpdator().

19  {
20  theVertexTrackUpdator = smoother.vertexTrackUpdator()->clone();
23 }
const VertexTrackUpdator< N > * vertexTrackUpdator() const
TrackToTrackCovCalculator< N > * theTrackToTrackCovCalculator
const VertexSmoothedChiSquaredEstimator< N > * vertexSmoothedChiSquaredEstimator() const
VertexTrackUpdator< N > * theVertexTrackUpdator
VertexSmoothedChiSquaredEstimator< N > * theVertexSmoothedChiSquaredEstimator
const TrackToTrackCovCalculator< N > * trackToTrackCovCalculator() const

Member Function Documentation

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

Clone method

Implements VertexSmoother< N >.

Definition at line 63 of file SequentialVertexSmoother.h.

63 { return new SequentialVertexSmoother(*this); }
SequentialVertexSmoother(const VertexTrackUpdator< N > &vtu, const VertexSmoothedChiSquaredEstimator< N > &vse, const TrackToTrackCovCalculator< N > &covCalc)
template<unsigned int N>
CachingVertex< N > SequentialVertexSmoother< N >::smooth ( const CachingVertex< N > &  vertex) const
overridevirtual

Methode which will refit the tracks with the vertex constraint, calculate the smoothed vertex chi**2, and, if required, the track-to-track covariance matrix.

Parameters
initVertexis the initial guess of the vertex (a-priori information), used at the start of the fit.
newVertexis the final estimate of the vertex, as given by the last update.
Returns
the final vertex estimate, with all the supplementary information

Implements VertexSmoother< N >.

Definition at line 26 of file SequentialVertexSmoother.cc.

References CachingVertex< N >::hasPrior(), mps_fire::i, CachingVertex< N >::position(), CachingVertex< N >::priorError(), CachingVertex< N >::priorPosition(), CachingVertex< N >::priorVertexState(), mps_fire::result, SequentialVertexSmoother< N >::theTrackToTrackCovCalculator, SequentialVertexSmoother< N >::theVertexSmoothedChiSquaredEstimator, SequentialVertexSmoother< N >::theVertexTrackUpdator, CachingVertex< N >::totalChiSquared(), CachingVertex< N >::tracks(), CachingVertex< N >::vertexState(), and CachingVertex< N >::weight().

26  {
27  // Track refit
28 
29  std::vector<RefCountedVertexTrack> newTracks;
30  if (theVertexTrackUpdator != nullptr) {
31  const std::vector<RefCountedVertexTrack>& vOut = vertex.tracks();
32  for (typename std::vector<RefCountedVertexTrack>::const_iterator i = vOut.begin(); i != vOut.end(); i++) {
33  RefCountedVertexTrack nTrack = theVertexTrackUpdator->update(vertex, *i);
34  newTracks.push_back(nTrack);
35  }
36  } else {
37  newTracks = vertex.tracks();
38  }
39 
40  // intermediate vertex for chi2 calculation and TktoTkcovariance map
41  CachingVertex<N> interVertex(vertex.position(), vertex.weight(), newTracks, 0.);
42  if (vertex.hasPrior()) {
43  interVertex = CachingVertex<N>(
44  vertex.priorPosition(), vertex.priorError(), vertex.position(), vertex.weight(), newTracks, 0.);
45  }
46 
47  // Smoothed chi2
48 
49  float smChi2 = vertex.totalChiSquared();
50  if (theVertexSmoothedChiSquaredEstimator != nullptr) {
51  std::pair<bool, double> result = theVertexSmoothedChiSquaredEstimator->estimate(interVertex);
52  smChi2 = result.second;
53  }
54 
55  if (theTrackToTrackCovCalculator == nullptr) {
56  if (vertex.hasPrior()) {
57  return CachingVertex<N>(vertex.priorVertexState(), vertex.vertexState(), newTracks, smChi2);
58  } else {
59  return CachingVertex<N>(vertex.vertexState(), newTracks, smChi2);
60  }
61  }
62 
63  //TktoTkcovariance map
64  typename CachingVertex<N>::TrackToTrackMap tkMap = (*theTrackToTrackCovCalculator)(interVertex);
65 
66  // CachingVertex<N> finalVertex(vertex.position(), vertex.error(),
67  // newTracks, smChi2, tkMap);
68  if (vertex.hasPrior()) {
69  CachingVertex<N> finalVertex(vertex.priorVertexState(), vertex.vertexState(), newTracks, smChi2, tkMap);
70  return finalVertex;
71  }
72 
73  CachingVertex<N> finalVertex(vertex.vertexState(), newTracks, smChi2, tkMap);
74  return finalVertex;
75 }
std::vector< RefCountedVertexTrack > tracks() const
VertexState const & vertexState() const
GlobalError priorError() const
ReferenceCountingPointer< VertexTrack< N > > RefCountedVertexTrack
GlobalWeight weight() const
float totalChiSquared() const
bool hasPrior() const
TrackToTrackCovCalculator< N > * theTrackToTrackCovCalculator
VertexTrackUpdator< N > * theVertexTrackUpdator
VertexState const & priorVertexState() const
VertexSmoothedChiSquaredEstimator< N > * theVertexSmoothedChiSquaredEstimator
GlobalPoint position() const
GlobalPoint priorPosition() const
std::map< RefCountedVertexTrack, TrackMap > TrackToTrackMap
Definition: CachingVertex.h:28
template<unsigned int N>
const TrackToTrackCovCalculator<N>* SequentialVertexSmoother< N >::trackToTrackCovCalculator ( ) const
inline

Definition at line 58 of file SequentialVertexSmoother.h.

Referenced by SequentialVertexSmoother< N >::SequentialVertexSmoother().

TrackToTrackCovCalculator< N > * theTrackToTrackCovCalculator
template<unsigned int N>
const VertexSmoothedChiSquaredEstimator<N>* SequentialVertexSmoother< N >::vertexSmoothedChiSquaredEstimator ( ) const
inline

Definition at line 55 of file SequentialVertexSmoother.h.

Referenced by SequentialVertexSmoother< N >::SequentialVertexSmoother().

55  {
57  }
VertexSmoothedChiSquaredEstimator< N > * theVertexSmoothedChiSquaredEstimator
template<unsigned int N>
const VertexTrackUpdator<N>* SequentialVertexSmoother< N >::vertexTrackUpdator ( ) const
inline

Access methods

Definition at line 54 of file SequentialVertexSmoother.h.

Referenced by SequentialVertexSmoother< N >::SequentialVertexSmoother().

54 { return theVertexTrackUpdator; }
VertexTrackUpdator< N > * theVertexTrackUpdator

Member Data Documentation

template<unsigned int N>
TrackToTrackCovCalculator<N>* SequentialVertexSmoother< N >::theTrackToTrackCovCalculator
private
template<unsigned int N>
VertexSmoothedChiSquaredEstimator<N>* SequentialVertexSmoother< N >::theVertexSmoothedChiSquaredEstimator
private
template<unsigned int N>
VertexTrackUpdator<N>* SequentialVertexSmoother< N >::theVertexTrackUpdator
private