-
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
Open
whokion
wants to merge
16
commits into
celeritas-project:develop
Choose a base branch
from
whokion:gamma-nuclear-xs
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0b03511
Add EmExtraPhysicsHelper to wrap cross-section calculations from G4Ga…
03d7de4
Add EmExtraPhysicsHelper
010c135
Includes CHIPS-based gamma–nuclear cross sections for the high-energy…
478b0c4
Use a common reals backend array for both cross-section grids
14a0346
Use a common reals backend array for both cross-section grids
08bb48a
Use VectorUtils::geomspace to construct the logarithmic energy binnin…
e0f940a
Add citation for the CHIPS gamma–nuclear cross-section model
998495f
Update for changes in data
f5d821e
Address more review comments and suggestions from Seth
c43607d
Fix CELERITAS_USE_GEANT4 addition
2cdb77c
Add a missing definition for CELERITAS_USE_GEANT4
7007577
Fix compilation error related to return type
7bc64ab
Fix compilation error related to return type
bb5df6c
Fix compilation error related to return type
8d3c5ae
ix incorrect syntax with ()
724dfd1
Fix compilation error related to unused-parameter
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| //------------------------------- -*- 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. | ||
| */ | ||
| auto EmExtraPhysicsHelper::calc_gamma_nuclear_xs(AtomicNumber z, | ||
| MevEnergy energy) const | ||
| -> MmSqXs | ||
| { | ||
| MmSqXs xs; | ||
| xs.value() = gn_xs_->ElementCrossSection(energy.value(), z.get()); | ||
| return xs; | ||
| } | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| } // namespace celeritas |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| //------------------------------- -*- 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> | ||
|
|
||
| #include "corecel/Config.hh" | ||
|
|
||
| #include "corecel/math/Quantity.hh" | ||
| #include "corecel/math/UnitUtils.hh" | ||
| #include "celeritas/Quantities.hh" | ||
| #include "celeritas/UnitTypes.hh" | ||
| #include "celeritas/phys/AtomicNumber.hh" | ||
|
|
||
| class G4GammaNuclearXS; | ||
|
|
||
| namespace celeritas | ||
| { | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * A helper class for interfacing with Geant4 cross section calculations and | ||
| * other properties. | ||
| * | ||
| * This class primarily severs as a wrapper around Geant4 cross section | ||
| * calculation methods, which are not directly accessible from Celeritas EM | ||
| * physics models. Use of this class requires CELERITAS_USE_GEANT4 to be | ||
| * enabled. | ||
| */ | ||
| class EmExtraPhysicsHelper | ||
| { | ||
| public: | ||
| //!@{ | ||
| using MevEnergy = units::MevEnergy; | ||
| using MmSqXs | ||
| = Quantity<UnitProduct<units::Millimeter, units::Millimeter>, double>; | ||
| //!@} | ||
|
|
||
| public: | ||
| // Construct EM extra physics helper | ||
| EmExtraPhysicsHelper(); | ||
|
|
||
| // Calculate gamma-nuclear element cross section | ||
| MmSqXs calc_gamma_nuclear_xs(AtomicNumber z, MevEnergy energy) const; | ||
|
|
||
| private: | ||
| //// DATA //// | ||
| std::shared_ptr<G4GammaNuclearXS> gn_xs_; | ||
| }; | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| // INLINE DEFINITIONS | ||
| //---------------------------------------------------------------------------// | ||
|
|
||
| #if !CELERITAS_USE_GEANT4 | ||
| inline EmExtraPhysicsHelper::EmExtraPhysicsHelper() | ||
| { | ||
| CELER_NOT_CONFIGURED("Geant4"); | ||
| } | ||
|
|
||
| inline EmExtraPhysicsHelper::MmSqXs | ||
| EmExtraPhysicsHelper::calc_gamma_nuclear_xs(AtomicNumber, MevEnergy) const | ||
| { | ||
| CELER_ASSERT_UNREACHABLE(); | ||
| } | ||
|
|
||
| #endif | ||
|
|
||
| //---------------------------------------------------------------------------// | ||
| } // namespace celeritas |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.