00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROO_ABS_DATA_STORE
00017 #define ROO_ABS_DATA_STORE
00018
00019 #include "Rtypes.h"
00020 #include "RooArgSet.h"
00021 #include "RooAbsData.h"
00022 #include "TNamed.h"
00023 #include <list>
00024
00025
00026 class RooAbsArg ;
00027 class RooArgList ;
00028 class TIterator ;
00029 class TTree ;
00030
00031 class RooAbsDataStore : public TNamed, public RooPrintable {
00032 public:
00033
00034 RooAbsDataStore() ;
00035 RooAbsDataStore(const char* name, const char* title, const RooArgSet& vars) ;
00036 RooAbsDataStore(const RooAbsDataStore& other, const char* newname=0) ;
00037 RooAbsDataStore(const RooAbsDataStore& other, const RooArgSet& vars, const char* newname=0) ;
00038 virtual RooAbsDataStore* clone(const RooArgSet& vars, const char* newname=0) const = 0 ;
00039 virtual ~RooAbsDataStore() ;
00040
00041
00042 virtual Int_t fill() = 0 ;
00043
00044
00045 virtual const RooArgSet* get(Int_t index) const = 0 ;
00046 virtual const RooArgSet* get() const { return &_vars ; }
00047 virtual Double_t weight() const = 0 ;
00048
00049 virtual Double_t weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const = 0 ;
00050 virtual void weightError(Double_t& lo, Double_t& hi, RooAbsData::ErrorType etype=RooAbsData::Poisson) const = 0 ;
00051
00052 virtual Double_t weight(Int_t index) const = 0 ;
00053
00054 virtual Bool_t isWeighted() const = 0 ;
00055
00056
00057 virtual Bool_t changeObservableName(const char* from, const char* to) =0 ;
00058
00059
00060 virtual RooAbsArg* addColumn(RooAbsArg& var, Bool_t adjustRange=kTRUE) = 0 ;
00061 virtual RooArgSet* addColumns(const RooArgList& varList) = 0 ;
00062
00063
00064 virtual RooAbsDataStore* merge(const RooArgSet& allvars, std::list<RooAbsDataStore*> dstoreList) = 0 ;
00065
00066
00067 virtual void append(RooAbsDataStore& other)= 0 ;
00068
00069
00070 virtual Bool_t valid() const = 0 ;
00071 virtual Int_t numEntries() const = 0 ;
00072 virtual void reset() = 0 ;
00073
00074
00075
00076 inline virtual void Print(Option_t *options= 0) const {
00077
00078 printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
00079 }
00080
00081 virtual void printName(ostream& os) const ;
00082 virtual void printTitle(ostream& os) const ;
00083 virtual void printClassName(ostream& os) const ;
00084 virtual void printArgs(ostream& os) const ;
00085 virtual void printValue(ostream& os) const ;
00086 void printMultiline(ostream& os, Int_t content, Bool_t verbose, TString indent) const ;
00087
00088 virtual Int_t defaultPrintContents(Option_t* opt) const ;
00089
00090
00091
00092 virtual void cacheArgs(const RooAbsArg* cacheOwner, RooArgSet& varSet, const RooArgSet* nset=0) = 0 ;
00093 virtual const RooAbsArg* cacheOwner() = 0 ;
00094 virtual void attachCache(const RooAbsArg* newOwner, const RooArgSet& cachedVars) = 0 ;
00095 virtual void setArgStatus(const RooArgSet& set, Bool_t active) = 0 ;
00096 const RooArgSet& cachedVars() const { return _cachedVars ; }
00097 virtual void resetCache() = 0 ;
00098
00099 virtual void setDirtyProp(Bool_t flag) { _doDirtyProp = flag ; }
00100
00101 virtual void checkInit() const {} ;
00102
00103 Bool_t hasFilledCache() const { return _cachedVars.getSize()>0 ; }
00104
00105 virtual const TTree* tree() const { return 0 ; }
00106
00107 protected:
00108
00109 RooArgSet _vars ;
00110 RooArgSet _cachedVars ;
00111 TIterator *_iterator;
00112 TIterator *_cacheIter ;
00113
00114 Bool_t _doDirtyProp ;
00115
00116 ClassDef(RooAbsDataStore,1)
00117 };
00118
00119
00120 #endif