diff --git a/tracy/tracy/src/read_script.cc b/tracy/tracy/src/read_script.cc index 32e5157dd68e65d62b7f2276f3183db6bbc5cd50..ee0dc683e95d79ee1831c0726f423f72b613bb7d 100644 --- a/tracy/tracy/src/read_script.cc +++ b/tracy/tracy/src/read_script.cc @@ -73,6 +73,7 @@ void read_script(const char *param_file_name, bool rd_lat, long& CommNo, UserCom const bool prt = false; // for debugging printout each line of input file long int LineNum=0L; long int NameLen=0L; + int idummy=0; char full_param_file_name[max_str]; char lat_FileName[max_str]; //bool TuneTracFlag; @@ -94,9 +95,8 @@ void read_script(const char *param_file_name, bool rd_lat, long& CommNo, UserCom // read parameter file, line by line // while (fgets(line, max_str, inf) != NULL) { - while (line = fgets(in, max_str, inf) ) { + while (line = fgets(in, max_str, inf)) { - /* kill preceding whitespace generated by "table" key or "space" key, but leave \n so we're guaranteed to have something*/ @@ -306,7 +306,7 @@ void read_script(const char *param_file_name, bool rd_lat, long& CommNo, UserCom } else if (strcmp("MomentumAccFlag", name) == 0){ - sscanf(line, "%*s %s %ld %ld %lf %lf %ld %lf %lf %ld", + sscanf(line, "%*s %s %ld %ld %lf %lf %ld %lf %lf %ld %ld", UserCommandFlag[CommNo].TrackDim, &(UserCommandFlag[CommNo]._MomentumAccFlag_istart), &(UserCommandFlag[CommNo]._MomentumAccFlag_istop), @@ -315,7 +315,8 @@ void read_script(const char *param_file_name, bool rd_lat, long& CommNo, UserCom &(UserCommandFlag[CommNo]._MomentumAccFlag_nstepp), &(UserCommandFlag[CommNo]._MomentumAccFlag_deltaminn), &(UserCommandFlag[CommNo]._MomentumAccFlag_deltamaxn), - &(UserCommandFlag[CommNo]._MomentumAccFlag_nstepn) + &(UserCommandFlag[CommNo]._MomentumAccFlag_nstepn), + &(UserCommandFlag[CommNo]._MomentumAccFlag_nturn) ); strcpy(UserCommandFlag[CommNo].CommandStr,name); } @@ -424,8 +425,13 @@ void read_script(const char *param_file_name, bool rd_lat, long& CommNo, UserCom else if (strcmp("ge", name) == 0){ sscanf(line, "%*s %s", ge_name); /* name of end of the girder */ } - - //set parameters for COD correction + + else if (strcmp("normalcut", name) == 0){ + sscanf(line, "%*s %d", &idummy); + fprintf(stdout,"User value for cutting at n sigma-s the normal distributions\n"); + setrancut(idummy); /* set normal cut for computation: random data are n sigma-s*/ + } + //set parameters for COD correction else if (strcmp("n_orbit", name) == 0){ sscanf(line, "%*s %d", &n_orbit); } diff --git a/tracy/tracy/src/soleillib.cc b/tracy/tracy/src/soleillib.cc index c1681e6a22cb8f61196f7b606ca7f4bea7200d7e..2cc605fb6cfec151bb07b9c3274bd31090e49de8 100644 --- a/tracy/tracy/src/soleillib.cc +++ b/tracy/tracy/src/soleillib.cc @@ -3000,10 +3000,11 @@ void SetSkewQuad(void) 23/07/10 modify the call variable to the Cell_Pass( ): j-1L --> j (L3435, L3590) since the Cell_Pass( ) is tracking from element i0 to i1(tracy 3), and the Cell_Pass( ) is tracking from element i0+1L to i1(tracy 2). + 17/04/11 add number of turn ****************************************************************************/ void MomentumAcceptance(long deb, long fin, double ep_min, double ep_max, - long nstepp, double em_min, double em_max, long nstepm) + long nstepp, double em_min, double em_max, long nstepm, long nturn) { double dP = 0.0, dp1 = 0.0, dp2 = 0.0; long lastpos = 0L,lastn = 0L; @@ -3011,7 +3012,6 @@ void MomentumAcceptance(long deb, long fin, double ep_min, double ep_max, CellType Cell, Clost; double x = 0.0, px = 0.0, z = 0.0, pz = 0.0, ctau0 = 0.0, delta = 0.0; Vector x0; - const long nturn = 1000L; FILE *outf2, *outf1; // Nonzero vertical amplitude const double zmax = 0.3e-3; // 0.3 mm at the ring entrance (element 1) @@ -5093,13 +5093,13 @@ void ReadFieldErr(const char *FieldErrorFile) printf(" n = %2d, Bn = %9.1e, An = %9.1e\n", n, Bn, An); - /* set multipole error to horizontal correctors of soleil ring*/ + /* set multipole errors to horizontal correctors of soleil ring*/ if(strcmp("hcorr", name) == 0) AddCorrQtErr_fam(fic_hcorr,globval.hcorr,_convHcorr,keywrd,r0,n,Bn,An); - /* set multipole error to vertical correctors of soleil ring*/ + /* set multipole errors to vertical correctors of soleil ring*/ else if(strcmp("vcorr", name) == 0) AddCorrQtErr_fam(fic_vcorr,globval.vcorr,_convVcorr,keywrd,r0,n,Bn,An); - /* set multipole error to skew quadrupoles of soleil ring*/ + /* set multipole errors to skew quadrupoles of soleil ring*/ else if(strcmp("qt", name) == 0) AddCorrQtErr_fam(fic_skew,globval.qt,_convQt,keywrd,r0,n,Bn,An); else @@ -5128,14 +5128,14 @@ void AddFieldErrors(const char *name, const char *keywrd,const double r0, Input: name type name or element name - keywrd "rms" or "sys" + keyword "rms" or "sys" "rms": random multipole error - "sys": systematic multipole error + "sys": systematic multipole error r0 radius at which error is measured, error field is relative to the design field strength when r0 !=0 n order of the error - Bn relative B component for the n-th error - An relative A component for the n-th error + Bn relative B component for the n-th error + An relative A component for the n-th error Output: @@ -5486,8 +5486,8 @@ void AddCorrQtErr_fam(char const *fic, const int Fnum, const double conv, const /* find index of sextupole associated with the corrector */ // solution 1: find by names - // solution 2: use a predfined list - // solution 3: smothing smart ??? + // solution 2: use a predefined list + // solution 3: something smart ??? for (i=0; i< GetnKid(Fnum); i++){ if (trace) fprintf(stdout, "%d\n", i);