From 6be32ff87a9cba91a1b7fb152e396c2722c05398 Mon Sep 17 00:00:00 2001 From: Sebastien Wertz Date: Tue, 18 Jan 2022 14:33:11 +0100 Subject: [PATCH 1/5] tweak plotSystematicsFromOutput.py --- scripts/plotSystematicsFromOutput.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/plotSystematicsFromOutput.py b/scripts/plotSystematicsFromOutput.py index c3396fc..d3f3255 100755 --- a/scripts/plotSystematicsFromOutput.py +++ b/scripts/plotSystematicsFromOutput.py @@ -17,7 +17,7 @@ sys.argv = tmpargv from HistogramTools import setTDRStyle # For systematics computed with alternate samples, draw statistical uncertainties on ratios -alternateSamples = ['isr', 'fsr', 'tune', 'hdamp'] +alternateSamples = ['tune', 'hdamp'] def beautify(s): if s == 'ttbar': @@ -136,11 +136,11 @@ def drawSystematic(nominal, up, down, title, syst, proc, output): up_ratio = up.Clone() up_ratio.Divide(nominal) - ratio_style = "P" - # if s.name().lower() in alternateSamples: - # ratio_style += "E" - # else: - # ratio_style += "hist" + ratio_style = "" + if syst.lower() in alternateSamples: + ratio_style += "PE" + else: + ratio_style += "hist" up_ratio.GetXaxis().SetLabelSize(0.02 / 0.333) up_ratio.GetXaxis().SetTitleSize(0.03 / 0.333) -- GitLab From de873dfb1e029b8d2b3fd0236a2e89a63f2cd505 Mon Sep 17 00:00:00 2001 From: Sebastien Wertz Date: Tue, 18 Jan 2022 14:54:07 +0100 Subject: [PATCH 2/5] more nBtag control plots --- python/controlPlotter.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/python/controlPlotter.py b/python/controlPlotter.py index 8fa1628..1d6a9a5 100644 --- a/python/controlPlotter.py +++ b/python/controlPlotter.py @@ -76,6 +76,13 @@ class controlPlotter(recoBaseTtbbPlotter): [(f"1mu_4j_2b", oneMu4Jet2BSel), (f"1ele_4j_2b", oneEle4Jet2BSel)], f"1lep_4j_2b", "nJets", EqBin(6, 4, 10), title="Number of jets", var=op.rng_len(s.cleanedJets)) + plots += utils.makeMergedPlots( + [(f"1mu_4j_2b", oneMu4Jet2BSel), (f"1ele_4j_2b", oneEle4Jet2BSel)], + f"1lep_4j_2b", "nBDeepFlavM", EqBin(3, 2, 5), title="Number of deepFlavourM b jets", var=op.rng_len(s.bJetsM)) + plots += utils.makeMergedPlots( + [(f"1mu_4j_2b", oneMu4Jet2BSel), (f"1ele_4j_2b", oneEle4Jet2BSel)], + f"1lep_4j_2b", "nBDeepFlavT", EqBin(3, 2, 5), title="Number of deepFlavourT b jets", var=op.rng_len(s.bJetsT)) + for sel,lep,name in [(oneMu4Jet2BSel, s.muon, f"1mu_4j_2b"), (oneEle4Jet2BSel, s.electron, f"1ele_4j_2b")]: plots += cp.makeLeptonPlots(sel, lep, name, binScaling=2) plots += cp.makeJetPlots(sel, s.cleanedJets, name, binScaling=2, allJets=True) @@ -95,6 +102,9 @@ class controlPlotter(recoBaseTtbbPlotter): plots += utils.makeMergedPlots( [(f"1mu_5j_3b", oneMu5Jet3BSel), (f"1ele_5j_3b", oneEle5Jet3BSel)], f"1lep_5j_3b", "nBDeepFlavM", EqBin(3, 2, 5), title="Number of deepFlavourM b jets", var=op.rng_len(s.bJetsM)) + plots += utils.makeMergedPlots( + [(f"1mu_5j_3b", oneMu5Jet3BSel), (f"1ele_5j_3b", oneEle5Jet3BSel)], + f"1lep_5j_3b", "nBDeepFlavT", EqBin(3, 2, 5), title="Number of deepFlavourT b jets", var=op.rng_len(s.bJetsT)) ##### Plots for ==1 lepton, >=6 jets, >= 2 b jets (ttjj level) ###### @@ -106,6 +116,9 @@ class controlPlotter(recoBaseTtbbPlotter): plots += utils.makeMergedPlots( [(f"1mu_6j_2b", oneMu6Jet2BSel), (f"1ele_6j_2b", oneEle6Jet2BSel)], f"1lep_6j_2b", "nBDeepFlavM", EqBin(3, 2, 5), title="Number of deepFlavourM b jets", var=op.rng_len(s.bJetsM)) + plots += utils.makeMergedPlots( + [(f"1mu_6j_2b", oneMu6Jet2BSel), (f"1ele_6j_2b", oneEle6Jet2BSel)], + f"1lep_6j_2b", "nBDeepFlavT", EqBin(3, 2, 5), title="Number of deepFlavourT b jets", var=op.rng_len(s.bJetsT)) for sel,lep,name in [(oneMu6Jet2BSel, s.muon, f"1mu_6j_2b"), (oneEle6Jet2BSel, s.electron, f"1ele_6j_2b")]: plots += cp.makeLeptonPlots(sel, lep, name, binScaling=2) -- GitLab From 9482d12c45c88800fbe14bf0e4f42fe47a62c6e6 Mon Sep 17 00:00:00 2001 From: Sebastien Wertz Date: Tue, 18 Jan 2022 14:54:40 +0100 Subject: [PATCH 3/5] plotit: add line for MC backgrounds --- config/analysis.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/config/analysis.yml b/config/analysis.yml index 5a78e19..3b9fd54 100644 --- a/config/analysis.yml +++ b/config/analysis.yml @@ -37,23 +37,29 @@ plotIt: ttbb: legend: 't#bar{t}b#bar{b}' fill-color: "#912200" + line-width: 1 ttB: legend: 't#bar{t}+B' fill-color: "#FFFF00" + line-width: 1 ttb: legend: 't#bar{t}b' fill-color: "#B93A13" + line-width: 1 ttcc: legend: 't#bar{t}+C' #fill-color: "#f55d2f" fill-color: "#FF6600" + line-width: 1 ttjj: legend: 't#bar{t}+light' #fill-color: "#F09175" fill-color: "#CC3300" + line-width: 1 TT_other: legend: 't#bar{t} other' fill-color: "#ffb29c" + line-width: 1 ttbb_4fs: legend: 't#bar{t}b#bar{b} 4FS' @@ -76,28 +82,35 @@ plotIt: legend: 'V+jets' #fill-color: "#ECD078" fill-color: "#FFFFFF" + line-width: 1 ZJets: legend: 'Z+jets' fill-color: "#FFFFFF" + line-width: 1 WJets: legend: 'W+jets' fill-color: "#ECD078" ttX: - legend: 't#bar{t}+X' + legend: 't#bar{t}V' fill-color: "#FF3333" #fill-color: "#53777A" + line-width: 1 ttH: legend: 't#bar{t}H' fill-color: "#A8DBA8" + line-width: 1 ttW: legend: 't#bar{t}W' fill-color: "#53777A" + line-width: 1 ttZ: legend: 't#bar{t}Z' fill-color: "#C02942" + line-width: 1 ST: legend: 'Single t' fill-color: "#FF6666" + line-width: 1 #fill-color: "#C02942" systematics: # this list is only used for control plots -- GitLab From f3f554f5afb59d7ac55ad0b88ac6ffba5c057939 Mon Sep 17 00:00:00 2001 From: Sebastien Wertz Date: Tue, 18 Jan 2022 14:58:52 +0100 Subject: [PATCH 4/5] add tight tagged b jet definition --- python/recoBaseTtbbPlotter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/recoBaseTtbbPlotter.py b/python/recoBaseTtbbPlotter.py index 6bbb4e4..d9a7db2 100644 --- a/python/recoBaseTtbbPlotter.py +++ b/python/recoBaseTtbbPlotter.py @@ -86,8 +86,9 @@ class recoBaseTtbbPlotter(baseTtbbPlotter): # order jets by *decreasing* deepFlavour self.btagger = "btagDeepFlavB" self.cleanedJetsByDeepFlav = op.sort(self.cleanedJets, lambda jet: -getattr(jet, self.btagger)) - # DeepFlavour Medium tagged jets - self.bJetsM = defs.bTagDef(self.cleanedJets, era, "M", self.btagger ) + # DeepFlavour tagged jets + self.bJetsM = defs.bTagDef(self.cleanedJets, era, "M", self.btagger) + self.bJetsT = defs.bTagDef(self.cleanedJets, era, "T", self.btagger) self.lightJetsM = defs.lightTagDef(self.cleanedJets, era, "M", self.btagger) if self.isMC(sample): -- GitLab From 1f96320462551d4209650f5efcd2cb3fc1fa1901 Mon Sep 17 00:00:00 2001 From: Sebastien Wertz Date: Tue, 18 Jan 2022 19:42:41 +0100 Subject: [PATCH 5/5] fix lines in plots --- config/analysis.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/config/analysis.yml b/config/analysis.yml index 3b9fd54..b87db57 100644 --- a/config/analysis.yml +++ b/config/analysis.yml @@ -38,28 +38,40 @@ plotIt: legend: 't#bar{t}b#bar{b}' fill-color: "#912200" line-width: 1 + line-color: 1 + line-style: 1 ttB: legend: 't#bar{t}+B' fill-color: "#FFFF00" line-width: 1 + line-color: 1 + line-style: 1 ttb: legend: 't#bar{t}b' fill-color: "#B93A13" line-width: 1 + line-color: 1 + line-style: 1 ttcc: legend: 't#bar{t}+C' #fill-color: "#f55d2f" fill-color: "#FF6600" line-width: 1 + line-color: 1 + line-style: 1 ttjj: legend: 't#bar{t}+light' #fill-color: "#F09175" fill-color: "#CC3300" line-width: 1 + line-color: 1 + line-style: 1 TT_other: legend: 't#bar{t} other' fill-color: "#ffb29c" line-width: 1 + line-color: 1 + line-style: 1 ttbb_4fs: legend: 't#bar{t}b#bar{b} 4FS' @@ -83,34 +95,51 @@ plotIt: #fill-color: "#ECD078" fill-color: "#FFFFFF" line-width: 1 + line-color: 1 + line-style: 1 ZJets: legend: 'Z+jets' fill-color: "#FFFFFF" line-width: 1 + line-color: 1 + line-style: 1 WJets: legend: 'W+jets' fill-color: "#ECD078" + line-width: 1 + line-color: 1 + line-style: 1 ttX: legend: 't#bar{t}V' fill-color: "#FF3333" #fill-color: "#53777A" line-width: 1 + line-color: 1 + line-style: 1 ttH: legend: 't#bar{t}H' fill-color: "#A8DBA8" line-width: 1 + line-color: 1 + line-style: 1 ttW: legend: 't#bar{t}W' fill-color: "#53777A" line-width: 1 + line-color: 1 + line-style: 1 ttZ: legend: 't#bar{t}Z' fill-color: "#C02942" line-width: 1 + line-color: 1 + line-style: 1 ST: legend: 'Single t' fill-color: "#FF6666" line-width: 1 + line-color: 1 + line-style: 1 #fill-color: "#C02942" systematics: # this list is only used for control plots -- GitLab