diff --git a/tracy/tracy/src/t2cell.cc b/tracy/tracy/src/t2cell.cc index 8783256c2caafee2f168fbe1107807a3c527b284..12dafed6eb9b1aac8132d86d1c189d6309d6ee5c 100644 --- a/tracy/tracy/src/t2cell.cc +++ b/tracy/tracy/src/t2cell.cc @@ -792,11 +792,17 @@ bool Cell_GetCOD_M(long imax, double eps, double dP, long &lastpos) Comments: Called by getCOD, Ring_Pass + 27/06/11 Correct the bug for the negative momentum compact factor; if the momentum + compact is negative, then switch the Stable Fixed Point to Unstable Fixed Point. + For Cell_GetCOD_M, the tracking is in 4D, so there is no switch of + fixed point for the lattice with negative momentum compact factor. + 28/06/11 Correct the one turn map for the lattice with negative momentum compact factor, now the one turn map is + tracked around the COD. ****************************************************************************/ bool Cell_getCOD(long imax, double eps, double dP, long &lastpos) { - long j, n, n_iter; - double dxabs; + long j = 0, n = 0, n_iter = 0, h_RF = 0; + double dxabs = 0.0; iVector jj; ss_vect<double> x0, x1, dx; ss_vect<tps> I, dx0, map; @@ -875,6 +881,20 @@ bool Cell_getCOD(long imax, double eps, double dP, long &lastpos) } } while ((dxabs >= eps) && (n_iter <= imax)); + + //if momentum compact factor is negative, then swtich the fixed point(SFP->UFP) + h_RF = Cell[Elem_GetPos(globval.cav, 1)].Elem.C->Ph; + if(globval.Alphac < 0) + x0[ct_] = -0.5*Cell[globval.Cell_nLoc].S/h_RF- x0[ct_]; //since the value of x0[ct_] is negative, so use "-0.5" + if(0) + cout<< " c*tau0 is: " << x0[ct_] <<endl; + + //get the one turn map for the close orbit + map.identity(); + map += x0; + Cell_Pass(0, globval.Cell_nLoc, map, lastpos); + + status.codflag = dxabs < eps; if (status.codflag)