pub struct Dataset { /* private fields */ }Expand description
A collection of events with optional metadata for name-based lookups.
Implementations§
Source§impl Dataset
impl Dataset
Sourcepub fn events_local(&self) -> &[Event]
pub fn events_local(&self) -> &[Event]
Borrow locally stored events.
When MPI is enabled, this slice contains only the current rank’s event ownership.
Sourcepub fn events_global(&self) -> Vec<Event>
pub fn events_global(&self) -> Vec<Event>
Collect all events into a Vec using the default global iteration semantics.
When MPI is enabled, the returned vector is ordered like Dataset::iter and
may include remotely owned events fetched on demand.
Sourcepub fn iter(&self) -> DatasetIter<'_> ⓘ
pub fn iter(&self) -> DatasetIter<'_> ⓘ
Iterate over all events in the dataset. When MPI is enabled, this will visit every event across all ranks, fetching remote events on demand.
Sourcepub fn iter_global(&self) -> DatasetIter<'_> ⓘ
pub fn iter_global(&self) -> DatasetIter<'_> ⓘ
Alias for Dataset::iter.
This preserves dataset-wide ordering under MPI.
Sourcepub fn metadata(&self) -> &DatasetMetadata
pub fn metadata(&self) -> &DatasetMetadata
Borrow the dataset metadata used for name lookups.
Sourcepub fn metadata_arc(&self) -> Arc<DatasetMetadata>
pub fn metadata_arc(&self) -> Arc<DatasetMetadata>
Clone the internal metadata handle for external consumers (e.g., language bindings).
Sourcepub fn p4_index(&self, name: &str) -> Option<usize>
pub fn p4_index(&self, name: &str) -> Option<usize>
Resolve the index of a four-momentum by name.
Sourcepub fn aux_index(&self, name: &str) -> Option<usize>
pub fn aux_index(&self, name: &str) -> Option<usize>
Resolve the index of an auxiliary scalar by name.
Sourcepub fn named_event(&self, index: usize) -> LadduResult<Event>
pub fn named_event(&self, index: usize) -> LadduResult<Event>
Borrow event data together with metadata-based helpers as an Event view.
Sourcepub fn named_event_global(&self, index: usize) -> LadduResult<Event>
pub fn named_event_global(&self, index: usize) -> LadduResult<Event>
Alias for Dataset::named_event.
Sourcepub fn get_event(&self, index: usize) -> Option<Event>
pub fn get_event(&self, index: usize) -> Option<Event>
Retrieve a single event by index, returning None when out of range.
Sourcepub fn get_event_global(&self, index: usize) -> Option<Event>
pub fn get_event_global(&self, index: usize) -> Option<Event>
Alias for Dataset::get_event.
This preserves the default global indexing semantics under MPI.
Sourcepub fn event(&self, index: usize) -> LadduResult<Event>
pub fn event(&self, index: usize) -> LadduResult<Event>
Retrieve a single event by index.
Sourcepub fn event_global(&self, index: usize) -> LadduResult<Event>
pub fn event_global(&self, index: usize) -> LadduResult<Event>
Alias for Dataset::event.
This preserves the default global indexing semantics under MPI.
Sourcepub fn p4_by_name(&self, event_index: usize, name: &str) -> Option<Vec4>
pub fn p4_by_name(&self, event_index: usize, name: &str) -> Option<Vec4>
Retrieve a four-momentum by name for the event at event_index.
Sourcepub fn aux_by_name(&self, event_index: usize, name: &str) -> Option<f64>
pub fn aux_by_name(&self, event_index: usize, name: &str) -> Option<f64>
Retrieve an auxiliary scalar by name for the event at event_index.
Sourcepub fn for_each_named_event_local<F>(&self, op: F)
pub fn for_each_named_event_local<F>(&self, op: F)
Iterate over all local events as metadata-aware columnar views.
Sourcepub fn event_view(&self, event_index: usize) -> NamedEventView<'_>
pub fn event_view(&self, event_index: usize) -> NamedEventView<'_>
Retrieve a metadata-aware columnar event view by local index.
Sourcepub fn index_local(&self, index: usize) -> &Event
pub fn index_local(&self, index: usize) -> &Event
Get a reference to the EventData at the given index in the Dataset (non-MPI
version).
§Notes
This method is not intended to be called in analyses but rather in writing methods
that have mpi-feature-gated versions. Most users should use Dataset::event instead:
let ds: Dataset = Dataset::new(events);
let event_0 = ds.event(0)?;Source§impl Dataset
impl Dataset
Sourcepub fn new_local(
events: Vec<Arc<EventData>>,
metadata: Arc<DatasetMetadata>,
) -> Self
pub fn new_local( events: Vec<Arc<EventData>>, metadata: Arc<DatasetMetadata>, ) -> Self
Create a new Dataset from a list of EventData (non-MPI version).
§Notes
This method is not intended to be called in analyses but rather in writing methods
that have mpi-feature-gated versions. Most users should just call Dataset::new instead.
Sourcepub fn new_with_metadata(
events: Vec<Arc<EventData>>,
metadata: Arc<DatasetMetadata>,
) -> Self
pub fn new_with_metadata( events: Vec<Arc<EventData>>, metadata: Arc<DatasetMetadata>, ) -> Self
Create a dataset with explicit metadata for name-based lookups. Create a dataset with explicit metadata for name-based lookups.
Sourcepub fn n_events_local(&self) -> usize
pub fn n_events_local(&self) -> usize
The number of EventDatas in the Dataset (non-MPI version).
§Notes
This method is not intended to be called in analyses but rather in writing methods
that have mpi-feature-gated versions. Most users should just call Dataset::n_events instead.
Sourcepub fn n_events_global(&self) -> usize
pub fn n_events_global(&self) -> usize
Alias for Dataset::n_events.
This returns the global event count under MPI.
Source§impl Dataset
impl Dataset
Sourcepub fn weights_local(&self) -> Vec<f64>
pub fn weights_local(&self) -> Vec<f64>
Extract a list of weights over each EventData in the Dataset (non-MPI version).
§Notes
This method is not intended to be called in analyses but rather in writing methods
that have mpi-feature-gated versions. Most users should just call Dataset::weights instead.
Sourcepub fn weights_global(&self) -> Vec<f64>
pub fn weights_global(&self) -> Vec<f64>
Alias for Dataset::weights.
This returns the global weight vector in dataset order under MPI.
Sourcepub fn n_events_weighted_local(&self) -> f64
pub fn n_events_weighted_local(&self) -> f64
Returns the sum of the weights for each EventData in the Dataset (non-MPI version).
§Notes
This method is not intended to be called in analyses but rather in writing methods
that have mpi-feature-gated versions. Most users should just call Dataset::n_events_weighted instead.
Sourcepub fn n_events_weighted(&self) -> f64
pub fn n_events_weighted(&self) -> f64
Sourcepub fn n_events_weighted_global(&self) -> f64
pub fn n_events_weighted_global(&self) -> f64
Alias for Dataset::n_events_weighted.
This returns the global weighted event count under MPI.
Sourcepub fn bootstrap_local(&self, seed: usize) -> Arc<Dataset>
pub fn bootstrap_local(&self, seed: usize) -> Arc<Dataset>
Generate a new dataset with the same length by resampling the events in the original datset with replacement. This can be used to perform error analysis via the bootstrap method. (non-MPI version).
§Notes
This method is not intended to be called in analyses but rather in writing methods
that have mpi-feature-gated versions. Most users should just call Dataset::bootstrap instead.
Sourcepub fn bootstrap(&self, seed: usize) -> Arc<Dataset>
pub fn bootstrap(&self, seed: usize) -> Arc<Dataset>
Generate a new dataset with the same length by resampling the events in the original datset with replacement. This can be used to perform error analysis via the bootstrap method.
Sourcepub fn filter(
&self,
expression: &VariableExpression,
) -> LadduResult<Arc<Dataset>>
pub fn filter( &self, expression: &VariableExpression, ) -> LadduResult<Arc<Dataset>>
Filter the Dataset by a given VariableExpression, selecting events for which
the expression returns true.
Sourcepub fn bin_by<V>(
&self,
variable: V,
bins: usize,
range: (f64, f64),
) -> LadduResult<BinnedDataset>where
V: Variable,
pub fn bin_by<V>(
&self,
variable: V,
bins: usize,
range: (f64, f64),
) -> LadduResult<BinnedDataset>where
V: Variable,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dataset
impl RefUnwindSafe for Dataset
impl Send for Dataset
impl Sync for Dataset
impl Unpin for Dataset
impl UnsafeUnpin for Dataset
impl UnwindSafe for Dataset
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,
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<I, F> SumWithAccumulator<F> for Iwhere
I: IntoIterator<Item = F>,
impl<I, F> SumWithAccumulator<F> for Iwhere
I: IntoIterator<Item = F>,
Source§fn sum_with_accumulator<Acc>(self) -> Fwhere
Acc: SumAccumulator<F>,
F: Zero,
fn sum_with_accumulator<Acc>(self) -> Fwhere
Acc: SumAccumulator<F>,
F: Zero,
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.