#ifndef ROO_ABS_DATA_STORE
#define ROO_ABS_DATA_STORE
#include "Rtypes.h"
#include "RooArgSet.h"
#include "RooAbsData.h"
#include "TNamed.h"
#include <list>
class RooAbsArg ;
class RooArgList ;
class TIterator ;
class TTree ;
class RooAbsDataStore : public TNamed, public RooPrintable {
public:
RooAbsDataStore() ;
RooAbsDataStore(const char* name, const char* title, const RooArgSet& vars) ;
RooAbsDataStore(const RooAbsDataStore& other, const char* newname=0) ;
RooAbsDataStore(const RooAbsDataStore& other, const RooArgSet& vars, const char* newname=0) ;
virtual RooAbsDataStore* clone(const char* newname=0) const = 0 ;
virtual RooAbsDataStore* clone(const RooArgSet& vars, const char* newname=0) const = 0 ;
virtual ~RooAbsDataStore() ;
virtual Int_t fill() = 0 ;
virtual const RooArgSet* get(Int_t index) const = 0 ;
virtual const RooArgSet* get() const { return &_vars ; }
virtual Double_t weight() const = 0 ;
virtual Double_t weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const = 0 ;
virtual void weightError(Double_t& lo, Double_t& hi, RooAbsData::ErrorType etype=RooAbsData::Poisson) const = 0 ;
virtual Double_t weight(Int_t index) const = 0 ;
virtual Bool_t isWeighted() const = 0 ;
virtual Bool_t changeObservableName(const char* from, const char* to) =0 ;
virtual RooAbsArg* addColumn(RooAbsArg& var, Bool_t adjustRange=kTRUE) = 0 ;
virtual RooArgSet* addColumns(const RooArgList& varList) = 0 ;
virtual RooAbsDataStore* merge(const RooArgSet& allvars, std::list<RooAbsDataStore*> dstoreList) = 0 ;
virtual void append(RooAbsDataStore& other)= 0 ;
virtual Bool_t valid() const = 0 ;
virtual Int_t numEntries() const = 0 ;
virtual Double_t sumEntries() const { return 0 ; } ;
virtual void reset() = 0 ;
virtual void attachBuffers(const RooArgSet& extObs) = 0 ;
virtual void resetBuffers() = 0 ;
virtual void setExternalWeightArray(Double_t* , Double_t* , Double_t* , Double_t* ) {} ;
inline virtual void Print(Option_t *options= 0) const {
printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
}
virtual void printName(std::ostream& os) const ;
virtual void printTitle(std::ostream& os) const ;
virtual void printClassName(std::ostream& os) const ;
virtual void printArgs(std::ostream& os) const ;
virtual void printValue(std::ostream& os) const ;
void printMultiline(std::ostream& os, Int_t content, Bool_t verbose, TString indent) const ;
virtual Int_t defaultPrintContents(Option_t* opt) const ;
virtual void cacheArgs(const RooAbsArg* cacheOwner, RooArgSet& varSet, const RooArgSet* nset=0, Bool_t skipZeroWeights=kFALSE) = 0 ;
virtual const RooAbsArg* cacheOwner() = 0 ;
virtual void attachCache(const RooAbsArg* newOwner, const RooArgSet& cachedVars) = 0 ;
virtual void setArgStatus(const RooArgSet& set, Bool_t active) = 0 ;
const RooArgSet& cachedVars() const { return _cachedVars ; }
virtual void resetCache() = 0 ;
virtual void recalculateCache(const RooArgSet* , Int_t , Int_t , Int_t , Bool_t ) {} ;
virtual void setDirtyProp(Bool_t flag) { _doDirtyProp = flag ; }
Bool_t dirtyProp() const { return _doDirtyProp ; }
virtual void checkInit() const {} ;
virtual Bool_t hasFilledCache() const { return kFALSE ; }
virtual const TTree* tree() const { return 0 ; }
virtual void dump() {}
virtual void loadValues(const RooAbsDataStore *tds, const RooFormulaVar* select=0, const char* rangeName=0, Int_t nStart=0, Int_t nStop=2000000000) = 0 ;
virtual void forceCacheUpdate() {} ;
protected:
RooArgSet _vars ;
RooArgSet _cachedVars ;
TIterator *_iterator;
TIterator *_cacheIter ;
Bool_t _doDirtyProp ;
ClassDef(RooAbsDataStore,1)
};
#endif