Logo ROOT  
Reference Guide
RooFit::BatchModeDataHelpers Namespace Reference


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

Function Documentation

◆ getDataSpans()

std::map< RooFit::Detail::DataKey, RooSpan< const double > > RooFit::BatchModeDataHelpers::getDataSpans ( RooAbsData const &  data,
std::string_view  rangeName,
std::string const &  prefix,
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.

A std::map with spans keyed to name pointers.
[in]dataThe input dataset.
[in]rangeNameSelect only entries from the data in a given range (empty string for no range).
[in]prefixA string prefix to use for all key names for the data map.
[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 44 of file BatchModeDataHelpers.cxx.