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 const &rangeName, RooSimultaneous const *simPdf, bool skipZeroWeights, bool takeGlobalObservablesFromData, std::stack< std::vector< double > > &buffers)
 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 const &  rangeName,
RooSimultaneous const *  simPdf,
bool  skipZeroWeights,
bool  takeGlobalObservablesFromData,
std::stack< std::vector< double > > &  buffers 
)

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. If the input dataset is a RooDataHist, the output map will also contain an item for the key _bin_volume with the bin volumes.

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]simPdfA simultaneous pdf to use as a guide for splitting the dataset. The spans from each channel data will be prefixed with the channel name.
[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!
[in]takeGlobalObservablesFromDataTake also the global observables stored in the dataset.
[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).

Definition at line 220 of file BatchModeDataHelpers.cxx.