ijazz.toys

Attributes

__doc__

mass_z

gamma_z

win_z_mc

win_z_dt

Functions

decalibrate(x)

Decalibrate the response of the events for the property x.

oversmearing(x)

Applies additional oversmearing based on the property x.

oversmearing2(x)

Return a quadratic oversmearing model as a function of x.

dataset(do_decal[, n_toys, decalibrate_f, ...])

Create the dataset.

tree_to_df(tree[, random_R9, use_fabrice])

Convert a ROOT tree to a pandas DataFrame with derived columns.

tree_to_df_paul(tree)

Paul's ROOT tree reader with Pythia-like inputs.

tree_to_df_fabrice(tree)

Fabrice's ROOT tree reader with Pythia-like inputs.

detector_smearing(x1, x2, mee[, sigma])

Adds Gaussian smearing with resolution sigma to x1, x2, and mee.

decal_and_os(x1, x2, pT1, pT2, mee[, decalibrate_f, ...])

Decalibrate and add oversmearing to pT1, pT2, and mee.

Module Contents

ijazz.toys.__doc__ = 'This module allows to create a simple MC simulation of the Z->ee decaywith a gaussian smearing...[source]
ijazz.toys.mass_z[source]
ijazz.toys.gamma_z[source]
ijazz.toys.win_z_mc = (50, 130)[source]
ijazz.toys.win_z_dt = (70, 110)[source]
ijazz.toys.decalibrate(x)[source]

Decalibrate the response of the events for the property x.

Parameters:

x (np.ndarray) – Input property.

Returns:

Decalibrated response.

Return type:

tf.Tensor

ijazz.toys.oversmearing(x)[source]

Applies additional oversmearing based on the property x.

Parameters:

x (np.ndarray) – Input property.

Returns:

Oversmearing values.

Return type:

np.ndarray

ijazz.toys.oversmearing2(x)[source]

Return a quadratic oversmearing model as a function of x.

ijazz.toys.dataset(do_decal, n_toys=100, decalibrate_f=decalibrate, oversmearing_f=oversmearing, smear_property=False, prop_gaus=False, return_smear=False)[source]

Create the dataset.

Parameters:
  • prop_gaus (bool) – If True, generate properties with a Gaussian distribution (mean=45, sigma=25).

  • do_decal (bool) – If True, decalibrate the Z BW events using the decalibrate_f and oversmearing_f functions.

  • n_toys (int) – Number of Monte Carlo toys to generate.

  • decalibrate_f (Callable) – Function to apply scale decalibration.

  • oversmearing_f (Callable) – Function to apply oversmearing.

  • smear_property (bool) – If True, smear the properties x1 and x2 according to the smearing in the mass.

  • prop_gaus – If True, generate properties with a Gaussian shape.

  • return_smear (bool) – If True, return smeared values.

Returns:

A tuple containing the smeared mass (mee_smear), and the properties x1 and x2 of the two electrons. If return_smear is True, also return the smearing factors s1 and s2.

Return type:

Tuple[tf.Tensor, tf.Tensor, tf.Tensor]

ijazz.toys.tree_to_df(tree, random_R9=True, use_fabrice=False)[source]

Convert a ROOT tree to a pandas DataFrame with derived columns.

ijazz.toys.tree_to_df_paul(tree)[source]

Paul’s ROOT tree reader with Pythia-like inputs.

ijazz.toys.tree_to_df_fabrice(tree)[source]

Fabrice’s ROOT tree reader with Pythia-like inputs.

ijazz.toys.detector_smearing(x1, x2, mee, sigma=0.02)[source]

Adds Gaussian smearing with resolution sigma to x1, x2, and mee.

Parameters:
  • x1 (np.ndarray) – Variable to apply the smearing (first electron).

  • x2 (np.ndarray) – Variable to apply the smearing (second electron).

  • mee (np.ndarray) – Variable to apply the smearing (dilepton system).

  • sigma (float, optional) – Gaussian resolution. Defaults to 0.02.

Returns:

Smeared variables x1_smear, x2_smear, and mee_smear.

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray]

ijazz.toys.decal_and_os(x1, x2, pT1, pT2, mee, decalibrate_f=decalibrate, oversmearing_f=oversmearing, decal_kwargs={}, os_kwargs={})[source]

Decalibrate and add oversmearing to pT1, pT2, and mee.

Parameters:
  • x1 (tuple) – Variables to use as input for the decalibrate and oversmearing functions (first lepton).

  • x2 (tuple) – Variables to use as input for the decalibrate and oversmearing functions (second lepton).

  • pT1 (float) – Variable to apply the decalibration and oversmearing (first lepton).

  • pT2 (float) – Variable to apply the decalibration and oversmearing (second lepton).

  • mee (float) – Variable to apply the decalibration and oversmearing (dilepton system).

  • decalibrate_f (Callable) – Function to decalibrate the pT. Defaults to decalibrate.

  • oversmearing_f (Callable) – Function to oversmear the pT. Defaults to oversmearing_all.

Returns:

pT1_smear, pT2_smear, mee_smear, mee_os (mee with only oversmearing).

Return type:

Tuple[float, float, float, float]