| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // $Id: testG4Tubs.cc,v 1.22 2008/11/05 13:56:30 gcosmo Exp $
|
|---|
| 28 | // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
|
|---|
| 29 | //
|
|---|
| 30 |
|
|---|
| 31 | // testG4Tubs
|
|---|
| 32 | //
|
|---|
| 33 | // Test file for class G4Tubs [NOT thorough]
|
|---|
| 34 | //
|
|---|
| 35 | // Ensure asserts are compiled in
|
|---|
| 36 | //
|
|---|
| 37 | // History:
|
|---|
| 38 | //
|
|---|
| 39 | // ~95-96 P. Kent R&D
|
|---|
| 40 | // 21.5.99 V. Grichine tests of phi-intersections (t3 and t4)
|
|---|
| 41 |
|
|---|
| 42 | #include <assert.h>
|
|---|
| 43 | #include <cmath>
|
|---|
| 44 |
|
|---|
| 45 | #include "globals.hh"
|
|---|
| 46 | #include "geomdefs.hh"
|
|---|
| 47 |
|
|---|
| 48 | #include "ApproxEqual.hh"
|
|---|
| 49 | #include "G4GeometryTolerance.hh"
|
|---|
| 50 |
|
|---|
| 51 | #include "G4ThreeVector.hh"
|
|---|
| 52 | #include "G4Tubs.hh"
|
|---|
| 53 | #include "G4RotationMatrix.hh"
|
|---|
| 54 | #include "G4AffineTransform.hh"
|
|---|
| 55 | #include "G4VoxelLimits.hh"
|
|---|
| 56 |
|
|---|
| 57 | ///////////////////////////////////////////////////////////////////
|
|---|
| 58 | //
|
|---|
| 59 | // Dave's auxiliary function
|
|---|
| 60 |
|
|---|
| 61 | const G4String OutputInside(const EInside a)
|
|---|
| 62 | {
|
|---|
| 63 | switch(a)
|
|---|
| 64 | {
|
|---|
| 65 | case kInside: return "Inside";
|
|---|
| 66 | case kOutside: return "Outside";
|
|---|
| 67 | case kSurface: return "Surface";
|
|---|
| 68 | }
|
|---|
| 69 | return "????";
|
|---|
| 70 | }
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 | G4bool testG4Tubs()
|
|---|
| 74 | {
|
|---|
| 75 | G4cout.precision(16) ;
|
|---|
| 76 | EInside side;
|
|---|
| 77 | G4ThreeVector pzero(0,0,0);
|
|---|
| 78 |
|
|---|
| 79 | G4double kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
|
|---|
| 80 |
|
|---|
| 81 | G4ThreeVector pbigx(100,0,0),pbigy(0,100,0),pbigz(0,0,100);
|
|---|
| 82 | G4ThreeVector pbigmx(-100,0,0),pbigmy(0,-100,0),pbigmz(0,0,-100);
|
|---|
| 83 |
|
|---|
| 84 | G4ThreeVector ponxside(50,0,0);
|
|---|
| 85 |
|
|---|
| 86 | G4ThreeVector vx(1,0,0),vy(0,1,0),vz(0,0,1);
|
|---|
| 87 | G4ThreeVector vmx(-1,0,0),vmy(0,-1,0),vmz(0,0,-1);
|
|---|
| 88 | G4ThreeVector vxy(1/std::sqrt(2.0),1/std::sqrt(2.0),0);
|
|---|
| 89 | G4ThreeVector vmxy(-1/std::sqrt(2.0),1/std::sqrt(2.0),0);
|
|---|
| 90 | G4ThreeVector vmxmy(-1/std::sqrt(2.0),-1/std::sqrt(2.0),0);
|
|---|
| 91 | G4ThreeVector vxmy(1/std::sqrt(2.0),-1/std::sqrt(2.0),0);
|
|---|
| 92 |
|
|---|
| 93 | G4double Dist, dist, vol;
|
|---|
| 94 | G4ThreeVector *pNorm,norm;
|
|---|
| 95 | G4bool *pgoodNorm,goodNorm,calcNorm=true;
|
|---|
| 96 |
|
|---|
| 97 | pNorm=&norm;
|
|---|
| 98 | pgoodNorm=&goodNorm;
|
|---|
| 99 |
|
|---|
| 100 | G4Tubs t1("Solid Tube #1",0,50*mm,50*mm,0,2*pi);
|
|---|
| 101 |
|
|---|
| 102 | G4Tubs t1a("Solid Tube #1",0,50*mm,50*mm,0,0.5*pi);
|
|---|
| 103 |
|
|---|
| 104 | G4Tubs t2("Hole Tube #2",45*mm,50*mm,50*mm,0,2*pi);
|
|---|
| 105 |
|
|---|
| 106 | G4Tubs t2a("Hole Tube #2",5*mm,50*mm,50*mm,0,2*pi);
|
|---|
| 107 |
|
|---|
| 108 | G4Tubs t2b("Hole Tube #2",15*mm,50*mm,50*mm,0,2*pi);
|
|---|
| 109 |
|
|---|
| 110 | G4Tubs t2c("Hole Tube #2",25*mm,50*mm,50*mm,0,2*pi);
|
|---|
| 111 |
|
|---|
| 112 | G4Tubs t2d("Hole Tube #2",35*mm,50*mm,50*mm,0,2*pi);
|
|---|
| 113 |
|
|---|
| 114 | G4Tubs t3("Solid Sector #3",0,50*mm,50*mm,halfpi,halfpi);
|
|---|
| 115 |
|
|---|
| 116 | G4Tubs t4("Hole Sector #4",45*mm,50*mm,50*mm,halfpi,halfpi);
|
|---|
| 117 |
|
|---|
| 118 | G4Tubs t5("Hole Sector #5",50*mm,100*mm,50*mm,0.0,270.0*deg);
|
|---|
| 119 |
|
|---|
| 120 | G4Tubs t6("Solid Sector #3",0,50*mm,50*mm,halfpi,3.*halfpi);
|
|---|
| 121 |
|
|---|
| 122 | G4Tubs tube6("tube6",750,760,350,0.31415926535897931,5.6548667764616276);
|
|---|
| 123 |
|
|---|
| 124 | G4Tubs tube7("tube7",2200,3200,2500,-0.68977164349384879,3.831364227270472);
|
|---|
| 125 |
|
|---|
| 126 | G4Tubs tube8("tube8",2550,2580,2000,0,2*pi);
|
|---|
| 127 |
|
|---|
| 128 | G4Tubs tube9("tube9",1150,1180,2000,0,2*pi);
|
|---|
| 129 |
|
|---|
| 130 | G4Tubs tube10("tube10",400*mm,405*mm,400*mm,0*degree,360*degree) ;
|
|---|
| 131 |
|
|---|
| 132 | G4Tubs* clad =
|
|---|
| 133 | new G4Tubs("clad",90.,110.,10.5*cm,0.*deg,180.*deg); // external
|
|---|
| 134 |
|
|---|
| 135 | G4Tubs* core =
|
|---|
| 136 | new G4Tubs("core",95.,105.,10.*cm,0.*deg,180.*deg); // internal
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 | G4cout.precision(20);
|
|---|
| 140 |
|
|---|
| 141 | // Check name
|
|---|
| 142 |
|
|---|
| 143 | assert(t1.GetName()=="Solid Tube #1");
|
|---|
| 144 |
|
|---|
| 145 | // Check cubic volume
|
|---|
| 146 | vol = t1.GetCubicVolume();
|
|---|
| 147 | assert(ApproxEqual(vol,785398.16339744825));
|
|---|
| 148 | assert( ApproxEqual(vol,785398.163397) );
|
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 | // Check Inside
|
|---|
| 152 |
|
|---|
| 153 | //
|
|---|
| 154 | // Make a tub
|
|---|
| 155 | //
|
|---|
| 156 | G4Tubs *arc = new G4Tubs( "outer", 1*m, 1.1*m, 0.01*m, -15*deg, 30*deg );
|
|---|
| 157 |
|
|---|
| 158 | //
|
|---|
| 159 | // First issue:
|
|---|
| 160 | // A point on the start phi surface just beyond the
|
|---|
| 161 | // start angle but still well within tolerance
|
|---|
| 162 | // is found to be "outside" by G4Tubs::Inside
|
|---|
| 163 | //
|
|---|
| 164 | // pt1 = exactly on phi surface (within precision)
|
|---|
| 165 | // pt2 = t1 but slightly higher, and still on tolerant surface
|
|---|
| 166 | // pt3 = t1 but slightly lower, and still on tolerant surface
|
|---|
| 167 | //
|
|---|
| 168 | G4ThreeVector pt1( 1.05*m*std::cos(-15*deg),
|
|---|
| 169 | 1.05*m*std::sin(-15*deg),
|
|---|
| 170 | 0*m );
|
|---|
| 171 |
|
|---|
| 172 | G4ThreeVector pt2 = pt1 + G4ThreeVector(0,0.001*kCarTolerance,0) ;
|
|---|
| 173 | G4ThreeVector pt3 = pt1 - G4ThreeVector(0,0.001*kCarTolerance,0) ;
|
|---|
| 174 |
|
|---|
| 175 | EInside a1 = arc->Inside(pt1);
|
|---|
| 176 | EInside a2 = arc->Inside(pt2);
|
|---|
| 177 | EInside a3 = arc->Inside(pt3);
|
|---|
| 178 |
|
|---|
| 179 | // G4cout << "Point pt1 is " << OutputInside(a1) << G4endl;
|
|---|
| 180 |
|
|---|
| 181 | assert(a1==kSurface);
|
|---|
| 182 | // G4cout << "Point pt2 is " << OutputInside(a2) << G4endl;
|
|---|
| 183 | assert(a2==kSurface);
|
|---|
| 184 | // G4cout << "Point pt3 is " << OutputInside(a3) << G4endl;
|
|---|
| 185 | assert(a3==kSurface);
|
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 | assert(t1.Inside(pzero)==kInside);
|
|---|
| 189 | assert(t1.Inside(pbigx)==kOutside);
|
|---|
| 190 |
|
|---|
| 191 | EInside in = t5.Inside(G4ThreeVector(60,-0.001*kCarTolerance,0)) ;
|
|---|
| 192 | assert(in == kSurface);
|
|---|
| 193 | // G4cout<<"t5.Inside(G4ThreeVector(60,-0.001*kCarTolerance,0)) = "
|
|---|
| 194 | // <<OutputInside(in)<<G4endl;
|
|---|
| 195 | in = tube10.Inside(G4ThreeVector(-114.8213313833317*mm,
|
|---|
| 196 | 382.7843220719649*mm,
|
|---|
| 197 | -32.20788536438663*mm)) ;
|
|---|
| 198 | // assert(in == kSurface);
|
|---|
| 199 | // G4cout<<"tube10.Inside(G4ThreeVector(-114.821...)) = "<<OutputInside(in)<<G4endl;
|
|---|
| 200 |
|
|---|
| 201 | // Check Surface Normal
|
|---|
| 202 |
|
|---|
| 203 | G4ThreeVector normal;
|
|---|
| 204 | G4double p2=1./std::sqrt(2.),p3=1./std::sqrt(3.);
|
|---|
| 205 | normal=t1.SurfaceNormal(ponxside);
|
|---|
| 206 | assert(ApproxEqual(normal,vx));
|
|---|
| 207 |
|
|---|
| 208 | normal=t4.SurfaceNormal(G4ThreeVector(0.,50.,0.));
|
|---|
| 209 | assert(ApproxEqual(normal,G4ThreeVector(p2,p2,0.)));
|
|---|
| 210 | normal=t4.SurfaceNormal(G4ThreeVector(0.,45.,0.));
|
|---|
| 211 | assert(ApproxEqual(normal,G4ThreeVector(p2,-p2,0.)));
|
|---|
| 212 | normal=t4.SurfaceNormal(G4ThreeVector(0.,45.,50.));
|
|---|
| 213 | assert(ApproxEqual(normal,G4ThreeVector(p3,-p3,p3)));
|
|---|
| 214 | normal=t4.SurfaceNormal(G4ThreeVector(0.,45.,-50.));
|
|---|
| 215 | assert(ApproxEqual(normal,G4ThreeVector(p3,-p3,-p3)));
|
|---|
| 216 | normal=t4.SurfaceNormal(G4ThreeVector(-50.,0.,-50.));
|
|---|
| 217 | assert(ApproxEqual(normal,G4ThreeVector(-p3,-p3,-p3)));
|
|---|
| 218 | normal=t4.SurfaceNormal(G4ThreeVector(-50.,0.,0.));
|
|---|
| 219 | assert(ApproxEqual(normal,G4ThreeVector(-p2,-p2,0.)));
|
|---|
| 220 | normal=t6.SurfaceNormal(G4ThreeVector(0.,0.,0.));
|
|---|
| 221 | assert(ApproxEqual(normal,G4ThreeVector(p2,p2,0.)));
|
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 | G4ThreeVector pSN1 = G4ThreeVector( 33.315052227388207, 37.284142675357259, 33.366096020078537);
|
|---|
| 225 | G4Tubs t4SN("Hole Sector #4",45*mm,50*mm,50*mm,pi/4.,pi/8.);
|
|---|
| 226 |
|
|---|
| 227 | in = t4SN.Inside(pSN1);
|
|---|
| 228 | assert(in == kSurface);
|
|---|
| 229 | normal = t4SN.SurfaceNormal(pSN1);
|
|---|
| 230 |
|
|---|
| 231 | // DistanceToOut(P)
|
|---|
| 232 | Dist=t1.DistanceToOut(pzero);
|
|---|
| 233 | assert(ApproxEqual(Dist,50));
|
|---|
| 234 |
|
|---|
| 235 | // DistanceToOut(P,V)
|
|---|
| 236 | Dist=t1.DistanceToOut(pzero,vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 237 | assert(ApproxEqual(Dist,50)&&ApproxEqual(pNorm->unit(),vx)&&*pgoodNorm);
|
|---|
| 238 | Dist=t1.DistanceToOut(pzero,vmx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 239 | assert(ApproxEqual(Dist,50)&&ApproxEqual(pNorm->unit(),vmx)&&*pgoodNorm);
|
|---|
| 240 | Dist=t1.DistanceToOut(pzero,vy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 241 | assert(ApproxEqual(Dist,50)&&ApproxEqual(pNorm->unit(),vy)&&*pgoodNorm);
|
|---|
| 242 | Dist=t1.DistanceToOut(pzero,vmy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 243 | assert(ApproxEqual(Dist,50)&&ApproxEqual(pNorm->unit(),vmy)&&*pgoodNorm);
|
|---|
| 244 | Dist=t1.DistanceToOut(pzero,vz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 245 | assert(ApproxEqual(Dist,50)&&ApproxEqual(pNorm->unit(),vz)&&*pgoodNorm);
|
|---|
| 246 | Dist=t1.DistanceToOut(pzero,vmz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 247 | assert(ApproxEqual(Dist,50)&&ApproxEqual(pNorm->unit(),vmz)&&*pgoodNorm);
|
|---|
| 248 | Dist=t1.DistanceToOut(pzero,vxy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 249 | assert(ApproxEqual(Dist,50)&&ApproxEqual(pNorm->unit(),vxy)&&*pgoodNorm);
|
|---|
| 250 |
|
|---|
| 251 | Dist=t2.DistanceToOut(pzero,vxy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 252 | // G4cout<<"Dist=t2.DistanceToOut(pzero,vxy) = "<<Dist<<G4endl;
|
|---|
| 253 |
|
|---|
| 254 | Dist=t2.DistanceToOut(ponxside,vmx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 255 | // G4cout<<"Dist=t2.DistanceToOut(ponxside,vmx) = "<<Dist<<G4endl;
|
|---|
| 256 |
|
|---|
| 257 | Dist=t2.DistanceToOut(ponxside,vmxmy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 258 | // G4cout<<"Dist=t2.DistanceToOut(ponxside,vmxmy) = "<<Dist<<G4endl;
|
|---|
| 259 |
|
|---|
| 260 | Dist=t2.DistanceToOut(ponxside,vz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 261 | // G4cout<<"Dist=t2.DistanceToOut(ponxside,vz) = "<<Dist<<G4endl;
|
|---|
| 262 |
|
|---|
| 263 | Dist=t2.DistanceToOut(pbigx,vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 264 | // G4cout<<"Dist=t2.DistanceToOut(pbigx,vx) = "<<Dist<<G4endl;
|
|---|
| 265 |
|
|---|
| 266 | Dist=t2.DistanceToOut(pbigx,vxy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 267 | // G4cout<<"Dist=t2.DistanceToOut(pbigx,vxy) = "<<Dist<<G4endl;
|
|---|
| 268 |
|
|---|
| 269 | Dist=t2.DistanceToOut(pbigx,vz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 270 | // G4cout<<"Dist=t2.DistanceToOut(pbigx,vz) = "<<Dist<<G4endl;
|
|---|
| 271 |
|
|---|
| 272 | Dist=t2.DistanceToOut(G4ThreeVector(45.5,0,0),vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 273 | // G4cout<<"Dist=t2.DistanceToOut((45.5,0,0),vx) = "<<Dist<<G4endl;
|
|---|
| 274 |
|
|---|
| 275 | Dist=t2.DistanceToOut(G4ThreeVector(49.5,0,0),vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 276 | // G4cout<<"Dist=t2.DistanceToOut((49.5,0,0),vx) = "<<Dist<<G4endl;
|
|---|
| 277 |
|
|---|
| 278 |
|
|---|
| 279 | Dist=t3.DistanceToOut(G4ThreeVector(0,10,0),vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 280 | // G4cout<<"Dist=t3.DistanceToOut((0,10,0),vx) = "<<Dist<<G4endl;
|
|---|
| 281 | assert(ApproxEqual(Dist,0));
|
|---|
| 282 |
|
|---|
| 283 | Dist=t3.DistanceToOut(G4ThreeVector(0.5,10,0),vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 284 | // G4cout<<"Dist=t3.DistanceToOut((0.5,10,0),vx) = "<<Dist<<G4endl;
|
|---|
| 285 | assert(ApproxEqual(Dist,48.489795));
|
|---|
| 286 |
|
|---|
| 287 | Dist=t3.DistanceToOut(G4ThreeVector(-0.5,9,0),vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 288 | // G4cout<<"Dist=t3.DistanceToOut((-0.5,9,0),vx) = "<<Dist<<G4endl;
|
|---|
| 289 | assert(ApproxEqual(Dist,0.5));
|
|---|
| 290 |
|
|---|
| 291 | Dist=t3.DistanceToOut(G4ThreeVector(-5,9.5,0),vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 292 | // G4cout<<"Dist=t3.DistanceToOut((-5,9.5,0),vx) = "<<Dist<<G4endl;
|
|---|
| 293 | assert(ApproxEqual(Dist,5));
|
|---|
| 294 |
|
|---|
| 295 | Dist=t3.DistanceToOut(G4ThreeVector(-5,9.5,0),vmy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 296 | // G4cout<<"Dist=t3.DistanceToOut((-5,9.5,0),vmy) = "<<Dist<<G4endl;
|
|---|
| 297 | assert(ApproxEqual(Dist,9.5));
|
|---|
| 298 |
|
|---|
| 299 | Dist=t3.DistanceToOut(G4ThreeVector(-5,9,0),vxmy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 300 | // G4cout<<"Dist=t3.DistanceToOut((-5,9,0),vxmy) = "<<Dist<<G4endl;
|
|---|
| 301 | assert(ApproxEqual(Dist,7.0710678));
|
|---|
| 302 |
|
|---|
| 303 | // bug #76
|
|---|
| 304 | Dist=tube6.DistanceToOut(
|
|---|
| 305 | G4ThreeVector(-388.20504321896431,-641.71398957741451,332.85995254027955),
|
|---|
| 306 | G4ThreeVector(-0.47312863350457468,-0.782046391443315, 0.40565100491504164),
|
|---|
| 307 | calcNorm,pgoodNorm,pNorm);
|
|---|
| 308 | // G4cout<<"Dist=tube6.DistanceToOut(p,v) = "<<Dist<<G4endl;
|
|---|
| 309 | assert(ApproxEqual(Dist,10.940583));
|
|---|
| 310 |
|
|---|
| 311 | // bug #91
|
|---|
| 312 | Dist=tube7.DistanceToOut(
|
|---|
| 313 | G4ThreeVector(-2460,1030,-2500),
|
|---|
| 314 | G4ThreeVector(-0.086580540180167642,0.070084247882560638,0.9937766390194761),
|
|---|
| 315 | calcNorm,pgoodNorm,pNorm);
|
|---|
| 316 | // G4cout<<"Dist=tube7.DistanceToOut(p,v) = "<<Dist<<G4endl;
|
|---|
| 317 | // assert(ApproxEqual(Dist,4950.348576972614));
|
|---|
| 318 |
|
|---|
| 319 | Dist=tube8.DistanceToOut(
|
|---|
| 320 | G4ThreeVector(6.71645645882942,2579.415860329989,-1.519530725281157),
|
|---|
| 321 | G4ThreeVector(-0.6305220496340839,-0.07780451841562354,0.7722618738739774),
|
|---|
| 322 | calcNorm,pgoodNorm,pNorm);
|
|---|
| 323 | // G4cout<<"Dist=tube8.DistanceToOut(p,v) = "<<Dist<<G4endl;
|
|---|
| 324 | // assert(ApproxEqual(Dist,4950.348576972614));
|
|---|
| 325 |
|
|---|
| 326 | Dist=tube9.DistanceToOut(
|
|---|
| 327 | G4ThreeVector(2.267347771505638,1170.164934028592,4.820317321984064),
|
|---|
| 328 | G4ThreeVector(-0.1443054266272111,-0.01508874701037938,0.9894181489944458),
|
|---|
| 329 | calcNorm,pgoodNorm,pNorm);
|
|---|
| 330 | // G4cout<<"Dist=tube9.DistanceToOut(p,v) = "<<Dist<<G4endl;
|
|---|
| 331 | // assert(ApproxEqual(Dist,4950.348576972614));
|
|---|
| 332 |
|
|---|
| 333 | Dist=t1a.DistanceToOut(G4ThreeVector(0.,0.,50.),vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 334 | G4cout<<"Dist=t1a.DistanceToOut((0,0,50),vx) = "<<Dist<<G4endl;
|
|---|
| 335 | // assert(ApproxEqual(Dist,48.489795));
|
|---|
| 336 |
|
|---|
| 337 | Dist=t1a.DistanceToOut(G4ThreeVector(0.,5.,50.),vmy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 338 | G4cout<<"Dist=t1a.DistanceToOut((0,5,50),vmy) = "<<Dist<<G4endl;
|
|---|
| 339 | // assert(ApproxEqual(Dist,48.489795));
|
|---|
| 340 |
|
|---|
| 341 | G4cout<<G4endl ;
|
|---|
| 342 |
|
|---|
| 343 |
|
|---|
| 344 | //DistanceToIn(P)
|
|---|
| 345 |
|
|---|
| 346 | Dist=t1.DistanceToIn(pbigx);
|
|---|
| 347 | assert(ApproxEqual(Dist,50));
|
|---|
| 348 | Dist=t1.DistanceToIn(pbigmx);
|
|---|
| 349 | assert(ApproxEqual(Dist,50));
|
|---|
| 350 | Dist=t1.DistanceToIn(pbigy);
|
|---|
| 351 | assert(ApproxEqual(Dist,50));
|
|---|
| 352 | Dist=t1.DistanceToIn(pbigmy);
|
|---|
| 353 | assert(ApproxEqual(Dist,50));
|
|---|
| 354 | Dist=t1.DistanceToIn(pbigz);
|
|---|
| 355 | assert(ApproxEqual(Dist,50));
|
|---|
| 356 | Dist=t1.DistanceToIn(pbigmz);
|
|---|
| 357 | assert(ApproxEqual(Dist,50));
|
|---|
| 358 |
|
|---|
| 359 | // DistanceToIn(P,V)
|
|---|
| 360 |
|
|---|
| 361 | Dist=t1.DistanceToIn(pbigx,vmx);
|
|---|
| 362 | assert(ApproxEqual(Dist,50));
|
|---|
| 363 | Dist=t1.DistanceToIn(pbigmx,vx);
|
|---|
| 364 | assert(ApproxEqual(Dist,50));
|
|---|
| 365 | Dist=t1.DistanceToIn(pbigy,vmy);
|
|---|
| 366 | assert(ApproxEqual(Dist,50));
|
|---|
| 367 | Dist=t1.DistanceToIn(pbigmy,vy);
|
|---|
| 368 | assert(ApproxEqual(Dist,50));
|
|---|
| 369 | Dist=t1.DistanceToIn(pbigz,vmz);
|
|---|
| 370 | assert(ApproxEqual(Dist,50));
|
|---|
| 371 | Dist=t1.DistanceToIn(pbigmz,vz);
|
|---|
| 372 | assert(ApproxEqual(Dist,50));
|
|---|
| 373 | Dist=t1.DistanceToIn(pbigx,vxy);
|
|---|
| 374 | assert(ApproxEqual(Dist,kInfinity));
|
|---|
| 375 |
|
|---|
| 376 | Dist=t1a.DistanceToIn(pbigz,vmz);
|
|---|
| 377 | assert(ApproxEqual(Dist,50));
|
|---|
| 378 |
|
|---|
| 379 | Dist=t2.DistanceToIn(G4ThreeVector(45.5,0,0),vx);
|
|---|
| 380 | // G4cout<<"Dist=t2.DistanceToIn((45.5,0,0),vx) = "<<Dist<<G4endl;
|
|---|
| 381 |
|
|---|
| 382 | Dist=t2.DistanceToIn(G4ThreeVector(45.5,0,0),vmx);
|
|---|
| 383 | // G4cout<<"Dist=t2.DistanceToIn((45.5,0,0),vmx) = "<<Dist<<G4endl;
|
|---|
| 384 |
|
|---|
| 385 | Dist=t2.DistanceToIn(G4ThreeVector(49.5,0,0),vmx);
|
|---|
| 386 | // G4cout<<"Dist=t2.DistanceToIn((49.5,0,0),vmx) = "<<Dist<<G4endl;
|
|---|
| 387 |
|
|---|
| 388 | Dist=t2.DistanceToIn(G4ThreeVector(49.5,0,0),vx);
|
|---|
| 389 | // G4cout<<"Dist=t2.DistanceToIn((49.5,0,0),vx) = "<<Dist<<G4endl;
|
|---|
| 390 |
|
|---|
| 391 | Dist=t3.DistanceToIn(G4ThreeVector(49.5,0,0),vmx);
|
|---|
| 392 | // G4cout<<"Dist=t2.DistanceToIn((49.5,0,0),vmx) = "<<Dist<<G4endl;
|
|---|
| 393 |
|
|---|
| 394 | Dist=t3.DistanceToIn(G4ThreeVector(49.5,5,0),vmx);
|
|---|
| 395 | // G4cout<<"Dist=t2.DistanceToIn((49.5,5,0),vmx) = "<<Dist<<G4endl;
|
|---|
| 396 |
|
|---|
| 397 | Dist=t3.DistanceToIn(G4ThreeVector(49.5,-0.5,0),vmx);
|
|---|
| 398 | // G4cout<<"Dist=t2.DistanceToIn((49.5,-0.5,0),vmx) = "<<Dist<<G4endl;
|
|---|
| 399 |
|
|---|
| 400 | Dist=t5.DistanceToIn(G4ThreeVector(30.0,-20.0,0),vxy);
|
|---|
| 401 | // G4cout<<"Dist=t5.DistanceToIn((30.0,-20.0,0),vxy) = "<<Dist<<G4endl;
|
|---|
| 402 | assert(ApproxEqual(Dist,28.284271));
|
|---|
| 403 |
|
|---|
| 404 | Dist=t5.DistanceToIn(G4ThreeVector(30.0,-70.0,0),vxy);
|
|---|
| 405 | // G4cout<<"Dist=t5.DistanceToIn((30.0,-70.0,0),vxy) = "<<Dist<<G4endl;
|
|---|
| 406 | assert(ApproxEqual(Dist,kInfinity));
|
|---|
| 407 |
|
|---|
| 408 | Dist=t5.DistanceToIn(G4ThreeVector(30.0,-20.0,0),vmxmy);
|
|---|
| 409 | // G4cout<<"Dist=t5.DistanceToIn((30.0,-20.0,0),vmxmy) = "<<Dist<<G4endl;
|
|---|
| 410 | assert(ApproxEqual(Dist,42.426407));
|
|---|
| 411 |
|
|---|
| 412 | Dist=t5.DistanceToIn(G4ThreeVector(30.0,-70.0,0),vmxmy);
|
|---|
| 413 | // G4cout<<"Dist=t5.DistanceToIn((30.0,-70.0,0),vmxmy) = "<<Dist<<G4endl;
|
|---|
| 414 | assert(ApproxEqual(Dist,kInfinity));
|
|---|
| 415 |
|
|---|
| 416 | Dist=t5.DistanceToIn(G4ThreeVector(50.0,-20.0,0),vy);
|
|---|
| 417 | // G4cout<<"Dist=t5.DistanceToIn((50.0,-20.0,0),vy) = "<<Dist<<G4endl;
|
|---|
| 418 | assert(ApproxEqual(Dist,20));
|
|---|
| 419 |
|
|---|
| 420 | Dist=t5.DistanceToIn(G4ThreeVector(100.0,-20.0,0),vy);
|
|---|
| 421 | // G4cout<<"Dist=t5.DistanceToIn((100.0,-20.0,0),vy) = "<<Dist<<G4endl;
|
|---|
| 422 | assert(ApproxEqual(Dist,kInfinity));
|
|---|
| 423 |
|
|---|
| 424 | Dist=t5.DistanceToIn(G4ThreeVector(30.0,-50.0,0),vmx);
|
|---|
| 425 | // G4cout<<"Dist=t5.DistanceToIn((30.0,-50.0,0),vmx) = "<<Dist<<G4endl;
|
|---|
| 426 | assert(ApproxEqual(Dist,30));
|
|---|
| 427 |
|
|---|
| 428 | Dist=t5.DistanceToIn(G4ThreeVector(30.0,-100.0,0),vmx);
|
|---|
| 429 | // G4cout<<"Dist=t5.DistanceToIn((30.0,-100.0,0),vmx) = "<<Dist<<G4endl;
|
|---|
| 430 | assert(ApproxEqual(Dist,kInfinity));
|
|---|
| 431 |
|
|---|
| 432 | // Bug 810
|
|---|
| 433 |
|
|---|
| 434 | G4ThreeVector pTmp(0.,0.,0.);
|
|---|
| 435 |
|
|---|
| 436 | dist = clad->DistanceToIn(pTmp,vy);
|
|---|
| 437 | pTmp += dist*vy;
|
|---|
| 438 | G4cout<<"pTmpX = "<<pTmp.x()<<"; pTmpY = "<<pTmp.y()<<"; pTmpZ = "<<pTmp.z()<<G4endl;
|
|---|
| 439 | side=core->Inside(pTmp);
|
|---|
| 440 | G4cout<<"core->Inside(pTmp) = "<<OutputInside(side)<<G4endl;
|
|---|
| 441 | side=clad->Inside(pTmp);
|
|---|
| 442 | G4cout<<"clad->Inside(pTmp) = "<<OutputInside(side)<<G4endl;
|
|---|
| 443 |
|
|---|
| 444 | dist = core->DistanceToIn(pTmp,vy);
|
|---|
| 445 | pTmp += dist*vy;
|
|---|
| 446 | G4cout<<"pTmpX = "<<pTmp.x()<<"; pTmpY = "<<pTmp.y()<<"; pTmpZ = "<<pTmp.z()<<G4endl;
|
|---|
| 447 | side=core->Inside(pTmp);
|
|---|
| 448 | G4cout<<"core->Inside(pTmp) = "<<OutputInside(side)<<G4endl;
|
|---|
| 449 | side=clad->Inside(pTmp);
|
|---|
| 450 | G4cout<<"clad->Inside(pTmp) = "<<OutputInside(side)<<G4endl;
|
|---|
| 451 |
|
|---|
| 452 | dist = core->DistanceToOut(pTmp,vy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 453 | pTmp += dist*vy;
|
|---|
| 454 | G4cout<<"pTmpX = "<<pTmp.x()<<"; pTmpY = "<<pTmp.y()<<"; pTmpZ = "<<pTmp.z()<<G4endl;
|
|---|
| 455 | side=core->Inside(pTmp);
|
|---|
| 456 | G4cout<<"core->Inside(pTmp) = "<<OutputInside(side)<<G4endl;
|
|---|
| 457 | side=clad->Inside(pTmp);
|
|---|
| 458 | G4cout<<"clad->Inside(pTmp) = "<<OutputInside(side)<<G4endl;
|
|---|
| 459 |
|
|---|
| 460 | dist = clad->DistanceToOut(pTmp,vy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 461 | pTmp += dist*vy;
|
|---|
| 462 | G4cout<<"pTmpX = "<<pTmp.x()<<"; pTmpY = "<<pTmp.y()<<"; pTmpZ = "<<pTmp.z()<<G4endl;
|
|---|
| 463 | side=core->Inside(pTmp);
|
|---|
| 464 | G4cout<<"core->Inside(pTmp) = "<<OutputInside(side)<<G4endl;
|
|---|
| 465 | side=clad->Inside(pTmp);
|
|---|
| 466 | G4cout<<"clad->Inside(pTmp) = "<<OutputInside(side)<<G4endl;
|
|---|
| 467 |
|
|---|
| 468 |
|
|---|
| 469 | // CalculateExtent
|
|---|
| 470 |
|
|---|
| 471 | G4VoxelLimits unlimit; // Unlimited
|
|---|
| 472 |
|
|---|
| 473 | G4VoxelLimits limitX, limitY, limitZ, limitXYZ,limitXsYZ, limitXYsZ;
|
|---|
| 474 |
|
|---|
| 475 | limitX.AddLimit(kXAxis,-20,-10);
|
|---|
| 476 | limitY.AddLimit(kYAxis,30,40);
|
|---|
| 477 | limitZ.AddLimit(kZAxis,-40,-30);
|
|---|
| 478 |
|
|---|
| 479 | limitXYZ.AddLimit(kXAxis,-20,-10);
|
|---|
| 480 | limitXYZ.AddLimit(kYAxis,30,40);
|
|---|
| 481 | limitXYZ.AddLimit(kZAxis,-40,-30);
|
|---|
| 482 |
|
|---|
| 483 | limitXsYZ.AddLimit(kXAxis,-60,-10);
|
|---|
| 484 | limitXsYZ.AddLimit(kYAxis,30,40);
|
|---|
| 485 | limitXsYZ.AddLimit(kZAxis,-40,-30);
|
|---|
| 486 |
|
|---|
| 487 | limitXYsZ.AddLimit(kXAxis,-20,-10);
|
|---|
| 488 | limitXYsZ.AddLimit(kYAxis,30,60);
|
|---|
| 489 | limitXYsZ.AddLimit(kZAxis,-40,-30);
|
|---|
| 490 |
|
|---|
| 491 | G4RotationMatrix noRot;
|
|---|
| 492 | G4AffineTransform origin;
|
|---|
| 493 | G4double min,max;
|
|---|
| 494 | G4bool clipped;
|
|---|
| 495 |
|
|---|
| 496 | G4ThreeVector pmxmymz(-100,-110,-120);
|
|---|
| 497 | G4AffineTransform tPosOnly(pmxmymz);
|
|---|
| 498 |
|
|---|
| 499 | G4RotationMatrix r90Z;
|
|---|
| 500 | r90Z.rotateZ(halfpi);
|
|---|
| 501 | G4AffineTransform tRotZ(r90Z,pzero);
|
|---|
| 502 | G4AffineTransform tRotZpos(r90Z,pmxmymz);
|
|---|
| 503 |
|
|---|
| 504 |
|
|---|
| 505 | assert(t1.CalculateExtent(kXAxis,unlimit,origin,min,max));
|
|---|
| 506 | assert(min<=-50&&max>=50);
|
|---|
| 507 | assert(t1.CalculateExtent(kYAxis,unlimit,origin,min,max));
|
|---|
| 508 | assert(min<=-50&&max>=50);
|
|---|
| 509 | assert(t1.CalculateExtent(kZAxis,unlimit,origin,min,max));
|
|---|
| 510 | assert(min<=-50&&max>=50);
|
|---|
| 511 |
|
|---|
| 512 | assert(t3.CalculateExtent(kXAxis,unlimit,origin,min,max));
|
|---|
| 513 | assert(min<=-50&&max>=0);
|
|---|
| 514 | assert(t3.CalculateExtent(kYAxis,unlimit,origin,min,max));
|
|---|
| 515 | assert(min<=0&&max>=50);
|
|---|
| 516 | assert(t3.CalculateExtent(kZAxis,unlimit,origin,min,max));
|
|---|
| 517 | assert(min<=-50&&max>=50);
|
|---|
| 518 |
|
|---|
| 519 | /////////////////////////////////////////////////////
|
|---|
| 520 |
|
|---|
| 521 | assert(t1.CalculateExtent(kXAxis,limitXYZ,origin,min,max));
|
|---|
| 522 | G4cout<<"t1.CE(kXAxis,limitXYZ,origin,min = "
|
|---|
| 523 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 524 | // assert(min<=-20&&max>=-30);
|
|---|
| 525 |
|
|---|
| 526 | assert(t1.CalculateExtent(kYAxis,limitXYZ,origin,min,max));
|
|---|
| 527 | G4cout<<"t1.CE(kYAxis,limitXYZ,origin,min = "
|
|---|
| 528 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 529 | // assert(min<=30&&max>=40);
|
|---|
| 530 |
|
|---|
| 531 | assert(t1.CalculateExtent(kZAxis,limitXYZ,origin,min,max));
|
|---|
| 532 | G4cout<<"t1.CE(kZAxis,limitXYZ,origin,min = "
|
|---|
| 533 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 534 | // assert(min<=-40&&max>=-30);
|
|---|
| 535 |
|
|---|
| 536 | clipped=t2.CalculateExtent(kXAxis,limitXYZ,origin,min,max);
|
|---|
| 537 | G4cout<<"t2.CE(kXAxis,limitXYZ,origin,min = "
|
|---|
| 538 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 539 | // assert(min<=-20&&max>=-30);
|
|---|
| 540 |
|
|---|
| 541 | clipped=t2.CalculateExtent(kYAxis,limitXYZ,origin,min,max);
|
|---|
| 542 | G4cout<<"t2.CE(kYAxis,limitXYZ,origin,min = "
|
|---|
| 543 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 544 | // assert(min<=30&&max>=40);
|
|---|
| 545 |
|
|---|
| 546 | clipped=t2.CalculateExtent(kZAxis,limitXYZ,origin,min,max);
|
|---|
| 547 | G4cout<<"t2.CE(kZAxis,limitXYZ,origin,min = "
|
|---|
| 548 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 549 | // assert(min<=-40&&max>=-30);
|
|---|
| 550 |
|
|---|
| 551 | clipped=t2a.CalculateExtent(kXAxis,limitXYZ,origin,min,max);
|
|---|
| 552 | G4cout<<"t2a.CE(kXAxis,limitXYZ,origin,min = "
|
|---|
| 553 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 554 | // assert(min<=-20&&max>=-30);
|
|---|
| 555 |
|
|---|
| 556 | clipped=t2a.CalculateExtent(kYAxis,limitXYZ,origin,min,max);
|
|---|
| 557 | G4cout<<"t2a.CE(kYAxis,limitXYZ,origin,min = "
|
|---|
| 558 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 559 | // assert(min<=30&&max>=40);
|
|---|
| 560 |
|
|---|
| 561 | clipped=t2a.CalculateExtent(kZAxis,limitXYZ,origin,min,max);
|
|---|
| 562 | G4cout<<"t2a.CE(kZAxis,limitXYZ,origin,min = "
|
|---|
| 563 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 564 | // assert(min<=-40&&max>=-30);
|
|---|
| 565 |
|
|---|
| 566 | clipped=t2b.CalculateExtent(kXAxis,limitXYZ,origin,min,max);
|
|---|
| 567 | G4cout<<"t2b.CE(kXAxis,limitXYZ,origin,min = "
|
|---|
| 568 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 569 | // assert(min<=-20&&max>=-30);
|
|---|
| 570 |
|
|---|
| 571 | clipped=t2b.CalculateExtent(kYAxis,limitXYZ,origin,min,max);
|
|---|
| 572 | G4cout<<"t2b.CE(kYAxis,limitXYZ,origin,min = "
|
|---|
| 573 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 574 | // assert(min<=30&&max>=40);
|
|---|
| 575 |
|
|---|
| 576 | clipped=t2b.CalculateExtent(kZAxis,limitXYZ,origin,min,max);
|
|---|
| 577 | G4cout<<"t2b.CE(kZAxis,limitXYZ,origin,min = "
|
|---|
| 578 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 579 | // assert(min<=-40&&max>=-30);
|
|---|
| 580 |
|
|---|
| 581 | clipped=t2c.CalculateExtent(kXAxis,limitXYZ,origin,min,max);
|
|---|
| 582 | G4cout<<"t2c.CE(kXAxis,limitXYZ,origin,min = "
|
|---|
| 583 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 584 | // assert(min<=-20&&max>=-30);
|
|---|
| 585 |
|
|---|
| 586 | clipped=t2c.CalculateExtent(kYAxis,limitXYZ,origin,min,max);
|
|---|
| 587 | G4cout<<"t2c.CE(kYAxis,limitXYZ,origin,min = "
|
|---|
| 588 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 589 | // assert(min<=30&&max>=40);
|
|---|
| 590 |
|
|---|
| 591 | clipped=t2c.CalculateExtent(kZAxis,limitXYZ,origin,min,max);
|
|---|
| 592 | G4cout<<"t2c.CE(kZAxis,limitXYZ,origin,min = "
|
|---|
| 593 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 594 | // assert(min<=-40&&max>=-30);
|
|---|
| 595 |
|
|---|
| 596 | clipped=t2d.CalculateExtent(kXAxis,limitXYZ,origin,min,max);
|
|---|
| 597 | G4cout<<"t2d.CE(kXAxis,limitXYZ,origin,min = "
|
|---|
| 598 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 599 | // assert(min<=-20&&max>=-30);
|
|---|
| 600 |
|
|---|
| 601 | clipped=t2d.CalculateExtent(kYAxis,limitXYZ,origin,min,max);
|
|---|
| 602 | G4cout<<"t2d.CE(kYAxis,limitXYZ,origin,min = "
|
|---|
| 603 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 604 | // assert(min<=30&&max>=40);
|
|---|
| 605 |
|
|---|
| 606 | clipped=t2d.CalculateExtent(kZAxis,limitXYZ,origin,min,max);
|
|---|
| 607 | G4cout<<"t2d.CE(kZAxis,limitXYZ,origin,min = "
|
|---|
| 608 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 609 | // assert(min<=-40&&max>=-30);
|
|---|
| 610 |
|
|---|
| 611 |
|
|---|
| 612 | clipped=t3.CalculateExtent(kXAxis,limitXYZ,origin,min,max);
|
|---|
| 613 | G4cout<<"t3.CE(kXAxis,limitXYZ,origin,min = "
|
|---|
| 614 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 615 | // assert(min<=-20&&max>=-30);
|
|---|
| 616 |
|
|---|
| 617 |
|
|---|
| 618 | clipped=t3.CalculateExtent(kYAxis,limitXYZ,origin,min,max);
|
|---|
| 619 | G4cout<<"t3.CE(kYAxis,limitXYZ,origin,min = "
|
|---|
| 620 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 621 | // assert(min<=30&&max>=40);
|
|---|
| 622 |
|
|---|
| 623 | clipped=t3.CalculateExtent(kZAxis,limitXYZ,origin,min,max);
|
|---|
| 624 | G4cout<<"t3.CE(kZAxis,limitXYZ,origin,min = "
|
|---|
| 625 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 626 | // assert(min<=-40&&max>=-30);
|
|---|
| 627 |
|
|---|
| 628 | clipped=t1.CalculateExtent(kXAxis,limitXsYZ,origin,min,max);
|
|---|
| 629 | G4cout<<"t1.CE(kXAxis,limitXsYZ,origin,min = "
|
|---|
| 630 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 631 | // assert(min<=-20&&max>=-30);
|
|---|
| 632 |
|
|---|
| 633 | clipped=t1.CalculateExtent(kYAxis,limitXsYZ,origin,min,max);
|
|---|
| 634 | G4cout<<"t1.CE(kYAxis,limitXsYZ,origin,min = "
|
|---|
| 635 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 636 | // assert(min<=30&&max>=40);
|
|---|
| 637 |
|
|---|
| 638 | clipped=t1.CalculateExtent(kZAxis,limitXsYZ,origin,min,max);
|
|---|
| 639 | G4cout<<"t1.CE(kZAxis,limitXsYZ,origin,min = "
|
|---|
| 640 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 641 | // assert(min<=-40&&max>=-30);
|
|---|
| 642 |
|
|---|
| 643 | clipped=t2.CalculateExtent(kXAxis,limitXsYZ,origin,min,max);
|
|---|
| 644 | G4cout<<"t2.CE(kXAxis,limitXsYZ,origin,min = "
|
|---|
| 645 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 646 | // assert(min<=-20&&max>=-30);
|
|---|
| 647 |
|
|---|
| 648 | clipped=t2.CalculateExtent(kYAxis,limitXsYZ,origin,min,max);
|
|---|
| 649 | G4cout<<"t2.CE(kYAxis,limitXsYZ,origin,min = "
|
|---|
| 650 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 651 | // assert(min<=30&&max>=40);
|
|---|
| 652 |
|
|---|
| 653 | clipped=t2.CalculateExtent(kZAxis,limitXsYZ,origin,min,max);
|
|---|
| 654 | G4cout<<"t2.CE(kZAxis,limitXsYZ,origin,min = "
|
|---|
| 655 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 656 | // assert(min<=-40&&max>=-30);
|
|---|
| 657 |
|
|---|
| 658 | clipped=t2a.CalculateExtent(kXAxis,limitXsYZ,origin,min,max);
|
|---|
| 659 | G4cout<<"t2a.CE(kXAxis,limitXsYZ,origin,min = "
|
|---|
| 660 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 661 | // assert(min<=-20&&max>=-30);
|
|---|
| 662 |
|
|---|
| 663 | clipped=t2a.CalculateExtent(kYAxis,limitXsYZ,origin,min,max);
|
|---|
| 664 | G4cout<<"t2a.CE(kYAxis,limitXsYZ,origin,min = "
|
|---|
| 665 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 666 | // assert(min<=30&&max>=40);
|
|---|
| 667 |
|
|---|
| 668 | clipped=t2a.CalculateExtent(kZAxis,limitXsYZ,origin,min,max);
|
|---|
| 669 | G4cout<<"t2a.CE(kZAxis,limitXsYZ,origin,min = "
|
|---|
| 670 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 671 | // assert(min<=-40&&max>=-30);
|
|---|
| 672 |
|
|---|
| 673 | clipped=t2b.CalculateExtent(kXAxis,limitXsYZ,origin,min,max);
|
|---|
| 674 | G4cout<<"t2b.CE(kXAxis,limitXsYZ,origin,min = "
|
|---|
| 675 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 676 | // assert(min<=-20&&max>=-30);
|
|---|
| 677 |
|
|---|
| 678 | clipped=t2b.CalculateExtent(kYAxis,limitXsYZ,origin,min,max);
|
|---|
| 679 | G4cout<<"t2b.CE(kYAxis,limitXsYZ,origin,min = "
|
|---|
| 680 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 681 | // assert(min<=30&&max>=40);
|
|---|
| 682 |
|
|---|
| 683 | clipped=t2b.CalculateExtent(kZAxis,limitXsYZ,origin,min,max);
|
|---|
| 684 | G4cout<<"t2b.CE(kZAxis,limitXsYZ,origin,min = "
|
|---|
| 685 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 686 | // assert(min<=-40&&max>=-30);
|
|---|
| 687 |
|
|---|
| 688 | clipped=t2c.CalculateExtent(kXAxis,limitXsYZ,origin,min,max);
|
|---|
| 689 | G4cout<<"t2c.CE(kXAxis,limitXsYZ,origin,min = "
|
|---|
| 690 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 691 | // assert(min<=-20&&max>=-30);
|
|---|
| 692 |
|
|---|
| 693 | clipped=t2c.CalculateExtent(kYAxis,limitXsYZ,origin,min,max);
|
|---|
| 694 | G4cout<<"t2c.CE(kYAxis,limitXsYZ,origin,min = "
|
|---|
| 695 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 696 | // assert(min<=30&&max>=40);
|
|---|
| 697 |
|
|---|
| 698 | clipped=t2c.CalculateExtent(kZAxis,limitXsYZ,origin,min,max);
|
|---|
| 699 | G4cout<<"t2c.CE(kZAxis,limitXsYZ,origin,min = "
|
|---|
| 700 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 701 | // assert(min<=-40&&max>=-30);
|
|---|
| 702 |
|
|---|
| 703 | clipped=t2d.CalculateExtent(kXAxis,limitXsYZ,origin,min,max);
|
|---|
| 704 | G4cout<<"t2d.CE(kXAxis,limitXsYZ,origin,min = "
|
|---|
| 705 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 706 | // assert(min<=-20&&max>=-30);
|
|---|
| 707 |
|
|---|
| 708 | clipped=t2d.CalculateExtent(kYAxis,limitXsYZ,origin,min,max);
|
|---|
| 709 | G4cout<<"t2.CE(kYAxis,limitXsYZ,origin,min = "
|
|---|
| 710 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 711 | // assert(min<=30&&max>=40);
|
|---|
| 712 |
|
|---|
| 713 | clipped=t2.CalculateExtent(kZAxis,limitXsYZ,origin,min,max);
|
|---|
| 714 | G4cout<<"t2d.CE(kZAxis,limitXsYZ,origin,min = "
|
|---|
| 715 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 716 | // assert(min<=-40&&max>=-30);
|
|---|
| 717 |
|
|---|
| 718 |
|
|---|
| 719 | ///////////////////////////////////////////////////////////
|
|---|
| 720 |
|
|---|
| 721 |
|
|---|
| 722 | assert(t3.CalculateExtent(kXAxis,limitX,origin,min,max));
|
|---|
| 723 | G4cout<<"t3.CE(kXAxis,limitX,origin,min = "
|
|---|
| 724 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 725 | assert(min<=-20&&max>=-30);
|
|---|
| 726 |
|
|---|
| 727 |
|
|---|
| 728 |
|
|---|
| 729 | assert(t3.CalculateExtent(kYAxis,limitY,origin,min,max));
|
|---|
| 730 | G4cout<<"t3.CE(kYAxis,limitY,origin,min = "
|
|---|
| 731 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 732 | assert(min<=30&&max>=40);
|
|---|
| 733 |
|
|---|
| 734 | assert(t3.CalculateExtent(kZAxis,limitZ,origin,min,max));
|
|---|
| 735 | G4cout<<"t3.CE(kZAxis,limitZ,origin,min = "
|
|---|
| 736 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 737 | assert(min<=-40&&max>=-30);
|
|---|
| 738 |
|
|---|
| 739 | assert(t2.CalculateExtent(kXAxis,limitX,origin,min,max));
|
|---|
| 740 | G4cout<<"t2.CE(kXAxis,limitX,origin,min = "
|
|---|
| 741 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 742 | assert(min<=-20&&max>=-30);
|
|---|
| 743 |
|
|---|
| 744 | assert(t2.CalculateExtent(kYAxis,limitY,origin,min,max));
|
|---|
| 745 | G4cout<<"t2.CE(kYAxis,limitY,origin,min = "
|
|---|
| 746 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 747 | assert(min<=30&&max>=40);
|
|---|
| 748 |
|
|---|
| 749 | assert(t2.CalculateExtent(kZAxis,limitZ,origin,min,max));
|
|---|
| 750 | G4cout<<"t2.CE(kZAxis,limitZ,origin,min = "
|
|---|
| 751 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 752 | assert(min<=-40&&max>=-30);
|
|---|
| 753 |
|
|---|
| 754 | assert(t4.CalculateExtent(kXAxis,unlimit,origin,min,max));
|
|---|
| 755 | assert(min<=-50&&max>=0);
|
|---|
| 756 | assert(t4.CalculateExtent(kYAxis,unlimit,origin,min,max));
|
|---|
| 757 | assert(min<=0&&max>=50);
|
|---|
| 758 | assert(t4.CalculateExtent(kZAxis,unlimit,origin,min,max));
|
|---|
| 759 | assert(min<=-50&&max>=50);
|
|---|
| 760 |
|
|---|
| 761 | //////////////////////////////////////////////////////////
|
|---|
| 762 |
|
|---|
| 763 |
|
|---|
| 764 | assert(t1.CalculateExtent(kXAxis,unlimit,tPosOnly,min,max));
|
|---|
| 765 | assert(min<=-150&&max>=-50);
|
|---|
| 766 | assert(t1.CalculateExtent(kYAxis,unlimit,tPosOnly,min,max));
|
|---|
| 767 | assert(min<=-160&&max>=-60);
|
|---|
| 768 | assert(t1.CalculateExtent(kZAxis,unlimit,tPosOnly,min,max));
|
|---|
| 769 | assert(min<=-170&&max>=-70);
|
|---|
| 770 |
|
|---|
| 771 | assert(t3.CalculateExtent(kXAxis,unlimit,tPosOnly,min,max));
|
|---|
| 772 | assert(min<=-150&&max>=-100);
|
|---|
| 773 | assert(t3.CalculateExtent(kYAxis,unlimit,tPosOnly,min,max));
|
|---|
| 774 | assert(min<=-110&&max>=-60);
|
|---|
| 775 | assert(t3.CalculateExtent(kZAxis,unlimit,tPosOnly,min,max));
|
|---|
| 776 | assert(min<=-170&&max>=-70);
|
|---|
| 777 |
|
|---|
| 778 | assert(t4.CalculateExtent(kXAxis,unlimit,tPosOnly,min,max));
|
|---|
| 779 | assert(min<=-150&&max>=-100);
|
|---|
| 780 | assert(t4.CalculateExtent(kYAxis,unlimit,tPosOnly,min,max));
|
|---|
| 781 | assert(min<=-110&&max>=-60);
|
|---|
| 782 | assert(t4.CalculateExtent(kZAxis,unlimit,tPosOnly,min,max));
|
|---|
| 783 | assert(min<=-170&&max>=-70);
|
|---|
| 784 |
|
|---|
| 785 |
|
|---|
| 786 | /////////////////////////////////////////////////////////////
|
|---|
| 787 |
|
|---|
| 788 | assert(t1.CalculateExtent(kXAxis,unlimit,tRotZ,min,max));
|
|---|
| 789 | assert(min<=-50&&max>=50);
|
|---|
| 790 | assert(t1.CalculateExtent(kYAxis,unlimit,tRotZ,min,max));
|
|---|
| 791 | assert(min<=-50&&max>=50);
|
|---|
| 792 | assert(t1.CalculateExtent(kZAxis,unlimit,tRotZ,min,max));
|
|---|
| 793 | assert(min<=-50&&max>=50);
|
|---|
| 794 |
|
|---|
| 795 | assert(t3.CalculateExtent(kXAxis,unlimit,tRotZ,min,max));
|
|---|
| 796 | G4cout<<"t3.CE(kXAxis,unlimit,tRotZ,min = "
|
|---|
| 797 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 798 | assert(min<=0&&max>=50);
|
|---|
| 799 |
|
|---|
| 800 | assert(t3.CalculateExtent(kYAxis,unlimit,tRotZ,min,max));
|
|---|
| 801 | G4cout<<"t3.CE(kYAxis,unlimit,tRotZ,min = "
|
|---|
| 802 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 803 | assert(min<=0&&max>=50);
|
|---|
| 804 |
|
|---|
| 805 | assert(t3.CalculateExtent(kZAxis,unlimit,tRotZ,min,max));
|
|---|
| 806 | G4cout<<"t3.CE(kZAxis,unlimit,tRotZ,min = "
|
|---|
| 807 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 808 | assert(min<=-50&&max>=50);
|
|---|
| 809 |
|
|---|
| 810 | clipped=t1.CalculateExtent(kXAxis,limitX,tRotZ,min,max);
|
|---|
| 811 | G4cout<<"t1.CE(kXAxis,limitX,tRotZ,min = "
|
|---|
| 812 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 813 | // assert(min<=-20&&max>=-30);
|
|---|
| 814 |
|
|---|
| 815 | clipped=t1.CalculateExtent(kYAxis,limitY,tRotZ,min,max);
|
|---|
| 816 | G4cout<<"t1.CE(kYAxis,limitY,tRotZ,min = "
|
|---|
| 817 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 818 | // assert(min<=30&&max>=40);
|
|---|
| 819 |
|
|---|
| 820 | clipped=t1.CalculateExtent(kZAxis,limitZ,tRotZ,min,max);
|
|---|
| 821 | G4cout<<"t1.CE(kZAxis,limitZ,tRotZ,min = "
|
|---|
| 822 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 823 | // assert(min<=-40&&max>=-30);
|
|---|
| 824 |
|
|---|
| 825 | clipped=t3.CalculateExtent(kXAxis,limitX,tRotZ,min,max);
|
|---|
| 826 | G4cout<<"t3.CE(kXAxis,limitX,tRotZ,min = "
|
|---|
| 827 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 828 | // assert(min<=-20&&max>=-30);
|
|---|
| 829 |
|
|---|
| 830 | clipped=t3.CalculateExtent(kYAxis,limitY,tRotZ,min,max);
|
|---|
| 831 | G4cout<<"t3.CE(kYAxis,limitY,tRotZ,min = "
|
|---|
| 832 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 833 | // assert(min<=30&&max>=40);
|
|---|
| 834 |
|
|---|
| 835 | clipped=t3.CalculateExtent(kZAxis,limitZ,tRotZ,min,max);
|
|---|
| 836 | G4cout<<"t3.CE(kZAxis,limitZ,tRotZ,min = "
|
|---|
| 837 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 838 | // assert(min<=-40&&max>=-30);
|
|---|
| 839 |
|
|---|
| 840 | clipped=t2.CalculateExtent(kXAxis,limitX,tRotZ,min,max);
|
|---|
| 841 | G4cout<<"t2.CE(kXAxis,limitX,tRotZ,min = "
|
|---|
| 842 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 843 | // assert(min<=-20&&max>=-30);
|
|---|
| 844 |
|
|---|
| 845 | clipped=t2.CalculateExtent(kYAxis,limitY,tRotZ,min,max);
|
|---|
| 846 | G4cout<<"t2.CE(kYAxis,limitY,tRotZ,min = "
|
|---|
| 847 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 848 | // assert(min<=30&&max>=40);
|
|---|
| 849 |
|
|---|
| 850 | clipped=t2.CalculateExtent(kZAxis,limitZ,tRotZ,min,max);
|
|---|
| 851 | G4cout<<"t2.CE(kZAxis,limitZ,tRotZ,min = "
|
|---|
| 852 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 853 | // assert(min<=-40&&max>=-30);
|
|---|
| 854 |
|
|---|
| 855 | /* *******************************
|
|---|
| 856 | ******************************** */
|
|---|
| 857 |
|
|---|
| 858 | clipped=t1.CalculateExtent(kXAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 859 | G4cout<<"t1.CE(kXAxis,limitXYZ,tRotZ,min = "
|
|---|
| 860 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 861 | // assert(min<=-20&&max>=-30);
|
|---|
| 862 |
|
|---|
| 863 |
|
|---|
| 864 | clipped=t1.CalculateExtent(kYAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 865 | G4cout<<"t1.CE(kYAxis,limitXYZ,tRotZ,min = "
|
|---|
| 866 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 867 | // assert(min<=30&&max>=40);
|
|---|
| 868 |
|
|---|
| 869 | clipped=t1.CalculateExtent(kZAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 870 | G4cout<<"t1.CE(kZAxis,limitXYZ,tRotZ,min = "
|
|---|
| 871 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 872 | // assert(min<=-40&&max>=-30);
|
|---|
| 873 |
|
|---|
| 874 | clipped=t2.CalculateExtent(kXAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 875 | G4cout<<"t2.CE(kXAxis,limitXYZ,tRotZ,min = "
|
|---|
| 876 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 877 | // assert(min<=-20&&max>=-30);
|
|---|
| 878 |
|
|---|
| 879 | clipped=t2.CalculateExtent(kYAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 880 | G4cout<<"t2.CE(kYAxis,limitXYZ,tRotZ,min = "
|
|---|
| 881 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 882 | // assert(min<=30&&max>=40);
|
|---|
| 883 |
|
|---|
| 884 | clipped=t2.CalculateExtent(kZAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 885 | G4cout<<"t2.CE(kZAxis,limitXYZ,tRotZ,min = "
|
|---|
| 886 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 887 | // assert(min<=-40&&max>=-30);
|
|---|
| 888 |
|
|---|
| 889 | clipped=t2a.CalculateExtent(kXAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 890 | G4cout<<"t2a.CE(kXAxis,limitXYZ,tRotZ,min = "
|
|---|
| 891 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 892 | // assert(min<=-20&&max>=-30);
|
|---|
| 893 |
|
|---|
| 894 | clipped=t2a.CalculateExtent(kYAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 895 | G4cout<<"t2a.CE(kYAxis,limitXYZ,tRotZ,min = "
|
|---|
| 896 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 897 | // assert(min<=30&&max>=40);
|
|---|
| 898 |
|
|---|
| 899 | clipped=t2a.CalculateExtent(kZAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 900 | G4cout<<"t2a.CE(kZAxis,limitXYZ,tRotZ,min = "
|
|---|
| 901 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 902 | // assert(min<=-40&&max>=-30);
|
|---|
| 903 |
|
|---|
| 904 | clipped=t2b.CalculateExtent(kXAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 905 | G4cout<<"t2b.CE(kXAxis,limitXYZ,tRotZ,min = "
|
|---|
| 906 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 907 | // assert(min<=-20&&max>=-30);
|
|---|
| 908 |
|
|---|
| 909 | clipped=t2b.CalculateExtent(kYAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 910 | G4cout<<"t2b.CE(kYAxis,limitXYZ,tRotZ,min = "
|
|---|
| 911 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 912 | // assert(min<=30&&max>=40);
|
|---|
| 913 |
|
|---|
| 914 | clipped=t2b.CalculateExtent(kZAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 915 | G4cout<<"t2b.CE(kZAxis,limitXYZ,tRotZ,min = "
|
|---|
| 916 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 917 | // assert(min<=-40&&max>=-30);
|
|---|
| 918 |
|
|---|
| 919 | clipped=t2c.CalculateExtent(kXAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 920 | G4cout<<"t2c.CE(kXAxis,limitXYZ,tRotZ,min = "
|
|---|
| 921 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 922 | // assert(min<=-20&&max>=-30);
|
|---|
| 923 |
|
|---|
| 924 | clipped=t2c.CalculateExtent(kYAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 925 | G4cout<<"t2c.CE(kYAxis,limitXYZ,tRotZ,min = "
|
|---|
| 926 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 927 | // assert(min<=30&&max>=40);
|
|---|
| 928 |
|
|---|
| 929 | clipped=t2c.CalculateExtent(kZAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 930 | G4cout<<"t2c.CE(kZAxis,limitXYZ,tRotZ,min = "
|
|---|
| 931 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 932 | // assert(min<=-40&&max>=-30);
|
|---|
| 933 |
|
|---|
| 934 | clipped=t2d.CalculateExtent(kXAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 935 | G4cout<<"t2d.CE(kXAxis,limitXYZ,tRotZ,min = "
|
|---|
| 936 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 937 | // assert(min<=-20&&max>=-30);
|
|---|
| 938 |
|
|---|
| 939 | clipped=t2d.CalculateExtent(kYAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 940 | G4cout<<"t2d.CE(kYAxis,limitXYZ,tRotZ,min = "
|
|---|
| 941 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 942 | // assert(min<=30&&max>=40);
|
|---|
| 943 |
|
|---|
| 944 | clipped=t2d.CalculateExtent(kZAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 945 | G4cout<<"t2d.CE(kZAxis,limitXYZ,tRotZ,min = "
|
|---|
| 946 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 947 | // assert(min<=-40&&max>=-30);
|
|---|
| 948 |
|
|---|
| 949 | clipped=t3.CalculateExtent(kXAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 950 | G4cout<<"t3.CE(kXAxis,limitXYZ,tRotZ,min = "
|
|---|
| 951 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 952 | // assert(min<=-20&&max>=-30);
|
|---|
| 953 |
|
|---|
| 954 | clipped=t3.CalculateExtent(kYAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 955 | G4cout<<"t3.CE(kYAxis,limitXYZ,tRotZ,min = "
|
|---|
| 956 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 957 | // assert(min<=30&&max>=40);
|
|---|
| 958 |
|
|---|
| 959 | clipped=t3.CalculateExtent(kZAxis,limitXYZ,tRotZ,min,max);
|
|---|
| 960 | G4cout<<"t3.CE(kZAxis,limitXYZ,tRotZ,min = "
|
|---|
| 961 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 962 | // assert(min<=-40&&max>=-30);
|
|---|
| 963 |
|
|---|
| 964 |
|
|---|
| 965 | assert(t4.CalculateExtent(kXAxis,unlimit,tRotZ,min,max));
|
|---|
| 966 | G4cout<<"t4.CE(kXAxis,unlimit,tRotZ,min = "
|
|---|
| 967 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 968 | // assert(min<=0&&max>=50);
|
|---|
| 969 |
|
|---|
| 970 | assert(t4.CalculateExtent(kYAxis,unlimit,tRotZ,min,max));
|
|---|
| 971 | G4cout<<"t4.CE(kYAxis,unlimit,tRotZ,min = "
|
|---|
| 972 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 973 | // assert(min<=0&&max>=50);
|
|---|
| 974 |
|
|---|
| 975 | assert(t4.CalculateExtent(kZAxis,unlimit,tRotZ,min,max));
|
|---|
| 976 | G4cout<<"t4.CE(kZAxis,unlimit,tRotZ,min = "
|
|---|
| 977 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 978 | // assert(min<=-50&&max>=50);
|
|---|
| 979 |
|
|---|
| 980 | assert(t3.CalculateExtent(kXAxis,unlimit,tRotZpos,min,max));
|
|---|
| 981 | G4cout<<"t3.CE(kXAxis,unlimit,tRotZpos,min = "
|
|---|
| 982 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 983 | assert(min<=-100&&max>=-50);
|
|---|
| 984 |
|
|---|
| 985 | assert(t3.CalculateExtent(kYAxis,unlimit,tRotZpos,min,max));
|
|---|
| 986 | G4cout<<"t3.CE(kYAxis,unlimit,tRotZpos,min = "
|
|---|
| 987 | <<min<<"; max = "<<max<<G4endl;
|
|---|
| 988 | assert(min<=-110&&max>=-60);
|
|---|
| 989 |
|
|---|
| 990 | assert(t3.CalculateExtent(kZAxis,unlimit,tRotZpos,min,max));
|
|---|
| 991 | G4cout<<"t3.CE(kZAxis,unlimit,tRotZpos,min = "
|
|---|
| 992 | <<min<<"; max = "<<max<<G4endl<<G4endl;
|
|---|
| 993 | assert(min<=-170&&max>=-70);
|
|---|
| 994 |
|
|---|
| 995 | // Check that clipped away
|
|---|
| 996 | G4VoxelLimits xClip;
|
|---|
| 997 | xClip.AddLimit(kXAxis,-100,-60);
|
|---|
| 998 | assert(!t1.CalculateExtent(kXAxis,xClip,origin,min,max));
|
|---|
| 999 |
|
|---|
| 1000 | // Assert clipped to volume
|
|---|
| 1001 | G4VoxelLimits allClip;
|
|---|
| 1002 | allClip.AddLimit(kXAxis,-5,+5);
|
|---|
| 1003 | allClip.AddLimit(kYAxis,-5,+5);
|
|---|
| 1004 | allClip.AddLimit(kZAxis,-5,+5);
|
|---|
| 1005 |
|
|---|
| 1006 | G4RotationMatrix genRot;
|
|---|
| 1007 | genRot.rotateX(pi/6);
|
|---|
| 1008 | genRot.rotateY(pi/6);
|
|---|
| 1009 | genRot.rotateZ(pi/6);
|
|---|
| 1010 | G4AffineTransform tGen(genRot,vx);
|
|---|
| 1011 |
|
|---|
| 1012 | assert(t1.CalculateExtent(kXAxis,allClip,tGen,min,max));
|
|---|
| 1013 | assert(min<=-5&&max>=5);
|
|---|
| 1014 | assert(t1.CalculateExtent(kYAxis,allClip,tGen,min,max));
|
|---|
| 1015 | assert(min<=-5&&max>=5);
|
|---|
| 1016 | assert(t1.CalculateExtent(kZAxis,allClip,tGen,min,max));
|
|---|
| 1017 | assert(min<=-5&&max>=5);
|
|---|
| 1018 |
|
|---|
| 1019 |
|
|---|
| 1020 | // Test t1 z clipping ok
|
|---|
| 1021 |
|
|---|
| 1022 | for (G4double zTest=-100;zTest<100;zTest+=9)
|
|---|
| 1023 | {
|
|---|
| 1024 | G4VoxelLimits zTestClip;
|
|---|
| 1025 | zTestClip.AddLimit(kZAxis,-kInfinity,zTest);
|
|---|
| 1026 | if (zTest<-50)
|
|---|
| 1027 | {
|
|---|
| 1028 | assert(!t1.CalculateExtent(kZAxis,zTestClip,origin,min,max));
|
|---|
| 1029 | }
|
|---|
| 1030 | else
|
|---|
| 1031 | {
|
|---|
| 1032 | assert(t1.CalculateExtent(kZAxis,zTestClip,origin,min,max));
|
|---|
| 1033 | G4double testMin=-50;
|
|---|
| 1034 | G4double testMax=(zTest<50) ? zTest : 50;
|
|---|
| 1035 | assert ( ApproxEqual(min,testMin) && ApproxEqual(max,testMax) );
|
|---|
| 1036 | }
|
|---|
| 1037 | }
|
|---|
| 1038 | G4cout<<"Test t1 z clipping ok"<<G4endl;
|
|---|
| 1039 |
|
|---|
| 1040 | // Test t1 y clipping ok
|
|---|
| 1041 |
|
|---|
| 1042 | for (G4double xTest=-100;xTest<100;xTest+=9)
|
|---|
| 1043 | {
|
|---|
| 1044 | G4VoxelLimits xTestClip;
|
|---|
| 1045 | xTestClip.AddLimit(kXAxis,-kInfinity,xTest);
|
|---|
| 1046 | if (xTest<-50)
|
|---|
| 1047 | {
|
|---|
| 1048 | assert(!t1.CalculateExtent(kYAxis,xTestClip,origin,min,max));
|
|---|
| 1049 | }
|
|---|
| 1050 | else
|
|---|
| 1051 | {
|
|---|
| 1052 | assert(t1.CalculateExtent(kYAxis,xTestClip,origin,min,max));
|
|---|
| 1053 | // Calc max y coordinate
|
|---|
| 1054 | // G4double testMax=(xTest<0) ? std::sqrt(50*50-xTest*xTest) : 50;
|
|---|
| 1055 | // assert (ApproxEqual(min,-testMax)&&ApproxEqual(max,testMax));
|
|---|
| 1056 | }
|
|---|
| 1057 | }
|
|---|
| 1058 | G4cout<<"Test t1 y clipping ok"<<G4endl;
|
|---|
| 1059 |
|
|---|
| 1060 | // Test t1 x clipping ok
|
|---|
| 1061 |
|
|---|
| 1062 | for (G4double yTest=-100;yTest<100;yTest+=9)
|
|---|
| 1063 | {
|
|---|
| 1064 | G4VoxelLimits yTestClip;
|
|---|
| 1065 | yTestClip.AddLimit(kYAxis,-kInfinity,yTest);
|
|---|
| 1066 | if (yTest<-50)
|
|---|
| 1067 | {
|
|---|
| 1068 | assert(!t1.CalculateExtent(kXAxis,yTestClip,origin,min,max));
|
|---|
| 1069 | }
|
|---|
| 1070 | else
|
|---|
| 1071 | {
|
|---|
| 1072 | assert(t1.CalculateExtent(kXAxis,yTestClip,origin,min,max));
|
|---|
| 1073 | // Calc max y coordinate
|
|---|
| 1074 | // G4double testMax=(yTest<0) ? std::sqrt(50*50-yTest*yTest) : 50;
|
|---|
| 1075 | // assert (ApproxEqual(min,-testMax)&&ApproxEqual(max,testMax));
|
|---|
| 1076 | }
|
|---|
| 1077 | }
|
|---|
| 1078 | G4cout<<"Test t1 x clipping ok"<<G4endl;
|
|---|
| 1079 |
|
|---|
| 1080 |
|
|---|
| 1081 | /* ********************************
|
|---|
| 1082 | ************************************ */
|
|---|
| 1083 |
|
|---|
| 1084 | return true;
|
|---|
| 1085 | }
|
|---|
| 1086 |
|
|---|
| 1087 | int main()
|
|---|
| 1088 | {
|
|---|
| 1089 | #ifdef NDEBUG
|
|---|
| 1090 | G4Exception("FAIL: *** Assertions must be compiled in! ***");
|
|---|
| 1091 | #endif
|
|---|
| 1092 | assert(testG4Tubs());
|
|---|
| 1093 | return 0;
|
|---|
| 1094 | }
|
|---|
| 1095 |
|
|---|
| 1096 |
|
|---|
| 1097 |
|
|---|
| 1098 |
|
|---|
| 1099 |
|
|---|
| 1100 |
|
|---|
| 1101 |
|
|---|