Skip to content

Conversation

@whokion
Copy link
Contributor

@whokion whokion commented Dec 5, 2025

This MR adds gamma–nuclear cross sections (CHIPS) in the high-energy region.

@whokion whokion added enhancement New feature or request physics Particles, processes, and stepping algorithms labels Dec 5, 2025
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Test summary

  504 files    817 suites   26s ⏱️
1 323 tests 1 307 ✅ 14 💤 2 ❌
2 672 runs  2 660 ✅  8 💤 4 ❌

For more details on these failures, see this check.

Results for commit 724dfd1.

♻️ This comment has been updated with latest results.

@pcanal pcanal mentioned this pull request Dec 5, 2025
Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

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

Thanks @whokion .

Comment on lines 117 to 124
* Build CHIPS gamma-nuclear element cross sections using G4GammaNuclearXS
* above the upper energy limit of G4PARTICLEXS/gamma (IAEA) data. The cross
* sections are derived from the parameterization developed by M. V. Kossov
* (CERN/ITEP Moscow) in the high energy region (106 MeV < E < 50 GeV) and
* from a Reggeon-based parameterization in the ultra-high-energy region
* (E > 50 GeV). G4GammaNuclearXS uses CHIPS (G4PhotoNuclearCrossSection)
* above 150 MeV and performs linear interpolation between the upper energy
* limit of G4PARTICLEXS/gamma (IAEA) data and 150 MeV.
Copy link
Member

Choose a reason for hiding this comment

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

Our user/methods manual pulls in documentation only from the class documentation (in the .hh file): should we move this to the class docs where it's more visible? Does the Kossov citation have a reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I move the description to the header and add a citation for the CHIPS gamma-nuclear cross section parameterization in the doc - assume that I do not need to add the paper itself to zotero"

Copy link
Member

Choose a reason for hiding this comment

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

Zotero exports the bibliography entries into our references, so we do need it there, so I've added it myself. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

@whokion
Copy link
Contributor Author

whokion commented Dec 5, 2025

@sethrj Thanks a lot for your review and comments - will take care of them accordingly. Also, I find that there is a link error. Do you have any quick idea to resolve it or am I doing something wrong? Thanks again.

@sethrj
Copy link
Member

sethrj commented Dec 6, 2025

@whokion Thanks for the quick update. Regarding the link error: we support Geant4-free builds for fast CI testing and mini-apps on HPC platforms, so you'll need to add #if !CELERITAS_USE_G4 ... methods at the end of the EmExtraPhysicsHelper.hh file as is done with our other wrappers:

#if !CELERITAS_USE_GEANT4
inline GeantImporter::GeantImporter()
{
    CELER_NOT_CONFIGURED("Geant4");
}

inline GeantImporter::GeantImporter(GeantSetup&&)
{
    CELER_NOT_CONFIGURED("Geant4");
}

inline ImportData GeantImporter::operator()(DataSelection const&)
{
    CELER_ASSERT_UNREACHABLE();
}
#endif

Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

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

Looking good @whokion !

EmExtraPhysicsHelper();

// Calculate gamma-nuclear element cross section
double GammaNuclearElementXS(double energy, int z);
Copy link
Member

Choose a reason for hiding this comment

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

Since this is an interface class and not meant to plug in to existing Geant4 code, please use style and unit conventions from Celeritas:

XsMmSq calc_gamma_nuclear_xs(AtomicNumber z, MevEnergy energy) const;

Also, if you're going to reuse this for multiple XS types, it could be changed in the future to simply hold a G4VCrossSectionDataSet shared pointer, and be initialized with "GammaNuclearXS" or "PhotoNuclearXS" so that it can use G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(name) as the physics list constructors do.

And if you don't need max_high_energy below, then you could make this class a function-like DatasetMicroXsCalculator (or whatever) with an operator().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the method as suggested. Thanks for the additional recommendations! I will consider and take into account the suggestion when adding ElectroNuclearCrossSection and other features in following MRs.

// The maximum high energy of G4PhotoNuclearCrossSection
static constexpr double max_high_energy()
{
return 5e+4; // clhep::MeV
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to get this programmatically from Geant4? Or should this live in GammaNuclearModel?


private:
//// DATA ////
std::shared_ptr<EmExtraPhysicsHelper> helper_;
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't need to be class data; it should be constructed temporarily at load time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry that I did not fully get this suggestion. Thanks for clarification.

result.x.insert(result.x.end(), ultra.begin(), ultra.end());

// Tabulate the cross section from emin to emax
Quantity<UnitProduct<units::Millimeter, units::Millimeter>, double> xs;
Copy link
Member

Choose a reason for hiding this comment

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

You can make this a type alias inside the DatasetMicroXsCalculator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Move it to EmExtraPhysicsHelper for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request physics Particles, processes, and stepping algorithms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants