1 #ifndef ELECTRONS_PRODUCER
2 #define ELECTRONS_PRODUCER
4 #include <cp3_llbb/Framework/interface/LeptonsProducer.h>
5 #include <cp3_llbb/Framework/interface/Identifiable.h>
6 #include <cp3_llbb/Framework/interface/ScaleFactors.h>
8 #include <DataFormats/PatCandidates/interface/Electron.h>
12 ElectronsProducer(
const std::string& name,
const ROOT::TreeGroup&
tree,
const edm::ParameterSet& config):
15 ScaleFactors::create_branches(config);
20 virtual void doConsumes(
const edm::ParameterSet& config, edm::ConsumesCollector&& collector)
override {
22 Identifiable::consumes_id_tokens(config, std::forward<edm::ConsumesCollector>(collector));
23 m_vertices_token = collector.consumes<std::vector<reco::Vertex>>(config.getUntrackedParameter<edm::InputTag>(
"vertices", edm::InputTag(
"offlineSlimmedPrimaryVertices")));
25 if (config.exists(
"mva_id")) {
26 const edm::ParameterSet& mva_id_pset = config.getUntrackedParameter<edm::ParameterSet>(
"mva_id");
27 m_mva_id_values_map_token = collector.consumes<edm::ValueMap<float>>(mva_id_pset.getUntrackedParameter<edm::InputTag>(
"values"));
28 m_mva_id_categories_map_token = collector.consumes<edm::ValueMap<int>>(mva_id_pset.getUntrackedParameter<edm::InputTag>(
"categories"));
32 virtual void produce(edm::Event& event,
const edm::EventSetup& eventSetup)
override;
36 edm::EDGetTokenT<std::vector<reco::Vertex>> m_vertices_token;
39 edm::EDGetTokenT<edm::ValueMap<float>> m_mva_id_values_map_token;
40 edm::EDGetTokenT<edm::ValueMap<int>> m_mva_id_categories_map_token;
44 BRANCH(isEB, std::vector<bool>);
45 BRANCH(isEE, std::vector<bool>);
47 BRANCH(dxy, std::vector<float>);
48 BRANCH(dz, std::vector<float>);
49 BRANCH(dca, std::vector<float>);
51 BRANCH(ecalPFClusterIso, std::vector<float>);
52 BRANCH(hcalPFClusterIso, std::vector<float>);
53 BRANCH(trackIso, std::vector<float>);
55 BRANCH(expectedMissingInnerHits, std::vector<unsigned int>);
57 BRANCH(mva_id_values, std::vector<float>);
58 BRANCH(mva_id_categories, std::vector<int>);
60 std::vector<edm::Ref<std::vector<pat::Electron>>> products;
Definition: ElectronsProducer.h:10
virtual void produce(edm::Event &event, const edm::EventSetup &eventSetup) override
Main method of the producer, called for each event.
Definition: ElectronsProducer.cc:3
virtual void doConsumes(const edm::ParameterSet &config, edm::ConsumesCollector &&collector) override
Hook for the CMSSW consumes interface.
Definition: ElectronsProducer.h:20
ROOT::TreeGroup tree
Access point to output tree.
Definition: Producer.h:132
Definition: Identifiable.h:14
Definition: LeptonsProducer.h:10
virtual void doConsumes(const edm::ParameterSet &config, edm::ConsumesCollector &&collector) override
Hook for the CMSSW consumes interface.
Definition: LeptonsProducer.h:22
Definition: ScaleFactors.h:13