CMS 3D CMS Logo

HLTScoutingPrimaryVertexProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HLTrigger/JetMET
4 // Class: HLTScoutingPrimaryVertexProducer
5 //
16 
17 #include <memory>
18 #include <utility>
19 
21 public:
23 
24  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
25 
26 private:
27  void produce(edm::StreamID sid, edm::Event& iEvent, edm::EventSetup const& setup) const final;
28 
30  int const mantissaPrecision_;
31 };
32 
34  : vertexCollToken_(consumes(iConfig.getParameter<edm::InputTag>("vertexCollection"))),
35  mantissaPrecision_(iConfig.getParameter<int>("mantissaPrecision")) {
36  produces<Run3ScoutingVertexCollection>("primaryVtx");
37 }
38 
41  edm::EventSetup const& setup) const {
42  auto outVertices = std::make_unique<Run3ScoutingVertexCollection>();
43 
44  auto const vertexCollHandle = iEvent.getHandle(vertexCollToken_);
45 
46  if (vertexCollHandle.isValid()) {
47  outVertices->reserve(vertexCollHandle->size());
48  for (auto const& vtx : *vertexCollHandle) {
49  outVertices->emplace_back(
56  vtx.tracksSize(),
58  vtx.ndof(),
59  vtx.isValid(),
63  }
64  }
65 
66  iEvent.put(std::move(outVertices), "primaryVtx");
67 }
68 
71  desc.add<edm::InputTag>("vertexCollection", edm::InputTag("hltPixelVertices"))
72  ->setComment("InputTag of input collection of primary vertices");
73  desc.add<int>("mantissaPrecision", 10)->setComment("default float16, change to 23 for float32");
74  descriptions.addWithDefaultLabel(desc);
75 }
76 
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static float reduceMantissaToNbitsRounding(const float &f)
Definition: libminifloat.h:79
HLT enums.
edm::EDGetTokenT< reco::VertexCollection > const vertexCollToken_
HLTScoutingPrimaryVertexProducer(const edm::ParameterSet &)
def move(src, dest)
Definition: eostools.py:511