Struct RMGVertexConfinement::DepthProfile¶
Defined in File RMGVertexConfinement.hh
Nested Relationships¶
This struct is a nested type of Class RMGVertexConfinement.
Struct Documentation¶
-
struct DepthProfile
Depth profile for displacing surface-sampled vertices into the material.
When surface sampling is enabled, an optional depth can be sampled from a statistical distribution. The vertex is then displaced inward from the surface by that depth along the outward surface normal, i.e.:
Three distributions are supported in addition to the default of no depth offset:vertex -= depth * solid->SurfaceNormal(vertex);
Exponential: physically motivated model for e.g. alpha/beta surface contamination, characterised by a mean implantation depth.
Truncated Gaussian: Gaussian distribution restricted to a finite range, suitable when a peak depth with physical cut-offs is needed.
Uniform: flat distribution over a user-defined range.
Note
The depth profile is applied in the local coordinate system of the solid before the global rotation and translation are applied. The sampled depth is clamped to the distance from the surface point to the far boundary along the inward normal (via
G4VSolid::DistanceToOut), so the displaced vertex can never cross to the other side of the solid or leave it. For thin volumes this means an over-large sampled depth is silently reduced; choose parameters consistent with the local thickness to keep the resulting depth distribution meaningful.Public Types
-
enum class Type
Distribution type for the depth profile.
See also
DepthProfile for a description of each type.
Values:
-
enumerator kNone
No depth profile: vertex remains on the surface.
-
enumerator kExponential
Exponential distribution parametrised by
mean.
-
enumerator kTruncatedGaussian
Gaussian distribution truncated to [
range_lo,range_hi].
-
enumerator kUniform
Uniform distribution over [
range_lo,range_hi].
-
enumerator kNone
Public Functions
-
double Sample() const
Sample a depth value from the configured distribution.
kNone:always returns 0.kExponential:inverse-CDF sampling from Exp(mean), all returned values ≥ 0.kTruncatedGaussian:Box-Muller Gaussian with rejection outside [range_lo,range_hi]. Aborts with a warning if10000consecutive attempts all fall outside the range (mis-configured parameters).kUniform:uniform over [range_lo,range_hi].
- Returns:
The sampled depth in Geant4 length units (mm by default).
-
void Validate() const
Validate the configured parameters, aborting with a fatal error on bad input.
Enforces the invariants each distribution needs for Sample to be well-defined:
mean> 0 forkExponential;range_hi> range_lo >= 0 forkUniform; and additionallysigma> 0 forkTruncatedGaussian. Should be called once, before sampling starts.kNonealways validates.
Public Members
-
double mean = 0
Mean depth for the exponential and truncated-Gaussian distributions.
For
kExponentialthis is the sole parameter (1/λ). ForkTruncatedGaussianit is the centre of the underlying Gaussian before truncation. Value is in Geant4 length units (mm by default).
-
double sigma = 0
Standard deviation for the truncated-Gaussian distribution.
Only used when
typeiskTruncatedGaussian. Value is in Geant4 length units (mm by default).
-
double range_lo = 0
Lower bound of the depth range for uniform and truncated-Gaussian distributions.
For
kUniform:minimum sampled depth. ForkTruncatedGaussian:values below this bound are rejected. Value is in Geant4 length units (mm by default).
-
double range_hi = 0
Upper bound of the depth range for uniform and truncated-Gaussian distributions.
For
kUniform:maximum sampled depth. ForkTruncatedGaussian:values above this bound are rejected. Value is in Geant4 length units (mm by default).