CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions
VertexTimeAlgorithmLegacy4D Class Reference

#include <VertexTimeAlgorithmLegacy4D.h>

Inheritance diagram for VertexTimeAlgorithmLegacy4D:
VertexTimeAlgorithmBase

Public Member Functions

void setEvent (edm::Event &iEvent, edm::EventSetup const &iSetup) override
 
bool vertexTime (float &vtxTime, float &vtxTimeError, TransientVertex const &vtx) const override
 
 VertexTimeAlgorithmLegacy4D (const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
 
 ~VertexTimeAlgorithmLegacy4D () override=default
 
- Public Member Functions inherited from VertexTimeAlgorithmBase
virtual void fill_vertex_times (std::vector< TransientVertex > &pvs)
 
VertexTimeAlgorithmBaseoperator= (const VertexTimeAlgorithmBase &)=delete
 
 VertexTimeAlgorithmBase (const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
 
 VertexTimeAlgorithmBase (const VertexTimeAlgorithmBase &)=delete
 
virtual ~VertexTimeAlgorithmBase ()=default
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &iDesc)
 
- Static Public Member Functions inherited from VertexTimeAlgorithmBase
static void fillPSetDescription (edm::ParameterSetDescription &iDesc)
 

Detailed Description

Definition at line 10 of file VertexTimeAlgorithmLegacy4D.h.

Constructor & Destructor Documentation

◆ VertexTimeAlgorithmLegacy4D()

VertexTimeAlgorithmLegacy4D::VertexTimeAlgorithmLegacy4D ( const edm::ParameterSet conf,
edm::ConsumesCollector iC 
)

Definition at line 13 of file VertexTimeAlgorithmLegacy4D.cc.

14  : VertexTimeAlgorithmBase(iConfig, iCC) {}
VertexTimeAlgorithmBase(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)

◆ ~VertexTimeAlgorithmLegacy4D()

VertexTimeAlgorithmLegacy4D::~VertexTimeAlgorithmLegacy4D ( )
overridedefault

Member Function Documentation

◆ fillPSetDescription()

void VertexTimeAlgorithmLegacy4D::fillPSetDescription ( edm::ParameterSetDescription iDesc)
static

Definition at line 16 of file VertexTimeAlgorithmLegacy4D.cc.

References VertexTimeAlgorithmBase::fillPSetDescription().

Referenced by PrimaryVertexProducer::fillDescriptions().

16  {
18 }
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)

◆ setEvent()

void VertexTimeAlgorithmLegacy4D::setEvent ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements VertexTimeAlgorithmBase.

Definition at line 20 of file VertexTimeAlgorithmLegacy4D.cc.

20 {};

◆ vertexTime()

bool VertexTimeAlgorithmLegacy4D::vertexTime ( float &  vtxTime,
float &  vtxTimeError,
TransientVertex const &  vtx 
) const
overridevirtual

estimate the vertex time and time uncertainty for transient vertex

returns true when a valid time has been determined, otherwise return false

Implements VertexTimeAlgorithmBase.

Definition at line 22 of file VertexTimeAlgorithmLegacy4D.cc.

References TransientTrackBuilder::defaultInvalidTrackTimeReso, submitPVResolutionJobs::err, mathSSE::sqrt(), hcalRecHitTable_cff::time, L1BJetProducer_cff::vtx, and w().

22  {
23  const auto num_track = vtx.originalTracks().size();
24  if (num_track == 0) {
25  return false;
26  }
27 
28  double sumwt = 0.;
29  double sumw = 0.;
30 
31  for (const auto& trk : vtx.originalTracks()) {
32  const double time = trk.timeExt();
33  const double err = trk.dtErrorExt();
35  continue; // tracks with no time information, as implemented in TransientTrackBuilder.cc l.17
36  const double inverr = err > 0. ? 1.0 / err : 0.;
37  const double w = inverr * inverr;
38  sumwt += w * time;
39  sumw += w;
40  }
41 
42  if (sumw > 0) {
43  vtxTime = sumwt / sumw;
44  vtxTimeError = 1 / sqrt(sumw);
45  return true;
46  }
47 
48  vtxTime = 0;
49  vtxTimeError = 1.;
50  return false;
51 }
T w() const
T sqrt(T t)
Definition: SSEVec.h:23
static constexpr float defaultInvalidTrackTimeReso