Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions HTTSM2017/bin/MorphingSM2017.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ int main(int argc, char **argv) {
typedef vector<string> VString;
typedef vector<pair<int, string>> Categories;
using ch::syst::bin_id;
using ch::JoinStr;

// Define program options
string output_folder = "sm_run2";
Expand Down Expand Up @@ -103,17 +104,31 @@ int main(int argc, char **argv) {

// Define background processes
map<string, VString> 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<string, Categories> cats;
Expand Down
75 changes: 53 additions & 22 deletions HTTSM2017/src/HttSystematics_SMRun2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -51,17 +48,16 @@ void AddSMRun2Systematics(CombineHarvester &cb, bool jetfakes, bool embedding) {
/* // Not used in the function, keep it for documentation purposes.
std::vector<std::string> backgrounds = {"ZTT", "W", "ZL", "ZJ",
"TTT", "TTJ", "VVT", "VVJ",
"EWKZ", "QCD", "jetFakes"};
"EWKZ", "QCD", "jetFakes", "EMB", "TTL"};
*/

// All processes being taken from simulation
// FIXME: Adapt for fake factor and embedding
std::vector<std::string> 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:
Expand All @@ -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));

// ##########################################################################
Expand All @@ -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
Expand Down Expand Up @@ -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));

// ##########################################################################
Expand All @@ -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));

// ##########################################################################
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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));

// ##########################################################################
Expand Down Expand Up @@ -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:
Expand Down