CSRWakeFunction.hh 1.45 KB
Newer Older
gsell's avatar
gsell committed
1 2 3 4 5
#ifndef CSRWAKEFUNCTION_HH
#define CSRWAKEFUNCTION_HH

#include "Solvers/WakeFunction.hh"
#include <vector>
6
#include <string>
gsell's avatar
gsell committed
7 8

class ElementBase;
9
class Filter;
gsell's avatar
gsell committed
10 11 12 13 14 15 16

class CSRWakeFunction: public WakeFunction {
public:
    CSRWakeFunction(const std::string &name, ElementBase *element, std::vector<Filter *> filters, const unsigned int &N);

    void apply(PartBunch &bunch);

17 18 19
    void initialize(const ElementBase * ref);

    virtual const std::string getType() const;
gsell's avatar
gsell committed
20 21

private:
22 23 24 25
    void calculateLineDensity(PartBunch & bunch, double meshSpacing);

    void calculateContributionInside(size_t sliceNumber, double angleOfSlice, double meshSpacing);
    void calculateContributionAfter(size_t sliceNumber, double angleOfSlice, double meshSpacing);
gsell's avatar
gsell committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
    double calcPsi(const double &psiInitial, const double &x, const double &Ds) const;

    std::vector<Filter *> filters_m;
    LineDensity lineDensity_m;
    LineDensity dlineDensitydz_m;
    LineDensity d2lineDensitydz2_m;

    // Longitudinal CSR field.
    std::vector<double> Ez_m;

    // Retarded angle Psi;
    std::vector<double> Psi_m;

    // Start position of CSR wake.
    double Begin_m;

    // Start position of equivalent hard edge dipole that approximates actual
    // dipole.
    double FieldBegin_m;

    // Effective length of dipole.
    double Length_m;

    // Radius of curvature of effective dipole.
50 51 52
    double bendRadius_m;

    std::string bendName_m;
gsell's avatar
gsell committed
53

54
    double totalBendAngle_m;
gsell's avatar
gsell committed
55 56 57 58

};

#endif //CSRWAKEFUNCTION_HH