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) {
55  vtx.tracksSize(),
57  vtx.ndof(),
58  vtx.isValid());
59  }
60  }
61 
62  iEvent.put(std::move(outVertices), "primaryVtx");
63 }
64 
67  desc.add<edm::InputTag>("vertexCollection", edm::InputTag("hltPixelVertices"))
68  ->setComment("InputTag of input collection of primary vertices");
69  desc.add<int>("mantissaPrecision", 10)->setComment("default float16, change to 23 for float32");
70  descriptions.addWithDefaultLabel(desc);
71 }
72 
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int iEvent
Definition: GenABIO.cc:224
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