CMS 3D CMS Logo

Functions
svhelper Namespace Reference

Functions

double cov33 (const reco::Vertex &sv)
 
double cov33 (const reco::VertexCompositePtrCandidate &sv)
 
void updateVertexTime (TransientVertex &vtx)
 

Function Documentation

◆ cov33() [1/2]

double svhelper::cov33 ( const reco::Vertex sv)
inline

◆ cov33() [2/2]

double svhelper::cov33 ( const reco::VertexCompositePtrCandidate sv)
inline

◆ updateVertexTime()

void svhelper::updateVertexTime ( TransientVertex vtx)
inline

Definition at line 11 of file SVTimeHelpers.h.

References submitPVResolutionJobs::err, edm::isFinite(), hcalRecHitTable_cff::time, hltEgammaHLTExtra_cfi::trks, L1BJetProducer_cff::vtx, and w().

Referenced by TemplatedInclusiveVertexFinder< InputContainer, VTX >::produce(), and TrackVertexArbitration< VTX >::trackVertexArbitrator().

11  {
12  const auto& trks = vtx.originalTracks();
13  double meantime = 0., expv_x2 = 0., normw = 0., timecov = 0.;
14  for (const auto& trk : trks) {
15  if (edm::isFinite(trk.timeExt())) {
16  const double time = trk.timeExt();
17  const double inverr = 1.0 / trk.dtErrorExt();
18  const double w = inverr * inverr;
19  meantime += time * w;
20  expv_x2 += time * time * w;
21  normw += w;
22  }
23  }
24  if (normw > 0.) {
25  meantime = meantime / normw;
26  expv_x2 = expv_x2 / normw;
27  timecov = expv_x2 - meantime * meantime;
28  auto err = vtx.positionError().matrix4D();
29  err(3, 3) = timecov / (double)trks.size();
30  vtx = TransientVertex(vtx.position(), meantime, err, vtx.originalTracks(), vtx.totalChiSquared());
31  }
32  }
T w() const
constexpr bool isFinite(T x)