20 #ifndef CLASSIC_TBeamline_HH
21 #define CLASSIC_TBeamline_HH
131 virtual void append(
const T &);
166 itsCoordTrafoTo_m(1.0, 0.0, 0.0, 0.0),
167 relativePositions_m(false)
177 itsCoordTrafoTo_m(1.0, 0.0, 0.0, 0.0),
178 relativePositions_m(false)
187 itsOrigin_m(rhs.itsOrigin_m),
188 itsCoordTrafoTo_m(rhs.itsCoordTrafoTo_m),
189 relativePositions_m(rhs.relativePositions_m)
207 for(
typename std::list<T>::const_reverse_iterator op = this->rbegin();
208 op != this->rend(); ++op) {
212 for(
typename std::list<T>::const_iterator op = this->
begin();
213 op != this->
end(); ++op) {
224 for(
typename std::list<T>::const_iterator op = this->
begin();
225 op != this->
end(); ++op) {
228 newObj.setElement(op->getElement()->clone());
247 for(
typename std::list<T>::const_iterator iter = this->
begin();
248 iter != this->
end(); ++iter) {
251 newObj.setElement(iter->getElement()->copyStructure());
264 template <
class T>
inline
268 for(
typename std::list<T>::const_iterator iter = this->
begin();
269 iter != this->
end(); ++iter) {
270 iter->getElement()->makeSharable();
275 template <
class T>
inline
281 template <
class T>
inline
291 for(
typename std::list<T>::const_iterator iter = this->
begin();
292 iter != this->
end(); ++iter) {
293 length += iter->getElement()->getArcLength();
304 for(
typename std::list<T>::const_iterator iter = this->
begin();
305 iter != this->
end(); ++iter) {
306 length += iter->getElement()->getElementLength();
315 return (getArcLength() / 2.0);
321 return (- getOrigin());
327 return (getArcLength() / 2.0);
336 double s1 = getEntrance();
337 typename std::list<T>::const_iterator iter = this->
begin();
339 while(iter != this->
end() && s1 <= toS) {
345 double s0 = (s1 + s2) / 2.0;
346 double arc1 =
std::max(s1, fromS) - s0;
347 double arc2 =
std::min(s2, toS) - s0;
355 double s1 = getExit();
356 typename std::list<T>::const_reverse_iterator iter = this->rbegin();
358 while(iter != this->rend() && s1 >= toS) {
364 double s0 = (s1 + s2) / 2.0;
365 double arc1 =
std::min(s1, fromS) - s0;
366 double arc2 =
std::max(s2, toS) - s0;
383 for(
typename std::list<T>::const_iterator iter = this->
begin();
384 iter != this->
end(); ++iter) {
385 transform.
dotBy(iter->getElement()->getTotalTransform());
394 return getTransform(0.0, s);
400 return getTransform(0.0, getEntrance());
406 return getTransform(0.0, getExit());
410 template <
class T>
inline
416 template <
class T>
inline
418 this->push_back(obj);
422 template <
class T>
inline
424 this->push_front(obj);
427 template <
class T>
inline
432 template <
class T>
inline
437 template <
class T>
inline
439 itsCoordTrafoTo_m = trafoTo;
442 template <
class T>
inline
444 return itsCoordTrafoTo_m;
447 template <
class T>
inline
449 relativePositions_m = flag;
452 template <
class T>
inline
454 return relativePositions_m;
460 for(
typename std::list<T>::const_iterator iter = this->
begin();
461 iter != this->
end(); ++iter) {
468 #endif // CLASSIC_TBeamline_HH
BeamlineGeometry itsGeometry
The beamline geometry.
virtual Euclid3D getEntranceFrame() const
Get transform.
virtual double getOrigin() const
Get origin position.
void setInitialDirection(const Quaternion &rot)
Implements the composite geometry of a beam line.
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent this
virtual double getArcLength() const
Get arc length.
bool getRelativeFlag() const
virtual double getEntrance() const
Get entrance position.
virtual double getArcLength() const
Get arc length.
An abstract sequence of beam line components.
virtual void makeSharable()
Set sharable flag.
virtual Euclid3D getTotalTransform() const
Get transform.
clearpage the user may choose between constant or variable radius This model includes fringe fields begin
virtual TBeamline< T > * clone() const
Make clone.
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
Quaternion itsCoordTrafoTo_m
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
virtual void append(const T &)
Append a T object.
virtual void accept(BeamlineVisitor &) const
Apply BeamlineVisitor to this line.
size_t size() const
Get the number of elements in the TBeamline.
virtual void iterate(BeamlineVisitor &, bool r2l) const
Apply visitor to all elements of the line.
Vector_t getOrigin3D() const
const Euclid3D & dotBy(const Euclid3D &rhs)
Dot product with assign.
virtual BeamlineGeometry & getGeometry()
Get geometry.
virtual Euclid3D getTransform(double fromS, double toS) const
Get transform.
virtual Euclid3D getTransform(double fromS, double toS) const
Get transform.
virtual void prepend(const T &)
Prepend a T object.
TBeamline()
Default constructor.
virtual double getExit() const
Get exit position.
Displacement and rotation in space.
virtual ElementType getType() const
Get beamline type.
Quaternion getInitialDirection() const
void setOrigin3D(const Vector_t &ori)
void setRelativeFlag(bool flag)
virtual void visitBeamline(const Beamline &)=0
Apply the algorithm to a beam line.
virtual TBeamline< T > * copyStructure()
Make structure copy.
virtual Euclid3D getExitFrame() const
Get transform.
virtual double getElementLength() const
Get design length.