10 #include <CLHEP/Random/RandGauss.h>
11 #include <CLHEP/Random/Random.h>
34 ALIint iast = str.find(
'*');
38 ALIstring unitstr = str.substr(iast+1, str.length() );
42 std::cerr <<
" ParameterMgr::getVal of an ALIstring that is not a number: " << valstr << std::endl;
56 std::cerr <<
" ParameterMgr::getVal of an string that is not a number nor a previous parameter: " << str << std::endl;
63 return atof( str.c_str() ) * dimensionFactor;
72 if(
ALIUtils::debug >= 1)
std::cerr <<
"!! WARNING: PARAMETER " << name <<
" appears twice, it will take first value " << std::endl;
82 CLHEP::HepRandom::setTheSeed( seed );
90 if(
ALIUtils::debug >= 1)
std::cerr <<
"!! WARNING: PARAMETER " << name <<
" appears twice, it will take first value " << std::endl;
94 ALIdouble val = CLHEP::RandGauss::shoot( mean, stddev );
96 if(
ALIUtils::debug >= -2 )
std::cout <<
" addRandomGaussParameter " << name <<
" " << valMean <<
" " << valStdDev <<
" = " << val << std::endl;
106 if(
ALIUtils::debug >= 1)
std::cerr <<
"!! WARNING: PARAMETER " << name <<
" appears twice, it will take first value " << std::endl;
110 ALIdouble val = CLHEP::HepRandom::getTheEngine()->flat();
112 val = val * 2*interval + mean-
interval;
114 if(
ALIUtils::debug >= 2 )
std::cout <<
" addRandomFlatParameter " << name <<
" " << valMean <<
" " << valInterval <<
" = " << val << std::endl;
128 if( namet[0] ==
'-' ) {
130 namet = namet.substr(1, namet.length() );
143 val = (*ite).second * negpar;
static ParameterMgr * getInstance()
ALIint getParameterValue(const ALIstring &name, ALIdouble &val)
void addRandomGaussParameter(const ALIstring &name, const ALIstring &valMean, const ALIstring &valStdDev)
void setRandomSeed(const long seed)
static int IsNumber(const ALIstring &str)
static ParameterMgr * theInstance
void addRandomFlatParameter(const ALIstring &name, const ALIstring &valMean, const ALIstring &valInterval)
static ALIdouble GetValueOf(ALIstring)
ALIdouble getVal(const ALIstring &str, const ALIdouble dimensionFactor=1.)
void addParameter(const ALIstring &name, const ALIstring &valstr)