|
remage
Simulation framework for HPGe-based experiments
|
Depth profile for displacing surface-sampled vertices into the material. More...
#include <RMGVertexConfinement.hh>
Public Types | |
| enum class | Type { kNone , kExponential , kTruncatedGaussian , kUniform } |
| Distribution type for the depth profile. More... | |
Public Member Functions | |
| double | Sample () const |
| Sample a depth value from the configured distribution. | |
| void | Validate () const |
| Validate the configured parameters, aborting with a fatal error on bad input. | |
Public Attributes | |
| Type | type = Type::kNone |
Distribution type. Defaults to kNone (no displacement). | |
| double | mean = 0 |
| Mean depth for the exponential and truncated-Gaussian distributions. | |
| double | sigma = 0 |
| Standard deviation for the truncated-Gaussian distribution. | |
| double | range_lo = 0 |
| Lower bound of the depth range for uniform and truncated-Gaussian distributions. | |
| double | range_hi = 0 |
| Upper bound of the depth range for uniform and truncated-Gaussian distributions. | |
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:
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.
|
strong |
Distribution type for the depth profile.
|
nodiscard |
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 if 10000 consecutive attempts all fall outside the range (mis-configured parameters).kUniform: uniform over [range_lo, range_hi].| void RMGVertexConfinement::DepthProfile::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 for kExponential; range_hi > range_lo >= 0 for kUniform; and additionally sigma > 0 for kTruncatedGaussian. Should be called once, before sampling starts. kNone always validates.
| double RMGVertexConfinement::DepthProfile::mean = 0 |
Mean depth for the exponential and truncated-Gaussian distributions.
For kExponential this is the sole parameter (1/λ). For kTruncatedGaussian it is the centre of the underlying Gaussian before truncation. Value is in Geant4 length units (mm by default).
| double RMGVertexConfinement::DepthProfile::range_hi = 0 |
Upper bound of the depth range for uniform and truncated-Gaussian distributions.
For kUniform: maximum sampled depth. For kTruncatedGaussian: values above this bound are rejected. Value is in Geant4 length units (mm by default).
| double RMGVertexConfinement::DepthProfile::range_lo = 0 |
Lower bound of the depth range for uniform and truncated-Gaussian distributions.
For kUniform: minimum sampled depth. For kTruncatedGaussian: values below this bound are rejected. Value is in Geant4 length units (mm by default).
| double RMGVertexConfinement::DepthProfile::sigma = 0 |
Standard deviation for the truncated-Gaussian distribution.
Only used when type is kTruncatedGaussian. Value is in Geant4 length units (mm by default).