pub struct Dataset<F: Field + 'static> {
pub events: Arc<Vec<Event<F>>>,
}
Expand description
An array of Event
s with some helpful methods for accessing and parsing the data they
contain.
A Dataset
can be loaded from either Parquet and ROOT files using the corresponding
Dataset::from_*
methods. Events are stored in an Arc<Vec<Event>>
, since we
rarely need to write data to a dataset (splitting/selecting/rejecting events) but often need to
read events from a dataset.
Fields§
§events: Arc<Vec<Event<F>>>
Storage for events.
Implementations§
Source§impl<F: Field + 'static> Dataset<F>
impl<F: Field + 'static> Dataset<F>
Sourcepub fn weights_indexed(&self, indices: &[usize]) -> Vec<F>
pub fn weights_indexed(&self, indices: &[usize]) -> Vec<F>
Retrieves the weights from the events in the dataset which have the given indices.
Sourcepub fn split_m(
&self,
range: (F, F),
bins: usize,
daughter_indices: Option<Vec<usize>>,
) -> (Vec<Vec<usize>>, Vec<usize>, Vec<usize>)
pub fn split_m( &self, range: (F, F), bins: usize, daughter_indices: Option<Vec<usize>>, ) -> (Vec<Vec<usize>>, Vec<usize>, Vec<usize>)
Splits the dataset by the mass of the combination of specified daughter particles in the
event. If no daughters are given, the first and second particle are assumed to form the
desired combination. This method returns Vec<usize>
s corresponding to the indices of
events in each bin, the underflow bin, and the overflow bin respectively. This is intended
to be used in conjunction with
Manager::evaluate_indexed
.
Sourcepub fn from_parquet(
path: &str,
method: ReadMethod<F>,
) -> Result<Self, RustitudeError>
pub fn from_parquet( path: &str, method: ReadMethod<F>, ) -> Result<Self, RustitudeError>
Sourcepub fn from_root(
path: &str,
method: ReadMethod<F>,
) -> Result<Self, RustitudeError>
pub fn from_root( path: &str, method: ReadMethod<F>, ) -> Result<Self, RustitudeError>
Sourcepub fn get_bootstrap_indices(&self, seed: usize) -> Vec<usize>
pub fn get_bootstrap_indices(&self, seed: usize) -> Vec<usize>
Returns a set of indices which represent a bootstrapped Dataset
. This method is to be
used in conjunction with
Manager::evaluate_indexed
.
Sourcepub fn get_selected_indices(
&self,
query: impl Fn(&Event<F>) -> bool + Sync + Send,
) -> (Vec<usize>, Vec<usize>)
pub fn get_selected_indices( &self, query: impl Fn(&Event<F>) -> bool + Sync + Send, ) -> (Vec<usize>, Vec<usize>)
Selects indices of events in a dataset using the given query. Indices of events for which
the query returns true
will end up in the first member of the returned tuple, and indices
of events which return false
will end up in the second member.
Sourcepub fn get_binned_indices(
&self,
variable: impl Fn(&Event<F>) -> F + Sync + Send,
range: (F, F),
nbins: usize,
) -> (Vec<Vec<usize>>, Vec<usize>, Vec<usize>)
pub fn get_binned_indices( &self, variable: impl Fn(&Event<F>) -> F + Sync + Send, range: (F, F), nbins: usize, ) -> (Vec<Vec<usize>>, Vec<usize>, Vec<usize>)
Splits the dataset by the given query. This method returns Vec<usize>
s corresponding to
the indices of events in each bin, the underflow bin, and the overflow bin respectively.
This is intended to be used in conjunction with
Manager::evaluate_indexed
.
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Dataset<F>
impl<F> RefUnwindSafe for Dataset<F>where
F: RefUnwindSafe,
impl<F> Send for Dataset<F>
impl<F> Sync for Dataset<F>
impl<F> Unpin for Dataset<F>
impl<F> UnwindSafe for Dataset<F>where
F: RefUnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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.