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