reboost.optmap package¶
Submodules¶
reboost.optmap.__main__ module¶
reboost.optmap.cli module¶
- reboost.optmap.cli.optical_cli()¶
- Return type:
None
reboost.optmap.convolve module¶
- class reboost.optmap.convolve.OptmapForConvolve(dets, detidx, edges, weights)¶
Bases:
NamedTupleA loaded optmap for convolving.
Create new instance of OptmapForConvolve(dets, detidx, edges, weights)
- Parameters:
dets (NDArray)
detidx (NDArray)
edges (NDArray)
weights (NDArray)
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('dets', 'detidx', 'edges', 'weights')¶
- classmethod _make(iterable)¶
Make a new OptmapForConvolve object from a sequence or iterable
- _replace(**kwds)¶
Return a new OptmapForConvolve object replacing specified fields with new values
- detidx: NDArray¶
Alias for field number 1
- dets: NDArray¶
Alias for field number 0
- edges: NDArray¶
Alias for field number 2
- weights: NDArray¶
Alias for field number 3
- reboost.optmap.convolve._iterate_stepwise_depositions_pois(edep_hits, rng, detidx, map_scaling, map_scaling_sigma, optmap_edges, optmap_weights, scint_mat_params)¶
- reboost.optmap.convolve._iterate_stepwise_depositions_scintillate(edep_hits, rng, scint_mat_params, mode)¶
- Parameters:
scint_mat_params (sc.ComputedScintParams)
mode (str)
- reboost.optmap.convolve._pdgid_to_particle(pdgid)¶
- Parameters:
pdgid (int)
- Return type:
sc.ParticleIndex
- reboost.optmap.convolve.iterate_stepwise_depositions_pois(edep_hits, optmap, scint_mat_params, det, map_scaling=1, map_scaling_sigma=0, rng=None)¶
- Parameters:
edep_hits (Array)
optmap (OptmapForConvolve)
scint_mat_params (ComputedScintParams)
det (str)
map_scaling (float)
map_scaling_sigma (float)
rng (Generator | None)
- reboost.optmap.convolve.iterate_stepwise_depositions_scintillate(edep_hits, scint_mat_params, rng=None, mode='no-fano')¶
- reboost.optmap.convolve.open_optmap_single(optmap_fn, spm_det)¶
- Parameters:
- Return type:
reboost.optmap.create module¶
- reboost.optmap.create._compute_hit_maps(hitcounts, optmap_count, ch_idx_to_optmap)¶
- reboost.optmap.create._create_optical_maps_chunk(optmap_events_fn, buffer_len, all_det_ids, optmaps, ch_idx_to_map_idx)¶
- Return type:
- reboost.optmap.create._create_optical_maps_process(optmap_events_fn, buffer_len, all_det_ids, ch_idx_to_map_idx)¶
- Return type:
- 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:
optmaps (list[OpticalMap])
hitcounts (NDArray)
- reboost.optmap.create._merge_optical_maps_process(d, map_l5_files, output_lh5_fn, settings, check_after_create=False, write_part_file=False)¶
- reboost.optmap.create._optmaps_for_channels(all_det_ids, settings, chfilter=(), use_shmem=False)¶
- reboost.optmap.create.check_optical_map(map_l5_file)¶
Run a health check on the map file.
This checks for consistency, and outputs 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, geom_fn=None)¶
Create optical maps.
- Parameters:
optmap_events_fn (list[str]) – list of filenames to lh5 files, that can either be stp files from remage or “optmap-evt” files with a table
/optmap_evtwith columns{x,y,z}locand 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,
1for sequential mode, orNoneto use all processors.buffer_len (int)
output_lh5_fn (str | None)
after_save (Callable[[int, str, OpticalMap]] | None)
check_after_create (bool)
geom_fn (str | None)
- Return type:
None
- reboost.optmap.create.list_optical_maps(lh5_file)¶
- 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.
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.
- reboost.optmap.evt.generate_optmap_evt(lh5_in_file, detectors, buffer_len=5000000)¶
Create a faster map for lookup of the hits in each detector, for each primary event.
- reboost.optmap.evt.read_optmap_evt(lh5_file, buffer_len=5000000)¶
- Parameters:
- Return type:
reboost.optmap.mapview module¶
- reboost.optmap.mapview._channel_selector(fig)¶
- Return type:
None
- reboost.optmap.mapview._prepare_data(optmap_fn, divide_fn=None, cmap_min=0.0001, cmap_max=0.01, histogram_choice='prob', detid='all')¶
- reboost.optmap.mapview._process_key(event)¶
- Return type:
None
- reboost.optmap.mapview._read_data(optmap_fn, detid='all', histogram_choice='prob')¶
- 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='prob', title=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- _divide_hist(h1, h2)¶
Calculate the ratio (and its standard error) from two histograms.
- Parameters:
h1 (NDArray)
h2 (NDArray)
- Return type:
tuple[NDArray, NDArray]
- static _edges_eq(e1, e2)¶
Compare edge-tuples for two histograms.
- _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)
- _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:
- static create_empty(name, settings)¶
- Parameters:
- Return type:
- 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)
- 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)
- Return type:
None
- get_settings()¶
Get the binning settings that were used to create this optical map instance.
- Return type:
- static load_from_file(lh5_file, group)¶
- Parameters:
- Return type: