73 for (std::map<TString,ExpensiveObject*>::iterator iter =
_map.begin() ; iter!=
_map.end() ; ++iter) {
180 for (std::map<TString,ExpensiveObject*>::iterator iter =
_map.begin() ; iter !=
_map.end() ; ++iter) {
181 if (iter->second->uid() == uid) {
182 return iter->second->payload() ;
196 for (std::map<TString,ExpensiveObject*>::iterator iter =
_map.begin() ; iter !=
_map.end() ; ++iter) {
197 if (iter->second->uid() == uid) {
198 _map.erase(iter->first) ;
213 for (std::map<TString,ExpensiveObject*>::iterator iter =
_map.begin() ; iter !=
_map.end() ; ++iter) {
214 if (iter->second->uid() == uid) {
215 iter->second->setPayload(obj) ;
259 oocoutW(&inPayload,
Caching) <<
"RooExpensiveObject::registerObject() WARNING: ignoring non-RooAbsReal/non-RooAbsCategory reference parameter " << arg->
GetName() << endl ;
272 _realRefParams(other._realRefParams),
273 _catRefParams(other._catRefParams),
274 _ownerName(other._ownerName)
297 if (_payload->IsA() != tc) {
333 map<TString,ExpensiveObject*>::const_iterator iter =
_map.begin() ;
335 while(iter!=
_map.end()) {
336 cout <<
"uid = " << iter->second->uid() <<
" key=" << iter->first <<
" value=" ;
337 iter->second->print() ;
348 cout << _payload->IsA()->GetName() <<
"::" << _payload->GetName() ;
349 if (_realRefParams.size()>0 || _catRefParams.size()>0) {
350 cout <<
" parameters=( " ;
351 auto iter = _realRefParams.begin() ;
352 while(iter!=_realRefParams.end()) {
353 cout << iter->first <<
"=" << iter->second <<
" " ;
356 auto iter2 = _catRefParams.begin() ;
357 while(iter2!=_catRefParams.end()) {
358 cout << iter2->first <<
"=" << iter2->second <<
" " ;
373 map<TString,ExpensiveObject*>::const_iterator iter = other.
_map.begin() ;
374 while(iter!=other.
_map.end()) {
375 if (
string(ownerName)==iter->second->ownerName()) {
378 oocoutI(iter->second->payload(),
Caching) <<
"RooExpensiveObjectCache::importCache() importing cache object "
379 << iter->first <<
" associated with object " << iter->second->ownerName() << endl ;
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
virtual Int_t getIndex() const
Return index number of current state.
TIterator * createIterator(Bool_t dir=kIterForward) const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Double_t getVal(const RooArgSet *set=0) const
Evaluate object. Returns either cached value or triggers a recalculation.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
std::map< TString, Double_t > _realRefParams
Bool_t matches(TClass *tc, const RooArgSet ¶ms)
Check object type ;.
virtual ~ExpensiveObject()
std::map< TString, Int_t > _catRefParams
const TObject * payload() const
RooExpensiveObjectCache is a singleton class that serves as repository for objects that are expensive...
static void cleanup()
Static function called by RooSentinel atexit() handler to cleanup at end of program.
const TObject * getObj(Int_t uniqueID)
Retrieve payload object of cache element with given unique ID
Bool_t registerObject(const char *ownerName, const char *objectName, TObject &cacheObject, TIterator *paramIter)
Register object associated with given name and given associated parameters with given values in cache...
RooExpensiveObjectCache()
Constructor.
static RooExpensiveObjectCache * _instance
std::map< TString, ExpensiveObject * > _map
const TObject * retrieveObject(const char *name, TClass *tclass, const RooArgSet ¶ms)
Retrieve object from cache that was registered under given name with given parameters,...
Bool_t clearObj(Int_t uniqueID)
Clear cache element with given unique ID Retrieve payload object of cache element with given unique I...
void importCacheObjects(RooExpensiveObjectCache &other, const char *ownerName, Bool_t verbose=kFALSE)
void clearAll()
Clear all cache elements.
virtual ~RooExpensiveObjectCache()
Destructor.
static RooExpensiveObjectCache & instance()
Return reference to singleton instance.
Bool_t setObj(Int_t uniqueID, TObject *obj)
Place new payload object in cache element with given unique ID.
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
The ROOT global object gROOT contains a list of all defined classes.
Iterator abstract base class.
virtual TObject * Next()=0
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)