37 width_m(right.width_m) {
48 endField = startField + 0.005;
54 *
gmsg <<
"Septum initialise" <<
endl;
73 double rbunch_max = std::hypot(xmax, ymax);
85 const double halfLength =
width_m / 2.0 * std::hypot(slope, 1);
87 const double intcept1 = intcept - halfLength;
88 const double intcept2 = intcept + halfLength;
90 for (
unsigned int i = 0; i < bunch->
getLocalNum(); ++i) {
93 double line1 =
std::abs(slope *
R(0) + intcept1);
94 double line2 =
std::abs(slope *
R(0) + intcept2);
105 t, bunch->
Q[i], bunch->
M[i]),
106 std::make_pair(turnnumber, bunch->
bunchNum[i]));
T::PETE_Expr_t::PETE_Return_t max(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)
ParticleAttrib< int > Bin
size_t getLocalNum() const
ParticleAttrib< double > M
ParticleAttrib< Vector_t > P
ParticleAttrib< double > Q
void get_bounds(Vector_t &rmin, Vector_t &rmax)
ParticleAttrib< short > bunchNum
virtual void visitSeptum(const Septum &)=0
Apply the algorithm to a septum magnet.
void setGeom(const double dist)
Sets geometry geom_m with element width dist.
double xstart_m
input geometry positions
std::unique_ptr< LossDataSink > lossDs_m
Pointer to Loss instance.
virtual bool doCheck(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep) override
Record hits when bunch particles pass.
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField) override
virtual bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
double width_m
input geometry positions
void setWidth(double width)
Member variable access.
virtual ElementBase::ElementType getType() const override
Override implementation of PluginElement.
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Septum.
virtual void doInitialise(PartBunchBase< double, 3 > *bunch) override
Hook for initialise.