Skip to content

RangePAllPID: do not load ROOT's default particle table (it changes the GENIE weights) - #690

Open
jzennamo wants to merge 1 commit into
developfrom
feature/jaz_rangep_fixed_masses
Open

jzennamo wants to merge 1 commit into
developfrom
feature/jaz_rangep_fixed_masses

Conversation

@jzennamo

Copy link
Copy Markdown
Contributor

Stops RangePAllPID from loading ROOT's default particle table, which changes the GENIE systematic weights computed later in the same process.

The bug: the RangePAllPID constructor read the muon and pion masses with TDatabasePDG::Instance()->GetParticle(). The first GetParticle() call loads ROOT's default pdg_table.txt into the process-wide particle database. GENIE shares that database, and when it later reads its own table the entries that already exist are kept. art builds modules in alphabetical order of their labels, so in the standard SBND CAF job pandoraTrackRange is built before systtools, and GENIE ReWeight then works with ROOT's particle properties: for example a Delta(1232) width of 0.120 GeV instead of GENIE's 0.117 GeV.

Size of the effect (SBND, sbndcode v10_26_00, BNB + cosmics): relative to the same weights computed in a process without this module, the CCRES and NCRES dials move by 1 to 3.5% of the weight for some neutrinos and the CCQE dials by about 1e-5. DIS and flux weights are not affected. The standard one-process CAF job is what production runs today.

The change: the two masses are constants, with the values the default table gave (0.105658 and 0.139570 GeV), and the TDatabasePDG include is gone.

Testing (library built against v10_26_00, one-process SBND CAF job on the same reco2 file, 10 events):

  • GENIE weights: identical to those from a job that runs the weights in their own process (all 263,760 weights). Adding only pandoraTrackRange to that separate process reproduces the unfixed one-process weights exactly, which confirms the mechanism.
  • Range momenta: identical to the unfixed job.
  • Side effect: eight truth-derived CAF branches (the fake_reco energies and parent_dcy_E) shift by a few parts per million (at most 8.6e-6), because CAFMaker looks up masses in the same shared database and now sees GENIE's table.
  • Every other CAF branch is identical to the unfixed job.
  • RangePAllPID_module.cc is identical in v10_26_00 and develop, so the tested file is the one in this PR. Not compiled on a develop build, and not run on ICARUS.

Things to know:

  • Other modules in sbncode also call TDatabasePDG::Instance() (for example CAFMaker's FillTrue and CalorimetryAnalysis). Any of them built before the event-weight module in a job has the same effect; this PR fixes the one that is in the standard SBND CAF path.
  • Which table is right for the weights is a question for the GENIE systematics experts. This PR makes the weights independent of which other modules happen to be in the job.

Context: found while preparing a fixed-seed comparison of the release against the menu of time, memory, and disk savings for the SBND Gen3 MC production (slides "Gen3 MC Production: Where the Time and Disk Go", Nov 2026), where the CAF stage runs as three processes and the weights disagreed with the one-process job.

🤖 Generated with Claude Code

The constructor read the muon and pion masses with TDatabasePDG::Instance()->GetParticle(). The first GetParticle() call loads ROOT's default pdg_table.txt into the process-wide particle database. GENIE shares that database, and when it later reads its own table the entries that already exist are kept. art builds modules in alphabetical order of their labels, so in the standard CAF job pandoraTrackRange is built before systtools, and GENIE ReWeight then works with ROOT's particle properties: Delta(1232) width 0.120 GeV instead of GENIE's 0.117 GeV. CCRES and NCRES weights move by 1 to 3.5%, CCQE weights by about 1e-5, relative to the same weights computed in a process without this module. The two masses are now constants with the values the default table gave, so the range momenta do not change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

1 participant