17#ifndef WAKEFUNCTION_HH
18#define WAKEFUNCTION_HH
25template <
class T,
unsigned Dim>
60 LineDensity(
int size = 0,
double defaultValue = 0.0) :
std::vector<double>(size, defaultValue) {}
65 const size_t size = this->size();
66 if(firstDerivative.size() != size)
67 firstDerivative.resize(size, 0.0);
69 firstDerivative[0] = ((*this)[1] - (*this)[0]) / hz;
70 for(
unsigned int i = 1; i + 1 < size; ++i)
71 firstDerivative[i] = ((*
this)[i + 1] - (*this)[i - 1]) / hz;
72 firstDerivative[size - 1] = ((*this)[size - 1] - (*this)[size - 2]) / hz;
const unsigned int nBins_m
const std::string & getName() const
WakeFunction(std::string name, unsigned int n)
virtual void initialize(const ElementBase *)
virtual WakeType getType() const =0
virtual void apply(PartBunchBase< double, 3 > *bunch)=0
LineDensity(int size=0, double defaultValue=0.0)
void getFirstDerivative(std::vector< double > &firstDerivative, const double &hz)