CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // -*- C++ -*- 00002 // $Id: 00003 #include "CLHEP/GenericFunctions/ParameterComposition.hh" 00004 #include "CLHEP/GenericFunctions/Parameter.hh" 00005 #include "CLHEP/GenericFunctions/AbsFunction.hh" 00006 00007 namespace Genfun { 00008 PARAMETER_OBJECT_IMP(ParameterComposition) 00009 00010 ParameterComposition::ParameterComposition(const AbsFunction *arg1, const AbsParameter *arg2): 00011 AbsParameter(), 00012 _arg1(arg1->clone()), 00013 _arg2(arg2->clone()) 00014 { 00015 if (arg2->parameter() && _arg2->parameter()) _arg2->parameter()->connectFrom(arg2->parameter()); 00016 } 00017 00018 ParameterComposition::ParameterComposition(const ParameterComposition & right) : 00019 AbsParameter(), 00020 _arg1(right._arg1->clone()), 00021 _arg2(right._arg2->clone()) 00022 {} 00023 00024 00025 ParameterComposition::~ParameterComposition() 00026 { 00027 delete _arg1; 00028 delete _arg2; 00029 } 00030 00031 00032 double ParameterComposition::getValue() const { 00033 return _arg1->operator() (_arg2->getValue()); 00034 } 00035 00036 } // namespace Genfun