-
Notifications
You must be signed in to change notification settings - Fork 6
/
cfg_genZjets.py
131 lines (112 loc) · 5.45 KB
/
cfg_genZjets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
from pocket_coffea.utils.configurator import Configurator
from pocket_coffea.lib.cut_definition import Cut
from pocket_coffea.lib.cut_functions import get_nObj_min, get_HLTsel
from pocket_coffea.parameters.cuts import passthrough
from pocket_coffea.parameters.histograms import *
from pocket_coffea.lib.weights.common.common import common_weights
import vjet_weights
from vjet_weights import *
import workflow_ZjetsGen
from workflow_ZjetsGen import ZjetsBaseProcessor
import GenSelectors
from GenSelectors import *
import cloudpickle
cloudpickle.register_pickle_by_value(workflow_ZjetsGen)
cloudpickle.register_pickle_by_value(GenSelectors)
cloudpickle.register_pickle_by_value(vjet_weights)
import os
localdir = os.path.dirname(os.path.abspath(__file__))
# Loading default parameters
from pocket_coffea.parameters import defaults
default_parameters = defaults.get_default_parameters()
defaults.register_configuration_dir("config_dir", localdir+"/params")
parameters = defaults.merge_parameters_from_files(default_parameters,
f"{localdir}/params/zjets_objects.yaml",
update=True)
files_2017 = [
f"{localdir}/datasets/Run2UL2017_MC_VJets.json",
f"{localdir}/datasets/Run2UL2017_MC_OtherBkg.json",
f"{localdir}/datasets/Run2UL2017_DATA.json",
]
files_2018 = [
f"{localdir}/datasets/Run2UL2018_MC_VJets.json",
f"{localdir}/datasets/Run2UL2018_MC_OtherBkg.json",
f"{localdir}/datasets/Run2UL2018_DATA.json",
]
files_Run3 = [
f"{localdir}/datasets/Run3_MC_VJets.json",
f"{localdir}/datasets/Run3_MC_OtherBkg.json",
f"{localdir}/datasets/Run3_DATA.json",
f"{localdir}/datasets/Run3_MC_Sig.json",
]
cfg = Configurator(
parameters = parameters,
weights_classes = common_weights + [custom_weight_vjet],
datasets = {
#"jsons": files_2017 + files_2018,
"jsons": files_Run3,
"filter" : {
"samples": [
"DYJetsToLL_MLM",
"DYJetsToLL_FxFx",
#"DYJetsToLL_MiNNLO_MuMu",
#"DYJetsToLL_MiNNLO_EE",
],
"samples_exclude" : [],
"year": ['2022_postEE']
}
},
workflow = ZjetsBaseProcessor,
skim = [get_nObj_min(4, 18., "GenJet")],
preselections = [get_nObj_min(2, 18., "MyGenLeptons")],
categories = {
"baseline_2l": [passthrough],
"ll_2j": [get_nObj_min(2, 25., "MyGenJets")],
"ZplusDijet_": [GenZplus2j],
"ZplusDijet_Nj1": [GenZplus2j, LHE_Nj(1)],
"ZplusDijet_Nj2": [GenZplus2j, LHE_Nj(2)],
"ZplusDijet_Nj3": [GenZplus2j, LHE_Nj(3)],
"ZplusDijet_m0": [GenZplus2j, dijet_m0to60],
"ZplusDijet_m1": [GenZplus2j, dijet_m60to120],
"ZplusDijet_m2": [GenZplus2j, dijet_m120to2000],
#"baseline_mumu": [dijet_0to60],
#"baseline_ee": [ee_channel],
},
weights = {
"common": {
"inclusive": ["genWeight","lumi","XS",
],
"bycategory" : {
}
},
"bysample": {
"DYJetsToLL_FxFx": {
"inclusive": ["weight_vjet"]
}
}
},
variations = {"weights": { "common": { "inclusive": [],}, },},
variables = {
**lepton_hists(coll="MyGenLeptons", pos=0),
**genjet_hists(coll="MyGenJets", pos=0),
**count_hist(name="nMyGenJets", coll="MyGenJets",bins=8, start=0, stop=8),
"dilep_m" : HistConf( [Axis(coll="ll", field="mass", bins=40, start=70, stop=110, label=r"$M_{\ell\ell}$ [GeV]")] ),
"dilep_dr" : HistConf( [Axis(coll="ll", field="deltaR", bins=50, start=0, stop=4.0, label=r"$\Delta R_{\ell\ell}$")] ),
"dilep_pt" : HistConf( [Axis(coll="ll", field="pt", bins=100, start=0, stop=400, label=r"$p_T{\ell\ell}$ [GeV]")] ),
"dijet_m" : HistConf( [Axis(coll="dijet", field="mass", bins=100, start=0, stop=800, label=r"$M_{jj}$ [GeV]")],
exclude_categories = ['baseline_2l']),
"dijet_dr" : HistConf( [Axis(coll="dijet", field="deltaR", bins=50, start=0, stop=5, label=r"$\Delta R_{jj}$")],
exclude_categories = ['baseline_2l']),
"dijet_pt" : HistConf( [Axis(coll="dijet", field="pt", bins=100, start=0, stop=400, label=r"$p_T{jj}$ [GeV]")],
exclude_categories = ['baseline_2l']),
#"dilep_dijet_ratio": HistConf( [Axis(field="ZH_pt_ratio", bins=100, start=0, stop=2, label=r"$\frac{p_T(jj)}{p_T(\ell\ell)}$")] ),
#"dilep_dijet_dphi": HistConf( [Axis(field="ZH_deltaPhi", bins=50, start=1.5, stop=math.pi, label=r"$\Delta \phi (\ell\ell, jj)$")] ),
#"dilep_dijet_dr": HistConf( [Axis(field="ZH_deltaR", bins=50, start=0, stop=5, label=r"$\Delta R (\ell\ell, jj)$")] ),
"LHE_HT": HistConf( [Axis(coll="LHE", field="HT", bins=100, start=0, stop=1000, label=r"LHE HT [GeV]")] ),
"LHE_VPT": HistConf( [Axis(coll="LHE", field="Vpt", bins=100, start=0, stop=400, label=r"LHE Vpt [GeV]")] ),
"LHE_Njets": HistConf( [Axis(coll="LHE", field="Njets", bins=6, start=0, stop=6, label=r"LHE Njets")] ),
"LHE_NpNLO": HistConf( [Axis(coll="LHE", field="NpNLO", bins=6, start=0, stop=6, label=r"LHE NpNLO")] ),
#"j1_l1_dr" : HistConf( [Axis(field="j1_l1_dr", bins=50, start=0, stop=5, label=r"$\Delta R_{j_1 l_1}$")] ),
#"j1_l2_dr" : HistConf( [Axis(field="j1_l2_dr", bins=50, start=0, stop=5, label=r"$\Delta R_{j_1 l_2}$")] ),
}
)