-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathexample_config.py
More file actions
102 lines (86 loc) · 3.48 KB
/
example_config.py
File metadata and controls
102 lines (86 loc) · 3.48 KB
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 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, get_nPVgood, goldenJson, eventFlags
from pocket_coffea.parameters.cuts import passthrough
from pocket_coffea.parameters.histograms import *
from pocket_coffea.lib.calibrators.common import default_calibrators_sequence
import workflow
from workflow import ZmumuBaseProcessor
from pocket_coffea.lib.weights.common import common_weights
# Register custom modules in cloudpickle to propagate them to dask workers
import cloudpickle
import custom_cut_functions
cloudpickle.register_pickle_by_value(workflow)
cloudpickle.register_pickle_by_value(custom_cut_functions)
from custom_cut_functions import *
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/object_preselection.yaml",
f"{localdir}/params/triggers.yaml",
f"{localdir}/params/plotting.yaml",
update=True)
cfg = Configurator(
parameters = parameters,
datasets = {
"jsons": [f"{localdir}/datasets/DATA_SingleMuon_xc2.json",
f"{localdir}/datasets/DYJetsToLL_M-50_xc2.json"
],
"filter" : {
"samples": ["DATA_SingleMuon",
"DYJetsToLL"],
"samples_exclude" : [],
"year": ['2018']
}
},
workflow = ZmumuBaseProcessor,
calibrators = default_calibrators_sequence,
skim = [get_nPVgood(1), eventFlags, goldenJson, # basic skims
get_nObj_min(1, 18., "Muon"),
# Asking only SingleMuon triggers since we are only using SingleMuon PD data
get_HLTsel(primaryDatasets=["SingleMuon"])],
preselections = [dimuon_presel],
categories = {
"baseline": [passthrough],
},
weights_classes = common_weights,
weights = {
"common": {
"inclusive": ["genWeight","lumi","XS",
"pileup",
"sf_mu_id","sf_mu_iso",
],
"bycategory" : {
}
},
"bysample": {
}
},
variations = {
"weights": {
"common": {
"inclusive": [ "pileup",
"sf_mu_id", "sf_mu_iso"
],
"bycategory" : {
}
},
"bysample": {
}
},
},
variables = {
**muon_hists(coll="MuonGood", pos=0),
**count_hist(name="nElectronGood", coll="ElectronGood",bins=3, start=0, stop=3),
**count_hist(name="nMuonGood", coll="MuonGood",bins=3, start=0, stop=3),
**count_hist(name="nJets", coll="JetGood",bins=8, start=0, stop=8),
**count_hist(name="nBJets", coll="BJetGood",bins=8, start=0, stop=8),
**jet_hists(coll="JetGood", pos=0),
**jet_hists(coll="JetGood", pos=1),
"mll" : HistConf( [Axis(coll="ll", field="mass", bins=100, start=0, stop=200, label=r"$M_{\ell\ell}$ [GeV]")] ),
}
)