Removal of code duplication for charge computation in trr_test_suite#244
Merged
jlenain merged 6 commits intocta-observatory:mainfrom Dec 17, 2025
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #244 +/- ##
==========================================
+ Coverage 51.71% 52.00% +0.29%
==========================================
Files 80 80
Lines 6774 6713 -61
==========================================
- Hits 3503 3491 -12
+ Misses 3271 3222 -49 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3a1d7bb to
3753dc6
Compare
Collaborator
jlenain
reviewed
Dec 15, 2025
Collaborator
|
Thanks a lot also for the comparison before/after, @pcorcam, I think this is really compelling! |
jlenain
reviewed
Dec 16, 2025
jlenain
approved these changes
Dec 17, 2025
alessandromontanari
pushed a commit
to alessandromontanari/nectarchain
that referenced
this pull request
Jan 27, 2026
cta-observatory#244) * make sure the logging only happens when the container is succesfully loaded * change to standard ChargesComponent in LinearityTestTool * update usage of LinearityTestTool * remove duplication of ChargeContainer and ChargeComponent * small correction in output path for pedestal file * Avoid using the same hardcoded value defined in several places. --------- Co-authored-by: jlenain <jlenain@in2p3.fr>
This was referenced Feb 9, 2026
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.
Removes code duplication in the
trr_test_suiteregarding the charge computation. More specifically:ChargeContainerandChargeCompare removed fromtrr_test_suite/tools_components.py;ChargesComponent(makers/components/charges_components.py) is now the component in theLinearityTestTool(trr_test_suite/tools_components.py);trr_test_suite/linearity.pyhas been adapted accordingly - pedestals are precomputed with the standardPedestalNectarCAMCalibrationTooland its output is fed to theChargesComponentin theLinearityTestTool.A crosscheck was performed to test the compatibility of both charge-extraction methods. The parameters:
run_number = 6954max_events = 500window_width = 16window_shift = 6ChargesComponent:method=LocalPeakWindowSumPedestalNectarCAMCalibrationToolwith parameters:max_events = 12000events_per_slice = 5000method = FullWaveFormSumfilter_method = NoneWe find good agreement between the two charge-extraction methods (see figures below); the relative difference is on average$\mu = 0.0045$ % with a standard deviation $\sigma = 0.5335$ %.
Note that there is still quite some code duplication regarding charge computation in
trr_test_suite/tools_components.py, notably inToMComp. This will be tackled in a future PR.