CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
ParameterSum.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: ParameterSum.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
3#include "CLHEP/GenericFunctions/ParameterSum.hh"
4#include "CLHEP/GenericFunctions/Parameter.hh"
5
6namespace Genfun {
7PARAMETER_OBJECT_IMP(ParameterSum)
8
10 _arg1(arg1->clone()),
11 _arg2(arg2->clone())
12{
13 if (arg1->parameter() && _arg1->parameter()) _arg1->parameter()->connectFrom(arg1->parameter());
14 if (arg2->parameter() && _arg2->parameter()) _arg2->parameter()->connectFrom(arg2->parameter());
15}
16
19_arg1(right._arg1->clone()),
20_arg2(right._arg2->clone())
21{}
22
23
25{
26 delete _arg1;
27 delete _arg2;
28}
29
30
31double ParameterSum::getValue() const {
32 return _arg1->getValue()+_arg2->getValue();
33}
34
35} // namespace Genfun
#define PARAMETER_OBJECT_IMP(classname)
Definition: AbsParameter.hh:86
virtual double getValue() const =0
virtual Parameter * parameter()
Definition: AbsParameter.hh:42
ParameterSum(const AbsParameter *arg1, const AbsParameter *arg2)
Definition: ParameterSum.cc:9
virtual double getValue() const
Definition: ParameterSum.cc:31
void connectFrom(const AbsParameter *source)
Definition: Parameter.cc:95
Definition: Abs.hh:14