42using std::map, std::list, std::string;
118 const char* cutRange, std::size_t
nStart, std::size_t
nStop)
127 auto out = std::make_unique<RooCompositeDataStore>(
name, title,
varsNoIndex, *
_indexCat, std::map<std::string,RooAbsDataStore*>{});
153 out->_ownComps =
true;
178 sum+=
item.second->sumEntries() ;
194 if (idx>=(
offset+
item.second->numEntries())) {
250 if (
item.second->isWeighted())
return true ;
260 throw(std::runtime_error(
"RooCompositeDataSore::loadValues() NOT IMPLEMENTED")) ;
276 coutE(InputArguments) <<
"RooCompositeDataStore::changeObservableName(" <<
GetName() <<
" no observable " << from <<
" in this dataset" << std::endl ;
286 ret |=
item.second->changeObservableName(from,to) ;
315 throw string(
"RooCompositeDataStore::merge() is not implemented yet") ;
327 for (
int i=0 ; i<nevt ; i++) {
341 n +=
item.second->numEntries() ;
354 item.second->reset() ;
377 item.second->resetBuffers();
387 std::cout <<
"RooCompositeDataStore::dump()" << std::endl ;
389 std::cout <<
"state number " <<
item.first <<
" has store " <<
item.second->ClassName() <<
" with variables " << *
item.second->get() ;
390 if (
item.second->isWeighted()) std::cout <<
" and is weighted " ;
391 std::cout << std::endl ;
420 const auto n =
static_cast<std::size_t
>(
numEntries());
434 std::vector<std::pair<RooAbsReal const *, std::vector<double> *>>
realCols;
435 std::vector<std::pair<RooAbsCategory const *, std::vector<RooAbsCategory::value_type> *>>
catCols;
449 for (std::size_t i = 0; i <
n; ++i) {
452 col.second->push_back(
col.first->getVal());
454 col.second->push_back(
col.first->getCurrentIndex());
468 first = std::min(first,
static_cast<std::size_t
>(
numEntries()));
473 out.emplace(
item.first, std::span<const double>{
item.second.data() + first,
len});
486 first = std::min(first,
static_cast<std::size_t
>(
numEntries()));
491 out.emplace(
item.first, std::span<const RooAbsCategory::value_type>{
item.second.data() + first,
len});
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Common abstract base class for objects that represent a value and a "shape" in RooFit.
void SetName(const char *name) override
Set the name of the TNamed.
A space to attach TBranches.
value_type lookupIndex(const std::string &stateName) const
Find the index number corresponding to the state name.
RooAbsCollection & assignValueOnly(const RooAbsCollection &other, bool forceIfSizeOne=false)
Sets the value of any argument in our set that also appears in the other set.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
void assign(const RooAbsCollection &other) const
Sets the value, cache and constant attribute of any argument in our set that also appears in the othe...
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract base class for a data collection.
virtual double weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const =0
virtual double weight() const =0
std::map< RooFit::Detail::DataKey, std::span< const double > > RealSpans
std::map< RooFit::Detail::DataKey, std::span< const RooAbsCategory::value_type > > CategorySpans
Abstract base class for objects that represent a real value and implements functionality common to al...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
bool setIndex(Int_t index, bool printError=true) override
Set value by specifying the index code of the desired state.
value_type getCurrentIndex() const final
Return current index.
Combines several disjunct datasets into one.
RooAbsArg * addColumn(RooAbsArg &var, bool adjustRange=true) override
WVE ownership issue here!! Caller (a RooAbsData) should take ownership of all arguments,...
std::unique_ptr< std::vector< double > > _weightBuffer
! Buffer for weights in case a batch of values is requested.
Int_t _curIndex
! Index associated with current event
void loadValues(const RooAbsDataStore *tds, const RooFormulaVar *select=nullptr, const char *rangeName=nullptr, std::size_t nStart=0, std::size_t nStop=std::numeric_limits< std::size_t >::max()) override
Int_t numEntries() const override
std::span< const double > getWeightBatch(std::size_t first, std::size_t len) const override
Get the weights of the events in the range [first, first+len).
RooAbsDataStore * merge(const RooArgSet &allvars, std::list< RooAbsDataStore * > dstoreList) override
std::map< RooAbsArg const *, std::vector< double > > _realBatchBuffers
! Buffers for real-valued columns in case batches of values are requested.
bool changeObservableName(const char *from, const char *to) override
Change name of internal observable named 'from' into 'to'.
RooAbsData::CategorySpans getCategoryBatches(std::size_t first, std::size_t len) const override
Get the batches of the category columns in the range [first, first+len), including the index category...
~RooCompositeDataStore() override
Destructor.
RooAbsData::RealSpans getBatches(std::size_t first, std::size_t len) const override
Get the batches of the real-valued columns in the range [first, first+len).
bool isWeighted() const override
RooAbsDataStore * _curStore
! Datastore associated with current event
double weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const override
double sumEntries() const override
Forward fill request to appropriate subset.
std::map< Int_t, RooAbsDataStore * > _dataMap
std::unique_ptr< RooAbsDataStore > reduce(RooStringView name, RooStringView title, const RooArgSet &vars, const RooFormulaVar *cutVar, const char *cutRange, std::size_t nStart, std::size_t nStop) override
void resetBuffers() override
Int_t fill() override
Forward fill request to appropriate subset.
void fillBatchBuffers() const
Fill the internal per-column buffers for batch access by loading the composite rows one by one,...
void attachBuffers(const RooArgSet &extObs) override
double weight() const override
void append(RooAbsDataStore &other) override
virtual const RooArgSet * get() const
std::map< RooAbsArg const *, std::vector< RooAbsCategory::value_type > > _catBatchBuffers
! Buffers for category columns in case batches of values are requested.
The RooStringView is a wrapper around a C-style string that can also be constructed from a std::strin...
const char * GetName() const override
Returns name of object.
static uint64_t sum(uint64_t i)