pub struct PyEvent {
pub event: Event,
/* private fields */
}Expand description
A single event
Events are composed of a set of 4-momenta of particles in the overall center-of-momentum frame, optional auxiliary scalars (e.g. polarization magnitude or angle), and a weight.
§Parameters
p4s : list of Vec4
4-momenta of each particle in the event in the overall center-of-momentum frame
aux: list of float
Scalar auxiliary data associated with the event
weight : float
The weight associated with this event
p4_names : list of str, optional
Human-readable aliases for each four-momentum. Providing names enables name-based
lookups when evaluating variables.
aux_names : list of str, optional
Aliases for auxiliary scalars corresponding to aux.
aliases : dict of {str: str or liststr}, optional
Additional particle identifiers that reference one or more entries from p4_names.
§Examples
from laddu import Event, Vec3 # doctest: +SKIP event = Event( # doctest: +SKIP … [Vec3(0.0, 0.0, 1.0).with_mass(0.0), Vec3(0.0, 0.0, 1.0).with_mass(0.0)], … [], … 1.0, … p4_names=[‘kshort1’, ‘kshort2’], … aliases={‘pair’: [‘kshort1’, ‘kshort2’]}, … ) event.p4(‘pair’) # doctest: +SKIP Vec4(px=0.0, py=0.0, pz=2.0, e=2.0)
Fields§
§event: EventImplementations§
Trait Implementations§
Source§impl<'py> IntoPyObject<'py> for PyEvent
impl<'py> IntoPyObject<'py> for PyEvent
Source§type Output = Bound<'py, <PyEvent as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <PyEvent as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClassImpl for PyEvent
impl PyClassImpl for PyEvent
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// A single event
///
/// Events are composed of a set of 4-momenta of particles in the overall
/// center-of-momentum frame, optional auxiliary scalars (e.g. polarization magnitude or angle),
/// and a weight.
///
/// Parameters
/// ----------
/// p4s : list of Vec4
/// 4-momenta of each particle in the event in the overall center-of-momentum frame
/// aux: list of float
/// Scalar auxiliary data associated with the event
/// weight : float
/// The weight associated with this event
/// p4_names : list of str, optional
/// Human-readable aliases for each four-momentum. Providing names enables name-based
/// lookups when evaluating variables.
/// aux_names : list of str, optional
/// Aliases for auxiliary scalars corresponding to ``aux``.
/// aliases : dict of {str: str or list[str]}, optional
/// Additional particle identifiers that reference one or more entries from ``p4_names``.
///
/// Examples
/// --------
/// >>> from laddu import Event, Vec3 # doctest: +SKIP
/// >>> event = Event( # doctest: +SKIP
/// ... [Vec3(0.0, 0.0, 1.0).with_mass(0.0), Vec3(0.0, 0.0, 1.0).with_mass(0.0)],
/// ... [],
/// ... 1.0,
/// ... p4_names=['kshort1', 'kshort2'],
/// ... aliases={'pair': ['kshort1', 'kshort2']},
/// ... )
/// >>> event.p4('pair') # doctest: +SKIP
/// Vec4(px=0.0, py=0.0, pz=2.0, e=2.0)
///
const RAW_DOC: &'static CStr = /// A single event /// /// Events are composed of a set of 4-momenta of particles in the overall /// center-of-momentum frame, optional auxiliary scalars (e.g. polarization magnitude or angle), /// and a weight. /// /// Parameters /// ---------- /// p4s : list of Vec4 /// 4-momenta of each particle in the event in the overall center-of-momentum frame /// aux: list of float /// Scalar auxiliary data associated with the event /// weight : float /// The weight associated with this event /// p4_names : list of str, optional /// Human-readable aliases for each four-momentum. Providing names enables name-based /// lookups when evaluating variables. /// aux_names : list of str, optional /// Aliases for auxiliary scalars corresponding to ``aux``. /// aliases : dict of {str: str or list[str]}, optional /// Additional particle identifiers that reference one or more entries from ``p4_names``. /// /// Examples /// -------- /// >>> from laddu import Event, Vec3 # doctest: +SKIP /// >>> event = Event( # doctest: +SKIP /// ... [Vec3(0.0, 0.0, 1.0).with_mass(0.0), Vec3(0.0, 0.0, 1.0).with_mass(0.0)], /// ... [], /// ... 1.0, /// ... p4_names=['kshort1', 'kshort2'], /// ... aliases={'pair': ['kshort1', 'kshort2']}, /// ... ) /// >>> event.p4('pair') # doctest: +SKIP /// Vec4(px=0.0, py=0.0, pz=2.0, e=2.0) ///
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<PyEvent>
type ThreadChecker = SendablePyClass<PyEvent>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature for PyEvent
impl PyClassNewTextSignature for PyEvent
const TEXT_SIGNATURE: &'static str = "(p4s, aux, weight, *, p4_names=None, aux_names=None, aliases=None)"
Source§impl PyMethods<PyEvent> for PyClassImplCollector<PyEvent>
impl PyMethods<PyEvent> for PyClassImplCollector<PyEvent>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for PyEvent
impl PyTypeInfo for PyEvent
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
impl DerefToPyAny for PyEvent
impl ExtractPyClassWithClone for PyEvent
Auto Trait Implementations§
impl Freeze for PyEvent
impl RefUnwindSafe for PyEvent
impl Send for PyEvent
impl Sync for PyEvent
impl Unpin for PyEvent
impl UnwindSafe for PyEvent
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<'a, 'py, T> FromPyObject<'a, 'py> for T
impl<'a, 'py, T> FromPyObject<'a, 'py> for T
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<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
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.