00001 #include "RecoVertex/KalmanVertexFit/interface/KalmanSmoothedVertexChi2Estimator.h" 00002 // #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexTrackCompatibilityEstimator.h" 00003 00004 00005 template <unsigned int N> 00006 float KalmanSmoothedVertexChi2Estimator<N>::estimate(const CachingVertex<N> & vertex) const 00007 { 00008 //initial vertex part 00009 float v_part = 0.; 00010 float returnChi = 0.; 00011 00012 if (vertex.hasPrior()) { 00013 v_part = helper.vertexChi2(vertex.priorVertexState(), vertex.vertexState()); 00014 } 00015 00016 //vector of tracks part 00017 typedef typename CachingVertex<N>::RefCountedVertexTrack RefCountedVertexTrack; 00018 vector< RefCountedVertexTrack > tracks = vertex.tracks(); 00019 float sum = 0.; 00020 for(typename vector<RefCountedVertexTrack>::iterator i = tracks.begin(); i != tracks.end(); i++) 00021 { 00022 sum += (*i)->weight() * helper.trackParameterChi2((*i)->linearizedTrack(), (*i)->refittedState()); 00023 } 00024 returnChi = v_part + sum; 00025 return returnChi; 00026 } 00027 00028 template class KalmanSmoothedVertexChi2Estimator<5>; 00029 template class KalmanSmoothedVertexChi2Estimator<6>;