-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsm_fake_factors.py
101 lines (95 loc) · 2.75 KB
/
sm_fake_factors.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
from __future__ import annotations # needed for type annotations in > python 3.7
from typing import List, Union
from .producers import fakefactors as fakefactors
from .quantities import output as q
from code_generation.friend_trees import FriendTreeConfiguration
from code_generation.modifiers import EraModifier
def build_config(
era: str,
sample: str,
scopes: List[str],
shifts: List[str],
available_sample_types: List[str],
available_eras: List[str],
available_scopes: List[str],
quantities_map: Union[str, None] = None,
):
configuration = FriendTreeConfiguration(
era,
sample,
scopes,
shifts,
available_sample_types,
available_eras,
available_scopes,
quantities_map,
)
# fake factor configurations
configuration.add_config_parameters(
["et"],
{
"ff_variation": "nominal",
"ff_file": EraModifier(
{
"2016": "",
"2017": "",
"2018": "data/fake_factors/sm/2018/fake_factors_et.json.gz",
}
),
"ff_corr_file": EraModifier(
{
"2016": "",
"2017": "",
"2018": "data/fake_factors/sm/2018/FF_corrections_et.json.gz",
}
),
},
)
configuration.add_config_parameters(
["mt"],
{
"ff_variation": "nominal",
"ff_file": EraModifier(
{
"2016": "",
"2017": "",
"2018": "data/fake_factors/sm/2018/fake_factors_mt.json.gz",
}
),
"ff_corr_file": EraModifier(
{
"2016": "",
"2017": "",
"2018": "data/fake_factors/sm/2018/FF_corrections_mt.json.gz",
}
),
},
)
configuration.add_producers(
["mt", "et"],
[
fakefactors.RawFakeFactors_sm_lt,
fakefactors.FakeFactors_sm_lt,
# fakefactors.FakeFactors_sm_lt_nodR,
],
)
configuration.add_outputs(
["mt", "et"],
[
q.raw_fake_factor,
q.raw_qcd_fake_factor,
q.raw_wjets_fake_factor,
q.raw_ttbar_fake_factor,
q.fake_factor,
q.ttbar_fake_factor,
q.wjets_fake_factor,
q.qcd_fake_factor,
],
)
#########################
# Finalize and validate the configuration
#########################
configuration.optimize()
configuration.validate()
configuration.report()
return configuration.expanded_configuration()