69 for (std::map<TString,ExpensiveObject*>::iterator iter =
_map.begin() ; iter!=
_map.end() ; ++iter) {
156 for (std::map<TString,ExpensiveObject*>::iterator iter =
_map.begin() ; iter !=
_map.end() ; ++iter) {
157 if (iter->second->uid() == uid) {
158 return iter->second->payload() ;
172 for (std::map<TString,ExpensiveObject*>::iterator iter =
_map.begin() ; iter !=
_map.end() ; ++iter) {
173 if (iter->second->uid() == uid) {
174 _map.erase(iter->first) ;
189 for (std::map<TString,ExpensiveObject*>::iterator iter =
_map.begin() ; iter !=
_map.end() ; ++iter) {
190 if (iter->second->uid() == uid) {
191 iter->second->setPayload(obj) ;
235 oocoutW(&inPayload,Caching) <<
"RooExpensiveObject::registerObject() WARNING: ignoring non-RooAbsReal/non-RooAbsCategory reference parameter " << arg->
GetName() << endl ;
248 _realRefParams(other._realRefParams),
249 _catRefParams(other._catRefParams),
250 _ownerName(other._ownerName)
273 if (_payload->IsA() != tc) {
309 map<TString,ExpensiveObject*>::const_iterator iter =
_map.begin() ;
311 while(iter!=
_map.end()) {
312 cout <<
"uid = " << iter->second->uid() <<
" key=" << iter->first <<
" value=" ;
313 iter->second->print() ;
324 cout << _payload->IsA()->GetName() <<
"::" << _payload->GetName() ;
325 if (_realRefParams.size()>0 || _catRefParams.size()>0) {
326 cout <<
" parameters=( " ;
327 auto iter = _realRefParams.begin() ;
328 while(iter!=_realRefParams.end()) {
329 cout << iter->first <<
"=" << iter->second <<
" " ;
332 auto iter2 = _catRefParams.begin() ;
333 while(iter2!=_catRefParams.end()) {
334 cout << iter2->first <<
"=" << iter2->second <<
" " ;
349 map<TString,ExpensiveObject*>::const_iterator iter = other.
_map.begin() ;
350 while(iter!=other.
_map.end()) {
351 if (
string(ownerName)==iter->second->ownerName()) {
354 oocoutI(iter->second->payload(),Caching) <<
"RooExpensiveObjectCache::importCache() importing cache object "
355 << iter->first <<
" associated with object " << iter->second->ownerName() << endl ;
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
RooAbsCategory is the base class for objects that represent a discrete value with a finite number of ...
virtual value_type getCurrentIndex() const
Return index number of current state.
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
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...
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.
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.
TClass instances represent classes, structs and namespaces in the ROOT type system.
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.