-
Notifications
You must be signed in to change notification settings - Fork 45
Add CHIPS gamma-nuclear cross sections #2149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 3 commits
0b03511
03d7de4
010c135
478b0c4
14a0346
08bb48a
e0f940a
998495f
f5d821e
c43607d
2cdb77c
7007577
7bc64ab
bb5df6c
8d3c5ae
724dfd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| #include "GammaNuclearModel.hh" | ||
|
|
||
| #include "corecel/math/Quantity.hh" | ||
| #include "celeritas/g4/EmExtraPhysicsHelper.hh" | ||
| #include "celeritas/global/CoreParams.hh" | ||
| #include "celeritas/global/CoreState.hh" | ||
| #include "celeritas/grid/NonuniformGridInserter.hh" | ||
|
|
@@ -32,6 +33,8 @@ GammaNuclearModel::GammaNuclearModel(ActionId id, | |
|
|
||
| HostVal<GammaNuclearData> data; | ||
|
|
||
| helper_ = std::make_shared<EmExtraPhysicsHelper>(); | ||
|
|
||
| // Save IDs | ||
| data.scalars.gamma_id = particles.find(pdg::gamma()); | ||
|
|
||
|
|
@@ -43,13 +46,24 @@ GammaNuclearModel::GammaNuclearModel(ActionId id, | |
| CELER_EXPECT(data.scalars); | ||
|
|
||
| // Load gamma-nuclear element cross section data | ||
| NonuniformGridInserter insert_micro_xs{&data.reals, &data.micro_xs}; | ||
| NonuniformGridInserter insert_micro_xs_iaea{&data.reals_iaea, | ||
| &data.micro_xs_iaea}; | ||
| NonuniformGridInserter insert_micro_xs_chips{&data.reals_chips, | ||
| &data.micro_xs_chips}; | ||
|
|
||
| double const emax = data.scalars.max_valid_energy().value(); | ||
| for (auto el_id : range(ElementId{materials.num_elements()})) | ||
| { | ||
| AtomicNumber z = materials.get(el_id).atomic_number(); | ||
| insert_micro_xs(load_data(z)); | ||
| // Build element cross sections from G4PARTICLEXS | ||
| insert_micro_xs_iaea(load_data(z)); | ||
|
|
||
| // Build element cross sections above the upper bound of G4PARTICLEXS | ||
| double emin = data.reals_iaea[data.micro_xs_iaea[el_id].grid.back()]; | ||
| insert_micro_xs_chips(this->calc_chips_xs(z, emin, emax)); | ||
| } | ||
| CELER_ASSERT(data.micro_xs.size() == materials.num_elements()); | ||
| CELER_ASSERT(data.micro_xs_iaea.size() == materials.num_elements()); | ||
| CELER_ASSERT(data.micro_xs_iaea.size() == data.micro_xs_chips.size()); | ||
|
|
||
| // Move to mirrored data, copying to device | ||
| data_ = CollectionMirror<GammaNuclearData>{std::move(data)}; | ||
|
|
@@ -98,5 +112,64 @@ void GammaNuclearModel::step(CoreParams const&, CoreStateDevice&) const | |
| } | ||
| #endif | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * 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. | ||
|
||
| */ | ||
| GammaNuclearModel::result_type | ||
| GammaNuclearModel::calc_chips_xs(AtomicNumber atomic_number, | ||
| double emin, | ||
| double emax) const | ||
| { | ||
| CELER_EXPECT(atomic_number); | ||
|
|
||
| result_type result; | ||
|
|
||
| // Tabulate cross sections using separate parameterizations for the high | ||
| // energy region (emin < E < 50 GeV) and the ultra high energy region up | ||
| // to the maximum valid energy (emax). The numbers of bins are chosen to | ||
| // adequately capture both the parameterized points (224 bins from 106 MeV | ||
| // to 50 GeV) and the calculations used in G4PhotoNuclearCrossSection, | ||
| // which can be made configurable if needed (TODO). Note that the linear | ||
| // interpolation between the upper limit of the IAEA cross-section data | ||
| // and 150 MeV, as used in G4GammaNuclearXS, is also included in this | ||
| // tabulation. | ||
| double const emid = helper_->max_high_energy(); | ||
| size_type nbin_high = 250; | ||
| size_type nbin_ultra = 50; | ||
|
|
||
| result.x.resize(nbin_high + nbin_ultra); | ||
| result.y.resize(nbin_high + nbin_ultra); | ||
|
|
||
| // Bin sizes in logarithmic energy scale | ||
| double const de_high = (std::log(emid) - std::log(emin)) / (nbin_high - 1); | ||
| double const de_ultra = (std::log(emax) - std::log(emid)) | ||
| / (nbin_ultra - 1); | ||
sethrj marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| // Tabulate the cross section from emin to emax | ||
| MmSqMicroXs xs; | ||
| for (size_type i = 0; i < nbin_high + nbin_ultra; ++i) | ||
| { | ||
| double energy | ||
| = (i < nbin_high) | ||
| ? std::exp(std::log(emin) + de_high * i) | ||
| : std::exp(std::log(emid) + de_ultra * (i - nbin_high + 1)); | ||
|
|
||
| result.x[i] = energy; | ||
| xs.value() | ||
| = helper_->GammaNuclearElementXS(energy, atomic_number.get()); | ||
sethrj marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| result.y[i] = native_value_to<BarnXs>(native_value_from(xs)).value(); | ||
| } | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| } // namespace celeritas | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| //------------------------------- -*- C++ -*- -------------------------------// | ||
| // Copyright Celeritas contributors: see top-level COPYRIGHT file for details | ||
| // SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
| //---------------------------------------------------------------------------// | ||
| //! \file celeritas/g4/EmExtraPhysicsHelper.cc | ||
| //---------------------------------------------------------------------------// | ||
| #include "EmExtraPhysicsHelper.hh" | ||
|
|
||
| #include <G4GammaNuclearXS.hh> | ||
|
|
||
| namespace celeritas | ||
| { | ||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Construct with Geant4 provided cross section classes | ||
| */ | ||
| EmExtraPhysicsHelper::EmExtraPhysicsHelper() | ||
| { | ||
| gn_xs_ = std::make_shared<G4GammaNuclearXS>(); | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Calculate the gamma-nuclear element cross section using G4GammaNuclearXS | ||
| * in the native Geant4 unit [mb] | ||
| */ | ||
| double EmExtraPhysicsHelper::GammaNuclearElementXS(double energy, int z) | ||
| { | ||
| return gn_xs_->ElementCrossSection(energy, z); | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| } // namespace celeritas |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| //------------------------------- -*- C++ -*- -------------------------------// | ||
| // Copyright Celeritas contributors: see top-level COPYRIGHT file for details | ||
| // SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
| //---------------------------------------------------------------------------// | ||
| //! \file celeritas/g4/EmExtraPhysicsHelper.hh | ||
| //---------------------------------------------------------------------------// | ||
| #pragma once | ||
|
|
||
| #include <memory> | ||
|
|
||
| class G4GammaNuclearXS; | ||
|
|
||
| namespace celeritas | ||
| { | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * A helper class to interface with Geant4 cross sections. | ||
sethrj marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| */ | ||
| class EmExtraPhysicsHelper | ||
| { | ||
| public: | ||
| // Construct EM extra physics helper | ||
| EmExtraPhysicsHelper(); | ||
|
|
||
| // Calculate gamma-nuclear element cross section | ||
| double GammaNuclearElementXS(double energy, int z); | ||
|
||
|
|
||
| // The maximum high energy of G4PhotoNuclearCrossSection | ||
| static constexpr double max_high_energy() | ||
| { | ||
| return 5e+4; // clhep::MeV | ||
|
||
| } | ||
|
|
||
| private: | ||
| //// DATA //// | ||
| std::shared_ptr<G4GammaNuclearXS> gn_xs_; | ||
| }; | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| } // namespace celeritas | ||
Uh oh!
There was an error while loading. Please reload this page.