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

TPG Threshold By Plane #177

Merged
merged 5 commits into from
May 14, 2024
Merged

Conversation

aeoranday
Copy link
Member

@aeoranday aeoranday commented May 7, 2024

This PR adds the implementation of TPG thresholding by plane. There are related PRs in daqconf, fddaqconf, and readoutlibs to include the configurables for these thresholds.

By default, the implementation makes use of the general tpg_threshold value unless a specific threshold is given for collection_threshold, induction2_threshold, and induction1_threshold. These thresholds are then applied according to the plane identification from detchannelmaps.

Testing was done with short runs where two of the three planes have a high threshold and the last plane has a low threshold. This was repeated for each of SimpleThreshold, AbsRS, and StandardRS. Then I checked that the TriggerPrimitives in the generated TPStream were only from the low threshold plane and above the required threshold. The following snippet is the exact check.

from trgtools import TPReader
import detchannelmaps

channel_map = detchannelmaps.make_map("<TPCChannelMap>")
tps = TPReader("<TestTPStream>")
tps.read_all_fragments()
count = 0
for tp in tps.tp_data:
    if channel_map.get_plane_from_offline_channel(tp['channel']) == <plane> and tp['adc_peak'] >= <set_threshold>:
      count += 1
print(count == tps.tp_data.shape[0])

Testing was consistent for each of the three planes.

@aeoranday
Copy link
Member Author

Latest commit made the word choice changes to match what is used in detchannelmaps. Configs and variables now refer to planes 0, 1, and 2 instead of induction 1, induction 2, and collection. Also prefixed with tpg_.

@aeoranday aeoranday requested a review from alessandrothea May 9, 2024 09:08
@aeoranday aeoranday merged commit cb2144d into patch/fddaq-v4.4.x May 14, 2024
@aeoranday aeoranday deleted the aeo/threshold_by_plane branch May 14, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request miscellaneous deliverable A change that is/will be part of a release but is not substantial enough to be a daq-deliverable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants