17#ifndef ROOFIT_ROOFITCORE_INC_BATCHDATA_H_
18#define ROOFIT_ROOFITCORE_INC_BATCHDATA_H_
58 elm.second.status =
kDirty;
74 void print(std::ostream& os,
const std::string&
indent)
const;
96 using Key_t = std::tuple<std::size_t, const RooArgSet* const, Tag_t>;
101 using Map_t = std::map<Key_t, Batch>;
static void indent(ostringstream &buf, int indent_level)
A class to store batches of data points that can be accessed via RooSpan.
bool setStatus(std::size_t begin, std::size_t size, Status_t stat, const RooArgSet *const normSet=nullptr, Tag_t ownerTag=kUnspecified)
Set the status of a batch with the given properties.
RooSpan< const double > getBatch(std::size_t begin, std::size_t maxSize, const RooArgSet *const normSet=nullptr, Tag_t ownerTag=kUnspecified) const
Retrieve an existing batch.
RooSpan< double > makeWritableBatchUnInit(std::size_t begin, std::size_t batchSize, const RooArgSet *const normSet=nullptr, Tag_t ownerTag=kUnspecified)
Make a batch and return a span pointing to the pdf-local memory.
void clear()
Discard all storage.
void print(std::ostream &os, const std::string &indent) const
Print to given output stream.
Status_t
Status of the batch.
std::tuple< std::size_t, const RooArgSet *const, Tag_t > Key_t
Key type of map that holds the batch storage.
RooSpan< const double > createSpanInsideExistingBatch(std::size_t begin, std::size_t batchSize, const RooArgSet *const normSet, Tag_t ownerTag) const
Create a span pointing to existing batch memory.
const std::vector< double > * _foreignData
Map_t::const_iterator findEnclosingBatch(std::size_t evt, const RooArgSet *const normSet, Tag_t ownerTag) const
Find the batch that contains the event with number evt.
void markDirty()
Mark all batches dirty. This will trigger recomputations.
Status_t status(std::size_t begin, const RooArgSet *const normSet=nullptr, Tag_t ownerTag=kUnspecified) const
Return the status of the batch starting at begin.
RooSpan< double > makeWritableBatchInit(std::size_t begin, std::size_t batchSize, double value, const RooArgSet *const normSet=nullptr, Tag_t ownerTag=kUnspecified)
Make a batch and return a span pointing to the pdf-local memory.
void attachForeignStorage(const std::vector< double > &vec)
Attach a foreign storage. Batches coming from this storage will be read only.
std::map< Key_t, Batch > Map_t
Storage for batch data.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
A simple container to hold a batch of data values.
std::vector< double > data
bool inBatch(std::size_t evt) const
RooSpan< const double > makeSpan(std::size_t evt, std::size_t batchSize) const