1 #ifndef VERTEX_PRODUCER
2 #define VERTEX_PRODUCER
4 #include <cp3_llbb/Framework/interface/Producer.h>
6 #include <DataFormats/VertexReco/interface/Vertex.h>
10 VerticesProducer(
const std::string& name,
const ROOT::TreeGroup&
tree,
const edm::ParameterSet& config):
18 virtual void doConsumes(
const edm::ParameterSet& config, edm::ConsumesCollector&& collector)
override {
19 m_vertices_token = collector.consumes<std::vector<reco::Vertex>>(config.getUntrackedParameter<edm::InputTag>(
"vertices", edm::InputTag(
"offlineSlimmedPrimaryVertices")));
22 virtual void produce(edm::Event& event,
const edm::EventSetup& eventSetup)
override;
27 edm::EDGetTokenT<std::vector<reco::Vertex>> m_vertices_token;
34 std::vector<float>& normalizedChi2 =
tree[
"normalizedChi2"].transient_write<std::vector<float>>();
35 std::vector<float>& ndof =
tree[
"ndof"].transient_write<std::vector<float>>();
36 std::vector<bool>& isFake =
tree[
"isFake"].transient_write<std::vector<bool>>();
37 std::vector<bool>& isValid =
tree[
"isValid"].transient_write<std::vector<bool>>();
38 std::vector<reco::Vertex::Point>& position =
tree[
"position"].transient_write<std::vector<reco::Vertex::Point>>();
39 std::vector<reco::Vertex::CovarianceMatrix>& covariance =
tree[
"covariance"].transient_write<std::vector<reco::Vertex::CovarianceMatrix>>();
Base class for Framework producers.
Definition: Producer.h:33
ROOT::TreeGroup tree
Access point to output tree.
Definition: Producer.h:132
Producer(const std::string &name, const ROOT::TreeGroup &tree_, const edm::ParameterSet &config)
Base constructor.
Definition: Producer.h:46
Definition: VerticesProducer.h:8
virtual void produce(edm::Event &event, const edm::EventSetup &eventSetup) override
Main method of the producer, called for each event.
Definition: VerticesProducer.cc:3
virtual void doConsumes(const edm::ParameterSet &config, edm::ConsumesCollector &&collector) override
Hook for the CMSSW consumes interface.
Definition: VerticesProducer.h:18