src/graphnet/plots/utils.py
def PlotWidth(key_limits, biases):
    """Plot reconstruction resoltion (width) for DynEdge vs. RetroReco."""
    key_limits = key_limits["width"]
    if "retro" in biases.keys():
        contains_retro = True
    else:
        contains_retro = False

    for key in biases["dynedge"].keys():
        fig, ax = plt.subplots(2, 3, figsize=(11.69, 8.27))
        fig.suptitle("dynedge: %s" % key, size=30)
        pid_count = 0
        for pid in biases["dynedge"][key].keys():
            interaction_count = 0
            for interaction_type in biases["dynedge"][key][pid]:
                if interaction_type != str(0.0):
                    plot_data = biases["dynedge"][key][pid][interaction_type]
                    if contains_retro:
                        plot_data_retro = biases["retro"][key][pid][
                            interaction_type
                        ]
                    if len(plot_data["mean"]) != 0:

                        ax2 = ax[interaction_count, pid_count].twinx()
                        ax2.bar(
                            x=(plot_data["mean"]),
                            height=plot_data["count"],
                            alpha=0.3,
                            color="grey",
                            align="edge",
                            width=0.25,
                        )
                        ax[interaction_count, pid_count].errorbar(
                            plot_data["mean"],
                            plot_data["width"],
                            plot_data["width_error"],
                            linestyle="dotted",
                            fmt="o",
                            capsize=10,
                            label="dynedge",
                        )
                        if contains_retro:
                            ax[interaction_count, pid_count].errorbar(
                                plot_data_retro["mean"],
                                plot_data_retro["width"],
                                plot_data_retro["width_error"],
                                linestyle="dotted",
                                fmt="o",
                                capsize=10,
                                label="RetroReco",
                            )

                        if pid == str(12.0):
                            pid_tag = "e"
                        if pid == str(14.0):
                            pid_tag = "u"
                        if pid == str(16.0):
                            pid_tag = "T"
                        if interaction_type == str(1.0):
                            interaction_tag = "cc"
                        if interaction_type == str(2.0):
                            interaction_tag = "nc"
                        if interaction_type == str(0.0):
                            interaction_tag = "unknown"

                        plt.title(
                            "$\\nu_%s$ %s" % (pid_tag, interaction_tag),
                            size=20,
                        )
                        ax[interaction_count, pid_count].tick_params(
                            axis="x", labelsize=10
                        )
                        ax[interaction_count, pid_count].tick_params(
                            axis="y", labelsize=10
                        )
                        ax[interaction_count, pid_count].set_xlim(
                            key_limits[key]["x"]
                        )
                        ax[interaction_count, pid_count].set_ylim(
                            key_limits[key]["y"]
                        )
                        ax[interaction_count, pid_count].legend()
                        plt.tick_params(right=False, labelright=False)
                        if (interaction_count == 0) & (pid_count == 0) or (
                            interaction_count == 1
                        ) & (pid_count == 0):
                            ax[interaction_count, pid_count].set_ylabel(
                                "W($log_{10}$($\\frac{pred}{truth}$)) [GeV]",
                                size=20,
                            )
                        if interaction_count != 0:
                            ax[interaction_count, pid_count].set_xlabel(
                                "$energy_{log10}$ GeV", size=25
                            )

                        interaction_count += 1
            pid_count += 1
    return fig
Plot reconstruction resoltion (width) for DynEdge vs. RetroReco.
Plot reconstruction resoltion (width) for DynEdge vs.
Plot reconstruction resoltion ( width ) for DynEdge vs .
def PlotWidth(key_limits, biases):
    key_limits = key_limits["width"]
    if "retro" in biases.keys():
        contains_retro = True
    else:
        contains_retro = False
    for key in biases["dynedge"].keys():
        fig, ax = plt.subplots(2, 3, figsize=(11.69, 8.27))
        fig.suptitle("dynedge: %s" % key, size=30)
        pid_count = 0
        for pid in biases["dynedge"][key].keys():
            interaction_count = 0
            for interaction_type in biases["dynedge"][key][pid]:
                if interaction_type != str(0.0):
                    plot_data = biases["dynedge"][key][pid][interaction_type]
                    if contains_retro:
                        plot_data_retro = biases["retro"][key][pid][
                            interaction_type
                        ]
                    if len(plot_data["mean"]) != 0:
                        ax2 = ax[interaction_count, pid_count].twinx()
                        ax2.bar(
                            x=(plot_data["mean"]),
                            height=plot_data["count"],
                            alpha=0.3,
                            color="grey",
                            align="edge",
                            width=0.25,
                        )
                        ax[interaction_count, pid_count].errorbar(
                            plot_data["mean"],
                            plot_data["width"],
                            plot_data["width_error"],
                            linestyle="dotted",
                            fmt="o",
                            capsize=10,
                            label="dynedge",
                        )
                        if contains_retro:
                            ax[interaction_count, pid_count].errorbar(
                                plot_data_retro["mean"],
                                plot_data_retro["width"],
                                plot_data_retro["width_error"],
                                linestyle="dotted",
                                fmt="o",
                                capsize=10,
                                label="RetroReco",
                            )
                        if pid == str(12.0):
                            pid_tag = "e"
                        if pid == str(14.0):
                            pid_tag = "u"
                        if pid == str(16.0):
                            pid_tag = "T"
                        if interaction_type == str(1.0):
                            interaction_tag = "cc"
                        if interaction_type == str(2.0):
                            interaction_tag = "nc"
                        if interaction_type == str(0.0):
                            interaction_tag = "unknown"
                        plt.title(
                            "$\\nu_%s$ %s" % (pid_tag, interaction_tag),
                            size=20,
                        )
                        ax[interaction_count, pid_count].tick_params(
                            axis="x", labelsize=10
                        )
                        ax[interaction_count, pid_count].tick_params(
                            axis="y", labelsize=10
                        )
                        ax[interaction_count, pid_count].set_xlim(
                            key_limits[key]["x"]
                        )
                        ax[interaction_count, pid_count].set_ylim(
                            key_limits[key]["y"]
                        )
                        ax[interaction_count, pid_count].legend()
                        plt.tick_params(right=False, labelright=False)
                        if (interaction_count == 0) & (pid_count == 0) or (
                            interaction_count == 1
                        ) & (pid_count == 0):
                            ax[interaction_count, pid_count].set_ylabel(
                                "W($log_{10}$($\\frac{pred}{truth}$)) [GeV]",
                                size=20,
                            )
                        if interaction_count != 0:
                            ax[interaction_count, pid_count].set_xlabel(
                                "$energy_{log10}$ GeV", size=25
                            )
                        interaction_count += 1
            pid_count += 1
    return fig
def PlotWidth ( key_limits , biases ) : key_limits = key_limits [ "width" ] if "retro" in biases . keys ( ) : contains_retro = True else : contains_retro = False for key in biases [ "dynedge" ] . keys ( ) : fig , ax = plt . subplots ( 2 , 3 , figsize = ( 11.69 , 8.27 ) ) fig . suptitle ( "dynedge: %s" % key , size = 30 ) pid_count = 0 for pid in biases [ "dynedge" ] [ key ] . keys ( ) : interaction_count = 0 for interaction_type in biases [ "dynedge" ] [ key ] [ pid ] : if interaction_type != str ( 0.0 ) : plot_data = biases [ "dynedge" ] [ key ] [ pid ] [ interaction_type ] if contains_retro : plot_data_retro = biases [ "retro" ] [ key ] [ pid ] [ interaction_type ] if len ( plot_data [ "mean" ] ) != 0 : ax2 = ax [ interaction_count , pid_count ] . twinx ( ) ax2 . bar ( x = ( plot_data [ "mean" ] ) , height = plot_data [ "count" ] , alpha = 0.3 , color = "grey" , align = "edge" , width = 0.25 , ) ax [ interaction_count , pid_count ] . errorbar ( plot_data [ "mean" ] , plot_data [ "width" ] , plot_data [ "width_error" ] , linestyle = "dotted" , fmt = "o" , capsize = 10 , label = "dynedge" , ) if contains_retro : ax [ interaction_count , pid_count ] . errorbar ( plot_data_retro [ "mean" ] , plot_data_retro [ "width" ] , plot_data_retro [ "width_error" ] , linestyle = "dotted" , fmt = "o" , capsize = 10 , label = "RetroReco" , ) if pid == str ( 12.0 ) : pid_tag = "e" if pid == str ( 14.0 ) : pid_tag = "u" if pid == str ( 16.0 ) : pid_tag = "T" if interaction_type == str ( 1.0 ) : interaction_tag = "cc" if interaction_type == str ( 2.0 ) : interaction_tag = "nc" if interaction_type == str ( 0.0 ) : interaction_tag = "unknown" plt . title ( "$\\nu_%s$ %s" % ( pid_tag , interaction_tag ) , size = 20 , ) ax [ interaction_count , pid_count ] . tick_params ( axis = "x" , labelsize = 10 ) ax [ interaction_count , pid_count ] . tick_params ( axis = "y" , labelsize = 10 ) ax [ interaction_count , pid_count ] . set_xlim ( key_limits [ key ] [ "x" ] ) ax [ interaction_count , pid_count ] . set_ylim ( key_limits [ key ] [ "y" ] ) ax [ interaction_count , pid_count ] . legend ( ) plt . tick_params ( right = False , labelright = False ) if ( interaction_count == 0 ) & ( pid_count == 0 ) or ( interaction_count == 1 ) & ( pid_count == 0 ) : ax [ interaction_count , pid_count ] . set_ylabel ( "W($log_{10}$($\\frac{pred}{truth}$)) [GeV]" , size = 20 , ) if interaction_count != 0 : ax [ interaction_count , pid_count ] . set_xlabel ( "$energy_{log10}$ GeV" , size = 25 ) interaction_count += 1 pid_count += 1 return fig
Plot reconstruction resoltion (width) for DynEdge vs. RetroReco.
Plot reconstruction resoltion ( width ) for DynEdge vs . RetroReco .
"""Plot reconstruction resoltion (width) for DynEdge vs. RetroReco."""
key_limits
biases