pub struct Dataset {
pub events: Vec<Arc<Event>>,
}Expand description
A collection of Events.
Fields§
§events: Vec<Arc<Event>>Implementations§
Source§impl Dataset
impl Dataset
Sourcepub fn index_local(&self, index: usize) -> &Event
pub fn index_local(&self, index: usize) -> &Event
Get a reference to the Event 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 just index into a Dataset
as if it were any other Vec:
let ds: Dataset = Dataset::new(events);
let event_0 = ds[0];Source§impl Dataset
impl Dataset
Sourcepub fn new_local(events: Vec<Arc<Event>>) -> Self
pub fn new_local(events: Vec<Arc<Event>>) -> Self
Create a new Dataset from a list of Events (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 n_events_local(&self) -> usize
pub fn n_events_local(&self) -> usize
The number of Events 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.
Source§impl Dataset
impl Dataset
Sourcepub fn weights_local(&self) -> Vec<Float> ⓘ
pub fn weights_local(&self) -> Vec<Float> ⓘ
Extract a list of weights over each Event 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 n_events_weighted_local(&self) -> Float
pub fn n_events_weighted_local(&self) -> Float
Returns the sum of the weights for each Event 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) -> Float
pub fn n_events_weighted(&self) -> Float
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) -> Arc<Dataset>
pub fn filter(&self, expression: &VariableExpression) -> 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: (Float, Float),
) -> BinnedDatasetwhere
V: Variable,
pub fn bin_by<V>(
&self,
variable: V,
bins: usize,
range: (Float, Float),
) -> BinnedDatasetwhere
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 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<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.