Class RooNormSet cache manage the bookkeeping of multiple instances of sets of integration and normalization observables that effectively have the same definition.
In complex function expression many RooArgSets with the same contents may be passed to an object that caches intermediate results dependent on the normalization/integration set To avoid unnecessary cache faulting, This class tracks all instances with the same contents and reports to the owner if the present nset/iset is truely different from the current reference. Class RooNormSet only evaluates each RooArgSet pointer once, it therefore assumes that RooArgSets with normalization and/or integration sets are not changes during their lifetime.
Definition at line 25 of file RooNormSetCache.h.
Classes | |
class | Pair |
Public Member Functions | |
RooNormSetCache (std::size_t max=32) | |
void | add (const RooArgSet *set1, const RooArgSet *set2=nullptr) |
Add given pair of RooArgSet pointers to our store. More... | |
bool | autoCache (const RooAbsArg *self, const RooArgSet *set1, const RooArgSet *set2=nullptr, const TNamed *set2RangeName=nullptr, bool autoRefill=true) |
If RooArgSets set1 and set2 or sets with similar contents have been seen by this cache manager before return false If not, return true . More... | |
void | clear () |
Clear contents. More... | |
bool | contains (const RooArgSet *set1, const RooArgSet *set2=nullptr, const TNamed *set2RangeName=nullptr) |
bool | containsSet1 (const RooArgSet *set1) |
std::size_t | entries () const |
int | index (const RooArgSet *set1, const RooArgSet *set2=nullptr, const TNamed *set2RangeName=nullptr) |
void | initialize (const RooNormSetCache &other) |
const std::string & | nameSet1 () const |
const std::string & | nameSet2 () const |
Private Types | |
typedef std::map< Pair, std::size_t > | PairIdxMapType |
typedef std::vector< Pair > | PairVectType |
Private Attributes | |
std::size_t | _max |
! More... | |
std::string | _name1 |
! More... | |
std::string | _name2 |
! More... | |
std::size_t | _next = 0 |
! More... | |
PairVectType | _pairs |
! More... | |
PairIdxMapType | _pairToIdx |
! More... | |
TNamed * | _set2RangeName = nullptr |
! More... | |
#include <RooNormSetCache.h>
|
private |
Definition at line 42 of file RooNormSetCache.h.
|
private |
Definition at line 41 of file RooNormSetCache.h.
|
inline |
Definition at line 45 of file RooNormSetCache.h.
Add given pair of RooArgSet pointers to our store.
Definition at line 57 of file RooNormSetCache.cxx.
bool RooNormSetCache::autoCache | ( | const RooAbsArg * | self, |
const RooArgSet * | set1, | ||
const RooArgSet * | set2 = nullptr , |
||
const TNamed * | set2RangeName = nullptr , |
||
bool | doRefill = true |
||
) |
If RooArgSets set1 and set2 or sets with similar contents have been seen by this cache manager before return false
If not, return true
.
If sets have not been seen and doRefill is true, update cache reference to current input sets.
Definition at line 90 of file RooNormSetCache.cxx.
void RooNormSetCache::clear | ( | ) |
Clear contents.
Definition at line 41 of file RooNormSetCache.cxx.
|
inline |
Definition at line 62 of file RooNormSetCache.h.
Definition at line 66 of file RooNormSetCache.h.
|
inline |
Definition at line 83 of file RooNormSetCache.h.
|
inline |
Definition at line 49 of file RooNormSetCache.h.
|
inline |
Definition at line 85 of file RooNormSetCache.h.
|
inline |
Definition at line 75 of file RooNormSetCache.h.
|
inline |
Definition at line 76 of file RooNormSetCache.h.
|
private |
!
Definition at line 91 of file RooNormSetCache.h.
|
private |
!
Definition at line 94 of file RooNormSetCache.h.
|
private |
!
Definition at line 95 of file RooNormSetCache.h.
|
private |
!
Definition at line 92 of file RooNormSetCache.h.
|
private |
!
Definition at line 89 of file RooNormSetCache.h.
|
private |
!
Definition at line 90 of file RooNormSetCache.h.
|
private |
!
Definition at line 96 of file RooNormSetCache.h.