Trim toa final#439
Open
vbe9cs wants to merge 20 commits into
Open
Conversation
…ession in command
…ession in command
…ession in command
tomeichlersmith
requested changes
Jul 15, 2026
Member
This was
linked to
issues
Jul 15, 2026
Closed
Co-authored-by: Tom Eichlersmith <31970302+tomeichlersmith@users.noreply.github.com>
Co-authored-by: Tom Eichlersmith <31970302+tomeichlersmith@users.noreply.github.com>
Co-authored-by: Tom Eichlersmith <31970302+tomeichlersmith@users.noreply.github.com>
tomeichlersmith
requested changes
Jul 20, 2026
tomeichlersmith
left a comment
Member
There was a problem hiding this comment.
After your merge, there are some syntax errors leftover that you need to patch (e.g. the test fails to compile: https://github.com/LDMX-Software/pflib/actions/runs/29757941083/job/88405044333)
I think the actual updates to trim toa are ready, the leftover comments are just cleanup.
Comment on lines
+201
to
+207
| return settings; | ||
| for (int i_link{0}; i_link < 2; i_link++) { | ||
| std::string page{ | ||
| pflib::utility::string_format("REFERENCEVOLTAGE_%d", i_link)}; | ||
| settings[i_roc][page]["TOA_VREF"] = target[i_roc][i_link]; | ||
| } | ||
| } | ||
| return settings; |
Member
There was a problem hiding this comment.
remove this section. It is now incorrect since the toa_vref scan goes over multiple ROCs each with their own links.
Suggested change
| return settings; | |
| for (int i_link{0}; i_link < 2; i_link++) { | |
| std::string page{ | |
| pflib::utility::string_format("REFERENCEVOLTAGE_%d", i_link)}; | |
| settings[i_roc][page]["TOA_VREF"] = target[i_roc][i_link]; | |
| } | |
| } | |
| return settings; | |
| return settings; |
| f << out.c_str() << std::endl; | ||
| } | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
I'm guessing this extra curly brace is one of the syntax errors.
Comment on lines
+199
to
+203
| for (int i_link{0}; i_link < 2; i_link++) { | ||
| std::string page{ | ||
| pflib::utility::string_format("REFERENCEVOLTAGE_%d", i_link)}; | ||
| settings[i_roc][page]["TOA_VREF"] = target[i_roc][i_link]; | ||
| } |
Member
There was a problem hiding this comment.
This is just a copy of the 5 lines above it.
Suggested change
| for (int i_link{0}; i_link < 2; i_link++) { | |
| std::string page{ | |
| pflib::utility::string_format("REFERENCEVOLTAGE_%d", i_link)}; | |
| settings[i_roc][page]["TOA_VREF"] = target[i_roc][i_link]; | |
| } |
| f << out.c_str() << std::endl; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated TRIM_TOA_SCAN to:
Added in the toa_graph.py file which can be used with the command in terminal:
python toa_graph.py toa_efficiencies.csv [i_roc] [ch]This file is intended to be good way to visualize if your data is actually following a linear fit, also can be useful to show if your data is not agreeing with the general "sharp S-curve" shape that we are expecting from TOA efficiency as calib increases. PLEASE NOTE: due to the new portion of the code that breaks after the first high efficiency TRIM_TOA value is found it will be visualized as a line of higher dots that then goes back down to 0, this just means that the scan stopped for this value. You can get far more complete understanding of how that channel is behaving if you remove line 173 of trim_toa_scan.cxx and then do a scan, however this will take significantly longer.
Added changes to the toa_vref scan to apply a TRIM_TOA value of 63 to so that its TOA_VREF value doesn't cause the collected data to dip back into the pedestal range once a TRIM_TOA value is applied. Also applied changes to the CHANNEL_WIDE_CALIB_SCAN to make it more efficient to run, by removing scanning over PHASE_CX and multiple bx values as this did not seem to affect any of the data created.