Skip to content

Spectral function for SBN - #461

Open
sjgardiner wants to merge 44 commits into
GENIE-MC:masterfrom
sjgardiner:gardiner/sf-sbn
Open

Spectral function for SBN#461
sjgardiner wants to merge 44 commits into
GENIE-MC:masterfrom
sjgardiner:gardiner/sf-sbn

Conversation

@sjgardiner

Copy link
Copy Markdown
Member

Adds the spectral function nuclear model, including 40Ar treatment based on recent JLab measurements. Also adds a variant of the AR23 configuration requested by SBN that uses the new spectral function.

Add unified QEL cross-section framework with hadron tensor infrastructure

Introduces a hadron-tensor-based formulation for quasi-elastic cross
section calculations, replacing direct amplitude evaluation with a
contraction of leptonic and hadronic tensors.

New components:
  - HadronTensorInterface(I) and Rank2LorentzTensorI: base classes for
    rank-2 Lorentz tensor manipulation and contraction. New we only
    implement the one body current. We will introduction two body
    currents and interference in the future.
  - LeptonTensor and ManualResponseTensor: leptonic and hadronic tensor
    implementations
  - UnifiedQELPXSec: tensor-contraction-based QEL cross-section algorithm
  - KellyELFormFactorsModel: Kelly parametrization of nucleon EM form
    factors, it is dipole model, new to GENIE
  - LwlynSmithFFEM: electromagnetic variant of the Llewellyn-Smith
    form-factor model
  - onebody_currents_sf: one-body current operators for spectral
    function calculations
  - Spectral function tables for 12C, 16O, and 40Ar (p/n)

Updates SpectralFunc to interface with the new framework, registers
new algorithms in master_config.xml and per-algorithm XML configs,
and adjusts Makefile and LinkDef entries for the new classes.
LiangLiu212 and others added 26 commits May 6, 2026 23:05
The change only rename the class of hadron tensor, add comments
In order to avoid use external Eigen library, implement the TensorUtil
to do hadron current. The implementation is done by claude, I do the
validate to make sure the agreement at machine precision.
This is a coercive fix to address inconsistencies between the advertised number of bins (200 on p, 400 on E) and maximum range
(2000 MeV on p, 500 MeV on E), and to bring p, E to be (presumed uniform) bin centres rather than bin edges.

The probabilities of the files have been preserved; this only changes the bins to be compatible with what
SpectralFunc assumes the format to be.
QE. A new QE vector form factor treatment (Kelly) is also added. A test
CMC called GTEST23_40a_00_000 allows easy access to the new features.
…plementation HadronTensorFortInterface, now interface is general enough so in future, new implementations for any language can be added
separates the SF nuclear model development from the Fortran-dependent
…rged

Feature/kplows tunes and fixes merged
  1. Remove deprecated (and now unused) helper function
  2. Mark two fatal error messages as pFATAL rather than just pERROR
  3. Free memory held by spectral function TH2Ds upon destruction (note
     that simply clearing the owned map does not do this automatically)
NewQELXSec when integrating the LwlynSmith and Nieves CCQE differential
cross sections. Using it leads to an unphysical discontinuity in the
cross-section splines.
@jtenavidal

Copy link
Copy Markdown
Contributor

I am testing this implementation for EM. I am attempting to generate the e-Carbon spline for MEC:

gmkspl -p 11 -t 1000060120 -n 30 -e 30 --tune AR23_20i_01_000 -o /pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/2026/SF//master-routine_validation_01-xsec_vA/e_on_1000060120_EMMEC.xml --event-generator-list EMMEC

This fails due to an uninitialized algorithm:
<AlgFactory.cxx::InstantiateAlgorithm (162)> : Failed instantiating algorithm = genie::NNBarOscDummyPXSec

You can find the full log here:
/pnfs/genie/persistent/users/jtenavid/e4nu_files/GENIE_Files/2026/SF//master-routine_validation_01-xsec_vA/output_run.info

Am I missing anything important for electrons? Do I need to change any configuration?

I am setting up the branch as is, without extra modifications.

Adding @dytman in the conversation

  - Add covariance matrix inputs under data/covariances/FormFactor/Axial/
    (Deuterium, LQCD v1 and updated, MINERvA elementary target, MINERvA
    Nature 2x2/4x4) and move the vector ELZExpFF.dat under
    FormFactor/Vector/; document the files and their sources in a Readme
  - Extend ZExpAxialFormFactorModel and ZExpELFormFactorModel to load the
    covariance matrices used by the reweighting machinery
  - Store importfile matrix elements at full precision in AlgConfigPool
    (std::to_string's fixed 6 decimals can flip a near-singular
    positive-definite covariance indefinite)
  - ZExpELFormFactorModel: hard-code the Gep(0)=1 / Gen(0)=0 charges and
    read the magnetic moments from the MagnMoments common parameter list
    instead of per-param_set QEL-G*0 entries
  - Add zexp axial param_sets: Deuterium PRD E-matrix default, minerva
    and lqcd fits from arXiv:2512.14097, minervaNature from Nature 614,48
    (lqcd carries the latest-version values with the v1 fit kept
    commented for reference)
Add covariance matrix support to the Z-expansion form factor models
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.

5 participants