pub enum Topology {
Full {
k1: P4Selection,
k2: P4Selection,
k3: P4Selection,
k4: P4Selection,
},
MissingK1 {
k2: P4Selection,
k3: P4Selection,
k4: P4Selection,
},
MissingK2 {
k1: P4Selection,
k3: P4Selection,
k4: P4Selection,
},
MissingK3 {
k1: P4Selection,
k2: P4Selection,
k4: P4Selection,
},
MissingK4 {
k1: P4Selection,
k2: P4Selection,
k3: P4Selection,
},
}Expand description
A reusable 2-to-2 reaction description shared by several kinematic variables.
A topology records the four canonical vertices $k_1 + k_2 \to k_3 + k_4$.
When one vertex is omitted, it is reconstructed by enforcing four-momentum
conservation, which is unambiguous in that frame. Use Topology::com_boost_vector
and the *_com helpers to access particles in the center-of-momentum frame.
k1 k3
╲ ╱
╭╮
╰╯
╱ ╲
k2 k4Note that variables are typically designed to use $k_1$ as the incoming beam, $k_2$ as a
target, $k_3$ as some resonance, and $k_4$ as the recoiling target particle, but this
notation should be extensible to any 2-to-2 reaction.
Variants§
Full
All four vertices are explicitly provided.
Fields
k1: P4SelectionFirst incoming vertex.
k2: P4SelectionSecond incoming vertex.
k3: P4SelectionFirst outgoing vertex.
k4: P4SelectionSecond outgoing vertex.
MissingK1
The first incoming vertex (k1) is reconstructed.
Fields
k2: P4SelectionSecond incoming vertex.
k3: P4SelectionFirst outgoing vertex.
k4: P4SelectionSecond outgoing vertex.
MissingK2
The second incoming vertex (k2) is reconstructed.
Fields
k1: P4SelectionFirst incoming vertex.
k3: P4SelectionFirst outgoing vertex.
k4: P4SelectionSecond outgoing vertex.
MissingK3
The first outgoing vertex (k3) is reconstructed.
Fields
k1: P4SelectionFirst incoming vertex.
k2: P4SelectionSecond incoming vertex.
k4: P4SelectionSecond outgoing vertex.
MissingK4
The second outgoing vertex (k4) is reconstructed.
Fields
k1: P4SelectionFirst incoming vertex.
k2: P4SelectionSecond incoming vertex.
k3: P4SelectionFirst outgoing vertex.
Implementations§
Source§impl Topology
impl Topology
Sourcepub fn new<K1, K2, K3, K4>(k1: K1, k2: K2, k3: K3, k4: K4) -> Self
pub fn new<K1, K2, K3, K4>(k1: K1, k2: K2, k3: K3, k4: K4) -> Self
Construct a topology with all four vertices explicitly defined.
Sourcepub fn missing_k1<K2, K3, K4>(k2: K2, k3: K3, k4: K4) -> Self
pub fn missing_k1<K2, K3, K4>(k2: K2, k3: K3, k4: K4) -> Self
Construct a topology when the first incoming vertex (k1) is omitted.
Sourcepub fn missing_k2<K1, K3, K4>(k1: K1, k3: K3, k4: K4) -> Self
pub fn missing_k2<K1, K3, K4>(k1: K1, k3: K3, k4: K4) -> Self
Construct a topology when the second incoming vertex (k2) is omitted.
Sourcepub fn missing_k3<K1, K2, K4>(k1: K1, k2: K2, k4: K4) -> Self
pub fn missing_k3<K1, K2, K4>(k1: K1, k2: K2, k4: K4) -> Self
Construct a topology when the first outgoing vertex (k3) is omitted.
Sourcepub fn missing_k4<K1, K2, K3>(k1: K1, k2: K2, k3: K3) -> Self
pub fn missing_k4<K1, K2, K3>(k1: K1, k2: K2, k3: K3) -> Self
Construct a topology when the second outgoing vertex (k4) is omitted.
Sourcepub fn bind(&mut self, metadata: &DatasetMetadata) -> LadduResult<()>
pub fn bind(&mut self, metadata: &DatasetMetadata) -> LadduResult<()>
Bind every vertex to dataset metadata so the particle names resolve to indices.
Sourcepub fn com_boost_vector(&self, event: &EventData) -> Vec3
pub fn com_boost_vector(&self, event: &EventData) -> Vec3
Return the velocity vector that boosts lab-frame momenta into the diagram’s center-of-momentum frame.
Sourcepub fn k1(&self, event: &EventData) -> Vec4
pub fn k1(&self, event: &EventData) -> Vec4
Convenience helper returning the beam four-momentum (k1).
Sourcepub fn k2(&self, event: &EventData) -> Vec4
pub fn k2(&self, event: &EventData) -> Vec4
Convenience helper returning the target four-momentum (k2).
Sourcepub fn k3(&self, event: &EventData) -> Vec4
pub fn k3(&self, event: &EventData) -> Vec4
Convenience helper returning the resonance four-momentum (k3).
Sourcepub fn k4(&self, event: &EventData) -> Vec4
pub fn k4(&self, event: &EventData) -> Vec4
Convenience helper returning the recoil four-momentum (k4).
Sourcepub fn k1_com(&self, event: &EventData) -> Vec4
pub fn k1_com(&self, event: &EventData) -> Vec4
Beam four-momentum (k1) expressed in the center-of-momentum frame.
Sourcepub fn k2_com(&self, event: &EventData) -> Vec4
pub fn k2_com(&self, event: &EventData) -> Vec4
Target four-momentum (k2) expressed in the center-of-momentum frame.
Sourcepub fn k3_com(&self, event: &EventData) -> Vec4
pub fn k3_com(&self, event: &EventData) -> Vec4
Resonance four-momentum (k3) expressed in the center-of-momentum frame.
Sourcepub fn k4_com(&self, event: &EventData) -> Vec4
pub fn k4_com(&self, event: &EventData) -> Vec4
Recoil four-momentum (k4) expressed in the center-of-momentum frame.
Sourcepub fn k1_names(&self) -> Option<&[String]>
pub fn k1_names(&self) -> Option<&[String]>
Returns the resolved names for k1 if it was explicitly provided.
Sourcepub fn k2_names(&self) -> Option<&[String]>
pub fn k2_names(&self) -> Option<&[String]>
Returns the resolved names for k2 if it was explicitly provided.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Topology
impl<'de> Deserialize<'de> for Topology
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>,
Auto Trait Implementations§
impl Freeze for Topology
impl RefUnwindSafe for Topology
impl Send for Topology
impl Sync for Topology
impl Unpin for Topology
impl UnwindSafe for Topology
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
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.