74 for (std::map<TString,ExpensiveObject*>::iterator
iter =
_map.begin() ;
iter!=
_map.end() ; ++
iter) {
181 for (std::map<TString,ExpensiveObject*>::iterator
iter =
_map.begin() ;
iter !=
_map.end() ;
iter++) {
182 if (
iter->second->uid() == uid) {
183 return iter->second->payload() ;
197 for (std::map<TString,ExpensiveObject*>::iterator
iter =
_map.begin() ;
iter !=
_map.end() ;
iter++) {
198 if (
iter->second->uid() == uid) {
214 for (std::map<TString,ExpensiveObject*>::iterator
iter =
_map.begin() ;
iter !=
_map.end() ;
iter++) {
215 if (
iter->second->uid() == uid) {
216 iter->second->setPayload(obj) ;
260 oocoutW(&inPayload,
Caching) <<
"RooExpensiveObject::registerObject() WARNING: ignoring non-RooAbsReal/non-RooAbsCategory reference parameter " << arg->
GetName() << endl ;
273 _realRefParams(other._realRefParams),
274 _catRefParams(other._catRefParams),
275 _ownerName(other._ownerName)
298 if (_payload->IsA() != tc) {
334 map<TString,ExpensiveObject*>::const_iterator
iter =
_map.begin() ;
336 while(iter!=
_map.end()) {
337 cout <<
"uid = " << iter->second->uid() <<
" key=" << iter->first <<
" value=" ;
338 iter->second->print() ;
349 cout << _payload->IsA()->GetName() <<
"::" << _payload->GetName() ;
350 if (_realRefParams.size()>0 || _catRefParams.size()>0) {
351 cout <<
" parameters=( " ;
352 map<TString,Double_t>::iterator
iter = _realRefParams.begin() ;
353 while(iter!=_realRefParams.end()) {
354 cout << iter->first <<
"=" << iter->second <<
" " ;
357 map<TString,Int_t>::iterator iter2 = _catRefParams.begin() ;
358 while(iter2!=_catRefParams.end()) {
359 cout << iter2->first <<
"=" << iter2->second <<
" " ;
374 map<TString,ExpensiveObject*>::const_iterator
iter = other.
_map.begin() ;
375 while(iter!=other.
_map.end()) {
376 if (
string(ownerName)==iter->second->ownerName()) {
379 oocoutI(iter->second->payload(),
Caching) <<
"RooExpensiveObjectCache::importCache() importing cache object "
380 << iter->first <<
" associated with object " << iter->second->ownerName() << endl ;
void clearAll()
Clear all cache elements.
virtual ~ExpensiveObject()
Bool_t clearObj(Int_t uniqueID)
Clear cache element with given unique ID Retrieve payload object of cache element with given unique I...
static void cleanup()
Static function called by RooSentinel atexit() handler to cleanup at end of program.
Bool_t matches(TClass *tc, const RooArgSet ¶ms)
Check object type ;.
virtual Int_t getIndex() const
Return index number of current state.
std::map< TString, Int_t > _catRefParams
std::map< TString, ExpensiveObject * > _map
static RooExpensiveObjectCache * _instance
virtual ~RooExpensiveObjectCache()
Destructor.
const TObject * retrieveObject(const char *name, TClass *tclass, const RooArgSet ¶ms)
Retrieve object from cache that was registered under given name with given parameters, if current parameter values match those that were stored in the registry for this object.
Iterator abstract base class.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
std::map< std::string, std::string >::const_iterator iter
TIterator * createIterator(Bool_t dir=kIterForward) const
Double_t getVal(const RooArgSet *set=0) const
void importCacheObjects(RooExpensiveObjectCache &other, const char *ownerName, Bool_t verbose=kFALSE)
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
std::map< TString, Double_t > _realRefParams
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
const TObject * payload() const
RooExpensiveObjectCache()
Constructor.
Bool_t setObj(Int_t uniqueID, TObject *obj)
Place new payload object in cache element with given unique ID.
static RooExpensiveObjectCache & instance()
Return reference to singleton instance.
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Mother of all ROOT objects.
virtual TObject * Next()=0
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
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...