CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
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)
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
int iEvent
Definition: GenABIO.cc:224
def move
Definition: eostools.py:511
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static float reduceMantissaToNbitsRounding(const float &f)
Definition: libminifloat.h:79
edm::EDGetTokenT< reco::VertexCollection > const vertexCollToken_
HLTScoutingPrimaryVertexProducer(const edm::ParameterSet &)