39 bool singlemode = (bunch->getParticleContainer()->getTotalNum() == 1) ?
true :
false;
45 *
gmsg <<
"* Probe " <<
getName() <<
" goes offline" << endl;
58 double xmin = std::min(std::abs(rmin(0)), std::abs(rmax(0)));
59 double xmax = std::max(std::abs(rmin(0)), std::abs(rmax(0)));
60 double ymin = std::min(std::abs(rmin(1)), std::abs(rmax(1)));
61 double ymax = std::max(std::abs(rmin(1)), std::abs(rmax(1)));
62 double rbunch_min = std::hypot(xmin, ymin);
63 double rbunch_max = std::hypot(xmax, ymax);
65 if (rbunch_max >
rmin_m - 0.01 && rbunch_min <
rend_m + 0.01) {
72 PartBunch_t* bunch,
const int turnnumber,
const double ,
const double tstep) {
73 *
gmsg <<
"passed t argument not used in Probe::doCheck" << endl;
75 size_t tempnum = bunch->getParticleContainer()->getLocalNum();
77 for (
unsigned int i = 0; i < tempnum; ++i) {
81 if (pflag == 0)
continue;
90 double dist1 = (
A_m * bunch->
R(i)(0) +
B_m * bunch->
R(i)(1) +
C_m) /
R_m;
91 double dist2 = dist1 * std::sqrt(1.0 + 1.0 / tangle / tangle);
96 probepoint = bunch->
R(i) + dist2 * bunch->
P(i) / std::sqrt(
dot(bunch->
P(i), bunch->
P(i)));
ippl::Vector< T, Dim > Vector_t
Template PIC bunch: IPPL PicManager, shared field mesh/solver, and multiple particle containers.
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
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.
Vector_t< double, Dim > R(size_t)
Do not use; throws (access positions via ParticleContainer::R).
Vector_t< double, Dim > P(size_t)
Do not use; throws (access momenta via ParticleContainer::P).
void get_bounds(Vector_t< double, Dim > &rmin, Vector_t< double, Dim > &rmax)
Copy cached bunch extent (rmin_m, rmax_m) from calcBeamParameters.
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.