reboost.spms package

Submodules

reboost.spms.pe module

reboost.spms.pe._nested_unflatten(data, lengths)
Parameters:
  • data (Array)

  • lengths (Array)

reboost.spms.pe.corrected_photoelectrons(simulated_pe, simulated_uids, data_pe, data_uids, *, seed=None)

Correct the number of photoelectrons using forced trigger data.

For every simulated event a corresponding forced trigger event in data is chosen and the resulting number of p.e. for each channel (i) is:

\[n_i = n_{\text{sim},i} + n_{\text{data},i}\]

Warning

The number of supplied forced trigger events in data should ideally be more than that in the simulations. If this is not the case and “allow_data_reuse” is True then some data events will be used multiple times. This introduces a small amount of correlation between the simulated events, but is probably acceptable in most circumstances.

Parameters:
  • simulated_pe (Array) – The number of number of detected pe per sipm channel.

  • simulated_uids (Array) – The unique identifier (uid) for each sipm hit.

  • data_pe (Array) – The collection of forced trigger pe.

  • data_uids (Array) – The uids for each forced trigger event.

  • seed (int | None) – Seed for random number generator.

Returns:

a tuple of the corrected pe and sipm uids.

Return type:

tuple[Array, Array]

reboost.spms.pe.detected_photoelectrons(num_scint_ph, particle, time, xloc, yloc, zloc, optmap, material, spm_detector, map_scaling=1, map_scaling_sigma=0)

Derive the number and arrival times of detected photoelectrons.

From scintillator hits using an optical map.

Deprecated since version 0.8.5: Use the other, more fine-granular and split processors number_of_detected_photoelectrons() and photoelectron_times() to replace this legacy processor.

Parameters:
  • num_scint_ph (Array) – array of emitted scintillation photons, as generated by emitted_scintillation_photons().

  • particle (Array) – array of particle PDG IDs of scintillation events.

  • time (Array) – array of timestamps of scintillation events.

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

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

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

  • optmap (OptmapForConvolve) – the optical map loaded via py:func:load_optmap.

  • material (Literal['lar', 'pen', 'fiber'] | tuple[~pygeomoptics.scintillate.ScintConfig, tuple[~pint.registry.Quantity, ...]]) – scintillating material name or material definition as used for pygeomoptics.scintillate.precompute_scintillation_params().

  • spm_detector (str) – SiPM detector name as used in the optical map.

  • map_scaling (float) – scale the detection probability in the map for this detector by this factor.

  • map_scaling_sigma (float) – if larger than zero, sample the used scaling factor for each (reshaped) event from a normal distribution with this standard deviation.

Return type:

Array

reboost.spms.pe.emitted_scintillation_photons(edep, particle, material)

Derive the number of emitted scintillation photons from scintillator hits.

This processor converts energy depositions into a number of emitted scintillation photons.

Parameters:
  • edep (Array) – array of deposited energy in scintillation events.

  • particle (Array) – array of particle PDG IDs of scintillation events.

  • material (Literal['lar', 'pen', 'fiber'] | tuple[~pygeomoptics.scintillate.ScintConfig, tuple[~pint.registry.Quantity, ...]]) – scintillating material name or material definition as used for pygeomoptics.scintillate.precompute_scintillation_params().

Returns:

Awkward array of integer photon counts with the same nested list structure (shape) as the input edep array.

Return type:

Array

reboost.spms.pe.load_optmap(map_file, spm_det)

Load an optical map file for later use with number_of_detected_photoelectrons().

Parameters:
  • map_file (str) – file path to the map file.

  • spm_det (str) – detector name or the string "all". In the case of a detector name, it will load the optical map "/channels/{spm_det}" from the provided map file.

Return type:

OptmapForConvolve

reboost.spms.pe.load_optmap_all(map_file)

Load an optical map file for later use with number_of_detected_photoelectrons().

Parameters:

map_file (str) – file path to the map file.

Return type:

OptmapForConvolve

reboost.spms.pe.number_of_detected_photoelectrons(xloc, yloc, zloc, num_scint_ph, optmap, spm_detector, map_scaling=1, map_scaling_sigma=0, max_pes_per_hit=-1)

Derive the number of detected photoelectrons.

This processor uses the provided optical map to convert emitted scintillation photons into detected photoelectrons for a single detector/channel.

Parameters:
  • xloc (Array) – array of x coordinate position of scintillation events.

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

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

  • num_scint_ph (Array) – array of emitted scintillation photons, as generated by emitted_scintillation_photons().

  • max_pes_per_hit (int) – Maximum number of photoelectrons to generate for a single scintillation hit. Use -1 to disable this limit.

  • optmap (OptmapForConvolve)

  • spm_detector (str)

  • map_scaling (float)

  • map_scaling_sigma (float)

Return type:

Array | tuple[Array, TypeAliasForwardRef(‘NDArray’)]

Warning

The max_pes_per_hit argument cannot be used in a build_hit() config file, since a tuple is returned in this case.

Returns:

Awkward array of integer p.e. counts with the same nested list structure (shape) as the input num_scint_ph array. If max_pes_per_hit is greater than zero, returns a tuple of the p.e. counts and a 1D boolean array that tells whether the maximum number of p.e.s was reached for the hit.

Parameters:
  • xloc (Array)

  • yloc (Array)

  • zloc (Array)

  • num_scint_ph (Array)

  • optmap (OptmapForConvolve)

  • spm_detector (str)

  • map_scaling (float)

  • map_scaling_sigma (float)

  • max_pes_per_hit (int)

Return type:

Array | tuple[Array, TypeAliasForwardRef(‘NDArray’)]

reboost.spms.pe.photoelectron_times(num_det_ph, particle, time, material)

Derive the arrival times of scintillation photons.

This processor samples an arrival time for each detected photon, given the particle type, material scintillation model, and emission time.

Parameters:
  • num_det_ph (Array) – array of detected scintillation photons, as generated by emitted_scintillation_photons().

  • particle (Array) – array of particle PDG IDs of scintillation events.

  • time (Array) – array of timestamps of scintillation events.

  • material (Literal['lar', 'pen', 'fiber'] | tuple[~pygeomoptics.scintillate.ScintConfig, tuple[~pint.registry.Quantity, ...]]) – scintillating material name or material definition as used for pygeomoptics.scintillate.precompute_scintillation_params().

Returns:

Awkward array where each event contains a list of arrival times; the per-event list length is the sum of num_det_ph for that event (i.e. ak.sum(num_det_ph, axis=1)).

Return type:

Array

Notes

The resulting times are unsorted along the innermost axis.