Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • 3pia/cms_analyses/example-analysis
  • Andrey.Pozdnyakov/example-analysis
2 results
Show changes
Commits on Source (2)
......@@ -39,36 +39,36 @@ cfg.aux["stat_model"] = "example_model"
# process groups
#
cfg.aux["process_groups"] = {
"default": [
# "data_dl",
"dy",
"tt",
"ttV",
"ttVH",
"ttVV", # one file missing?
],
"plotting": [
# "data_dl",
"tt",
"dy",
"ttV",
"ttVH",
"ttVV",
# "plot_other",
],
}
"default": [
# "data_dl",
"dy",
"tt",
"ttV",
"ttVH",
"ttVV", # one file missing?
],
"plotting": [
# "data_dl",
"tt",
"dy",
"ttV",
"ttVH",
"ttVV",
# "plot_other",
],
}
cfg.aux["signal_prcess"] = "dy"
cfg.aux["btag_sf_shifts"] = [
"lf",
"lfstats1",
"lfstats2",
"hf",
"hfstats1",
"hfstats2",
"cferr1",
"cferr2",
]
"lf",
"lfstats1",
"lfstats2",
"hf",
"hfstats1",
"hfstats2",
"cferr1",
"cferr2",
]
processes = [
{
......@@ -82,12 +82,12 @@ processes = [
get("ttVH"),
],
},
# {
# "name": "ttX",
# "idx": 999995,
# "label": r"ttX",
# "processes": [get("ttV"), get("ttVV"), get("ttVH")],
# },
# {
# "name": "ttX",
# "idx": 999995,
# "label": r"ttX",
# "processes": [get("ttV"), get("ttVV"), get("ttVH")],
# },
]
specific_processes = []
......
......@@ -15,5 +15,5 @@ BR_H_WW = sn.Number(0.2137, {"br_hww": ("rel", 0.0154, 0.0153)})
BR_W_HAD = sn.Number(0.6741, {"br_whad": 0.0027})
BR_W_LEP = 1 - BR_W_HAD
BR_WW_SL = 2 * BR_W_HAD.mul(BR_W_LEP, rho=-1, inplace=False)
BR_WW_DL = BR_W_LEP ** 2
BR_WW_FH = BR_W_HAD ** 2
BR_WW_DL = BR_W_LEP**2
BR_WW_FH = BR_W_HAD**2
......@@ -3,7 +3,7 @@
import os
import numpy as np
import hist
import example_analysis.config.analysis as example_config
import example_analysis.config.analysis as example_config
from utils.datacard import Datacard, RDict
from utils.util import reluncs, wquant
from enum import IntEnum, unique
......@@ -209,10 +209,11 @@ class StatModel(DataCardLogger):
]
self.add_systematics(
names=self.config_inst.aux["jes_sources"] + ["jer", "UnclustEn"],
type="shape", strength=1.0,
processes=self.processes,
suffix=("_up", "_down"),
names=self.config_inst.aux["jes_sources"] + ["jer", "UnclustEn"],
type="shape",
strength=1.0,
processes=self.processes,
suffix=("_up", "_down"),
)
# lepton efficiencies
......@@ -223,15 +224,15 @@ class StatModel(DataCardLogger):
processes=self.processes,
)
self.add_systematics(
names="muon*",
type="shape",
strength=1.0,
processes=self.processes,
names="muon*",
type="shape",
strength=1.0,
processes=self.processes,
)
# trigger
self.add_systematics(
names="trigger*",
type="shape",
strength=1.0,
processes=self.processes,
)
\ No newline at end of file
names="trigger*",
type="shape",
strength=1.0,
processes=self.processes,
)
......@@ -233,7 +233,6 @@ class BaseSelection:
"PtEtaPhiMCandidate",
)
# select at least one bjet
passbtag = clean_good_jets.btagDeepFlavB >= btag_wp["2017"]["tight"]
one_bjets = ak.num(clean_good_jets[passbtag]) >= 1
......@@ -333,7 +332,7 @@ class BaseSelection:
weights.add(
"top_pT_reweighting",
w_toppt,
weightUp=w_toppt ** 2, # w**2
weightUp=w_toppt**2, # w**2
weightDown=ak.ones_like(w_toppt), # w = 1.
)
......@@ -371,9 +370,9 @@ class BaseSelection:
),
]:
args = lep_pt[:, 0], lep_pt[:, 1]
trigger_sf = Ctrig[
f"ttHbb_dilepton_trigger_{trigger_hist}"
](*args)
trigger_sf = Ctrig[f"ttHbb_dilepton_trigger_{trigger_hist}"](
*args
)
trigger_sf_error = Ctrig[
f"ttHbb_dilepton_trigger_{trigger_hist}_error"
](*args)
......@@ -441,7 +440,6 @@ class BaseSelection:
btagnorm = self.corrections["btagnorm"][dataset_inst.name]
weights.add("btagNorm", btagnorm(ak.num(clean_good_jets)))
# n build categories
eventnr = ak.flatten(events.event, axis=-1)
common_filter = ["met_filter"]
......@@ -459,13 +457,14 @@ class BaseSelection:
(process,) = dataset_inst.processes.values
procid = np.full(n_events, process.id)
else:
raise NotImplementedError("There was an old Pget import, which is not anymore available. please check the comment under this error!")
raise NotImplementedError(
"There was an old Pget import, which is not anymore available. please check the comment under this error!"
)
# procid = np.full(n_events, Pget("data").id)
yield locals()
class Processor(BaseSelection, Histogramer):
jes_shifts = False
pass
......