Skip to content
Snippets Groups Projects
Commit 8516d213 authored by Vadim Kostyukhin's avatar Vadim Kostyukhin :angry: Committed by Julien Maurer
Browse files

Fix FPE for zero magnetic field

Fix FPE for zero magnetic field

Add protection against zero magnetic field, so that vertex fit doesn't crash, but return approximate solution
parent eb60effd
Branches mon_stringview
No related tags found
No related merge requests found
......@@ -91,6 +91,7 @@ void cfnewpm(double *par, const double *xyzStart, double *xyzEnd, const double u
/* at new point with new mag.field */
constB = myMagFld.getMagFld(xyzEnd,CONTROL) * myMagFld.getCnvCst() ;
if(std::abs(constB)<0.001)constB=0.001; //Protection against zero field
dpar0[0] = 0.;
dpar0[1] = 0.;
......
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