61 const RooArgSet& vars,
RooCategory& indexCat,map<std::string,RooAbsDataStore*>
const& inputData) :
64 for (
const auto& iter : inputData) {
76 RooAbsDataStore(other,newname), _indexCat(other._indexCat), _curStore(other._curStore), _curIndex(other._curIndex), _ownComps(true)
78 for (
const auto& item : other.
_dataMap) {
90 RooAbsDataStore(other,vars,newname), _indexCat(other._indexCat), _curStore(other._curStore), _curIndex(other._curIndex), _ownComps(true)
98 for (
const auto& item : other.
_dataMap) {
124 const char* cutRange, std::size_t nStart, std::size_t nStop)
129 varsNoIndex.
remove(*indexCat,
true) ;
133 auto out = std::make_unique<RooCompositeDataStore>(
name, title, varsNoIndex, *
_indexCat, std::map<std::string,RooAbsDataStore*>{});
137 out->_dataMap[item.first] = item.second->reduce(
name, title, varsNoIndex, cutVar, cutRange, nStart, nStop).release();
141 out->_ownComps =
true;
152 item.second->recalculateCache(proj,firstEvent,lastEvent,stepSize,skipZeroWeights) ;
163 ret |= item.second->hasFilledCache() ;
174 item.second->forceCacheUpdate() ;
187 return subset->
fill() ;
200 sum+= item.second->sumEntries() ;
216 if (idx>=(
offset+item.second->numEntries())) {
217 offset += item.second->numEntries() ;
272 if (item.second->isWeighted())
return true ;
282 throw(std::runtime_error(
"RooCompositeDataSore::loadValues() NOT IMPLEMENTED")) ;
298 coutE(InputArguments) <<
"RooCompositeDataStore::changeObservableName(" <<
GetName() <<
" no observable " << from <<
" in this dataset" << endl ;
308 ret |= item.second->changeObservableName(from,to) ;
324 ret = item.second->addColumn(newVar,adjustRange) ;
337 throw string(
"RooCompositeDataStore::merge() is not implemented yet") ;
349 for (
int i=0 ; i<nevt ; i++) {
363 n += item.second->numEntries() ;
376 item.second->reset() ;
387 item.second->cacheArgs(owner,newVarSet,nset,skipZeroWeights) ;
399 item.second->setArgStatus(*subset,active) ;
414 item.second->attachCache(newOwner,inCachedVars) ;
426 item.second->resetCache() ;
438 item.second->attachBuffers(extObs);
450 item.second->resetBuffers();
460 cout <<
"RooCompositeDataStore::dump()" << endl ;
462 cout <<
"state number " << item.
first <<
" has store " << item.second->
ClassName() <<
" with variables " << *item.second->get() ;
463 if (item.second->isWeighted()) cout <<
" and is weighted " ;
478 for (std::size_t i = 0; i < static_cast<std::size_t>(
numEntries()); ++i) {
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
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
void SetName(const char *name) override
Set the name of the TNamed.
value_type lookupIndex(const std::string &stateName) const
Find the index number corresponding to the state name.
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
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 * first() const
bool selectCommon(const RooAbsCollection &refColl, RooAbsCollection &outColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsDataStore is the abstract base class for data collection that use a TTree as internal storage m...
virtual const RooArgSet * get(Int_t index) const =0
virtual RooAbsDataStore * clone(const char *newname=nullptr) const =0
virtual double weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const =0
virtual double weight() const =0
virtual Int_t numEntries() const =0
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooCategory is an 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.
RooCompositeDataStore combines several disjunct datasets into one.
void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars) override
Initialize cache of dataset: attach variables of cache ArgSet to the corresponding TTree branches.
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::map< Int_t, RooAbsDataStore * > _dataMap
RooAbsDataStore * merge(const RooArgSet &allvars, std::list< RooAbsDataStore * > dstoreList) override
bool changeObservableName(const char *from, const char *to) override
Change name of internal observable named 'from' into 'to'.
~RooCompositeDataStore() override
Destructor.
RooSpan< 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).
void cacheArgs(const RooAbsArg *owner, RooArgSet &varSet, const RooArgSet *nset=nullptr, bool skipZeroWeights=false) override
void recalculateCache(const RooArgSet *, Int_t, Int_t, Int_t, bool) override
Forward recalculate request to all subsets.
bool isWeighted() const override
void setArgStatus(const RooArgSet &set, bool active) override
bool hasFilledCache() 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::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 attachBuffers(const RooArgSet &extObs) override
double weight() const override
void resetCache() override
void forceCacheUpdate() override
void append(RooAbsDataStore &other) override
virtual const RooArgSet * get() const
A simple container to hold a batch of data values.
constexpr std::span< T >::pointer data() const
The RooStringView is a wrapper around a C-syle string that can also be constructed from a std::string...
const char * GetName() const override
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
static uint64_t sum(uint64_t i)