66 for (
const auto& iter : inputData) {
80 RooAbsDataStore(other,newname), _indexCat(other._indexCat), _curStore(other._curStore), _curIndex(other._curIndex), _ownComps(
kTRUE)
82 for (map<Int_t,RooAbsDataStore*>::const_iterator iter=other.
_dataMap.begin() ; iter!=other.
_dataMap.end() ; ++iter) {
94 RooAbsDataStore(other,vars,newname), _indexCat(other._indexCat), _curStore(other._curStore), _curIndex(other._curIndex), _ownComps(
kTRUE)
102 for (map<Int_t,RooAbsDataStore*>::const_iterator iter=other.
_dataMap.begin() ; iter!=other.
_dataMap.end() ; ++iter) {
118 map<int,RooAbsDataStore*>::const_iterator iter ;
120 delete iter->second ;
144 map<int,RooAbsDataStore*>::const_iterator iter ;
146 iter->second->recalculateCache(proj,firstEvent,lastEvent,stepSize,skipZeroWeights) ;
156 map<int,RooAbsDataStore*>::const_iterator iter ;
158 ret |= iter->second->hasFilledCache() ;
168 map<int,RooAbsDataStore*>::const_iterator iter ;
170 iter->second->forceCacheUpdate() ;
183 return subset->
fill() ;
195 map<int,RooAbsDataStore*>::const_iterator iter ;
197 sum+= iter->second->sumEntries() ;
212 map<int,RooAbsDataStore*>::const_iterator iter ;
214 if (idx>=(offset+iter->second->numEntries())) {
215 offset += iter->second->numEntries() ;
283 map<int,RooAbsDataStore*>::const_iterator iter ;
285 if (iter->second->isWeighted())
return kTRUE ;
295 throw(std::runtime_error(
"RooCompositeDataSore::loadValues() NOT IMPLEMENTED")) ;
311 coutE(InputArguments) <<
"RooCompositeDataStore::changeObservableName(" <<
GetName() <<
" no observable " << from <<
" in this dataset" << endl ;
320 map<int,RooAbsDataStore*>::const_iterator iter ;
322 ret |= iter->second->changeObservableName(from,to) ;
337 map<int,RooAbsDataStore*>::const_iterator iter ;
339 ret = iter->second->addColumn(newVar,adjustRange) ;
356 map<int,RooAbsDataStore*>::const_iterator iter ;
358 ret = iter->second->addColumns(varList) ;
373 throw string(
"RooCompositeDataStore::merge() is not implemented yet") ;
385 for (
int i=0 ; i<nevt ; i++) {
398 map<int,RooAbsDataStore*>::const_iterator iter ;
400 n += iter->second->numEntries() ;
412 map<int,RooAbsDataStore*>::const_iterator iter ;
414 iter->second->reset() ;
424 map<int,RooAbsDataStore*>::const_iterator iter ;
426 iter->second->cacheArgs(owner,newVarSet,nset,skipZeroWeights) ;
436 map<int,RooAbsDataStore*>::const_iterator iter ;
439 iter->second->setArgStatus(*subset,active) ;
453 map<int,RooAbsDataStore*>::const_iterator iter ;
455 iter->second->attachCache(newOwner,inCachedVars) ;
466 map<int,RooAbsDataStore*>::const_iterator iter ;
468 iter->second->resetCache() ;
479 map<int,RooAbsDataStore*>::const_iterator iter ;
481 iter->second->attachBuffers(extObs);
492 map<int,RooAbsDataStore*>::const_iterator iter ;
494 iter->second->resetBuffers();
504 cout <<
"RooCompositeDataStore::dump()" << endl ;
505 map<int,RooAbsDataStore*>::const_iterator iter ;
507 cout <<
"state number " << iter->
first <<
" has store " << iter->second->IsA()->
GetName() <<
" with variables " << *iter->second->get() ;
508 if (iter->second->isWeighted()) cout <<
" and is weighted " ;
523 for (std::size_t i = 0; i < static_cast<std::size_t>(
numEntries()); ++i) {
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
void SetName(const char *name)
Set the name of the TNamed.
value_type lookupIndex(const std::string &stateName) const
Find the index number corresponding to the state name.
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
RooAbsCollection & assignValueOnly(const RooAbsCollection &other, Bool_t oneSafe=kFALSE)
The assignment operator sets the value of any argument in our set that also appears in the other set.
RooAbsArg * first() const
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 Double_t weight() const =0
virtual Double_t weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const =0
virtual RooAbsDataStore * clone(const char *newname=0) const =0
virtual Int_t numEntries() const =0
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
RooCategory is an object to represent discrete states.
virtual value_type getCurrentIndex() const override final
Return current index.
virtual Bool_t setIndex(Int_t index, bool printError=true) override
Set value by specifying the index code of the desired state.
RooCompositeDataStore combines several disjunct datasets into one.
virtual RooAbsArg * addColumn(RooAbsArg &var, Bool_t adjustRange=kTRUE)
WVE ownership issue here!! Caller (a RooAbsData) should take ownership of all arguments,...
virtual void resetCache()
std::unique_ptr< std::vector< double > > _weightBuffer
Index associated with current event.
Int_t _curIndex
Datastore associated with current event.
void loadValues(const RooAbsDataStore *tds, const RooFormulaVar *select=0, const char *rangeName=0, std::size_t nStart=0, std::size_t nStop=std::numeric_limits< std::size_t >::max())
virtual Bool_t changeObservableName(const char *from, const char *to)
Change name of internal observable named 'from' into 'to'.
virtual Bool_t valid() const
Return true if currently loaded coordinate is considered valid within the current range definitions o...
std::map< Int_t, RooAbsDataStore * > _dataMap
virtual void attachBuffers(const RooArgSet &extObs)
void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars)
Initialize cache of dataset: attach variables of cache ArgSet to the corresponding TTree branches.
virtual Double_t weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const
virtual void resetBuffers()
Bool_t _ownComps
Buffer for weights in case a batch of values is requested.
virtual Double_t sumEntries() const
Forward fill request to appropriate subset.
virtual void setArgStatus(const RooArgSet &set, Bool_t active)
virtual RooArgSet * addColumns(const RooArgList &varList)
WVE ownership issue here!! Caller (a RooAbsData) should take ownership of all arguments,...
virtual RooSpan< const double > getWeightBatch(std::size_t first, std::size_t len) const
Get the weights of the events in the range [first, first+len).
virtual Int_t numEntries() const
virtual void append(RooAbsDataStore &other)
virtual Bool_t isWeighted() const
virtual Double_t weight() const
virtual void cacheArgs(const RooAbsArg *owner, RooArgSet &varSet, const RooArgSet *nset=0, Bool_t skipZeroWeights=kFALSE)
RooAbsDataStore * _curStore
virtual ~RooCompositeDataStore()
Destructor.
RooAbsDataStore * merge(const RooArgSet &allvars, std::list< RooAbsDataStore * > dstoreList)
virtual Bool_t hasFilledCache() const
virtual void recalculateCache(const RooArgSet *, Int_t, Int_t, Int_t, Bool_t)
Forward recalculate request to all subsets.
virtual void forceCacheUpdate()
virtual const RooArgSet * get() const
virtual Int_t fill()
Forward fill request to appropriate subset.
A simple container to hold a batch of data values.
constexpr std::span< T >::pointer data() const
virtual const char * GetName() const
Returns name of object.
static uint64_t sum(uint64_t i)