muon#

Muon related event weights.

Classes:

MuonSFConfig(correction[, campaign, min_pt, ...])

muon_weights(*args, **kwargs)

muon_trigger_weights(*args, **kwargs)

class MuonSFConfig(correction, campaign='', min_pt=0.0, max_pt=0.0)[source]#

Bases: object

Attributes:

Methods:

new(obj)

correction: str#
campaign: str = ''#
min_pt: float = 0.0#
max_pt: float = 0.0#
classmethod new(obj)[source]#
Return type:

MuonSFConfig

class muon_weights(*args, **kwargs)[source]#

Bases: Producer

Attributes:

Methods:

call_func(events[, muon_mask])

Creates muon weights using the correctionlib.

get_muon_config()

get_muon_file(external_files)

init_func(**kwargs)

Default init function.

requires_func(task, reqs, **kwargs)

Default requires function.

setup_func(task, reqs, inputs, ...)

Default setup function.

skip_func(**kwargs)

Default skip function.

update_cls_dict(cls_name, cls_dict, get_attr)

update_corrector_variables(corrector, variables)

cache_instances = True#
call_func(events, muon_mask=Ellipsis, **kwargs)#

Creates muon weights using the correctionlib. Requires an external file in the config under muon_sf:

cfg.x.external_files = DotDict.wrap({
    "muon_sf": "/afs/cern.ch/work/m/mrieger/public/mirrors/jsonpog-integration-9ea86c4c/POG/MUO/2017_UL/muon_z.json.gz",  # noqa
})

get_muon_file can be adapted in a subclass in case it is stored differently in the external files.

The name of the correction set and the year string for the weight evaluation should be given as an auxiliary entry in the config:

cfg.x.muon_sf = MuonSFConfig(
    correction="NUM_TightRelIso_DEN_TightIDandIPCut",
    campaign="2017_UL",
)

get_muon_config can be adapted in a subclass in case it is stored differently in the config.

Optionally, a muon_mask can be supplied to compute the scale factor weight based only on a subset of muons.

Return type:

ak.Array

get_muon_config()#
get_muon_file(external_files)#
init_func(**kwargs)#

Default init function.

Return type:

None

mc_only: bool = True#
requires_func(task, reqs, **kwargs)#

Default requires function.

Return type:

None

setup_func(task, reqs, inputs, reader_targets, **kwargs)#

Default setup function.

Return type:

None

skip_func(**kwargs) bool#

Default skip function.

Return type:

bool

supported_versions = {1, 2}#
static update_cls_dict(cls_name, cls_dict, get_attr)#
update_corrector_variables(corrector, variables)#
uses = {'Muon.{pt,eta}'}#
weight_name = 'muon_weight'#
class muon_trigger_weights(*args, **kwargs)#

Bases: muon_weights

Attributes:

Methods:

get_muon_config()

get_muon_file(external_files)

skip_func(**kwargs)

Default skip function.

cache_instances = True#
get_muon_config()#
get_muon_file(external_files)#
skip_func(**kwargs) bool#

Default skip function.

Return type:

bool

weight_name = 'muon_trigger_weight'#