Struct Dataset

Source
pub struct Dataset {
    pub events: Vec<Arc<Event>>,
}
Expand description

A collection of Events.

Fields§

§events: Vec<Arc<Event>>

The Events contained in the Dataset

Implementations§

Source§

impl Dataset

Source

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

Source

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.

Source

pub fn new(events: Vec<Arc<Event>>) -> Self

Create a new Dataset from a list of Events.

This method is prefered for external use because it contains proper MPI construction methods. Constructing a Dataset manually is possible, but may cause issues when interfacing with MPI and should be avoided unless you know what you are doing.

Source

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

pub fn n_events(&self) -> usize

The number of Events in the Dataset.

Source§

impl Dataset

Source

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.

Source

pub fn weights(&self) -> Vec<Float>

Extract a list of weights over each Event in the Dataset.

Source

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.

Source

pub fn n_events_weighted(&self) -> Float

Returns the sum of the weights for each Event in the Dataset.

Source

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.

Source

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.

Source

pub fn filter(&self, expression: &VariableExpression) -> Arc<Dataset>

Filter the Dataset by a given VariableExpression, selecting events for which the expression returns true.

Source

pub fn bin_by<V>( &self, variable: V, bins: usize, range: (Float, Float), ) -> BinnedDataset
where V: Variable,

Bin a Dataset by the value of the given Variable into a number of bins within the given range.

Source

pub fn boost_to_rest_frame_of<T: AsRef<[usize]> + Sync>( &self, indices: T, ) -> Arc<Dataset>

Boost all the four-momenta in all Events to the rest frame of the given set of four-momenta by indices.

Source

pub fn evaluate<V: Variable>(&self, variable: &V) -> Vec<Float>

Evaluate a Variable on every event in the Dataset.

Trait Implementations§

Source§

impl Add<&Dataset> for &Dataset

Source§

type Output = Dataset

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Dataset) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&Dataset> for Dataset

Source§

type Output = Dataset

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Dataset) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Dataset> for &Dataset

Source§

type Output = Dataset

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Dataset) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for Dataset

Source§

type Output = Dataset

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Dataset) -> Self::Output

Performs the + operation. Read more
Source§

impl Clone for Dataset

Source§

fn clone(&self) -> Dataset

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Dataset

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Dataset

Source§

fn default() -> Dataset

Returns the “default value” for a type. Read more
Source§

impl Index<usize> for Dataset

Source§

type Output = Event

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,