49 bool singlemode = (bunch->
getTotalNum() == 1) ?
true :
false;
76 double rbunch_min = std::hypot(xmin, ymin);
77 double rbunch_max = std::hypot(xmax, ymax);
79 if (rbunch_max >
rmin_m - 0.01 && rbunch_min <
rend_m + 0.01 ) {
89 for (
unsigned int i = 0; i < tempnum; ++i) {
93 if (pflag == 0)
continue;
102 double dist1 = (
A_m * bunch->
R[i](0) +
B_m * bunch->
R[i](1) +
C_m) /
R_m;
103 double dist2 = dist1 *
std::sqrt(1.0 + 1.0 / tangle / tangle);
112 t+dt, bunch->
Q[i], bunch->
M[i]),
113 std::make_pair(turnnumber, bunch->
bunchNum[i]));
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
Tps< T > sqrt(const Tps< T > &x)
Square root.
T euclidean_norm(const Vector< T > &)
Euclidean norm.
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
constexpr double c
The velocity of light in m/s.
void get_bounds(Vector_t &rmin, Vector_t &rmax) const
size_t getLocalNum() const
ParticleAttrib< double > M
size_t getTotalNum() const
ParticleAttrib< Vector_t > P
ParticleAttrib< double > Q
ParticleAttrib< short > bunchNum
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(PartBunchBase< double, 3 > *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.
std::unique_ptr< LossDataSink > lossDs_m
Pointer to Loss instance.
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 bool doCheck(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep) override
Record probe hits when bunch particles pass.
virtual void doInitialise(PartBunchBase< double, 3 > *bunch) override
Initialise peakfinder file.
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 bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
virtual double getStep() const
Member variable access.
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Probe.