diff --git a/tracy/tools/soltracy.cc b/tracy/tools/soltracy.cc index da45e5ec4445eb03dc511a2931a013d82339ab7f..8fc3809378fec00cc391c74c7d25eadcd7b9cb2e 100644 --- a/tracy/tools/soltracy.cc +++ b/tracy/tools/soltracy.cc @@ -20,10 +20,11 @@ extern bool freq_map; // turn on globval.Cavity_on and globval.radiation to get proper synchr radiation damping // IDs accounted too if: wiggler model and symplectic integrator (method = 1) globval.H_exact = false; - globval.quad_fringe = false; // quadrupole fringe field - globval.radiation = false; // synchrotron radiation - globval.emittance = false; // emittance - globval.pathlength = false; +/*The following values are set in the Read_lattice( ) in soleilcommon.cc*/ +// globval.quad_fringe = false; // quadrupole fringe field + // globval.radiation = false; // synchrotron radiation + // globval.emittance = false; // emittance + // globval.pathlength = false; // globval.bpm = 0; // const double x_max_FMA = 10e-3, delta_FMA = 10e-2; @@ -41,7 +42,7 @@ extern bool freq_map; /************************************************************************ - start read in files and flags + read in files and flags *************************************************************************/ if (argc > 1){ read_script(argv[1], true);} @@ -50,15 +51,10 @@ extern bool freq_map; exit_(1); } - - /************************************************************************ - end read in files and flags - *************************************************************************/ - prtmfile("flat_file.dat"); // writes flat file /* very important file for debug*/ - printlatt(); /* SOLEIL print out lattice functions */ - printglob(); - + writes flat file with all the design values of the lattice, very important file for debug + *************************************************************************/ + prtmfile("flat_file.dat"); // Flag factory @@ -211,27 +207,32 @@ extern bool freq_map; if (ReadMultipoleFlag == true){ fprintf(stdout, "\n Read Multipoles file for lattice with thick sextupoles \n"); ReadFieldErr(multipole_file); + //first print the full lattice with error as a flat file + prtmfile("flat_file_error.dat"); // writes flat file /* very important file for debug*/ + Ring_GetTwiss(chroma=true, 0.0); /* Compute and get Twiss parameters */ + printglob(); } + + //Old version to multipole errors in soleil lattice, is obsoleted if (MultipoleFlag == true ){ if (ThinsextFlag ==true){ fprintf(stdout, "\n Setting Multipoles for lattice with thin sextupoles \n"); Multipole_thinsext(fic_hcorr,fic_vcorr,fic_skew); /* for thin sextupoles */ + prtmfile("flat_file_error.dat"); // writes flat file /* very important file for debug*/ Ring_GetTwiss(chroma=true, 0.0); /* Compute and get Twiss parameters */ printglob(); } else{ fprintf(stdout, "\n Setting Multipoles for lattice with thick sextupoles \n"); Multipole_thicksext(fic_hcorr,fic_vcorr,fic_skew); /* for thick sextupoles */ + prtmfile("flat_file_error.dat"); // writes flat file /* very important file for debug*/ Ring_GetTwiss(chroma=true, 0.0); /* Compute and get Twiss parameters */ printglob(); } } - //first print the full lattice with error as a flat file - prtmfile("flat_file_error.dat"); // writes flat file /* very important file for debug*/ - printlatt(); /* SOLEIL print out lattice functions */ - printglob(); + /******************************************************************************************/ // COMPUTATION PART after setting the model @@ -288,16 +289,16 @@ extern bool freq_map; if (MomentumAccFlag == true){ bool cavityflag, radiationflag; - /* record the initial values*/ cavityflag = globval.Cavity_on; radiationflag = globval.radiation; - if(strncmp("6D",DimTrack,2)==0){ + /* set the dimension for the momentum tracking*/ + if(strncmp("6D",TrackDim,2)==0){ globval.Cavity_on = true; globval.radiation = true; } - else if(strncmp("4D",DimTrack,2)==0){ + else if(strncmp("4D",TrackDim,2)==0){ globval.Cavity_on = false; globval.radiation = false; } @@ -306,12 +307,13 @@ extern bool freq_map; exit_(1); }; + /* calculate momentum accepetance*/ MomentumAcceptance( _MomentumAccFlag_istart, _MomentumAccFlag_istop, _MomentumAccFlag_deltaminp, _MomentumAccFlag_deltamaxp, _MomentumAccFlag_nstepp, _MomentumAccFlag_deltaminn, _MomentumAccFlag_deltamaxn, _MomentumAccFlag_nstepn); - /* reset back to the initial values*/ + /* restore the initial values*/ globval.Cavity_on = cavityflag; globval.radiation = radiationflag; }