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

add routines for computing time coincidence map and evt #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tdixon97
Copy link
Collaborator

This is still a bit WIP.

  • builds a simple TCM
  • computes events using pygama functions

Issues:

  • building the TCM is done fully in memory (potentially bad?)
  • no tests yet
  • some more flexibility is needed, eg. parsing expressions for channel lists etc.

I still think its useful if @gipert can have a look so we plan what needs to be changed

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 3.65854% with 79 lines in your changes missing coverage. Please review.

Project coverage is 69.03%. Comparing base (f0f1791) to head (edabe63).

Files with missing lines Patch % Lines
src/reboost/build_evt.py 0.00% 50 Missing ⚠️
src/reboost/build_tcm.py 0.00% 29 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
- Coverage   72.30%   69.03%   -3.27%     
==========================================
  Files          23       24       +1     
  Lines        1607     1686      +79     
==========================================
+ Hits         1162     1164       +2     
- Misses        445      522      +77     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

) -> Table:
"""Builds a time-coincidence map from a hit of hit data Tables.

- build an ak.Array of the data merging channels with fields base on "time_name", and "idx_name" and adding a field `rawid` from the channel idx, also add the row (`hit_idx`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please wrap!

@gipert
Copy link
Member

gipert commented Feb 13, 2025

Can you calculate how many events you would have to process to make memory usage problematic?

@tdixon97
Copy link
Collaborator Author

I think around 10^8 hits over the full detector.

  • I.e need to read one int and one double per hit, so 1 GB of memory would be 0.8 x 10^8 hits.
  • There are probably cases we will run into issues, eg a 2vbb sim will be few 10^8 hits.
  • In general run partitioning will help this a bit, but I rather not rely on it.

Note: The issue is just when we create the TCM, once we have it we can iterate over it without memory issues.

@tdixon97
Copy link
Collaborator Author

I think this can likely be done without loading the full file into memory with a "leap-frog" like reading. Similar to the build_glm code?

hash_func = r"\d+"

@tdixon97
Copy link
Collaborator Author

Alternatively, build_hit can produce a hlm object telling which rows in the hit table correspond to which g4_evtid to help with iterating over the hit files... I am not sure about producing too many new objects though

@tdixon97 tdixon97 mentioned this pull request Feb 14, 2025
@tdixon97
Copy link
Collaborator Author

I think we should merge this, since it is still useful functionality, even if some parts have to be changed to work for very large files

@tdixon97 tdixon97 marked this pull request as ready for review February 16, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants