24 os <<
"DDConstant name=" << cons.
name();
27 os <<
" val=" << cons.
value();
30 os <<
" constant is not yet defined, only declared.";
41 const std::vector<std::string> & vars = eval->
variables();
42 const std::vector<std::string> & vals = eval->
values();
43 if (vars.size() != vals.size()) {
44 throw DDException(
"DDConstants::createConstansFromEvaluator(): different size of variable names & values!") ;
46 size_t i(0),
s(vars.size());
48 const std::string & sr = vars[
i];
50 ST i1 = sr.find(
"___");
51 DDName name(std::string(sr,i1+3,sr.size()-1),std::string(sr,0,i1));
52 double* dv =
new double;
53 *dv = eval->
eval(sr.c_str());
58 throw DDException(
"DDConstants::createConstansFromEvaluator(): expression-evaluator is not a ClhepEvaluator-implementation!");
def_type isDefined() const
An exception for DDD errors.
DDName is used to identify DDD entities uniquely.
std::ostream & operator<<(std::ostream &out, const ALILine &li)
static value_type & instance()
Interface of an Expression Evaluator.
const std::vector< std::string > & variables() const
access to the clhep-implementation of the dictionary variables
const std::vector< std::string > & values() const
double value() const
return the first stored value; does not check boundaries!
DDConstant()
an uninitialized constant; one can assign an initialized constant to make it valid ...
static void createConstantsFromEvaluator()
creates all DDConstants from the variables of the ClhepEvaluator
double eval(const std::string &ns, const std::string &expr)
evaluate an expression expr inside the local namespace
a named constant corresponding to the DDL-XML tag <Constant> and <ConstantsVector> ...