16 #ifndef ROO_VECTOR_DATA_STORE
17 #define ROO_VECTOR_DATA_STORE
30 #define VECTOR_BUFFER_SIZE 1024
95 virtual void reset() ;
139 _vec.reserve(initialCapacity);
144 _vec.reserve(initialCapacity);
166 if (&other==
this)
return *
this;
172 std::vector<Double_t> tmp;
174 tmp.assign(other.
_vec.begin(), other.
_vec.end());
226 std::vector<Double_t> tmp;
244 std::vector<Double_t> tmp;
248 if (
Int_t(tmp.size()) != siz)
316 if (&other==
this)
return *
this;
326 for (
unsigned i = 0; i < 3; ++i) {
329 if (dst[i]->
size() <= src[i]->capacity() / 2 &&
331 std::vector<Double_t> tmp;
333 tmp.assign(src[i]->begin(), src[i]->end());
339 dst[i] =
new std::vector<Double_t>(*src[i]);
352 if (!
_vecE)
_vecE =
new std::vector<Double_t> ;
359 _vecEL =
new std::vector<Double_t> ;
360 _vecEH =
new std::vector<Double_t> ;
398 std::vector<Double_t> tmp;
402 std::vector<Double_t> tmp;
406 std::vector<Double_t> tmp;
421 for (
unsigned i = 0; i < 3; ++i) {
422 if (!vlist[i])
continue;
426 std::vector<Double_t> tmp;
428 if (!vlist[i]->empty())
429 tmp.assign(vlist[i]->begin(),
431 if (
Int_t(tmp.size()) != siz)
435 vlist[i]->resize(siz);
466 _vec.reserve(initialCapacity);
472 _vec.reserve(initialCapacity);
485 if (&other==
this)
return *
this;
490 std::vector<RooCatType> tmp;
492 tmp.assign(other.
_vec.begin(), other.
_vec.end());
519 std::vector<RooCatType> tmp;
534 std::vector<RooCatType> tmp;
538 if (
Int_t(tmp.size()) != siz)
582 if (std::string((*iter)->bufArg()->GetName())==cat->
GetName()) {
606 if ((*iter)->bufArg()->namePtr()==real->
namePtr()) {
613 std::vector<RealFullVector*>::iterator iter2 =
_realfStoreList.begin() ;
616 if ((*iter2)->bufArg()->namePtr()==real->
namePtr()) {
639 if (std::string((*iter)->bufArg()->GetName())==real->
GetName()) {
651 if (std::string((*iter)->bufArg()->GetName())==real->
GetName()) {
663 if (std::string((*iter)->bufArg()->GetName())==real->
GetName()) {
677 if (std::string((*iter)->bufArg()->GetName())==real->
GetName()) {
684 std::vector<RealVector*>::iterator iter2 =
_realStoreList.begin() ;
686 if (std::string((*iter2)->bufArg()->GetName())==real->
GetName()) {
CatVector * addCategory(RooAbsCategory *cat)
void getNative(Int_t idx) const
RealFullVector & operator=(const RealFullVector &other)
void setAllBuffersNative()
std::vector< Double_t > * _vecE
RooAbsDataStore is the abstract base class for data collection that use a TTree as internal storage m...
CatVector(UInt_t initialCapacity=(VECTOR_BUFFER_SIZE/sizeof(RooCatType)))
RealFullVector(RooAbsReal *arg, UInt_t initialCapacity=(VECTOR_BUFFER_SIZE/sizeof(Double_t)))
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
Double_t * _extSumW2Array
External weight array - high error.
RooRealVar * weightVar(const RooArgSet &allVars, const char *wgtName)
Utility function for constructors Return pointer to weight variable if it is defined.
void setBufArg(RooAbsReal *arg)
virtual Int_t fill()
Interface function to TTree::Fill.
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...
virtual RooAbsDataStore * clone(const char *newname=0) const
void setBuffer(RooCatType *newBuf)
void setNativeBuffer(Double_t *newBuf=0)
virtual Double_t weight() const
Return the weight of the n-th data point (n='index') in memory.
virtual void reserve(Int_t nEvt)
RealVector & operator=(const RealVector &other)
virtual void setDirtyProp(Bool_t flag)
void setDependents(const RooArgSet &deps)
virtual Bool_t hasFilledCache() const
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'.
void setBuffer(RooAbsReal *real, Double_t *newBuf)
virtual const RooArgSet * get() const
virtual void recalculateCache(const RooArgSet *, Int_t firstEvent, Int_t lastEvent, Int_t stepSize, Bool_t skipZeroWeights)
void getNative(Int_t idx) const
virtual void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars)
Initialize cache of dataset: attach variables of cache ArgSet to the corresponding TTree branches...
Bool_t hasChanged(Bool_t clearState)
Returns true if state has changes since last call with clearState=kTRUE If clearState is true...
virtual void append(RooAbsDataStore &other)
std::vector< RealVector * > & realStoreList()
Double_t _sumWeight
do not persist
Double_t * _extWgtErrLoArray
External weight array.
std::vector< RealFullVector * > & realfStoreList()
void setAsymErrorBuffer(Double_t *newBufL, Double_t *newBufH)
virtual Bool_t isWeighted() const
virtual Bool_t valid() const
Return true if currently loaded coordinate is considered valid within the current range definitions o...
RooAbsArg * _cacheOwner
Optimization cache.
RooTreeDataStore is the abstract base class for data collection that use a TTree as internal storage ...
RealVector(const RealVector &other, RooAbsReal *real=0)
Double_t _curWgt
External sum of weights array.
std::vector< Double_t > _vec
Bool_t _doDirtyProp
Iterator over cached variables.
std::vector< RooCatType > _vec
virtual RooArgSet * addColumns(const RooArgList &varList)
Utility function to add multiple columns in one call See addColumn() for details. ...
std::vector< RealFullVector * > _realfStoreList
RooArgSet varsNoWeight(const RooArgSet &allVars, const char *wgtName)
Utility function for constructors Return RooArgSet that is copy of allVars minus variable matching wg...
Bool_t _forcedUpdate
Cache owner.
#define ClassDef(name, id)
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")) ;
std::vector< CatVector * > & catStoreList()
void setNset(RooArgSet *newNset)
const RooAbsCategory * bufArg() const
RooArgSet parameters() const
std::vector< RealVector * > _realStoreList
virtual void resetBuffers()
RooVectorDataStore is the abstract base class for data collection that use a TTree as internal storag...
void setNativeBuffer(RooCatType *newBuf=0)
std::map< std::string, std::string >::const_iterator iter
const TNamed * namePtr() const
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
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...
std::vector< Double_t > * _vecEH
const RooArgSet & cachedVars() const
virtual Double_t weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const
Bool_t hasError(RooAbsReal *real)
RooRealVar represents a fundamental (non-derived) real valued object.
CatVector ** _firstCat
do not persist
RealFullVector(const RealFullVector &other, RooAbsReal *real=0)
RooAbsDataStore * merge(const RooArgSet &allvars, std::list< RooAbsDataStore * > dstoreList)
Merge columns of supplied data set(s) with this data set.
Bool_t hasAsymError(RooAbsReal *real)
RealFullVector(const RealVector &other, RooAbsReal *real=0)
const RooAbsReal * bufArg() const
char * Form(const char *fmt,...)
void get(Int_t idx) const
virtual const char * GetName() const
Returns name of object.
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...
RealVector(RooAbsReal *arg, UInt_t initialCapacity=(VECTOR_BUFFER_SIZE/sizeof(Double_t)))
RealFullVector(UInt_t initialCapacity=(VECTOR_BUFFER_SIZE/sizeof(Double_t)))
CatVector & operator=(const CatVector &other)
Double_t * _extWgtErrHiArray
External weight array - low error.
void setErrorBuffer(Double_t *newBuf)
virtual RooAbsDataStore * clone(const RooArgSet &vars, const char *newname=0) const
std::vector< CatVector * > _catStoreList
RooVectorDataStore * _cache
virtual const RooAbsArg * cacheOwner()
RooChangeTracker * _tracker
void select(Int_t replica=1, Int_t color=kGreen)
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Bool_t isFullReal(RooAbsReal *real)
virtual Double_t sumEntries() const
const RooVectorDataStore * cache() const
RealVector * addReal(RooAbsReal *real)
virtual ~RealFullVector()
CatVector(const CatVector &other, RooAbsCategory *cat=0)
RooChangeTracker is a meta object that tracks value changes in a given set of RooAbsArgs by registeri...
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
virtual Int_t numEntries() const
RealVector(UInt_t initialCapacity=(VECTOR_BUFFER_SIZE/sizeof(Double_t)))
virtual ~RooVectorDataStore()
Destructor.
RealFullVector * addRealFull(RooAbsReal *real)
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
std::vector< Double_t > * _vecEL
CatVector(RooAbsCategory *cat, UInt_t initialCapacity=(VECTOR_BUFFER_SIZE/sizeof(RooCatType)))
A TTree object has a header with a name and a title.
float type_of_call hi(const int &, const int &)
void assignFast(const RooCatType &other)
RealFullVector ** _firstRealF
do not persist
virtual void attachBuffers(const RooArgSet &extObs)
virtual Bool_t changeObservableName(const char *from, const char *to)
#define VECTOR_BUFFER_SIZE
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
void setExternalWeightArray(Double_t *arrayWgt, Double_t *arrayWgtErrLo, Double_t *arrayWgtErrHi, Double_t *arraySumW2)
void setBufArg(RooAbsCategory *arg)
void getNative(Int_t idx) const
virtual void resetCache()