Skip to content

[develop] CAF beam-quality fields: -999 for missing values (CAF default pattern) - #688

Open
jzennamo wants to merge 1 commit into
feature/bnb-bunch-rotation-developfrom
fix/bnb-fom-defaults-develop
Open

jzennamo wants to merge 1 commit into
feature/bnb-bunch-rotation-developfrom
fix/bnb-fom-defaults-develop

Conversation

@jzennamo

Copy link
Copy Markdown
Contributor

develop version of #687 (same commit, cherry-picked). Stacked on #681 (feature/bnb-bunch-rotation-develop): it shows only this change. Merge it after that one, and retarget it to develop once that one is merged.

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 missing FOM_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_status and fom_version are unchanged. A cut 0.98 < FOM_best <= 1 still 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.
  • README and the bunch_rotation.py docstring are updated.

The spillbnbinfo of a record with no matching spill is left default-constructed (NaN): it was never set.

Testing

Built and tested on the Gen2 line (see #687). The cherry-pick onto develop applied with no conflicts; the develop branch itself was not built.

Companions: the PRs from branch fix/bnb-fom-defaults-develop in sbnobj, sbnanaobj and sbncode.

Joseph Zennamo (with Claude Code)

🤖 Generated with Claude Code

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>
(cherry picked from commit d2e6e13)

@PetrilloAtWork PetrilloAtWork left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me.

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