revertex.generators package¶
Submodules¶
revertex.generators.beta module¶
- revertex.generators.beta.generate_beta_spectrum(size, *, energies, phase_space, seed=None, eunit='keV')¶
Generate samples from a beta spectrum defined by a list of energies and phase space values.
This function interprets the energies and phase_space as a histogram and samples energies from this. These are then converted into momenta. The energies should be the left edge of the bin of a histogram
- Parameters:
- Returns:
An awkward array with the sampled kinematics, in keV.
- Return type:
Array
- revertex.generators.beta.save_beta_spectrum(n_gen, in_file, out_file, seed=None, eunit='keV')¶
Save positions generated by the function to a file.
- Parameters:
func – function which generates the positions, must return an ak.Array of positions.
n_gen (int) – number of positions to generate
in_file (str) – path to the CSV theory file.
out_file (str) – path to the output file.
seed (int | None) – random seed, for each chunk will be multiplied by 7.
lunit – The length unit returned by the function.
**kwargs – keyword arguments to be passed to the function.
eunit (str)
- Return type:
None
revertex.generators.borehole module¶
- revertex.generators.borehole._sample_hpge_borehole_impl(size, hpge, seed=None)¶
Generate events on the surface of a single HPGe.
- Parameters:
- Returns:
Array with shape (n,3) describing the local (x,y,z) positions for every vertex
- Return type:
NDArray
- revertex.generators.borehole.sample_hpge_borehole(n_tot, *, seed=None, hpges, positions)¶
Generate events on many HPGe boreholes weighting by the volume.
- Parameters:
- Returns:
Array of global coordinates.
- Return type:
NDArray
revertex.generators.shell module¶
- revertex.generators.shell._sample_hpge_shell_impl(size, hpge, surface_type, distance, seed=None)¶
Generate events on a shell around a single HPGe. This uses rejection sampling.
- Parameters:
size (int) – number of vertexs to generate.
hpge (pygeomhpges.HPGe) – pygeomhpges object describing the detector geometry.
surface_type (str | None) – Which surface to generate events on either nplus, pplus, passive or None (generate on all surfaces).
distance (float) – Size of the hpge shell to generate in.
seed (int | None) – seed for random number generator.
- Returns:
Array with shape (n,3) describing the local (x,y,z) positions for every vertex
- Return type:
NDArray
- revertex.generators.shell.sample_hpge_shell(n_tot, *, seed=None, hpges, positions, distance, surface_type=None)¶
Generate events on many HPGe’s shells weighting by the surface area.
- Parameters:
n_tot (int) – total number of events to generate
seed (int | None) – random seed for the RNG.
hpges (dict[str, pygeomhpges.HPGe] | pygeomhpges.HPGe) – List of
pygeomhpges.HPGeobjects.positions (dict[str, ArrayLike] | ArrayLike) – List of the origin position of each HPGe.
surface_type (str | None) – Which surface to generate events on either nplus, pplus, passive or None (generate on all surfaces).
distance (float)
- Returns:
Array of global coordinates.
- Return type:
NDArray
revertex.generators.surface module¶
- revertex.generators.surface._sample_hpge_surface_impl(n, hpge, surface_type, depth=None, seed=None)¶
Generate events on the surface of a single HPGe.
- Parameters:
n (int) – number of vertexs to generate.
hpge (pygeomhpges.HPGe) – pygeomhpges object describing the detector geometry.
surface_type (str | None) – Which surface to generate events on either nplus, pplus, passive or None (generate on all surfaces).
depth (rv_continuous | None) – scipy rv_continuous object describing the depth profile, if None events are generated directly on the surface.
seed (int | None) – seed for random number generator.
- Returns:
Array with shape (n,3) describing the local (x,y,z) positions for every vertex
- Return type:
NDArray
- revertex.generators.surface.sample_hpge_surface(n_tot, seed=None, *, hpges, positions, surface_type=None)¶
Generate events on many HPGe’s weighting by the surface area.
- Parameters:
n_tot (int) – total number of events to generate
hpges (dict[str, pygeomhpges.HPGe] | pygeomhpges.HPGe) – List of
pygeomhpges.HPGeobjects.positions (dict[str, ArrayLike] | ArrayLike) – List of the origin position of each HPGe.
surface_type (str | None) – Which surface to generate events on either nplus, pplus, passive or None (generate on all surfaces).
seed (int | None) – seed for random number generator.
- Returns:
Array of global coordinates.
- Return type:
NDArray