CP3-llbb Framework
VerticesProducer.h
1 #ifndef VERTEX_PRODUCER
2 #define VERTEX_PRODUCER
3 
4 #include <cp3_llbb/Framework/interface/Producer.h>
5 
6 #include <DataFormats/VertexReco/interface/Vertex.h>
7 
9  public:
10  VerticesProducer(const std::string& name, const ROOT::TreeGroup& tree, const edm::ParameterSet& config):
11  Producer(name, tree, config)
12  {
13 
14  }
15 
16  virtual ~VerticesProducer() {}
17 
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")));
20  }
21 
22  virtual void produce(edm::Event& event, const edm::EventSetup& eventSetup) override;
23 
24  private:
25 
26  // Tokens
27  edm::EDGetTokenT<std::vector<reco::Vertex>> m_vertices_token;
28 
29  public:
30  // Tree members
31 
32  BRANCH(n, uint8_t);
33 
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>>();
40 };
41 
42 #endif
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