reboost.optmap package

Submodules

reboost.optmap.cli module

reboost.optmap.cli.optical_cli()
Return type:

None

reboost.optmap.convolve module

reboost.optmap.convolve._iterate_stepwise_depositions(edep_df, x0, x1, rng, detids, detidx, optmap_edges, optmap_weights, optmap_multi_det_exp, scint_mat_params)
Parameters:

scint_mat_params (sc.ComputedScintParams)

reboost.optmap.convolve._pdgid_to_particle(pdgid)
Parameters:

pdgid (int)

Return type:

sc.ParticleIndex

reboost.optmap.convolve.convolve(map_file, edep_file, edep_path, material, output_file=None, buffer_len=1000000)
Parameters:
  • map_file (str)

  • edep_file (str)

  • edep_path (str)

  • material (str)

  • output_file (str | None)

  • buffer_len (int)

reboost.optmap.convolve.get_output_table(output_map)
reboost.optmap.convolve.iterate_stepwise_depositions(edep_df, optmap_for_convolve, scint_mat_params, rng=None)
Parameters:
reboost.optmap.convolve.open_optmap(optmap_fn)
Parameters:

optmap_fn (str)

reboost.optmap.create module

reboost.optmap.create._compute_hit_maps(hitcounts, optmap_count, ch_idx_to_optmap)
reboost.optmap.create._count_multi_ph_detection(hitcounts)
Return type:

ndarray[Any, dtype[_ScalarType_co]]

reboost.optmap.create._create_optical_maps_chunk(optmap_events_fn, buffer_len, all_det_ids, optmaps, ch_idx_to_map_idx)
Return type:

None

reboost.optmap.create._create_optical_maps_process(optmap_events_fn, buffer_len, all_det_ids, ch_idx_to_map_idx)
Return type:

None

reboost.optmap.create._create_optical_maps_process_init(optmaps, log_level)
Return type:

None

reboost.optmap.create._fill_hit_maps(optmaps, loc, hitcounts, ch_idx_to_map_idx)
Parameters:
reboost.optmap.create._fit_multi_ph_detection(hits_per_primary)
Return type:

float

reboost.optmap.create._merge_optical_maps_process(d, map_l5_files, output_lh5_fn, settings, check_after_create=False, write_part_file=False)
Parameters:
Return type:

bool

reboost.optmap.create._optmaps_for_channels(optmap_evt_columns, settings, chfilter=(), use_shmem=False)
Parameters:
reboost.optmap.create.check_optical_map(map_l5_file)

Run a health check on the map file.

This checks for consistency, and output details on map statistics.

Parameters:

map_l5_file (str)

reboost.optmap.create.create_optical_maps(optmap_events_fn, settings, buffer_len=5000000, chfilter=(), output_lh5_fn=None, after_save=None, check_after_create=False, n_procs=1)

Create optical maps.

Parameters:
  • optmap_events_fn (list[str]) – list of filenames to lh5 files with a table /optmap_evt with columns {x,y,z}loc and one column (with numeric header) for each SiPM channel.

  • chfilter (tuple[str | int] | Literal['*']) – tuple of detector ids that will be included in the resulting optmap. Those have to match the column names in optmap_events_fn.

  • n_procs (int | None) – number of processors, 1 for sequential mode, or None to use all processors.

  • buffer_len (int)

  • output_lh5_fn (str | None)

  • after_save (Callable[[int, str, OpticalMap]] | None)

  • check_after_create (bool)

Return type:

None

reboost.optmap.create.list_optical_maps(lh5_file)
Parameters:

lh5_file (str)

Return type:

list[str]

reboost.optmap.create.merge_optical_maps(map_l5_files, output_lh5_fn, settings, check_after_create=False, n_procs=1)

Merge optical maps from multiple files.

Parameters:
  • n_procs (int | None) – number of processors, 1 for sequential mode, or None to use all processors.

  • map_l5_files (list[str])

  • output_lh5_fn (str)

  • check_after_create (bool)

Return type:

None

reboost.optmap.create.rebin_optical_maps(map_l5_file, output_lh5_file, factor)

Rebin the optical map by an integral factor.

Note

the factor has to divide the bincounts on all axes.

Parameters:
  • map_l5_file (str)

  • output_lh5_file (str)

  • factor (int)

reboost.optmap.evt module

reboost.optmap.evt.build_optmap_evt(lh5_in_file, lh5_out_file, detectors, buffer_len=5000000)

Create a faster map for lookup of the hits in each detector, for each primary event.

Parameters:
Return type:

None

reboost.optmap.evt.read_optmap_evt(lh5_file, buffer_len=5000000)
Parameters:
  • lh5_file (str)

  • buffer_len (int)

Return type:

LH5Iterator

reboost.optmap.mapview module

reboost.optmap.mapview._channel_selector(fig)
Return type:

None

reboost.optmap.mapview._get_weights(viewdata)
Parameters:

viewdata (dict)

reboost.optmap.mapview._prepare_data(optmap_fn, divide_fn=None, cmap_min=0.0001, cmap_max=0.01, histogram_choice='p_det', detid='all')
Parameters:
Return type:

tuple[tuple[ndarray[Any, dtype[_ScalarType_co]]], ndarray[Any, dtype[_ScalarType_co]]]

reboost.optmap.mapview._process_key(event)
Return type:

None

reboost.optmap.mapview._read_data(optmap_fn, detid='all', histogram_choice='p_det')
Parameters:
  • optmap_fn (str)

  • detid (str)

  • histogram_choice (str)

Return type:

tuple[tuple[ndarray[Any, dtype[_ScalarType_co]]], ndarray[Any, dtype[_ScalarType_co]]]

reboost.optmap.mapview._slice_text(viewdata)
Parameters:

viewdata (dict)

Return type:

str

reboost.optmap.mapview._update_figure(fig)
Return type:

None

reboost.optmap.mapview.view_optmap(optmap_fn, detid='all', divide_fn=None, start_axis=2, cmap_min=0.0001, cmap_max=0.01, histogram_choice='p_det', title=None)
Parameters:
Return type:

None

reboost.optmap.numba_pdg module

reboost.optmap.numba_pdg.numba_pdgid_funcs()

Load a numby-optimized copy of the scikit-hep/particle package.

reboost.optmap.optmap module

class reboost.optmap.optmap.OpticalMap(name, settings, use_shmem=False)

Bases: object

Parameters:
_divide_hist(h1, h2)

Calculate the ratio (and its standard error) from two histograms.

Parameters:
Return type:

tuple[ndarray[Any, dtype[_ScalarType_co]], ndarray[Any, dtype[_ScalarType_co]]]

static _edges_eq(e1, e2)

Compare edge-tuples for two histograms.

Parameters:
Return type:

bool

_fill_histogram(h, xyz, for_hits=False)
Parameters:
  • h (NDArray | mp.sharedctypes.SynchronizedArray)

  • xyz (NDArray)

  • for_hits (bool)

Return type:

None

_fill_histogram_buf(h, idx)
Parameters:
  • h (NDArray | mp.sharedctypes.SynchronizedArray)

  • idx (NDArray)

Return type:

None

_lock_nda(h)
Parameters:

h (NDArray | mp.sharedctypes.SynchronizedArray)

_mp_preinit(mp_man, vertex)
Parameters:
  • mp_man (BaseContext)

  • vertex (bool)

Return type:

None

_nda(h)
Parameters:

h (NDArray | mp.sharedctypes.SynchronizedArray)

Return type:

NDArray

_prepare_hist()

Prepare an empty histogram with the parameters global to this map instance.

Return type:

ndarray

check_histograms(include_prefix=False)
Parameters:

include_prefix (bool)

Return type:

None

static create_empty(name, settings)
Parameters:
Return type:

OpticalMap

create_probability()

Compute probability map (and map uncertainty) from vertex and hit map.

Return type:

None

fill_hits(loc)

Fill map with a chunk of hit coordinates.

Note

For performance reasons, this function is buffered and does not directly write to the map array. Use fill_hits_flush() to flush the remaining hits in the buffer to this map.

Parameters:

loc (ndarray[Any, dtype[_ScalarType_co]])

Return type:

None

fill_hits_flush()

Commit all remaining hit coordinates in the buffer.

Return type:

None

fill_vertex(loc)

Fill map with a chunk of hit coordinates.

Parameters:

loc (ndarray[Any, dtype[_ScalarType_co]])

Return type:

None

get_settings()

Get the binning settings that were used to create this optical map instance.

Return type:

dict

static load_from_file(lh5_file, group)
Parameters:
Return type:

OpticalMap

write_lh5(lh5_file, group='all', wo_mode='write_safe')

Write this map to a LH5 file.

Parameters:
Return type:

None