Import Geant4 10.7.1 source tree
This commit is contained in:
@@ -19,6 +19,10 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
January 28, 2021 I.Hrivnacova, E.Tcherniaev geom-bool-V10-06-01
|
||||
- Added protection against using invalid normal
|
||||
in G4ScaledSolid::DistanceToOut(p,v, ...)
|
||||
|
||||
December 10, 2019 B.Morgan geom-bool-V10-06-00
|
||||
- Cleanup CMake build, removing obsolete granular library options and
|
||||
explicit include_directories.
|
||||
|
||||
@@ -268,7 +268,7 @@ G4ScaledSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
{
|
||||
G4ThreeVector normal;
|
||||
fScale->TransformNormal(solNorm, normal);
|
||||
*n = normal/normal.mag();
|
||||
*n = normal.unit();
|
||||
}
|
||||
|
||||
// Return distance converted to global
|
||||
|
||||
@@ -16,6 +16,10 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
February 1, 2021 G.Cosmo geom-csg-V10-06-06
|
||||
- G4Trap, G4Para: removed spurious character in printout in StreamInfo().
|
||||
Addressed problem report #2318.
|
||||
|
||||
November 12, 2020 E.Tcherniaev geom-csg-V10-06-05
|
||||
- G4Sphere::InitializeThetaTrigonometry(): tan() replaced with sin()/cos(),
|
||||
it addresses problem report #2289
|
||||
|
||||
@@ -1990,7 +1990,7 @@ G4double G4Cons::DistanceToOut( const G4ThreeVector& p,
|
||||
if( p.x() != 0. || p.y() != 0.)
|
||||
{
|
||||
message << "point phi = " << std::atan2(p.y(),p.x())/degree
|
||||
<< " degree" << G4endl << G4endl ;
|
||||
<< " degrees" << G4endl << G4endl ;
|
||||
}
|
||||
message << "Direction:" << G4endl << G4endl
|
||||
<< "v.x() = " << v.x() << G4endl
|
||||
@@ -2034,7 +2034,7 @@ G4double G4Cons::DistanceToOut(const G4ThreeVector& p) const
|
||||
if( (p.x() != 0.) || (p.x() != 0.) )
|
||||
{
|
||||
G4cout << "point phi = " << std::atan2(p.y(),p.x())/degree
|
||||
<< " degree" << G4endl << G4endl ;
|
||||
<< " degrees" << G4endl << G4endl ;
|
||||
}
|
||||
G4cout.precision(oldprc) ;
|
||||
G4Exception("G4Cons::DistanceToOut(p)", "GeomSolids1002",
|
||||
|
||||
@@ -815,7 +815,6 @@ std::ostream& G4Para::StreamInfo( std::ostream& os ) const
|
||||
G4double theta = std::atan(std::sqrt(fTthetaCphi*fTthetaCphi +
|
||||
fTthetaSphi*fTthetaSphi));
|
||||
G4double phi = std::atan2(fTthetaSphi,fTthetaCphi);
|
||||
G4String signDegree = "\u00B0";
|
||||
|
||||
G4int oldprc = os.precision(16);
|
||||
os << "-----------------------------------------------------------\n"
|
||||
@@ -826,9 +825,9 @@ std::ostream& G4Para::StreamInfo( std::ostream& os ) const
|
||||
<< " half length X: " << fDx/mm << " mm\n"
|
||||
<< " half length Y: " << fDy/mm << " mm\n"
|
||||
<< " half length Z: " << fDz/mm << " mm\n"
|
||||
<< " alpha: " << alpha/degree << signDegree << "\n"
|
||||
<< " theta: " << theta/degree << signDegree << "\n"
|
||||
<< " phi: " << phi/degree << signDegree << "\n"
|
||||
<< " alpha: " << alpha/degree << "degrees\n"
|
||||
<< " theta: " << theta/degree << "degrees\n"
|
||||
<< " phi: " << phi/degree << "degrees\n"
|
||||
<< "-----------------------------------------------------------\n";
|
||||
os.precision(oldprc);
|
||||
|
||||
|
||||
@@ -1129,7 +1129,6 @@ std::ostream& G4Trap::StreamInfo( std::ostream& os ) const
|
||||
+fTthetaSphi*fTthetaSphi));
|
||||
G4double alpha1 = std::atan(fTalpha1);
|
||||
G4double alpha2 = std::atan(fTalpha2);
|
||||
G4String signDegree = "\u00B0";
|
||||
|
||||
G4int oldprc = os.precision(16);
|
||||
os << "-----------------------------------------------------------\n"
|
||||
@@ -1144,10 +1143,10 @@ std::ostream& G4Trap::StreamInfo( std::ostream& os ) const
|
||||
<< " half length Y, face +Dz: " << fDy2/mm << " mm\n"
|
||||
<< " half length X, face +Dz, side -Dy2: " << fDx3/mm << " mm\n"
|
||||
<< " half length X, face +Dz, side +Dy2: " << fDx4/mm << " mm\n"
|
||||
<< " theta: " << theta/degree << signDegree << "\n"
|
||||
<< " phi: " << phi/degree << signDegree << "\n"
|
||||
<< " alpha, face -Dz: " << alpha1/degree << signDegree << "\n"
|
||||
<< " alpha, face +Dz: " << alpha2/degree << signDegree << "\n"
|
||||
<< " theta: " << theta/degree << "degrees\n"
|
||||
<< " phi: " << phi/degree << "degrees\n"
|
||||
<< " alpha, face -Dz: " << alpha1/degree << "degrees\n"
|
||||
<< " alpha, face +Dz: " << alpha2/degree << "degrees\n"
|
||||
<< "-----------------------------------------------------------\n";
|
||||
os.precision(oldprc);
|
||||
|
||||
|
||||
@@ -16,6 +16,11 @@ committal in the source repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
13-January-2021 G.Cosmo (geom-specific-V10-06-11)
|
||||
- Reduce cases of bad speculation in G4PolyhedraSide::Inside() and
|
||||
G4PolyPhiFace::InsideEdges(), based on report in profiling analysis
|
||||
by G.Amadio.
|
||||
|
||||
30-October-2020 E.Tcherniaev (geom-specific-V10-06-10)
|
||||
- G4Polycone: Revised GetPointOnSurface();
|
||||
Added protected auxiliary method SetSurfaceElements();
|
||||
|
||||
@@ -806,11 +806,13 @@ G4bool G4PolyPhiFace::InsideEdges( G4double r, G4double z,
|
||||
G4PolyPhiFaceEdge* edge = edges;
|
||||
do // Loop checking, 13.08.2015, G.Cosmo
|
||||
{
|
||||
G4PolyPhiFaceVertex* testMe;
|
||||
G4PolyPhiFaceVertex* testMe = nullptr;
|
||||
G4PolyPhiFaceVertex* v0_vertex = edge->v0;
|
||||
G4PolyPhiFaceVertex* v1_vertex = edge->v1;
|
||||
//
|
||||
// Get distance perpendicular to the edge
|
||||
//
|
||||
G4double dr = (r-edge->v0->r), dz = (z-edge->v0->z);
|
||||
G4double dr = (r-v0_vertex->r), dz = (z-v0_vertex->z);
|
||||
|
||||
G4double distOut = dr*edge->tz - dz*edge->tr;
|
||||
G4double distance2 = distOut*distOut;
|
||||
@@ -827,17 +829,13 @@ G4bool G4PolyPhiFace::InsideEdges( G4double r, G4double z,
|
||||
if (q < 0)
|
||||
{
|
||||
distance2 += q*q;
|
||||
testMe = edge->v0;
|
||||
testMe = v0_vertex;
|
||||
}
|
||||
else if (q > edge->length)
|
||||
{
|
||||
G4double s2 = q-edge->length;
|
||||
distance2 += s2*s2;
|
||||
testMe = edge->v1;
|
||||
}
|
||||
else
|
||||
{
|
||||
testMe = nullptr;
|
||||
testMe = v1_vertex;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -846,11 +844,11 @@ G4bool G4PolyPhiFace::InsideEdges( G4double r, G4double z,
|
||||
if (distance2 < bestDistance2)
|
||||
{
|
||||
bestDistance2 = distance2;
|
||||
if (testMe)
|
||||
if (testMe != nullptr)
|
||||
{
|
||||
G4double distNorm = dr*testMe->rNorm + dz*testMe->zNorm;
|
||||
answer = (distNorm <= 0);
|
||||
if (base3Dnorm)
|
||||
if (base3Dnorm != nullptr)
|
||||
{
|
||||
*base3Dnorm = testMe;
|
||||
*head3Dnorm = &testMe->norm3D;
|
||||
@@ -859,9 +857,9 @@ G4bool G4PolyPhiFace::InsideEdges( G4double r, G4double z,
|
||||
else
|
||||
{
|
||||
answer = (distOut <= 0);
|
||||
if (base3Dnorm)
|
||||
if (base3Dnorm != nullptr)
|
||||
{
|
||||
*base3Dnorm = edge->v0;
|
||||
*base3Dnorm = v0_vertex;
|
||||
*head3Dnorm = &edge->norm3D;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -616,12 +616,10 @@ EInside G4PolyhedraSide::Inside( const G4ThreeVector& p,
|
||||
//
|
||||
// Use distance along normal to decide return value
|
||||
//
|
||||
if ( (std::fabs(norm) < tolerance) && (*bestDistance < 2.0*tolerance) )
|
||||
if ( (std::fabs(norm) > tolerance) || (*bestDistance > 2.0*tolerance) )
|
||||
return (norm < 0) ? kInside : kOutside;
|
||||
else
|
||||
return kSurface;
|
||||
else if (norm < 0)
|
||||
return kInside;
|
||||
else
|
||||
return kOutside;
|
||||
}
|
||||
|
||||
// Normal
|
||||
|
||||
Reference in New Issue
Block a user