90 _wgtVar(weightVar(vars,wgtVarName)),
101 _extWgtErrLoArray(0),
102 _extWgtErrHiArray(0),
129 vector<RealVector*>::const_iterator oiter =
_realStoreList.begin() ;
131 (*oiter)->setNativeBuffer() ;
134 vector<RealFullVector*>::const_iterator fiter =
_realfStoreList.begin() ;
136 (*fiter)->setNativeBuffer() ;
139 vector<CatVector*>::const_iterator citer =
_catStoreList.begin() ;
141 (*citer)->setNativeBuffer() ;
187 _varsww(other._varsww),
188 _wgtVar(other._wgtVar),
192 _nEntries(other._nEntries),
193 _sumWeight(other._sumWeight),
194 _sumWeightCarry(other._sumWeightCarry),
195 _extWgtArray(other._extWgtArray),
196 _extWgtErrLoArray(other._extWgtErrLoArray),
197 _extWgtErrHiArray(other._extWgtErrHiArray),
198 _extSumW2Array(other._extSumW2Array),
199 _curWgt(other._curWgt),
200 _curWgtErrLo(other._curWgtErrLo),
201 _curWgtErrHi(other._curWgtErrHi),
202 _curWgtErr(other._curWgtErr),
207 vector<RealVector*>::const_iterator oiter = other.
_realStoreList.begin() ;
213 vector<RealFullVector*>::const_iterator fiter = other.
_realfStoreList.begin() ;
219 vector<CatVector*>::const_iterator citer = other.
_catStoreList.begin() ;
239 _wgtVar(weightVar(vars,other._wgtVar?other._wgtVar->
GetName():0)),
250 _extWgtErrLoArray(0),
251 _extWgtErrHiArray(0),
288 _wgtVar(other._wgtVar?weightVar(vars,other._wgtVar->
GetName()):0),
292 _nEntries(other._nEntries),
293 _sumWeight(other._sumWeight),
294 _sumWeightCarry(other._sumWeightCarry),
295 _extWgtArray(other._extWgtArray),
296 _extWgtErrLoArray(other._extWgtErrLoArray),
297 _extWgtErrHiArray(other._extWgtErrHiArray),
298 _extSumW2Array(other._extSumW2Array),
299 _curWgt(other._curWgt),
300 _curWgtErrLo(other._curWgtErrLo),
301 _curWgtErrHi(other._curWgtErrHi),
302 _curWgtErr(other._curWgtErr),
306 vector<RealVector*>::const_iterator oiter = other.
_realStoreList.begin() ;
318 vector<RealFullVector*>::const_iterator fiter = other.
_realfStoreList.begin() ;
330 vector<CatVector*>::const_iterator citer = other.
_catStoreList.begin() ;
363 _wgtVar(weightVar(vars,wgtVarName)),
374 _extWgtErrLoArray(0),
375 _extWgtErrHiArray(0),
405 loadValues(&tds,cloneVar,cutRange,nStart,nStop);
422 for ( ; iter!=iend ; ++iter) {
427 for ( ; iter3!=iend3 ; ++iter3) {
432 for ( ; iter2!=iend2 ; ++iter2) {
511 for (
auto var :
_vars) {
512 var->setValueDirty();
579 for (
auto var :
_vars) {
580 var->setValueDirty() ;
684 throw string(
Form(
"RooDataHist::weightError(%s) error type Auto not allowed here",
GetName())) ;
688 throw string(
Form(
"RooDataHist::weightError(%s) error type Expected not allowed here",
GetName())) ;
780 std::vector<std::string> ranges;
786 for(
Int_t i=nStart; i < nevent ; ++i) {
790 if (selectClone && selectClone->
getVal()==0) {
810 bool allValid =
true;
811 for (
const auto arg :
_varsww) {
812 allValid = arg->isValid() && (ranges.empty() || std::any_of(ranges.begin(), ranges.end(),
813 [arg](
const std::string& range){return arg->inRange(range.c_str());}) );
871 << valHolder->
GetName() <<
"\"" << endl;
901 if (rv) rv->
write(i) ;
902 if (cv) cv->
write(i) ;
930 holderSet->
add(*valHolder) ;
935 << valHolder->
GetName() <<
"\"" << endl;
941 if (!newVarCloneList) {
943 <<
") Couldn't deep-clone variable " << var->
GetName() <<
", abort." << endl ;
950 cloneSetList.
Add(newVarCloneList) ;
951 cloneSet.
add(*newVarClone) ;
1014 Int_t nevt = dstoreList.front()->numEntries() ;
1016 for (
int i=0 ; i<nevt ; i++) {
1022 for (list<RooAbsDataStore*>::iterator iter = dstoreList.begin() ; iter!=dstoreList.end() ; ++iter) {
1023 const RooArgSet* partSet = (*iter)->get(i) ;
1024 mergedStore->
_vars = *partSet ;
1027 mergedStore->
fill() ;
1029 return mergedStore ;
1038 (*iter)->reserve(nEvts);
1042 (*iter3)->reserve(nEvts);
1044 vector<CatVector*>::iterator iter2 =
_catStoreList.begin() ;
1046 (*iter2)->reserve(nEvts);
1056 for (
int i=0 ; i<nevt ; i++) {
1091 vector<CatVector*>::iterator iter2 =
_catStoreList.begin() ;
1099struct less_dep :
public binary_function<RooAbsArg*, RooAbsArg*, bool> {
1101 return y->dependsOn(*
x);
1126 vector<RooAbsArg*> trackArgs ;
1127 while((arg=itern.
next())) {
1129 orderedArgs.
add(*arg) ;
1137 trackArgs.push_back(arg) ;
1145 if (trackArgs.size()>1) {
1146 sort(trackArgs.begin(),trackArgs.end(),less_dep()) ;
1150 for (vector<RooAbsArg*>::iterator viter = trackArgs.begin() ; viter!=trackArgs.end() ; ++viter) {
1151 orderedArgs.
add(**viter) ;
1164 list<RooArgSet*> vlist ;
1174 vlist.push_back(newVarCloneList) ;
1175 cloneSet.
add(*newVarClone) ;
1188 vector<RooArgSet*> nsetList ;
1189 list<RooArgSet*> argObsList ;
1198 argObsList.push_back(argObs) ;
1225 nsetList.push_back(normSet) ;
1233 if (
weight()!=0 || !skipZeroWeights) {
1235 vector<RooArgSet*>::iterator niter = nsetList.begin() ;
1239 cloneArg->
syncCache(argNset?argNset:nset) ;
1265 coutI(
Optimization) <<
"RooVectorDataStore::cacheArg() element " << arg->
GetName() <<
" has change tracking enabled on parameters " << *deps << endl ;
1273 for (list<RooArgSet*>::iterator iter = vlist.begin() ; iter!=vlist.end() ; ++iter) {
1276 for (list<RooArgSet*>::iterator iter = argObsList.begin() ; iter!=argObsList.end() ; ++iter) {
1298 std::vector<RooVectorDataStore::RealVector *> tv;
1305 tv.push_back(cacheElem);
1321 if (projectedArgs && projectedArgs->
getSize()>0) {
1324 usedNset = ownedNset ;
1331 for (
int i=firstEvent ; i<lastEvent ; i+=stepSize) {
1334 if (!zeroWeight || !skipZeroWeights) {
1335 for (std::vector<RooVectorDataStore::RealVector *>::iterator cacheIt = tv.begin(); cacheIt != tv.end();
1337 (*cacheIt)->_nativeReal->_valueDirty =
kTRUE;
1338 (*cacheIt)->_nativeReal->getValV((*cacheIt)->_nset ? (*cacheIt)->_nset : usedNset);
1339 (*cacheIt)->write(i);
1359 for (std::vector<RooVectorDataStore::RealVector *>::iterator cacheIt = tv.begin(); cacheIt != tv.end(); ++cacheIt) {
1445 while((arg=iter.
next())) {
1461 while((arg=iter.
next())) {
1472 cout <<
"RooVectorDataStor::dump()" << endl ;
1475 cout <<
"realVector list is" << endl ;
1476 std::vector<RealVector*>::iterator iter =
_realStoreList.begin() ;
1478 cout <<
"RealVector " << *iter <<
" _nativeReal = " << (*iter)->_nativeReal <<
" = " << (*iter)->_nativeReal->GetName() <<
" bufptr = " << (*iter)->_buf << endl ;
1479 cout <<
" values : " ;
1480 Int_t imax = (*iter)->_vec.size()>10 ? 10 : (*iter)->_vec.size() ;
1481 for (
Int_t i=0 ; i<imax ; i++) {
1482 cout << (*iter)->_vec[i] <<
" " ;
1486 std::vector<RealFullVector*>::iterator iter2 =
_realfStoreList.begin() ;
1488 cout <<
"RealFullVector " << *iter2 <<
" _nativeReal = " << (*iter2)->_nativeReal <<
" = " << (*iter2)->_nativeReal->GetName()
1489 <<
" bufptr = " << (*iter2)->_buf <<
" errbufptr = " << (*iter2)->_bufE << endl ;
1491 cout <<
" values : " ;
1492 Int_t imax = (*iter2)->_vec.size()>10 ? 10 : (*iter2)->_vec.size() ;
1493 for (
Int_t i=0 ; i<imax ; i++) {
1494 cout << (*iter2)->_vec[i] <<
" " ;
1497 if ((*iter2)->_vecE) {
1498 cout <<
" errors : " ;
1499 for (
Int_t i=0 ; i<imax ; i++) {
1500 cout << (*(*iter2)->_vecE)[i] <<
" " ;
1512void RooVectorDataStore::Streamer(
TBuffer &R__b)
1547void RooVectorDataStore::RealVector::Streamer(
TBuffer &R__b)
1560void RooVectorDataStore::RealFullVector::Streamer(
TBuffer &R__b)
1568 if (_vecE && _vecE->empty()) {
delete _vecE ; _vecE = 0 ; }
1569 if (_vecEL && _vecEL->empty()) {
delete _vecEL ; _vecEL = 0 ; }
1570 if (_vecEH && _vecEH->empty()) {
delete _vecEH ; _vecEH = 0 ; }
1579void RooVectorDataStore::CatVector::Streamer(
TBuffer &R__b)
1583 _vec0 = _vec.size()>0 ? &_vec.front() : 0 ;
float type_of_call hi(const int &, const int &)
TRObject operator()(const T1 &t1) const
char * Form(const char *fmt,...)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual RooAbsArg * cloneTree(const char *newname=0) const
Clone tree expression of objects.
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Return the observables of this pdf given a set of observables.
void attachDataStore(const RooAbsDataStore &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)=0
static void setDirtyInhibit(Bool_t flag)
Control global dirty inhibit mode.
virtual Bool_t isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
const Text_t * getStringAttribute(const Text_t *key) const
Get string attribute mapped under key 'key'.
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
virtual void syncCache(const RooArgSet *nset=0)=0
virtual void attachToVStore(RooVectorDataStore &vstore)=0
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
virtual RooAbsArg * createFundamental(const char *newname=0) const =0
Create a fundamental-type object that stores our type of value.
Bool_t recursiveRedirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE)
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
virtual void attachToVStore(RooVectorDataStore &vstore)
Attach the category index and label to as branches to the given vector store.
RooFIter fwdIterator() const R__SUGGEST_ALTERNATIVE("begin()
One-time forward iterator.
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.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
TIterator * createIterator(Bool_t dir=kIterForward) const R__SUGGEST_ALTERNATIVE("begin()
TIterator-style iteration over contained elements.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
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 void checkInit() const
virtual Double_t weight() const =0
virtual Int_t numEntries() const =0
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual void attachToVStore(RooVectorDataStore &vstore)
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgList is a container object that can hold multiple RooAbsArg objects.
Int_t index(const RooAbsArg *arg) const
Returns index of given arg, or -1 if arg is not in list.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
Bool_t getPoissonInterval(Int_t n, Double_t &mu1, Double_t &mu2, Double_t nSigma=1) const
Return a confidence interval for the expected number of events given n observed (unweighted) events.
static const RooHistError & instance()
Return a reference to a singleton object that is created the first time this method is called.
RooNameSet is a utility class that stores the names the objects in a RooArget.
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input 'list' whose names match to those in the internal name list...
void setNameList(const char *givenList)
RooRealVar represents a fundamental (non-derived) real valued object.
Double_t getAsymErrorLo() const
Bool_t hasAsymError(Bool_t allowZero=kTRUE) const
Double_t getAsymErrorHi() const
Bool_t hasError(Bool_t allowZero=kTRUE) const
Double_t getError() const
virtual void setVal(Double_t value)
Set value of variable to 'value'.
RooTreeDataStore is a TTree-backed data storage.
virtual const RooArgSet * get(Int_t index) const
Load the n-th data point (n='index') in memory and return a pointer to the internal RooArgSet holding...
RooArgSet _varsww
Was object constructed with default ctor?
virtual Int_t numEntries() const
void setNset(RooArgSet *newNset)
void setDependents(const RooArgSet &deps)
std::vector< Double_t > _vec
RooVectorDataStore is the abstract base class for data collection that use a TTree as internal storag...
virtual RooArgSet * addColumns(const RooArgList &varList)
Utility function to add multiple columns in one call See addColumn() for details.
virtual Double_t weight() const
Return the weight of the n-th data point (n='index') in memory.
virtual Int_t fill()
Interface function to TTree::Fill.
std::vector< RealFullVector * > _realfStoreList
Double_t * _extSumW2Array
External weight array - high error.
virtual void recalculateCache(const RooArgSet *, Int_t firstEvent, Int_t lastEvent, Int_t stepSize, Bool_t skipZeroWeights)
Double_t * _extWgtErrHiArray
External weight array - low error.
void loadValues(const RooAbsDataStore *tds, const RooFormulaVar *select=0, const char *rangeName=0, Int_t nStart=0, Int_t nStop=2000000000)
throw(std::string("RooVectorDataSore::loadValues() NOT IMPLEMENTED")) ;
RooVectorDataStore * _cache
RooRealVar * weightVar(const RooArgSet &allVars, const char *wgtName)
Utility function for constructors Return pointer to weight variable if it is defined.
std::vector< RealVector * > _realStoreList
RealVector * addReal(RooAbsReal *real)
Double_t _sumWeight
do not persist
virtual void resetCache()
virtual void attachBuffers(const RooArgSet &extObs)
virtual void setArgStatus(const RooArgSet &set, Bool_t active)
Disabling of branches is (intentionally) not implemented in vector data stores (as the doesn't result...
Double_t * _extWgtErrLoArray
External weight array.
virtual const RooArgSet * getNative(Int_t index) const
Load the n-th data point (n='index') in memory and return a pointer to the internal RooArgSet holding...
virtual void setDirtyProp(Bool_t flag)
virtual RooAbsArg * addColumn(RooAbsArg &var, Bool_t adjustRange=kTRUE)
Add a new column to the data set which holds the pre-calculated values of 'newVar'.
std::vector< CatVector * > _catStoreList
Bool_t _forcedUpdate
Cache owner.
void setAllBuffersNative()
CatVector ** _firstCat
do not persist
virtual const RooArgSet * get(Int_t index) const
Load the n-th data point (n='index') in memory and return a pointer to the internal RooArgSet holding...
virtual Double_t weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const
virtual void append(RooAbsDataStore &other)
virtual Bool_t valid() const
Return true if currently loaded coordinate is considered valid within the current range definitions o...
virtual Bool_t changeObservableName(const char *from, const char *to)
virtual void resetBuffers()
virtual void cacheArgs(const RooAbsArg *owner, RooArgSet &varSet, const RooArgSet *nset=0, Bool_t skipZeroWeights=kTRUE)
Cache given RooAbsArgs with this tree: The tree is given direct write access of the args internal cac...
Double_t _curWgt
External sum of weights array.
virtual void reserve(Int_t nEvt)
RooAbsDataStore * merge(const RooArgSet &allvars, std::list< RooAbsDataStore * > dstoreList)
Merge columns of supplied data set(s) with this data set.
virtual const RooArgSet * get() const
virtual ~RooVectorDataStore()
Destructor.
RooArgSet varsNoWeight(const RooArgSet &allVars, const char *wgtName)
Utility function for constructors Return RooArgSet that is copy of allVars minus variable matching wg...
virtual Int_t numEntries() const
CatVector * addCategory(RooAbsCategory *cat)
RealFullVector ** _firstRealF
do not persist
virtual void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars)
Initialize cache of dataset: attach variables of cache ArgSet to the corresponding TTree branches.
RooAbsArg * _cacheOwner
Optimization cache.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
Iterator abstract base class.
virtual TObject * Next()=0
virtual void Add(TObject *obj)
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
std::string GetName(const std::string &scope_name)
std::vector< std::string > tokenise(const std::string &str, const std::string &delims)
Tokenise the string by splitting at the characters in delims.