reboost 0.8.0__tar.gz → 0.8.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {reboost-0.8.0 → reboost-0.8.1}/PKG-INFO +2 -1
- {reboost-0.8.0 → reboost-0.8.1}/pyproject.toml +1 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/_version.py +3 -3
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/hpge/psd.py +11 -9
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/optmap/convolve.py +40 -83
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/optmap/create.py +2 -5
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/spms/pe.py +4 -4
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost.egg-info/PKG-INFO +2 -1
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost.egg-info/requires.txt +1 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hit/configs/spms.yaml +4 -4
- {reboost-0.8.0 → reboost-0.8.1}/tests/hit/test_build_hit.py +3 -5
- {reboost-0.8.0 → reboost-0.8.1}/LICENSE +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/README.md +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/setup.cfg +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/__init__.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/build_evt.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/build_glm.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/build_hit.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/cli.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/core.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/daq/__init__.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/daq/core.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/daq/utils.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/hpge/__init__.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/hpge/surface.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/hpge/utils.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/iterator.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/log_utils.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/math/__init__.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/math/functions.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/math/stats.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/optmap/__init__.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/optmap/cli.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/optmap/evt.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/optmap/mapview.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/optmap/numba_pdg.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/optmap/optmap.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/profile.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/shape/__init__.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/shape/cluster.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/shape/group.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/shape/reduction.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/spms/__init__.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/units.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost/utils.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost.egg-info/SOURCES.txt +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost.egg-info/dependency_links.txt +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost.egg-info/entry_points.txt +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost.egg-info/not-zip-safe +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/src/reboost.egg-info/top_level.txt +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/conftest.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/evt/test_evt.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/glm/test_build_glm.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hit/configs/args.yaml +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hit/configs/basic.yaml +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hit/configs/foward_only.yaml +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hit/configs/geom.gdml +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hit/configs/hit_config.yaml +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hit/configs/pars.yaml +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hit/configs/reshape.yaml +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/simulation/gammas.mac +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/simulation/geometry.gdml +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/simulation/make_dt_map.jl +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/simulation/make_geom.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/test_current.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/test_dt_heuristic.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/test_files/drift_time_maps.lh5 +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/test_files/internal_electron.lh5 +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/test_hpge_map.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/test_r90.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/hpge/test_surface.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/spms/test_pe.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/test_cli.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/test_core.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/test_math.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/test_optmap.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/test_optmap_dets.gdml +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/test_profile.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/test_shape.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/test_units.py +0 -0
- {reboost-0.8.0 → reboost-0.8.1}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reboost
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: New LEGEND Monte-Carlo simulation post-processing
|
|
5
5
|
Author-email: Manuel Huber <info@manuelhu.de>, Toby Dixon <toby.dixon.23@ucl.ac.uk>, Luigi Pertoldi <gipert@pm.me>
|
|
6
6
|
Maintainer: The LEGEND Collaboration
|
|
@@ -704,6 +704,7 @@ Requires-Dist: numba>=0.60
|
|
|
704
704
|
Requires-Dist: legend-pydataobj>=1.15.1
|
|
705
705
|
Requires-Dist: legend-pygeom-optics>=0.12.0
|
|
706
706
|
Requires-Dist: legend-pygeom-tools>=0.0.11
|
|
707
|
+
Requires-Dist: legend-pygeom-hpges
|
|
707
708
|
Requires-Dist: hist
|
|
708
709
|
Requires-Dist: dbetto
|
|
709
710
|
Requires-Dist: particle
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.8.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 8,
|
|
31
|
+
__version__ = version = '0.8.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 8, 1)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g3148f45bd'
|
|
@@ -262,11 +262,13 @@ def _current_pulse_model(
|
|
|
262
262
|
|
|
263
263
|
Consists of a Gaussian, a high side exponential tail and a low side tail:
|
|
264
264
|
|
|
265
|
-
|
|
265
|
+
.. math::
|
|
266
266
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
\frac{e^{
|
|
267
|
+
\begin{align}
|
|
268
|
+
A(t) = \; &A_\text{max} \times (1-p-p_h) \times \text{Gauss}(t;\mu,\sigma) \\
|
|
269
|
+
&+ A \times p \; \left(1 - \text{erf}\left(\frac{t-\mu}{\sigma_i}\right)\right) \times \frac{e^{t/\tau}}{2e^{\mu/\tau}} \\
|
|
270
|
+
&+ A \times p_h \; \left(1 - \text{erf}\left(-\frac{t-\mu}{\sigma_i}\right)\right) \times \frac{1}{2}e^{-t/\tau}
|
|
271
|
+
\end{align}
|
|
270
272
|
|
|
271
273
|
Parameters
|
|
272
274
|
----------
|
|
@@ -397,13 +399,13 @@ def get_current_waveform(
|
|
|
397
399
|
the template.
|
|
398
400
|
|
|
399
401
|
.. math::
|
|
400
|
-
A(t) = \sum_i E_i \times N f(t,dt_i
|
|
402
|
+
A(t) = \sum_i E_i \times N f(t, dt_i, \vec{\theta})
|
|
401
403
|
|
|
402
404
|
Where:
|
|
403
|
-
-
|
|
404
|
-
-
|
|
405
|
-
-
|
|
406
|
-
- N is a normalisation term
|
|
405
|
+
- :math:`f(t)` is the template
|
|
406
|
+
- :math`\vec{\theta}` are the parameters :math:`(\sigma, p, \tau)`
|
|
407
|
+
- :math:`E_i` and :math:`dt_i` are the deposited energy and drift time.
|
|
408
|
+
- :math:`N` is a normalisation term
|
|
407
409
|
|
|
408
410
|
Parameters
|
|
409
411
|
----------
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
-
import re
|
|
5
4
|
from typing import NamedTuple
|
|
6
5
|
|
|
7
6
|
import awkward as ak
|
|
@@ -10,7 +9,7 @@ import numba
|
|
|
10
9
|
import numpy as np
|
|
11
10
|
from legendoptics import fibers, lar, pen
|
|
12
11
|
from lgdo import lh5
|
|
13
|
-
from lgdo.types import
|
|
12
|
+
from lgdo.types import Histogram
|
|
14
13
|
from numba import njit
|
|
15
14
|
from numpy.typing import NDArray
|
|
16
15
|
|
|
@@ -20,24 +19,20 @@ log = logging.getLogger(__name__)
|
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
OPTMAP_ANY_CH = -1
|
|
23
|
-
OPTMAP_SUM_CH = -2
|
|
24
22
|
|
|
25
23
|
|
|
26
24
|
class OptmapForConvolve(NamedTuple):
|
|
27
25
|
"""A loaded optmap for convolving."""
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
dets: NDArray
|
|
30
28
|
detidx: NDArray
|
|
31
29
|
edges: NDArray
|
|
32
30
|
weights: NDArray
|
|
33
31
|
|
|
34
32
|
|
|
35
33
|
def open_optmap(optmap_fn: str) -> OptmapForConvolve:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
det_ntuples = [m for m in maps if re.match(r"_\d+$", m)]
|
|
39
|
-
detids = np.array([int(m.lstrip("_")) for m in det_ntuples])
|
|
40
|
-
detidx = np.arange(0, detids.shape[0])
|
|
34
|
+
dets = lh5.ls(optmap_fn, "/channels/")
|
|
35
|
+
detidx = np.arange(0, dets.shape[0])
|
|
41
36
|
|
|
42
37
|
optmap_all = lh5.read("/all/prob", optmap_fn)
|
|
43
38
|
assert isinstance(optmap_all, Histogram)
|
|
@@ -46,7 +41,7 @@ def open_optmap(optmap_fn: str) -> OptmapForConvolve:
|
|
|
46
41
|
ow = np.empty((detidx.shape[0] + 2, *optmap_all.weights.nda.shape), dtype=np.float64)
|
|
47
42
|
# 0, ..., len(detidx)-1 AND OPTMAP_ANY_CH might be negative.
|
|
48
43
|
ow[OPTMAP_ANY_CH] = optmap_all.weights.nda
|
|
49
|
-
for i, nt in zip(detidx,
|
|
44
|
+
for i, nt in zip(detidx, dets, strict=True):
|
|
50
45
|
optmap = lh5.read(f"/{nt}/prob", optmap_fn)
|
|
51
46
|
assert isinstance(optmap, Histogram)
|
|
52
47
|
ow[i] = optmap.weights.nda
|
|
@@ -54,61 +49,51 @@ def open_optmap(optmap_fn: str) -> OptmapForConvolve:
|
|
|
54
49
|
# if we have any individual channels registered, the sum is potentially larger than the
|
|
55
50
|
# probability to find _any_ hit.
|
|
56
51
|
if len(detidx) != 0:
|
|
57
|
-
|
|
58
|
-
assert not np.any(
|
|
52
|
+
map_sum = np.sum(ow[0:-2], axis=0, where=(ow[0:-2] >= 0))
|
|
53
|
+
assert not np.any(map_sum < 0)
|
|
54
|
+
|
|
55
|
+
# give this check some numerical slack.
|
|
56
|
+
if np.any(
|
|
57
|
+
np.abs(map_sum[ow[OPTMAP_ANY_CH] >= 0] - ow[OPTMAP_ANY_CH][ow[OPTMAP_ANY_CH] >= 0])
|
|
58
|
+
< -1e-15
|
|
59
|
+
):
|
|
60
|
+
msg = "optical map does not fulfill relation sum(p_i) >= p_any"
|
|
61
|
+
raise ValueError(msg)
|
|
59
62
|
else:
|
|
60
63
|
detidx = np.array([OPTMAP_ANY_CH])
|
|
61
|
-
|
|
62
|
-
ow[OPTMAP_SUM_CH] = ow[OPTMAP_ANY_CH]
|
|
64
|
+
dets = np.array(["all"])
|
|
63
65
|
|
|
64
|
-
#
|
|
65
|
-
if
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
raise ValueError(msg)
|
|
66
|
+
# check the exponent from the optical map file
|
|
67
|
+
if "_hitcounts_exp" in lh5.ls(optmap_fn):
|
|
68
|
+
msg = "found _hitcounts_exp which is not supported any more"
|
|
69
|
+
raise RuntimeError(msg)
|
|
70
|
+
|
|
71
|
+
dets = [d.replace("/channels/", "") for d in dets]
|
|
72
|
+
|
|
73
|
+
return OptmapForConvolve(dets, detidx, optmap_edges, ow)
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return OptmapForConvolve(detids, detidx, optmap_edges, ow)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
def open_optmap_single(optmap_fn: str, spm_det_uid: int) -> OptmapForConvolve:
|
|
88
|
-
try:
|
|
89
|
-
# check the exponent from the optical map file
|
|
90
|
-
optmap_multi_det_exp = lh5.read("/_hitcounts_exp", optmap_fn).value
|
|
91
|
-
assert isinstance(optmap_multi_det_exp, float)
|
|
92
|
-
if np.isfinite(optmap_multi_det_exp):
|
|
93
|
-
msg = f"found finite _hitcounts_exp {optmap_multi_det_exp} which is not supported any more"
|
|
94
|
-
raise RuntimeError(msg)
|
|
95
|
-
except lh5.exceptions.LH5DecodeError: # the _hitcounts_exp might not be always present.
|
|
96
|
-
pass
|
|
97
|
-
|
|
98
|
-
optmap = lh5.read(f"/_{spm_det_uid}/prob", optmap_fn)
|
|
75
|
+
|
|
76
|
+
def open_optmap_single(optmap_fn: str, spm_det: str) -> OptmapForConvolve:
|
|
77
|
+
# check the exponent from the optical map file
|
|
78
|
+
if "_hitcounts_exp" in lh5.ls(optmap_fn):
|
|
79
|
+
msg = "found _hitcounts_exp which is not supported any more"
|
|
80
|
+
raise RuntimeError(msg)
|
|
81
|
+
|
|
82
|
+
h5_path = f"channels/{spm_det}" if spm_det != "all" else spm_det
|
|
83
|
+
optmap = lh5.read(f"/{h5_path}/prob", optmap_fn)
|
|
99
84
|
assert isinstance(optmap, Histogram)
|
|
100
85
|
ow = np.empty((1, *optmap.weights.nda.shape), dtype=np.float64)
|
|
101
86
|
ow[0] = optmap.weights.nda
|
|
102
87
|
optmap_edges = tuple([b.edges for b in optmap.binning])
|
|
103
88
|
|
|
104
|
-
return OptmapForConvolve(np.array([
|
|
89
|
+
return OptmapForConvolve(np.array([spm_det]), np.array([0]), optmap_edges, ow)
|
|
105
90
|
|
|
106
91
|
|
|
107
92
|
def iterate_stepwise_depositions_pois(
|
|
108
93
|
edep_hits: ak.Array,
|
|
109
94
|
optmap: OptmapForConvolve,
|
|
110
95
|
scint_mat_params: sc.ComputedScintParams,
|
|
111
|
-
|
|
96
|
+
det: str,
|
|
112
97
|
map_scaling: float = 1,
|
|
113
98
|
map_scaling_sigma: float = 0,
|
|
114
99
|
rng: np.random.Generator | None = None,
|
|
@@ -117,11 +102,15 @@ def iterate_stepwise_depositions_pois(
|
|
|
117
102
|
msg = "the pe processors only support already reshaped output"
|
|
118
103
|
raise ValueError(msg)
|
|
119
104
|
|
|
105
|
+
if det not in optmap.dets:
|
|
106
|
+
msg = f"channel {det} not available in optical map (contains {optmap.dets})"
|
|
107
|
+
raise ValueError(msg)
|
|
108
|
+
|
|
120
109
|
rng = np.random.default_rng() if rng is None else rng
|
|
121
110
|
res, output_list = _iterate_stepwise_depositions_pois(
|
|
122
111
|
edep_hits,
|
|
123
112
|
rng,
|
|
124
|
-
np.where(optmap.
|
|
113
|
+
np.where(optmap.dets == det)[0][0],
|
|
125
114
|
map_scaling,
|
|
126
115
|
map_scaling_sigma,
|
|
127
116
|
optmap.edges,
|
|
@@ -314,38 +303,6 @@ def _iterate_stepwise_depositions_scintillate(
|
|
|
314
303
|
return output_list
|
|
315
304
|
|
|
316
305
|
|
|
317
|
-
def get_output_table(output_map):
|
|
318
|
-
ph_count_o = 0
|
|
319
|
-
for _rawid, (_evtid, det, _times) in output_map.items():
|
|
320
|
-
ph_count_o += det.shape[0]
|
|
321
|
-
|
|
322
|
-
out_idx = 0
|
|
323
|
-
out_evtid = np.empty(ph_count_o, dtype=np.int64)
|
|
324
|
-
out_det = np.empty(ph_count_o, dtype=np.int64)
|
|
325
|
-
out_times = np.empty(ph_count_o, dtype=np.float64)
|
|
326
|
-
for _rawid, (evtid, det, times) in output_map.items():
|
|
327
|
-
o_len = det.shape[0]
|
|
328
|
-
out_evtid[out_idx : out_idx + o_len] = evtid
|
|
329
|
-
out_det[out_idx : out_idx + o_len] = det
|
|
330
|
-
out_times[out_idx : out_idx + o_len] = times
|
|
331
|
-
out_idx += o_len
|
|
332
|
-
|
|
333
|
-
tbl = Table({"evtid": Array(out_evtid), "det_uid": Array(out_det), "time": Array(out_times)})
|
|
334
|
-
return ph_count_o, tbl
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
def _reflatten_scint_vov(arr: ak.Array) -> ak.Array:
|
|
338
|
-
if all(arr[f].ndim == 1 for f in ak.fields(arr)):
|
|
339
|
-
return arr
|
|
340
|
-
|
|
341
|
-
group_num = ak.num(arr["edep"]).to_numpy()
|
|
342
|
-
flattened = {
|
|
343
|
-
f: ak.flatten(arr[f]) if arr[f].ndim > 1 else np.repeat(arr[f].to_numpy(), group_num)
|
|
344
|
-
for f in ak.fields(arr)
|
|
345
|
-
}
|
|
346
|
-
return ak.Array(flattened)
|
|
347
|
-
|
|
348
|
-
|
|
349
306
|
def _get_scint_params(material: str):
|
|
350
307
|
if material == "lar":
|
|
351
308
|
return sc.precompute_scintillation_params(
|
|
@@ -369,11 +369,8 @@ def check_optical_map(map_l5_file: str):
|
|
|
369
369
|
|
|
370
370
|
This checks for consistency, and outputs details on map statistics.
|
|
371
371
|
"""
|
|
372
|
-
if (
|
|
373
|
-
"_hitcounts_exp
|
|
374
|
-
and lh5.read("_hitcounts_exp", lh5_file=map_l5_file).value != np.inf
|
|
375
|
-
):
|
|
376
|
-
log.error("unexpected _hitcounts_exp not equal to positive infinity")
|
|
372
|
+
if "_hitcounts_exp" in lh5.ls(map_l5_file):
|
|
373
|
+
log.error("found _hitcounts_exp which is not supported any more")
|
|
377
374
|
return
|
|
378
375
|
|
|
379
376
|
all_binning = None
|
|
@@ -105,7 +105,7 @@ def detected_photoelectrons(
|
|
|
105
105
|
zloc: ak.Array,
|
|
106
106
|
optmap: convolve.OptmapForConvolve,
|
|
107
107
|
material: str,
|
|
108
|
-
|
|
108
|
+
spm_detector: str,
|
|
109
109
|
map_scaling: float = 1,
|
|
110
110
|
map_scaling_sigma: float = 0,
|
|
111
111
|
) -> VectorOfVectors:
|
|
@@ -130,8 +130,8 @@ def detected_photoelectrons(
|
|
|
130
130
|
the optical map loaded via py:func:`load_optmap`.
|
|
131
131
|
material
|
|
132
132
|
scintillating material name.
|
|
133
|
-
|
|
134
|
-
SiPM detector
|
|
133
|
+
spm_detector
|
|
134
|
+
SiPM detector name as used in the optical map.
|
|
135
135
|
map_scaling
|
|
136
136
|
scale the detection probability in the map for this detector by this factor.
|
|
137
137
|
map_scaling_sigma
|
|
@@ -151,7 +151,7 @@ def detected_photoelectrons(
|
|
|
151
151
|
|
|
152
152
|
scint_mat_params = convolve._get_scint_params(material)
|
|
153
153
|
pe = convolve.iterate_stepwise_depositions_pois(
|
|
154
|
-
hits, optmap, scint_mat_params,
|
|
154
|
+
hits, optmap, scint_mat_params, spm_detector, map_scaling, map_scaling_sigma
|
|
155
155
|
)
|
|
156
156
|
|
|
157
157
|
return VectorOfVectors(pe, attrs={"units": "ns"})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reboost
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: New LEGEND Monte-Carlo simulation post-processing
|
|
5
5
|
Author-email: Manuel Huber <info@manuelhu.de>, Toby Dixon <toby.dixon.23@ucl.ac.uk>, Luigi Pertoldi <gipert@pm.me>
|
|
6
6
|
Maintainer: The LEGEND Collaboration
|
|
@@ -704,6 +704,7 @@ Requires-Dist: numba>=0.60
|
|
|
704
704
|
Requires-Dist: legend-pydataobj>=1.15.1
|
|
705
705
|
Requires-Dist: legend-pygeom-optics>=0.12.0
|
|
706
706
|
Requires-Dist: legend-pygeom-tools>=0.0.11
|
|
707
|
+
Requires-Dist: legend-pygeom-hpges
|
|
707
708
|
Requires-Dist: hist
|
|
708
709
|
Requires-Dist: dbetto
|
|
709
710
|
Requires-Dist: particle
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
objects:
|
|
2
|
-
spms: "
|
|
2
|
+
spms: "['S001', 'S002']"
|
|
3
3
|
|
|
4
4
|
processing_groups:
|
|
5
5
|
- name: spms
|
|
6
6
|
|
|
7
7
|
detector_mapping:
|
|
8
|
-
- output: OBJECTS.spms
|
|
8
|
+
- output: OBJECTS.spms
|
|
9
9
|
input: det001
|
|
10
10
|
|
|
11
11
|
outputs:
|
|
@@ -21,10 +21,10 @@ processing_groups:
|
|
|
21
21
|
"lar")
|
|
22
22
|
|
|
23
23
|
detector_objects:
|
|
24
|
-
optmap_lar: reboost.spms.load_optmap(ARGS.optmap_path,
|
|
24
|
+
optmap_lar: reboost.spms.load_optmap(ARGS.optmap_path, DETECTOR)
|
|
25
25
|
|
|
26
26
|
operations:
|
|
27
27
|
pe_times_lar:
|
|
28
28
|
reboost.spms.detected_photoelectrons( HITS.num_scint_ph, HITS.particle,
|
|
29
29
|
HITS.time, HITS.xloc, HITS.yloc, HITS.zloc, DETECTOR_OBJECTS.optmap_lar,
|
|
30
|
-
"lar",
|
|
30
|
+
"lar", DETECTOR )
|
|
@@ -327,14 +327,12 @@ def test_spms(test_gen_lh5_scint, tmptestdir):
|
|
|
327
327
|
|
|
328
328
|
# create a simple test map
|
|
329
329
|
map_file = f"{tmptestdir}/spms_hit_map.lh5"
|
|
330
|
-
m = OpticalMap.create_empty(
|
|
331
|
-
"_11", {"range_in_m": [[-1, 1], [-1, 1], [-1, 1]], "bins": [1, 1, 1]}
|
|
332
|
-
)
|
|
330
|
+
m = OpticalMap.create_empty("_", {"range_in_m": [[-1, 1], [-1, 1], [-1, 1]], "bins": [1, 1, 1]})
|
|
333
331
|
m._nda(m.h_vertex)[0, 0, 0] = 100
|
|
334
332
|
m._nda(m.h_hits)[0, 0, 0] = 10
|
|
335
333
|
m.create_probability()
|
|
336
|
-
m.write_lh5(map_file, "
|
|
337
|
-
m.write_lh5(map_file, "
|
|
334
|
+
m.write_lh5(map_file, "channels/S001", "overwrite_file")
|
|
335
|
+
m.write_lh5(map_file, "channels/S002", "write_safe")
|
|
338
336
|
|
|
339
337
|
outfile = f"{tmptestdir}/spms_hit.lh5"
|
|
340
338
|
reboost.build_hit(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|