CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SimpleCacheSentry.cc
Go to the documentation of this file.
1 #include "../interface/SimpleCacheSentry.h"
2 
3 SimpleCacheSentry::SimpleCacheSentry() : _deps("deps","deps",this) {}
4 
5 SimpleCacheSentry::SimpleCacheSentry(const RooRealVar &var) :
6  _deps("deps","deps",this)
7 {
8  addVar(var);
9 }
10 
11 SimpleCacheSentry::SimpleCacheSentry(const RooAbsCollection &vars) :
12  _deps("deps","deps",this)
13 {
14  addVars(vars);
15 }
16 
17 
18 SimpleCacheSentry::SimpleCacheSentry(const RooAbsArg &func, const RooArgSet *obs) :
19  _deps("deps","deps",this)
20 {
21  addFunc(func,obs);
22 }
23 
24 SimpleCacheSentry::SimpleCacheSentry(const SimpleCacheSentry &other, const char *newname) :
25  _deps("deps",this,other._deps)
26 {
27 }
28 
29 void SimpleCacheSentry::addVars(const RooAbsCollection &vars)
30 {
31  TIterator *iter = vars.createIterator();
32  for (RooAbsArg *a = (RooAbsArg *) iter->Next(); a != 0; a = (RooAbsArg *) iter->Next()) {
33  if (_deps.containsInstance(*a)) continue;
34  if (a->isDerived()) addFunc(*a);
35  else _deps.add(*a);
36  }
37  delete iter;
38 }
39 
40 void SimpleCacheSentry::addFunc(const RooAbsArg &func, const RooArgSet *obs)
41 {
42  RooArgSet *deps = func.getParameters(obs,false);
43  addVars(*deps);
44  delete deps;
45 }
46 
47 
void addVars(const RooAbsCollection &vars)
RooSetProxy & deps()
double a
Definition: hdecay.h:121
void addVar(const RooRealVar &var)
void addFunc(const RooAbsArg &func, const RooArgSet *obs=0)