4 #include <DataFormats/PatCandidates/interface/MET.h>
6 #include <cp3_llbb/Framework/interface/Producer.h>
10 METProducer(
const std::string& name,
const ROOT::TreeGroup&
tree,
const edm::ParameterSet& config):
12 m_slimmed(config.getUntrackedParameter<
bool>(
"slimmed",
true))
19 virtual void doConsumes(
const edm::ParameterSet& config, edm::ConsumesCollector&& collector)
override {
20 m_met_token = collector.consumes<std::vector<pat::MET>>(config.getUntrackedParameter<edm::InputTag>(
"met", edm::InputTag(
"slimmedMETs")));
23 virtual void produce(edm::Event& event,
const edm::EventSetup& eventSetup)
override;
26 float& create_branch(
const std::string& name) {
27 static float s_dummy = 0;
28 return (m_slimmed) ?
tree[name].write<
float>() : s_dummy;
34 edm::EDGetTokenT<std::vector<pat::MET>> m_met_token;
38 LorentzVector& p4 =
tree[
"p4"].write<LorentzVector>();
39 float& sumEt =
tree[
"sumEt"].write<
float>();
40 float& significance =
tree[
"significance"].write<
float>();
42 float& CovMatrix00 =
tree[
"CovMatrix00"].write<
float>();
43 float& CovMatrix01 =
tree[
"CovMatrix01"].write<
float>();
44 float& CovMatrix10 =
tree[
"CovMatrix10"].write<
float>();
45 float& CovMatrix11 =
tree[
"CovMatrix11"].write<
float>();
46 float& uncorrectedPt = create_branch(
"uncorrectedPt");
47 float& uncorrectedPhi = create_branch(
"uncorrectedPhi");
48 float& uncorrectedSumEt = create_branch(
"uncorrectedSumEt");
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: METProducer.h:8
virtual void produce(edm::Event &event, const edm::EventSetup &eventSetup) override
Main method of the producer, called for each event.
Definition: METProducer.cc:3
virtual void doConsumes(const edm::ParameterSet &config, edm::ConsumesCollector &&collector) override
Hook for the CMSSW consumes interface.
Definition: METProducer.h:19