47 "The \"EIGEN\" statement lists the eigenvectors for a named "
50 (
"TABLE",
"Name of table to be listed");
52 (
"FILE",
"Name of file to receive output",
"EIGEN");
68 return new Eigen(name,
this);
78 if(fileName ==
"TERM") {
81 std::ofstream os(fileName.c_str());
87 "Unable to open output stream \"" +
93 "Twiss table \"" + tableName +
"\" not found.");
105 std::streamsize old_prec = os.precision(6);
106 os.setf(std::ios::fixed, std::ios::floatfield);
110 os << std::string(118,
'-') <<
'\n';
111 os <<
"Element" << std::string(24,
' ') <<
"S Orbit |"
112 << std::string(25,
' ') <<
"E i g e n v e c t o r s\n";
113 os << std::string(118,
'-') <<
'\n';
116 for(Twiss::TLine::const_iterator row = table->
begin();
117 row != table->
end(); ++row) {
118 if(row->getSelectionFlag()) {
120 std::string
name = row->getElement()->getName();
121 if(
int occur = row->getCounter()) {
122 std::ostringstream tos;
123 tos << name <<
'[' << occur <<
']' << std::ends;
127 if(name.length() > 16) {
129 os << std::string(name, 0, 13) <<
".. ";
132 os << name << std::string(16 - name.length(),
' ');
134 os << std::setw(16) << table->
getS(*row);
138 for(
int i = 0; i < 6; ++i) {
139 if(i != 0) os << std::string(32,
' ');
140 os << std::setw(12) << orbit[i] <<
" |";
141 for(
int j = 0; j < 6; ++j) {
142 os << std::setw(12) << eigen[i][j];
149 os << std::string(118,
'-') <<
std::endl;
153 os.setf(std::ios::fixed, std::ios::floatfield);
Eigen()
Exemplar constructor.
TLine::const_iterator end() const
Access to last row.
The base class for all OPAL actions.
TLine::const_iterator begin() const
Access to first row.
The base class for all OPAL exceptions.
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
static OpalData * getInstance()
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
void formatPrint(std::ostream &, const Twiss *) const
Print Twiss table in eigenvector representation.
void format(std::ostream &, const Twiss *)
Object * find(const std::string &name)
Find entry.
virtual Eigen * clone(const std::string &name)
Make clone.
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.
FVector< double, 6 > getOrbit() const
Return initial closed orbit.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
double getS(const Row &, int=0, int=0) const
Arc length for given row.
Inform & endl(Inform &inf)
virtual void execute()
Execute the command.
std::string getString(const Attribute &attr)
Get string value.