Import Geant4 10.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 14:11:04 +02:00
parent c9b32a6c0a
commit d4af681f38
4886 changed files with 420149 additions and 1023309 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4BooleanSolid.cc 83572 2014-09-01 15:23:27Z gcosmo $
// $Id: G4BooleanSolid.cc 92010 2015-08-13 10:07:52Z gcosmo $
//
// Implementation for the abstract base class for solids created by boolean
// operations between other solids
@@ -249,7 +249,7 @@ G4ThreeVector G4BooleanSolid::GetPointOnSurface() const
G4double rand;
G4ThreeVector p;
do
do // Loop checking, 13.08.2015, G.Cosmo
{
rand = G4UniformRand();
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4IntersectionSolid.cc 66356 2012-12-18 09:02:32Z gcosmo $
// $Id: G4IntersectionSolid.cc 92010 2015-08-13 10:07:52Z gcosmo $
//
// Implementation of methods for the class G4IntersectionSolid
//
@@ -296,7 +296,8 @@ G4IntersectionSolid::DistanceToIn( const G4ThreeVector& p,
G4double dB = 0., dB1=0., dB2=0.;
G4bool doA = true, doB = true;
while(true)
static const size_t max_trials=10000;
for (size_t trial=0; trial<max_trials; ++trial)
{
if(doA)
{
@@ -359,6 +360,11 @@ G4IntersectionSolid::DistanceToIn( const G4ThreeVector& p,
}
}
}
#ifdef G4BOOLDEBUG
G4Exception("G4IntersectionSolid::DistanceToIn(p,v)",
"GeomSolids0001", JustWarning,
"Reached maximum number of iterations! Returning zero.");
#endif
return dist ;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4SubtractionSolid.cc 66356 2012-12-18 09:02:32Z gcosmo $
// $Id: G4SubtractionSolid.cc 92010 2015-08-13 10:07:52Z gcosmo $
//
// Implementation of methods for the class G4IntersectionSolid
//
@@ -284,7 +284,7 @@ G4SubtractionSolid::DistanceToIn( const G4ThreeVector& p,
if( fPtrSolidA->Inside(p+dist*v) != kInside )
{
G4int count1=0;
do
do // Loop checking, 13.08.2015, G.Cosmo
{
disTmp = fPtrSolidA->DistanceToIn(p+dist*v,v) ;
@@ -377,7 +377,7 @@ G4SubtractionSolid::DistanceToIn( const G4ThreeVector& p,
return dist;
}
}
}
} // Loop checking, 13.08.2015, G.Cosmo
}
}
@@ -31,6 +31,9 @@
// --------------------------------------------------------------------
#include "G4UMultiUnion.hh"
#if defined(G4GEOM_USE_USOLIDS)
#include "G4Polyhedron.hh"
#include "G4DisplacedSolid.hh"
#include "G4RotationMatrix.hh"
@@ -123,3 +126,5 @@ G4Polyhedron* G4UMultiUnion::CreatePolyhedron() const
if (processor.execute(*top)) { return top; }
else { return 0; }
}
#endif // G4GEOM_USE_USOLIDS
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UnionSolid.cc 66356 2012-12-18 09:02:32Z gcosmo $
// $Id: G4UnionSolid.cc 92010 2015-08-13 10:07:52Z gcosmo $
//
// Implementation of methods for the class G4IntersectionSolid
//
@@ -345,41 +345,39 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p,
if( positionA != kOutside )
{
do
do // Loop checking, 13.08.2015, G.Cosmo
{
disTmp = fPtrSolidA->DistanceToOut(p+dist*v,v,calcNorm,
validNorm,nTmp) ;
validNorm,nTmp);
dist += disTmp ;
if(fPtrSolidB->Inside(p+dist*v) != kOutside)
{
disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v,calcNorm,
validNorm,nTmp) ;
validNorm,nTmp);
dist += disTmp ;
}
}
// while( Inside(p+dist*v) == kInside ) ;
while( fPtrSolidA->Inside(p+dist*v) != kOutside &&
disTmp > 0.5*kCarTolerance ) ;
while( (fPtrSolidA->Inside(p+dist*v) != kOutside)
&& (disTmp > 0.5*kCarTolerance) );
}
else // if( positionB != kOutside )
{
do
do // Loop checking, 13.08.2015, G.Cosmo
{
disTmp = fPtrSolidB->DistanceToOut(p+dist*v,v,calcNorm,
validNorm,nTmp) ;
validNorm,nTmp);
dist += disTmp ;
if(fPtrSolidA->Inside(p+dist*v) != kOutside)
{
disTmp = fPtrSolidA->DistanceToOut(p+dist*v,v,calcNorm,
validNorm,nTmp) ;
validNorm,nTmp);
dist += disTmp ;
}
}
// while( Inside(p+dist*v) == kInside ) ;
while( (fPtrSolidB->Inside(p+dist*v) != kOutside)
&& (disTmp > 0.5*kCarTolerance) ) ;
while( (fPtrSolidB->Inside(p+dist*v) != kOutside)
&& (disTmp > 0.5*kCarTolerance) );
}
}
if( calcNorm )