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 
6 // system include files
7 #include <memory>
8 
9 // user include files
19 
21 public:
24 
25  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
26 
27 private:
28  void produce(edm::StreamID sid, edm::Event& iEvent, edm::EventSetup const& setup) const final;
30 };
31 
32 //
33 // constructors and destructor
34 //
36  : vertexCollection_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexCollection"))) {
37  //register products
38  produces<Run3ScoutingVertexCollection>("primaryVtx");
39 }
40 
42 
43 // ------------ method called to produce the data ------------
46  edm::EventSetup const& setup) const {
47  using namespace edm;
48 
49  //get vertices
51 
52  std::unique_ptr<Run3ScoutingVertexCollection> outVertices(new Run3ScoutingVertexCollection());
53 
55  for (auto& vtx : *vertexCollection) {
56  outVertices->emplace_back(vtx.x(),
57  vtx.y(),
58  vtx.z(),
59  vtx.zError(),
60  vtx.xError(),
61  vtx.yError(),
62  vtx.tracksSize(),
63  vtx.chi2(),
64  vtx.ndof(),
65  vtx.isValid());
66  }
67  }
68 
69  //put output
70  iEvent.put(std::move(outVertices), "primaryVtx");
71 }
72 
73 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
76  desc.add<edm::InputTag>("vertexCollection", edm::InputTag("hltPixelVertices"));
77  descriptions.add("hltScoutingPrimaryVertexProducer", desc);
78 }
79 
80 // declare this class as a framework plugin
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
std::vector< Run3ScoutingVertex > Run3ScoutingVertexCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< Vertex > VertexCollection
Definition: Vertex.h:12
tuple vertexCollection
int iEvent
Definition: GenABIO.cc:224
const edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
def move
Definition: eostools.py:511
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLTScoutingPrimaryVertexProducer(const edm::ParameterSet &)