diff --git a/tracy/tools/soltracy.cc b/tracy/tools/soltracy.cc index 2c8a45840c9d4b56f9e9f903b8d37b79525e0fe1..069509d01a8a4ab14a74d9b6708bce2ee714f9fb 100644 --- a/tracy/tools/soltracy.cc +++ b/tracy/tools/soltracy.cc @@ -34,8 +34,7 @@ int main(int argc, char *argv[]) { // globval.pathlength = false; // globval.bpm = 0; - // const double x_max_FMA = 10e-3, delta_FMA = 10e-2; - // const int n_x = 801, n_dp = 80, n_tr = 2048; + long i=0L; //initilize the for loop to read command string char CommandStr[max_str]; double nux = 0, nuy = 0, ksix = 0, ksiy = 0; @@ -68,11 +67,11 @@ int main(int argc, char *argv[]) { } /************************************************************************ - writes flat file with all the design values of the lattice, very important file for debug + print files, very important file for debug *************************************************************************/ + //print flat file with all the design values of the lattice, prtmfile("flat_file.dat"); - - // print cod + // print close orbit to a file getcod(dP, lastpos); prt_cod("cod.out", globval.bpm, true); @@ -97,6 +96,14 @@ int main(int argc, char *argv[]) { cout << "print the twiss parameters to file: "<< twiss_file << "\n"; printlatt(twiss_file); } + //print the close orbit + else if(strcmp(CommandStr,"PrintCODFlag") == 0) { + cout << "\n"; + cout << "print the close orbit to file: "<< cod_file << "\n"; + getcod(dP, lastpos); + prt_cod(cod_file, globval.bpm, true); + } + //turn on flag for quadrupole fringe field else if(strcmp(CommandStr,"QuadFringeOnFlag") == 0) { diff --git a/tracy/tracy/inc/read_script.h b/tracy/tracy/inc/read_script.h index 58533977508bf67d789fb4c916477e2208d5a151..081b8ac82677af2dc957508fab773058b3ebdb7c 100644 --- a/tracy/tracy/inc/read_script.h +++ b/tracy/tracy/inc/read_script.h @@ -113,6 +113,6 @@ extern char chamber_file[max_str]; extern char twiss_file[max_str]; - + extern char cod_file[max_str]; // function void read_script(const char *param_file_name, bool rd_lat,long& CommNo, UserCommand UserCommandFlag[]); diff --git a/tracy/tracy/src/read_script.cc b/tracy/tracy/src/read_script.cc index 1ee1369cb134c9b3416c22726425eabcefc82ca3..0adffff3fd8d8e0b1fc8be0ae673c8978ed6fff1 100644 --- a/tracy/tracy/src/read_script.cc +++ b/tracy/tracy/src/read_script.cc @@ -30,6 +30,8 @@ /* files */ //twiss file char twiss_file[max_str]; + // cod file +char cod_file[max_str]; //chamber file char chamber_file[max_str]; // multipole files @@ -150,10 +152,15 @@ void read_script(const char *param_file_name, bool rd_lat, long& CommNo, UserCom } /* read in bool flags */ - //print twiss parameters flag flag + //print twiss parameters flag else if (strcmp("PrintTwissFlag", name) == 0){ sscanf(line, "%*s %s", twiss_file); strcpy(UserCommandFlag[CommNo].CommandStr,name); + } + //print close orbit(COD) flag + else if (strcmp("PrintCODFlag", name) == 0){ + sscanf(line, "%*s %s", cod_file); + strcpy(UserCommandFlag[CommNo].CommandStr,name); } //read chamber file flat else if (strcmp("ReadChamberFlag", name) == 0){