CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SimpleCacheSentry.h
Go to the documentation of this file.
1 #ifndef ROO_SIMPLE_CACHE_SENTRY
2 #define ROO_SIMPLE_CACHE_SENTRY
3 
4 #include "RooRealVar.h"
5 #include "RooSetProxy.h"
6 #include "TIterator.h"
7 
8 class SimpleCacheSentry : public RooAbsArg {
9  public:
11  SimpleCacheSentry(const RooRealVar &var) ;
12  SimpleCacheSentry(const RooAbsCollection &vars) ;
13  SimpleCacheSentry(const RooAbsArg &func, const RooArgSet *obs=0) ;
14  SimpleCacheSentry(const SimpleCacheSentry &other, const char *newname = 0) ;
15  RooSetProxy & deps() { return _deps; }
16  const RooArgSet & deps() const { return _deps; }
17  void addVar(const RooRealVar &var) { _deps.add(var); }
18  void addVars(const RooAbsCollection &vars) ;
19  void addFunc(const RooAbsArg &func, const RooArgSet *obs=0) ;
20  bool good() const { return !isValueDirty(); }
21  bool empty() const { return _deps.getSize() == 0; }
22  void reset() { clearValueDirty(); }
23  // base class methods to be implemented
24  virtual TObject* clone(const char* newname) const { return new SimpleCacheSentry(*this, newname); }
25  virtual RooAbsArg *createFundamental(const char* newname=0) const { return 0; }
26  virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) { return false; }
27  virtual void writeToStream(ostream& os, Bool_t compact) const { }
28  virtual Bool_t operator==(const RooAbsArg& other) { return this == &other; }
29  virtual void syncCache(const RooArgSet* nset=0) {}
30  virtual void copyCache(const RooAbsArg* source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE) {}
31  virtual void attachToTree(TTree& t, Int_t bufSize=32000) {}
32  virtual void attachToVStore(RooVectorDataStore& vstore) {}
33  virtual void setTreeBranchStatus(TTree& t, Bool_t active) {}
34  virtual void fillTreeBranch(TTree& t) {}
35  private:
36  RooSetProxy _deps;
37  ClassDef(SimpleCacheSentry,1)
38 };
39 
40 #endif
virtual void fillTreeBranch(TTree &t)
virtual Bool_t operator==(const RooAbsArg &other)
virtual TObject * clone(const char *newname) const
virtual void writeToStream(ostream &os, Bool_t compact) const
virtual void attachToTree(TTree &t, Int_t bufSize=32000)
virtual void attachToVStore(RooVectorDataStore &vstore)
static int const bufSize
Definition: Guid.cc:24
virtual void syncCache(const RooArgSet *nset=0)
virtual void setTreeBranchStatus(TTree &t, Bool_t active)
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)
bool good() const
void addVars(const RooAbsCollection &vars)
RooSetProxy & deps()
bool empty() const
virtual RooAbsArg * createFundamental(const char *newname=0) const
const RooArgSet & deps() const
void addVar(const RooRealVar &var)
void addFunc(const RooAbsArg &func, const RooArgSet *obs=0)
virtual Bool_t readFromStream(istream &is, Bool_t compact, Bool_t verbose=kFALSE)