19#ifndef OPALX_PluginElement_HH
20#define OPALX_PluginElement_HH
39 PartBunch_t* bunch,
double& startField,
double& endField)
override;
43 virtual
bool bends() const override;
44 virtual
void getFieldExtend(
double& zBegin,
double& zEnd) const override;
50 const
size_t& i, const
double& t,
Vector_t<
double, 3>& E,
63 void setDimensions(
double xstart,
double xend,
double ystart,
double yend);
72 bool check(
PartBunch_t* 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);
97 PartBunch_t* bunch,
const int turnnumber,
const double t,
const double tstep) = 0;
Defines the abstract interface for a single beamline component in the accelerator model.
ippl::Vector< T, Dim > Vector_t
Container for all per-particle (and per-simulation) fields tracked during OPALX tracking.
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 getFieldExtend(double &zBegin, double &zEnd) const override
Return the field-support extent of the component.
virtual bool bends() const override
double C_m
Geometric lengths used in calculations.
virtual bool apply(const std::shared_ptr< ParticleContainer_t > &pc) override
void changeWidth(PartBunch_t *bunch, int i, const double tstep, const double tangle)
Change probe width depending on step size and angle of particle.
virtual void finalise() final
virtual void doSetGeom()
Virtual hook for setGeom.
virtual void doGoOffline()
Virtual hook for goOffline.
int numPassages_m
Number of turns (number of times save() method is called)
virtual bool doCheck(PartBunch_t *bunch, const int turnnumber, const double t, const double tstep)=0
Pure virtual hook for check.
virtual bool doFinaliseCheck(PartBunch_t *, bool flagNeedUpdate)
Virtual hook for finaliseCheck.
virtual void doInitialise(PartBunch_t *)
Pure virtual hook for initialise.
bool finaliseCheck(PartBunch_t *bunch, bool flagNeedUpdate)
Finalise call after check.
virtual void doFinalise()
Virtual hook for finalise.
virtual void goOffline() final
void operator=(const PluginElement &)=delete
bool preCheck(PartBunch_t *bunch)
Check if bunch is close to element.
double calculateIncidentAngle(double xp, double yp) const
Calculate angle of particle/bunch wrt to element.
double xstart_m
input geometry positions
virtual void initialise(PartBunch_t *bunch, double &startField, double &endField) override
Pure virtual implementation of Component.
virtual bool doPreCheck(PartBunch_t *)
Virtual hook for preCheck.
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 check(PartBunch_t *bunch, const int turnnumber, const double t, const double tstep)
double rmin_m
radius closest to the origin
virtual bool applyToReferenceParticle(const Vector_t< double, 3 > &R, const Vector_t< double, 3 > &P, const double &t, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B) override
Apply to reference particle with position R and momemtum P.