Changeset 291 in svn
- Timestamp:
- Mar 4, 2009, 1:54:41 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/interface/BFieldProp.h
r264 r291 87 87 88 88 unsigned int loop_overflow_counter; 89 unsigned int aaa,bbb,ccc,ddd; // to be deleted 90 89 91 }; 90 92 -
trunk/src/BFieldProp.cc
r270 r291 140 140 //cout << "gammam" << gammam << "\t gamma" << gammam/Part->M << endl; 141 141 omega = q * B_z /gammam; 142 r = Part->PT / (omega * gammam); 142 //r = Part->PT / (omega * gammam); 143 r = fabs(Part->PT / (omega * gammam)); 143 144 144 145 // 2. Helix parameters : center coordinates in transverse plane … … 152 153 // 3. time evaluation t = min(t_T, t_z) 153 154 // t_T : time to exit from the sides 154 // t_T= [ Phi_c - phi_0 + a tan( (R_max^2 - (R_c^2 + r^2))/(2rR_c) ) ]/omega155 // t_T= [ Phi_c - phi_0 + acos( (R_max^2 - (R_c^2 + r^2))/(2rR_c) ) ]/omega 155 156 // t_z : time to exit from the front or the back 156 157 // t_z = gamma * m /p_z0 \times (-z_0 + z_max * sign(p_z0)) … … 161 162 if ( fabs(R_c - r) > R_max || R_c + r < R_max ) t = t_z; 162 163 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; 164 167 t = min(t_T,t_z); 165 168 } … … 345 348 //cout << "gammam" << gammam << "\t gamma" << gammam/Part->M << endl; 346 349 omega = q * B_z /gammam; 347 r = Part->PT / (omega * gammam);350 r = fabs(Part->PT / (omega * gammam)); 348 351 349 352 // 2. Helix parameters : center coordinates in transverse plane … … 357 360 // 3. time evaluation t = min(t_T, t_z) 358 361 // t_T : time to exit from the sides 359 // t_T= [ Phi_c - phi_0 + a tan( (R_max^2 - (R_c^2 + r^2))/(2rR_c) ) ]/omega362 // t_T= [ Phi_c - phi_0 + acos( (R_max^2 - (R_c^2 + r^2))/(2rR_c) ) ]/omega 360 363 // t_z : time to exit from the front or the back 361 364 // t_z = gamma * m /p_z0 \times (-z_0 + z_max * sign(p_z0)) … … 366 369 if ( fabs(R_c - r) > R_max || R_c + r < R_max ) t = t_z; 367 370 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; 369 374 t = min(t_T,t_z); 370 375 }
Note:
See TracChangeset
for help on using the changeset viewer.