48 opcharge_m(right.opcharge_m),
49 opmass_m(right.opmass_m),
50 opyield_m(right.opyield_m),
102 double rbunch_max = std::hypot(xmax, ymax);
104 if (rbunch_max >
rmin_m - 1
e-2) {
112 bool flagNeedUpdate =
false;
119 for (
unsigned int i = 0; i < tempnum; ++i) {
125 if (pflag == 0)
continue;
128 double dist1 = (
A_m * bunch->
R[i](0) +
B_m * bunch->
R[i](1) +
C_m) /
R_m;
129 double dist2 = dist1 *
std::sqrt(1.0 + 1.0 / tangle / tangle);
133 strippoint(2) = bunch->
R[i](2);
135 strippoint, bunch->
P[i],
136 t+dt, bunch->
Q[i], bunch->
M[i]),
137 std::make_pair(turnnumber, bunch->
bunchNum[i]));
139 flagNeedUpdate =
true;
146 if (bunch->
ID[i] == 0)
158 size_t index = tempnum + count;
159 bunch->
R[index] = bunch->
R[i];
160 bunch->
P[index] = bunch->
P[i];
161 bunch->
Q[index] = bunch->
Q[i];
162 bunch->
M[index] = bunch->
M[i];
166 bunch->
Bin[index] = bunch->
Bin[i];
173 return flagNeedUpdate;
187 return flagNeedUpdate;
Tps< T > sqrt(const Tps< T > &x)
Square root.
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
bool reduce(Communicate &, InputIterator, InputIterator, OutputIterator, const ReduceOp &, bool *IncludeVal=0)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
Inform & level4(Inform &inf)
constexpr double q_e
The elementary charge in As.
constexpr double e
The value of.
constexpr double c
The velocity of light in m/s.
ParticleAttrib< int > Bin
ParticleOrigin getPOrigin() const
size_t getLocalNum() const
ParticleAttrib< double > M
ParticleAttrib< Vector_t > P
ParticleAttrib< ParticleOrigin > POrigin
ParticleAttrib< double > Q
void setPOrigin(ParticleOrigin)
void get_bounds(Vector_t &rmin, Vector_t &rmax)
ParticleAttrib< short > bunchNum
virtual void visitStripper(const Stripper &)=0
Apply the algorithm to a particle stripper.
virtual const std::string & getName() const
Get element name.
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
double opcharge_m
Charge number of the out-coming particle.
virtual bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
void setOPCharge(double charge)
Member variable access.
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Stripper.
virtual ElementBase::ElementType getType() const override
Override implementation of PluginElement.
double getOPCharge() const
void setStop(bool stopflag)
void setOPYield(double yield)
void setOPMass(double mass)
double opmass_m
Mass of the out-coming particle.
virtual bool doCheck(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep) override
Record hits when bunch particles pass.
double getOPYield() const
double opyield_m
Yield of the out-coming particle.
virtual void doFinalise() override
Virtual hook for finalise.
bool stop_m
Flag if particles should be stripped or stopped.
virtual bool doFinaliseCheck(PartBunchBase< double, 3 > *bunch, bool flagNeedUpdate) override
Virtual hook for finaliseCheck.