Import Geant4 10.5.0 source tree
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: CMakeLists.txt 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# $Id: GNUmakefile 103464 2017-04-11 07:24:03Z gcosmo $
|
||||
# ----------------------------------------------------------------
|
||||
# GNUmakefile for geometry/CSG library. Gabriele Cosmo, 16/11/96.
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
$Id: History 110606 2018-06-01 14:48:58Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -20,6 +19,20 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
October 4, 2018 E.Tcherniaev geom-bool-V10-04-08
|
||||
- G4ScaledSolid: return back using EstimateSurfaceArea() from G4VSolid,
|
||||
as it was originally, but now adopting the more precise algorithm
|
||||
implemented in G4VSolid.
|
||||
|
||||
October 4, 2018 E.Tcherniaev geom-bool-V10-04-07
|
||||
- G4ScaledSolid: improved approximated computation for surface area.
|
||||
|
||||
October 3, 2018 E.Tcherniaev geom-bool-V10-04-06, 05
|
||||
- Minor optimisations to G4SubtractionSolid and G4IntersectionSolid
|
||||
for use of early returns.
|
||||
- G4ScaledSolid: implemented approximated computation for surface
|
||||
area and cubic volume.
|
||||
|
||||
June 1, 2018 G. Cosmo geom-bool-V10-04-04
|
||||
- G4MultiUnion: added protection for normal initialisation in
|
||||
DistanceToOutVoxels(). (M.Gheata)
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4BooleanSolid.hh 96960 2016-05-18 14:59:54Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4BooleanSolid
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4BooleanSolid.icc 109382 2018-04-13 13:01:28Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DisplacedSolid.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4DisplacedSolid
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4IntersectionSolid.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4IntersectionSolid
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// class G4ScaledSolid
|
||||
@@ -87,6 +86,9 @@ class G4ScaledSolid : public G4VSolid
|
||||
const G4int n,
|
||||
const G4VPhysicalVolume* pRep );
|
||||
|
||||
G4double GetCubicVolume();
|
||||
G4double GetSurfaceArea();
|
||||
|
||||
void CleanTransformations();
|
||||
|
||||
G4ThreeVector GetPointOnSurface() const;
|
||||
@@ -121,6 +123,8 @@ class G4ScaledSolid : public G4VSolid
|
||||
|
||||
G4VSolid* fPtrSolid;
|
||||
G4ScaleTransform* fScale;
|
||||
G4double fCubicVolume;
|
||||
G4double fSurfaceArea;
|
||||
mutable G4bool fRebuildPolyhedron;
|
||||
mutable G4Polyhedron* fpPolyhedron;
|
||||
} ;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SubtractionSolid.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4SubtractionSolid
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UnionSolid.hh 109479 2018-04-24 14:33:49Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4UnionSolid
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: sources.cmake 109329 2018-04-11 08:40:52Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4BooleanSolid.cc 109382 2018-04-13 13:01:28Z gcosmo $
|
||||
//
|
||||
// Implementation for the abstract base class for solids created by boolean
|
||||
// operations between other solids
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DisplacedSolid.cc 108788 2018-03-07 08:39:32Z gcosmo $
|
||||
//
|
||||
// Implementation for G4DisplacedSolid class for boolean
|
||||
// operations between other solids
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4IntersectionSolid.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -208,29 +207,14 @@ G4IntersectionSolid::CalculateExtent(const EAxis pAxis,
|
||||
|
||||
EInside G4IntersectionSolid::Inside(const G4ThreeVector& p) const
|
||||
{
|
||||
EInside positionA = fPtrSolidA->Inside(p) ;
|
||||
EInside positionA = fPtrSolidA->Inside(p);
|
||||
if(positionA == kOutside) return positionA; //outside A
|
||||
|
||||
if( positionA == kOutside ) return kOutside ;
|
||||
EInside positionB = fPtrSolidB->Inside(p);
|
||||
if(positionA == kInside) return positionB;
|
||||
|
||||
EInside positionB = fPtrSolidB->Inside(p) ;
|
||||
|
||||
if(positionA == kInside && positionB == kInside)
|
||||
{
|
||||
return kInside ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if((positionA == kInside && positionB == kSurface) ||
|
||||
(positionB == kInside && positionA == kSurface) ||
|
||||
(positionA == kSurface && positionB == kSurface) )
|
||||
{
|
||||
return kSurface ;
|
||||
}
|
||||
else
|
||||
{
|
||||
return kOutside ;
|
||||
}
|
||||
}
|
||||
if(positionB == kOutside) return positionB; // outside B
|
||||
return kSurface; // surface A & B
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// Implementation for G4MultiUnion class
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// Implementation for G4ScaledSolid class
|
||||
//
|
||||
@@ -49,9 +48,10 @@
|
||||
// Constructor
|
||||
//
|
||||
G4ScaledSolid::G4ScaledSolid( const G4String& pName,
|
||||
G4VSolid* pSolid ,
|
||||
const G4Scale3D& pScale )
|
||||
G4VSolid* pSolid,
|
||||
const G4Scale3D& pScale )
|
||||
: G4VSolid(pName), fPtrSolid(pSolid),
|
||||
fCubicVolume(-1.), fSurfaceArea(-1.),
|
||||
fRebuildPolyhedron(false), fpPolyhedron(0)
|
||||
{
|
||||
fScale = new G4ScaleTransform(pScale);
|
||||
@@ -60,10 +60,11 @@ G4ScaledSolid::G4ScaledSolid( const G4String& pName,
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Fake default constructor - sets only member data and allocates memory
|
||||
// for usage restricted to object persistency.
|
||||
// for usage restricted to object persistency
|
||||
//
|
||||
G4ScaledSolid::G4ScaledSolid( __void__& a )
|
||||
: G4VSolid(a), fPtrSolid(0), fScale(0),
|
||||
fCubicVolume(-1.), fSurfaceArea(-1.),
|
||||
fRebuildPolyhedron(false), fpPolyhedron(0)
|
||||
{
|
||||
}
|
||||
@@ -72,7 +73,7 @@ G4ScaledSolid::G4ScaledSolid( __void__& a )
|
||||
//
|
||||
// Destructor
|
||||
//
|
||||
G4ScaledSolid::~G4ScaledSolid()
|
||||
G4ScaledSolid::~G4ScaledSolid()
|
||||
{
|
||||
delete fpPolyhedron; fpPolyhedron= 0;
|
||||
delete fScale; fScale= 0;
|
||||
@@ -84,6 +85,7 @@ G4ScaledSolid::~G4ScaledSolid()
|
||||
//
|
||||
G4ScaledSolid::G4ScaledSolid(const G4ScaledSolid& rhs)
|
||||
: G4VSolid (rhs), fPtrSolid(rhs.fPtrSolid),
|
||||
fCubicVolume(rhs.fCubicVolume), fSurfaceArea(rhs.fSurfaceArea),
|
||||
fRebuildPolyhedron(false), fpPolyhedron(0)
|
||||
{
|
||||
fScale = new G4ScaleTransform(*(rhs.fScale));
|
||||
@@ -93,11 +95,11 @@ G4ScaledSolid::G4ScaledSolid(const G4ScaledSolid& rhs)
|
||||
//
|
||||
// Assignment operator
|
||||
//
|
||||
G4ScaledSolid& G4ScaledSolid::operator = (const G4ScaledSolid& rhs)
|
||||
G4ScaledSolid& G4ScaledSolid::operator = (const G4ScaledSolid& rhs)
|
||||
{
|
||||
// Check assignment to self
|
||||
//
|
||||
if (this == &rhs) { return *this; }
|
||||
if (this == &rhs) { return *this; }
|
||||
|
||||
// Copy base class data
|
||||
//
|
||||
@@ -108,20 +110,22 @@ G4ScaledSolid& G4ScaledSolid::operator = (const G4ScaledSolid& rhs)
|
||||
fPtrSolid = rhs.fPtrSolid;
|
||||
delete fScale;
|
||||
fScale = new G4ScaleTransform(*(rhs.fScale));
|
||||
fCubicVolume = rhs.fCubicVolume;
|
||||
fSurfaceArea = rhs.fSurfaceArea;
|
||||
fRebuildPolyhedron = false;
|
||||
delete fpPolyhedron; fpPolyhedron= 0;
|
||||
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Return original solid not scaled
|
||||
//
|
||||
G4VSolid* G4ScaledSolid::GetUnscaledSolid() const
|
||||
{
|
||||
return fPtrSolid;
|
||||
}
|
||||
{
|
||||
return fPtrSolid;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -190,15 +194,15 @@ EInside G4ScaledSolid::Inside(const G4ThreeVector& p) const
|
||||
//
|
||||
// SurfaceNormal
|
||||
//
|
||||
G4ThreeVector
|
||||
G4ScaledSolid::SurfaceNormal( const G4ThreeVector& p ) const
|
||||
G4ThreeVector
|
||||
G4ScaledSolid::SurfaceNormal( const G4ThreeVector& p ) const
|
||||
{
|
||||
// Transform point to unscaled shape frame
|
||||
G4ThreeVector newPoint;
|
||||
fScale->Transform(p, newPoint);
|
||||
|
||||
// Compute normal in unscaled frame
|
||||
G4ThreeVector newNormal = fPtrSolid->SurfaceNormal(newPoint);
|
||||
G4ThreeVector newNormal = fPtrSolid->SurfaceNormal(newPoint);
|
||||
G4ThreeVector normal;
|
||||
|
||||
// Convert normal to scaled frame
|
||||
@@ -210,10 +214,10 @@ G4ScaledSolid::SurfaceNormal( const G4ThreeVector& p ) const
|
||||
//
|
||||
// The same algorithm as in DistanceToIn(p)
|
||||
//
|
||||
G4double
|
||||
G4double
|
||||
G4ScaledSolid::DistanceToIn( const G4ThreeVector& p,
|
||||
const G4ThreeVector& v ) const
|
||||
{
|
||||
const G4ThreeVector& v ) const
|
||||
{
|
||||
// Transform point and direction to unscaled shape frame
|
||||
G4ThreeVector newPoint;
|
||||
fScale->Transform(p, newPoint);
|
||||
@@ -234,14 +238,14 @@ G4ScaledSolid::DistanceToIn( const G4ThreeVector& p,
|
||||
//
|
||||
// Approximate nearest distance from the point p to the solid from outside
|
||||
//
|
||||
G4double
|
||||
G4ScaledSolid::DistanceToIn( const G4ThreeVector& p ) const
|
||||
G4double
|
||||
G4ScaledSolid::DistanceToIn( const G4ThreeVector& p ) const
|
||||
{
|
||||
// Transform point to unscaled shape frame
|
||||
G4ThreeVector newPoint;
|
||||
fScale->Transform(p, newPoint);
|
||||
|
||||
// Compute unscaled safety, then scale it.
|
||||
// Compute unscaled safety, then scale it
|
||||
G4double dist = fPtrSolid->DistanceToIn(newPoint);
|
||||
return fScale->InverseTransformDistance(dist);
|
||||
}
|
||||
@@ -250,12 +254,12 @@ G4ScaledSolid::DistanceToIn( const G4ThreeVector& p ) const
|
||||
//
|
||||
// The same algorithm as DistanceToOut(p)
|
||||
//
|
||||
G4double
|
||||
G4double
|
||||
G4ScaledSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
const G4ThreeVector& v,
|
||||
const G4bool calcNorm,
|
||||
G4bool *validNorm,
|
||||
G4ThreeVector *n ) const
|
||||
G4ThreeVector *n ) const
|
||||
{
|
||||
// Transform point and direction to unscaled shape frame
|
||||
G4ThreeVector newPoint;
|
||||
@@ -267,11 +271,11 @@ G4ScaledSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
newDirection = newDirection/newDirection.mag();
|
||||
|
||||
// Compute distance in unscaled system
|
||||
G4ThreeVector solNorm;
|
||||
G4ThreeVector solNorm;
|
||||
G4double dist = fPtrSolid->DistanceToOut(newPoint,newDirection,
|
||||
calcNorm,validNorm,&solNorm);
|
||||
if(calcNorm)
|
||||
{
|
||||
{
|
||||
G4ThreeVector normal;
|
||||
fScale->TransformNormal(solNorm, normal);
|
||||
*n = normal/normal.mag();
|
||||
@@ -285,14 +289,14 @@ G4ScaledSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
//
|
||||
// Approximate nearest distance from the point p to the solid from inside
|
||||
//
|
||||
G4double
|
||||
G4ScaledSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
G4double
|
||||
G4ScaledSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
{
|
||||
// Transform point to unscaled shape frame
|
||||
G4ThreeVector newPoint;
|
||||
fScale->Transform(p, newPoint);
|
||||
|
||||
// Compute unscaled safety, then scale it.
|
||||
// Compute unscaled safety, then scale it
|
||||
G4double dist = fPtrSolid->DistanceToOut(newPoint);
|
||||
return fScale->InverseTransformDistance(dist);
|
||||
}
|
||||
@@ -301,7 +305,7 @@ G4ScaledSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
//
|
||||
// ComputeDimensions
|
||||
//
|
||||
void
|
||||
void
|
||||
G4ScaledSolid::ComputeDimensions( G4VPVParameterisation*,
|
||||
const G4int,
|
||||
const G4VPhysicalVolume* )
|
||||
@@ -326,7 +330,7 @@ G4ThreeVector G4ScaledSolid::GetPointOnSurface() const
|
||||
//
|
||||
// Return object type name
|
||||
//
|
||||
G4GeometryType G4ScaledSolid::GetEntityType() const
|
||||
G4GeometryType G4ScaledSolid::GetEntityType() const
|
||||
{
|
||||
return G4String("G4ScaledSolid");
|
||||
}
|
||||
@@ -362,6 +366,35 @@ void G4ScaledSolid::SetScaleTransform(const G4Scale3D& scale)
|
||||
fRebuildPolyhedron = true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Get volume of the scaled solid
|
||||
//
|
||||
G4double G4ScaledSolid::GetCubicVolume()
|
||||
{
|
||||
if(fCubicVolume < 0.)
|
||||
{
|
||||
fCubicVolume = fPtrSolid->GetCubicVolume() *
|
||||
fScale->GetScale().x() *
|
||||
fScale->GetScale().y() *
|
||||
fScale->GetScale().z();
|
||||
}
|
||||
return fCubicVolume;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Get estimated surface area of the scaled solid
|
||||
//
|
||||
G4double G4ScaledSolid::GetSurfaceArea()
|
||||
{
|
||||
if(fSurfaceArea < 0.)
|
||||
{
|
||||
fSurfaceArea = G4VSolid::GetSurfaceArea();
|
||||
}
|
||||
return fSurfaceArea;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Stream object contents to an output stream
|
||||
@@ -391,7 +424,7 @@ std::ostream& G4ScaledSolid::StreamInfo(std::ostream& os) const
|
||||
// DescribeYourselfTo
|
||||
//
|
||||
void
|
||||
G4ScaledSolid::DescribeYourselfTo ( G4VGraphicsScene& scene ) const
|
||||
G4ScaledSolid::DescribeYourselfTo ( G4VGraphicsScene& scene ) const
|
||||
{
|
||||
scene.AddSolid (*this);
|
||||
}
|
||||
@@ -401,7 +434,7 @@ G4ScaledSolid::DescribeYourselfTo ( G4VGraphicsScene& scene ) const
|
||||
// CreatePolyhedron
|
||||
//
|
||||
G4Polyhedron*
|
||||
G4ScaledSolid::CreatePolyhedron () const
|
||||
G4ScaledSolid::CreatePolyhedron () const
|
||||
{
|
||||
G4Polyhedron* polyhedron = fPtrSolid->CreatePolyhedron();
|
||||
if (polyhedron)
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SubtractionSolid.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -187,31 +186,20 @@ G4SubtractionSolid::CalculateExtent( const EAxis pAxis,
|
||||
EInside G4SubtractionSolid::Inside( const G4ThreeVector& p ) const
|
||||
{
|
||||
EInside positionA = fPtrSolidA->Inside(p);
|
||||
if (positionA == kOutside) return kOutside;
|
||||
if (positionA == kOutside) return positionA; // outside A
|
||||
|
||||
EInside positionB = fPtrSolidB->Inside(p);
|
||||
|
||||
if(positionA == kInside && positionB == kOutside)
|
||||
{
|
||||
return kInside ;
|
||||
}
|
||||
else
|
||||
{
|
||||
static const G4double rtol
|
||||
= 1000.0*G4GeometryTolerance::GetInstance()->GetRadialTolerance();
|
||||
if(( positionA == kInside && positionB == kSurface) ||
|
||||
( positionB == kOutside && positionA == kSurface) ||
|
||||
( positionA == kSurface && positionB == kSurface &&
|
||||
( fPtrSolidA->SurfaceNormal(p) -
|
||||
fPtrSolidB->SurfaceNormal(p) ).mag2() > rtol ) )
|
||||
{
|
||||
return kSurface;
|
||||
}
|
||||
else
|
||||
{
|
||||
return kOutside;
|
||||
}
|
||||
}
|
||||
if (positionB == kOutside) return positionA;
|
||||
|
||||
if (positionB == kInside) return kOutside;
|
||||
if (positionA == kInside) return kSurface; // surface B
|
||||
|
||||
// Point is on both surfaces
|
||||
//
|
||||
static const G4double rtol = 1000*kCarTolerance;
|
||||
|
||||
return ((fPtrSolidA->SurfaceNormal(p) -
|
||||
fPtrSolidB->SurfaceNormal(p)).mag2() > rtol) ? kSurface : kOutside;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UnionSolid.cc 109479 2018-04-24 14:33:49Z gcosmo $
|
||||
//
|
||||
// Implementation of methods for the class G4UnionSolid
|
||||
//
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: CMakeLists.txt 85530 2014-10-30 16:17:43Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: CMakeLists.txt 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# $Id: GNUmakefile 101121 2016-11-07 09:18:01Z gcosmo $
|
||||
# ----------------------------------------------------------------
|
||||
# GNUmakefile for geometry/CSG library. Gabriele Cosmo, 16/11/96.
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
$Id: History 109684 2018-05-08 10:37:49Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +16,22 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
November 13, 2018 E.Tcherniaev geom-csg-V10-04-07
|
||||
- G4Orb: improved check if point is too far in DistanceToIn(p,v).
|
||||
- G4Torus: added check if point is too far in DistanceToIn(p,v).
|
||||
Addressing problem report #2100.
|
||||
|
||||
November 12, 2018 E.Tcherniaev geom-csg-V10-04-06
|
||||
- G4Cons: fix in GetPointOnSurface() when sampling on inner and outer
|
||||
conical surfaces.
|
||||
|
||||
September 13, 2018 G.Cosmo geom-csg-V10-04-05
|
||||
- G4UTorus: removed leftover use of UVector3 and replaced with U3Vector.
|
||||
|
||||
August 10, 2018 A.Gheata geom-csg-V10-04-04
|
||||
- Make G4UTrd wrapper inheriting from vecgeom::GenericUnplacedTrd,
|
||||
following the latest changes in VecGeom.
|
||||
|
||||
May 7, 2018 G.Cosmo geom-csg-V10-04-03
|
||||
- Make G4UCons wrapper inheriting from vecgeom::GenericUnplacedCone,
|
||||
following the latest changes in VecGeom.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Box.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Box.icc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4CSGSolid.hh 105315 2017-07-20 14:35:13Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Cons.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Cons.icc 100820 2016-11-02 15:18:48Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4CutTubs.hh 105075 2017-07-11 14:22:53Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4CutTubs.icc 105075 2017-07-11 14:22:53Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Orb.hh 105834 2017-08-23 08:14:34Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Orb.icc 105834 2017-08-23 08:14:34Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Para.hh 105075 2017-07-11 14:22:53Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Para.icc 104452 2017-05-31 15:41:24Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Sphere.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Sphere.icc 100820 2016-11-02 15:18:48Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Torus.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Torus.icc 100820 2016-11-02 15:18:48Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Trap.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Trap.icc 103371 2017-04-03 07:36:29Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Trd.hh 104894 2017-06-26 13:30:00Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Trd.icc 104358 2017-05-26 09:43:34Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Tubs.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Tubs.icc 100820 2016-11-02 15:18:48Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Sphere.hh 72929 2013-08-14 08:27:27Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
@@ -50,10 +49,10 @@
|
||||
|
||||
#include "G4Polyhedron.hh"
|
||||
|
||||
class G4UTrd : public G4UAdapter<vecgeom::UnplacedTrd>
|
||||
class G4UTrd : public G4UAdapter<vecgeom::GenericUnplacedTrd>
|
||||
{
|
||||
using Shape_t = vecgeom::UnplacedTrd;
|
||||
using Base_t = G4UAdapter<vecgeom::UnplacedTrd>;
|
||||
using Shape_t = vecgeom::GenericUnplacedTrd;
|
||||
using Base_t = G4UAdapter<vecgeom::GenericUnplacedTrd>;
|
||||
|
||||
public: // with description
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: sources.cmake 109330 2018-04-11 08:42:02Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Box.cc 109330 2018-04-11 08:42:02Z gcosmo $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4CSGSolid.cc 105315 2017-07-20 14:35:13Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Cons.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
//
|
||||
// class G4Cons
|
||||
@@ -2139,37 +2137,50 @@ std::ostream& G4Cons::StreamInfo(std::ostream& os) const
|
||||
// GetPointOnSurface
|
||||
|
||||
G4ThreeVector G4Cons::GetPointOnSurface() const
|
||||
{
|
||||
{
|
||||
// declare working variables
|
||||
//
|
||||
G4double Aone, Atwo, Athree, Afour, Afive, slin, slout, phi;
|
||||
G4double zRand, cosu, sinu, rRand1, rRand2, chose, rone, rtwo, qone, qtwo;
|
||||
rone = (fRmax1-fRmax2)/(2.*fDz);
|
||||
rtwo = (fRmin1-fRmin2)/(2.*fDz);
|
||||
qone=0.; qtwo=0.;
|
||||
if(fRmax1!=fRmax2) { qone = fDz*(fRmax1+fRmax2)/(fRmax1-fRmax2); }
|
||||
if(fRmin1!=fRmin2) { qtwo = fDz*(fRmin1+fRmin2)/(fRmin1-fRmin2); }
|
||||
slin = std::sqrt(sqr(fRmin1-fRmin2)+sqr(2.*fDz));
|
||||
slout = std::sqrt(sqr(fRmax1-fRmax2)+sqr(2.*fDz));
|
||||
Aone = 0.5*fDPhi*(fRmax2 + fRmax1)*slout;
|
||||
Atwo = 0.5*fDPhi*(fRmin2 + fRmin1)*slin;
|
||||
Athree = 0.5*fDPhi*(fRmax1*fRmax1-fRmin1*fRmin1);
|
||||
Afour = 0.5*fDPhi*(fRmax2*fRmax2-fRmin2*fRmin2);
|
||||
Afive = fDz*(fRmax1-fRmin1+fRmax2-fRmin2);
|
||||
|
||||
phi = G4RandFlat::shoot(fSPhi,fSPhi+fDPhi);
|
||||
cosu = std::cos(phi); sinu = std::sin(phi);
|
||||
rRand1 = GetRadiusInRing(fRmin1, fRmax1);
|
||||
rRand2 = GetRadiusInRing(fRmin2, fRmax2);
|
||||
G4double rone = (fRmax1-fRmax2)/(2.*fDz);
|
||||
G4double rtwo = (fRmin1-fRmin2)/(2.*fDz);
|
||||
G4double qone = (fRmax1 == fRmax2) ? 0. : fDz*(fRmax1+fRmax2)/(fRmax1-fRmax2);
|
||||
G4double qtwo = (fRmin1 == fRmin2) ? 0. : fDz*(fRmin1+fRmin2)/(fRmin1-fRmin2);
|
||||
|
||||
G4double slin = std::hypot(fRmin1-fRmin2, 2.*fDz);
|
||||
G4double slout = std::hypot(fRmax1-fRmax2, 2.*fDz);
|
||||
G4double Aone = 0.5*fDPhi*(fRmax2 + fRmax1)*slout; // outer surface
|
||||
G4double Atwo = 0.5*fDPhi*(fRmin2 + fRmin1)*slin; // inner surface
|
||||
G4double Athree = 0.5*fDPhi*(fRmax1*fRmax1-fRmin1*fRmin1); // base at -Dz
|
||||
G4double Afour = 0.5*fDPhi*(fRmax2*fRmax2-fRmin2*fRmin2); // base at +Dz
|
||||
G4double Afive = fDz*(fRmax1-fRmin1+fRmax2-fRmin2); // phi section
|
||||
|
||||
G4double phi = G4RandFlat::shoot(fSPhi,fSPhi+fDPhi);
|
||||
G4double cosu = std::cos(phi);
|
||||
G4double sinu = std::sin(phi);
|
||||
G4double rRand1 = GetRadiusInRing(fRmin1, fRmax1);
|
||||
G4double rRand2 = GetRadiusInRing(fRmin2, fRmax2);
|
||||
|
||||
if ( (fSPhi == 0.) && fPhiFullCone ) { Afive = 0.; }
|
||||
chose = G4RandFlat::shoot(0.,Aone+Atwo+Athree+Afour+2.*Afive);
|
||||
|
||||
if( (chose >= 0.) && (chose < Aone) )
|
||||
G4double chose = G4RandFlat::shoot(0.,Aone+Atwo+Athree+Afour+2.*Afive);
|
||||
|
||||
if( (chose >= 0.) && (chose < Aone) ) // outer surface
|
||||
{
|
||||
if(fRmax1 != fRmax2)
|
||||
{
|
||||
G4double zRand = G4RandFlat::shoot(-1.*fDz,fDz);
|
||||
return G4ThreeVector (rone*cosu*(qone-zRand),
|
||||
rone*sinu*(qone-zRand), zRand);
|
||||
}
|
||||
else
|
||||
{
|
||||
return G4ThreeVector(fRmax1*cosu, fRmax2*sinu,
|
||||
G4RandFlat::shoot(-1.*fDz,fDz));
|
||||
}
|
||||
}
|
||||
else if( (chose >= Aone) && (chose < Aone + Atwo) ) // inner surface
|
||||
{
|
||||
if(fRmin1 != fRmin2)
|
||||
{
|
||||
zRand = G4RandFlat::shoot(-1.*fDz,fDz);
|
||||
G4double zRand = G4RandFlat::shoot(-1.*fDz,fDz);
|
||||
return G4ThreeVector (rtwo*cosu*(qtwo-zRand),
|
||||
rtwo*sinu*(qtwo-zRand), zRand);
|
||||
}
|
||||
@@ -2179,41 +2190,27 @@ G4ThreeVector G4Cons::GetPointOnSurface() const
|
||||
G4RandFlat::shoot(-1.*fDz,fDz));
|
||||
}
|
||||
}
|
||||
else if( (chose >= Aone) && (chose <= Aone + Atwo) )
|
||||
{
|
||||
if(fRmax1 != fRmax2)
|
||||
{
|
||||
zRand = G4RandFlat::shoot(-1.*fDz,fDz);
|
||||
return G4ThreeVector (rone*cosu*(qone-zRand),
|
||||
rone*sinu*(qone-zRand), zRand);
|
||||
}
|
||||
else
|
||||
{
|
||||
return G4ThreeVector(fRmax1*cosu, fRmax2*sinu,
|
||||
G4RandFlat::shoot(-1.*fDz,fDz));
|
||||
}
|
||||
}
|
||||
else if( (chose >= Aone + Atwo) && (chose < Aone + Atwo + Athree) )
|
||||
else if( (chose >= Aone + Atwo) && (chose < Aone + Atwo + Athree) ) // base at -Dz
|
||||
{
|
||||
return G4ThreeVector (rRand1*cosu, rRand1*sinu, -1*fDz);
|
||||
}
|
||||
else if( (chose >= Aone + Atwo + Athree)
|
||||
&& (chose < Aone + Atwo + Athree + Afour) )
|
||||
&& (chose < Aone + Atwo + Athree + Afour) ) // base at +Dz
|
||||
{
|
||||
return G4ThreeVector (rRand2*cosu,rRand2*sinu,fDz);
|
||||
}
|
||||
else if( (chose >= Aone + Atwo + Athree + Afour)
|
||||
else if( (chose >= Aone + Atwo + Athree + Afour) // SPhi section
|
||||
&& (chose < Aone + Atwo + Athree + Afour + Afive) )
|
||||
{
|
||||
zRand = G4RandFlat::shoot(-1.*fDz,fDz);
|
||||
G4double zRand = G4RandFlat::shoot(-1.*fDz,fDz);
|
||||
rRand1 = G4RandFlat::shoot(fRmin2-((zRand-fDz)/(2.*fDz))*(fRmin1-fRmin2),
|
||||
fRmax2-((zRand-fDz)/(2.*fDz))*(fRmax1-fRmax2));
|
||||
fRmax2-((zRand-fDz)/(2.*fDz))*(fRmax1-fRmax2));
|
||||
return G4ThreeVector (rRand1*std::cos(fSPhi),
|
||||
rRand1*std::sin(fSPhi), zRand);
|
||||
}
|
||||
else
|
||||
{
|
||||
zRand = G4RandFlat::shoot(-1.*fDz,fDz);
|
||||
else // SPhi+DPhi section
|
||||
{
|
||||
G4double zRand = G4RandFlat::shoot(-1.*fDz,fDz);
|
||||
rRand1 = G4RandFlat::shoot(fRmin2-((zRand-fDz)/(2.*fDz))*(fRmin1-fRmin2),
|
||||
fRmax2-((zRand-fDz)/(2.*fDz))*(fRmax1-fRmax2));
|
||||
return G4ThreeVector (rRand1*std::cos(fSPhi+fDPhi),
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4CutTubs.cc 105118 2017-07-13 10:43:55Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4CutTubs
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4Orb.cc 105834 2017-08-23 08:14:34Z gcosmo $
|
||||
//
|
||||
// class G4Orb
|
||||
//
|
||||
@@ -309,21 +308,21 @@ G4double G4Orb::DistanceToIn( const G4ThreeVector& p,
|
||||
if (D < 0) return kInfinity; // no intersection
|
||||
|
||||
G4double sqrtD = std::sqrt(D);
|
||||
G4double tmin = -pv - sqrtD;
|
||||
G4double dist = -pv - sqrtD;
|
||||
|
||||
// Avoid rounding errors due to precision issues seen on 64 bits systems.
|
||||
// Split long distances and recompute
|
||||
//
|
||||
G4double Dmax = 32*fRmax;
|
||||
if (tmin > Dmax)
|
||||
if (dist > Dmax)
|
||||
{
|
||||
G4double tadd = tmin - Dmax + fRmax;
|
||||
tadd += DistanceToIn(p + tadd*v, v);
|
||||
return (tadd >= kInfinity) ? kInfinity : tadd;
|
||||
dist = dist - 1.e-8*dist - fRmax; // to stay outside after the move
|
||||
dist += DistanceToIn(p + dist*v, v);
|
||||
return (dist >= kInfinity) ? kInfinity : dist;
|
||||
}
|
||||
|
||||
if (sqrtD*2 <= halfRmaxTol) return kInfinity; // touch
|
||||
return (tmin < halfRmaxTol) ? 0. : tmin;
|
||||
return (dist < halfRmaxTol) ? 0. : dist;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Para.cc 107555 2017-11-22 15:26:59Z gcosmo $
|
||||
//
|
||||
// class G4Para
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Sphere.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
// class G4Sphere
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Torus.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4Torus
|
||||
@@ -948,7 +947,37 @@ G4ThreeVector G4Torus::ApproxSurfaceNormal( const G4ThreeVector& p ) const
|
||||
G4double G4Torus::DistanceToIn( const G4ThreeVector& p,
|
||||
const G4ThreeVector& v ) const
|
||||
{
|
||||
// Get bounding box of full torus
|
||||
//
|
||||
G4double boxDx = fRtor + fRmax;
|
||||
G4double boxDy = boxDx;
|
||||
G4double boxDz = fRmax;
|
||||
G4double boxMax = boxDx;
|
||||
G4double boxMin = boxDz;
|
||||
|
||||
// Check if point is traveling away
|
||||
//
|
||||
G4double distX = std::abs(p.x()) - boxDx;
|
||||
G4double distY = std::abs(p.y()) - boxDy;
|
||||
G4double distZ = std::abs(p.z()) - boxDz;
|
||||
if (distX >= -halfCarTolerance && p.x()*v.x() >= 0) return kInfinity;
|
||||
if (distY >= -halfCarTolerance && p.y()*v.y() >= 0) return kInfinity;
|
||||
if (distZ >= -halfCarTolerance && p.z()*v.z() >= 0) return kInfinity;
|
||||
|
||||
// Calculate safety distance to bounding box
|
||||
// If point is too far, move it closer and calculate distance
|
||||
//
|
||||
G4double Dmax = 32*boxMax;
|
||||
G4double safe = std::max(std::max(distX,distY),distZ);
|
||||
if (safe > Dmax)
|
||||
{
|
||||
G4double dist = safe - 1.e-8*safe - boxMin; // to stay outside after the move
|
||||
dist += DistanceToIn(p + dist*v, v);
|
||||
return (dist >= kInfinity) ? kInfinity : dist;
|
||||
}
|
||||
|
||||
// Find intersection with torus
|
||||
//
|
||||
G4double snxt=kInfinity, sphi=kInfinity; // snxt = default return value
|
||||
|
||||
G4double sd[4] ;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Trap.cc 107555 2017-11-22 15:26:59Z gcosmo $
|
||||
//
|
||||
// class G4Trap
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Trd.cc 107895 2017-12-11 07:33:57Z gcosmo $
|
||||
//
|
||||
//
|
||||
// Implementation for G4Trd class
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Tubs.cc 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4Tubs
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation for G4UBox wrapper class
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation for G4UCons wrapper class
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation for G4UCutTubs wrapper class
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation for G4UOrb wrapper class
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation for G4UPara wrapper class
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation for G4USphere wrapper class
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// Implementation for G4UTorus wrapper class
|
||||
//
|
||||
@@ -258,7 +257,7 @@ void G4UTorus::BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const
|
||||
//
|
||||
if (checkBBox)
|
||||
{
|
||||
UVector3 vmin, vmax;
|
||||
U3Vector vmin, vmax;
|
||||
Base_t::Extent(vmin,vmax);
|
||||
if (std::abs(pMin.x()-vmin.x()) > kCarTolerance ||
|
||||
std::abs(pMin.y()-vmin.y()) > kCarTolerance ||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation for G4UTrap wrapper class
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation for G4UTrd wrapper class
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
//
|
||||
// Implementation for G4UTubs wrapper class
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# $Id: GNUmakefile 85530 2014-10-30 16:17:43Z gcosmo $
|
||||
# --------------------------------------------------------------
|
||||
# Makes libraries for each subdomain:
|
||||
# CSG, specific, Boolean.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
$Id: History 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: CMakeLists.txt 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# $Id: GNUmakefile 101118 2016-11-07 09:10:59Z gcosmo $
|
||||
# ----------------------------------------------------------------------------
|
||||
# GNUmakefile for geometry/solids/specific library. Gabriele Cosmo, 05/04/00.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
$Id: History 110899 2018-06-25 08:39:48Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +16,26 @@ committal in the source repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
20-September-2018 G.Cosmo (geom-specific-V10-04-15)
|
||||
- Make G4UPolycone wrapper inheriting from vecgeom::GenericUnplacedPolycone,
|
||||
following the latest changes in VecGeom.
|
||||
|
||||
13-September-2018 G.Cosmo (geom-specific-V10-04-14)
|
||||
- G4UTessellatedSolid, G4UExtrudedSolid: removed leftover use of
|
||||
UVector3 and replaced with U3Vector.
|
||||
|
||||
23-August-2018 G.Cosmo (geom-specific-V10-04-13)
|
||||
- Enabled VecGeom wrapper for G4Tet.
|
||||
|
||||
10-August-2018 A.Gheata (geom-specific-V10-04-12)
|
||||
- Make G4UHype wrapper inheriting from vecgeom::GenericUnplacedHype,
|
||||
following the latest changes in VecGeom.
|
||||
|
||||
12-July-2018 G.Cosmo (geom-specific-V10-04-11)
|
||||
- Removed G4SolidsWorkspacePool class. Adapted G4SolidsWorkspace to
|
||||
use templated class G4TWorkspacePool.
|
||||
- Coworks with tags in geometry/volumes, run and visualization/management.
|
||||
|
||||
25-Jun-2018 G.Cosmo (geom-specific-V10-04-10)
|
||||
- Use dynamic_cast to attempt fix for spurious compilation warnings on
|
||||
CentOS7/gcc-5.3 on G4UTessellatedSolid wrapper.
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ClippablePolygon.hh 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ClippablePolygon.icc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Ellipsoid.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Ellipsoid.icc 83572 2014-09-01 15:23:27Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EllipticalCone.hh 105324 2017-07-21 07:34:10Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EllipticalCone.icc 105324 2017-07-21 07:34:10Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EllipticalTube.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EllipticalTube.icc 83572 2014-09-01 15:23:27Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EnclosingCylinder.hh 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ExtrudedSolid.hh 108078 2017-12-20 08:15:44Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ExtrudedSolid.icc 107111 2017-11-02 14:33:38Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GenerciPolycone.hh 72077 2013-07-08 12:31:44Z tnikitin $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GenericPolycone.icc 72078 2013-07-08 12:31:53Z tnikitin $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GenericTrap.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GenericTrap.icc 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Hype.hh 108078 2017-12-20 08:15:44Z gcosmo $
|
||||
// $Original: G4Hype.hh,v 1.0 1998/06/09 16:57:50 safai Exp $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Hype.icc 83572 2014-09-01 15:23:27Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 inline definitions file
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4IntersectingCone.hh 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Paraboloid.hh 104316 2017-05-24 13:04:23Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user