Add CutGaussian distribution type#1312
Open
cemitch99 wants to merge 11 commits intoBLAST-ImpactX:developmentfrom
Open
Add CutGaussian distribution type#1312cemitch99 wants to merge 11 commits intoBLAST-ImpactX:developmentfrom
cemitch99 wants to merge 11 commits intoBLAST-ImpactX:developmentfrom
Conversation
cemitch99
commented
Feb 20, 2026
Comment on lines
+124
to
+129
| // factors determined by the first cutoff value: | ||
| f = m_cutX*m_cutX/2.0_prt; | ||
| ef = std::exp(-f); | ||
| r2scale = 1_prt - f*ef/(1_prt - ef); | ||
| r2 = -2_prt * std::log(1_prt - u1*(1_prt - ef)); | ||
| ln1 = std::sqrt(r2 / r2scale); |
Member
Author
There was a problem hiding this comment.
These lines (and the corresponding lines in the code blocks below) define the effect of the cutoff. As cutX -> infinity, this reduces to the Box-Mueller transformation defining the parameter ln1 that appears in Gaussian.H.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a new initial particle distribution type,
CutGaussian, that is similar to a 6D Gaussian, but it allows the user to specify an independent cutoff in each phase plane(x,px),(y,py), and(t,pt). The cut is performed in normalized Courant-Snyder variables corresponding to the user-supplied second moments or Twiss functions. As a result, this is equivalent to a cut corresponding to the (linearized) action in each plane.If the user would like to apply a circular or elliptical cut in the
(x,y)plane, this is more appropriately done using theApertureelement, which represents the effect of a transverse mask.The PR addresses Issue #1253