CMS 3D CMS Logo

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 
54  if (iEvent.getByToken(vertexCollection_, vertexCollection)) {
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
edm::StreamID
Definition: StreamID.h:30
HLTScoutingPrimaryVertexProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HLTScoutingPrimaryVertexProducer.cc:74
edm::EDGetTokenT< reco::VertexCollection >
Run3ScoutingVertex.h
edm
HLT enums.
Definition: AlignableModifier.h:19
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
HLTScoutingPrimaryVertexProducer::produce
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
Definition: HLTScoutingPrimaryVertexProducer.cc:44
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
Run3ScoutingVertexCollection
std::vector< Run3ScoutingVertex > Run3ScoutingVertexCollection
Definition: Run3ScoutingVertex.h:69
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle< reco::VertexCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
HLTScoutingPrimaryVertexProducer::HLTScoutingPrimaryVertexProducer
HLTScoutingPrimaryVertexProducer(const edm::ParameterSet &)
Definition: HLTScoutingPrimaryVertexProducer.cc:35
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTScoutingPrimaryVertexProducer
Definition: HLTScoutingPrimaryVertexProducer.cc:20
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
Vertex.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
deltaR.h
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
HLTScoutingPrimaryVertexProducer::vertexCollection_
const edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
Definition: HLTScoutingPrimaryVertexProducer.cc:29
HLTScoutingPrimaryVertexProducer::~HLTScoutingPrimaryVertexProducer
~HLTScoutingPrimaryVertexProducer() override
VertexFwd.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
Frameworkfwd.h
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
ParameterSet.h
EDProducer.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15