45 filename_m(right.filename_m),
49 MomentumX_m(right.MomentumX_m),
50 MomentumY_m(right.MomentumY_m),
51 MomentumZ_m(right.MomentumZ_m),
104 double frac = -
R(2) / P(2) * recpgamma;
154 *gmsg <<
"* Finalize Degrader" <<
endl;
158 Inform msg(
"Degrader::goOnline ");
172 Inform msg(
"Degrader::goOffline ");
175 msg <<
" done..." <<
endl;
virtual bool computeEnergyLoss(Vector_t &P, const double deltat, bool includeFluctuations=true) const =0
virtual ParticleMatterInteractionHandler * getParticleMatterInteraction() const
ParticleAttrib< Vector_t > P
virtual bool isInMaterial(double z)
std::vector< double > PosZ_m
virtual ElementBase::ElementType getType() const
Get element type std::string.
std::vector< double > MomentumY_m
virtual void visitDegrader(const Degrader &)=0
Apply the algorithm to a diagnostic.
virtual bool bends() const
std::vector< double > PosY_m
std::vector< double > MomentumZ_m
virtual void getDimensions(double &zBegin, double &zEnd) const
virtual const std::string & getName() const
Get element name.
std::vector< double > MomentumX_m
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B)
virtual void accept(BeamlineVisitor &) const
Apply visitor to Degrader.
virtual double getElementLength() const
Get design length.
constexpr double c
The velocity of light in m/s.
std::vector< double > PosX_m
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField)
PartBunchBase< double, 3 > * RefPartBunch_m
virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B)
virtual void goOnline(const double &kineticEnergy)
size_t getLocalNum() const
std::unique_ptr< LossDataSink > lossDs_m
Tps< T > sqrt(const Tps< T > &x)
Square root.
ParticleAttrib< double > dt
std::vector< double > time_m
std::string getOutputFN()
T euclidean_norm(const Vector< T > &)
Euclidean norm.
double getQ() const
Access to reference data.
std::string getDegraderShape()
ParticleAttrib< int > Bin
Interface for a single beam element.
void setOutputFN(std::string fn)
Inform & endl(Inform &inf)