CMS 3D CMS Logo

VertexTimeAlgorithmBase.h
Go to the documentation of this file.
1 #ifndef usercode_PrimaryVertexAnalyzer_VertexTimeAlgorithmBase_h
2 #define usercode_PrimaryVertexAnalyzer_VertexTimeAlgorithmBase_h
4 
5 namespace edm {
6  class Event;
7  class EventSetup;
8  class ParameterSet;
10  class ConsumesCollector;
11 } // namespace edm
12 
14 public:
16  virtual ~VertexTimeAlgorithmBase() = default;
19 
21 
22  virtual void setEvent(edm::Event& iEvent, edm::EventSetup const& iSetup) = 0;
23 
29  virtual bool vertexTime(float& vtxTime, float& vtxTimeError, TransientVertex const& vtx) const = 0;
30 
37  virtual void fill_vertex_times(std::vector<TransientVertex>& pvs) {
38  for (unsigned int i = 0; i < pvs.size(); i++) {
39  auto vtx = pvs[i];
40  if (vtx.isValid()) {
41  auto vtxTime(0.f), vtxTimeError(-1.f);
42  if (vertexTime(vtxTime, vtxTimeError, vtx)) {
43  auto err = vtx.positionError().matrix4D();
44  err(3, 3) = vtxTimeError * vtxTimeError;
45  auto trkWeightMap3d = vtx.weightMap();
46  auto vtx_with_time = TransientVertex(
47  vtx.position(), vtxTime, err, vtx.originalTracks(), vtx.totalChiSquared(), vtx.degreesOfFreedom());
48  vtx_with_time.weightMap(trkWeightMap3d);
49  pvs[i] = vtx_with_time;
50  }
51  }
52  }
53  }
54 };
55 
56 #endif
VertexTimeAlgorithmBase(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
virtual void setEvent(edm::Event &iEvent, edm::EventSetup const &iSetup)=0
VertexTimeAlgorithmBase & operator=(const VertexTimeAlgorithmBase &)=delete
TransientTrackToFloatMap weightMap() const
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
int iEvent
Definition: GenABIO.cc:224
virtual void fill_vertex_times(std::vector< TransientVertex > &pvs)
double f[11][100]
virtual ~VertexTimeAlgorithmBase()=default
HLT enums.
virtual bool vertexTime(float &vtxTime, float &vtxTimeError, TransientVertex const &vtx) const =0