btag#
Producers for btag scale factor weights.
Classes:
|
|
|
- class BTagSFConfig(correction_set, jec_sources, discriminator='', corrector_kwargs=<factory>)[source]#
Bases:
objectAttributes:
Methods:
new(obj)- rtype:
BTagSFConfig
- class btag_weights(*args, requires_func=law.util.no_value, setup_func=law.util.no_value, sandbox=law.util.no_value, call_force=law.util.no_value, max_chunk_size=law.util.no_value, pick_cached_result=law.util.no_value, inst_dict=None, **kwargs)[source]#
Bases:
ProducerMethods:
call_func(events[, jet_mask, ...])B-tag scale factor weight producer.
get_btag_file(external_files)- rtype:
requires_func(reqs)- rtype:
setup_func(reqs, inputs, reader_targets)- rtype:
update_cls_dict(cls_name, cls_dict, get_attr)Attributes:
- call_func(events, jet_mask=Ellipsis, negative_b_score_action='ignore', negative_b_score_log_mode='warning', **kwargs)#
B-tag scale factor weight producer. Requires an external file in the config as under
btag_sf_corr:cfg.x.external_files = DotDict.wrap({ "btag_sf_corr": "/afs/cern.ch/work/m/mrieger/public/mirrors/jsonpog-integration-9ea86c4c/POG/BTV/2017_UL/btagging.json.gz", # noqa })
get_btag_file can be adapted in a subclass in case it is stored differently in the external files.
The name of the correction set, a list of JEC uncertainty sources which should be propagated through the weight calculation, and the column used for b-tagging should be given as an auxiliary entry in the config:
cfg.x.btag_sf = BTagSFConfig( correction_set="deepJet_shape", jec_sources=["Absolute", "FlavorQCD", ...], discriminator="btagDeepFlavB", corrector_kwargs={...}, )
get_btag_config can be adapted in a subclass in case it is stored differently in the config.
Optionally, a jet_mask can be supplied to compute the scale factor weight based only on a subset of jets.
The negative_b_score_action defines the procedure of how to handle jets with a negative b-tag. Supported modes are: :rtype: ak.Array
“ignore”: the jet_mask is extended to exclude jets with b_score < 0
- “remove”: the scale factor is set to 0 for jets with b_score < 0, resulting in an overall
btag weight of 0 for the event
“raise”: an exception is raised
The verbosity of the handling of jets with negative b-score can be set via negative_b_score_log_mode, which offers the following options:
"none": no message is given"info": a logger.info message is given"debug": a logger.debug message is given"warning": a logger.warning message is given
Resources:
- data_only = False#
- get_btag_config()#
- get_btag_file(external_files)#
- mc_only = True#
- nominal_only = False#
- shifts_only = None#
- skip_func()#
- static update_cls_dict(cls_name, cls_dict, get_attr)#
- uses = {'Jet.{pt,eta,hadronFlavour}'}#
- weight_name = 'btag_weight'#