Repository navigation
[Gen2] CAF beam-quality fields: -999 for missing values (CAF default pattern) - #687
Merged
Merged
Conversation
CAF convention (review of SBNSoftware/sbnanaobj#201, #203): NaN is for a data member that was never set, -999 for one that was set to an invalid value. - makeSRBNBInfo() stores a missing FOM_best, tor_used, position, angle, width or bunch-rotation setting as -999 instead of NaN; a cut 0.98 < FOM_best <= 1 still rejects spills without a FOM. - update_flatcafs.py writes missing values as -999. - dump_bnb_quality.py reads -999 (and the NaN of flat CAFs updated before this change) as NaN, which the analysis tools use for "missing". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 10, 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.
Description
Follow-up to Gianluca's review of SBNSoftware/sbnanaobj#201 and #203. The CAF convention is that NaN marks a data member that was never set, and -999 one that was set to an invalid value. The beam-quality fields in the CAF now follow it.
makeSRBNBInfo()(CAFMaker/FillExposure.cxx): a missingFOM_best,tor_used, beam position, angle or width at the target, or bunch-rotation setting is stored as -999 instead of NaN. The input value -999 and non-finite inputs both count as missing.fom_source(-1),fom_statusandfom_versionare unchanged. A cut0.98 < FOM_best <= 1still rejects spills without a FOM.update_flatcafs.py: writes missing values as -999, as CAFMaker does.dump_bnb_quality.py: reads -999 in these fields as NaN, and also the NaN of flat CAFs updated by the earlier version. The analysis tools downstream (bnb_fom*.py,fom_fixups.py,neighbor_fill.py,logger_fill.py) keep using NaN internally and are unchanged.bunch_rotation.pydocstring are updated.The
spillbnbinfoof a record with no matching spill is left default-constructed (NaN): it was never set.Testing
production/sbnd-gen2head (larsoftv10_14_02_06; sbnobj, sbnanaobj, sbnalg and sbncode 10.14.02.10, with the companion PRs). No warnings, and the class-version checks pass.makeSRBNBInfo(): compiled stand-alone with-Wall -Wextra, no warnings. All checks pass for:BNBSpillInfo(input made before the beam-quality result): every field -999,fom_source-1,fom_version0;update_flatcafs.pyon the run 18490 BNBLight flat CAF (442 spills, 50 triggered), compared with the previous version's output:bnbinfoandspillbnbinfoare identical after NaN → -999, and no NaN is left;dump_bnb_quality.pyreads the new file and the old (NaN) file to the same values.Companions: SBNSoftware/sbnanaobj#208 and SBNSoftware/sbnobj#183. develop: SBNSoftware/sbnobj#184, SBNSoftware/sbnanaobj#209, #688.
Joseph Zennamo (with Claude Code)
🤖 Generated with Claude Code