Skip to content
Snippets Groups Projects
Commit 64de6258 authored by zhang's avatar zhang
Browse files

02/11/2010

1) Add routines to fit tunes for soleil lattice.
2) Add flag to set using 4D/6D in MomentumAcc
parent 7504a3df
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,9 @@ bool ErrorCouplingFlag = false; long err_seed=0L; double err_rms=0.0;
bool CouplingFlag = false;
bool MomentumAccFlag = false;
long _MomentumAccFlag_istart=1L, _MomentumAccFlag_istop=108L,
char DimTrack[3] = "4D";
long _MomentumAccFlag_istart=1L, _MomentumAccFlag_istop=108L,
//long Dim = 4L, _MomentumAccFlag_istart=1L, _MomentumAccFlag_istop=108L,
_MomentumAccFlag_nstepn=100L, _MomentumAccFlag_nstepp=100L;
double _MomentumAccFlag_deltaminn=0.01, _MomentumAccFlag_deltamaxn=0.05;
double _MomentumAccFlag_deltaminp=0.01, _MomentumAccFlag_deltamaxp=0.05;
......@@ -66,7 +68,10 @@ bool MultipoleFlag = false, ThinsextFlag = false;
char fic_hcorr[max_str],fic_vcorr[max_str], fic_skew[max_str];
bool FitTuneFlag = false; char qm1[max_str],qm2[max_str]; double targetnux = 0.0, targetnuz = 0.0;
/*generic function to fit tunes using 1 family of quadrupoles*/
bool FitTuneFlag = false; char qf[max_str],qd[max_str]; double targetnux = 0.0, targetnuz = 0.0;
/* specific for soleil lattice in which the quadrupole is cut into 2 parts*/
bool FitTune4Flag = false; char qf1[max_str],qf2[max_str],qd1[max_str],qd2[max_str];
bool FitChromFlag = false; char sxm1[max_str],sxm2[max_str]; double targetksix = 0.0, targetksiz = 0.0;
bool ChamberFlag = false, ChamberNoU20Flag = false, ReadChamberFlag = false;
bool GirderErrorFlag = false;
......@@ -333,7 +338,7 @@ void read_script(const char *param_file_name, bool rd_lat)
}
}
else if (strcmp("MomentumAccFlag", name) == 0){
sscanf(line, "%*s %s %ld %ld %lf %lf %ld %lf %lf %ld", str,
sscanf(line, "%*s %s %s %ld %ld %lf %lf %ld %lf %lf %ld", str,DimTrack,
&_MomentumAccFlag_istart, &_MomentumAccFlag_istop,
&_MomentumAccFlag_deltaminp, &_MomentumAccFlag_deltamaxp, &_MomentumAccFlag_nstepp,
&_MomentumAccFlag_deltaminn, &_MomentumAccFlag_deltamaxn, &_MomentumAccFlag_nstepn
......@@ -391,9 +396,9 @@ void read_script(const char *param_file_name, bool rd_lat)
else if (strcmp("fic_skew", name) == 0){// read of skew quads for multipoles
sscanf(line, "%*s %s", str);
sprintf(fic_skew,"%s%s", in_dir, str);
}
else if (strcmp("FitTuneFlag", name) == 0){
sscanf(line, "%*s %s %s %s %lf %lf", str,qm1,qm2,&targetnux,&targetnuz);
} // generic one, fit for 1 family of quadrupoles
else if (strcmp("FitTuneFlag", name) == 0){
sscanf(line, "%*s %s %s %s %lf %lf", str,qf,qd,&targetnux,&targetnuz);
if(strcmp(str, "true") == 0)
FitTuneFlag = true;
else if(strcmp(str, "false") == 0)
......@@ -402,6 +407,17 @@ void read_script(const char *param_file_name, bool rd_lat)
printf("set boolean flag true or false for FitTuneFlag \n");
exit_(1);
}
}// fit for 2 families,specific for the soleil lattice in which the quadrupole is cut into 2 parts
else if (strcmp("FitTune4Flag", name) == 0){
sscanf(line, "%*s %s %s %s %s %s %lf %lf", str,qf1,qf2,qd1,qd2,&targetnux,&targetnuz);
if(strcmp(str, "true") == 0)
FitTune4Flag = true;
else if(strcmp(str, "false") == 0)
FitTune4Flag = false;
else {
printf("set boolean flag true or false for FitTune4Flag \n");
exit_(1);
}
}
else if (strcmp("FitChromFlag", name) == 0){
sscanf(line, "%*s %s %s %s %lf %lf", str,sxm1,sxm2,&targetksix,&targetksiz);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment