json_filter
#
Selectors for applying golden JSON in data.
Functions:
|
Function to load path or url to golden json files. |
Classes:
|
- get_lumi_file_default(self, external_files)[source]#
Function to load path or url to golden json files.
By default, the path is extracted from the current config_inst, which should have a external_files in the auxiliary information block. The path or url is extracted with
external_files.lumi.golden
- class json_filter(*args, **kwargs)[source]#
Bases:
Selector
Methods:
call_func
(events[, data_only])Select only events from certified luminosity blocks included in the "golden" JSON.
get_lumi_file
(external_files)Function to load path or url to golden json files.
requires_func
(reqs)- rtype:
setup_func
(reqs, inputs, reader_targets)Setup function for
json_filter
.Attributes:
- call_func(events, data_only=True, **kwargs)#
Select only events from certified luminosity blocks included in the “golden” JSON. This filter can only be applied in recorded data.
By default, the JSON file should specified in the config as an external file under
lumi.golden
:cfg.x.external_files = DotDict.wrap({ "lumi": { "golden": "/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions17/13TeV/Legacy_2017/Cert_294927-306462_13TeV_UL2017_Collisions17_GoldenJSON.txt", # noqa }, })
get_lumi_file can be adapted in a subclass in case it is stored differently in the external files.
- Parameters:
- Return type:
- Returns:
Tuple containing the events array and a
SelectionResult
with a “json” field in its “steps” data representing a boolean mask to accept or reject given events
- data_only = False#
- get_lumi_file(external_files)#
Function to load path or url to golden json files.
By default, the path is extracted from the current config_inst, which should have a external_files in the auxiliary information block. The path or url is extracted with
external_files.lumi.golden
- mc_only = False#
- nominal_only = False#
- setup_func(reqs, inputs, reader_targets)#
Setup function for
json_filter
. Load golden JSON and set up run/luminosity block lookup table.
- shifts_only = None#
- uses = {'luminosityBlock', 'run'}#