// // ******************************************************************** // * 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. * // ******************************************************************** // // // $Id: testG4EllipticalTube.cc // GEANT4 tag $Name: // // testG4EllipticalTube // // Test file for class G4EllipticalTube derived from G4EllipticalCone // // Ensure asserts are compiled in #include #include #include "globals.hh" #include "geomdefs.hh" #include "G4GeometryTolerance.hh" #include "G4ThreeVector.hh" #include "G4EllipticalTube.hh" #include "G4RotationMatrix.hh" #include "G4AffineTransform.hh" #include "G4VoxelLimits.hh" const G4String OutputInside(const EInside a) { switch(a) { case kInside: return "Inside"; case kOutside: return "Outside"; case kSurface: return "Surface"; } return "????"; } G4bool testG4EllipticalTube() { G4ThreeVector pzero(0,0,0); G4ThreeVector pout ( 0*cm, 0*cm, 25*cm ) ; G4ThreeVector psurface(2.*mm,0*mm,0*cm); G4ThreeVector dir = pzero-pout ; dir *= 1/dir.mag(); //For Normal G4ThreeVector *pNorm,norm; G4bool *pgoodNorm,goodNorm,calcNorm=true; pNorm=&norm; pgoodNorm=&goodNorm;//For Normal G4EllipticalTube t1("Solid EllipticalTube #1", 2*mm, // xSemiAxis 1*mm, // ySemiAxis 15*cm); // zheight G4double dist = t1.DistanceToOut(pout,dir) ; G4cout << "*********** Testing DistanceToOut method *************** "<GetSurfaceTolerance(); for(G4int i=0; iGetSurfaceTolerance(); //For Normal G4ThreeVector *pNorm,norm,SurfNormal; G4bool *pgoodNorm,goodNorm,calcNorm=true; pNorm=&norm; pgoodNorm=&goodNorm; // for(G4int i=0; i 2.*kCarTolerance){ if(std::fabs(std::fabs(point.z())-15.0*cm)>kCarTolerance) nn++; G4cout<<"point="<