// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // Test File for tracking functions on a solid surface // // o Basic asserts on each function + // awkward cases for tracking / geom algorithms // // o Add tests on dicovering bugs in G4Sphere.cc... // // History: // // 28.03.06 V.Grichine orb modifications for accuracy 2nd algorithms // // 16.07.05 V.Grichine creation for box, tubs, cons, sphere, orb, torus // based on testSurfaceInOut.cc #include "G4ios.hh" #include #include #include "globals.hh" #include "geomdefs.hh" #include "Randomize.hh" #include "ApproxEqual.hh" #include "G4ThreeVector.hh" #include "G4RotationMatrix.hh" #include "G4AffineTransform.hh" #include "G4VoxelLimits.hh" #include "G4GeometryTolerance.hh" #include "G4Box.hh" #include "G4Orb.hh" #include "G4Tubs.hh" #include "G4Sphere.hh" #include "G4Cons.hh" #include "G4Hype.hh" #include "G4Para.hh" #include "G4Torus.hh" #include "G4Trd.hh" /////////////////////////////////////////////////////////////////////////// // // //const G4double kApproxEqualTolerance = kCarTolerance; // Return true if the double check is approximately equal to target // // Process: // // Return true is difference < kApproxEqualTolerance //G4bool ApproxEqual(const G4double check,const G4double target) //{ // return (std::fabs(check-target) 1.) cosTheta = 1.; if( cosTheta < -1.) cosTheta = -1.; sinTheta = std::sqrt( 1. - cosTheta*cosTheta ); phi = 2*pi*G4UniformRand(); vx = sinTheta*std::cos(phi); vy = sinTheta*std::sin(phi); vz = cosTheta; return G4ThreeVector(vx,vy,vz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector around box surface G4ThreeVector GetVectorAroundBox( G4Box& box ) { G4double a, b, c, px, py, pz; G4double part = std::pow(2,1./3.); G4double kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); a = part*box.GetXHalfLength(); b = part*box.GetYHalfLength(); c = part*box.GetZHalfLength(); px = -a - 0.5*kCarTolerance + (2.*a + kCarTolerance)*G4UniformRand(); py = -b - 0.5*kCarTolerance + (2.*b + kCarTolerance)*G4UniformRand(); pz = -c - 0.5*kCarTolerance + (2.*c + kCarTolerance)*G4UniformRand(); return G4ThreeVector(px,py,pz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector on orb surface G4ThreeVector GetVectorOnOrb(G4Orb& orb, G4ThreeVector& norm) { G4double cosTheta, sinTheta, phi, radius, px, py, pz; radius = orb.GetRadius(); // radius += -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); cosTheta = -1. + 2.*G4UniformRand(); if( cosTheta > 1.) cosTheta = 1.; if( cosTheta < -1.) cosTheta = -1.; sinTheta = std::sqrt( 1. - cosTheta*cosTheta ); phi = 2*pi*G4UniformRand(); px = radius*sinTheta*std::cos(phi); py = radius*sinTheta*std::sin(phi); pz = radius*cosTheta; norm = G4ThreeVector( sinTheta*std::cos(phi), sinTheta*std::sin(phi), cosTheta); return G4ThreeVector(px,py,pz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector around orb surface G4ThreeVector GetVectorAroundOrb(G4Orb& orb) { G4double cosTheta, sinTheta, phi, radius, px, py, pz; radius = 4.*orb.GetRadius(); // 1.26 radius *= G4UniformRand(); cosTheta = -1. + 2.*G4UniformRand(); if( cosTheta > 1.) cosTheta = 1.; if( cosTheta < -1.) cosTheta = -1.; sinTheta = std::sqrt( 1. - cosTheta*cosTheta ); phi = 2*pi*G4UniformRand(); px = radius*sinTheta*std::cos(phi); py = radius*sinTheta*std::sin(phi); pz = radius*cosTheta; return G4ThreeVector(px,py,pz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector on sphere surface G4ThreeVector GetVectorOnSphere(G4Sphere& sphere) { G4double cosTheta, sinTheta, phi, radius, px, py, pz; G4double part = 1./6.; G4double rand = G4UniformRand(); G4double pRmin = sphere.GetInsideRadius(); G4double pRmax = sphere.GetOuterRadius(); G4double phi1 = sphere.GetStartPhiAngle(); G4double phi2 = phi1 + sphere.GetDeltaPhiAngle(); G4double theta1 = sphere.GetStartThetaAngle(); G4double theta2 = theta1 + sphere.GetDeltaThetaAngle(); G4double kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); G4double kAngTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance(); if ( rand < part ) // Rmax { radius = pRmax -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); cosTheta = std::cos(theta2+0.5*kAngTolerance) + (std::cos(theta1-0.5*kAngTolerance)-std::cos(theta2+0.5*kAngTolerance))*G4UniformRand(); if( cosTheta > 1.) cosTheta = 1.; if( cosTheta < -1.) cosTheta = -1.; sinTheta = std::sqrt( 1. - cosTheta*cosTheta ); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } else if ( rand < 2*part ) // Rmin { radius = pRmin -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); cosTheta = std::cos(theta2+0.5*kAngTolerance) + (std::cos(theta1-0.5*kAngTolerance)-std::cos(theta2+0.5*kAngTolerance))*G4UniformRand(); if( cosTheta > 1.) cosTheta = 1.; if( cosTheta < -1.) cosTheta = -1.; sinTheta = std::sqrt( 1. - cosTheta*cosTheta ); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } else if ( rand < 3*part ) // phi1 { radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); cosTheta = std::cos(theta2+0.5*kAngTolerance) + (std::cos(theta1-0.5*kAngTolerance)-std::cos(theta2+0.5*kAngTolerance))*G4UniformRand(); if( cosTheta > 1.) cosTheta = 1.; if( cosTheta < -1.) cosTheta = -1.; sinTheta = std::sqrt( 1. - cosTheta*cosTheta ); phi = phi1 -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); } else if ( rand < 4*part ) // phi2 { radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); cosTheta = std::cos(theta2+0.5*kAngTolerance) + (std::cos(theta1-0.5*kAngTolerance)-std::cos(theta2+0.5*kAngTolerance))*G4UniformRand(); if( cosTheta > 1.) cosTheta = 1.; if( cosTheta < -1.) cosTheta = -1.; sinTheta = std::sqrt( 1. - cosTheta*cosTheta ); phi = phi2 -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); } else if ( rand < 5*part ) // theta1 { radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); cosTheta = std::cos(theta1+0.5*kAngTolerance) + (std::cos(theta1-0.5*kAngTolerance)-std::cos(theta1+0.5*kAngTolerance))*G4UniformRand(); if( cosTheta > 1.) cosTheta = 1.; if( cosTheta < -1.) cosTheta = -1.; sinTheta = std::sqrt( 1. - cosTheta*cosTheta ); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } else // theta2 { radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); cosTheta = std::cos(theta2+0.5*kAngTolerance) + (std::cos(theta2-0.5*kAngTolerance)-std::cos(theta2+0.5*kAngTolerance))*G4UniformRand(); if( cosTheta > 1.) cosTheta = 1.; if( cosTheta < -1.) cosTheta = -1.; sinTheta = std::sqrt( 1. - cosTheta*cosTheta ); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } px = radius*sinTheta*std::cos(phi); py = radius*sinTheta*std::sin(phi); pz = radius*cosTheta; return G4ThreeVector(px,py,pz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector around sphere surface G4ThreeVector GetVectorAroundSphere(G4Sphere& sphere) { G4double cosTheta, sinTheta, phi, radius, px, py, pz; // G4double pRmin = sphere.GetInsideRadius(); G4double pRmax = 1.26*sphere.GetOuterRadius(); // G4double phi1 = sphere.GetStartPhiAngle(); // G4double phi2 = phi1 + sphere.GetDeltaPhiAngle(); // G4double theta1 = sphere.GetStartThetaAngle(); // G4double theta2 = theta1 + sphere.GetDeltaThetaAngle(); radius = pRmax*G4UniformRand(); cosTheta = -1. + 2.*G4UniformRand(); if( cosTheta > 1.) cosTheta = 1.; if( cosTheta < -1.) cosTheta = -1.; sinTheta = std::sqrt( 1. - cosTheta*cosTheta ); phi = 2*pi*G4UniformRand(); px = radius*sinTheta*std::cos(phi); py = radius*sinTheta*std::sin(phi); pz = radius*cosTheta; return G4ThreeVector(px,py,pz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector on tubs surface G4ThreeVector GetVectorOnTubs(G4Tubs& tubs) { G4double phi, radius, px, py, pz; // G4double part = 1.; // G4double rand = G4UniformRand(); // G4double pRmin = tubs.GetInnerRadius (); G4double pRmax = tubs.GetOuterRadius (); G4double tubsZ = 0.999*tubs.GetZHalfLength (); // G4double phi1 = tubs.GetStartPhiAngle (); // G4double phi2 = phi1 + tubs.GetDeltaPhiAngle (); // G4double kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); // G4double kAngTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance(); // if ( rand < part ) // Rmax { radius = pRmax; // -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); // pz = -tubsZ - 0.5*kCarTolerance + (2*tubsZ + kCarTolerance)*G4UniformRand(); pz = -tubsZ + 2*tubsZ*G4UniformRand(); // phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); phi = 2*pi*G4UniformRand(); } /* else if ( rand < 2*part ) // Rmin { radius = pRmin -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); pz = -tubsZ - 0.5*kCarTolerance + (2*tubsZ + kCarTolerance)*G4UniformRand(); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } else if ( rand < 3*part ) // phi1 { radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); pz = -tubsZ - 0.5*kCarTolerance + (2*tubsZ + kCarTolerance)*G4UniformRand(); phi = phi1 -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); } else if ( rand < 4*part ) // phi2 { radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); pz = -tubsZ - 0.5*kCarTolerance + (2*tubsZ + kCarTolerance)*G4UniformRand(); phi = phi2 -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); } else if ( rand < 5*part ) // -fZ { radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); pz = -tubsZ - 0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } else // fZ { radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); pz = tubsZ - 0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } */ px = radius*std::cos(phi); py = radius*std::sin(phi); return G4ThreeVector(px,py,pz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector around tubs surface G4ThreeVector GetVectorAroundTubs(G4Tubs& tubs) { G4double phi, radius, px, py, pz; G4double partR = 3.; // 1.26; G4double partZ = 1.; // 1.26; G4double pRmax = partR*tubs.GetOuterRadius (); G4double tubsZ = 0.999*partZ*tubs.GetZHalfLength (); // G4double pRmin = tubs.GetInnerRadius (); // G4double phi1 = tubs.GetStartPhiAngle (); // G4double phi2 = phi1 + tubs.GetDeltaPhiAngle (); radius = pRmax*G4UniformRand(); pz = -tubsZ + 2*tubsZ*G4UniformRand(); phi = 2*pi*G4UniformRand(); px = radius*std::cos(phi); py = radius*std::sin(phi); return G4ThreeVector(px,py,pz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector on cons surface G4ThreeVector GetVectorOnCons(G4Cons& cons) { // G4double pRmin, pRmax; G4double phi, radius, px, py, pz; // G4double part = 1.; // /6.; // G4double rand = G4UniformRand(); // G4double kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); // G4double kAngTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance(); // G4double pRmin1 = cons.GetInnerRadiusMinusZ (); G4double pRmax1 = cons.GetOuterRadiusMinusZ (); // G4double pRmin2 = cons.GetInnerRadiusPlusZ (); G4double pRmax2 = cons.GetOuterRadiusPlusZ (); G4double consZ = cons.GetZHalfLength (); // G4double phi1 = cons.GetStartPhiAngle (); // G4double phi2 = phi1 + cons.GetDeltaPhiAngle (); // G4double tgMin = 0.5*(pRmin2 - pRmin1)/consZ; G4double tgMax = 0.5*(pRmax2 - pRmax1)/consZ; // consZ *= 0.999; G4double cof = 0.999; // if ( rand < part ) // Rmax { pz = -cof*consZ + 2*cof*consZ*G4UniformRand(); radius = pRmax1 + tgMax*( pz + consZ ); // radius = pRmax; // -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); phi = 2*pi*G4UniformRand(); } /* else if ( rand < 2*part ) // Rmin { pz = -consZ - 0.5*kCarTolerance + (2*consZ + kCarTolerance)*G4UniformRand(); pRmin = pRmin1 + tgMin*(pz+consZ); radius = pRmin -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } else if ( rand < 3*part ) // phi1 { pz = -consZ - 0.5*kCarTolerance + (2*consZ + kCarTolerance)*G4UniformRand(); pRmax = pRmax1 + tgMax*(pz+consZ); pRmin = pRmin1 + tgMin*(pz+consZ); radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); phi = phi1 -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); } else if ( rand < 4*part ) // phi2 { pz = -consZ - 0.5*kCarTolerance + (2*consZ + kCarTolerance)*G4UniformRand(); pRmax = pRmax1 + tgMax*(pz+consZ); pRmin = pRmin1 + tgMin*(pz+consZ); radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); phi = phi2 -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); } else if ( rand < 5*part ) // -fZ { pz = -consZ - 0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); radius = pRmin1 - 0.5*kCarTolerance + (pRmax1-pRmin1+kCarTolerance)*G4UniformRand(); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } else // fZ { pz = consZ - 0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); radius = pRmin2 - 0.5*kCarTolerance + (pRmax2-pRmin2+kCarTolerance)*G4UniformRand(); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } */ px = radius*std::cos(phi); py = radius*std::sin(phi); return G4ThreeVector(px,py,pz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector around cons surface G4ThreeVector GetVectorAroundCons(G4Cons& cons) { G4double phi, pRmax, radius, px, py, pz; // G4double rand = G4UniformRand(); // G4double pRmin1 = cons.GetInnerRadiusMinusZ (); G4double pRmax1 = cons.GetOuterRadiusMinusZ (); // G4double pRmin2 = cons.GetInnerRadiusPlusZ (); G4double pRmax2 = cons.GetOuterRadiusPlusZ (); G4double consZ = cons.GetZHalfLength (); // G4double phi1 = cons.GetStartPhiAngle (); // G4double phi2 = phi1 + cons.GetDeltaPhiAngle (); // G4double tgMin = (pRmin2 - pRmin1)/(2.*consZ); G4double tgMax = (pRmax2 - pRmax1)/(2.*consZ); consZ *= 0.999; pz = -consZ + 2*consZ*G4UniformRand(); pRmax = pRmax1 + tgMax*(pz+consZ); pRmax *= 3.; radius = pRmax*G4UniformRand(); phi = twopi*G4UniformRand(); px = radius*std::cos(phi); py = radius*std::sin(phi); return G4ThreeVector(px,py,pz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector on torus surface G4ThreeVector GetVectorOnTorus(G4Torus& torus) { G4double phi, alpha, radius, px, py, pz; // G4double part = 1./4.; // G4double rand = G4UniformRand(); // G4double pRmin = torus.GetRmin(); G4double pRmax = torus.GetRmax(); G4double pRtor = torus.GetRtor(); // G4double phi1 = torus.GetSPhi(); // G4double phi2 = phi1 + torus.GetDPhi (); // G4double kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); // G4double kAngTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance(); // if ( rand < part ) // Rmax { radius = pRmax; // -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); alpha = -halfpi + pi*G4UniformRand(); phi = pi*G4UniformRand(); } /* else if ( rand < 2*part ) // Rmin { radius = pRmin -0.5*kCarTolerance + (kCarTolerance)*G4UniformRand(); alpha = twopi*G4UniformRand(); phi = phi1 - 0.5*kAngTolerance + (phi2 - phi1 + kAngTolerance)*G4UniformRand(); } else if ( rand < 3*part ) // phi1 { radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); alpha = twopi*G4UniformRand(); // pz = -pRtor - 0.5*kCarTolerance + (2*pRtor + kCarTolerance)*G4UniformRand(); phi = phi1 -0.5*kAngTolerance + (kAngTolerance)*G4UniformRand(); } else // phi2 { radius = pRmin - 0.5*kCarTolerance + (pRmax-pRmin+kCarTolerance)*G4UniformRand(); alpha = twopi*G4UniformRand(); phi = phi2 -0.5*kAngTolerance + (kAngTolerance)*G4UniformRand(); } */ px = (pRtor+radius*std::cos(alpha))*std::cos(phi); py = (pRtor+radius*std::cos(alpha))*std::sin(phi); pz = radius*std::sin(alpha); return G4ThreeVector(px,py,pz); } ///////////////////////////////////////////////////////////////////////////// // // Random vector around torus surface G4ThreeVector GetVectorAroundTorus(G4Torus& torus) { G4double phi, alpha, radius, px, py, pz; G4double pRmax = torus.GetRmax(); G4double pRtor = torus.GetRtor(); radius = 3*pRmax*G4UniformRand(); alpha = -halfpi + pi*G4UniformRand(); phi = pi*G4UniformRand(); pRtor *= 3*G4UniformRand(); px = (pRtor+radius*std::cos(alpha))*std::cos(phi); py = (pRtor+radius*std::cos(alpha))*std::sin(phi); pz = radius*std::sin(alpha); return G4ThreeVector(px,py,pz); } enum Esolid {kBox, kOrb, kSphere, kCons, kTubs, kTorus, kPara, kTrapezoid, kTrd}; ////////////////////////////////////////////////////////////////////// // // Main executable function int main(int argc, char** argv) { G4int test_one_solid( Esolid, int, int ); G4int no_points = 1000; G4int dirs_per_point = 10000; G4cout << "Usage: testDistanceAccuracy [ no_surface_points ] [ no_directions_each ] " << G4endl << G4endl; G4int points_in = 0, dirs_in = 0; if( argc >= 2 ) points_in = atoi(argv[1]); if( argc >= 3 ) dirs_in = atoi(argv[2]); if( points_in > 0 ) { no_points= points_in; } if( dirs_in > 0 ) { dirs_per_point = dirs_in; } G4cout << "Testing each solid with " << no_points << " surface points and " << dirs_per_point << " directions each. " << G4endl; Esolid useCase; /* G4cout<< "To test Box." << G4endl; test_one_solid( useCase= kBox, no_points, dirs_per_point ); G4cout<< "To test Para." << G4endl; test_one_solid( useCase= kPara, no_points, dirs_per_point ); G4cout<< "To test Trapezoid." << G4endl; test_one_solid( useCase= kTrapezoid, no_points, dirs_per_point ); G4cout<< "To test Trd." << G4endl; test_one_solid( useCase= kTrd, no_points, dirs_per_point ); G4cout<< "To test Orb." << G4endl; test_one_solid( useCase= kOrb, no_points, dirs_per_point ); G4cout<< "To test Tubs." << G4endl; test_one_solid( useCase= kTubs, no_points, dirs_per_point ); G4cout<< "To test Cons." << G4endl; test_one_solid( useCase= kCons, no_points, dirs_per_point ); */ G4cout<< "To test Torus" << G4endl; test_one_solid( useCase= kTorus, no_points, dirs_per_point ); return 0; } // int test_one_solid ( Esolid useCase, int num_points, int directions_per_point ) { G4int i,j; G4int iMax = num_points, jMax = directions_per_point; G4int iCheck=iMax/10; G4double kRadTolerance = G4GeometryTolerance::GetInstance()->GetRadialTolerance(); jMax = 50; G4int iInNoSurf = 0, iOutNoSurf = 0, iIn = 0, iOut = 0; G4cout << " Reporting every " << iCheck << " points. " << G4endl; G4double distIn, distOut, distCheck, dDist, position, dIn[50], dOut[50]; for(j=0;j