From 5b3b1a428521dfc895480b784bc6ac3042dbc38b Mon Sep 17 00:00:00 2001 From: janekbechtel Date: Mon, 23 Jul 2018 16:44:18 +0200 Subject: [PATCH] Added embedded uncertainty model --- HTTSM2017/bin/MorphingSM2017.cpp | 35 ++++++++---- HTTSM2017/src/HttSystematics_SMRun2.cc | 75 ++++++++++++++++++-------- 2 files changed, 78 insertions(+), 32 deletions(-) diff --git a/HTTSM2017/bin/MorphingSM2017.cpp b/HTTSM2017/bin/MorphingSM2017.cpp index 6a9fa597e38..03667c5b718 100644 --- a/HTTSM2017/bin/MorphingSM2017.cpp +++ b/HTTSM2017/bin/MorphingSM2017.cpp @@ -33,6 +33,7 @@ int main(int argc, char **argv) { typedef vector VString; typedef vector> Categories; using ch::syst::bin_id; + using ch::JoinStr; // Define program options string output_folder = "sm_run2"; @@ -103,17 +104,31 @@ int main(int argc, char **argv) { // Define background processes map bkg_procs; - if (jetfakes) { - bkg_procs["et"] = {"ZTT", "ZL", "TTT", "VVT", "EWKZ", "jetFakes"}; - bkg_procs["mt"] = {"ZTT", "ZL", "TTT", "VVT", "EWKZ", "jetFakes"}; - bkg_procs["tt"] = {"ZTT", "ZL", "TTT", "VVT", "EWKZ", "jetFakes"}; - bkg_procs["em"] = {"ZTT", "ZL", "TTT", "VVT", "EWKZ", "jetFakes"}; - } else { - bkg_procs["et"] = {"W", "ZTT", "QCD", "ZL", "ZJ", "TTT", "TTJ", "VVJ", "VVT", "EWKZ"}; - bkg_procs["mt"] = {"W", "ZTT", "QCD", "ZL", "ZJ", "TTT", "TTJ", "VVJ", "VVT", "EWKZ"}; - bkg_procs["tt"] = {"W", "ZTT", "QCD", "ZL", "ZJ", "TTT", "TTJ", "VVJ", "VVT", "EWKZ"}; - bkg_procs["em"] = {"W", "ZTT", "QCD", "ZL", "ZJ", "TTT", "TTJ", "VVJ", "VVT", "EWKZ"}; + VString bkgs; + bkgs = {"W", "ZTT", "QCD", "ZL", "ZJ", "TTT", "TTJ", "VVJ", "VVT", "EWKZ"}; + if(embedding){ + bkgs.erase(std::remove(bkgs.begin(), bkgs.end(), "ZTT"), bkgs.end()); + bkgs.erase(std::remove(bkgs.begin(), bkgs.end(), "TTT"), bkgs.end()); + bkgs = JoinStr({bkgs,{"EMB","TTL"}}); } + if(jetfakes){ + bkgs.erase(std::remove(bkgs.begin(), bkgs.end(), "QCD"), bkgs.end()); + bkgs.erase(std::remove(bkgs.begin(), bkgs.end(), "W"), bkgs.end()); + bkgs.erase(std::remove(bkgs.begin(), bkgs.end(), "VVJ"), bkgs.end()); + bkgs.erase(std::remove(bkgs.begin(), bkgs.end(), "TTJ"), bkgs.end()); + bkgs.erase(std::remove(bkgs.begin(), bkgs.end(), "ZJ"), bkgs.end()); + bkgs = JoinStr({bkgs,{"jetFakes"}}); + } + + std::cout << "[INFO] Considerung the following processes:\n"; + for (unsigned int i=0; i < bkgs.size(); i++) { + std::cout << bkgs[i] << " "; + } + std::cout << std::endl; + bkg_procs["et"] = bkgs; + bkg_procs["mt"] = bkgs; + bkg_procs["tt"] = bkgs; + bkg_procs["em"] = bkgs; // Define categories map cats; diff --git a/HTTSM2017/src/HttSystematics_SMRun2.cc b/HTTSM2017/src/HttSystematics_SMRun2.cc index eb7fc4010b5..2d9f223a9b4 100644 --- a/HTTSM2017/src/HttSystematics_SMRun2.cc +++ b/HTTSM2017/src/HttSystematics_SMRun2.cc @@ -19,9 +19,6 @@ using ch::syst::bin; using ch::JoinStr; void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) { - // Error-handling - if (embedding) - throw std::runtime_error("Embedding is not yet implemented."); // ########################################################################## // Define groups of processes @@ -51,7 +48,7 @@ void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) { /* // Not used in the function, keep it for documentation purposes. std::vector backgrounds = {"ZTT", "W", "ZL", "ZJ", "TTT", "TTJ", "VVT", "VVJ", - "EWKZ", "QCD", "jetFakes"}; + "EWKZ", "QCD", "jetFakes", "EMB", "TTL"}; */ // All processes being taken from simulation @@ -59,9 +56,8 @@ void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) { std::vector mc_processes = JoinStr({ signals, - {"ZTT", "TTT", "VVT", "EWKZ", "W", "ZJ", "ZL", "TTJ", "VVJ"} + {"ZTT", "TTT", "TTL", "VVT", "EWKZ", "W", "ZJ", "ZL", "TTJ", "VVJ"} }); - // ########################################################################## // Uncertainty: Lumi // References: @@ -85,22 +81,22 @@ void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) { cb.cp() .channel({"et"}) - .process(mc_processes) + .process(JoinStr({mc_processes, {"EMB"}})) .AddSyst(cb, "CMS_eff_trigger_et_$ERA", "lnN", SystMap<>::init(1.02)); cb.cp() .channel({"mt"}) - .process(mc_processes) + .process(JoinStr({mc_processes, {"EMB"}})) .AddSyst(cb, "CMS_eff_trigger_mt_$ERA", "lnN", SystMap<>::init(1.02)); cb.cp() .channel({"tt"}) - .process(mc_processes) + .process(JoinStr({mc_processes, {"EMB"}})) .AddSyst(cb, "CMS_eff_trigger_tt_$ERA", "lnN", SystMap<>::init(1.02)); cb.cp() .channel({"em"}) - .process(mc_processes) + .process(JoinStr({mc_processes, {"EMB"}})) .AddSyst(cb, "CMS_eff_trigger_em_$ERA", "lnN", SystMap<>::init(1.02)); // ########################################################################## @@ -115,35 +111,35 @@ void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) { // Electron ID cb.cp() .channel({"et", "em"}) - .process(mc_processes) + .process(JoinStr({mc_processes, {"EMB"}})) .AddSyst(cb, "CMS_eff_e_$ERA", "lnN", SystMap<>::init(1.02)); // Muon ID cb.cp() .channel({"mt", "em"}) - .process(mc_processes) + .process(JoinStr({mc_processes, {"EMB"}})) .AddSyst(cb, "CMS_eff_m_$ERA", "lnN", SystMap<>::init(1.02)); // Tau ID: et and mt with 1 real tau cb.cp() .channel({"et", "mt"}) - .process(mc_processes) + .process(JoinStr({mc_processes, {"EMB"}})) .AddSyst(cb, "CMS_eff_t_$ERA", "lnN", SystMap<>::init(1.045)); cb.cp() .channel({"et", "mt"}) - .process(mc_processes) + .process(JoinStr({mc_processes, {"EMB"}})) .AddSyst(cb, "CMS_eff_t_$CHANNEL_$ERA", "lnN", SystMap<>::init(1.02)); // Tau ID: tt with 2 real taus cb.cp() .channel({"tt"}) - .process({"ZTT", "TTT", "VVT", "EWKZ"}) + .process({"ZTT", "TTT", "VVT", "EWKZ", "EMB"}) .AddSyst(cb, "CMS_eff_t_$ERA", "lnN", SystMap<>::init(1.09)); cb.cp() .channel({"tt"}) - .process({"ZTT", "TTT", "VVT", "EWKZ"}) + .process({"ZTT", "TTT", "VVT", "EWKZ", "EMB"}) .AddSyst(cb, "CMS_eff_t_$CHANNEL_$ERA", "lnN", SystMap<>::init(1.04)); // Tau ID: tt with 1 real taus and 1 jet fake @@ -183,7 +179,7 @@ void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) { cb.cp() .channel({"em"}) - .process(mc_processes) + .process(JoinStr({mc_processes, {"EMB"}})) .AddSyst(cb, "CMS_scale_e_$ERA", "shape", SystMap<>::init(1.00)); // ########################################################################## @@ -196,18 +192,18 @@ void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) { cb.cp() .channel({"et", "mt", "tt"}) - .process(JoinStr({signals, {"ZTT", "TTT", "VVT", "EWKZ"}})) + .process(JoinStr({signals, {"ZTT", "TTT", "TTL", "VVT", "EWKZ", "EMB"}})) .AddSyst(cb, "CMS_scale_t_1prong_$ERA", "shape", SystMap<>::init(1.00)); cb.cp() .channel({"et", "mt", "tt"}) - .process(JoinStr({signals, {"ZTT", "TTT", "VVT", "EWKZ"}})) + .process(JoinStr({signals, {"ZTT", "TTT", "TTL", "VVT", "EWKZ", "EMB"}})) .AddSyst(cb, "CMS_scale_t_1prong1pizero_$ERA", "shape", SystMap<>::init(1.00)); cb.cp() .channel({"et", "mt", "tt"}) - .process(JoinStr({signals, {"ZTT", "TTT", "VVT", "EWKZ"}})) + .process(JoinStr({signals, {"ZTT", "TTT", "TTL", "VVT", "EWKZ", "EMB"}})) .AddSyst(cb, "CMS_scale_t_3prong_$ERA", "shape", SystMap<>::init(1.00)); // ########################################################################## @@ -257,7 +253,7 @@ void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) { // TT cb.cp() .channel({"et", "mt", "tt", "em"}) - .process({"TTT", "TTJ"}) + .process({"TTT", "TTL", "TTJ"}) .AddSyst(cb, "CMS_htt_tjXsec_$ERA", "lnN", SystMap<>::init(1.06)); // W @@ -307,7 +303,7 @@ void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) { cb.cp() .channel({"et", "mt", "tt", "em"}) - .process({"TTT", "TTJ"}) + .process({"TTT", "TTL", "TTJ"}) .AddSyst(cb, "CMS_htt_ttbarShape_$ERA", "shape", SystMap<>::init(1.00)); // ########################################################################## @@ -422,6 +418,41 @@ void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) { .process({"ZH_htt"}) .AddSyst(cb, "pdf_Higgs_VH", "lnN", SystMap<>::init(1.016)); + // ########################################################################## + // Uncertainty: Embedded events + // References: + // - https://twiki.cern.ch/twiki/bin/viewauth/CMS/TauTauEmbeddingSamples2016 + // Notes: + // ########################################################################## + + // Embedded Normalization: No Lumi, Zjxsec information used, instead derived from data using dimuon selection efficiency + cb.cp() + .channel({"et", "mt", "tt", "em"}) + .process({"EMB"}) + .AddSyst(cb, "CMS_htt_doublemutrg_$ERA", "lnN", SystMap<>::init(1.04)); + + cb.cp() + .channel({"tt"}) + .process({"EMB"}) + .AddSyst(cb, "CMS_htt_doubletautrg_$ERA", "lnN", SystMap<>::init(1.04)); + + // TTbar contamination in embedded events: 10% shape uncertainty of assumed ttbar->tautau event shape + cb.cp() + .channel({"et", "mt", "tt", "em"}) + .process({"EMB"}) + .AddSyst(cb, "CMS_htt_emb_ttbar_$ERA", "shape", SystMap<>::init(1.00)); + + // Uncertainty of hadronic tau track efficiency correction + cb.cp() + .channel({"et", "mt", "tt", "em"}) + .process({"EMB"}) + .AddSyst(cb, "CMS_3ProngEff_$ERA", "shape", SystMap<>::init(1.00)); + + cb.cp() + .channel({"et", "mt", "tt", "em"}) + .process({"EMB"}) + .AddSyst(cb, "CMS_1ProngPi0Eff_$ERA", "shape", SystMap<>::init(1.00)); + // ########################################################################## // Uncertainty: Jet fakes // References: