Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reboost hpges #23

Draft
wants to merge 90 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
578de78
basic template for hpge post processing
tdixon97 Oct 21, 2024
a6d3d12
style: pre-commit fixes
pre-commit-ci[bot] Oct 21, 2024
05b42e6
pc fixes
tdixon97 Oct 21, 2024
3dfbf23
style improvements
tdixon97 Oct 21, 2024
0bd5d6f
fix merge
tdixon97 Oct 21, 2024
8b1fd87
basic functionality for time-windowing
tdixon97 Oct 22, 2024
223a7d0
detectors file to config
tdixon97 Oct 22, 2024
5ded4c9
[fix] sort by time
tdixon97 Oct 22, 2024
4261348
[wip] adding functions for DL calculations
tdixon97 Oct 24, 2024
2f888fb
[wip] adding functions for DL calc and __init__ for hpge subpackage
tdixon97 Oct 24, 2024
ddea2d5
style: pre-commit fixes
pre-commit-ci[bot] Oct 24, 2024
ca94f10
Update __init__.py
tdixon97 Oct 24, 2024
adb1f6e
style: pre-commit fixes
pre-commit-ci[bot] Oct 24, 2024
534882c
Update src/reboost/hpge/processors.py
tdixon97 Oct 28, 2024
3d5a535
Update src/reboost/hpge/hit.py
tdixon97 Oct 28, 2024
39c587c
style: pre-commit fixes
pre-commit-ci[bot] Oct 28, 2024
78e130a
[wip] starting functionality for DLs
tdixon97 Oct 28, 2024
592bdfc
Merge branch 'main' of github.com:tdixon97/reboost into main
tdixon97 Oct 28, 2024
a2e2599
style: pre-commit fixes
pre-commit-ci[bot] Oct 28, 2024
16550ae
fix some parts of the docs
tdixon97 Oct 28, 2024
4c4f603
style: pre-commit fixes
pre-commit-ci[bot] Oct 28, 2024
f8778cc
generate proccesing chain from config file
tdixon97 Nov 7, 2024
0e7aaf5
bit of clean up / improved docs
tdixon97 Nov 7, 2024
5a9595b
[tests] add test for the windowing
tdixon97 Nov 7, 2024
63ca42b
style: pre-commit fixes
pre-commit-ci[bot] Nov 7, 2024
d65ffad
[tests] adding more tests
tdixon97 Nov 8, 2024
bfe9782
style: pre-commit fixes
pre-commit-ci[bot] Nov 8, 2024
670f5df
[tests] test merging arrays
tdixon97 Nov 8, 2024
4747230
Merge branch 'main' of github.com:tdixon97/reboost into main
tdixon97 Nov 8, 2024
cdc8767
style: pre-commit fixes
pre-commit-ci[bot] Nov 8, 2024
8e8de77
update to be able to read json or yaml
tdixon97 Nov 8, 2024
6cf37d6
fix merge
tdixon97 Nov 8, 2024
3dcc0f6
processor for distance to surface
tdixon97 Nov 10, 2024
0d22b95
[docs] improved documentation
tdixon97 Nov 12, 2024
83be05d
add hpges and pyg4ometry to the dependencies
tdixon97 Nov 12, 2024
a2e8d4a
add pyg4ometry
tdixon97 Nov 12, 2024
58e6f36
[docs] add legendtestdata to deps
tdixon97 Nov 12, 2024
8ec0df6
[tests] test on the whole of build_hit (IO)
tdixon97 Nov 12, 2024
ee048fa
precommit
tdixon97 Nov 12, 2024
410bb22
remove dependency
tdixon97 Nov 12, 2024
a4140bf
[tests] fix the test data
tdixon97 Nov 12, 2024
b615949
add the option to just read n evtid starting at a particular index.
tdixon97 Nov 14, 2024
42390b8
trying to fix tests
tdixon97 Nov 14, 2024
40329f5
style: pre-commit fixes
pre-commit-ci[bot] Nov 14, 2024
432bd70
add awkward to dependencies
tdixon97 Nov 14, 2024
8616562
Merge branch 'main' of github.com:tdixon97/reboost into main
tdixon97 Nov 14, 2024
dea22dd
update main.yaml
tdixon97 Nov 14, 2024
6237681
improving documentation
tdixon97 Nov 14, 2024
1370087
change FileInfo into class (cleaner)
tdixon97 Nov 14, 2024
54663e0
[docs] improve documentation and start working on locals option
tdixon97 Nov 14, 2024
097b9e6
add option to specify local objects in config
tdixon97 Nov 15, 2024
133da5e
ak.min to np.min for 1D array
tdixon97 Nov 15, 2024
9f0a9ba
style: pre-commit fixes
pre-commit-ci[bot] Nov 15, 2024
f075594
style fixes
tdixon97 Nov 15, 2024
9f70f59
Merge branch 'main' of github.com:tdixon97/reboost into main
tdixon97 Nov 15, 2024
cd16454
ak -> np to fix CI failures
tdixon97 Nov 15, 2024
a28d1a4
style: pre-commit fixes
pre-commit-ci[bot] Nov 15, 2024
b9bc3a4
[docs] adding a basic tutorial
tdixon97 Nov 16, 2024
28115f1
Merge branch 'main' of github.com:tdixon97/reboost into main
tdixon97 Nov 16, 2024
50017cc
style: pre-commit fixes
pre-commit-ci[bot] Nov 16, 2024
e301bd7
[docs] fix spelling
tdixon97 Nov 16, 2024
7293579
Merge branch 'main' of github.com:tdixon97/reboost into main
tdixon97 Nov 16, 2024
03e6088
[docs] fix
tdixon97 Nov 16, 2024
90112a2
[docs] remove nbspinx
tdixon97 Nov 16, 2024
e4feb8f
[docs] update conf.p
tdixon97 Nov 16, 2024
66c63fc
Update pyproject.toml
tdixon97 Nov 17, 2024
22c4b78
[docs] fix tutorial
tdixon97 Nov 17, 2024
c2bc963
[docs] fix
tdixon97 Nov 17, 2024
387ac50
[docs] more format fixes
tdixon97 Nov 17, 2024
e78e90e
clean up build hit
tdixon97 Nov 18, 2024
9530b65
first version of building tcm
tdixon97 Nov 18, 2024
78116a4
remove timing debug (cleanup)
tdixon97 Nov 18, 2024
0abd90f
[evt] first version of build_tcm code
tdixon97 Nov 18, 2024
d9509bc
[docs] small fix
tdixon97 Nov 18, 2024
abd9450
pre-commit
tdixon97 Nov 18, 2024
01cc000
[docs] fix build-hit docsring
tdixon97 Nov 19, 2024
f0d13cb
change evtid to _evtid and global_evtid to _global_evtid since its no…
tdixon97 Nov 20, 2024
f594231
additions to documentation
tdixon97 Nov 20, 2024
9509c2a
[docs] switch tutorials from rst to ipynb (easier to mantain)
tdixon97 Nov 20, 2024
df7e6d9
change to notebook for docs
tdixon97 Nov 20, 2024
ae1cea5
[docs] switch back to rst (dont want to run the notebooks)
tdixon97 Nov 20, 2024
ecd90e7
[evt] adding build_tcm functionality
tdixon97 Nov 21, 2024
d6b6d27
[docs] documentation for event tier
tdixon97 Nov 22, 2024
235aefb
[docs] documentation for event tier
tdixon97 Nov 22, 2024
c61ef07
[docs] remove nbsphinx
tdixon97 Nov 22, 2024
2d8c634
[docs] fix
tdixon97 Nov 22, 2024
0a97068
style: pre-commit fixes
pre-commit-ci[bot] Nov 22, 2024
5790828
[docs] ipython --> python
tdixon97 Nov 22, 2024
6383880
Merge branch 'main' of github.com:tdixon97/reboost into main
tdixon97 Nov 22, 2024
b779c4d
[docs] small fixes
tdixon97 Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style: pre-commit fixes
pre-commit-ci[bot] committed Oct 24, 2024
commit ddea2d5aa265e9b27ced219a65eb1387bb420421
27 changes: 13 additions & 14 deletions src/reboost/hpge/processors.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
import numpy as np
import utils


def def_chain(funcs, kwargs_list):
def func(data):
tmp = data
@@ -54,25 +55,23 @@ def smear_energy(data, reso=2, energy_name="sum_energy"):
data, rng.normal(loc=flat_energy, scale=np.ones_like(flat_energy) * reso), "energy_smeared"
)

def distance_to_surface(data,detector="det001"):

def distance_to_surface(data, detector="det001"):
# get detector origin
x,y,z = utils.get_detector_origin(detector)
x, y, z = utils.get_detector_origin(detector)

# get the r-z points to produce the detector (G4GenericPolyCone)
r,z = utils.get_detector_corners(detector)
r, z = utils.get_detector_corners(detector)

# loop over pairs
dists=[]
for (rtmp,ztmp,rnext_tmp,znext_tmp) in zip(r[:-1],z[:-1],r[1:],z[1:]):

s1 = ak.zip({"x":rtmp,"y":ztmp})
s2 = ak.zip({"x":rnext_tmp,"y":znext_tmp})
v_3d=ak.zip({"x":data.xloc-x,"y":data.yloc-y,"z":data.zloc-z})
v = ak.zip({"x":np.sqrt(np.power(v_3d.x,2)+np.power(v_3d.y,2)),"y":v_3d.z})

dist = utils.dist(s1,s2,v)
dists = []
for rtmp, ztmp, rnext_tmp, znext_tmp in zip(r[:-1], z[:-1], r[1:], z[1:]):
s1 = ak.zip({"x": rtmp, "y": ztmp})
s2 = ak.zip({"x": rnext_tmp, "y": znext_tmp})
v_3d = ak.zip({"x": data.xloc - x, "y": data.yloc - y, "z": data.zloc - z})
v = ak.zip({"x": np.sqrt(np.power(v_3d.x, 2) + np.power(v_3d.y, 2)), "y": v_3d.z})

dist = utils.dist(s1, s2, v)
dists.append(dist)


raise np.min(dists)
2 changes: 2 additions & 0 deletions src/reboost/hpge/utils.py
Original file line number Diff line number Diff line change
@@ -59,9 +59,11 @@ def proj(s1, s2, v):
def dist(s1, s2, v):
return distance_2d(proj(s1, s2, v), v)


def get_detector_origin(name):
raise NotImplementedError


def read_write_incremental(
file_out: str,
name_out: str,