42 "The \"TWISSTRACK\" command defines a table of lattice functions\n"
43 "which can be matched or tabulated for an insertion.") {
45 (
"INIT",
"If given, this table position is used to initialise\n"
46 "\t\t\t\tif not given, use the following parameters to initialise");
48 (
"BETX",
"Initial horizontal beta", 1.0);
50 (
"ALFX",
"Initial horizontal alpha");
52 (
"BETY",
"Initial vertical beta", 1.0);
54 (
"ALFY",
"Initial vertical alpha");
56 (
"DX",
"Initial horizontal dispersion");
58 (
"DPX",
"Initial slope of horizontal dispersion");
60 (
"DY",
"Initial vertical dispersion");
62 (
"DPY",
"Initial slope of vertical dispersion");
64 (
"XC",
"Initial horizontal position");
66 (
"PXC",
"Initial horizontal slope");
68 (
"YC",
"Initial vertical position");
70 (
"PYC",
"Initial vertical slope");
72 (
"TC",
"Initial time difference");
74 (
"PTC",
"Initial relative momentum error");
78 (
"LENGTH",
"Total length in m");
82 (
"MU1",
"Phase for mode 1");
86 (
"MU2",
"Phase for mode 2");
90 (
"MU3",
"Phase for mode 3");
94 (
"DELTAP",
"Differential momentum variation");
136 "\" is not suitable for initialising insertion \"" +
141 for(
int i = 0; i < 6; ++i) B(i, i) = H(i, i) = 1.0;
145 B(1, 1) = 1.0 / B(0, 0);
148 B(3, 3) = 1.0 / B(2, 2);
178 double arc =
getS(row);
189 std::streamsize old_prec = os.precision(6);
190 os.setf(std::ios::fixed, std::ios::floatfield);
200 os <<
"Insert length = " << setw(16) <<
getS(row)
201 <<
" Mux = " << setw(16) <<
getMUi(row, 0)
202 <<
" Muy = " << setw(16) <<
getMUi(row, 1)
221 os.precision(old_prec);
222 os.setf(std::ios::fixed, std::ios::floatfield);
void setReal(Attribute &attr, double val)
Set real value.
std::vector< Cell > CellArray
An array of cell descriptors.
virtual bool matches(Table *rhs) const
Check compatibility.
virtual void fill()=0
Refill the buffer.
The base class for all OPAL exceptions.
Row & findRow(const PlaceRep &row)
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
Representation of a table row reference.
TableRowRep getTableRow(const Attribute &attr)
Get table row value.
virtual void printTable(std::ostream &, const CellArray &) const
Print the table on an ASCII stream.
void printTableBody(std::ostream &, const CellArray &) const
Print the body to this TWISS table.
virtual void fill()
Fill the buffer using the defined algorithm.
Representation of a place within a beam line or sequence.
virtual Insertion * clone(const std::string &name)
Make clone.
FMatrix< double, 6, 6 > curly_A
The initial curly A matrix.
Insertion()
Exemplar construction.
const std::string & getOpalName() const
Return object name.
double getMUi(const Row &, int i1, int=0) const
Three modes, "naive" Twiss functions.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
static Table * find(const std::string &name)
Find named Table.
FVector< double, 6 > orbit
The initial closed orbit.
virtual void setMap(const LinearMap< double, 6 > &)=0
Reset the linear part of the accumulated map for restart.
PlaceRep getPosition() const
Return the row position representation.
Attribute makeTableRow(const std::string &name, const std::string &help)
Create a table row attribute.
Tps< T > sqrt(const Tps< T > &x)
Square root.
Structure for a row of the Twiss table.
AbstractMapper * itsMapper
static void setGlobalTruncOrder(int order)
Set the global truncation order.
void printTableTitle(std::ostream &, const char *title) const
Print standard information about the TWISS table.
FMatrix< double, 6, 6 > getCurlyA() const
Return initial curly A matrix.
double getReal(const Attribute &attr)
Return real value.
FVector< double, 6 > getOrbit() const
Return initial closed orbit.
const std::string & getTabName() const
Return the table name.
The base class for all OPAL tables.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
double getS(const Row &, int=0, int=0) const
Arc length for given row.