Commit 20d22a1a authored by TOUZE Francois's avatar TOUZE Francois
Browse files

fix bug in tunes option

parent 148c602d
......@@ -1116,6 +1116,8 @@ smap softwareMadx::getTableContents(ifstream& infile)
{
if(debug > 0) cout << "softwareMadx::getTableContents()\n";
cout << "softwareMadx::getTableContents()\n";
// format of the twiss file:
// the header
// element keywords
......@@ -1131,6 +1133,8 @@ smap softwareMadx::getTableContents(ifstream& infile)
if ( buf.find("* NAME") != string::npos ) break;
}
cout << "buf => " << buf << endl;
vector<string> vaxis;
if ( buf.find("BETX") != string::npos ) vaxis.push_back("betx");
if ( buf.find("ALFX") != string::npos ) vaxis.push_back("alfx");
......@@ -1140,6 +1144,8 @@ smap softwareMadx::getTableContents(ifstream& infile)
if ( buf.find("BETY") != string::npos ) vaxis.push_back("bety");
if ( buf.find("ALFY") != string::npos ) vaxis.push_back("alfy");
if ( buf.find("MUY" ) != string::npos ) vaxis.push_back("muy");
cout << "vaxis.size => " << vaxis.size() << endl;
//
// skip formats
......@@ -1161,6 +1167,8 @@ smap softwareMadx::getTableContents(ifstream& infile)
infile >> buf; // name
}
cout << "vmap.size => " << vmap.size() << endl;
return vmap;
}
......@@ -1216,7 +1224,7 @@ json softwareMadx::readOpticalParameters()
// get the file xxx-Ytunes.txt back (if exists)
TYtune( j );
}
// creates the output file => xxx-plot.txt
string fname= userDir_ + getFileName("plot",false);
ofstream outfile;
......@@ -1268,11 +1276,13 @@ void softwareMadx::TTwiss(json& j)
}
it= vmap.find("mux");
for(int k = 0; k < it->second.size(); k++)
{
double ycoor= atof( it->second.at(k).c_str() );
j["xmu"].push_back(ycoor);
}
if (it != vmap.end()) {
for(int k = 0; k < it->second.size(); k++)
{
double ycoor= atof( it->second.at(k).c_str() );
j["xmu"].push_back(ycoor);
}
}
it= vmap.find("dx");
for(int k = 0; k < it->second.size(); k++) {
......@@ -1295,11 +1305,13 @@ void softwareMadx::TTwiss(json& j)
}
it= vmap.find("muy");
for(int k = 0; k < it->second.size(); k++)
{
double ycoor= atof( it->second.at(k).c_str() );
j["ymu"].push_back(ycoor);
}
if (it != vmap.end()) {
for(int k = 0; k < it->second.size(); k++)
{
double ycoor= atof( it->second.at(k).c_str() );
j["ymu"].push_back(ycoor);
}
}
}
void softwareMadx::TSigma(json& j)
......
......@@ -215,7 +215,7 @@ int main (int argc, char* argv[])
status= ptr->simuTEST( obj );
std::cout << std::boolalpha;
cout << "status => " << status << endl;
//ptr->Chartjs();
ptr->Chartjs();
}
......
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