columnflow.calibration.util#

Useful functions for use by calibrators

Summary#

ak_random(*args, rand_func)

Return an awkward array filled with random numbers.

propagate_met(jet_pt1, jet_phi1, jet_pt2, ...)

Helper function to compute new MET based on per-jet pts and phis before and after a correction.

Functions#

ak_random#

ak_random(*args, rand_func)[source]#

Return an awkward array filled with random numbers.

The args must be broadcastable awkward arrays and will be passed as positional arguments to rand_func to obtain the random numbers.

Parameters:

rand_func (Callable) – Callable to generate random numbers from awkward arrays in args.

Return type:

Array

Returns:

awkward array filled with random numbers.

propagate_met#

propagate_met(jet_pt1, jet_phi1, jet_pt2, jet_phi2, met_pt1, met_phi1)[source]#

Helper function to compute new MET based on per-jet pts and phis before and after a correction. Since the pts and phis parameterize the individual jets, the dimensions of the arrays (jet_pt1, jet_phi1) as well as (jet_pt2, jet_phi2) must be the same. The pt values are decomposed into their x and y components, which are then propagated to the corresponding contributions to the MET vector

Parameters:
  • jet_pt1 (Array) – transverse momentum of first jet(s)

  • jet_phi1 (Array) – azimuthal angle of first jet(s)

  • jet_pt2 (Array) – transverse momentum of second jet(s)

  • jet_phi2 (Array) – azimuthal angle of second jet(s)

  • met_pt1 (Array) – missing transverse momentum (MET)

  • met_phi1 (Array) – azimuthal angle of MET vector

Raises:

AssertionError – if arrays (jet_pt1, jet_phi1) and (jet_pt2, jet_phi2) have different dimensions.

Return type:

tuple[Array, Array]

Returns:

updated values of MET vector, i.e. missing transverse momentum and corresponding azimuthal angle phi.