Fork me on GitHub

Changeset 291 in svn


Ignore:
Timestamp:
Mar 4, 2009, 1:54:41 PM (16 years ago)
Author:
Xavier Rouby
Message:

first attempt of corrections

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/interface/BFieldProp.h

    r264 r291  
    8787
    8888   unsigned int loop_overflow_counter;
     89   unsigned int aaa,bbb,ccc,ddd; // to be deleted
     90 
    8991};
    9092 
  • trunk/src/BFieldProp.cc

    r270 r291  
    140140      //cout << "gammam" << gammam << "\t gamma" << gammam/Part->M << endl;
    141141      omega = q * B_z /gammam;
    142       r = Part->PT / (omega * gammam);
     142      //r = Part->PT / (omega * gammam);
     143      r = fabs(Part->PT / (omega * gammam));
    143144
    144145    // 2.  Helix parameters : center coordinates in transverse plane
     
    152153    // 3. time evaluation t = min(t_T, t_z)
    153154    //    t_T : time to exit from the sides
    154     //    t_T= [ Phi_c - phi_0 + atan( (R_max^2 - (R_c^2 + r^2))/(2rR_c) )  ]/omega
     155    //    t_T= [ Phi_c - phi_0 + acos( (R_max^2 - (R_c^2 + r^2))/(2rR_c) )  ]/omega
    155156    //    t_z : time to exit from the front or the back
    156157    //    t_z = gamma * m /p_z0 \times (-z_0 + z_max * sign(p_z0))
     
    161162      if ( fabs(R_c - r) > R_max || R_c + r  < R_max ) t = t_z;
    162163      else {
    163          t_T = (Phi_c - phi_0 + atan2( (R_max + rr)*(R_max - rr) , 2*r*R_c ) ) / omega;
     164         if(r==0|| R_c ==0) t_T=1E99;
     165         //else t_T = (Phi_c - phi_0 + atan2( (R_max + rr)*(R_max - rr) , 2*r*R_c ) ) / omega;
     166         else t_T = (Phi_c - phi_0 + acos( (R_max + rr)*(R_max - rr) / (2*r*R_c) ) ) / omega;
    164167         t = min(t_T,t_z);
    165168      }
     
    345348      //cout << "gammam" << gammam << "\t gamma" << gammam/Part->M << endl;
    346349      omega = q * B_z /gammam;
    347       r = Part->PT / (omega * gammam);
     350      r = fabs(Part->PT / (omega * gammam));
    348351
    349352    // 2.  Helix parameters : center coordinates in transverse plane
     
    357360    // 3. time evaluation t = min(t_T, t_z)
    358361    //    t_T : time to exit from the sides
    359     //    t_T= [ Phi_c - phi_0 + atan( (R_max^2 - (R_c^2 + r^2))/(2rR_c) )  ]/omega
     362    //    t_T= [ Phi_c - phi_0 + acos( (R_max^2 - (R_c^2 + r^2))/(2rR_c) )  ]/omega
    360363    //    t_z : time to exit from the front or the back
    361364    //    t_z = gamma * m /p_z0 \times (-z_0 + z_max * sign(p_z0))
     
    366369      if ( fabs(R_c - r) > R_max || R_c + r  < R_max ) t = t_z;
    367370      else {
    368          t_T = (Phi_c - phi_0 + atan2( (R_max + rr)*(R_max - rr) , 2*r*R_c ) ) / omega;
     371         if(r==0|| R_c ==0) t_T=1E99;
     372         //else t_T = (Phi_c - phi_0 + atan2( (R_max + rr)*(R_max - rr) , 2*r*R_c ) ) / omega;
     373         else t_T = (Phi_c - phi_0 + acos( (R_max + rr)*(R_max - rr) / (2*r*R_c) ) ) / omega;
    369374         t = min(t_T,t_z);
    370375      }
Note: See TracChangeset for help on using the changeset viewer.