Import Geant4 10.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2016-06-30 14:12:05 +02:00
parent a654a7ab1f
commit 4ec577e5c4
2021 changed files with 100995 additions and 78277 deletions
@@ -1,4 +1,3 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
@@ -24,7 +23,7 @@
// ********************************************************************
//
//
// $Id: G4ReplicaNavigation.cc 89897 2015-05-04 08:19:32Z gcosmo $
// $Id: G4ReplicaNavigation.cc 96458 2016-04-15 10:15:24Z gcosmo $
//
//
// class G4ReplicaNavigation Implementation
@@ -61,6 +60,10 @@ G4ReplicaNavigation::G4ReplicaNavigation()
kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
kRadTolerance = G4GeometryTolerance::GetInstance()->GetRadialTolerance();
kAngTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance();
halfkCarTolerance = kCarTolerance*0.5;
halfkRadTolerance = kRadTolerance*0.5;
halfkAngTolerance = kAngTolerance*0.5;
fMinStep = 0.05*kCarTolerance;
}
// ********************************************************************
@@ -81,7 +84,7 @@ G4ReplicaNavigation::Inside(const G4VPhysicalVolume *pVol,
const G4ThreeVector &localPoint) const
{
EInside in = kOutside;
// Replication data
//
EAxis axis;
@@ -99,11 +102,11 @@ G4ReplicaNavigation::Inside(const G4VPhysicalVolume *pVol,
case kYAxis:
case kZAxis:
coord = std::fabs(localPoint(axis))-width*0.5;
if ( coord<=-kCarTolerance*0.5 )
if ( coord<=-halfkCarTolerance )
{
in = kInside;
}
else if ( coord<=kCarTolerance*0.5 )
else if ( coord<=halfkCarTolerance )
{
in = kSurface;
}
@@ -112,11 +115,11 @@ G4ReplicaNavigation::Inside(const G4VPhysicalVolume *pVol,
if ( localPoint.y()||localPoint.x() )
{
coord = std::fabs(std::atan2(localPoint.y(),localPoint.x()))-width*0.5;
if ( coord<=-kAngTolerance*0.5 )
if ( coord<=-halfkAngTolerance )
{
in = kInside;
}
else if ( coord<=kAngTolerance*0.5 )
else if ( coord<=halfkAngTolerance )
{
in = kSurface;
}
@@ -129,11 +132,11 @@ G4ReplicaNavigation::Inside(const G4VPhysicalVolume *pVol,
case kRho:
rad2 = localPoint.perp2();
rmax = (replicaNo+1)*width+offset;
tolRMax2 = rmax-kRadTolerance*0.5;
tolRMax2 = rmax-halfkRadTolerance;
tolRMax2 *= tolRMax2;
if ( rad2>tolRMax2 )
{
tolRMax2 = rmax+kRadTolerance*0.5;
tolRMax2 = rmax+halfkRadTolerance;
tolRMax2 *= tolRMax2;
if ( rad2<=tolRMax2 )
{
@@ -147,11 +150,11 @@ G4ReplicaNavigation::Inside(const G4VPhysicalVolume *pVol,
if ( replicaNo||offset )
{
rmin = rmax-width;
tolRMin2 = rmin-kRadTolerance*0.5;
tolRMin2 = rmin-halfkRadTolerance;
tolRMin2 *= tolRMin2;
if ( rad2>tolRMin2 )
{
tolRMin2 = rmin+kRadTolerance*0.5;
tolRMin2 = rmin+halfkRadTolerance;
tolRMin2 *= tolRMin2;
if ( rad2>=tolRMin2 )
{
@@ -240,7 +243,7 @@ G4ReplicaNavigation::DistanceToOut(const G4VPhysicalVolume *pVol,
FatalException, "Unknown axis!");
break;
}
return (safety >= kCarTolerance) ? safety : 0;
return (safety >= halfkCarTolerance) ? safety : 0;
}
// ********************************************************************
@@ -365,7 +368,7 @@ G4ReplicaNavigation::DistanceToOutPhi(const G4ThreeVector &localPoint,
//
if ( yi<=0 )
{
Dist = (pDistS<=-kCarTolerance*0.5) ? dist2 : 0;
Dist = (pDistS<=-halfkCarTolerance) ? dist2 : 0;
sidePhi= G4ExitNormal::kSPhi; // tbc
}
else
@@ -393,7 +396,7 @@ G4ReplicaNavigation::DistanceToOutPhi(const G4ThreeVector &localPoint,
{
// Leaving via ending phi
//
Dist = (pDistE<=-kCarTolerance*0.5) ? dist2 : 0;
Dist = (pDistE<=-halfkCarTolerance) ? dist2 : 0;
sidePhi = G4ExitNormal::kEPhi;
}
}
@@ -506,7 +509,7 @@ G4ReplicaNavigation::DistanceToOutRad(const G4ThreeVector &localPoint,
G4double rmin, rmax, t1, t2, t3, deltaR;
G4double b, c, d2, srd;
G4ExitNormal::ESide sideR= G4ExitNormal::kNull;
//
// Radial Intersections
//
@@ -541,9 +544,9 @@ G4ReplicaNavigation::DistanceToOutRad(const G4ThreeVector &localPoint,
deltaR = t3-rmax*rmax;
// NOTE: Should use
// rho-rmax<-kRadTolerance*0.5 - [no sqrts for efficiency]
// rho-rmax<-halfkRadTolerance - [no sqrts for efficiency]
//
if ( deltaR<-kRadTolerance*0.5 )
if ( deltaR<-halfkRadTolerance )
{
b = t2/t1;
c = deltaR/t1;
@@ -573,11 +576,11 @@ G4ReplicaNavigation::DistanceToOutRad(const G4ThreeVector &localPoint,
{
// Leaving via rmin
// NOTE: Should use
// rho-rmin>kRadTolerance*0.5 - [no sqrts for efficiency]
// rho-rmin>halfkRadTolerance - [no sqrts for efficiency]
//
srd = (deltaR>kRadTolerance*0.5) ? -b-std::sqrt(d2) : 0.0;
srd = (deltaR>halfkRadTolerance) ? -b-std::sqrt(d2) : 0.0;
// Is the following more accurate ?
// srd = (deltaR>kRadTolerance*0.5) ? c/( -b - std::sqrt(d2)) : 0.0;
// srd = (deltaR>halfkRadTolerance) ? c/( -b - std::sqrt(d2)) : 0.0;
sideR= G4ExitNormal::kRMin;
}
else
@@ -841,7 +844,8 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
}
if ( sampleSafety < ourStep )
{
G4ThreeVector newLocalDirection = GlobalToLocal.TransformAxis(globalDirection);
G4ThreeVector newLocalDirection =
GlobalToLocal.TransformAxis(globalDirection);
sampleStep = DistanceToOut(history.GetVolume(depth),
history.GetReplicaNo(depth),
repPoint,
@@ -911,16 +915,16 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
}
// Push in principle no longer necessary. G4Navigator now takes care of ...
// Removing this will however generate warnings for pushed particles from
// G4Navigator, particularly for the case of 3D replicas (Cartesian or
// combined Radial/Phi cases).
// Removing this however may cause additional almost-zero steps and generate
// warnings for pushed particles from G4Navigator, particularly for the case
// of 3D replicas (Cartesian or combined Radial/Phi cases).
// Requires further investigation and eventually reimplementation of
// LevelLocate() to take into account point and direction ...
//
if ( ( !ourStep && (sampleSafety<0.5*kCarTolerance) )
if ( ( (ourStep<fMinStep) && (sampleSafety<halfkCarTolerance) )
&& ( repLogical->GetSolid()->Inside(localPoint)==kSurface ) )
{
ourStep += kCarTolerance;
ourStep = 100*kCarTolerance;
}
if ( motherSafety<ourSafety )
@@ -972,7 +976,9 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
if ( motherDeterminedStep )
{
exitNormalVector= motherNormalStc.exitNormal;
}else{
}
else
{
G4ThreeVector exitNormalGlobal= exitNormalStc.exitNormal;
exitNormalVector= globalToLocalTop.TransformAxis(exitNormalGlobal);
// exitNormalVector= globalToLocal2nd.TransformAxis(exitNormalGlobal);
@@ -1059,7 +1065,7 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
entering = true;
exiting = false;
*pBlockedPhysical = samplePhysical;
blockedReplicaNo = -1;
blockedReplicaNo = sampleNo;
#ifdef DAUGHTER_NORMAL_ALSO
// This norm can be calculated later, if needed daughter is available