Performance generation (protopipe.perf)#

Introduction#

The DL2-to-DL3 step of the protopipe pipeline is based on the pyirf library.

The protopipe.perf module contains utility tools used to interface with this library, mainly to translate the DL2 data in the internal nomenclature used by pyirf to produce the DL3 file.

In general this step takes care of,

  • handling the determination of the best-cutoffs to separate gamma and the background (protons + electrons),

  • estimating the sensitivity from the optimized cuts,

  • producing the instrument response functions (IRFs).

Provided that a performance script makes use of protopipe.perf.utils.read_DL2_pyirf, protopipe supports the addition and testing of multiple scripts based on pyirf.

Note

Some functions are discontinued or will be with the next release and should be removed.

The current approach is based on the EventDisplay historical pipeline for which the following main points apply,

  • maximum signal efficiency set to 80%,

  • optimisation cuts are performed following these steps, - applying a global cut of 40% signal efficiency, - energy-bin-wise 68% containment angular cuts optimization - energy-bin-wise optimisation of gamma/hadron separation cut for best sensitivity

For more details on the specific API and benchmarks, please check pyirf’s documentation.

Reference/API#

protopipe.perf Package#

Functions#

angular_resolution(events, energy_bins[, ...])

Calculate the angular resolution.

energy_bias_resolution(events, energy_bins)

Calculate bias and energy resolution.

initialize_script_arguments()

Initialize the parser of any protopipe.scripts.make_performance_XXX script.

load_obj(name)

Load object in binary

percentiles(values, bin_values, bin_edges, ...)

plot_hist(ax, data, edges[, norm, yerr, ...])

Utility function to plot histogram

read_DL2_pyirf(infile, run_header)

Read a DL2 HDF5 protopipe file and adapt them to pyirf format.

save_obj(obj, name)

Save object in binary

Variables#

norm

A normal continuous random variable.