-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnmssm_fake_factors.py
134 lines (126 loc) · 3.56 KB
/
nmssm_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
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
132
133
134
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/nmssm/2018/fake_factors_et.json.gz",
}
),
"ff_corr_file": EraModifier(
{
"2016": "",
"2017": "",
"2018": "data/fake_factors/nmssm/2018/FF_corrections_et.json.gz",
}
),
},
)
configuration.add_config_parameters(
["mt"],
{
"ff_variation": "nominal",
"ff_file": EraModifier(
{
"2016": "",
"2017": "",
"2018": "data/fake_factors/nmssm/2018/fake_factors_mt.json.gz",
}
),
"ff_corr_file": EraModifier(
{
"2016": "",
"2017": "",
"2018": "data/fake_factors/2018/nmssm/FF_corrections_mt.json.gz",
}
),
},
)
configuration.add_config_parameters(
["tt"],
{
"ff_variation": "nominal",
"ff_file": EraModifier(
{
"2016": "",
"2017": "",
"2018": "data/fake_factors/nmssm/2018/fake_factors_tt.json.gz",
}
),
"ff_corr_file": EraModifier(
{
"2016": "",
"2017": "",
"2018": "data/fake_factors/nmssm/2018/FF_corrections_tt.json.gz",
}
),
},
)
configuration.add_producers(
["mt", "et"],
[
fakefactors.RawFakeFactors_nmssm_lt,
fakefactors.FakeFactors_nmssm_lt,
],
)
configuration.add_outputs(
["mt", "et"],
[
q.raw_fake_factor,
q.fake_factor,
],
)
configuration.add_producers(
["tt"],
[
fakefactors.RawFakeFactors_nmssm_tt_1,
fakefactors.RawFakeFactors_nmssm_tt_2,
fakefactors.FakeFactors_nmssm_tt_1,
fakefactors.FakeFactors_nmssm_tt_2,
],
)
configuration.add_outputs(
["tt"],
[
q.raw_fake_factor_1,
q.raw_fake_factor_2,
q.fake_factor_1,
q.fake_factor_2,
],
)
#########################
# Finalize and validate the configuration
#########################
configuration.optimize()
configuration.validate()
configuration.report()
return configuration.expanded_configuration()