Import Geant4 10.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2017-06-30 10:49:55 +02:00
parent 3a5407696b
commit 1a1316fea4
2180 changed files with 237880 additions and 59109 deletions
+3
View File
@@ -98,6 +98,8 @@ static int variable(const string & name, double & result,
pchar exp_end = exp_begin + strlen(exp_begin) - 1;
if (engine(exp_begin, exp_end, result, exp_end, dictionary) == EVAL::OK)
return EVAL::OK;
else
return EVAL::ERROR_CALCULATION_ERROR;
}
default:
return EVAL::ERROR_CALCULATION_ERROR;
@@ -328,6 +330,7 @@ static int maker(int op, stack<double> & val)
errno = 0;
val.top() = std::pow(val1,val2);
if (errno == 0) return EVAL::OK;
else return EVAL::ERROR_CALCULATION_ERROR;
case UNARY_PLUS: // unary operator '+'
val.top() = val1 + val2; // val1 is zero
return EVAL::OK;
+33 -11
View File
@@ -78,20 +78,42 @@ double HepRotation::delta() const {
Hep3Vector HepRotation::axis () const {
// Determine 2*std::sin(delta) times the u components (I call this uX, uY, Uz)
// Normalization is not needed; it will be done when returning the 3-Vector
const double eps = 1e-15;
double Uz = ryx - rxy;
double Uy = rxz - rzx;
double Ux = rzy - ryz;
double Ux = rzy - ryz;
double Uy = rxz - rzx;
double Uz = ryx - rxy;
if (std::abs(Ux) < eps && std::abs(Uy) < eps && std::abs(Uz) < eps) {
if ( (Uz==0) && (Uy==0) && (Ux==0) ) {
if ( rzz>0 ) {
return Hep3Vector(0,0,1);
} else if ( ryy>0 ) {
return Hep3Vector(0,1,0);
double cosdelta = (rxx + ryy + rzz - 1.0) / 2.0;
if (cosdelta > 0.0) return Hep3Vector(0,0,1); // angle = 0, any axis is good
double mxx = (rxx + 1)/2;
double myy = (ryy + 1)/2;
double mzz = (rzz + 1)/2;
double mxy = (rxy + ryx)/4;
double mxz = (rxz + rzx)/4;
double myz = (ryz + rzy)/4;
double x, y, z;
if (mxx > ryy && mxx > rzz) {
x = std::sqrt(mxx);
if (rzy - ryz < 0) x = -x;
y = mxy/x;
z = mxz/x;
return Hep3Vector( x, y, z ).unit();
} else if (myy > mzz) {
y = std::sqrt(myy);
if (rxz - rzx < 0) y = -y;
x = mxy/y;
z = myz/y;
return Hep3Vector( x, y, z ).unit();
} else {
return Hep3Vector(1,0,0);
z = std::sqrt(mzz);
if (ryx - rxy < 0) z = -z;
x = mxz/z;
y = myz/z;
return Hep3Vector( x, y, z ).unit();
}
} else {
return Hep3Vector( Ux, Uy, Uz ).unit();