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
Add Seltzer-Berger interactor and kernel #241
Add Seltzer-Berger interactor and kernel #241
Conversation
Looking for first round of reviews while documentation and test updated, and add Modified Tsai sampler for bremsstrahlung and pair-production. |
cutoffs_.energy(device_pointers_.ids.gamma), | ||
inc_energy_); | ||
gamma_exit_energy | ||
= Energy{gamma_exit_energy.value() * scale_xs(gamma_exit_energy)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block isn't quite right (although we'll need to use the constructor you've enumerated). The XsCorrector
needs to be used as part of the energy distribution, which I didn't implement because I didn't want to interfere with your ongoing work on the SB interactor 😬 . The XsCorrector should modify the energy distribution to be sampled from, rather than scaling the exiting energy as written here.
78dd506
to
b2f848d
Compare
Hope to have addressed most of the reviews. Will continue with remaining documentation and tests Monday. |
This commit adds the SB interactor and associated kernel method.
* Initialize `material_view` near where first used
* `migdal` as `constexpr`, and use integer multiplication to prevent float->double conversion
* Make type aliases `public` and add doxygen mark-up * Remove unused `energy_val_max_`
* Add ElementId class member to interactor and supply during instantiation of interactor in CUDA source * Remove assertion on minimum energy for interactor * Do not apply XS correction for positrons yet in interactor; to be integrated in energy distribution sampler * Remove `energy_val_min_` member from interactor (handled before interactor is constructed); instead, check incoming particle energy is sufficient to produce secondary at start of `operator()`
Used for sampling angular distributions in pair-production and bremsstrahlung processes (e.g. Seltzer-Berger and Bethe-Heitler models).
b2f848d
to
71a3b94
Compare
* Update class description and other comments * Remove photon angular sampler function (using instead common TsaiUrbanDistribution)
Sampled electron angle twice. Fixed to sample positron.
1e8fd0f
to
3e8470f
Compare
* Use native pointers/refs \todo Fix issue with min_gamma_energy <= 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite close to being ready to merge! The (mostly superficial) units issue is the only problem that I see for now.
@@ -149,34 +150,20 @@ CELER_FUNCTION Interaction BetheHeitlerInteractor::operator()(Engine& rng) | |||
real_type phi = sample_phi(rng); | |||
|
|||
// Electron | |||
real_type cost = this->sample_cos_theta(secondaries[0].energy.value(), rng); | |||
TsaiUrbanDistribution sample_electron_angle( | |||
secondaries[0].energy, units::MevMass{shared_.inv_electron_mass}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The units here are wrong but it looks like the quantity is right. The sampler and its G4ModifiedTsai counterpart both expect 1/(m_e c^2) so units of MevMassInv
, which you can define (for now, and I'd dprob put it in the TsaiUrbanDistribution
) as
using MevMassInv = Quantity<UnitDivide<CLightSq, Mev>>;
* Explicitly mark public of type aliases and doxygen
* EXPECT_VEC_SOFT_EQ for angle comparison with `double` type
* Store ratio energy [MeV] to mass [MevMass*c^2] instead of energy and mass separately
SB test still failing due to EDIT: Fixed, thanks to @sethrj. Finish test and wrap up tomorrow! |
* `gamma_secondary` -> `secondaries` (for consistency) * Assign secondary energy * normalize incident particle outgoing direction
* Finalize 'basic' test * Add 'stress' test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work Vince! Thanks for making it happen! 😄
A bit late to the party but we have it now! |
I'm gonna implement the positron XS correction; and then you can add the new Brems process. We shouldn't end up stepping on each other's changes. |
This commit adds the SB interactor and associated kernel method.