20#ifndef CLASSIC_TBeamline_HH
21#define CLASSIC_TBeamline_HH
199 for (
typename std::list<T>::const_reverse_iterator op = this->rbegin(); op != this->rend();
204 for (
typename std::list<T>::const_iterator op = this->
begin(); op != this->
end(); ++op) {
214 for (
typename std::list<T>::const_iterator op = this->
begin(); op != this->
end(); ++op) {
217 newObj.setElement(op->getElement()->clone());
236 for (
typename std::list<T>::const_iterator iter = this->
begin(); iter != this->
end();
240 newObj.setElement(iter->getElement()->copyStructure());
257 for (
typename std::list<T>::const_iterator iter = this->
begin(); iter != this->
end(); ++iter) {
258 iter->getElement()->makeSharable();
276 for (
typename std::list<T>::const_iterator iter = this->
begin(); iter != this->
end(); ++iter) {
277 length += iter->getElement()->getArcLength();
287 for (
typename std::list<T>::const_iterator iter = this->
begin(); iter != this->
end(); ++iter) {
288 length += iter->getElement()->getElementLength();
315 typename std::list<T>::const_iterator iter = this->
begin();
317 while (iter != this->
end() && s1 <= toS) {
323 double s0 = (s1 + s2) / 2.0;
324 double arc1 = std::max(s1, fromS) - s0;
325 double arc2 = std::min(s2, toS) - s0;
334 typename std::list<T>::const_reverse_iterator iter = this->rbegin();
336 while (iter != this->rend() && s1 >= toS) {
342 double s0 = (s1 + s2) / 2.0;
343 double arc1 = std::min(s1, fromS) - s0;
344 double arc2 = std::max(s2, toS) - s0;
360 for (
typename std::list<T>::const_iterator iter = this->
begin(); iter != this->
end(); ++iter) {
361 transform.
dotBy(iter->getElement()->getTotalTransform());
389 this->push_back(obj);
394 this->push_front(obj);
430 for (
typename std::list<T>::const_iterator iter = this->
begin(); iter != this->
end(); ++iter) {
ippl::Vector< T, Dim > Vector_t
PartBunch< T, Dim >::ConstIterator end(PartBunch< T, Dim > const &bunch)
PartBunch< T, Dim >::ConstIterator begin(PartBunch< T, Dim > const &bunch)
virtual void visitBeamline(const Beamline &)=0
Apply the algorithm to a beam line.
virtual const std::string & getName() const
Get element name.
virtual double getArcLength() const
Get arc length.
ElementBase(const std::string &name)
Constructor with given name.
virtual Euclid3D getTransform(double fromS, double toS) const
Get transform.
bool isSharable() const
Test if the element can be shared.
Displacement and rotation in space.
const Euclid3D & dotBy(const Euclid3D &rhs)
Dot product with assign.
Beamline(const std::string &name)
Constructor with given name.
Implements the composite geometry of a beam line.
bool getRelativeFlag() const
TBeamline(const TBeamline< T > &right)
Quaternion getInitialDirection() const
virtual Euclid3D getEntranceFrame() const
Get transform.
void setRelativeFlag(bool flag)
virtual double getArcLength() const
Get arc length.
virtual TBeamline< T > * clone() const
Make clone.
virtual double getEntrance() const
Get entrance position.
size_t size() const
Get the number of elements in the TBeamline.
virtual const BeamlineGeometry & getGeometry() const
Get geometry.
void setOrigin3D(const Vector_t< double, 3 > &ori)
virtual TBeamline< T > * copyStructure()
Make structure copy.
virtual Euclid3D getTotalTransform() const
Get transform.
virtual Euclid3D getExitFrame() const
Get transform.
virtual void prepend(const T &)
Prepend a T object.
virtual Euclid3D getTransform(double s) const
Get transform.
virtual void makeSharable()
Set sharable flag.
virtual double getOrigin() const
Get origin position.
TBeamline()
Default constructor.
virtual Euclid3D getTransform(double fromS, double toS) const
Get transform.
Vector_t< double, 3 > itsOrigin_m
void setInitialDirection(const Quaternion &rot)
virtual void append(const T &)
Append a T object.
virtual ElementType getType() const
Get beamline type.
Quaternion itsCoordTrafoTo_m
virtual double getElementLength() const
Get design length.
Vector_t< double, 3 > getOrigin3D() const
virtual BeamlineGeometry & getGeometry()
Get geometry.
virtual void accept(BeamlineVisitor &) const
Apply BeamlineVisitor to this line.
TBeamline(const std::string &name)
Constructor with given name.
virtual double getExit() const
Get exit position.
virtual void iterate(BeamlineVisitor &, bool r2l) const
Apply visitor to all elements of the line.
BeamlineGeometry itsGeometry