Commit e7cb4f9b authored by TOUZE Francois's avatar TOUZE Francois
Browse files

modify TWISS commands

parent b30c972d
......@@ -928,11 +928,11 @@ void computingBlock::twissAMLOutput(UAPNode* node,const vector<smap>& v)
string str= v[0].find("twiss_option")->second.at(0);
if( str.find("option 1") != string::npos ) {
if ( str.find("option 1") != string::npos ) {
node->addAttribute("option","1");
}
if( str.find("option 3") != string::npos ) {
if ( str.find("option 3") != string::npos ) {
node->addAttribute("option","3");
}
......@@ -950,10 +950,10 @@ void computingBlock::twissAMLOutput(UAPNode* node,const vector<smap>& v)
}
if( !v[ 2 ].empty() ) {
if ( !v[ 2 ].empty() ) {
smap::const_iterator it= v[2].find("output");
for(int k = 0; k < it->second.size(); k++)
for (int k = 0; k < it->second.size(); k++)
{
UAPNode *n2= node->addChild("output");
n2->addAttribute("ref",it->second.at(k));
......@@ -1268,7 +1268,7 @@ void computingBlock::jtwissOutput(json& j,const vector<smap>& v)
if (str.find("option 1") != string::npos) {
j["twissCommands"]= "loadParameters";
j["twissCommands"]= "loadBeam";
j["initialValues"]= json::array();
}
......@@ -1303,7 +1303,7 @@ void computingBlock::jtwissOutput(json& j,const vector<smap>& v)
{
string ref= it->second.at( k );
if (ref == "chrom") j["outputFunctions"].push_back("chromatic");
if (ref == "sigma") j["outputFunctions"].push_back("beam");
if (ref == "hinvx") j["outputFunctions"].push_back("hinvx");
}
}
......@@ -1972,7 +1972,7 @@ std::vector<smap> computingBlock::jtwissInput(json j)
string option= up->find( "twissCommands" ).value();
smap amap;
if(option == "loadParameters")
if(option == "loadBeam")
amap["twiss_option"].push_back( "option 1" );
if(option == "initialValues")
amap["twiss_option"].push_back( "option 2" );
......@@ -2006,8 +2006,8 @@ std::vector<smap> computingBlock::jtwissInput(json j)
for (auto& ref : up->find( "outputFunctions" ).value())
{
if( ref == "chromatic" ) amap[ "output" ].push_back("chrom");
if( ref == "beam" ) amap[ "output" ].push_back("sigma");
if (ref == "chromatic") amap[ "output" ].push_back("chrom");
if (ref == "hinvx") amap[ "output" ].push_back("hinvx");
}
v.push_back( amap ); // v[2]
......
......@@ -289,7 +289,7 @@ string softwareMadx::twissStatement(const std::vector<smap>& v)
smap::const_iterator it= v[2].find("output");
std::vector<string>::const_iterator found;
found= std::find(it->second.begin(), it->second.end(), "sigma");
found= std::find(it->second.begin(), it->second.end(), "hinvx");
if (found != it->second.end()) {
os2 << "alfx:= table(twiss,alfx);\n";
os2 << "xgam:= (1+alfx*alfx)/betx;\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment