19 #ifndef CLASSIC_PluginElement_HH
20 #define CLASSIC_PluginElement_HH
26 template <
class T,
unsigned Dim>
46 virtual
bool bends() const override;
47 virtual
void getDimensions(
double &zBegin,
double &zEnd) const override;
50 virtual
bool apply(const
size_t &i,
63 void setDimensions(
double xstart,
double xend,
double ystart,
double yend);
72 bool check(
PartBunchBase<
double, 3> *bunch, const
int turnnumber, const
double t, const
double tstep);
74 int checkPoint(const
double & x, const
double & y) const;
80 void setGeom(const
double dist);
Interface for a single beam element.
virtual void doInitialise(PartBunchBase< double, 3 > *)
Pure virtual hook for initialise.
int checkPoint(const double &x, const double &y) const
Checks if coordinate is within element.
void setGeom(const double dist)
Sets geometry geom_m with element width dist.
virtual void getDimensions(double &zBegin, double &zEnd) const override
virtual bool bends() const override
double C_m
Geometric lengths used in calculations.
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
Pure virtual implementation of Component.
virtual void finalise() final
virtual void doSetGeom()
Virtual hook for setGeom.
virtual void doGoOffline()
Virtual hook for goOffline.
void changeWidth(PartBunchBase< double, 3 > *bunch, int i, const double tstep, const double tangle)
Change probe width depending on step size and angle of particle.
int numPassages_m
Number of turns (number of times save() method is called)
Point geom_m[5]
actual geometry positions with adaptive width such that each particle hits element once per turn
bool check(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep)
virtual bool doFinaliseCheck(PartBunchBase< double, 3 > *, bool flagNeedUpdate)
Virtual hook for finaliseCheck.
virtual bool doPreCheck(PartBunchBase< double, 3 > *)
Virtual hook for preCheck.
virtual void doFinalise()
Virtual hook for finalise.
virtual void goOffline() final
void operator=(const PluginElement &)=delete
double calculateIncidentAngle(double xp, double yp) const
Calculate angle of particle/bunch wrt to element.
double xstart_m
input geometry positions
void setDimensions(double xstart, double xend, double ystart, double yend)
Set dimensions and consistency checks.
std::unique_ptr< LossDataSink > lossDs_m
Pointer to Loss instance.
double getXStart() const
Member variable access.
bool finaliseCheck(PartBunchBase< double, 3 > *bunch, bool flagNeedUpdate)
Finalise call after check.
bool preCheck(PartBunchBase< double, 3 > *bunch)
Check if bunch is close to element.
virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B) override
double rmin_m
radius closest to the origin
virtual bool doCheck(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep)=0
Pure virtual hook for check.
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B) override