ijazz.plotting
Functions
entry point for the ijazz_plot command |
|
|
Create a list of Axes to plot the results in the json file. |
|
Create a list of Axes to plot the results in the json file. |
|
Plot the contribution of each systematic uncertainties from the json files |
|
Plot the result of the scale and smearing fit |
Module Contents
- ijazz.plotting.plot_results_from_json(json_file: str | pathlib.Path | Dict, dims: List = None, x_range=(), x_unit='', cat_latex: Dict = None, resp_range=(), reso_range=(), hide_legend=False, jsons_mode='', param_to_plot=None, **kwargs) Tuple[List[matplotlib.pyplot.Figure], matplotlib.pyplot.Axes][source]
Create a list of Axes to plot the results in the json file. the dimensions to plot can be specified, additional dimension are averaged over. Up to 3 dimensions can be plotted.
- Parameters:
json_file (Union[str, Path, Dict]) – json file containing the results of the IJazZ SAS fit or Dict from the json file
dims (List, optional) – name dimensions to plot (as in the categories). Defaults to None.
x_range (tuple, optional) – range of the main variable (dimension 0). Defaults to ().
x_unit (str, optional) – usint of the main varaible. Defaults to ‘’.
cat_latex (Dict, optional) – dictionnary mapping var name (from categories) into a latex name. Defaults to None.
resp_range (tuple, optional) – y-range of the resp axis. Defaults to ().
reso_range (tuple, optional) – y-range if the reso axis. Defaults to ().
leg_ncol (int, optional) – number of columns in the legend. Defaults to 1.
hide_legend (bool, optional) – hide the legend. Defaults to False.
jsons_mode (str, optional) – select plotting mode between ‘compare’ and ‘ratio’. Defaults to ‘’.
param_to_plot (str, optional) – parameter to plot (resp or reso) if compare_jsons. Defaults to None.
- Returns:
Figure and Axes of the plot.
- Return type:
Tuple[Figure, Axes]
- ijazz.plotting.plot_results_from_json2G(json_file: str | pathlib.Path | Dict, dims: List = None, x_range=(), x_unit='', cat_latex: Dict = None, mu_range=(0.78, 1.02), reso2_range=(-0.001, 0.1), frac_range=(0.78, 1.02), **kwargs) Tuple[List[matplotlib.pyplot.Figure], matplotlib.pyplot.Axes][source]
Create a list of Axes to plot the results in the json file. the dimensions to plot can be specified, additional dimension are averaged over. Up to 3 dimensions can be plotted.
- Parameters:
json_file (Union[str, Path, Dict]) – json file containing the results of the IJazZ SAS fit or Dict from the json file
dims (List, optional) – name dimensions to plot (as in the categories). Defaults to None.
x_range (tuple, optional) – range of the main variable (dimension 0). Defaults to ().
x_unit (str, optional) – usint of the main varaible. Defaults to ‘’.
cat_latex (Dict, optional) – dictionnary mapping var name (from categories) into a latex name. Defaults to None.
resp_range (tuple, optional) – y-range of the resp axis. Defaults to ().
reso_range (tuple, optional) – y-range if the reso axis. Defaults to ().
leg_ncol (int, optional) – number of columns in the legend. Defaults to 1.
- Returns:
Figure and Axes of the plot.
- Return type:
Tuple[Figure, Axes]
- ijazz.plotting.plot_syst_from_jsons(nominal: Dict | str | pathlib.Path, syst_jsons: List[Dict | str | pathlib.Path], fit_2g: Dict | str | pathlib.Path = None, nominal_syst: Dict | str | pathlib.Path = None, scale_flat_syst: float = 0.0, smear_flat_syst: float = 0.0, **kwargs) Tuple[str, List[str]][source]
Plot the contribution of each systematic uncertainties from the json files
- Parameters:
nominal (Union[Dict, str, Path]) – nominal json file
syst_jsons (List[Union[Dict, str, Path]]) – list of json files with systematic variations
fit_2g (Union[Dict, str, Path], optional) – json file with the parameters of the double gaussian fit. Defaults to None.
scale_flat_syst (float, optional) – flat scale systematic uncertainty. Defaults to 0.0.
smear_flat_syst (float, optional) – flat smear systematic uncertainty. Defaults to 0.0.
Returns:
- ijazz.plotting.plot_sas_fit_results(sas: ijazz.ScaleAndSmearing.IJazZSAS, cat_latex={}, x_range=None, resp_range=(0.95, 1.05), reso_range=(0, 0.05), add_injected=False, use_pt_cat=False, resp_range_ratio=(0.999, 1.001), reso_range_ratio=(0.8, 1.2), pt_scale_std=1.0) Tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]
Plot the result of the scale and smearing fit
- Parameters:
sas (IJazZSAS) – object containing the fit result of the scale and smearing (as well as the data , mc samples)
cat_latex (dict, optional) – dict containing for each variable used for categorisation a latex plotting symbol (e.g. {‘pt’: ‘p_T’}). Defaults to {}.
x_range (tuple, optional) – x axis range (can be auto). Defaults to None.
resp_range (tuple, optional) – y axis range for response. Defaults to (0.95, 1.05).
reso_range (tuple, optional) – y axis range for resolution. Defaults to (0, 0.05).
add_injected (bool, optional) – When a resolution was injected for test, plot the value (variable sas per lepton must exist filled with the injected s&s). Defaults to False.
use_pt_cat (bool, optional) – Use the pt categorisation axis (when fitting with relative pt, allows to plot back w/r to pt). Defaults to False.
resp_range_ratio (tuple, optional) – y axis range for response ratio. Defaults to (0.999, 1.001).
reso_range_ratio (tuple, optional) – y axis range for resolution ratio. Defaults to (0.80, 1.20).
pt_scale_std (float, optional) – ?. Defaults to 1.0.
- Returns:
matplotlib figure, axes with the result
- Return type:
tuple[plt.Figure, plt.Axes]