reboost.hpge package

Submodules

reboost.hpge.psd module

reboost.hpge.psd._drift_time_heuristic_impl(dt, edep)

Low-level implementation of the HPGe drift-time-based pulse-shape heuristic.

Accepts Awkward arrays and uses Numba to speed up the computation.

For each hit (collection of steps), the drift times and corresponding energies are sorted in ascending order. The function finds the optimal split point \(m\) that maximizes the identification metric:

\[I = \frac{|T_1 - T_2|}{E_\text{s}(E_1, E_2)}\]

where:

\[T_1 = \frac{\sum_{i < m} t_i E_i}{\sum_{i < m} E_i} \quad \text{and} \quad T_2 = \frac{\sum_{i \geq m} t_i E_i}{\sum_{i \geq m} E_i}\]

are the energy-weighted mean drift times of the two groups.

\[E_\text{scale}(E_1, E_2) = \frac{1}{\sqrt{E_1 E_2}}\]

is the scaling factor.

The function iterates over all possible values of \(m\) and selects the maximum I as the drift time heuristic value.

Parameters:
  • dt (ak.Array)

  • edep (ak.Array)

Return type:

NDArray

reboost.hpge.psd.drift_time(xloc, yloc, zloc, dt_map, coord_offset=<Quantity([0 0 0], 'meter')>)

Calculates drift times for each step (cluster) in an HPGe detector.

Parameters:
Return type:

VectorOfVectors

reboost.hpge.psd.drift_time_heuristic(drift_time, edep)

HPGe drift-time-based pulse-shape heuristic.

See _drift_time_heuristic_impl() for a description of the algorithm.

Parameters:
Return type:

Array

reboost.hpge.psd.r90(edep, xloc, yloc, zloc)

R90 HPGe pulse shape heuristic.

Parameters:
  • edep (Array) – array of energy.

  • xloc (Array) – array of x coordinate position.

  • yloc (Array) – array of y coordinate position.

  • zloc (Array) – array of z coordinate position.

Return type:

Array

reboost.hpge.surface module

reboost.hpge.utils module

class reboost.hpge.utils.HPGeScalarRZField(φ, r_units, z_units, φ_units)

Bases: NamedTuple

A scalar field defined in the cylindrical-like (r, z) HPGe plane.

Create new instance of HPGeScalarRZField(φ, r_units, z_units, φ_units)

Parameters:
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('φ', 'r_units', 'z_units', 'φ_units')
classmethod _make(iterable)

Make a new HPGeScalarRZField object from a sequence or iterable

_replace(**kwds)

Return a new HPGeScalarRZField object replacing specified fields with new values

r_units: Unit

Physical units of the coordinate r.

z_units: Unit

Physical units of the coordinate z.

φ: Callable

Scalar field, function of the coordinates (r, z).

φ_units: Unit

Physical units of the field.

reboost.hpge.utils.get_hpge_scalar_rz_field(filename, obj, field, out_of_bounds_val=nan, **kwargs)

Create an interpolator for a gridded scalar HPGe field defined on (r, z).

Reads from disk the following data structure:

FILENAME/
└── OBJ · struct{r,z,FIELD}
    ├── r · array<1>{real} ── {'units': 'UNITS'}
    ├── z · array<1>{real} ── {'units': 'UNITS'}
    └── FIELD · array<2>{real} ── {'units': 'UNITS'}

where FILENAME, OBJ and FIELD are provided as arguments to this function. obj is a Struct, r and z are one dimensional arrays specifying the radial and z coordinates of the rectangular grid — not the coordinates of each single grid point. In this coordinate system, the center of the p+ contact surface is at (0, 0), with the p+ contact facing downwards. field is instead a two-dimensional array specifying the field value at each grid point. The first and second dimensions are r and z, respectively. NaN values are interpreted as points outside the detector profile in the (r, z) plane.

Before returning a HPGeScalarRZField, the gridded field is fed to scipy.interpolate.RegularGridInterpolator.

Parameters:
  • filename (str) – name of the LH5 file containing the gridded scalar field.

  • obj (str) – name of the HDF5 dataset where the data is saved.

  • field (str) – name of the HDF5 dataset holding the field values.

  • out_of_bounds_val (int | float) – value to use to replace NaNs in the field values.

Return type:

HPGeScalarRZField