1 #ifndef OPAL_ParallelSliceTracker_HH
2 #define OPAL_ParallelSliceTracker_HH
54 bool revBeam,
bool revTrack);
64 const std::vector<unsigned long long> &maxSTEPS,
66 const std::vector<double> &zstop,
67 const std::vector<double> &dt);
151 void FieldsOutput(
double z,
double Ex,
double Ey,
double Ez,
152 double Bx,
double By,
double Bz);
175 unsigned long long getMaxSteps(std::queue<unsigned long long> numSteps);
304 Inform msg(
"ParallelSliceTracker");
317 pos[0] =
Vector_t(rmax(0), rmax(1), rmax(2));
318 pos[1] =
Vector_t(0.0, 0.0, sposRef);
319 pos[2] =
Vector_t(rmin(0), rmin(1), rmin(2));
321 for(
int k = 0; k < 3; ++k) {
326 bunch_time, externalE, externalB);
328 FDext[2*k] = externalB;
329 FDext[2*k+1] = externalE * 1
e-6;
344 Inform msg(
"ParallelSliceTracker");
352 pos[0] =
Vector_t(rmax(0), rmax(1), rmax(2));
353 pos[1] =
Vector_t(0.0, 0.0, sposRef);
354 pos[2] =
Vector_t(rmin(0), rmin(1), rmin(2));
356 for(
int k = 0; k < 3; ++k) {
359 FDext[2*k] = externalB;
360 FDext[2*k+1] = externalE * 1
e-6;
365 INFOMSG(
"* Invalid bunch! No statistics dumped." <<
endl);
369 unsigned long long totalNumSteps = 0;
371 while (numSteps.size() > 0) {
372 totalNumSteps += numSteps.front();
376 return totalNumSteps;
IpplTimings::TimerRef WakeFieldTimer_m
virtual void visitCorrector(const Corrector &)
Apply the algorithm to a corrector.
void applyExitFringe(double edge, double curve, const BMultipoleField &field, double scale)
constexpr double e
The value of .
double getT()
returns the current time of the bunch
virtual void visitParallelPlate(const ParallelPlate &)
Apply the algorithm to a ParallelPlate.
virtual void visitBeamline(const Beamline &)
Apply the algorithm to a beam line.
Interface for septum magnet.
core of the envelope tracker based on Rene Bakkers BET implementation
void applyEntranceFringe(double edge, double curve, const BMultipoleField &field, double scale)
Interface for electrostatic separator.
virtual void visitSeptum(const Septum &)
Apply the algorithm to a septum.
void operator=(const ParallelSliceTracker &)
Interface for beam position monitors.
Interface for RF Quadrupole.
IpplTimings::TimerRef timeIntegrationTimer2_m
Define the position of a misaligned element.
OpalBeamline itsOpalBeamline_m
Interface for general corrector.
void kickReferenceParticle(const Vector_t &externalE, const Vector_t &externalB)
Interface for beam diagnostics.
CoordinateSystemTrafo referenceToLabCSTrafo_m
virtual void visitMonitor(const Monitor &)
Apply the algorithm to a monitor.
virtual void visitRFQuadrupole(const RFQuadrupole &)
Apply the algorithm to a RF quadrupole.
void computeExternalFields(OrbitThreader &oth)
Interface for drift space.
void updateReferenceParticle(const BorisPusher &pusher)
unsigned long getFieldAt(const unsigned int &, const Vector_t &, const long &, const double &, Vector_t &, Vector_t &)
std::queue< double > zStop_m
where to stop
std::queue< double > dtAllTracks_m
Interface for general multipole.
int statDumpFreq
The frequency to dump statistical values, e.e. dump data when stepstatDumpFreq==0.
T deg(T x)
Convert radians to degrees.
virtual void visitProbe(const Probe &)
Apply the algorithm to a probe.
virtual ~ParallelSliceTracker()
virtual void visitTravelingWave(const TravelingWave &)
Apply the algorithm to a RF cavity.
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a multipole.
virtual void visitDrift(const Drift &)
Apply the algorithm to a drift.
Vector_t get_rmean() const
void restoreCavityPhases()
virtual void visitSeparator(const Separator &)
Apply the algorithm to a separator.
IpplTimings::TimerRef BinRepartTimer_m
virtual void visitDegrader(const Degrader &)
Apply the algorithm to a drift.
void FieldsOutput(double z, double Ex, double Ey, double Ez, double Bx, double By, double Bz)
virtual void visitAlignWrapper(const AlignWrapper &)
Apply the algorithm to an align wrapper.
virtual void visitCyclotronValley(const CyclotronValley &)
Apply the algorithm to a CyclotronValley.
unsigned long long getMaxSteps(std::queue< unsigned long long > numSteps)
virtual void visitCCollimator(const CCollimator &)
Apply the algorithm to a collimator.
void computeSpaceChargeFields()
void switchElements(double scaleMargin=3.0)
virtual void visitSolenoid(const Solenoid &)
Apply the algorithm to a solenoid.
Interface for cyclotron collimator.
void updateSpaceOrientation(const bool &move=false)
Abstract beam-beam interaction.
void visit(const T &, BeamlineVisitor &, PartBunchBase< double, 3 > *)
double currentSimulationTime_m
Interface for cyclotron valley.
void dumpH5(PartBunchBase< double, 3 > *beam, Vector_t FDext[]) const
virtual void visitDiagnostic(const Diagnostic &)
Apply the algorithm to a diagnostic.
virtual void execute()
Apply the algorithm to the top-level beamline.
Vektor< double, 3 > Vector_t
void writeLastStepPhaseSpace(const long long step, const double &sposRef)
An abstract sequence of beam line components.
void updateRFElement(std::string elName, double maxPhi)
std::queue< unsigned long long > localTrackSteps_m
The maximal number of steps the system is integrated per TRACK.
int psDumpFreq
The frequency to dump the phase space, i.e.dump data when steppsDumpFreq==0.
IpplTimings::TimerRef timeIntegrationTimer1_m
The magnetic field of a multipole.
bool hasEndOfLineReached()
virtual void visitSBend(const SBend &)
Apply the algorithm to a sector bend.
virtual void visitLambertson(const Lambertson &)
Apply the algorithm to a Lambertson.
virtual void visitRBend(const RBend &)
Apply the algorithm to a rectangular bend.
EnvelopeBunch * itsBunch_m
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RF cavity.
void findStartPosition(const BorisPusher &pusher)
void autophaseCavities(const BorisPusher &pusher)
virtual void visitBeamBeam(const BeamBeam &)
Apply the algorithm to a beam-beam.
void dumpSDDS(PartBunchBase< double, 3 > *beam, Vector_t FDext[], const double &azimuth=-1) const
double zstart_m
where to start
void get_bounds(Vector_t &min, Vector_t &max)
returns bounds of envelope bunch
void dumpStats(long long step)
Timing::TimerRef TimerRef
virtual void visitSource(const Source &)
Apply the algorithm to a source.
IpplTimings::TimerRef timeFieldEvaluation_m
void calcBeamParameters()
calculates envelope statistics
void writePhaseSpace(const long long step, const double &sposRef)
Inform & endl(Inform &inf)
virtual void visitFlexibleCollimator(const FlexibleCollimator &)
Apply the algorithm to a flexible collimator.
Interface for a Lambertson septum.
virtual void visitMarker(const Marker &)
Apply the algorithm to a marker.
Track particles or bunches.