pub struct WriteNTuples { /* private fields */ }Implementations§
Source§impl WriteNTuples
impl WriteNTuples
Sourcepub fn create<P: AsRef<Path>>(filename: P) -> Option<WriteNTuples>
pub fn create<P: AsRef<Path>>(filename: P) -> Option<WriteNTuples>
This function creates a new write-only ntuple file filename for ntuples of size size and returns a pointer to the newly created ntuple struct. Any existing file with the same name is truncated to zero length and overwritten. A pointer to memory for the current ntuple row ntuple_data must be supplied-this is used to copy ntuples in and out of the file.
Source§impl WriteNTuples
impl WriteNTuples
Sourcepub fn project<T: Sized, V: Fn(&T) -> f64, S: Fn(&T) -> bool>(
&self,
h: &mut Histogram,
value_func: V,
select_func: S,
) -> Result<(), Value>
pub fn project<T: Sized, V: Fn(&T) -> f64, S: Fn(&T) -> bool>( &self, h: &mut Histogram, value_func: V, select_func: S, ) -> Result<(), Value>
This function updates the histogram h from the ntuple ntuple using the functions
value_func and select_func. For each ntuple row where the selection function
select_func is non-zero the corresponding value of that row is computed using the function
value_func and added to the histogram. Those ntuple rows where select_func returns
false are ignored. New entries are added to the histogram, so subsequent calls can be used
to accumulate further data in the same histogram.