Commit 4cf971b8 authored by Victor Hugo Ruelas Rivera's avatar Victor Hugo Ruelas Rivera
Browse files

Merge remote-tracking branch 'upstream/master'

parents 4f5144b5 819bbc98
Pipeline #3295966 passed with stages
in 19 minutes and 17 seconds
......@@ -347,7 +347,7 @@ Dips_saliency_b_WP77_passed_ttbar:
| `target_beff` | Float | Necessary | The WP which needs to be passed/not passed. |
| `jet_flavour` | Int | Necessary | Class which is to be plotted. |
| `PassBool` | Bool | Necessary | Decide if the b-tagging discriminant of the jets, which will be used, needs to be above the WP cut value or not. |
| `FlipAxis` | Bool | Optional | If True, the y and x axis will be switched. Usefull for presenation plots. True: landscape format. |
| `FlipAxis` | Bool | Optional | If True, the y and x axis will be switched. Useful for presentation plots. True: landscape format. |
| `UseAtlasTag` | Bool | Optional | Decide if the ATLAS Tag is printed in the upper left corner of the plot or not. |
| `AtlasTag` | String | Optional | The first line of text right behind the 'ATLAS'. |
| `SecondTag` | String | Optional | Second line (if its starts with `\n`) of text right below the 'ATLAS' and the AtlasTag. |
......@@ -455,7 +455,7 @@ eff_vs_pt:
| `data_set_for_cut_name` | string | Optional | The dataset to use to compute the cut_value defining the working point. |
| `recompute` | bool | Optional | Whether to recompute the score or load it (useful if different fractions). If recomputing, `flavour_fractions` must be defined. Will recompute by default. |
| `class_labels` | List | Necessary | List of class labels that were used in the preprocessing/training. They must be the same as in preprocessing! Order is important! |
| `main_class` | string | Necessary | The main class label to tagg. Must be in `class_labels`. |
| `main_class` | string | Necessary | The main class label to tag. Must be in `class_labels`. |
| `tagger_name` | string | Necessary | The name of the tagger to use (will be composed with probability of the flavour to retrieve the probability: e.g., "DL1" leads to "DL1_pb", "DL1_pc", ...). |
| `frac_values` | dictionary | Optional | The flavour fractions used. Only necessary if recomputing the scores. Added to the tag if not None. |
| `variable` | String | Necessary | A variable contained in the h5 result file from `evaluate.py` (e.g., "pt"). <br /> To include any non-standard variable in this h5, include them in the list of the parameter `add_variables_eval` in the training configuration ([example](https://gitlab.cern.ch/atlas-flavor-tagging-tools/algorithms/umami/-/blob/master/examples/DL1r-PFlow-Training-config.yaml#L69)). <br /> Note! pt variable is automatically transformed in GeV (divide by 1000)! |
......@@ -534,7 +534,7 @@ eff_vs_pt_small:
| `data_set_for_cut_name` | string | Optional (for each model) | The dataset to use to compute the cut_value defining the working point. |
| `recompute` | bool | Optional | Whether to recompute the score or load it (useful if different fractions). If recomputing, `flavour_fractions` must be defined for the model considered. Setting recompute above models set it as default. Will recompute by default. |
| `class_labels` | List | Necessary (for each model or above all models) | List of class labels that were used in the preprocessing/training. They must be the same as in preprocessing! Order is important! |
| `main_class` | string | Necessary | The main class label to tagg. Must be in `class_labels`. |
| `main_class` | string | Necessary | The main class label to tag. Must be in `class_labels`. |
| `frac_values` | dictionary | Optional (for each model or above all models, then serving as default) | The flavour fractions used. Necessary if recomputing the scores for a tagger. If defined above model, will be added to the tag if not None.|
| `variable` | String | Necessary | A variable contained in the h5 result file from `evaluate.py` (e.g., "pt"). <br /> To include any non-standard variable in this h5, include them in the list of the parameter `add_variables_eval` in the training configuration ([example](https://gitlab.cern.ch/atlas-flavor-tagging-tools/algorithms/umami/-/blob/master/examples/DL1r-PFlow-Training-config.yaml#L69)). <br /> Note! pt variable is automatically transformed in GeV (divide by 1000)! |
| `flat_eff` | bool | Optional | Whether to use a flat b-tag b-jet efficiency per variable bin or a global one. |
......@@ -618,6 +618,7 @@ nTracks_ttbar_loose:
variables: "tracks"
folder_to_save: input_vars_trks_ttbar_loose
nTracks: True
track_origins: ['All', 'Pileup', 'Fake', 'Primary', 'FromB', 'FromBC', 'FromC', 'FromTau', 'OtherSecondary']
Datasets_to_plot:
R21:
files: /work/ws/nemo/fr_af1100-Training-Simulations-0/ntuples_p3985/user.mguth.410470.btagTraining.e6337_s3126_r10201_p3985.EMPFlow_looser-track_selection.2020-07-01-T193555-R26654_output.h5/*
......@@ -644,7 +645,7 @@ nTracks_ttbar_loose:
| `nTracks` | Bool | Necessary | MUST BE TRUE HERE! Decide if the Tracks per Jets are plotted or the input variable. |
| `Datasets_to_plot` | None | Necessary | Here the category starts of which plots shall be plotted. |
| `R21` | None | Necessary | Name of the fileset which is to be plotted. Does not effect anything! |
| `files` | String | Necessary | Path to a file which is to be used for plotting. Wildcard is supported. The function will load as much files as needed to achive the number of jets given in the `Eval_parameters`. |
| `files` | String | Necessary | Path to a file which is to be used for plotting. Wildcard is supported. The function will load as much files as needed to achieve the number of jets given in the `Eval_parameters`. |
| `label` | String | Necessary | Plot label for the plot legend. |
| `plot_settings` | None | Necessary | Here starts the plot settings. Do not fill! |
| `Log` | Bool | Optional | Decide if the plots are plotted with logarithmic y axis or without. |
......@@ -655,6 +656,7 @@ nTracks_ttbar_loose:
| `yAxisIncrease` | Float | Optional |Increase the y-axis by a given factor. Mainly used to fit in the ATLAS Tag without cutting the lines of the plot. |
| `figsize` | List | Optional | Two element list that gives the shape of the plot. (First is width, second is height). |
| `Ratio_Cut` | List | Optional | Two element list that gives the lower (first element) and upper (second element) y axis bound of the ratio plot below the main plot. |
| `track_origins` | List | Optional | List that gives the desired track origins when plotting. |
#### Input Variables Tracks
To plot the track input variables, the following options are used.
......@@ -663,6 +665,7 @@ To plot the track input variables, the following options are used.
input_vars_trks_ttbar_loose_ptfrac:
variables: "tracks"
folder_to_save: input_vars_trks_ttbar_loose
track_origins: ['All', 'Pileup', 'Fake', 'Primary', 'FromB', 'FromBC', 'FromC', 'FromTau', 'OtherSecondary']
Datasets_to_plot:
R21:
files: /work/ws/nemo/fr_af1100-Training-Simulations-0/ntuples_p3985/user.mguth.410470.btagTraining.e6337_s3126_r10201_p3985.EMPFlow_looser-track_selection.2020-07-01-T193555-R26654_output.h5/*
......@@ -707,7 +710,7 @@ input_vars_trks_ttbar_loose_ptfrac:
| `nTracks` | Bool | Necessary | To plot the input variable distributions, this must be `False`. |
| `Datasets_to_plot` | None | Necessary | Here the category starts of which plots shall be plotted. |
| `R21` | None | Necessary | Name of the fileset which is to be plotted. Does not effect anything! |
| `files` | String | Necessary | Path to a file which is to be used for plotting. Wildcard is supported. The function will load as much files as needed to achive the number of jets given in the `Eval_parameters`. |
| `files` | String | Necessary | Path to a file which is to be used for plotting. Wildcard is supported. The function will load as much files as needed to achieve the number of jets given in the `Eval_parameters`. |
| `label` | String | Necessary | Plot label for the plot legend. |
| `plot_settings` | None | Necessary | Here starts the plot settings. Do not fill! |
| `sorting_variable` | String | Optional | Variable Name to sort after. |
......@@ -720,7 +723,8 @@ input_vars_trks_ttbar_loose_ptfrac:
| `yAxisIncrease` | Float | Optional |Increase the y-axis by a given factor. Mainly used to fit in the ATLAS Tag without cutting the lines of the plot. |
| `figsize` | List | Optional | Two element list that gives the shape of the plot. (First is width, second is height). |
| `Ratio_Cut` | List | Optional | If you add more then two models to plot, the comparison function is used with a small ratio plot at the bottom. Two element list that gives the lower (first element) and upper (second element) y axis bound of the ratio plot below the main plot. |
| `binning` | None | Necessary | Here starts the binning for each variable. If you give a `int`, there will be so much equal distant bins. You can also give a three element list which will be used in the `numpy.arange` function. The first element is start, second ist stop and third is the step width. The so aranged numbers are bin edges not bins! If `None` is given, the standard value is `100`. If a variable is not defined here, its not plotted. |
| `binning` | None | Necessary | Here starts the binning for each variable. If you give a `int`, there will be so much equal distant bins. You can also give a three element list which will be used in the `numpy.arange` function. The first element is start, second is stop and third is the step width. The so arranged numbers are bin edges not bins! If `None` is given, the standard value is `100`. If a variable is not defined here, its not plotted. |
| `track_origins` | List | Optional | List that gives the desired track origins when plotting. |
#### Input Variables Jets
To plot the jet input variables, the following options are used.
......@@ -835,10 +839,10 @@ input_vars_ttbar_loose:
| `folder_to_save` | String | Necessary | Path where the plots should be saved. This is a relative path. Add a folder name as path. |
| `Datasets_to_plot` | None | Necessary | Here the category starts of which plots shall be plotted. |
| `R21` | None | Necessary | Name of the fileset which is to be plotted. Does not effect anything! |
| `files` | String | Necessary | Path to a file which is to be used for plotting. Wildcard is supported. The function will load as much files as needed to achive the number of jets given in the `Eval_parameters`. |
| `files` | String | Necessary | Path to a file which is to be used for plotting. Wildcard is supported. The function will load as much files as needed to achieve the number of jets given in the `Eval_parameters`. |
| `label` | String | Necessary | Plot label for the plot legend. |
| `special_param_jets` | None | Necessary | Here starts the special x axis limits for a variable. If you want to set the x range by hand, add the variable here and also the `lim_left` for xmin and `lift_right` for xmax. |
| `binning` | None | Necessary | Here starts the binning for each variable. If you give a `int`, there will be so much equal distant bins. You can also give a three element list which will be used in the `numpy.arange` function. The first element is start, second ist stop and third is the step width. The so aranged numbers are bin edges not bins! If `None` is given, the standard value is `100`. Variables that are not in here are not plotted! |
| `binning` | None | Necessary | Here starts the binning for each variable. If you give a `int`, there will be so much equal distant bins. You can also give a three element list which will be used in the `numpy.arange` function. The first element is start, second is stop and third is the step width. The so arranged numbers are bin edges not bins! If `None` is given, the standard value is `100`. Variables that are not in here are not plotted! |
| `plot_settings` | None | Necessary | Here starts the plot settings. Do not fill! |
| `Log` | Bool | Optional | Decide if the plots are plotted with logarithmic y axis or without. |
| `UseAtlasTag` | Bool | Optional | Decide if the ATLAS Tag is printed in the upper left corner of the plot or not. |
......
......@@ -65,3 +65,14 @@ hist_err_style:
linewidth: 0
hatch: "/////"
edgecolor: "#666666"
# Track origin map
OriginType:
Pileup: 0
Fake: 1
Primary: 2
FromB: 3
FromBC: 4
FromC: 5
FromTau: 6
OtherSecondary: 7
......@@ -30,6 +30,7 @@ class Configuration(object):
"MPLPlottingBackend",
"flavour_categories",
"hist_err_style",
"OriginType",
]
for item in config_items:
if item in self.config:
......
......@@ -51,6 +51,7 @@ def plot_nTracks_per_Jet(
ncol=2,
Ratio_Cut=None,
Bin_Width_y_axis=True,
track_origin="All",
):
"""
Plotting the number of tracks per jet as a histogram.
......@@ -145,6 +146,9 @@ def plot_nTracks_per_Jet(
if not os.path.isdir(f"{output_directory}/"):
os.makedirs(f"{output_directory}/")
logger.info(f"Path: {output_directory}")
logger.info(f"Track origin: {track_origin}\n")
# Define the figure with two subplots of unequal sizes
axis_dict = {}
......@@ -179,7 +183,12 @@ def plot_nTracks_per_Jet(
):
# Sort after given variable
trks = np.asarray(trks_dict[label])
nTracks = np.sum(~np.isnan(trks["ptfrac"]), axis=1)
if track_origin == 'All':
nTracks = np.sum(~np.isnan(trks["ptfrac"]), axis=1)
else:
nTracks = np.sum(np.logical_and(~np.isnan(trks["ptfrac"]),
trks['truthOriginLabel'] == global_config.OriginType[track_origin]
), axis=1)
if model_number == 0:
# Calculate unified Binning
......@@ -307,7 +316,8 @@ def plot_nTracks_per_Jet(
axis_dict["left"]["top"].tick_params(axis="y", labelcolor=ycolor)
axis_dict["left"]["ratio"].set_xlabel(
"Number of tracks per Jet",
"Number of tracks per Jet" if track_origin == 'All'
else f"Number of tracks per Jet ({track_origin})",
fontsize=12,
horizontalalignment="right",
x=1.0,
......@@ -366,7 +376,7 @@ def plot_nTracks_per_Jet(
)
# Save and close figure
plt.savefig(f"{output_directory}/nTracks_per_Jet.{plot_type}")
plt.savefig(f"{output_directory}/nTracks_per_Jet_{track_origin}.{plot_type}")
plt.close()
plt.clf()
......@@ -396,6 +406,7 @@ def plot_input_vars_trks_comparison(
ncol=2,
Ratio_Cut=None,
Bin_Width_y_axis=True,
track_origin="All",
):
"""
Plotting the track variable in comparison to another model with ratio plot.
......@@ -552,7 +563,8 @@ def plot_input_vars_trks_comparison(
logger.info(f"Path: {filedir}")
logger.info(f"Sorting: {sorting_variable}")
logger.info(f"nLeading track: {nLeading}\n")
logger.info(f"nLeading track: {nLeading}")
logger.info(f"Track origin: {track_origin}\n")
# Loop over vars
for var in trksVars:
......@@ -597,18 +609,32 @@ def plot_input_vars_trks_comparison(
)
# Sort the variables and tracks after given variable
tmp = np.asarray(
[
trks_dict[label][var][k][sorting[k]]
for k in range(
len(trks_dict[label][sorting_variable])
)
]
)
if track_origin == 'All':
tmp = np.asarray(
[
trks_dict[label][var][k][sorting[k]]
for k in range(
len(trks_dict[label][sorting_variable])
)
]
)
else:
# Select tracks of a given origin, so keep truthOriginLabel
tmp = np.asarray(
[
trks_dict[label][[var, 'truthOriginLabel']][k][sorting[k]]
for k in range(
len(trks_dict[label][sorting_variable])
)
]
)
if model_number == 0:
# Calculate unified Binning
first_flav = tmp[flavour_label_dict[label] == 0]
if track_origin == 'All':
first_flav = tmp[flavour_label_dict[label] == 0]
else:
first_flav = tmp[var][flavour_label_dict[label] == 0]
if nBins_dict[var] is None:
_, Binning = np.histogram(
......@@ -629,9 +655,16 @@ def plot_input_vars_trks_comparison(
jets = tmp[flavour_label_dict[label] == flav_label]
# Get number of tracks
Tracks = jets[:, nLeading][
~np.isnan(jets[:, nLeading])
]
if track_origin == 'All':
Tracks = jets[:, nLeading][
~np.isnan(jets[:, nLeading])
]
else:
mask_nan = ~np.isnan(jets[var][:, nLeading])
mask_origin = np.asarray(jets[:, nLeading]['truthOriginLabel'] == global_config.OriginType[track_origin])
Tracks = jets[:, nLeading][
np.logical_and(mask_nan, mask_origin)
][var]
# Calculate bins
bins, weights, unc, band = uet.calc_bins(
......@@ -768,12 +801,15 @@ def plot_input_vars_trks_comparison(
if nLeading is None:
axis_dict["left"]["ratio"].set_xlabel(
var, fontsize=12, horizontalalignment="right", x=1.0
f"{var}" if track_origin == 'All'
else f"{var} ({track_origin})",
fontsize=12, horizontalalignment="right", x=1.0
)
else:
axis_dict["left"]["ratio"].set_xlabel(
f"{nLeading+1} leading tracks {var}",
f"{nLeading+1} leading tracks {var}" if track_origin == 'All'
else f"{nLeading+1} leading tracks {var} ({track_origin})",
fontsize=12,
horizontalalignment="right",
x=1.0,
......@@ -834,7 +870,7 @@ def plot_input_vars_trks_comparison(
)
# Save and close figure
plt.savefig(f"{filedir}/{var}_{nLeading}.{plot_type}")
plt.savefig(f"{filedir}/{var}_{nLeading}_{track_origin}.{plot_type}")
plt.close()
plt.clf()
logger.info(
......@@ -866,6 +902,7 @@ def plot_input_vars_trks(
legFontSize=10,
ncol=2,
Bin_Width_y_axis=True,
track_origin="All",
):
"""
Plotting the track variable.
......@@ -1021,7 +1058,8 @@ def plot_input_vars_trks(
logger.info(f"Path: {filedir}")
logger.info(f"Sorting: {sorting_variable}")
logger.info(f"nLeading track: {nLeading}\n")
logger.info(f"nLeading track: {nLeading}")
logger.info(f"Track origin: {track_origin}\n")
for var in nBins_dict:
if var not in trksVars:
......@@ -1049,17 +1087,31 @@ def plot_input_vars_trks(
)
# Sort the variables and tracks after given variable
tmp = np.asarray(
[
trks_dict[label][var][k][sorting[k]]
for k in range(
len(trks_dict[label][sorting_variable])
)
]
)
if track_origin == 'All':
tmp = np.asarray(
[
trks_dict[label][var][k][sorting[k]]
for k in range(
len(trks_dict[label][sorting_variable])
)
]
)
else:
# Select tracks of a given origin, so keep truthOriginLabel
tmp = np.asarray(
[
trks_dict[label][[var, 'truthOriginLabel']][k][sorting[k]]
for k in range(
len(trks_dict[label][sorting_variable])
)
]
)
# Calculate unified Binning
first_flav = tmp[flavour_label_dict[label] == 0]
if track_origin == 'All':
first_flav = tmp[flavour_label_dict[label] == 0]
else:
first_flav = tmp[var][flavour_label_dict[label] == 0]
# Check if binning is already set
if nBins_dict[var] is None:
......@@ -1098,9 +1150,16 @@ def plot_input_vars_trks(
jets = tmp[flavour_label_dict[label] == flav_label]
# Get number of tracks
Tracks = jets[:, nLeading][
~np.isnan(jets[:, nLeading])
]
if track_origin == 'All':
Tracks = jets[:, nLeading][
~np.isnan(jets[:, nLeading])
]
else:
mask_nan = ~np.isnan(jets[var][:, nLeading])
mask_origin = np.asarray(jets[:, nLeading]['truthOriginLabel'] == global_config.OriginType[track_origin])
Tracks = jets[:, nLeading][
np.logical_and(mask_nan, mask_origin)
][var]
# Calculate bins
bins, weights, unc, band = uet.calc_bins(
......@@ -1146,10 +1205,16 @@ def plot_input_vars_trks(
)
if nLeading is None:
plt.xlabel(var)
plt.xlabel(
f"{var}" if track_origin == 'All'
else f"{var} ({track_origin})"
)
else:
plt.xlabel(f"{nLeading+1} leading tracks {var}")
plt.xlabel(
f"{nLeading+1} leading tracks {var}" if track_origin == 'All'
else f"{nLeading+1} leading tracks {var} ({track_origin})"
)
# Add axes, titels and the legend
if Bin_Width_y_axis is True:
......@@ -1195,7 +1260,7 @@ def plot_input_vars_trks(
ymax=yAxisAtlasTag,
)
plt.savefig(f"{filedir}/{var}_{nLeading}.{plot_type}")
plt.savefig(f"{filedir}/{var}_{nLeading}_{track_origin}.{plot_type}")
plt.close()
plt.clf()
logger.info(f"{filedir}/{var}.{plot_type}\n")
......
......@@ -63,6 +63,11 @@ def plot_trks_variables(plot_config, plot_type):
logger.info(f"Start {plot_name}...\n")
filepath_list = []
labels_list = []
# Default to no selection based on track_origin
trk_origins = ['All']
# Update list of track origins if specified
if "track_origins" in plotting_config:
trk_origins = plotting_config["track_origins"]
for model_name, model_config in plotting_config[
"Datasets_to_plot"
......@@ -84,65 +89,70 @@ def plot_trks_variables(plot_config, plot_type):
]
)
if len(filepath_list) >= 2:
if ("nTracks" in plotting_config) and (
plotting_config["nTracks"] is True
):
uit.plot_nTracks_per_Jet(
datasets_filepaths=filepath_list,
datasets_labels=labels_list,
class_labels=plotting_config["class_labels"],
var_dict=plot_config["Eval_parameters"]["var_dict"],
nJets=int(plot_config["Eval_parameters"]["nJets"]),
output_directory="input_vars_trks/"
+ plotting_config["folder_to_save"],
plot_type=plot_type,
**plotting_config["plot_settings"],
)
for trk_origin in trk_origins:
if len(filepath_list) >= 2:
if ("nTracks" in plotting_config) and (
plotting_config["nTracks"] is True
):
uit.plot_nTracks_per_Jet(
datasets_filepaths=filepath_list,
datasets_labels=labels_list,
class_labels=plotting_config["class_labels"],
var_dict=plot_config["Eval_parameters"]["var_dict"],
nJets=int(plot_config["Eval_parameters"]["nJets"]),
output_directory="input_vars_trks/"
+ plotting_config["folder_to_save"],
plot_type=plot_type,
**plotting_config["plot_settings"],
track_origin=trk_origin,
)
else:
uit.plot_input_vars_trks_comparison(
datasets_filepaths=filepath_list,
datasets_labels=labels_list,
class_labels=plotting_config["class_labels"],
var_dict=plot_config["Eval_parameters"]["var_dict"],
nJets=int(plot_config["Eval_parameters"]["nJets"]),
binning=plotting_config["binning"],
output_directory="input_vars_trks/"
+ plotting_config["folder_to_save"],
plot_type=plot_type,
**plotting_config["plot_settings"],
track_origin=trk_origin,
)
else:
uit.plot_input_vars_trks_comparison(
datasets_filepaths=filepath_list,
datasets_labels=labels_list,
class_labels=plotting_config["class_labels"],
var_dict=plot_config["Eval_parameters"]["var_dict"],
nJets=int(plot_config["Eval_parameters"]["nJets"]),
binning=plotting_config["binning"],
output_directory="input_vars_trks/"
+ plotting_config["folder_to_save"],
plot_type=plot_type,
**plotting_config["plot_settings"],
)
else:
if ("nTracks" in plotting_config) and (
plotting_config["nTracks"] is True
):
uit.plot_nTracks_per_Jet(
datasets_filepaths=filepath_list,
datasets_labels=labels_list,
class_labels=plotting_config["class_labels"],
var_dict=plot_config["Eval_parameters"]["var_dict"],
nJets=int(plot_config["Eval_parameters"]["nJets"]),
output_directory="input_vars_trks/"
+ plotting_config["folder_to_save"],
plot_type=plot_type,
**plotting_config["plot_settings"],
)
else:
uit.plot_input_vars_trks(
datasets_filepaths=filepath_list,
datasets_labels=labels_list,
class_labels=plotting_config["class_labels"],
var_dict=plot_config["Eval_parameters"]["var_dict"],
nJets=int(plot_config["Eval_parameters"]["nJets"]),
binning=plotting_config["binning"],
output_directory="input_vars_trks/"
+ plotting_config["folder_to_save"],
plot_type=plot_type,
**plotting_config["plot_settings"],
)
if ("nTracks" in plotting_config) and (
plotting_config["nTracks"] is True
):
uit.plot_nTracks_per_Jet(
datasets_filepaths=filepath_list,
datasets_labels=labels_list,
class_labels=plotting_config["class_labels"],
var_dict=plot_config["Eval_parameters"]["var_dict"],
nJets=int(plot_config["Eval_parameters"]["nJets"]),
output_directory="input_vars_trks/"
+ plotting_config["folder_to_save"],
plot_type=plot_type,
**plotting_config["plot_settings"],
track_origin=trk_origin,
)
else:
uit.plot_input_vars_trks(
datasets_filepaths=filepath_list,
datasets_labels=labels_list,
class_labels=plotting_config["class_labels"],
var_dict=plot_config["Eval_parameters"]["var_dict"],
nJets=int(plot_config["Eval_parameters"]["nJets"]),
binning=plotting_config["binning"],
output_directory="input_vars_trks/"
+ plotting_config["folder_to_save"],
plot_type=plot_type,
**plotting_config["plot_settings"],
track_origin=trk_origin,
)
def plot_jets_variables(plot_config, plot_type):
......
......@@ -298,10 +298,8 @@ class Resampling(object):
"""
Parameters
----------
sampling_options: dict with the sampling options from the preprocessing
config file
preparation_samples: dict with the preparation options from the
preprocessing config file
config: umami.preprocessing_tools.Configuration object which stores
the config for the preprocessing
Returns
-------
"""
......
......@@ -153,8 +153,8 @@ class JetPlotting_TestCase(unittest.TestCase):
self.assertEqual(
None,
compare_images(
self.Control_plots_dir + "ptfrac/All/" + "dr_None.png",
self.tmp_plot_dir + "ptfrac/All/" + "dr_None.png",
self.Control_plots_dir + "ptfrac/All/" + "dr_None_All.png",
self.tmp_plot_dir + "ptfrac/All/" + "dr_None_All.png",
tol=1,
),
)
......@@ -164,10 +164,10 @@ class JetPlotting_TestCase(unittest.TestCase):
compare_images(
self.Control_plots_dir
+ "ptfrac/All/"
+ "IP3D_signed_d0_significance_None.png",
+ "IP3D_signed_d0_significance_None_All.png",
self.tmp_plot_dir
+ "ptfrac/All/"
+ "IP3D_signed_d0_significance_None.png",
+ "IP3D_signed_d0_significance_None_All.png",
tol=1,
),
)
......@@ -177,10 +177,10 @@ class JetPlotting_TestCase(unittest.TestCase):
compare_images(
self.Control_plots_dir
+ "ptfrac/All/"
+ "numberOfInnermostPixelLayerHits_None.png",
+ "numberOfInnermostPixelLayerHits_None_All.png",
self.tmp_plot_dir
+ "ptfrac/All/"
+ "numberOfInnermostPixelLayerHits_None.png",
+ "numberOfInnermostPixelLayerHits_None_All.png",
tol=1,
),
)
......@@ -188,8 +188,8 @@ class JetPlotting_TestCase(unittest.TestCase):
self.assertEqual(
None,
compare_images(
self.Control_plots_dir + "ptfrac/0/" + "dr_0.png",
self.tmp_plot_dir + "ptfrac/0/" + "dr_0.png",
self.Control_plots_dir + "ptfrac/0/" + "dr_0_All.png",
self.tmp_plot_dir + "ptfrac/0/" + "dr_0_All.png",
tol=1,
),