OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Twiss Class Reference

Class Twiss. More...

#include <Twiss.h>

Inheritance diagram for Twiss:
Inheritance graph
[legend]
Collaboration diagram for Twiss:
Collaboration graph
[legend]

Classes

class  Row
 Structure for a row of the Twiss table. More...
 

Public Types

typedef TBeamline< RowTLine
 
- Public Types inherited from Table
typedef std::vector< CellCellArray
 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 RowgetCurrent () 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 BeamlinegetLine () 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 Objectclone (const std::string &name)=0
 Return a clone. More...
 
void copyAttributes (const Object &)
 Copy attributes from another object. More...
 
virtual AttributefindAttribute (const std::string &name)
 Find an attribute by name. More...
 
virtual const AttributefindAttribute (const std::string &name) const
 Find an attribute by name. More...
 
virtual ObjectmakeTemplate (const std::string &, TokenStream &, Statement &)
 Macro handler function. More...
 
virtual ObjectmakeInstance (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 ObjectgetBaseObject () const
 Return the object's base type object. More...
 
const std::string & getOpalName () const
 Return object name. More...
 
ObjectgetParent () 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
 
RCObjectoperator= (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 &)
 
RowfindRow (const PlaceRep &row)
 
void put ()
 

Private Attributes

TLine::const_iterator current
 
TLineitsTable
 
AbstractMapperitsMapper
 
const Beambeam
 
const PartDatareference
 
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 Tablefind (const std::string &name)
 Find named Table. More...
 
- Public Attributes inherited from Object
std::vector< AttributeitsAttr
 The object attributes (see Attribute.hh). More...
 

Detailed Description

Class Twiss.

Abstract base class for table buffers holding lattice function.

Definition at line 41 of file Twiss.h.

Member Typedef Documentation

Definition at line 89 of file Twiss.h.

Member Enumeration Documentation

anonymous enum
protected

The common attributes for all objects having the "TWISS" interface.

Enumerator
LINE 
BEAM 
RANGE 
ORDER 
STATIC 
METHOD 
REVBEAM 
REVTRACK 
BETXMAX 
BETYMAX 
XCMAX 
YCMAX 
XCRMS 
YCRMS 
DXMAX 
DYMAX 
DXRMS 
DYRMS 
SIZE 

Definition at line 233 of file Twiss.h.

Constructor & Destructor Documentation

Twiss::~Twiss ( )
virtual

Definition at line 476 of file Twiss.cpp.

References itsMapper, and itsTable.

Twiss::Twiss ( int  size,
const char *  name,
const char *  help 
)
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.

Here is the call graph for this function:

Twiss::Twiss ( const std::string &  name,
Twiss parent 
)
protected

Clone constructor.

Definition at line 471 of file Twiss.cpp.

Twiss::Twiss ( const Twiss )
private

Member Function Documentation

Twiss::TLine::const_iterator Twiss::begin ( ) const
Twiss::TLine::iterator Twiss::begin ( )

Access to first row.

Definition at line 546 of file Twiss.cpp.

References itsTable.

Twiss::TLine::const_iterator Twiss::end ( ) const
Twiss::TLine::iterator Twiss::end ( )

Access to last row.

Definition at line 556 of file Twiss.cpp.

References itsTable.

void Twiss::execute ( )
virtual
Twiss::Row & Twiss::findRow ( const PlaceRep row)
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().

Here is the call graph for this function:

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().

double Twiss::getCell ( const PlaceRep row,
const std::string &  col 
)
virtual

Return a selected value in a selected row.

Implements Table.

Definition at line 626 of file Twiss.cpp.

References findRow().

Here is the call graph for this function:

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().

Here is the call graph for this function:

std::vector< double > Twiss::getColumn ( const RangeRep range,
const std::string &  col 
)
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().

Here is the call graph for this function:

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().

FMatrix< double, 6, 6 > Twiss::getCurlyA ( const Row row) const

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

Return current table row in iteration.

Definition at line 664 of file Twiss.cpp.

References current.

Table::CellArray Twiss::getDefault ( ) const
virtual

Return the default print columns.

Implements Table.

Definition at line 633 of file Twiss.cpp.

Referenced by execute().

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

double Twiss::getLength ( )
virtual

Return the length of the table.

Implements Table.

Definition at line 694 of file Twiss.cpp.

References TBeamline< T >::getElementLength(), and itsTable.

Here is the call graph for this function:

const Beamline * Twiss::getLine ( ) const
virtual

Return embedded CLASSIC beamline.

Implements Table.

Definition at line 699 of file Twiss.cpp.

References itsTable.

FMatrix< double, 6, 6 > Twiss::getMatrix ( const Row row) const

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

Transfer matrix.

Definition at line 1292 of file Twiss.cpp.

References Twiss::Row::matrix.

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().

Here is the call graph for this function:

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().

FVector< double, 6 > Twiss::getOrbit ( const Row row) const

Get orbit in given row.

Definition at line 709 of file Twiss.cpp.

References Twiss::Row::orbit.

std::vector< double > Twiss::getRow ( const PlaceRep pos,
const std::vector< std::string > &  cols 
)
virtual

Return a table row, possible user-defined.

Implements Table.

Definition at line 738 of file Twiss.cpp.

References findRow().

Here is the call graph for this function:

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().

Here is the call graph for this function:

FMatrix<double, 6, 6> Twiss::getSigma ( ) const

Initial envelope (Sigma) matrix.

Referenced by Envelope::formatPrint().

FMatrix< double, 6, 6 > Twiss::getSigma ( const Row row) const

Envelope (Sigma) matrix for given row.

Definition at line 719 of file Twiss.cpp.

References getCurlyA(), getET(), getEX(), and getEY().

Here is the call graph for this function:

double Twiss::getSigma ( const Row row,
int  i1,
int  i2 
) const

Sigma matrix.

Definition at line 1280 of file Twiss.cpp.

References curly_A, getET(), getEX(), getEY(), and Twiss::Row::matrix.

Here is the call graph for this function:

bool Twiss::isDependent ( const std::string &  name) const
virtual

Check dependency.

Implements Table.

Definition at line 760 of file Twiss.cpp.

References begin(), end(), itsLine, and name.

Here is the call graph for this function:

Expressions::PtrToScalar< double > Twiss::makeColumnExpression ( const std::string &  colName) const
virtual

Return column expression.

Implements Table.

Definition at line 775 of file Twiss.cpp.

bool Twiss::matches ( Table rhs) const
virtual

Check compatibility.

Implements Table.

Definition at line 781 of file Twiss.cpp.

Referenced by Insertion::fill().

void Twiss::operator= ( const Twiss )
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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void Twiss::put ( )
private

Friends And Related Function Documentation

friend class Insertion
friend

Definition at line 43 of file Twiss.h.

friend class Period
friend

Definition at line 44 of file Twiss.h.

Member Data Documentation

const Beam* Twiss::beam
private

Definition at line 296 of file Twiss.h.

Referenced by execute(), getET(), getEX(), and getEY().

FMatrix<double, 6, 6> Twiss::curly_A
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().

TLine::const_iterator Twiss::current
mutableprivate

Definition at line 287 of file Twiss.h.

Referenced by getCurrent(), and printTableBody().

std::string Twiss::itsLine
private

Definition at line 310 of file Twiss.h.

Referenced by execute(), and isDependent().

AbstractMapper* Twiss::itsMapper
private

Definition at line 293 of file Twiss.h.

Referenced by execute(), Insertion::fill(), Period::fill(), Period::findClosedOrbit(), put(), and ~Twiss().

TLine* Twiss::itsTable
private
const int Twiss::numColumns = 11
staticprotected

Number of table columns.

Definition at line 266 of file Twiss.h.

FVector<double, 6> Twiss::orbit
protected

The initial closed orbit.

Definition at line 269 of file Twiss.h.

Referenced by Insertion::fill(), Period::fill(), Twiss::Row::getCO(), and getOrbit().

int Twiss::order
private

Definition at line 302 of file Twiss.h.

Referenced by execute(), Period::fill(), Insertion::fill(), and printTableTitle().

const PartData* Twiss::reference
private

Definition at line 299 of file Twiss.h.

Referenced by execute(), and Period::fill().

bool Twiss::revBeam
private

Definition at line 305 of file Twiss.h.

Referenced by execute().

bool Twiss::revPath
private

Definition at line 307 of file Twiss.h.

Referenced by execute(), and put().

bool Twiss::revTrack
private

Definition at line 306 of file Twiss.h.

Referenced by execute().


The documentation for this class was generated from the following files: