Changeset 1340 for trunk/source/geometry/management/src
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- Location:
- trunk/source/geometry/management/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/geometry/management/src/G4ErrorTarget.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ErrorTarget.cc,v 1. 1 2007/05/16 12:50:52gcosmo Exp $28 // GEANT4 tag $Name: ge ant4-09-04-beta-01$27 // $Id: G4ErrorTarget.cc,v 1.2 2010/07/05 09:22:58 gcosmo Exp $ 28 // GEANT4 tag $Name: geommng-V09-03-05 $ 29 29 // 30 30 // … … 35 35 #include "G4ErrorTarget.hh" 36 36 37 G4ErrorTarget::G4ErrorTarget(){} 38 G4ErrorTarget::~G4ErrorTarget(){} 37 G4ErrorTarget::G4ErrorTarget() 38 : theType(G4ErrorTarget_GeomVolume) {} 39 40 G4ErrorTarget::~G4ErrorTarget() {} 39 41 40 42 G4double G4ErrorTarget::GetDistanceFromPoint( const G4ThreeVector&, -
trunk/source/geometry/management/src/G4GeometryManager.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4GeometryManager.cc,v 1.2 2 2008/05/16 13:46:48gcosmo Exp $28 // GEANT4 tag $Name: ge ant4-09-04-beta-01$27 // $Id: G4GeometryManager.cc,v 1.24 2010/07/16 15:52:57 gcosmo Exp $ 28 // GEANT4 tag $Name: geommng-V09-03-05 $ 29 29 // 30 30 // class G4GeometryManager … … 261 261 #ifdef G4GEOMETRY_VOXELDEBUG 262 262 G4cout << "**** G4GeometryManager::BuildOptimisations" << G4endl 263 << " Skipping logical volume name = " << volume->GetName()263 << " Skipping logical volume name = " << tVolume->GetName() 264 264 << G4endl; 265 265 #endif … … 359 359 << totalMemory/1024 << " kByte" << G4endl; 360 360 G4cout << " Total CPU time elapsed for geometry optimisation: " 361 << std::setprecision(2) << totalCpuTime << " seconds" << G4endl; 361 << std::setprecision(2) << totalCpuTime << " seconds" 362 << std::setprecision(6) << G4endl; 362 363 363 364 // -
trunk/source/geometry/management/src/G4LogicalVolume.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4LogicalVolume.cc,v 1.3 4 2009/09/24 13:22:57gcosmo Exp $28 // GEANT4 tag $Name: ge ant4-09-04-beta-01$27 // $Id: G4LogicalVolume.cc,v 1.35 2010/07/05 09:22:58 gcosmo Exp $ 28 // GEANT4 tag $Name: geommng-V09-03-05 $ 29 29 // 30 30 // … … 211 211 G4Exception("G4LogicalVolume::GetMass()", "InvalidSetup", FatalException, 212 212 "No material associated to the logical volume !"); 213 return 0; 213 214 } 214 215 if (!fSolid) … … 219 220 G4Exception("G4LogicalVolume::GetMass()", "InvalidSetup", FatalException, 220 221 "No solid associated to the logical volume !"); 222 return 0; 221 223 } 222 224 G4double globalDensity = logMaterial->GetDensity(); -
trunk/source/geometry/management/src/G4ReflectedSolid.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ReflectedSolid.cc,v 1.1 1 2006/11/08 09:56:33gcosmo Exp $28 // 29 // GEANT4 tag $Name: ge ant4-09-04-beta-01$27 // $Id: G4ReflectedSolid.cc,v 1.13 2010/10/19 15:20:18 gcosmo Exp $ 28 // 29 // GEANT4 tag $Name: geommng-V09-03-05 $ 30 30 // 31 31 // Implementation for G4ReflectedSolid class for boolean … … 93 93 } 94 94 95 /////////////////////////////////////////////////////////////////// 96 // 97 98 G4ReflectedSolid::G4ReflectedSolid(const G4ReflectedSolid& rhs) 99 : G4VSolid(rhs), fPtrSolid(rhs.fPtrSolid), fpPolyhedron(0) 100 { 101 fPtrTransform = new G4AffineTransform(*rhs.fPtrTransform); 102 fDirectTransform = new G4AffineTransform(*rhs.fDirectTransform); 103 fPtrTransform3D = new G4Transform3D(*rhs.fPtrTransform3D); 104 fDirectTransform3D = new G4Transform3D(*rhs.fDirectTransform3D); 105 } 106 107 /////////////////////////////////////////////////////////////////// 108 // 109 110 G4ReflectedSolid& G4ReflectedSolid::operator=(const G4ReflectedSolid& rhs) 111 { 112 // Check assignment to self 113 // 114 if (this == &rhs) { return *this; } 115 116 // Copy base class data 117 // 118 G4VSolid::operator=(rhs); 119 120 // Copy data 121 // 122 fPtrSolid= rhs.fPtrSolid; fpPolyhedron= 0; 123 delete fPtrTransform; 124 fPtrTransform= new G4AffineTransform(*rhs.fPtrTransform); 125 delete fDirectTransform; 126 fDirectTransform= new G4AffineTransform(*rhs.fDirectTransform); 127 delete fPtrTransform3D; 128 fPtrTransform3D= new G4Transform3D(*rhs.fPtrTransform3D); 129 delete fDirectTransform3D; 130 fDirectTransform3D= new G4Transform3D(*rhs.fDirectTransform3D); 131 132 return *this; 133 } 134 135 /////////////////////////////////////////////////////////////////// 136 // 137 95 138 G4GeometryType G4ReflectedSolid::GetEntityType() const 96 139 { … … 257 300 G4Point3D tmpPoint; 258 301 259 // Calculate rotated vertex coordinates302 // Calculate rotated vertex coordinates 260 303 261 304 G4ThreeVectorList* vertices = new G4ThreeVectorList(); 262 vertices->reserve(8);263 305 264 306 if (vertices) 265 307 { 308 vertices->reserve(8); 309 266 310 G4ThreeVector vertex0(x1,y1,z1) ; 267 311 tmpPoint = transform3D*G4Point3D(vertex0); … … 494 538 { 495 539 DumpInfo(); 496 G4Exception("G4 BooleanSolid::ComputeDimensions()",540 G4Exception("G4ReflectedSolid::ComputeDimensions()", 497 541 "NotApplicable", FatalException, 498 542 "Method not applicable in this context!"); … … 511 555 return G4ThreeVector(newPoint.x(),newPoint.y(),newPoint.z()); 512 556 } 557 558 ////////////////////////////////////////////////////////////////////////// 559 // 560 // Make a clone of this object 561 562 G4VSolid* G4ReflectedSolid::Clone() const 563 { 564 return new G4ReflectedSolid(*this); 565 } 566 513 567 514 568 ////////////////////////////////////////////////////////////////////////// -
trunk/source/geometry/management/src/G4SmartVoxelHeader.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4SmartVoxelHeader.cc,v 1.3 5 2010/02/09 16:50:25gcosmo Exp $28 // GEANT4 tag $Name: ge ant4-09-04-beta-01$27 // $Id: G4SmartVoxelHeader.cc,v 1.39 2010/09/06 09:39:21 gcosmo Exp $ 28 // GEANT4 tag $Name: geommng-V09-03-05 $ 29 29 // 30 30 // … … 148 148 } 149 149 } 150 150 else 151 151 { 152 152 dyingNode = fslices[node]->GetNode(); … … 510 510 pTestSlices->pop_back(); 511 511 for (G4ProxyVector::iterator i=pTestSlices->begin(); 512 i!=pTestSlices->end(); i++)512 i!=pTestSlices->end(); ) 513 513 { 514 514 if (*i==tmpProx) 515 515 { 516 pTestSlices->erase(i); i--; 516 i = pTestSlices->erase(i); 517 } 518 else 519 { 520 ++i; 517 521 } 518 522 } 519 523 if ( tmpProx ) { delete tmpProx; } 520 } 524 } 521 525 delete pTestSlices; 522 526 } … … 534 538 "InvalidSetup", FatalException, 535 539 "Cannot select more than 3 axis for optimisation."); 540 return; 536 541 } 537 542 … … 548 553 549 554 #ifdef G4GEOMETRY_VOXELDEBUG 550 G4cout << G4endl << " Selected axis = " << faxis << G4endl; 555 G4cout << G4endl << " Volume = " << pVolume->GetName() 556 << G4endl << " Selected axis = " << faxis << G4endl; 551 557 for (size_t islice=0; islice<fslices.size(); islice++) 552 558 { … … 808 814 G4Exception("G4SmartVoxelHeader::BuildNodes()", "InvalidSetup", 809 815 FatalException, "Missing parameterisation."); 816 return 0; 810 817 } 811 818 … … 864 871 minExtents[nVol] = targetMinExtent; 865 872 maxExtents[nVol] = targetMaxExtent; 873 874 #ifdef G4GEOMETRY_VOXELDEBUG 875 G4cout << "---------------------------------------------------" << G4endl 876 << " Volume = " << pDaughter->GetName() << G4endl 877 << " Min Extent = " << targetMinExtent << G4endl 878 << " Max Extent = " << targetMaxExtent << G4endl 879 << "---------------------------------------------------" << G4endl; 880 #endif 866 881 867 882 // Check not entirely outside mother when processing toplevel nodes … … 960 975 G4double nodeWidth = (motherMaxExtent-motherMinExtent)/noNodes; 961 976 962 // Create G4VoxelNodes. Will Add proxies before setting fslices963 //977 // Create G4VoxelNodes. Will Add proxies before setting fslices 978 // 964 979 G4NodeVector* nodeList = new G4NodeVector(); 965 nodeList->reserve(noNodes);966 980 if (!nodeList) 967 981 { … … 970 984 G4Exception("G4SmartVoxelHeader::BuildNodes()", "FatalError", 971 985 FatalException, "NodeList allocation error."); 972 } 986 return 0; 987 } 988 nodeList->reserve(noNodes); 989 973 990 for (nNode=0; nNode<noNodes; nNode++) 974 991 { … … 981 998 G4Exception("G4SmartVoxelHeader::BuildNodes()", "FatalError", 982 999 FatalException, "Node allocation error."); 1000 return 0; 983 1001 } 984 1002 nodeList->push_back(pNode); … … 1026 1044 // 1027 1045 G4ProxyVector* proxyList = new G4ProxyVector(); 1028 proxyList->reserve(noNodes);1029 1046 if (!proxyList) 1030 1047 { … … 1033 1050 G4Exception("G4SmartVoxelHeader::BuildNodes()", "FatalError", 1034 1051 FatalException, "Proxy list allocation error."); 1035 } 1052 return 0; 1053 } 1054 proxyList->reserve(noNodes); 1055 1036 1056 // 1037 1057 // Fill proxy List … … 1049 1069 G4Exception("G4SmartVoxelHeader::BuildNodes()", "FatalError", 1050 1070 FatalException, "Proxy node allocation failed."); 1071 return 0; 1051 1072 } 1052 1073 proxyList->push_back(pProxyNode); … … 1196 1217 noContainedDaughters = targetNode->GetNoContained(); 1197 1218 targetList = new G4VolumeNosVector(); 1198 targetList->reserve(noContainedDaughters);1199 1219 if (!targetList) 1200 1220 { … … 1205 1225 "FatalError", FatalException, 1206 1226 "Target volume node list allocation error."); 1207 } 1227 return; 1228 } 1229 targetList->reserve(noContainedDaughters); 1208 1230 for (i=0; i<noContainedDaughters; i++) 1209 1231 { … … 1218 1240 << " - " << maxNo << " inclusive" << G4endl; 1219 1241 #endif 1242 if (minNo > maxNo) // Delete node and list to be replaced 1243 { // and avoid further action ... 1244 delete targetNode; 1245 delete targetList; 1246 return; 1247 } 1248 1220 1249 // Delete node proxies at start of collected sets of nodes/headers 1221 1250 // … … 1246 1275 G4Exception("G4SmartVoxelHeader::RefineNodes()", "FatalError", 1247 1276 FatalException, "Refined VoxelHeader allocation error."); 1277 return; 1248 1278 } 1249 1279 replaceHeader->SetMinEquivalentSliceNo(minNo); 1250 1280 replaceHeader->SetMaxEquivalentSliceNo(maxNo); 1251 1281 replaceHeaderProxy = new G4SmartVoxelProxy(replaceHeader); 1252 if (!replaceHeader )1282 if (!replaceHeaderProxy) 1253 1283 { 1254 1284 G4cerr << "ERROR - G4SmartVoxelHeader::RefineNodes()" << G4endl … … 1256 1286 G4Exception("G4SmartVoxelHeader::RefineNodes()", "FatalError", 1257 1287 FatalException, "Refined VoxelProxy allocation error."); 1288 return; 1258 1289 } 1259 1290 for (replaceNo=minNo; replaceNo<=maxNo; replaceNo++) -
trunk/source/geometry/management/src/G4VSolid.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4VSolid.cc,v 1. 39 2008/09/23 13:07:41gcosmo Exp $28 // GEANT4 tag $Name: ge ant4-09-04-beta-01$27 // $Id: G4VSolid.cc,v 1.40 2010/10/19 15:19:37 gcosmo Exp $ 28 // GEANT4 tag $Name: geommng-V09-03-05 $ 29 29 // 30 30 // class G4VSolid … … 158 158 JustWarning, "Not implemented for this solid ! Returning origin."); 159 159 return G4ThreeVector(0,0,0); 160 } 161 162 ////////////////////////////////////////////////////////////////////////// 163 // 164 // Dummy implementations ... 165 166 const G4VSolid* G4VSolid::GetConstituentSolid(G4int) const 167 { return 0; } 168 169 G4VSolid* G4VSolid::GetConstituentSolid(G4int) 170 { return 0; } 171 172 const G4DisplacedSolid* G4VSolid::GetDisplacedSolidPtr() const 173 { return 0; } 174 175 G4DisplacedSolid* G4VSolid::GetDisplacedSolidPtr() 176 { return 0; } 177 178 //////////////////////////////////////////////////////////////// 179 // 180 // Returns an estimation of the solid volume in internal units. 181 // The number of statistics and error accuracy is fixed. 182 // This method may be overloaded by derived classes to compute the 183 // exact geometrical quantity for solids where this is possible. 184 // or anyway to cache the computed value. 185 // This implementation does NOT cache the computed value. 186 187 G4double G4VSolid::GetCubicVolume() 188 { 189 G4int cubVolStatistics = 1000000; 190 G4double cubVolEpsilon = 0.001; 191 return EstimateCubicVolume(cubVolStatistics, cubVolEpsilon); 192 } 193 194 //////////////////////////////////////////////////////////////// 195 // 196 // Calculate cubic volume based on Inside() method. 197 // Accuracy is limited by the second argument or the statistics 198 // expressed by the first argument. 199 // Implementation is courtesy of Vasiliki Despoina Mitsou, 200 // University of Athens. 201 202 G4double G4VSolid::EstimateCubicVolume(G4int nStat, G4double epsilon) const 203 { 204 G4int iInside=0; 205 G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,volume; 206 G4bool yesno; 207 G4ThreeVector p; 208 EInside in; 209 210 // values needed for CalculateExtent signature 211 212 G4VoxelLimits limit; // Unlimited 213 G4AffineTransform origin; 214 215 // min max extents of pSolid along X,Y,Z 216 217 yesno = this->CalculateExtent(kXAxis,limit,origin,minX,maxX); 218 yesno = this->CalculateExtent(kYAxis,limit,origin,minY,maxY); 219 yesno = this->CalculateExtent(kZAxis,limit,origin,minZ,maxZ); 220 221 // limits 222 223 if(nStat < 100) nStat = 100; 224 if(epsilon > 0.01) epsilon = 0.01; 225 226 for(G4int i = 0; i < nStat; i++ ) 227 { 228 px = minX+(maxX-minX)*G4UniformRand(); 229 py = minY+(maxY-minY)*G4UniformRand(); 230 pz = minZ+(maxZ-minZ)*G4UniformRand(); 231 p = G4ThreeVector(px,py,pz); 232 in = this->Inside(p); 233 if(in != kOutside) iInside++; 234 } 235 volume = (maxX-minX)*(maxY-minY)*(maxZ-minZ)*iInside/nStat; 236 return volume; 237 } 238 239 //////////////////////////////////////////////////////////////// 240 // 241 // Returns an estimation of the solid surface area in internal units. 242 // The number of statistics and error accuracy is fixed. 243 // This method may be overloaded by derived classes to compute the 244 // exact geometrical quantity for solids where this is possible. 245 // or anyway to cache the computed value. 246 // This implementation does NOT cache the computed value. 247 248 G4double G4VSolid::GetSurfaceArea() 249 { 250 G4int stat = 1000000; 251 G4double ell = -1.; 252 return EstimateSurfaceArea(stat,ell); 253 } 254 255 //////////////////////////////////////////////////////////////// 256 // 257 // Estimate surface area based on Inside(), DistanceToIn(), and 258 // DistanceToOut() methods. Accuracy is limited by the statistics 259 // defined by the first argument. Implemented by Mikhail Kosov. 260 261 G4double G4VSolid::EstimateSurfaceArea(G4int nStat, G4double ell) const 262 { 263 G4int inside=0; 264 G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,surf; 265 G4bool yesno; 266 G4ThreeVector p; 267 EInside in; 268 269 // values needed for CalculateExtent signature 270 271 G4VoxelLimits limit; // Unlimited 272 G4AffineTransform origin; 273 274 // min max extents of pSolid along X,Y,Z 275 276 yesno = this->CalculateExtent(kXAxis,limit,origin,minX,maxX); 277 yesno = this->CalculateExtent(kYAxis,limit,origin,minY,maxY); 278 yesno = this->CalculateExtent(kZAxis,limit,origin,minZ,maxZ); 279 280 // limits 281 282 if(nStat < 100) { nStat = 100; } 283 284 G4double dX=maxX-minX; 285 G4double dY=maxY-minY; 286 G4double dZ=maxZ-minZ; 287 if(ell<=0.) // Automatic definition of skin thickness 288 { 289 G4double minval=dX; 290 if(dY<dX) { minval=dY; } 291 if(dZ<minval) { minval=dZ; } 292 ell=.01*minval; 293 } 294 295 G4double dd=2*ell; 296 minX-=ell; minY-=ell; minZ-=ell; dX+=dd; dY+=dd; dZ+=dd; 297 298 for(G4int i = 0; i < nStat; i++ ) 299 { 300 px = minX+dX*G4UniformRand(); 301 py = minY+dY*G4UniformRand(); 302 pz = minZ+dZ*G4UniformRand(); 303 p = G4ThreeVector(px,py,pz); 304 in = this->Inside(p); 305 if(in != kOutside) 306 { 307 if (DistanceToOut(p)<ell) { inside++; } 308 } 309 else if(DistanceToIn(p)<ell) { inside++; } 310 } 311 // @@ The conformal correction can be upgraded 312 surf = dX*dY*dZ*inside/dd/nStat; 313 return surf; 314 } 315 316 /////////////////////////////////////////////////////////////////////////// 317 // 318 // Returns a pointer of a dynamically allocated copy of the solid. 319 // Returns NULL pointer with warning in case the concrete solid does not 320 // implement this method. The caller has responsibility for ownership. 321 // 322 323 G4VSolid* G4VSolid::Clone() const 324 { 325 G4String ErrMessage = "Clone() method not implemented for type: " 326 + GetEntityType() + "! Returning NULL pointer!"; 327 G4Exception("G4VSolid::Clone()", "NotImplemented", 328 JustWarning, ErrMessage); 329 return 0; 160 330 } 161 331 … … 447 617 } 448 618 449 const G4VSolid* G4VSolid::GetConstituentSolid(G4int) const450 { return 0; }451 452 G4VSolid* G4VSolid::GetConstituentSolid(G4int)453 { return 0; }454 455 const G4DisplacedSolid* G4VSolid::GetDisplacedSolidPtr() const456 { return 0; }457 458 G4DisplacedSolid* G4VSolid::GetDisplacedSolidPtr()459 { return 0; }460 461 619 G4VisExtent G4VSolid::GetExtent () const 462 620 { … … 491 649 return 0; 492 650 } 493 494 ////////////////////////////////////////////////////////////////495 //496 // Returns an estimation of the solid volume in internal units.497 // The number of statistics and error accuracy is fixed.498 // This method may be overloaded by derived classes to compute the499 // exact geometrical quantity for solids where this is possible.500 // or anyway to cache the computed value.501 // This implementation does NOT cache the computed value.502 503 G4double G4VSolid::GetCubicVolume()504 {505 G4int cubVolStatistics = 1000000;506 G4double cubVolEpsilon = 0.001;507 return EstimateCubicVolume(cubVolStatistics, cubVolEpsilon);508 }509 510 ////////////////////////////////////////////////////////////////511 //512 // Calculate cubic volume based on Inside() method.513 // Accuracy is limited by the second argument or the statistics514 // expressed by the first argument.515 // Implementation is courtesy of Vasiliki Despoina Mitsou,516 // University of Athens.517 518 G4double G4VSolid::EstimateCubicVolume(G4int nStat, G4double epsilon) const519 {520 G4int iInside=0;521 G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,volume;522 G4bool yesno;523 G4ThreeVector p;524 EInside in;525 526 // values needed for CalculateExtent signature527 528 G4VoxelLimits limit; // Unlimited529 G4AffineTransform origin;530 531 // min max extents of pSolid along X,Y,Z532 533 yesno = this->CalculateExtent(kXAxis,limit,origin,minX,maxX);534 yesno = this->CalculateExtent(kYAxis,limit,origin,minY,maxY);535 yesno = this->CalculateExtent(kZAxis,limit,origin,minZ,maxZ);536 537 // limits538 539 if(nStat < 100) nStat = 100;540 if(epsilon > 0.01) epsilon = 0.01;541 542 for(G4int i = 0; i < nStat; i++ )543 {544 px = minX+(maxX-minX)*G4UniformRand();545 py = minY+(maxY-minY)*G4UniformRand();546 pz = minZ+(maxZ-minZ)*G4UniformRand();547 p = G4ThreeVector(px,py,pz);548 in = this->Inside(p);549 if(in != kOutside) iInside++;550 }551 volume = (maxX-minX)*(maxY-minY)*(maxZ-minZ)*iInside/nStat;552 return volume;553 }554 555 ////////////////////////////////////////////////////////////////556 //557 // Returns an estimation of the solid surface area in internal units.558 // The number of statistics and error accuracy is fixed.559 // This method may be overloaded by derived classes to compute the560 // exact geometrical quantity for solids where this is possible.561 // or anyway to cache the computed value.562 // This implementation does NOT cache the computed value.563 564 G4double G4VSolid::GetSurfaceArea()565 {566 G4int stat = 1000000;567 G4double ell = -1.;568 return EstimateSurfaceArea(stat,ell);569 }570 571 ////////////////////////////////////////////////////////////////572 //573 // Estimate surface area based on Inside(), DistanceToIn(), and574 // DistanceToOut() methods. Accuracy is limited by the statistics575 // defined by the first argument. Implemented by Mikhail Kosov.576 577 G4double G4VSolid::EstimateSurfaceArea(G4int nStat, G4double ell) const578 {579 G4int inside=0;580 G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,surf;581 G4bool yesno;582 G4ThreeVector p;583 EInside in;584 585 // values needed for CalculateExtent signature586 587 G4VoxelLimits limit; // Unlimited588 G4AffineTransform origin;589 590 // min max extents of pSolid along X,Y,Z591 592 yesno = this->CalculateExtent(kXAxis,limit,origin,minX,maxX);593 yesno = this->CalculateExtent(kYAxis,limit,origin,minY,maxY);594 yesno = this->CalculateExtent(kZAxis,limit,origin,minZ,maxZ);595 596 // limits597 598 if(nStat < 100) { nStat = 100; }599 600 G4double dX=maxX-minX;601 G4double dY=maxY-minY;602 G4double dZ=maxZ-minZ;603 if(ell<=0.) // Automatic definition of skin thickness604 {605 G4double minval=dX;606 if(dY<dX) { minval=dY; }607 if(dZ<minval) { minval=dZ; }608 ell=.01*minval;609 }610 611 G4double dd=2*ell;612 minX-=ell; minY-=ell; minZ-=ell; dX+=dd; dY+=dd; dZ+=dd;613 614 for(G4int i = 0; i < nStat; i++ )615 {616 px = minX+dX*G4UniformRand();617 py = minY+dY*G4UniformRand();618 pz = minZ+dZ*G4UniformRand();619 p = G4ThreeVector(px,py,pz);620 in = this->Inside(p);621 if(in != kOutside)622 {623 if (DistanceToOut(p)<ell) { inside++; }624 }625 else if(DistanceToIn(p)<ell) { inside++; }626 }627 // @@ The conformal correction can be upgraded628 surf = dX*dY*dZ*inside/dd/nStat;629 return surf;630 }
Note: See TracChangeset
for help on using the changeset viewer.