18#ifndef OPAL_BEAMLINE_H
19#define OPAL_BEAMLINE_H
35template <
class T,
unsigned Dim>
70 void switchElements(
const double &,
const double &,
const double &kineticEnergy,
const bool &nomonitors =
false);
104template<
class T>
inline
107 double startField = 0.0;
108 double endField = 0.0;
109 std::shared_ptr<T> elptr(
dynamic_cast<T *
>(element.clone()));
113 if (elptr->isElementPositionSet())
114 startField = elptr->getElementPosition();
116 elptr->initialise(bunch, startField, endField);
123 double startField = 0.0;
124 double endField = 0.0;
125 std::shared_ptr<Source> elptr(
dynamic_cast<Source *
>(element.
clone()));
129 if (elptr->isElementPositionSet())
130 startField = elptr->getElementPosition();
132 elptr->initialise(bunch, startField, endField);
168 return comp->getCSTrafoGlobal2Local().transformTo(r);
174 return comp->getCSTrafoGlobal2Local().transformFrom(r);
180 return comp->getCSTrafoGlobal2Local().rotateTo(r);
186 return comp->getCSTrafoGlobal2Local().rotateFrom(r);
191 return comp->getCSTrafoGlobal2Local();
201 return comp->getMisalignment();
std::list< ClassicField > FieldList
Inform & endl(Inform &inf)
virtual ElementBase * clone() const =0
Return clone.
std::string getTypeString() const
Vector_t rotateFrom(const Vector_t &r) const
Vector_t transformFrom(const Vector_t &r) const
Vector_t transformTo(const Vector_t &r) const
Vector_t rotateTo(const Vector_t &r) const
FieldList getElementByType(ElementType)
Vector_t rotateFrom(const Vector_t &r) const
Vector_t transformFromLocalCS(const std::shared_ptr< Component > &comp, const Vector_t &r) const
Vector_t rotateToLocalCS(const std::shared_ptr< Component > &comp, const Vector_t &r) const
double getEnd(const Vector_t &) const
void positionElementRelative(std::shared_ptr< ElementBase >)
void visit(const T &, BeamlineVisitor &, PartBunchBase< double, 3 > *)
CoordinateSystemTrafo getMisalignment(const std::shared_ptr< Component > &comp) const
void merge(OpalBeamline &rhs)
Vector_t transformTo(const Vector_t &r) const
double getStart(const Vector_t &) const
Vector_t transformFrom(const Vector_t &r) const
Vector_t transformToLocalCS(const std::shared_ptr< Component > &comp, const Vector_t &r) const
ParticleMatterInteractionHandler * getParticleMatterInteractionHandler(const unsigned int &)
Vector_t rotateFromLocalCS(const std::shared_ptr< Component > &comp, const Vector_t &r) const
CoordinateSystemTrafo coordTransformationTo_m
void print(Inform &) const
void switchElements(const double &, const double &, const double &kineticEnergy, const bool &nomonitors=false)
unsigned long getFieldAt(const unsigned int &, const Vector_t &, const long &, const double &, Vector_t &, Vector_t &)
CoordinateSystemTrafo getCSTrafoLab2Local() const
BoundaryGeometry * getBoundaryGeometry(const unsigned int &)
Vector_t rotateTo(const Vector_t &r) const
std::set< std::shared_ptr< Component > > getElements(const Vector_t &x)
void swap(OpalBeamline &rhs)