electron#
Electron related event weights.
Classes:
|
|
|
|
|
|
|
- class ElectronSFConfig(correction, campaign, working_point='', hlt_path='', min_pt=0.0, max_pt=0.0)[source]#
Bases:
objectAttributes:
Methods:
new(obj)- correction: str#
- campaign: str#
- working_point: str | dict[str, Callable] = ''#
- hlt_path: str = ''#
- min_pt: float = 0.0#
- max_pt: float = 0.0#
- class electron_weights(*args, **kwargs)[source]#
Bases:
ProducerAttributes:
Methods:
call_func(events[, electron_mask])Creates electron weights using the correctionlib.
get_electron_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)- cache_instances = True#
- call_func(events, electron_mask=Ellipsis, **kwargs)#
Creates electron weights using the correctionlib. Requires an external file in the config under
electron_sf:cfg.x.external_files = DotDict.wrap({ "electron_sf": "/afs/cern.ch/work/m/mrieger/public/mirrors/jsonpog-integration-9ea86c4c/POG/EGM/2017_UL/electron.json.gz", # noqa })
get_electron_file can be adapted in a subclass in case it is stored differently in the external files.
The name of the correction set, the year string for the weight evaluation, and the name of the working point should be given as an auxiliary entry in the config:
cfg.x.electron_sf = ElectronSFConfig( correction="UL-Electron-ID-SF", campaign="2017", working_point="wp80iso", # for trigger weights use hlt_path instead )
The working_point can also be a dictionary mapping working point names to functions that return a boolean mask for the electrons. This is useful to compute scale factors for multiple working points at once, e.g. for the electron reconstruction scale factors:
cfg.x.electron_sf = ElectronSFConfig( correction="Electron-ID-SF", campaign="2022Re-recoE+PromptFG", working_point={ "RecoBelow20": lambda variable_map: variable_map["pt"] < 20.0, "Reco20to75": lambda variable_map: (variable_map["pt"] >= 20.0) & (variable_map["pt"] < 75.0), "RecoAbove75": lambda variable_map: variable_map["pt"] >= 75.0, }, )
get_electron_config can be adapted in a subclass in case it is stored differently in the config.
Optionally, an electron_mask can be supplied to compute the scale factor weight based only on a subset of electrons.
- Return type:
ak.Array
- get_electron_config()#
- get_electron_file(external_files)#
- mc_only: bool = True#
- supported_versions = {1, 2, 3, 4, 5}#
- static update_cls_dict(cls_name, cls_dict, get_attr)#
- use_supercluster_eta = True#
- uses = {'Electron.{pt,eta,phi,deltaEtaSC}'}#
- weight_name = 'electron_weight'#
- class electron_trigger_weights(*args, **kwargs)#
Bases:
electron_weightsAttributes:
Methods:
get_electron_file(external_files)skip_func(**kwargs)Default skip function.
- cache_instances = True#
- get_electron_config()#
- get_electron_file(external_files)#
- use_supercluster_eta = False#
- weight_name = 'electron_trigger_weight'#
- class electron_sceta(*args, **kwargs)[source]#
Bases:
ProducerAttributes:
Methods:
call_func(events, **kwargs)Returns the electron super cluster eta.
skip_func(**kwargs)Default skip function.
update_cls_dict(cls_name, cls_dict, get_attr)- cache_instances = True#
- produces = {'Electron.superclusterEta'}#
- static update_cls_dict(cls_name, cls_dict, get_attr)#
- uses = {'Electron.{pt,phi,eta,deltaEtaSC}'}#