Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooFit::BatchModeDataHelpers Namespace Reference

Functions

std::map< RooFit::Detail::DataKey, RooSpan< const double > > getDataSpans (RooAbsData const &data, std::string_view rangeName, RooAbsCategory const *indexCat, std::stack< std::vector< double > > &buffers, bool skipZeroWeights)
 Extract all content from a RooFit datasets as a map of spans.
 

Function Documentation

◆ getDataSpans()

std::map< RooFit::Detail::DataKey, RooSpan< const double > > RooFit::BatchModeDataHelpers::getDataSpans ( RooAbsData const &  data,
std::string_view  rangeName,
RooAbsCategory const *  indexCat,
std::stack< std::vector< double > > &  buffers,
bool  skipZeroWeights 
)

Extract all content from a RooFit datasets as a map of spans.

Spans with the weights and squared weights will be also stored in the map, keyed with the names _weight and the _weight_sumW2. If the dataset is unweighted, these weight spans will only contain the single value 1.0. Entries with zero weight will be skipped.

Returns
A std::map with spans keyed to name pointers.
Parameters
[in]dataThe input dataset.
[in]rangeNameSelect only entries from the data in a given range (empty string for no range).
[in]indexCatIf not nullptr, each span is spit up by this category, with the new names prefixed by the category component name surrounded by underscores. For example, if you have a category with signal and control samples, the span for a variable x will be split in two spans _signal_x and _control_x.
[in]buffersPass here an empty stack of double vectors, which will be used as memory for the data if the memory in the dataset object can't be used directly (e.g. because you used the range selection or the splitting by categories).
[in]skipZeroWeightsSkip entries with zero weight when filling the data spans. Be very careful with enabling it, because the user might not expect that the batch results are not aligned with the original dataset anymore!

Definition at line 98 of file BatchModeDataHelpers.cxx.