From 1bd6c591dd998fe43294013e4fa76e471876083c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Brochet?= Date: Mon, 13 Feb 2017 22:35:03 +0100 Subject: [PATCH] Ensure all branches are created during the first event --- interface/HHAnalyzer.h | 16 +++++++++++++++- plugins/HHAnalyzer.cc | 13 ------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/interface/HHAnalyzer.h b/interface/HHAnalyzer.h index 689b2e7..eb60761 100644 --- a/interface/HHAnalyzer.h +++ b/interface/HHAnalyzer.h @@ -92,7 +92,7 @@ class HHAnalyzer: public Framework::Analyzer { //// October 2016: adding some asymmetric btag candidates, for study //BRANCH(llmetjj_HWWleptons_btagLM_cmva, std::vector); //BRANCH(llmetjj_HWWleptons_btagMT_cmva, std::vector); - + BRANCH(llmetjj, std::vector); virtual void analyze(const edm::Event&, const edm::EventSetup&, const ProducersManager&, const AnalyzersManager&, const CategoryManager&) override; @@ -208,6 +208,20 @@ class HHAnalyzer: public Framework::Analyzer { ONLY_NOMINAL_BRANCH(gen_Nu1, LorentzVector); ONLY_NOMINAL_BRANCH(gen_Nu2, LorentzVector); + ONLY_NOMINAL_BRANCH(gen_deltaR_jet_B, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_jet_Bbar, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_jet_B_afterFSR, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_jet_Bbar_afterFSR, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_electron_L1, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_electron_L2, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_electron_L1_afterFSR, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_electron_L2_afterFSR, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_muon_L1, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_muon_L2, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_muon_L1_afterFSR, std::vector); + ONLY_NOMINAL_BRANCH(gen_deltaR_muon_L2_afterFSR, std::vector); + + private: // Producers name std::string m_electrons_producer; diff --git a/plugins/HHAnalyzer.cc b/plugins/HHAnalyzer.cc index ab4989e..27ff856 100644 --- a/plugins/HHAnalyzer.cc +++ b/plugins/HHAnalyzer.cc @@ -265,19 +265,6 @@ void HHAnalyzer::analyze(const edm::Event& event, const edm::EventSetup&, const // ***** ***** ***** // Matching // ***** ***** ***** - ONLY_NOMINAL_BRANCH(gen_deltaR_jet_B, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_jet_Bbar, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_jet_B_afterFSR, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_jet_Bbar_afterFSR, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_electron_L1, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_electron_L2, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_electron_L1_afterFSR, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_electron_L2_afterFSR, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_muon_L1, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_muon_L2, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_muon_L1_afterFSR, std::vector); - ONLY_NOMINAL_BRANCH(gen_deltaR_muon_L2_afterFSR, std::vector); - for (auto p4: alljets.gen_p4) { gen_deltaR_jet_B.push_back(deltaR(p4, gen_B)); gen_deltaR_jet_Bbar.push_back(deltaR(p4, gen_Bbar));