| 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: testG4Cons2.cc,v 1.21 2009/11/12 10:40:45 tnikitin Exp $
|
|---|
| 28 | // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
|
|---|
| 29 | //
|
|---|
| 30 | // Simple test of G4Cons
|
|---|
| 31 | // Basic checks on each function + awkward cases for tracking / geom algorithms
|
|---|
| 32 |
|
|---|
| 33 | #include <assert.h>
|
|---|
| 34 | #include <cmath>
|
|---|
| 35 | #include "G4ios.hh"
|
|---|
| 36 |
|
|---|
| 37 | #include "globals.hh"
|
|---|
| 38 | #include "geomdefs.hh"
|
|---|
| 39 |
|
|---|
| 40 | #include "ApproxEqual.hh"
|
|---|
| 41 |
|
|---|
| 42 | #include "G4ThreeVector.hh"
|
|---|
| 43 | #include "G4Cons.hh"
|
|---|
| 44 | #include "G4RotationMatrix.hh"
|
|---|
| 45 | #include "G4AffineTransform.hh"
|
|---|
| 46 | #include "G4VoxelLimits.hh"
|
|---|
| 47 | #include "G4GeometryTolerance.hh"
|
|---|
| 48 |
|
|---|
| 49 | #define DELTA 0.0001
|
|---|
| 50 |
|
|---|
| 51 | // Returns false if actual is within wanted+/- DELTA
|
|---|
| 52 | // true if error
|
|---|
| 53 | G4bool OutRange(G4double actual,G4double wanted)
|
|---|
| 54 | {
|
|---|
| 55 | G4bool rng = false ;
|
|---|
| 56 | if (actual < wanted-DELTA || actual > wanted + DELTA ) rng = true ;
|
|---|
| 57 | return rng ;
|
|---|
| 58 | }
|
|---|
| 59 | G4bool OutRange(G4ThreeVector actual,G4ThreeVector wanted)
|
|---|
| 60 | {
|
|---|
| 61 | G4bool rng = false ;
|
|---|
| 62 | if (OutRange(actual.x(),wanted.x())
|
|---|
| 63 | ||OutRange(actual.y(),wanted.y())
|
|---|
| 64 | ||OutRange(actual.z(),wanted.z()) ) rng = true ;
|
|---|
| 65 | return rng ;
|
|---|
| 66 | }
|
|---|
| 67 | ///////////////////////////////////////////////////////////////////
|
|---|
| 68 | //
|
|---|
| 69 | // Dave's auxiliary function
|
|---|
| 70 |
|
|---|
| 71 | const G4String OutputInside(const EInside a)
|
|---|
| 72 | {
|
|---|
| 73 | switch(a)
|
|---|
| 74 | {
|
|---|
| 75 | case kInside: return "Inside";
|
|---|
| 76 | case kOutside: return "Outside";
|
|---|
| 77 | case kSurface: return "Surface";
|
|---|
| 78 | }
|
|---|
| 79 | return "????";
|
|---|
| 80 | }
|
|---|
| 81 |
|
|---|
| 82 | int main(void)
|
|---|
| 83 | {
|
|---|
| 84 | G4double dist, vol, volCheck;
|
|---|
| 85 |
|
|---|
| 86 | G4double kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
|
|---|
| 87 | G4double kRadTolerance = G4GeometryTolerance::GetInstance()->GetRadialTolerance();
|
|---|
| 88 |
|
|---|
| 89 | G4ThreeVector pzero(0,0,0);
|
|---|
| 90 |
|
|---|
| 91 | G4ThreeVector pplx(120,0,0),pply(0,120,0),pplz(0,0,120);
|
|---|
| 92 |
|
|---|
| 93 | G4ThreeVector pmix(-120,0,0),pmiy(0,-120,0),pmiz(0,0,-120);
|
|---|
| 94 |
|
|---|
| 95 | G4ThreeVector ponmiz(0,75,-50),ponplz(0,75,50);
|
|---|
| 96 |
|
|---|
| 97 | G4ThreeVector ponr1(std::sqrt(50*50/2.0),std::sqrt(50*50/2.0),0),
|
|---|
| 98 | ponr2(std::sqrt(100*100/2.0),std::sqrt(100*100/2.0),0),
|
|---|
| 99 | ponphi1(60*std::cos(pi/6),-60*std::sin(pi/6),0),
|
|---|
| 100 | ponphi2(60*std::cos(pi/6),60*std::sin(pi/6),0),
|
|---|
| 101 | ponr2b(150,0,0);
|
|---|
| 102 |
|
|---|
| 103 | G4ThreeVector pnearplz(45,45,45),pnearmiz(45,45,-45);
|
|---|
| 104 | G4ThreeVector pydx(60,150,0),pbigx(500,0,0);
|
|---|
| 105 |
|
|---|
| 106 | G4ThreeVector proot1(0,125,-1000),proot2(0,75,-1000);
|
|---|
| 107 |
|
|---|
| 108 | G4ThreeVector pparr1(0,25,-150); // Test case parallel to both rs of c8
|
|---|
| 109 | G4ThreeVector pparr2(0,75,-50),pparr3(0,125,50);
|
|---|
| 110 | G4ThreeVector vparr(0,1./std::sqrt(5.),2./std::sqrt(5.));
|
|---|
| 111 |
|
|---|
| 112 | G4ThreeVector vnphi1(-std::sin(pi/6),-std::cos(pi/6),0),
|
|---|
| 113 | vnphi2(-std::sin(pi/6),std::cos(pi/6),0);
|
|---|
| 114 |
|
|---|
| 115 | G4ThreeVector vx(1,0,0),vy(0,1,0),vz(0,0,1),
|
|---|
| 116 | vmx(-1,0,0),vmy(0,-1,0),vmz(0,0,-1),
|
|---|
| 117 | vxy(1./std::sqrt(2.),1./std::sqrt(2.),0),
|
|---|
| 118 | vxmy(1./std::sqrt(2.),-1./std::sqrt(2.),0),
|
|---|
| 119 | vmxmy(-1./std::sqrt(2.),-1./std::sqrt(2.),0),
|
|---|
| 120 | vmxy(-1./std::sqrt(2.),1./std::sqrt(2.),0),
|
|---|
| 121 | vx2mz(1.0/std::sqrt(5.0),0,-2.0/std::sqrt(5.0)),
|
|---|
| 122 | vxmz(1./std::sqrt(2.),0,-1./std::sqrt(2.));
|
|---|
| 123 |
|
|---|
| 124 | G4RotationMatrix r90X,r90Y,r90Z,r180X,r45X,r30Y;
|
|---|
| 125 |
|
|---|
| 126 | G4Cons c1("Hollow Full Tube",50,100,50,100,50,0,twopi),
|
|---|
| 127 | cn1("cn1",45.,50.,45.,50.,50,halfpi,halfpi),
|
|---|
| 128 | cn2("cn1",45.,50.,45.,50.,50,halfpi,3*halfpi),
|
|---|
| 129 | c2("Hollow Full Cone",50,100,50,200,50,-1,twopi),
|
|---|
| 130 | c3("Hollow Cut Tube",50,100,50,100,50,-pi/6,pi/3),
|
|---|
| 131 | c4("Hollow Cut Cone",50,100,50,200,50,-pi/6,pi/3),
|
|---|
| 132 | c5("Hollow Cut Cone",25,50,75,150,50,0,3*halfpi),
|
|---|
| 133 | c6("Solid Full Tube",0,150,0,150,50,0,twopi),
|
|---|
| 134 | c7("Thin Tube",95,100,95,100,50,0,twopi),
|
|---|
| 135 | c8a("Solid Full Cone2",0,100,0,150,50,0,twopi),
|
|---|
| 136 | c8b("Hollow Full Cone2",50,100,100,150,50,0,twopi),
|
|---|
| 137 | c8c("Hollow Full Cone2inv",100,150,50,100,50,0,twopi),
|
|---|
| 138 | c9("Excotic Cone",50,60,
|
|---|
| 139 | 0, // 1.0e-7, 500*kRadTolerance,
|
|---|
| 140 | 10,50,0,twopi),
|
|---|
| 141 | cms("cms cone",0.0,70.0,0.0,157.8,2949.0,0.0,6.2831853071796);
|
|---|
| 142 |
|
|---|
| 143 | G4Cons cms2("RearAirCone",401.0,1450.0,
|
|---|
| 144 | 1020.0,1450.0,175.0,0.0,6.2831853071796) ;
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 | G4Cons ctest10( "aCone", 2*cm, 6*cm, 8*cm, 14*cm,
|
|---|
| 149 | 10*cm, 10*deg, 300*deg );
|
|---|
| 150 |
|
|---|
| 151 | G4ThreeVector pct10(60,0,0);
|
|---|
| 152 | G4ThreeVector pct10mx(-50,0,0);
|
|---|
| 153 | G4ThreeVector pct10phi1(60*std::cos(10.*degree),60*std::sin(10*degree),0);
|
|---|
| 154 | G4ThreeVector pct10phi2(60*std::cos(50.*degree),-60*std::sin(50*degree),0);
|
|---|
| 155 |
|
|---|
| 156 | G4ThreeVector pct10e1(-691-500,174, 404 );
|
|---|
| 157 |
|
|---|
| 158 | G4ThreeVector pct10e2( 400-500, 20.9, 5.89 );
|
|---|
| 159 |
|
|---|
| 160 | G4ThreeVector pct10e3( 456-500, 13, -14.7 );
|
|---|
| 161 |
|
|---|
| 162 | G4ThreeVector pct10e4( 537-500, 1.67, -44.1 );
|
|---|
| 163 | // point P is outside
|
|---|
| 164 | G4ThreeVector pct10e5(537, 1.67, -44.1);
|
|---|
| 165 |
|
|---|
| 166 | G4ThreeVector pct10e6(1e+03, -63.5, -213 );
|
|---|
| 167 |
|
|---|
| 168 | G4double a1,a2,a3,am;
|
|---|
| 169 |
|
|---|
| 170 | a1=pct10e2.x()-pct10e1.x();
|
|---|
| 171 | a2=pct10e2.y()-pct10e1.y();
|
|---|
| 172 | a3=pct10e2.z()-pct10e1.z();
|
|---|
| 173 | am=std::sqrt(a1*a1+a2*a2+a3*a3);
|
|---|
| 174 | G4ThreeVector d1(a1/am,a2/am,a3/am);
|
|---|
| 175 | G4cout<<d1.x()<<"\t"<<d1.y()<<"\t"<<d1.z()<<G4endl;
|
|---|
| 176 |
|
|---|
| 177 | a1=pct10e3.x()-pct10e2.x();
|
|---|
| 178 | a2=pct10e3.y()-pct10e2.y();
|
|---|
| 179 | a3=pct10e3.z()-pct10e2.z();
|
|---|
| 180 | am=std::sqrt(a1*a1+a2*a2+a3*a3);
|
|---|
| 181 | G4ThreeVector d2(a1/am,a2/am,a3/am);
|
|---|
| 182 | G4cout<<d2.x()<<"\t"<<d2.y()<<"\t"<<d2.z()<<G4endl;
|
|---|
| 183 |
|
|---|
| 184 | a1=pct10e4.x()-pct10e3.x();
|
|---|
| 185 | a2=pct10e4.y()-pct10e3.y();
|
|---|
| 186 | a3=pct10e4.z()-pct10e3.z();
|
|---|
| 187 | am=std::sqrt(a1*a1+a2*a2+a3*a3);
|
|---|
| 188 | G4ThreeVector d3(a1/am,a2/am,a3/am);
|
|---|
| 189 | G4cout<<d3.x()<<"\t"<<d3.y()<<"\t"<<d3.z()<<G4endl;
|
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 | // 19.01.04 modified test10 info:
|
|---|
| 193 |
|
|---|
| 194 | G4ThreeVector pt10s1( 6.454731216775542,
|
|---|
| 195 | -90.42080754048007,
|
|---|
| 196 | 100. );
|
|---|
| 197 |
|
|---|
| 198 | G4ThreeVector pt10s2( 22.65282328600368,
|
|---|
| 199 | -69.34877585931267,
|
|---|
| 200 | 76.51600623610082 );
|
|---|
| 201 |
|
|---|
| 202 | G4ThreeVector pt10s3( 51.28206938732319,
|
|---|
| 203 | -32.10510677306267,
|
|---|
| 204 | 35.00932544708616 );
|
|---|
| 205 |
|
|---|
| 206 | G4ThreeVector vt10d( 0.4567090876640433 ,
|
|---|
| 207 | 0.5941309830320264,
|
|---|
| 208 | -0.6621368319663807 );
|
|---|
| 209 |
|
|---|
| 210 |
|
|---|
| 211 | G4ThreeVector norm,*pNorm;
|
|---|
| 212 | G4bool *pgoodNorm,goodNorm,calcNorm=true;
|
|---|
| 213 |
|
|---|
| 214 | pNorm=&norm;
|
|---|
| 215 | pgoodNorm=&goodNorm;
|
|---|
| 216 |
|
|---|
| 217 | r90X.rotateX(halfpi);
|
|---|
| 218 | r90Y.rotateY(halfpi);
|
|---|
| 219 | r90Z.rotateZ(halfpi);
|
|---|
| 220 | r45X.rotateX(pi/4);
|
|---|
| 221 | r30Y.rotateY(pi/6);
|
|---|
| 222 |
|
|---|
| 223 | // G4cout << "G4Cons:"<< c4.GetName()
|
|---|
| 224 | // << " ID=" << c4.GetIdentifier() << "\n";
|
|---|
| 225 |
|
|---|
| 226 | // check cubic volume
|
|---|
| 227 |
|
|---|
| 228 | vol = c1.GetCubicVolume();
|
|---|
| 229 | volCheck = 2*pi*50*(100*100-50*50);
|
|---|
| 230 | assert(ApproxEqual(vol,volCheck));
|
|---|
| 231 |
|
|---|
| 232 | vol = c6.GetCubicVolume();
|
|---|
| 233 | volCheck = 2*pi*50*(150*150);
|
|---|
| 234 | assert(ApproxEqual(vol,volCheck));
|
|---|
| 235 |
|
|---|
| 236 | EInside in;
|
|---|
| 237 | G4cout.precision(16) ;
|
|---|
| 238 | G4cout << "Testing G4Cons::Inside...\n";
|
|---|
| 239 |
|
|---|
| 240 | in = ctest10.Inside(pct10e1);
|
|---|
| 241 | G4cout << "ctest10.Inside(pct10e1) = " <<OutputInside(in)<< G4endl;
|
|---|
| 242 |
|
|---|
| 243 | in = ctest10.Inside(pct10e2);
|
|---|
| 244 | G4cout << "ctest10.Inside(pct10e2) = " <<OutputInside(in)<< G4endl;
|
|---|
| 245 |
|
|---|
| 246 | in = ctest10.Inside(pct10e3);
|
|---|
| 247 | G4cout << "ctest10.Inside(pct10e3) = " <<OutputInside(in)<< G4endl;
|
|---|
| 248 |
|
|---|
| 249 | in = ctest10.Inside(pct10e4);
|
|---|
| 250 | G4cout << "ctest10.Inside(pct10e4) = " <<OutputInside(in)<< G4endl;
|
|---|
| 251 |
|
|---|
| 252 | in = ctest10.Inside(pct10e5);
|
|---|
| 253 | G4cout << "ctest10.Inside(pct10e5) = " <<OutputInside(in)<< G4endl;
|
|---|
| 254 |
|
|---|
| 255 | in = ctest10.Inside(pct10e6);
|
|---|
| 256 | G4cout << "ctest10.Inside(pct10e6) = " <<OutputInside(in)<< G4endl;
|
|---|
| 257 |
|
|---|
| 258 | in = ctest10.Inside(pct10mx);
|
|---|
| 259 | G4cout << "ctest10.Inside(pct10mx) = " <<OutputInside(in)<< G4endl;
|
|---|
| 260 |
|
|---|
| 261 | in = ctest10.Inside(pt10s1);
|
|---|
| 262 | G4cout << "ctest10.Inside(pt10s1) = " <<OutputInside(in)<< G4endl;
|
|---|
| 263 |
|
|---|
| 264 | in = ctest10.Inside(pt10s2);
|
|---|
| 265 | G4cout << "ctest10.Inside(pt10s2) = " <<OutputInside(in)<< G4endl;
|
|---|
| 266 |
|
|---|
| 267 | in = ctest10.Inside(pt10s3);
|
|---|
| 268 | G4cout << "ctest10.Inside(pt10s3) = " <<OutputInside(in)<< G4endl;
|
|---|
| 269 |
|
|---|
| 270 | if (c1.Inside(pzero)!=kOutside)
|
|---|
| 271 | G4cout << "Error A" << G4endl;
|
|---|
| 272 | if (c6.Inside(pzero)!=kInside)
|
|---|
| 273 | G4cout << "Error A2" << G4endl;
|
|---|
| 274 | if (c1.Inside(pplx)!=kOutside)
|
|---|
| 275 | G4cout << "Error B1" << G4endl;
|
|---|
| 276 | if (c2.Inside(pplx)!=kInside)
|
|---|
| 277 | G4cout << "Error B2" << G4endl;
|
|---|
| 278 | if (c3.Inside(pplx)!=kOutside)
|
|---|
| 279 | G4cout << "Error B3" << G4endl;
|
|---|
| 280 | if (c4.Inside(pplx)!=kInside)
|
|---|
| 281 | G4cout << "Error B4" << G4endl;
|
|---|
| 282 | if (c1.Inside(ponmiz)!=kSurface)
|
|---|
| 283 | G4cout << "Error C" << G4endl;
|
|---|
| 284 | if (c1.Inside(ponplz)!=kSurface)
|
|---|
| 285 | G4cout << "Error D" << G4endl;
|
|---|
| 286 | if (c1.Inside(ponr1)!=kSurface)
|
|---|
| 287 | G4cout << "Error E" << G4endl;
|
|---|
| 288 | if (c1.Inside(ponr2)!=kSurface)
|
|---|
| 289 | G4cout << "Error F" << G4endl;
|
|---|
| 290 | if (c3.Inside(ponphi1)!=kSurface)
|
|---|
| 291 | G4cout << "Error G" << G4endl;
|
|---|
| 292 | if (c3.Inside(ponphi2)!=kSurface)
|
|---|
| 293 | G4cout << "Error H" << G4endl;
|
|---|
| 294 |
|
|---|
| 295 | if (c5.Inside(G4ThreeVector(70,1,0))!=kInside)
|
|---|
| 296 | G4cout << "Error I" << G4endl;
|
|---|
| 297 | if (c5.Inside(G4ThreeVector(50,-50,0))!=kOutside)
|
|---|
| 298 | G4cout << "Error I2" << G4endl;
|
|---|
| 299 | if (c5.Inside(G4ThreeVector(70,0,0))!=kSurface)
|
|---|
| 300 | G4cout << "Error I3" << G4endl;
|
|---|
| 301 | // on tolerant r, inside z, within phi
|
|---|
| 302 | if (c5.Inside(G4ThreeVector(100,0,0))!=kSurface)
|
|---|
| 303 | G4cout << "Error I4" << G4endl;
|
|---|
| 304 | if (c3.Inside(G4ThreeVector(100,0,0))!=kSurface)
|
|---|
| 305 | G4cout << "Error I5" << G4endl;
|
|---|
| 306 | // on tolerant r, tolerant z, within phi
|
|---|
| 307 | if (c5.Inside(G4ThreeVector(100,0,50))!=kSurface)
|
|---|
| 308 | G4cout << "Error I4" << G4endl;
|
|---|
| 309 | if (c3.Inside(G4ThreeVector(100,0,50))!=kSurface)
|
|---|
| 310 | G4cout << "Error I5" << G4endl;
|
|---|
| 311 |
|
|---|
| 312 |
|
|---|
| 313 | G4cout << "Testing G4Cons::SurfaceNormal...\n";
|
|---|
| 314 |
|
|---|
| 315 | G4ThreeVector normal;
|
|---|
| 316 | G4double p2=1./std::sqrt(2.),p3=1./std::sqrt(3.);
|
|---|
| 317 |
|
|---|
| 318 | normal=cn1.SurfaceNormal(G4ThreeVector(0.,50.,0.));
|
|---|
| 319 | assert(ApproxEqual(normal,G4ThreeVector(p2,p2,0.)));
|
|---|
| 320 | normal=cn1.SurfaceNormal(G4ThreeVector(0.,45.,0.));
|
|---|
| 321 | assert(ApproxEqual(normal,G4ThreeVector(p2,-p2,0.)));
|
|---|
| 322 | normal=cn1.SurfaceNormal(G4ThreeVector(0.,45.,50.));
|
|---|
| 323 | assert(ApproxEqual(normal,G4ThreeVector(p3,-p3,p3)));
|
|---|
| 324 | normal=cn1.SurfaceNormal(G4ThreeVector(0.,45.,-50.));
|
|---|
| 325 | assert(ApproxEqual(normal,G4ThreeVector(p3,-p3,-p3)));
|
|---|
| 326 | normal=cn1.SurfaceNormal(G4ThreeVector(-50.,0.,-50.));
|
|---|
| 327 | assert(ApproxEqual(normal,G4ThreeVector(-p3,-p3,-p3)));
|
|---|
| 328 | normal=cn1.SurfaceNormal(G4ThreeVector(-50.,0.,0.));
|
|---|
| 329 | assert(ApproxEqual(normal,G4ThreeVector(-p2,-p2,0.)));
|
|---|
| 330 | normal=cn2.SurfaceNormal(G4ThreeVector(50.,0.,0.));
|
|---|
| 331 | assert(ApproxEqual(normal,G4ThreeVector(p2,p2,0.)));
|
|---|
| 332 | normal=c6.SurfaceNormal(G4ThreeVector(0.,0.,50.));
|
|---|
| 333 | assert(ApproxEqual(normal,G4ThreeVector(0.,0.,1.)));
|
|---|
| 334 |
|
|---|
| 335 |
|
|---|
| 336 |
|
|---|
| 337 |
|
|---|
| 338 |
|
|---|
| 339 | norm=c1.SurfaceNormal(ponplz);
|
|---|
| 340 | if (OutRange(norm,G4ThreeVector(0,0,1)))
|
|---|
| 341 | G4cout << "Error A " << norm << G4endl;
|
|---|
| 342 | norm=c1.SurfaceNormal(ponmiz);
|
|---|
| 343 | if (OutRange(norm,G4ThreeVector(0,0,-1)))
|
|---|
| 344 | G4cout << "Error B " << norm << G4endl;
|
|---|
| 345 | norm=c1.SurfaceNormal(ponr1);
|
|---|
| 346 | if (OutRange(norm,G4ThreeVector(-1.0/std::sqrt(2.0),-1.0/std::sqrt(2.0),0)))
|
|---|
| 347 | G4cout << "Error C " << norm << G4endl;
|
|---|
| 348 | norm=c1.SurfaceNormal(ponr2);
|
|---|
| 349 | if (OutRange(norm,G4ThreeVector(1.0/std::sqrt(2.0),1.0/std::sqrt(2.0),0)))
|
|---|
| 350 | G4cout << "Error D " << norm << G4endl;
|
|---|
| 351 | norm=c3.SurfaceNormal(ponphi1);
|
|---|
| 352 | if (OutRange(norm,vnphi1))
|
|---|
| 353 | G4cout << "Error E " << norm << G4endl;
|
|---|
| 354 | norm=c3.SurfaceNormal(ponphi2);
|
|---|
| 355 | if (OutRange(norm,vnphi2))
|
|---|
| 356 | G4cout << "Error F " << norm << G4endl;
|
|---|
| 357 | norm=c4.SurfaceNormal(ponr2b);
|
|---|
| 358 | if (OutRange(norm,vxmz))
|
|---|
| 359 | G4cout << "Error G " << norm << G4endl;
|
|---|
| 360 |
|
|---|
| 361 | norm=c5.SurfaceNormal(G4ThreeVector(51,0,-50));
|
|---|
| 362 | if (OutRange(norm,G4ThreeVector(0.,-p2,-p2)))
|
|---|
| 363 | G4cout << "Errot H " << norm << G4endl;
|
|---|
| 364 |
|
|---|
| 365 | G4cout << "Testing G4Cons::DistanceToOut...\n";
|
|---|
| 366 |
|
|---|
| 367 |
|
|---|
| 368 | dist=c4.DistanceToOut(ponphi1);
|
|---|
| 369 | if (OutRange(dist,0))
|
|---|
| 370 | G4cout << "Error A " << dist << G4endl;
|
|---|
| 371 |
|
|---|
| 372 | dist=c1.DistanceToOut(ponphi1);
|
|---|
| 373 | if (OutRange(dist,10))
|
|---|
| 374 | G4cout << "Error B " << dist << G4endl;
|
|---|
| 375 |
|
|---|
| 376 | dist=c1.DistanceToOut(pnearplz);
|
|---|
| 377 | if (OutRange(dist,5))
|
|---|
| 378 | G4cout << "Error C " << dist << G4endl;
|
|---|
| 379 | dist=c1.DistanceToOut(pnearmiz);
|
|---|
| 380 | if (OutRange(dist,5))
|
|---|
| 381 | G4cout << "Error D " << dist << G4endl;
|
|---|
| 382 |
|
|---|
| 383 | dist=c1.DistanceToOut(ponr1);
|
|---|
| 384 | if (OutRange(dist,0))
|
|---|
| 385 | G4cout << "Error E " << dist << G4endl;
|
|---|
| 386 | dist=c1.DistanceToOut(ponr2);
|
|---|
| 387 | if (OutRange(dist,0))
|
|---|
| 388 | G4cout << "Error F " << dist << G4endl;
|
|---|
| 389 |
|
|---|
| 390 | dist=c6.DistanceToOut(pzero);
|
|---|
| 391 | if (OutRange(dist,50))
|
|---|
| 392 | G4cout << "Error G " << dist << G4endl;
|
|---|
| 393 |
|
|---|
| 394 | dist=c5.DistanceToOut(G4ThreeVector(0,-70,0));
|
|---|
| 395 | if (OutRange(dist,0))
|
|---|
| 396 | G4cout << "Error H " << dist << G4endl;
|
|---|
| 397 |
|
|---|
| 398 | G4cout << "Testing G4Cons::DistanceToOut...\n";
|
|---|
| 399 | dist=c4.DistanceToOut(pplx,vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 400 | *pNorm=pNorm->unit();
|
|---|
| 401 | if (OutRange(dist,30)||OutRange(*pNorm,vxmz)||!*pgoodNorm)
|
|---|
| 402 | G4cout << "Error Rmax1 " << dist << G4endl;
|
|---|
| 403 |
|
|---|
| 404 | dist=c2.DistanceToOut(pplx,vx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 405 | *pNorm=pNorm->unit();
|
|---|
| 406 | if (OutRange(dist,30)||OutRange(*pNorm,vxmz)||!*pgoodNorm)
|
|---|
| 407 | G4cout << "Error Rmax2 " << dist << G4endl;
|
|---|
| 408 |
|
|---|
| 409 | dist=c4.DistanceToOut(pplx,vmx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 410 | *pNorm=pNorm->unit();
|
|---|
| 411 | if (OutRange(dist,70)||*pgoodNorm)
|
|---|
| 412 | G4cout << "Error Rmin1 " << dist << G4endl;
|
|---|
| 413 |
|
|---|
| 414 |
|
|---|
| 415 | dist=c2.DistanceToOut(pplx,vmx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 416 | *pNorm=pNorm->unit();
|
|---|
| 417 | if (OutRange(dist,70)||*pgoodNorm)
|
|---|
| 418 | G4cout << "Error Rmin2 " << dist << G4endl;
|
|---|
| 419 |
|
|---|
| 420 | dist=c3.DistanceToOut(ponphi1,vmy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 421 | *pNorm=pNorm->unit();
|
|---|
| 422 | if (OutRange(dist,0)||
|
|---|
| 423 | OutRange(*pNorm,vnphi1)||
|
|---|
| 424 | !*pgoodNorm)
|
|---|
| 425 | G4cout << "Error PhiS 1" << dist << G4endl;
|
|---|
| 426 | dist=c3.DistanceToOut(ponphi1,vy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 427 | *pNorm=pNorm->unit();
|
|---|
| 428 | if (OutRange(dist,2*60*std::sin(pi/6))||
|
|---|
| 429 | OutRange(*pNorm,vnphi2)||
|
|---|
| 430 | !*pgoodNorm)
|
|---|
| 431 | G4cout << "Error PhiS 2" << dist << G4endl;
|
|---|
| 432 |
|
|---|
| 433 | dist=c3.DistanceToOut(ponphi2,vy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 434 | *pNorm=pNorm->unit();
|
|---|
| 435 | if (OutRange(dist,0)||
|
|---|
| 436 | OutRange(*pNorm,vnphi2)||
|
|---|
| 437 | !*pgoodNorm)
|
|---|
| 438 | G4cout << "Error PhiE 1" << dist << G4endl;
|
|---|
| 439 | dist=c3.DistanceToOut(ponphi2,vmy,calcNorm,pgoodNorm,pNorm);
|
|---|
| 440 | *pNorm=pNorm->unit();
|
|---|
| 441 | if (OutRange(dist,2*60*std::sin(pi/6))||
|
|---|
| 442 | OutRange(*pNorm,vnphi1)||
|
|---|
| 443 | !*pgoodNorm)
|
|---|
| 444 | G4cout << "Error PhiS 2" << dist << G4endl;
|
|---|
| 445 |
|
|---|
| 446 |
|
|---|
| 447 | dist=c6.DistanceToOut(ponplz,vmz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 448 | *pNorm=pNorm->unit();
|
|---|
| 449 | if (OutRange(dist,100)||
|
|---|
| 450 | OutRange(*pNorm,vmz)||
|
|---|
| 451 | !*pgoodNorm)
|
|---|
| 452 | G4cout << "Error Top Z 1" << dist << G4endl;
|
|---|
| 453 | dist=c6.DistanceToOut(ponplz,vz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 454 | *pNorm=pNorm->unit();
|
|---|
| 455 | if (OutRange(dist,0)||
|
|---|
| 456 | OutRange(*pNorm,vz)||
|
|---|
| 457 | !*pgoodNorm)
|
|---|
| 458 | G4cout << "Error Top Z 2" << dist << G4endl;
|
|---|
| 459 |
|
|---|
| 460 | dist=c6.DistanceToOut(ponmiz,vz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 461 | *pNorm=pNorm->unit();
|
|---|
| 462 | if (OutRange(dist,100)||
|
|---|
| 463 | OutRange(*pNorm,vz)||
|
|---|
| 464 | !*pgoodNorm)
|
|---|
| 465 | G4cout << "Error Lower Z 1" << dist << G4endl;
|
|---|
| 466 | dist=c6.DistanceToOut(ponmiz,vmz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 467 | *pNorm=pNorm->unit();
|
|---|
| 468 | if (OutRange(dist,0)||
|
|---|
| 469 | OutRange(*pNorm,vmz)||
|
|---|
| 470 | !*pgoodNorm)
|
|---|
| 471 | G4cout << "Error Lower Z 2" << dist << G4endl;
|
|---|
| 472 |
|
|---|
| 473 | // Test case for rmax root bug
|
|---|
| 474 | dist=c7.DistanceToOut(ponr2,vmx,calcNorm,pgoodNorm,pNorm);
|
|---|
| 475 | if (OutRange(dist,100/std::sqrt(2.)-std::sqrt(95*95-100*100/2.))||*pgoodNorm)
|
|---|
| 476 | G4cout << "Error rmax root bug" << dist << G4endl;
|
|---|
| 477 |
|
|---|
| 478 | // Parallel radii test cases
|
|---|
| 479 | dist=c8a.DistanceToOut(pparr2,vparr,calcNorm,pgoodNorm,pNorm);
|
|---|
| 480 | *pNorm=pNorm->unit();
|
|---|
| 481 | if (OutRange(dist,100.*std::sqrt(5.)/2.)||
|
|---|
| 482 | !*pgoodNorm||
|
|---|
| 483 | OutRange(*pNorm,vz))
|
|---|
| 484 | G4cout << "Error solid parr2a " <<dist << G4endl;
|
|---|
| 485 | dist=c8a.DistanceToOut(pparr2,-vparr,calcNorm,pgoodNorm,pNorm);
|
|---|
| 486 | *pNorm=pNorm->unit();
|
|---|
| 487 | if (OutRange(dist,0)||
|
|---|
| 488 | !*pgoodNorm||
|
|---|
| 489 | OutRange(*pNorm,vmz))
|
|---|
| 490 | G4cout << "Error solid parr2b " <<dist << G4endl;
|
|---|
| 491 |
|
|---|
| 492 | dist=c8a.DistanceToOut(pparr2,vz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 493 | *pNorm=pNorm->unit();
|
|---|
| 494 | if (OutRange(dist,100)||
|
|---|
| 495 | !*pgoodNorm||
|
|---|
| 496 | OutRange(*pNorm,vz))
|
|---|
| 497 | G4cout << "Error solid parr2c " <<dist << G4endl;
|
|---|
| 498 | dist=c8a.DistanceToOut(pparr2,vmz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 499 | *pNorm=pNorm->unit();
|
|---|
| 500 | if (OutRange(dist,0)||
|
|---|
| 501 | !*pgoodNorm||
|
|---|
| 502 | OutRange(*pNorm,vmz))
|
|---|
| 503 | G4cout << "Error solid parr2d " <<dist << G4endl;
|
|---|
| 504 |
|
|---|
| 505 | dist=c8a.DistanceToOut(pparr3,vparr,calcNorm,pgoodNorm,pNorm);
|
|---|
| 506 | *pNorm=pNorm->unit();
|
|---|
| 507 | if (OutRange(dist,0)||
|
|---|
| 508 | !*pgoodNorm||
|
|---|
| 509 | OutRange(*pNorm,vz))
|
|---|
| 510 | G4cout << "Error solid parr3a " <<dist << G4endl;
|
|---|
| 511 | dist=c8a.DistanceToOut(pparr3,-vparr,calcNorm,pgoodNorm,pNorm);
|
|---|
| 512 | *pNorm=pNorm->unit();
|
|---|
| 513 | if (OutRange(dist,100*std::sqrt(5.)/2.)||
|
|---|
| 514 | !*pgoodNorm||
|
|---|
| 515 | OutRange(*pNorm,vmz))
|
|---|
| 516 | G4cout << "Error solid parr3b " <<dist << G4endl;
|
|---|
| 517 | dist=c8a.DistanceToOut(pparr3,vz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 518 | *pNorm=pNorm->unit();
|
|---|
| 519 | if (OutRange(dist,0)||
|
|---|
| 520 | !*pgoodNorm||
|
|---|
| 521 | OutRange(*pNorm,vz))
|
|---|
| 522 | G4cout << "Error solid parr3c " <<dist << G4endl;
|
|---|
| 523 |
|
|---|
| 524 | dist=c8a.DistanceToOut(pparr3,vmz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 525 | *pNorm=pNorm->unit();
|
|---|
| 526 | if (OutRange(dist,50)||
|
|---|
| 527 | !*pgoodNorm||
|
|---|
| 528 | OutRange(*pNorm,G4ThreeVector(0,2./std::sqrt(5.0),-1./std::sqrt(5.0))))
|
|---|
| 529 | G4cout << "Error solid parr3d " <<dist << G4endl;
|
|---|
| 530 |
|
|---|
| 531 |
|
|---|
| 532 | dist=c8b.DistanceToOut(pparr2,vparr,calcNorm,pgoodNorm,pNorm);
|
|---|
| 533 | *pNorm=pNorm->unit();
|
|---|
| 534 | if (OutRange(dist,100*std::sqrt(5.)/2.)||
|
|---|
| 535 | !*pgoodNorm||
|
|---|
| 536 | OutRange(*pNorm,vz))
|
|---|
| 537 | G4cout << "Error hollow parr2a " <<dist << G4endl;
|
|---|
| 538 | dist=c8b.DistanceToOut(pparr2,-vparr,calcNorm,pgoodNorm,pNorm);
|
|---|
| 539 | *pNorm=pNorm->unit();
|
|---|
| 540 | if (OutRange(dist,0)||
|
|---|
| 541 | !*pgoodNorm||
|
|---|
| 542 | OutRange(*pNorm,vmz))
|
|---|
| 543 | G4cout << "Error hollow parr2b " <<dist << G4endl;
|
|---|
| 544 |
|
|---|
| 545 | dist=c8b.DistanceToOut(pparr2,vz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 546 | *pNorm=pNorm->unit();
|
|---|
| 547 | if (OutRange(dist,50)||*pgoodNorm)
|
|---|
| 548 | G4cout << "Error hollow parr2c " <<dist << G4endl;
|
|---|
| 549 | dist=c8b.DistanceToOut(pparr2,vmz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 550 | *pNorm=pNorm->unit();
|
|---|
| 551 | if (OutRange(dist,0)||
|
|---|
| 552 | !*pgoodNorm||
|
|---|
| 553 | OutRange(*pNorm,vmz))
|
|---|
| 554 | G4cout << "Error hollow parr2d " <<dist << G4endl;
|
|---|
| 555 |
|
|---|
| 556 |
|
|---|
| 557 | dist=c8b.DistanceToOut(pparr3,vparr,calcNorm,pgoodNorm,pNorm);
|
|---|
| 558 | *pNorm=pNorm->unit();
|
|---|
| 559 | if (OutRange(dist,0)||
|
|---|
| 560 | !*pgoodNorm||
|
|---|
| 561 | OutRange(*pNorm,vz))
|
|---|
| 562 | G4cout << "Error hollow parr3a " <<dist << G4endl;
|
|---|
| 563 | dist=c8b.DistanceToOut(pparr3,-vparr,calcNorm,pgoodNorm,pNorm);
|
|---|
| 564 | *pNorm=pNorm->unit();
|
|---|
| 565 | if (OutRange(dist,100.*std::sqrt(5.)/2.)||
|
|---|
| 566 | !*pgoodNorm||
|
|---|
| 567 | OutRange(*pNorm,vmz))
|
|---|
| 568 | G4cout << "Error hollow parr3b " <<dist << G4endl;
|
|---|
| 569 | dist=c8b.DistanceToOut(pparr3,vz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 570 | *pNorm=pNorm->unit();
|
|---|
| 571 | if (OutRange(dist,0)||
|
|---|
| 572 | !*pgoodNorm||
|
|---|
| 573 | OutRange(*pNorm,vz))
|
|---|
| 574 | G4cout << "Error hollow parr3c " <<dist << G4endl;
|
|---|
| 575 |
|
|---|
| 576 | dist=c8b.DistanceToOut(pparr3,vmz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 577 | *pNorm=pNorm->unit();
|
|---|
| 578 | if (OutRange(dist,50)||
|
|---|
| 579 | !*pgoodNorm||
|
|---|
| 580 | OutRange(*pNorm,G4ThreeVector(0,2./std::sqrt(5.),-1.0/std::sqrt(5.))))
|
|---|
| 581 | G4cout << "Error hollow parr3d " <<dist << G4endl;
|
|---|
| 582 |
|
|---|
| 583 | dist=c9.DistanceToOut(G4ThreeVector(1e3*kRadTolerance,0,50),
|
|---|
| 584 | vx2mz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 585 | *pNorm=pNorm->unit();
|
|---|
| 586 | if (OutRange(dist,111.8033988)||
|
|---|
| 587 | !*pgoodNorm||
|
|---|
| 588 | OutRange(*pNorm,G4ThreeVector(0,0,-1.0)))
|
|---|
| 589 | G4cout<<"Error:c9.Out((1e3*kRadTolerance,0,50),vx2mz,...) = " <<dist << G4endl;
|
|---|
| 590 |
|
|---|
| 591 | dist=c9.DistanceToOut(G4ThreeVector(5,0,50),
|
|---|
| 592 | vx2mz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 593 | *pNorm=pNorm->unit();
|
|---|
| 594 | if (OutRange(dist,111.8033988)||
|
|---|
| 595 | !*pgoodNorm||
|
|---|
| 596 | OutRange(*pNorm,G4ThreeVector(0,0,-1.0)))
|
|---|
| 597 | G4cout << "Error:c9.Out((5,0,50),vx2mz,...) = " <<dist << G4endl;
|
|---|
| 598 |
|
|---|
| 599 | dist=c9.DistanceToOut(G4ThreeVector(10,0,50),
|
|---|
| 600 | vx2mz,calcNorm,pgoodNorm,pNorm);
|
|---|
| 601 | *pNorm=pNorm->unit();
|
|---|
| 602 | if (OutRange(dist,111.8033988)||
|
|---|
| 603 | !*pgoodNorm||
|
|---|
| 604 | OutRange(*pNorm,G4ThreeVector(0,0,-1.0)))
|
|---|
| 605 | G4cout << "Error:c9.Out((10,0,50),vx2mz,...) = " <<dist << G4endl;
|
|---|
| 606 |
|
|---|
| 607 | dist=cms.DistanceToOut(
|
|---|
| 608 | G4ThreeVector(0.28628920024909,-0.43438111004815,-2949.0),
|
|---|
| 609 | G4ThreeVector(6.0886686196674e-05,-9.2382200635766e-05,0.99999999387917),
|
|---|
| 610 | calcNorm,pgoodNorm,pNorm);
|
|---|
| 611 | if (OutRange(dist,5898.0))
|
|---|
| 612 | G4cout << "Error:cms.DistToOut() = " <<dist << G4endl;
|
|---|
| 613 |
|
|---|
| 614 | dist=cms.DistanceToOut(
|
|---|
| 615 | G4ThreeVector(0.28628920024909,-0.43438111004815,
|
|---|
| 616 | -2949.0 + kCarTolerance*0.25),
|
|---|
| 617 | G4ThreeVector(6.0886686196674e-05,-9.2382200635766e-05,0.99999999387917),
|
|---|
| 618 | calcNorm,pgoodNorm,pNorm);
|
|---|
| 619 | if (OutRange(dist,5898.0))
|
|---|
| 620 | G4cout << "Error:cms.DistToOut(+) = " <<dist << G4endl;
|
|---|
| 621 |
|
|---|
| 622 | dist=cms.DistanceToOut(G4ThreeVector(0.28628920024909,
|
|---|
| 623 | -0.43438111004815,
|
|---|
| 624 | -2949.0 - kCarTolerance*0.25),
|
|---|
| 625 | G4ThreeVector(6.0886686196674e-05,
|
|---|
| 626 | -9.2382200635766e-05,
|
|---|
| 627 | 0.99999999387917),
|
|---|
| 628 | calcNorm,pgoodNorm,pNorm);
|
|---|
| 629 | if (OutRange(dist,5898.0))
|
|---|
| 630 | G4cout << "Error:cms.DistToOut(-) = " <<dist << G4endl;
|
|---|
| 631 |
|
|---|
| 632 | dist=cms2.DistanceToOut(G4ThreeVector(-344.13684353113,
|
|---|
| 633 | 258.98049377272,
|
|---|
| 634 | -158.20772167926),
|
|---|
| 635 | G4ThreeVector(-0.30372024336672,
|
|---|
| 636 | -0.5581146924652,
|
|---|
| 637 | 0.77218003329776),
|
|---|
| 638 | calcNorm,pgoodNorm,pNorm);
|
|---|
| 639 | if (OutRange(dist,0.))
|
|---|
| 640 | G4cout<<"cms2.DistanceToOut(G4ThreeVector(-344.13684 ... = "<<dist<<G4endl;
|
|---|
| 641 |
|
|---|
| 642 | dist=ctest10.DistanceToOut(pct10e2,
|
|---|
| 643 | d1,calcNorm,pgoodNorm,pNorm);
|
|---|
| 644 | *pNorm=pNorm->unit();
|
|---|
| 645 | if (OutRange(dist,111.8033988)||
|
|---|
| 646 | !*pgoodNorm||
|
|---|
| 647 | OutRange(*pNorm,G4ThreeVector(0,0,-1.0)))
|
|---|
| 648 | G4cout << "ctest10.DistanceToOut(pct10e2,d1,...) = " <<dist << G4endl;
|
|---|
| 649 | dist=ctest10.DistanceToOut(pct10e3,
|
|---|
| 650 | d1,calcNorm,pgoodNorm,pNorm);
|
|---|
| 651 | *pNorm=pNorm->unit();
|
|---|
| 652 | if (OutRange(dist,111.8033988)||
|
|---|
| 653 | !*pgoodNorm||
|
|---|
| 654 | OutRange(*pNorm,G4ThreeVector(0,0,-1.0)))
|
|---|
| 655 | G4cout << "ctest10.DistanceToOut(pct10e3,d1,...) = " <<dist << G4endl;
|
|---|
| 656 |
|
|---|
| 657 | /////////////////////////////////////////////
|
|---|
| 658 | //
|
|---|
| 659 |
|
|---|
| 660 | G4cout << "Testing G4Cons::DistanceToIn(p) ...\n";
|
|---|
| 661 |
|
|---|
| 662 |
|
|---|
| 663 | dist=c1.DistanceToIn(pzero);
|
|---|
| 664 | if (OutRange(dist,50))
|
|---|
| 665 | G4cout << "Error A " << dist << G4endl;
|
|---|
| 666 |
|
|---|
| 667 | dist=c1.DistanceToIn(pplx);
|
|---|
| 668 | if (OutRange(dist,20))
|
|---|
| 669 | G4cout << "Error B " << dist << G4endl;
|
|---|
| 670 |
|
|---|
| 671 | dist=c1.DistanceToIn(pply);
|
|---|
| 672 | if (OutRange(dist,20))
|
|---|
| 673 | G4cout << "Error C " << dist << G4endl;
|
|---|
| 674 |
|
|---|
| 675 | dist=c4.DistanceToIn(pply);
|
|---|
| 676 | if (OutRange(dist,120*std::sin(pi/3)))
|
|---|
| 677 | G4cout << "Error D " << dist << G4endl;
|
|---|
| 678 |
|
|---|
| 679 | dist=c4.DistanceToIn(pmiy);
|
|---|
| 680 | if (OutRange(dist,120*std::sin(pi/3)))
|
|---|
| 681 | G4cout << "Error D " << dist << G4endl;
|
|---|
| 682 |
|
|---|
| 683 | dist=c1.DistanceToIn(pplz);
|
|---|
| 684 | if (OutRange(dist,70))
|
|---|
| 685 | G4cout << "Error E " << dist << G4endl;
|
|---|
| 686 | // Check with both rmins=0
|
|---|
| 687 | dist=c5.DistanceToIn(pplx);
|
|---|
| 688 | if (OutRange(dist,20./std::sqrt(2.)))
|
|---|
| 689 | G4cout << "Error F " << dist << G4endl;
|
|---|
| 690 |
|
|---|
| 691 | /////////////////////////////////////////////////////
|
|---|
| 692 | //
|
|---|
| 693 |
|
|---|
| 694 | G4cout << "Testing G4Cons::DistanceToIn(p,v,...) ...\n";
|
|---|
| 695 |
|
|---|
| 696 | dist=c1.DistanceToIn(pplz,vmz);
|
|---|
| 697 | if (OutRange(dist,kInfinity))
|
|---|
| 698 | G4cout << "Error A " << dist << G4endl;
|
|---|
| 699 |
|
|---|
| 700 | dist=c2.DistanceToIn(pplz,vmz);
|
|---|
| 701 | if (OutRange(dist,kInfinity))
|
|---|
| 702 | G4cout << "Error:c2.DistanceToIn(pplz,vmz) = " << dist << G4endl;
|
|---|
| 703 |
|
|---|
| 704 | dist=c3.DistanceToIn(pplz,vmz);
|
|---|
| 705 | if (OutRange(dist,kInfinity))
|
|---|
| 706 | G4cout << "Error:c3.DistanceToIn(pplz,vmz) = " << dist << G4endl;
|
|---|
| 707 |
|
|---|
| 708 | dist=c4.DistanceToIn(pplz,vmz);
|
|---|
| 709 | if (OutRange(dist,kInfinity))
|
|---|
| 710 | G4cout << "Error:c4.DistanceToIn(pplz,vmz) = " << dist << G4endl;
|
|---|
| 711 |
|
|---|
| 712 | dist=c5.DistanceToIn(pplz,vmz);
|
|---|
| 713 | if (OutRange(dist,kInfinity))
|
|---|
| 714 | G4cout << "Error:c5.DistanceToIn(pplz,vmz) = " << dist << G4endl;
|
|---|
| 715 |
|
|---|
| 716 | dist=c6.DistanceToIn(pplz,vmz);
|
|---|
| 717 | if (OutRange(dist,70.0))
|
|---|
| 718 | G4cout << "Error:c6.DistanceToIn(pplz,vmz) = " << dist << G4endl;
|
|---|
| 719 |
|
|---|
| 720 | dist=c7.DistanceToIn(pplz,vmz);
|
|---|
| 721 | if (OutRange(dist,kInfinity))
|
|---|
| 722 | G4cout << "Error:c7.DistanceToIn(pplz,vmz) = " << dist << G4endl;
|
|---|
| 723 |
|
|---|
| 724 | dist=c8a.DistanceToIn(pplz,vmz);
|
|---|
| 725 | if (OutRange(dist,70.0))
|
|---|
| 726 | G4cout << "Error:c8a.DistanceToIn(pplz,vmz) = " << dist << G4endl;
|
|---|
| 727 |
|
|---|
| 728 | dist=c8b.DistanceToIn(pplz,vmz);
|
|---|
| 729 | if (OutRange(dist,kInfinity))
|
|---|
| 730 | G4cout << "Error:c8b.DistanceToIn(pplz,vmz) = " << dist << G4endl;
|
|---|
| 731 |
|
|---|
| 732 | dist=c8c.DistanceToIn(pplz,vmz);
|
|---|
| 733 | if (OutRange(dist,kInfinity))
|
|---|
| 734 | G4cout << "Error:c8c.DistanceToIn(pplz,vmz) = " << dist << G4endl;
|
|---|
| 735 |
|
|---|
| 736 | dist=c9.DistanceToIn(pplz,vmz);
|
|---|
| 737 | if (OutRange(dist,kInfinity))
|
|---|
| 738 | G4cout << "Error:c9.DistanceToIn(pplz,vmz) = " << dist << G4endl;
|
|---|
| 739 |
|
|---|
| 740 | dist=c9.DistanceToIn(G4ThreeVector(0,0,50),vmz);
|
|---|
| 741 | if (OutRange(dist,kInfinity))
|
|---|
| 742 | G4cout << "Error:c9.DistanceToIn((0,0,50),vmz) = " << dist << G4endl;
|
|---|
| 743 |
|
|---|
| 744 | ///////////////
|
|---|
| 745 |
|
|---|
| 746 | dist=c1.DistanceToIn(pmiz,vz);
|
|---|
| 747 | if (OutRange(dist,kInfinity))
|
|---|
| 748 | G4cout << "Error A " << dist << G4endl;
|
|---|
| 749 |
|
|---|
| 750 | dist=c2.DistanceToIn(pmiz,vz);
|
|---|
| 751 | if (OutRange(dist,kInfinity))
|
|---|
| 752 | G4cout << "Error:c2.DistanceToIn(pmiz,vz) = " << dist << G4endl;
|
|---|
| 753 |
|
|---|
| 754 | dist=c3.DistanceToIn(pmiz,vz);
|
|---|
| 755 | if (OutRange(dist,kInfinity))
|
|---|
| 756 | G4cout << "Error:c3.DistanceToIn(pmiz,vz) = " << dist << G4endl;
|
|---|
| 757 |
|
|---|
| 758 | dist=c4.DistanceToIn(pmiz,vz);
|
|---|
| 759 | if (OutRange(dist,kInfinity))
|
|---|
| 760 | G4cout << "Error:c4.DistanceToIn(pmiz,vz) = " << dist << G4endl;
|
|---|
| 761 |
|
|---|
| 762 | dist=c5.DistanceToIn(pmiz,vz);
|
|---|
| 763 | if (OutRange(dist,kInfinity))
|
|---|
| 764 | G4cout << "Error:c5.DistanceToIn(pmiz,vz) = " << dist << G4endl;
|
|---|
| 765 |
|
|---|
| 766 | dist=c6.DistanceToIn(pmiz,vz);
|
|---|
| 767 | if (OutRange(dist,70.0))
|
|---|
| 768 | G4cout << "Error:c6.DistanceToIn(pmiz,vz) = " << dist << G4endl;
|
|---|
| 769 |
|
|---|
| 770 | dist=c7.DistanceToIn(pmiz,vz);
|
|---|
| 771 | if (OutRange(dist,kInfinity))
|
|---|
| 772 | G4cout << "Error:c7.DistanceToIn(pmiz,vz) = " << dist << G4endl;
|
|---|
| 773 |
|
|---|
| 774 | dist=c8a.DistanceToIn(pmiz,vz);
|
|---|
| 775 | if (OutRange(dist,70.0))
|
|---|
| 776 | G4cout << "Error:c8a.DistanceToIn(pmiz,vz) = " << dist << G4endl;
|
|---|
| 777 |
|
|---|
| 778 | dist=c8b.DistanceToIn(pmiz,vz);
|
|---|
| 779 | if (OutRange(dist,kInfinity))
|
|---|
| 780 | G4cout << "Error:c8b.DistanceToIn(pmiz,vz) = " << dist << G4endl;
|
|---|
| 781 |
|
|---|
| 782 | dist=c8c.DistanceToIn(pmiz,vz);
|
|---|
| 783 | if (OutRange(dist,kInfinity))
|
|---|
| 784 | G4cout << "Error:c8c.DistanceToIn(pmiz,vz) = " << dist << G4endl;
|
|---|
| 785 |
|
|---|
| 786 | dist=c9.DistanceToIn(pmiz,vz);
|
|---|
| 787 | if (OutRange(dist,kInfinity))
|
|---|
| 788 | G4cout << "Error:c9.DistanceToIn(pmiz,vz) = " << dist << G4endl;
|
|---|
| 789 |
|
|---|
| 790 | //////////////
|
|---|
| 791 |
|
|---|
| 792 | dist=c1.DistanceToIn(pplx,vmx);
|
|---|
| 793 | if (OutRange(dist,20))
|
|---|
| 794 | G4cout << "Error B " << dist << G4endl;
|
|---|
| 795 | dist=c1.DistanceToIn(pplz,vx);
|
|---|
| 796 | if (OutRange(dist,kInfinity))
|
|---|
| 797 | G4cout << "Error C " << dist << G4endl;
|
|---|
| 798 | dist=c4.DistanceToIn(pply,vmy);
|
|---|
| 799 | if (OutRange(dist,kInfinity))
|
|---|
| 800 | G4cout << "Error D " << dist << G4endl;
|
|---|
| 801 |
|
|---|
| 802 | dist=c1.DistanceToIn(pydx,vmy);
|
|---|
| 803 | if (OutRange(dist,70))
|
|---|
| 804 | G4cout << "Error E " << dist << G4endl;
|
|---|
| 805 | dist=c3.DistanceToIn(pydx,vmy);
|
|---|
| 806 | if (OutRange(dist,150-60*std::tan(pi/6)))
|
|---|
| 807 | G4cout << "Error F " << dist << G4endl;
|
|---|
| 808 |
|
|---|
| 809 | dist=c1.DistanceToIn(pplx,vmx);
|
|---|
| 810 | if (OutRange(dist,20))
|
|---|
| 811 | G4cout << "Error G " << dist << G4endl;
|
|---|
| 812 | dist=c1.DistanceToIn(pplx,vx);
|
|---|
| 813 | if (OutRange(dist,kInfinity))
|
|---|
| 814 | G4cout << "Error G2 " << dist << G4endl;
|
|---|
| 815 |
|
|---|
| 816 | dist=c4.DistanceToIn(pbigx,vmx);
|
|---|
| 817 | if (OutRange(dist,350))
|
|---|
| 818 | G4cout << "Error G3 " << dist << G4endl;
|
|---|
| 819 |
|
|---|
| 820 | dist=c4.DistanceToIn(pzero,vx);
|
|---|
| 821 | if (OutRange(dist,50))
|
|---|
| 822 | G4cout << "Error H " << dist << G4endl;
|
|---|
| 823 |
|
|---|
| 824 | dist=c1.DistanceToIn(ponr2,vx);
|
|---|
| 825 | if (OutRange(dist,kInfinity))
|
|---|
| 826 | G4cout << "Error I" << dist << G4endl;
|
|---|
| 827 | dist=c1.DistanceToIn(ponr2,vmx);
|
|---|
| 828 | if (OutRange(dist,0))
|
|---|
| 829 | G4cout << "Error I2" << dist << G4endl;
|
|---|
| 830 |
|
|---|
| 831 | dist=c1.DistanceToIn(ponr1,vx);
|
|---|
| 832 | if (OutRange(dist,0))
|
|---|
| 833 | G4cout << "Error J" << dist << G4endl;
|
|---|
| 834 | dist=c1.DistanceToIn(ponr1,vmx);
|
|---|
| 835 | if (OutRange(dist,2.0*std::sqrt(50*50/2.)))
|
|---|
| 836 | G4cout << "Error J2" << dist << G4endl;
|
|---|
| 837 |
|
|---|
| 838 | dist=c1.DistanceToIn(ponr2,vmxmy);
|
|---|
| 839 | if (OutRange(dist,0))
|
|---|
| 840 | G4cout << "Error K" << dist << G4endl;
|
|---|
| 841 |
|
|---|
| 842 | // Parallel test case -> parallel to both radii
|
|---|
| 843 | dist=c8b.DistanceToIn(pparr1,vparr);
|
|---|
| 844 | if (OutRange(dist,100*std::sqrt(5.)/2.))
|
|---|
| 845 | G4cout << "Error parr1 " << dist << G4endl;
|
|---|
| 846 | dist=c8b.DistanceToIn(pparr2,-vparr);
|
|---|
| 847 | if (OutRange(dist,kInfinity))
|
|---|
| 848 | G4cout << "Error parr2 " << dist << G4endl;
|
|---|
| 849 | dist=c8b.DistanceToIn(pparr3,vparr);
|
|---|
| 850 | if (OutRange(dist,kInfinity))
|
|---|
| 851 | G4cout << "Error parr3a " << dist << G4endl;
|
|---|
| 852 | dist=c8b.DistanceToIn(pparr3,-vparr);
|
|---|
| 853 | if (OutRange(dist,0))
|
|---|
| 854 | G4cout << "Error parr3b " << dist << G4endl;
|
|---|
| 855 |
|
|---|
| 856 | // Check we don't Hit `shadow cone' at `-ve radius' on rmax or rmin
|
|---|
| 857 | dist=c8a.DistanceToIn(proot1,vz);
|
|---|
| 858 | if (OutRange(dist,1000))
|
|---|
| 859 | G4cout << "Error shadow rmax root problem " << dist << G4endl;
|
|---|
| 860 |
|
|---|
| 861 | dist=c8c.DistanceToIn(proot2,vz);
|
|---|
| 862 | if (OutRange(dist,1000))
|
|---|
| 863 | G4cout << "Error shadow rmin root problem " << dist << G4endl;
|
|---|
| 864 |
|
|---|
| 865 | dist = cms2.DistanceToIn(G4ThreeVector(-344.13684353113,
|
|---|
| 866 | 258.98049377272,
|
|---|
| 867 | -158.20772167926),
|
|---|
| 868 | G4ThreeVector(-0.30372022869765,
|
|---|
| 869 | -0.55811472925794,
|
|---|
| 870 | 0.77218001247454)) ;
|
|---|
| 871 | if (OutRange(dist,kInfinity))
|
|---|
| 872 | G4cout<<"cms2.DistanceToIn(G4ThreeVector(-344.1 ... = "<<dist<<G4endl;
|
|---|
| 873 |
|
|---|
| 874 | dist=ctest10.DistanceToIn(pct10,vx);
|
|---|
| 875 | if (OutRange(dist,kInfinity))
|
|---|
| 876 | G4cout << "ctest10.DistanceToIn(pct10,vx) = " << dist << G4endl;
|
|---|
| 877 |
|
|---|
| 878 | dist=ctest10.DistanceToIn(pct10,vmx);
|
|---|
| 879 | if (OutRange(dist,110))
|
|---|
| 880 | G4cout << "ctest10.DistanceToIn(pct10,vmx) = " << dist << G4endl;
|
|---|
| 881 |
|
|---|
| 882 | dist=ctest10.DistanceToIn(pct10,vy);
|
|---|
| 883 | if (OutRange(dist,10.57961))
|
|---|
| 884 | G4cout << "ctest10.DistanceToIn(pct10,vy) = " << dist << G4endl;
|
|---|
| 885 |
|
|---|
| 886 | dist=ctest10.DistanceToIn(pct10,vmy);
|
|---|
| 887 | if (OutRange(dist,71.5052))
|
|---|
| 888 | G4cout << "ctest10.DistanceToIn(pct10,vmy) = " << dist << G4endl;
|
|---|
| 889 |
|
|---|
| 890 | dist=ctest10.DistanceToIn(pct10,vz);
|
|---|
| 891 | if (OutRange(dist,kInfinity))
|
|---|
| 892 | G4cout << "ctest10.DistanceToIn(pct10,vz) = " << dist << G4endl;
|
|---|
| 893 |
|
|---|
| 894 |
|
|---|
| 895 | dist=ctest10.DistanceToIn(pct10phi1,vx);
|
|---|
| 896 | if (OutRange(dist,kInfinity))
|
|---|
| 897 | G4cout << "ctest10.DistanceToIn(pct10phi1,vx) = " << dist << G4endl;
|
|---|
| 898 |
|
|---|
| 899 | dist=ctest10.DistanceToIn(pct10phi1,vmx);
|
|---|
| 900 | if (OutRange(dist,0))
|
|---|
| 901 | G4cout << "ctest10.DistanceToIn(pct10phi1,vmx) = " << dist << G4endl;
|
|---|
| 902 |
|
|---|
| 903 | dist=ctest10.DistanceToIn(pct10phi1,vy);
|
|---|
| 904 | if (OutRange(dist,0))
|
|---|
| 905 | G4cout << "ctest10.DistanceToIn(pct10phi1,vy) = " << dist << G4endl;
|
|---|
| 906 |
|
|---|
| 907 | dist=ctest10.DistanceToIn(pct10phi1,vmy);
|
|---|
| 908 | if (OutRange(dist,80.83778))
|
|---|
| 909 | G4cout << "ctest10.DistanceToIn(pct10phi1,vmy) = " << dist << G4endl;
|
|---|
| 910 |
|
|---|
| 911 | dist=ctest10.DistanceToIn(pct10phi1,vz);
|
|---|
| 912 | if (OutRange(dist,33.3333))
|
|---|
| 913 | G4cout << "ctest10.DistanceToIn(pct10phi1,vz) = " << dist << G4endl;
|
|---|
| 914 |
|
|---|
| 915 | dist=ctest10.DistanceToIn(pct10phi1,vmz);
|
|---|
| 916 | if (OutRange(dist,kInfinity))
|
|---|
| 917 | G4cout << "ctest10.DistanceToIn(pct10phi1,vmz) = " << dist << G4endl;
|
|---|
| 918 |
|
|---|
| 919 | dist=ctest10.DistanceToIn(pct10phi2,vx);
|
|---|
| 920 | if (OutRange(dist,kInfinity))
|
|---|
| 921 | G4cout << "ctest10.DistanceToIn(pct10phi2,vx) = " << dist << G4endl;
|
|---|
| 922 |
|
|---|
| 923 | dist=ctest10.DistanceToIn(pct10phi2,vmx);
|
|---|
| 924 | if (OutRange(dist,0))
|
|---|
| 925 | G4cout << "ctest10.DistanceToIn(pct10phi2,vmx) = " << dist << G4endl;
|
|---|
| 926 |
|
|---|
| 927 | dist=ctest10.DistanceToIn(pct10phi2,vy);
|
|---|
| 928 | if (OutRange(dist,77.78352))
|
|---|
| 929 | G4cout << "ctest10.DistanceToIn(pct10phi2,vy) = " << dist << G4endl;
|
|---|
| 930 |
|
|---|
| 931 | dist=ctest10.DistanceToIn(pct10phi2,vmy);
|
|---|
| 932 | if (OutRange(dist,0))
|
|---|
| 933 | G4cout << "ctest10.DistanceToIn(pct10phi2,vmy) = " << dist << G4endl;
|
|---|
| 934 |
|
|---|
| 935 | dist=ctest10.DistanceToIn(pct10phi2,vz);
|
|---|
| 936 | if (OutRange(dist,33.3333))
|
|---|
| 937 | G4cout << "ctest10.DistanceToIn(pct10phi2,vz) = " << dist << G4endl;
|
|---|
| 938 |
|
|---|
| 939 | dist=ctest10.DistanceToIn(pct10phi2,vmz);
|
|---|
| 940 | if (OutRange(dist,kInfinity))
|
|---|
| 941 | G4cout << "ctest10.DistanceToIn(pct10phi2,vmz) = " << dist << G4endl;
|
|---|
| 942 |
|
|---|
| 943 | dist=ctest10.DistanceToIn(pct10mx,vx);
|
|---|
| 944 | if (OutRange(dist,kInfinity))
|
|---|
| 945 | G4cout << "ctest10.DistanceToIn(pct10mx,vx) = " << dist << G4endl;
|
|---|
| 946 |
|
|---|
| 947 | dist=ctest10.DistanceToIn(pct10mx,vmx);
|
|---|
| 948 | if (OutRange(dist,0))
|
|---|
| 949 | G4cout << "ctest10.DistanceToIn(pct10mx,vmx) = " << dist << G4endl;
|
|---|
| 950 |
|
|---|
| 951 | dist=ctest10.DistanceToIn(pct10mx,vy);
|
|---|
| 952 | if (OutRange(dist,77.78352))
|
|---|
| 953 | G4cout << "ctest10.DistanceToIn(pct10mx,vy) = " << dist << G4endl;
|
|---|
| 954 |
|
|---|
| 955 | dist=ctest10.DistanceToIn(pct10mx,vmy);
|
|---|
| 956 | if (OutRange(dist,0))
|
|---|
| 957 | G4cout << "ctest10.DistanceToIn(pct10mx,vmy) = " << dist << G4endl;
|
|---|
| 958 |
|
|---|
| 959 | dist=ctest10.DistanceToIn(pct10mx,vz);
|
|---|
| 960 | if (OutRange(dist,33.3333))
|
|---|
| 961 | G4cout << "ctest10.DistanceToIn(pct10mx,vz) = " << dist << G4endl;
|
|---|
| 962 |
|
|---|
| 963 | dist=ctest10.DistanceToIn(pct10mx,vmz);
|
|---|
| 964 | if (OutRange(dist,kInfinity))
|
|---|
| 965 | G4cout << "ctest10.DistanceToIn(pct10mx,vmz) = " << dist << G4endl;
|
|---|
| 966 |
|
|---|
| 967 |
|
|---|
| 968 |
|
|---|
| 969 | dist=ctest10.DistanceToIn(pct10e1,d1);
|
|---|
| 970 | if (OutRange(dist,kInfinity))
|
|---|
| 971 | G4cout << "ctest10.DistanceToIn(pct10e1,d1) = " << dist << G4endl;
|
|---|
| 972 |
|
|---|
| 973 | dist=ctest10.DistanceToIn(pct10e4,d1);
|
|---|
| 974 | if (OutRange(dist,kInfinity))
|
|---|
| 975 | G4cout << "ctest10.DistanceToIn(pct10e4,d1) = " << dist << G4endl;
|
|---|
| 976 |
|
|---|
| 977 | dist=ctest10.DistanceToIn(pt10s2,vt10d);
|
|---|
| 978 | // if (OutRange(dist,kInfinity))
|
|---|
| 979 | G4cout << "ctest10.DistanceToIn(pt10s2,vt10d) = " << dist << G4endl;
|
|---|
| 980 |
|
|---|
| 981 | G4double rad = 90.;
|
|---|
| 982 |
|
|---|
| 983 | G4ThreeVector pct10phi1r( rad*std::cos(10.*degree), rad*std::sin(10*degree), 0);
|
|---|
| 984 | G4ThreeVector pct10phi2r( rad*std::cos(50.*degree), -rad*std::sin(50*degree), 0);
|
|---|
| 985 |
|
|---|
| 986 | dist = ctest10.DistanceToIn(pct10phi1r,vmy);
|
|---|
| 987 | // if (OutRange(dist,kInfinity))
|
|---|
| 988 | G4cout << "ctest10.DistanceToIn(pct10phi1r,vmy) = " << dist << G4endl;
|
|---|
| 989 |
|
|---|
| 990 | dist = ctest10.DistanceToIn(pct10phi2r,vx);
|
|---|
| 991 | // if (OutRange(dist,kInfinity))
|
|---|
| 992 | G4cout << "ctest10.DistanceToIn(pct10phi2r,vx) = " << dist << G4endl;
|
|---|
| 993 |
|
|---|
| 994 |
|
|---|
| 995 | G4ThreeVector alex1P(49.840299921054168,-59.39735648688918,-20.893051766050633);
|
|---|
| 996 | G4ThreeVector alex1V(0.6068108874999103,0.35615926907657169,0.71058505603651234);
|
|---|
| 997 |
|
|---|
| 998 | in = ctest10.Inside(alex1P);
|
|---|
| 999 | G4cout << "ctest10.Inside(alex1P) = " <<OutputInside(in)<< G4endl;
|
|---|
| 1000 |
|
|---|
| 1001 | dist = ctest10.DistanceToIn(alex1P,alex1V);
|
|---|
| 1002 | // if (OutRange(dist,kInfinity))
|
|---|
| 1003 | G4cout << "ctest10.DistanceToIn(alex1P,alex1V) = " << dist << G4endl;
|
|---|
| 1004 |
|
|---|
| 1005 | dist = ctest10.DistanceToOut(alex1P,alex1V);
|
|---|
| 1006 | // if (OutRange(dist,kInfinity))
|
|---|
| 1007 | G4cout << "ctest10.DistanceToOut(alex1P,alex1V) = " << dist << G4endl;
|
|---|
| 1008 |
|
|---|
| 1009 |
|
|---|
| 1010 | G4ThreeVector alex2P(127.0075852717127, -514.1050841937065, 69.47104834263656);
|
|---|
| 1011 | G4ThreeVector alex2V(0.1277616879490939, 0.4093610465777845, 0.9033828007202369);
|
|---|
| 1012 |
|
|---|
| 1013 | in = ctest10.Inside(alex2P);
|
|---|
| 1014 | G4cout << "ctest10.Inside(alex2P) = " <<OutputInside(in)<< G4endl;
|
|---|
| 1015 |
|
|---|
| 1016 | dist = ctest10.DistanceToIn(alex2P,alex2V);
|
|---|
| 1017 | // if (OutRange(dist,kInfinity))
|
|---|
| 1018 | G4cout << "ctest10.DistanceToIn(alex2P,alex2V) = " << dist << G4endl;
|
|---|
| 1019 |
|
|---|
| 1020 | //Add Error of CMS, point on the Inner Surface going // to imaginary cone
|
|---|
| 1021 |
|
|---|
| 1022 | G4Cons testc( "cCone", 261.9*mm,270.4*mm,1066.5*mm,1068.7*mm,274.75*mm , 0., twopi);
|
|---|
| 1023 | G4ThreeVector dir;
|
|---|
| 1024 | dir=G4ThreeVector(0.653315775,0.5050862758,0.5639737158);
|
|---|
| 1025 | G4double x,y,z;
|
|---|
| 1026 | x=-296.7662086;y=-809.1328836;z=13210.2270-(12.8005*m+274.75*mm);
|
|---|
| 1027 | G4ThreeVector point=G4ThreeVector(x,y,z);
|
|---|
| 1028 | G4ThreeVector newp=point+testc.DistanceToOut(point,dir)*dir;
|
|---|
| 1029 | G4cout<<"CMS problem: DistIn has to be small="<<testc.DistanceToOut(point,dir)<<G4endl;
|
|---|
| 1030 | G4cout<<"CMS problem: DistInNew has to be kInfinity="<<testc.DistanceToIn(newp,dir)<<G4endl;
|
|---|
| 1031 |
|
|---|
| 1032 | // G4cout << "NOT Checking G4Cons::ScopeCar...\n";
|
|---|
| 1033 | // G4cout << "NOT Checking G4Cons::ScopePhi...\n";
|
|---|
| 1034 | // G4cout << "NOT Checking G4Cons::ScopeRad...\n";
|
|---|
| 1035 |
|
|---|
| 1036 | return 0;
|
|---|
| 1037 | }
|
|---|