|
OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
#include <Twiss.h>


Classes | |
| class | Row |
| Structure for a row of the Twiss table. More... | |
Public Types | |
| typedef TBeamline< Row > | TLine |
Public Types inherited from Table | |
| typedef std::vector< Cell > | CellArray |
| An array of cell descriptors. More... | |
Public Member Functions | |
| virtual | ~Twiss () |
| TLine::const_iterator | begin () const |
| Access to first row. More... | |
| TLine::iterator | begin () |
| Access to first row. More... | |
| TLine::const_iterator | end () const |
| Access to last row. More... | |
| TLine::iterator | end () |
| Access to last row. More... | |
| virtual void | execute () |
| Check validity of the table definition. More... | |
| virtual double | getCell (const PlaceRep &row, const std::string &col) |
| Return a selected value in a selected row. More... | |
| virtual CellArray | getDefault () const |
| Return the default print columns. More... | |
| virtual std::vector< double > | getColumn (const RangeRep &range, const std::string &col) |
| Return column [b]col[/b] of this table, limited by [b]range[/b]. More... | |
| const Row & | getCurrent () const |
| Return current table row in iteration. More... | |
| double | getEX () const |
| Return emittance for mode 1. More... | |
| double | getEY () const |
| Return emittance for mode 2. More... | |
| double | getET () const |
| Return emittance for mode 3. More... | |
| virtual double | getLength () |
| Return the length of the table. More... | |
| virtual const Beamline * | getLine () const |
| Return embedded CLASSIC beamline. More... | |
| virtual std::vector< double > | getRow (const PlaceRep &, const std::vector< std::string > &) |
| Return a table row, possible user-defined. More... | |
| virtual bool | isDependent (const std::string &name) const |
| Check dependency. More... | |
| virtual Expressions::PtrToScalar < double > | makeColumnExpression (const std::string &colName) const |
| Return column expression. More... | |
| virtual bool | matches (Table *rhs) const |
| Check compatibility. More... | |
| void | printTableBody (std::ostream &, const CellArray &) const |
| Print the body to this TWISS table. More... | |
| void | printTableTitle (std::ostream &, const char *title) const |
| Print standard information about the TWISS table. More... | |
| FMatrix< double, 6, 6 > | getCurlyA () const |
| Return initial curly A matrix. More... | |
| FMatrix< double, 6, 6 > | getCurlyA (const Row &) const |
| Curly A map for given row. More... | |
| FMatrix< double, 6, 6 > | getMatrix (const Row &) const |
| Accumulated transfer map. More... | |
| FVector< double, 6 > | getOrbit () const |
| Return initial closed orbit. More... | |
| FVector< double, 6 > | getOrbit (const Row &) const |
| Get orbit in given row. More... | |
| FMatrix< double, 6, 6 > | getSigma () const |
| Initial envelope (Sigma) matrix. More... | |
| FMatrix< double, 6, 6 > | getSigma (const Row &) const |
| Envelope (Sigma) matrix for given row. More... | |
| double | getS (const Row &, int=0, int=0) const |
| Arc length for given row. More... | |
| double | getMUi (const Row &, int i1, int=0) const |
| Three modes, "naive" Twiss functions. More... | |
| double | getBETi (const Row &, int i1, int=0) const |
| double | getALFi (const Row &, int i1, int=0) const |
| double | getBETik (const Row &, int i1, int i2) const |
| Mais-Ripken beta functions. More... | |
| double | getALFik (const Row &, int i1, int i2) const |
| Mais-Ripken alpha functions. More... | |
| double | getGAMik (const Row &, int i1, int i2) const |
| Mais-Ripken gamma functions. More... | |
| double | getCO (const Row &, int i1, int=0) const |
| Closed orbit. More... | |
| double | getDisp (const Row &, int i1, int=0) const |
| Dispersion. More... | |
| double | getEigen (const Row &, int i1, int i2) const |
| Eigenvectors. More... | |
| double | getSigma (const Row &, int i1, int i2) const |
| Sigma matrix. More... | |
| double | getMatrix (const Row &, int i1, int i2) const |
| Transfer matrix. More... | |
Public Member Functions inherited from Table | |
| virtual | ~Table () |
| virtual bool | canReplaceBy (Object *newObject) |
| Test if object can be replaced. More... | |
| virtual void | fill ()=0 |
| Refill the buffer. More... | |
| virtual const std::string | getCategory () const |
| Return the object category as a string. More... | |
| virtual bool | shouldTrace () const |
| Trace flag. More... | |
| virtual bool | shouldUpdate () const |
| Update flag. More... | |
| virtual void | invalidate () |
| Mark this table as invalid, if it is dynamic. More... | |
| virtual void | printTable (std::ostream &, const CellArray &) const =0 |
| Print list for the table. More... | |
Public Member Functions inherited from Object | |
| virtual | ~Object () |
| virtual Object * | clone (const std::string &name)=0 |
| Return a clone. More... | |
| void | copyAttributes (const Object &) |
| Copy attributes from another object. More... | |
| virtual Attribute * | findAttribute (const std::string &name) |
| Find an attribute by name. More... | |
| virtual const Attribute * | findAttribute (const std::string &name) const |
| Find an attribute by name. More... | |
| virtual Object * | makeTemplate (const std::string &, TokenStream &, Statement &) |
| Macro handler function. More... | |
| virtual Object * | makeInstance (const std::string &name, Statement &, const Parser *) |
| Macro handler function. More... | |
| virtual void | parse (Statement &) |
| Parse the object. More... | |
| virtual void | parseShortcut (Statement &) |
| Parser for single-attribute commands. More... | |
| virtual void | print (std::ostream &) const |
| Print the object. More... | |
| virtual void | printValue (std::ostream &) const |
| virtual void | printHelp (std::ostream &) const |
| Print help. More... | |
| virtual void | replace (Object *oldObject, Object *newObject) |
| Replace references. More... | |
| virtual void | update () |
| Update this object. More... | |
| bool | isBuiltin () const |
| True, if [b]this[/b] is a built-in object. More... | |
| virtual bool | isShared () const |
| Shared flag. More... | |
| virtual void | setShared (bool) |
| Set/reset shared flag. More... | |
| void | setDirty (bool) |
| Set/reset the [b]modified[/b] flag. More... | |
| bool | isDirty () const |
| True, if the [b]modified[/b] flag is set. More... | |
| void | setFlag (bool) |
| Flag/unflag this object, e. g. to control output of objects for. More... | |
| bool | isFlagged () const |
| True, if [b]this[/b] is flagged by setFlag(true). More... | |
| const Object * | getBaseObject () const |
| Return the object's base type object. More... | |
| const std::string & | getOpalName () const |
| Return object name. More... | |
| Object * | getParent () const |
| Return parent pointer. More... | |
| bool | isTreeMember (const Object *subTree) const |
| Test for tree membership. More... | |
| void | setOpalName (const std::string &name) |
| Set object name. More... | |
| void | setParent (Object *) |
| Set parent object. More... | |
| void | clear () |
| Clear the occurrence counter. More... | |
| int | increment () |
| Increment and return the occurrence counter. More... | |
| int | occurrenceCount () |
| Return the occurrence counter. More... | |
| void | registerReference (Invalidator *a) |
| Register a reference to this object. More... | |
| void | unregisterReference (Invalidator *a) |
| Unegister a reference to this object. More... | |
| void | registerOwnership (const AttributeHandler::OwnerType &itsClass) const |
Public Member Functions inherited from RCObject | |
| int | addReference () const |
| Increment reference count. More... | |
| int | removeReference () const |
| Decrement the reference count. More... | |
| bool | isShared () const |
| Test for sharing. More... | |
Protected Types | |
| enum | { LINE, BEAM, RANGE, ORDER, STATIC, METHOD, REVBEAM, REVTRACK, BETXMAX, BETYMAX, XCMAX, YCMAX, XCRMS, YCRMS, DXMAX, DYMAX, DXRMS, DYRMS, SIZE } |
| The common attributes for all objects having the "TWISS" interface. More... | |
Protected Member Functions | |
| Twiss (int size, const char *name, const char *help) | |
| Exemplar constructor. More... | |
| Twiss (const std::string &name, Twiss *parent) | |
| Clone constructor. More... | |
Protected Member Functions inherited from Table | |
| Table (int size, const char *name, const char *help) | |
| Constructor for exemplars. More... | |
| Table (const std::string &name, Table *parent) | |
| Constructor for clones. More... | |
Protected Member Functions inherited from Object | |
| Object (int size, const char *name, const char *help) | |
| Constructor for exemplars. More... | |
| Object (const std::string &name, Object *parent) | |
| Constructor for clones. More... | |
Protected Member Functions inherited from RCObject | |
| RCObject () | |
| Default constructor. More... | |
| RCObject (const RCObject &) | |
| Copy constructor. More... | |
| virtual | ~RCObject ()=0 |
| RCObject & | operator= (const RCObject &right) |
Protected Attributes | |
| FVector< double, 6 > | orbit |
| The initial closed orbit. More... | |
| FMatrix< double, 6, 6 > | curly_A |
| The initial curly A matrix. More... | |
Protected Attributes inherited from Table | |
| bool | dynamic |
| Flag dynamic table. More... | |
| bool | refill |
| Refill flag. More... | |
Protected Attributes inherited from Object | |
| bool | builtin |
| Built-in flag. More... | |
| bool | modified |
| Dirty flag. More... | |
| bool | flagged |
| Object flag. More... | |
Static Protected Attributes | |
| static const int | numColumns = 11 |
| Number of table columns. More... | |
Private Member Functions | |
| Twiss (const Twiss &) | |
| void | operator= (const Twiss &) |
| Row & | findRow (const PlaceRep &row) |
| void | put () |
Private Attributes | |
| TLine::const_iterator | current |
| TLine * | itsTable |
| AbstractMapper * | itsMapper |
| const Beam * | beam |
| const PartData * | reference |
| int | order |
| bool | revBeam |
| bool | revTrack |
| bool | revPath |
| std::string | itsLine |
Friends | |
| class | Insertion |
| class | Period |
Additional Inherited Members | |
Static Public Member Functions inherited from Table | |
| static Table * | find (const std::string &name) |
| Find named Table. More... | |
Public Attributes inherited from Object | |
| std::vector< Attribute > | itsAttr |
| The object attributes (see Attribute.hh). More... | |
Class Twiss.
Abstract base class for table buffers holding lattice function.
| typedef TBeamline<Row> Twiss::TLine |
|
protected |
|
virtual |
|
protected |
Exemplar constructor.
Definition at line 407 of file Twiss.cpp.
References BEAM, BETXMAX, BETYMAX, DXMAX, DXRMS, DYMAX, DYRMS, Object::itsAttr, LINE, Attributes::makeBool(), Attributes::makeRange(), Attributes::makeReal(), Attributes::makeString(), METHOD, ORDER, RANGE, REVBEAM, REVTRACK, STATIC, XCMAX, XCRMS, YCMAX, and YCRMS.

|
protected |
|
private |
| Twiss::TLine::const_iterator Twiss::begin | ( | ) | const |
Access to first row.
Definition at line 551 of file Twiss.cpp.
References itsTable.
Referenced by findRow(), Twiss3::formatPrint(), Eigen::formatPrint(), Envelope::formatPrint(), MatrixCmd::formatPrint(), getColumn(), isDependent(), printTableBody(), put(), MSplit::run(), and Aperture::run().
| Twiss::TLine::iterator Twiss::begin | ( | ) |
| Twiss::TLine::const_iterator Twiss::end | ( | ) | const |
Access to last row.
Definition at line 561 of file Twiss.cpp.
References itsTable.
Referenced by findRow(), Twiss3::formatPrint(), Eigen::formatPrint(), Envelope::formatPrint(), MatrixCmd::formatPrint(), getColumn(), isDependent(), printTableBody(), put(), MSplit::run(), and Aperture::run().
| Twiss::TLine::iterator Twiss::end | ( | ) |
|
virtual |
Check validity of the table definition.
Reimplemented from Object.
Definition at line 566 of file Twiss.cpp.
References BEAM, beam, Table::dynamic, endl(), Flatten< Member >::execute(), BeamSequence::fetchLine(), Table::fill(), BeamSequence::find(), Beam::find(), Attributes::getBool(), getDefault(), OpalData::getInstance(), Object::getOpalName(), Attributes::getRange(), Attributes::getReal(), Beam::getReference(), Attributes::getString(), Object::itsAttr, itsLine, itsMapper, itsTable, LINE, METHOD, ORDER, order, Table::printTable(), RANGE, reference, REVBEAM, revBeam, revPath, REVTRACK, revTrack, Round(), STATIC, OpalData::update(), and Options::warn.

|
private |
Definition at line 861 of file Twiss.cpp.
References begin(), end(), PlaceRep::enter(), Object::getOpalName(), PlaceRep::initialize(), PlaceRep::isActive(), and PlaceRep::leave().
Referenced by Insertion::fill(), getCell(), and getRow().

| double Twiss::getALFi | ( | const Row & | row, |
| int | i1, | ||
| int | = 0 |
||
| ) | const |
Definition at line 1137 of file Twiss.cpp.
References curly_A, and Twiss::Row::matrix.
Referenced by MSplit::calcul(), and Aperture::calcul().
| double Twiss::getALFik | ( | const Row & | row, |
| int | i1, | ||
| int | i2 | ||
| ) | const |
Mais-Ripken alpha functions.
Definition at line 1183 of file Twiss.cpp.
References curly_A, and Twiss::Row::matrix.
Referenced by Twiss3::formatPrint().
| double Twiss::getBETi | ( | const Row & | row, |
| int | i1, | ||
| int | = 0 |
||
| ) | const |
Definition at line 1111 of file Twiss.cpp.
References curly_A, and Twiss::Row::matrix.
Referenced by MSplit::calcul(), Aperture::calcul(), and put().
| double Twiss::getBETik | ( | const Row & | row, |
| int | i1, | ||
| int | i2 | ||
| ) | const |
Mais-Ripken beta functions.
Definition at line 1164 of file Twiss.cpp.
References curly_A, and Twiss::Row::matrix.
Referenced by Twiss3::formatPrint().
|
virtual |
| double Twiss::getCO | ( | const Row & | row, |
| int | i1, | ||
| int | = 0 |
||
| ) | const |
Closed orbit.
Definition at line 1229 of file Twiss.cpp.
References Twiss::Row::getCO().
Referenced by put().

|
virtual |
Return column [b]col[/b] of this table, limited by [b]range[/b].
Implements Table.
Definition at line 645 of file Twiss.cpp.
References begin(), end(), RangeRep::enter(), RangeRep::initialize(), RangeRep::isActive(), and RangeRep::leave().

| FMatrix< double, 6, 6 > Twiss::getCurlyA | ( | ) | const |
Return initial curly A matrix.
Definition at line 669 of file Twiss.cpp.
References curly_A.
Referenced by Insertion::fill(), Eigen::formatPrint(), and getSigma().
Curly A map for given row.
Definition at line 674 of file Twiss.cpp.
References curly_A, and Twiss::Row::matrix.
| const Twiss::Row & Twiss::getCurrent | ( | ) | const |
|
virtual |
| double Twiss::getDisp | ( | const Row & | row, |
| int | i1, | ||
| int | = 0 |
||
| ) | const |
Dispersion.
Definition at line 1234 of file Twiss.cpp.
References curly_A, and Twiss::Row::matrix.
Referenced by MSplit::calcul(), Aperture::calcul(), and put().
| double Twiss::getEigen | ( | const Row & | row, |
| int | i1, | ||
| int | i2 | ||
| ) | const |
Eigenvectors.
Definition at line 1248 of file Twiss.cpp.
References curly_A, and Twiss::Row::matrix.
| double Twiss::getET | ( | ) | const |
Return emittance for mode 3.
Definition at line 689 of file Twiss.cpp.
References beam, and Beam::getET().
Referenced by getSigma().

| double Twiss::getEX | ( | ) | const |
Return emittance for mode 1.
Definition at line 679 of file Twiss.cpp.
References beam, and Beam::getEX().
Referenced by Aperture::calcul_Apert(), and getSigma().

| double Twiss::getEY | ( | ) | const |
Return emittance for mode 2.
Definition at line 684 of file Twiss.cpp.
References beam, and Beam::getEY().
Referenced by Aperture::calcul_Apert(), and getSigma().

| double Twiss::getGAMik | ( | const Row & | row, |
| int | i1, | ||
| int | i2 | ||
| ) | const |
Mais-Ripken gamma functions.
Definition at line 1210 of file Twiss.cpp.
References curly_A, and Twiss::Row::matrix.
Referenced by Twiss3::formatPrint().
|
virtual |
Return the length of the table.
Implements Table.
Definition at line 694 of file Twiss.cpp.
References TBeamline< T >::getElementLength(), and itsTable.

|
virtual |
Accumulated transfer map.
Definition at line 704 of file Twiss.cpp.
References Twiss::Row::matrix.
Referenced by MatrixCmd::formatPrint().
| double Twiss::getMatrix | ( | const Row & | row, |
| int | i1, | ||
| int | i2 | ||
| ) | const |
| double Twiss::getMUi | ( | const Row & | row, |
| int | i1, | ||
| int | = 0 |
||
| ) | const |
Three modes, "naive" Twiss functions.
Definition at line 1106 of file Twiss.cpp.
References Twiss::Row::getMUi().
Referenced by Insertion::fill(), Period::fill(), Twiss3::formatPrint(), Insertion::printTable(), and Period::printTable().

| FVector< double, 6 > Twiss::getOrbit | ( | ) | const |
Return initial closed orbit.
Definition at line 714 of file Twiss.cpp.
References orbit.
Referenced by Insertion::fill(), Twiss3::formatPrint(), MatrixCmd::formatPrint(), Eigen::formatPrint(), and Envelope::formatPrint().
|
virtual |
| double Twiss::getS | ( | const Row & | row, |
| int | = 0, |
||
| int | = 0 |
||
| ) | const |
Arc length for given row.
Definition at line 1101 of file Twiss.cpp.
References Twiss::Row::getS().
Referenced by Aperture::calcul(), Insertion::fill(), Period::fill(), MatrixCmd::formatPrint(), Twiss3::formatPrint(), Eigen::formatPrint(), Envelope::formatPrint(), and Insertion::printTable().

| FMatrix<double, 6, 6> Twiss::getSigma | ( | ) | const |
Initial envelope (Sigma) matrix.
Referenced by Envelope::formatPrint().
| double Twiss::getSigma | ( | const Row & | row, |
| int | i1, | ||
| int | i2 | ||
| ) | const |
|
virtual |
|
virtual |
|
virtual |
Check compatibility.
Implements Table.
Definition at line 781 of file Twiss.cpp.
Referenced by Insertion::fill().
|
private |
| void Twiss::printTableBody | ( | std::ostream & | os, |
| const CellArray & | cells | ||
| ) | const |
Print the body to this TWISS table.
Definition at line 786 of file Twiss.cpp.
References begin(), current, end(), and name.
Referenced by Insertion::printTable(), and Period::printTable().

| void Twiss::printTableTitle | ( | std::ostream & | os, |
| const char * | title | ||
| ) | const |
Print standard information about the TWISS table.
Definition at line 847 of file Twiss.cpp.
References BEAM, OpalData::getInstance(), Object::itsAttr, LINE, METHOD, order, OpalData::printTitle(), and RANGE.
Referenced by Eigen::formatPrint(), Envelope::formatPrint(), MatrixCmd::formatPrint(), Twiss3::formatPrint(), Insertion::printTable(), and Period::printTable().

|
private |
Definition at line 878 of file Twiss.cpp.
References abs(), atan2(), begin(), BETXMAX, BETYMAX, LinearMap< T, N >::constantTerm(), curly_A, DXMAX, DXRMS, DYMAX, DYRMS, end(), getBETi(), getCO(), getDisp(), ElementBase::getElementLength(), AbstractMapper::getMap(), Object::itsAttr, itsMapper, itsTable, LinearMap< T, N >::linearTerms(), LinearFun< T, N >::makeVariable(), max(), revPath, AbstractMapper::setMap(), Attributes::setReal(), sqrt(), Physics::two_pi, XCMAX, XCRMS, YCMAX, and YCRMS.
Referenced by Insertion::fill(), and Period::fill().

|
private |
|
protected |
The initial curly A matrix.
Definition at line 272 of file Twiss.h.
Referenced by Insertion::fill(), Period::fill(), getALFi(), getALFik(), getBETi(), getBETik(), getCurlyA(), getDisp(), getEigen(), getGAMik(), getSigma(), and put().
|
mutableprivate |
Definition at line 287 of file Twiss.h.
Referenced by getCurrent(), and printTableBody().
|
private |
Definition at line 310 of file Twiss.h.
Referenced by execute(), and isDependent().
|
private |
Definition at line 293 of file Twiss.h.
Referenced by execute(), Insertion::fill(), Period::fill(), Period::findClosedOrbit(), put(), and ~Twiss().
|
private |
Definition at line 290 of file Twiss.h.
Referenced by begin(), end(), execute(), Period::fill(), Insertion::fill(), getLength(), getLine(), Period::printTable(), Insertion::printTable(), put(), and ~Twiss().
|
staticprotected |
|
protected |
The initial closed orbit.
Definition at line 269 of file Twiss.h.
Referenced by Insertion::fill(), Period::fill(), Twiss::Row::getCO(), and getOrbit().
|
private |
Definition at line 302 of file Twiss.h.
Referenced by execute(), Period::fill(), Insertion::fill(), and printTableTitle().
|
private |
Definition at line 299 of file Twiss.h.
Referenced by execute(), and Period::fill().
|
private |
1.8.5