45 bool singlemode = (bunch->
getTotalNum() == 1) ?
true :
false;
69 double xmin =
std::min(std::abs(rmin(0)), std::abs(rmax(0)));
70 double xmax =
std::max(std::abs(rmin(0)), std::abs(rmax(0)));
71 double ymin =
std::min(std::abs(rmin(1)), std::abs(rmax(1)));
72 double ymax =
std::max(std::abs(rmin(1)), std::abs(rmax(1)));
73 double rbunch_min = std::hypot(xmin, ymin);
74 double rbunch_max = std::hypot(xmax, ymax);
76 if (rbunch_max >
rmin_m - 0.01 && rbunch_min <
rend_m + 0.01) {
86 for (
unsigned int i = 0; i < tempnum; ++i) {
100 double dist1 = (
A_m * bunch->
R(i)(0) +
B_m * bunch->
R(i)(1) +
C_m) /
R_m;
101 double dist2 = dist1 * std::sqrt(1.0 + 1.0 / tangle / tangle);
106 probepoint = bunch->
R(i) + dist2 * bunch->
P(i) / std::sqrt(
dot(bunch->
P(i), bunch->
P(i)));
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
Inform & endl(Inform &inf)
KOKKOS_INLINE_FUNCTION Vector< T, Dim > max(const Vector< T, Dim > &a, const Vector< T, Dim > &b)
KOKKOS_INLINE_FUNCTION Vector< T, Dim > min(const Vector< T, Dim > &a, const Vector< T, Dim > &b)
virtual void visitProbe(const Probe &)=0
Apply the algorithm to a Probe.
virtual const std::string & getName() const
Get element name.
std::string getOutputFN() const
Get output filename.
int checkPoint(const double &x, const double &y) const
Checks if coordinate is within element.
double C_m
Geometric lengths used in calculations.
void changeWidth(PartBunch_t *bunch, int i, const double tstep, const double tangle)
Change probe width depending on step size and angle of particle.
double calculateIncidentAngle(double xp, double yp) const
Calculate angle of particle/bunch wrt to element.
double rmin_m
radius closest to the origin
void setStep(double step)
Set probe histogram bin width.
std::unique_ptr< PeakFinder > peakfinder_m
Pointer to Peakfinder instance.
virtual void doInitialise(PartBunch_t *bunch) override
Initialise peakfinder file.
virtual bool doCheck(PartBunch_t *bunch, const int turnnumber, const double t, const double tstep) override
Record probe hits when bunch particles pass.
virtual bool doPreCheck(PartBunch_t *) override
Virtual hook for preCheck.
double step_m
Step size of the probe (bin width in histogram file)
virtual void doGoOffline() override
Hook for goOffline.
virtual ElementType getType() const override
Get element type std::string.
virtual double getStep() const
Member variable access.
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Probe.
Vector_t< double, Dim > R(size_t)
void get_bounds(Vector_t< T, Dim > &rmin, Vector_t< T, Dim > &rmax) const
size_t getLocalNum() const
ParticleAttrib< Vector_t< T, Dim > > P
size_t getTotalNum() const