#include "RooFit.h"
#include "RooRealConstant.h"
#include "RooRealConstant.h"
#include "RooConstVar.h"
#include "RooArgList.h"
ClassImp(RooRealConstant)
;
RooArgList* RooRealConstant::_constDB = 0;
TIterator* RooRealConstant::_constDBIter = 0;
RooConstVar& RooRealConstant::value(Double_t value)
{
init() ;
RooConstVar* var ;
while((var=(RooConstVar*)_constDBIter->Next())) {
if (var->getVal()==value) return *var ;
}
char label[128] ;
sprintf(label,"%8.6f",value) ;
var = new RooConstVar(label,label,value) ;
var->setAttribute("RooRealConstant_Factory_Object",kTRUE) ;
_constDB->add(*var) ;
return *var ;
}
void RooRealConstant::init()
{
if (!_constDB) {
_constDB = new RooArgList("RooRealVar Constants Database") ;
_constDBIter = _constDB->createIterator() ;
} else {
_constDBIter->Reset() ;
}
}
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.