10#ifndef EVT_AMPLITUDE_SUM_HH
11#define EVT_AMPLITUDE_SUM_HH
16#include "EvtGenBase/EvtAmplitude.hh"
28 for(i=0;i<other.nTerms();i++) {
36 _term.push_back(amp1);
43 for(i=0;i<_term.size();i++) {
58 _term.push_back(amp.
clone());
68 int nTerms()
const {
return _term.size(); }
73 printf(
"Amplitude has %d terms\n",N);
76 printf(
"c%d = (%f,%f)\n",i,
real(_c[i]),
imag(_c[i]));
90 printf(
"Warning: amplitude sum has zero terms\n");
94 for(i=0;i<_term.size();i++) {
96 value+=_c[i]*_term[i]->evaluate(p);
103 std::vector<EvtComplex> _c;
104 std::vector<EvtAmplitude<T>*> _term;
double imag(const EvtComplex &c)
virtual EvtAmplitude< T > * clone() const
EvtAmplitude< T > * getTerm(int i) const
virtual ~EvtAmplitudeSum()
void addTerm(EvtComplex c, const EvtAmplitude< T > &)
EvtAmplitudeSum(const EvtAmplitudeSum< T > &other)
void addOwnedTerm(EvtComplex c, EvtAmplitude< T > *amp)
virtual EvtComplex amplitude(const T &p) const
EvtComplex c(int i) const
virtual EvtAmplitude< T > * clone() const =0