pub struct RuleSet { /* private fields */ }Expand description
A collection of selection rules for testing whether a two-body decay channel is allowed.
Each rule enables one conservation or symmetry check. Each enabled rule is associated with a
RulePolicy which dictates how permissively it should be applied to the given particles.
§Notes
The default angular policy doesn’t actually enforce any rules, as angular momentum conservation and coupling rules are handled by other methods.
All constructors assume a permissive enforcement policy, i.e. if a property is unknown for one or more particles involved, that check is skipped.
Implementations§
Source§impl RuleSet
impl RuleSet
Sourcepub fn angular() -> Self
pub fn angular() -> Self
Construct a rule set with no non-angular selection rules enabled.
This is useful when only the angular-momentum coupling constraints should
be applied:
$S \in |j_a - j_b|, \ldots, j_a + j_b$
and
$J \in |L - S|, \ldots, L + S$.
Sourcepub fn strong() -> Self
pub fn strong() -> Self
Construct a rule set appropriate for ordinary strong two-body decays.
This enables parity, isospin, isospin projection, electric charge, flavor quantum numbers, baryon number, and identical-particle exchange symmetry.
Charge-conjugation parity and G-parity are left disabled because they are only meaningful for certain channels and should be enabled explicitly when applicable.
Sourcepub fn electromagnetic() -> Self
pub fn electromagnetic() -> Self
Construct a rule set appropriate for electromagnetic two-body decays.
This enables parity, electric charge, flavor quantum numbers, baryon number, isospin-projection conservation, and identical-particle exchange symmetry.
Total isospin is not enabled because electromagnetic interactions break isospin symmetry.
Sourcepub fn weak() -> Self
pub fn weak() -> Self
Construct a rule set appropriate for weak two-body decays.
This enables electric charge, baryon number, individual lepton-family numbers, total lepton number, and identical-particle exchange symmetry.
Parity, isospin, strangeness, charm, bottomness, and topness are not enabled because weak interactions can violate or change them.
Sourcepub fn enforce_mut(&mut self, rule: RuleKind) -> &mut Self
pub fn enforce_mut(&mut self, rule: RuleKind) -> &mut Self
Enable a rule in place using permissive missing-input handling.
Sourcepub fn enforce_strict_mut(&mut self, rule: RuleKind) -> &mut Self
pub fn enforce_strict_mut(&mut self, rule: RuleKind) -> &mut Self
Enable a rule in place and reject candidates with missing inputs.
Sourcepub fn set_policy_mut(
&mut self,
rule: RuleKind,
policy: RulePolicy,
) -> &mut Self
pub fn set_policy_mut( &mut self, rule: RuleKind, policy: RulePolicy, ) -> &mut Self
Assign an explicit policy to a rule in place.
Sourcepub fn ignore_mut(
&mut self,
rule: RuleKind,
reason: impl Into<String>,
) -> &mut Self
pub fn ignore_mut( &mut self, rule: RuleKind, reason: impl Into<String>, ) -> &mut Self
Ignore a rule in place and record the supplied reason.
Sourcepub fn ignore_without_reason_mut(&mut self, rule: RuleKind) -> &mut Self
pub fn ignore_without_reason_mut(&mut self, rule: RuleKind) -> &mut Self
Ignore a rule in place without recording a reason.
Sourcepub fn diagnose_only_mut(
&mut self,
rule: RuleKind,
reason: impl Into<String>,
) -> &mut Self
pub fn diagnose_only_mut( &mut self, rule: RuleKind, reason: impl Into<String>, ) -> &mut Self
Make a rule diagnostic-only in place and record the supplied reason.
Sourcepub fn diagnose_only_without_reason_mut(&mut self, rule: RuleKind) -> &mut Self
pub fn diagnose_only_without_reason_mut(&mut self, rule: RuleKind) -> &mut Self
Make a rule diagnostic-only in place without recording a reason.
Sourcepub fn disable_mut(&mut self, rule: RuleKind) -> &mut Self
pub fn disable_mut(&mut self, rule: RuleKind) -> &mut Self
Remove a rule from this set in place.
Sourcepub fn with_unknown_policy_mut(
&mut self,
rule: RuleKind,
unknown: UnknownPolicy,
) -> &mut Self
pub fn with_unknown_policy_mut( &mut self, rule: RuleKind, unknown: UnknownPolicy, ) -> &mut Self
Change a rule’s missing-input policy in place.
The rule is enabled with RulePolicy::enforce if it was not already
configured.
Sourcepub fn enforce_strict(self, rule: RuleKind) -> Self
pub fn enforce_strict(self, rule: RuleKind) -> Self
Return a copy with a strictly enforced rule.
Sourcepub fn set_policy(self, rule: RuleKind, policy: RulePolicy) -> Self
pub fn set_policy(self, rule: RuleKind, policy: RulePolicy) -> Self
Return a copy with an explicit policy assigned to a rule.
Sourcepub fn ignore(self, rule: RuleKind, reason: impl Into<String>) -> Self
pub fn ignore(self, rule: RuleKind, reason: impl Into<String>) -> Self
Return a copy which ignores a rule for the supplied reason.
Sourcepub fn ignore_without_reason(self, rule: RuleKind) -> Self
pub fn ignore_without_reason(self, rule: RuleKind) -> Self
Return a copy which ignores a rule without recording a reason.
Sourcepub fn diagnose_only(self, rule: RuleKind, reason: impl Into<String>) -> Self
pub fn diagnose_only(self, rule: RuleKind, reason: impl Into<String>) -> Self
Return a copy which evaluates a rule only for diagnostics.
Sourcepub fn diagnose_only_without_reason(self, rule: RuleKind) -> Self
pub fn diagnose_only_without_reason(self, rule: RuleKind) -> Self
Return a copy which evaluates a rule only for diagnostics, without a reason.
Sourcepub fn with_unknown_policy(self, rule: RuleKind, unknown: UnknownPolicy) -> Self
pub fn with_unknown_policy(self, rule: RuleKind, unknown: UnknownPolicy) -> Self
Return a copy with the selected missing-input policy.
Sourcepub fn policy(&self, rule: RuleKind) -> Option<&RulePolicy>
pub fn policy(&self, rule: RuleKind) -> Option<&RulePolicy>
Retrieve the configured policy for a rule.
Sourcepub fn enabled_rules(&self) -> impl Iterator<Item = RuleKind> + '_
pub fn enabled_rules(&self) -> impl Iterator<Item = RuleKind> + '_
Iterate over the configured rules in stable RuleKind order.
Sourcepub fn check(
&self,
parent: &ParticleProperties,
daughters: (&ParticleProperties, &ParticleProperties),
l: L,
s: S,
) -> bool
pub fn check( &self, parent: &ParticleProperties, daughters: (&ParticleProperties, &ParticleProperties), l: L, s: S, ) -> bool
Return whether a two-body partial-wave candidate satisfies this rule set.
Sourcepub fn evaluate(
&self,
parent: &ParticleProperties,
daughters: (&ParticleProperties, &ParticleProperties),
l: L,
s: S,
) -> RuleReport
pub fn evaluate( &self, parent: &ParticleProperties, daughters: (&ParticleProperties, &ParticleProperties), l: L, s: S, ) -> RuleReport
Evaluate every configured rule and return a detailed report.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RuleSet
impl<'de> Deserialize<'de> for RuleSet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RuleSet
impl StructuralPartialEq for RuleSet
Auto Trait Implementations§
impl Freeze for RuleSet
impl RefUnwindSafe for RuleSet
impl Send for RuleSet
impl Sync for RuleSet
impl Unpin for RuleSet
impl UnsafeUnpin for RuleSet
impl UnwindSafe for RuleSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.