json_filter
#
Selectors for applying golden JSON in data.
Selectors
#
- class json_filter(*args, **kwargs)[source]#
Bases:
Selector
- 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.
- 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.- Parameters:
reqs (
dict
) – Contains requirements for this taskinputs (
dict
) – Additional inputs, currently not usedreader_targets (
InsertableDict
) – Additional targets, currently not used
- Return type:
- shifts_only = None#
- uses = {'luminosityBlock', 'run'}#