Import Geant4 10.5.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2018-06-29 10:58:11 +02:00
parent fe81a77428
commit 6aa23be517
1581 changed files with 124288 additions and 83758 deletions
+31 -5
View File
@@ -1,4 +1,4 @@
$Id: History 110067 2018-05-15 09:20:12Z gcosmo $
$Id: History 110832 2018-06-15 15:00:33Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,19 +17,44 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 4, 2018 - J.Apostolakis (geomnav-V10-03-11)
June 15, 2018 - G.Cosmo (geomnav-V10-04-11)
-----------------------
- Fixed Coverity defect in diagnostic report in G4MultiLevelLocator.
June 13, 2018 - G.Cosmo (geomnav-V10-04-10, 09)
-----------------------
- Use G4Exception instead of streaming to cerr in various classes.
June 8, 2018 - J.Apostolakis (geomnav-V10-04-08, 07)
----------------------------
- G4PropagatorInField: fix for case of finishing integration in last iteration
(so a looping particle will not be signalled incorrectly in that case.)
Improved reporting of looping particle, adding info on density and
fraction (%) of proposed step that was completed, and momentum (-08).
May 11, 2018 - E.Tcherniaev (geomnav-V10-04-06)
---------------------------
- G4Navigator::ComputeLocalAxis(): removed unnecessary check for IsRotated().
May 9, 2018 - E.Tcherniaev (geomnav-V10-04-05)
--------------------------
- Replaced use of Inverse() from G4AffineTransform with new dedicated
methods, to avoid creation of temporaries in G4Navigator, G4RegularNavigation
and G4ReplicaNavigation.
May 4, 2018 - J.Apostolakis (geomnav-V10-04-04)
---------------------------
- G4Navigator::GetLocalExitNormal(): fix for normal calculated at the endpoint
of current step, on a 'candidate' next volume. Adds missing transformation to
the frame of the current volume.
Addresses problem report #2054.
April 17, 2018 - J.Apostolakis
April 17, 2018 - J.Apostolakis (geomnav-V10-04-02,03)
------------------------------
- G4Navigator::Set/RestoreSavedState(): fix for save/restore of ReplicaNumber
(Thanks to Helmut Burkhardt).
April 11, 2018 - J.Apostolakis
April 11, 2018 - J.Apostolakis (geomnav-V10-04-01)
------------------------------
- G4PathFinder::DoNextLinearStep():
* Use 'Relocated Point' flag to signal move from call to ReLocate, and
@@ -38,12 +63,13 @@ April 11, 2018 - J.Apostolakis
value, which can be kInfinity when step is not limited by Navigators
(it was meant to cope with zero proposed step in RE03, however it
caused problems in multiple cases when PathFinder was used).
- G4SafetyHelper:
* Do not limit memorisation of safety in case of parallel
geometries (when a length is not passed to safety method).
* Fix to including full message in Exception.
February 26, 2018 - J.Apostolakis (geomnav-V10-03-10)
February 26, 2018 - J.Apostolakis (geomnav-V10-04-00)
---------------------------------
- Fix for momentum value in G4PathFinder::SetChargeMomentumMass
Was passing magnitude square, instead of magnitude.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Navigator.icc 73164 2013-08-21 08:55:28Z gcosmo $
// $Id: G4Navigator.icc 110048 2018-05-15 06:28:03Z gcosmo $
//
//
// class G4Navigator Inline implementation
@@ -52,8 +52,7 @@ G4ThreeVector G4Navigator::GetCurrentLocalCoordinate() const
inline
G4ThreeVector G4Navigator::ComputeLocalAxis(const G4ThreeVector& pVec) const
{
return (fHistory.GetTopTransform().IsRotated())
? fHistory.GetTopTransform().TransformAxis(pVec) : pVec ;
return fHistory.GetTopTransform().TransformAxis(pVec);
}
// ********************************************************************
@@ -66,7 +65,7 @@ inline
G4ThreeVector
G4Navigator::ComputeLocalPoint(const G4ThreeVector& pGlobalPoint) const
{
return ( fHistory.GetTopTransform().TransformPoint(pGlobalPoint) ) ;
return fHistory.GetTopTransform().TransformPoint(pGlobalPoint);
}
// ********************************************************************
@@ -193,9 +192,7 @@ const G4AffineTransform& G4Navigator::GetGlobalToLocalTransform() const
inline
const G4AffineTransform G4Navigator::GetLocalToGlobalTransform() const
{
G4AffineTransform tempTransform;
tempTransform = fHistory.GetTopTransform().Inverse();
return tempTransform;
return fHistory.GetTopTransform().Inverse();
}
// ********************************************************************
@@ -207,8 +204,7 @@ const G4AffineTransform G4Navigator::GetLocalToGlobalTransform() const
inline
G4ThreeVector G4Navigator::NetTranslation() const
{
G4AffineTransform tf(fHistory.GetTopTransform().Inverse());
return tf.NetTranslation();
return fHistory.GetTopTransform().InverseNetTranslation();
}
// ********************************************************************
@@ -220,8 +216,7 @@ G4ThreeVector G4Navigator::NetTranslation() const
inline
G4RotationMatrix G4Navigator::NetRotation() const
{
G4AffineTransform tf(fHistory.GetTopTransform().Inverse());
return tf.NetRotation();
return fHistory.GetTopTransform().InverseNetRotation();
}
// ********************************************************************
@@ -233,10 +228,10 @@ G4RotationMatrix G4Navigator::NetRotation() const
inline
G4GRSVolume* G4Navigator::CreateGRSVolume() const
{
G4AffineTransform tf(fHistory.GetTopTransform().Inverse());
const G4AffineTransform& tf = fHistory.GetTopTransform();
return new G4GRSVolume(fHistory.GetTopVolume(),
tf.NetRotation(),
tf.NetTranslation());
tf.InverseNetRotation(),
tf.InverseNetTranslation());
}
// ********************************************************************
@@ -248,10 +243,10 @@ G4GRSVolume* G4Navigator::CreateGRSVolume() const
inline
G4GRSSolid* G4Navigator::CreateGRSSolid() const
{
G4AffineTransform tf(fHistory.GetTopTransform().Inverse());
const G4AffineTransform& tf = fHistory.GetTopTransform();
return new G4GRSSolid(fHistory.GetTopVolume()->GetLogicalVolume()->GetSolid(),
tf.NetRotation(),
tf.NetTranslation());
tf.InverseNetRotation(),
tf.InverseNetTranslation());
}
// ********************************************************************
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4PathFinder.hh 110067 2018-05-15 09:20:12Z gcosmo $
// $Id: G4PathFinder.hh 109355 2018-04-12 08:08:58Z gcosmo $
//
// class G4PathFinder
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PropagatorInField.hh 90009 2015-05-08 07:42:39Z gcosmo $
// $Id: G4PropagatorInField.hh 110728 2018-06-11 06:12:39Z gcosmo $
//
//
// Class G4PropagatorInField
@@ -199,9 +199,13 @@ class G4PropagatorInField
G4double stepTrial,
const G4FieldTrack& aFieldTrack);
void ReportLoopingParticle( G4int count, double StepTaken, G4VPhysicalVolume* pPhysVol);
void ReportStuckParticle( G4int noZeroSteps, G4double proposedStep, G4double lastTriedStep,
G4VPhysicalVolume* physVol );
void ReportLoopingParticle( G4int count, G4double StepTaken,
G4double stepRequest, const char* methodName,
G4ThreeVector momentumVec,
G4VPhysicalVolume* physVol);
void ReportStuckParticle( G4int noZeroSteps, G4double proposedStep,
G4double lastTriedStep, G4VPhysicalVolume* physVol);
private:
// ----------------------------------------------------------------------
// DATA Members
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ReplicaNavigation.icc 66356 2012-12-18 09:02:32Z gcosmo $
// $Id: G4ReplicaNavigation.icc 110766 2018-06-13 07:34:39Z gcosmo $
//
//
// class G4ReplicaNavigation Inline implementation
@@ -93,11 +93,14 @@ G4ReplicaNavigation::VoxelLocate( const G4SmartVoxelHeader* pHead,
{
#ifdef G4DEBUG_NAVIGATION
G4cerr << " WARNING: assert in G4ReplicaNavigation::VoxelLocate "
<< " has failed : " << G4endl
<< " (targetNodeNo>=0&&targetNodeNo<targetHeaderNoSlices) "
<< " targetNodeNo= " << targetNodeNo
<< " Number of Slices = " << targetHeaderNoSlices << G4endl;
std::ostringstream message;
message << "Voxel location failed:" << G4endl
<< " (targetNodeNo>=0&&targetNodeNo<targetHeaderNoSlices) "
<< G4endl
<< " - targetNodeNo= " << targetNodeNo << G4endl
<< " - Number of Slices = " << targetHeaderNoSlices;
G4Exception("G4ReplicaNavigation::VoxelLocate()",
"GeomNav1002", JustWarning, message);
#endif
// In the case of rotational symmetry and an extent over the
// whole 360 degrees, the above is not true and you can go from
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MultiLevelLocator.cc 107606 2017-11-27 09:39:04Z gcosmo $
// $Id: G4MultiLevelLocator.cc 110832 2018-06-15 15:00:33Z gcosmo $
//
// Class G4MultiLevelLocator implementation
//
@@ -694,7 +694,7 @@ G4bool G4MultiLevelLocator::EstimateIntersectionPoint(
ReportReversedPoints(errmsg,
CurveStartPointVelocity, CurveEndPointVelocity,
NewSafety, fiEpsilonStep,
CurrentA_PointVelocity, CurrentA_PointVelocity,
CurrentA_PointVelocity, CurrentB_PointVelocity,
SubStart_PointVelocity, CurrentE_Point,
ApproxIntersecPointV, substep_no, substep_no_p, depth);
G4Exception(MethodName, "GeomNav0003", FatalException, errmsg);
+8 -14
View File
@@ -1149,10 +1149,8 @@ G4double G4Navigator::ComputeStep( const G4ThreeVector &pGlobalpoint,
G4int depth= fHistory.GetDepth();
if( depth > 0 )
{
G4AffineTransform GrandMotherToGlobalTransf =
fHistory.GetTransform(depth-1).Inverse();
fExitNormalGlobalFrame =
GrandMotherToGlobalTransf.TransformAxis( fGrandMotherExitNormal );
fHistory.GetTransform(depth-1).InverseTransformAxis( fGrandMotherExitNormal );
}
else
{
@@ -1362,7 +1360,7 @@ G4ThreeVector G4Navigator::GetLocalExitNormal( G4bool* valid )
GetMotherToDaughterTransform( fBlockedPhysicalVolume,
fBlockedReplicaNo,
VolumeType(fBlockedPhysicalVolume) );
G4ThreeVector daughterPointOwnLocal=
G4ThreeVector daughterPointOwnLocal=
MotherToDaughterTransform.TransformPoint( fLastStepEndPointLocal );
// OK if it is a parameterised volume
@@ -1396,7 +1394,7 @@ G4ThreeVector G4Navigator::GetLocalExitNormal( G4bool* valid )
//
// First flip ( ExitNormal = -nextSolidExitNormal; )
// and then rotate the the normal to the frame of the mother (current volume)
ExitNormal = MotherToDaughterTransform.Inverse().TransformAxis( -nextSolidExitNormal );
ExitNormal = MotherToDaughterTransform.InverseTransformAxis( -nextSolidExitNormal );
fCalculatedExitNormal= true;
}
else
@@ -1647,9 +1645,7 @@ G4Navigator::GetGlobalExitNormal(const G4ThreeVector& IntersectPointGlobal,
localNormal = GetLocalExitNormalAndCheck(IntersectPointGlobal,
&validNormal);
*pNormalCalculated = fCalculatedExitNormal;
G4AffineTransform localToGlobal = GetLocalToGlobalTransform();
globalNormal = localToGlobal.TransformAxis( localNormal );
globalNormal = fHistory.GetTopTransform().InverseTransformAxis( localNormal );
}
}
else
@@ -1706,8 +1702,7 @@ G4Navigator::GetGlobalExitNormal(const G4ThreeVector& IntersectPointGlobal,
"Value obtained from new local *solid* is incorrect.");
localNormal = localNormal.unit(); // Should we correct it ??
}
G4AffineTransform localToGlobal = GetLocalToGlobalTransform();
globalNormal = localToGlobal.TransformAxis( localNormal );
globalNormal = fHistory.GetTopTransform().InverseTransformAxis( localNormal );
}
#ifdef G4DEBUG_NAVIGATION
@@ -1717,8 +1712,7 @@ G4Navigator::GetGlobalExitNormal(const G4ThreeVector& IntersectPointGlobal,
localNormal= GetLocalExitNormalAndCheck(IntersectPointGlobal, &validNormal);
G4AffineTransform localToGlobal = GetLocalToGlobalTransform();
globalNormAgn = localToGlobal.TransformAxis( localNormal );
globalNormAgn = fHistory.GetTopTransform().InverseTransformAxis( localNormal );
// Check the value computed against fExitNormalGlobalFrame
G4ThreeVector diffNorm = globalNormAgn - fExitNormalGlobalFrame;
@@ -2163,8 +2157,8 @@ void G4Navigator::ComputeStepLog(const G4ThreeVector& pGlobalpoint,
const G4double fAccuracyForWarning = kCarTolerance,
fAccuracyForException = 1000*kCarTolerance;
G4ThreeVector OriginalGlobalpoint = fHistory.GetTopTransform().Inverse().
TransformPoint(fLastLocatedPointLocal);
G4ThreeVector OriginalGlobalpoint = fHistory.GetTopTransform().
InverseTransformPoint(fLastLocatedPointLocal);
G4double shiftOriginSafSq = (fPreviousSftOrigin-pGlobalpoint).mag2();
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PathFinder.cc 110067 2018-05-15 09:20:12Z gcosmo $
// $Id: G4PathFinder.cc 109355 2018-04-12 08:08:58Z gcosmo $
// GEANT4 tag $ Name: $
//
// class G4PathFinder Implementation
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PhantomParameterisation.cc 101807 2016-11-30 13:42:28Z gunter $
// $Id: G4PhantomParameterisation.cc 110766 2018-06-13 07:34:39Z gcosmo $
// GEANT4 tag $ Name:$
//
// class G4PhantomParameterisation implementation
@@ -240,13 +240,13 @@ GetReplicaNo( const G4ThreeVector& localPoint, const G4ThreeVector& localDir )
message << "Point outside voxels!" << G4endl
<< " localPoint - " << localPoint
<< " - is outside container solid: "
<< fContainerSolid->GetName() << G4endl;
<< fContainerSolid->GetName() << G4endl
<< "DIFFERENCE WITH PHANTOM WALLS X: "
<< std::fabs(localPoint.x()) - fContainerWallX
<< " Y: " << std::fabs(localPoint.y()) - fContainerWallY
<< " Z: " << std::fabs(localPoint.z()) - fContainerWallZ;
G4Exception("G4PhantomParameterisation::GetReplicaNo()", "GeomNav0003",
JustWarning, message);
G4cerr << " DIFFERENCE WITH PHANTOM WALLS X: "
<< std::fabs(localPoint.x()) - fContainerWallX
<< " Y: " << std::fabs(localPoint.y()) - fContainerWallY
<< " Z: " << std::fabs(localPoint.z()) - fContainerWallZ << G4endl;
}
// Check the voxel numbers corresponding to localPoint
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PropagatorInField.cc 105904 2017-08-28 07:36:13Z gcosmo $
// $Id: G4PropagatorInField.cc 110728 2018-06-11 06:12:39Z gcosmo $
// GEANT4 tag $ Name: $
//
// class G4PropagatorInField Implementation
@@ -100,7 +100,7 @@ G4PropagatorInField::G4PropagatorInField( G4Navigator *theNavigator,
G4cout << " PiF: Value of kCarTolerance = "
<< kCarTolerance / millimeter
<< " mm. " << G4endl;
fVerboseLevel = 3;
fVerboseLevel = 2;
fVerbTracePiF = true;
#endif
@@ -151,6 +151,7 @@ G4PropagatorInField::ComputeStep(
// If CurrentProposedStepLength is too small for finding Chords
// then return with no action (for now - TODO: some action)
//
const char* methodName="G4PropagatorInField::ComputeStep";
if(CurrentProposedStepLength<kCarTolerance)
{
return kInfinity;
@@ -169,7 +170,7 @@ G4PropagatorInField::ComputeStep(
if( fVerboseLevel > 2 )
{
G4cout << "G4PropagatorInField::ComputeStep() called" << G4endl;
G4cout << methodName << " called" << G4endl;
G4cout << " Starting FT: " << pFieldTrack;
G4cout << " Requested length = " << CurrentProposedStepLength << G4endl;
G4cout << " PhysVol = ";
@@ -270,13 +271,21 @@ G4PropagatorInField::ComputeStep(
stepTrial *= decreaseFactor;
#ifdef G4DEBUG_FIELD
G4cerr << " G4PropagatorInField::ComputeStep(): " << G4endl
<< " Decreasing step - in volume " << pPhysVol;
if( pPhysVol )
G4cerr << " with name " << pPhysVol->GetName();
G4cerr << G4endl;
PrintStepLengthDiagnostic(CurrentProposedStepLength, decreaseFactor,
stepTrial, pFieldTrack);
if( fVerboseLevel > 2
|| (fNoZeroStep >= fSevereActionThreshold_NoZeroSteps)
)
{
G4cerr << " " << methodName
<< " Decreasing step after " << fNoZeroStep << " zero steps "
<< " - in volume " << pPhysVol;
if( pPhysVol )
G4cerr << " with name " << pPhysVol->GetName();
else
G4cerr << " i.e. *unknown* volume.";
G4cerr << G4endl;
PrintStepLengthDiagnostic(CurrentProposedStepLength, decreaseFactor,
stepTrial, pFieldTrack);
}
#endif
if( stepTrial == 0.0 ) // Change to make it < 0.1 * kCarTolerance ??
{
@@ -287,8 +296,7 @@ G4PropagatorInField::ComputeStep(
<< " Attempting a zero step = " << stepTrial << G4endl
<< " while attempting to progress after " << fNoZeroStep
<< " trial steps. Will abandon step.";
G4Exception("G4PropagatorInField::ComputeStep()", "GeomNav1002",
JustWarning, message);
G4Exception(methodName, "GeomNav1002", JustWarning, message);
fParticleIsLooping= true;
return 0; // = stepTrial;
}
@@ -408,6 +416,11 @@ G4PropagatorInField::ComputeStep(
#ifdef G4DEBUG_FIELD
if( fNoZeroStep > fActionThreshold_NoZeroSteps )
{
if( fNoZeroStep > fSevereActionThreshold_NoZeroSteps )
G4cout << " Above 'Severe Action' threshold -- for Zero steps. ";
else
G4cout << " Above 'action' threshold -- for Zero steps. ";
G4cout << " Number of zero steps = " << fNoZeroStep << G4endl;
printStatus( SubStepStartState, // or OriginalState,
CurrentState, CurrentProposedStepLength,
NewSafety, do_loop_count, pPhysVol );
@@ -418,6 +431,8 @@ G4PropagatorInField::ComputeStep(
{
G4cout << " G4PropagatorInField::ComputeStep(): " << G4endl
<< " Difficult track - taking many sub steps." << G4endl;
printStatus( SubStepStartState, SubStepStartState, CurrentProposedStepLength,
NewSafety, 0, pPhysVol );
}
printStatus( SubStepStartState, CurrentState, CurrentProposedStepLength,
NewSafety, do_loop_count, pPhysVol );
@@ -431,13 +446,17 @@ G4PropagatorInField::ComputeStep(
&& (StepTaken + kCarTolerance < CurrentProposedStepLength)
&& ( do_loop_count < fMax_loop_count ) );
if( do_loop_count >= fMax_loop_count )
if( do_loop_count >= fMax_loop_count
&& (StepTaken + kCarTolerance < CurrentProposedStepLength)
)
{
fParticleIsLooping = true;
}
if ( fParticleIsLooping && (fVerboseLevel > 0) )
if ( fParticleIsLooping ) // && (fVerboseLevel > 0) )
{
ReportLoopingParticle( do_loop_count, StepTaken, pPhysVol );
ReportLoopingParticle( do_loop_count, StepTaken,
CurrentProposedStepLength, methodName,
CurrentState.GetMomentum(), pPhysVol );
}
if( !intersects )
@@ -475,8 +494,7 @@ G4PropagatorInField::ComputeStep(
- End_PointAndTangent.GetCurveLength() << G4endl
<< " Original state = " << OriginalState << G4endl
<< " Proposed state = " << End_PointAndTangent;
G4Exception("G4PropagatorInField::ComputeStep()",
"GeomNav0003", FatalException, message);
G4Exception(methodName, "GeomNav0003", FatalException, message);
}
#endif
@@ -533,9 +551,9 @@ G4PropagatorInField::printStatus( const G4FieldTrack& StartFT,
if( ((stepNo == 0) && (verboseLevel <3)) || (verboseLevel >= 3) )
{
oldprec = G4cout.precision(4);
G4cout << std::setw( 6) << " "
<< std::setw( 25) << " Current Position and Direction" << " "
<< G4endl;
// G4cout << std::setw( 6) << " "
// << std::setw( 25) << " Current Position and Direction" << " "
// << G4endl;
G4cout << std::setw( 5) << "Step#"
<< std::setw(10) << " s " << " "
<< std::setw(10) << "X(mm)" << " "
@@ -733,24 +751,47 @@ G4int G4PropagatorInField::SetVerboseLevel( G4int level )
return oldval;
}
#include "G4Material.hh"
void G4PropagatorInField::ReportLoopingParticle( G4int count,
G4double StepTaken,
G4double StepRequested,
const char* methodName,
G4ThreeVector momentumVec,
G4VPhysicalVolume* pPhysVol)
{
std::ostringstream message;
message << " Killing looping particle "
G4double fraction = StepTaken / StepRequested;
message << " Unfinished integration of track (likely looping particle) "
<< " of momentum " << momentumVec << " ( magnitude = " << momentumVec.mag() << " ) "
<< G4endl
<< " after " << count << " field substeps "
<< " totaling " << StepTaken / mm << " mm " ;
<< " totaling " << std::setprecision(12) << StepTaken / mm << " mm "
<< " out of requested step " << std::setprecision(12) << StepRequested / mm << " mm ";
message << " a fraction of ";
int prec= 4;
if( fraction > 0.99 )
prec= 7;
else
if (fraction > 0.97 )
prec= 5;
message << std::setprecision(prec)
<< 100. * StepTaken / StepRequested << " % " << G4endl ;
if( pPhysVol )
{
message << " in *volume* " << pPhysVol->GetName() ;
message << " in volume " << pPhysVol->GetName() ;
auto material= pPhysVol->GetLogicalVolume()->GetMaterial();
if( material )
message << " with material " << material->GetName()
<< " ( density = "
<< material->GetDensity() / ( gram / ( centimeter * centimeter * centimeter ) )
<< " g / cm^3 ) ";
}
else
{
message << " in unknown or null volume. " ;
message << " in unknown (null) volume. " ;
}
G4Exception("G4PropagatorInField::ComputeStep()", "GeomNav1002",
JustWarning, message);
G4Exception(methodName, "GeomNav1002", JustWarning, message);
}
void G4PropagatorInField::ReportStuckParticle( G4int noZeroSteps,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RegularNavigation.cc 66356 2012-12-18 09:02:32Z gcosmo $
// $Id: G4RegularNavigation.cc 109826 2018-05-09 10:55:30Z gcosmo $
// GEANT4 tag $ Name:$
//
// class G4RegularNavigation implementation
@@ -77,9 +77,9 @@ G4double G4RegularNavigation::
// problems would make this method to be called
G4ThreeVector globalPoint =
history.GetTopTransform().Inverse().TransformPoint(localPoint);
history.GetTopTransform().InverseTransformPoint(localPoint);
G4ThreeVector globalDirection =
history.GetTopTransform().Inverse().TransformAxis(localDirection);
history.GetTopTransform().InverseTransformAxis(localDirection);
G4ThreeVector localPoint2 = localPoint; // take away constantness
@@ -161,11 +161,11 @@ G4double G4RegularNavigation::ComputeStepSkippingEqualMaterials(
// param container volume
//
G4int ide = history.GetDepth();
G4ThreeVector containerPoint = history.GetTransform(ide).Inverse().TransformPoint(localPoint);
G4ThreeVector containerPoint = history.GetTransform(ide).InverseTransformPoint(localPoint);
// Point in global frame
//
containerPoint = history.GetTransform(ide).Inverse().TransformPoint(localPoint);
containerPoint = history.GetTransform(ide).InverseTransformPoint(localPoint);
// Point in voxel parent volume frame
//
@@ -23,7 +23,7 @@
// ********************************************************************
//
//
// $Id: G4ReplicaNavigation.cc 100372 2016-10-19 10:37:52Z gcosmo $
// $Id: G4ReplicaNavigation.cc 109826 2018-05-09 10:55:30Z gcosmo $
//
//
// class G4ReplicaNavigation Implementation
@@ -826,9 +826,9 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
exiting = true;
validExitNormal = normalOutStc.validConvex; // false; -> Old,Conservative
exitNormalStc= normalOutStc;
exitNormalStc.exitNormal= history.GetTopTransform().Inverse().
TransformAxis(normalOutStc.exitNormal);
exitNormalStc = normalOutStc;
exitNormalStc.exitNormal =
history.GetTopTransform().InverseTransformAxis(normalOutStc.exitNormal);
calculatedExitNormal= true;
}
}
@@ -865,9 +865,9 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
// As step is limited by this level, must set Exit Normal
//
G4ThreeVector localExitNorm= normalOutStc.exitNormal;
G4ThreeVector globalExitNorm=
GlobalToLocal.Inverse().TransformAxis(localExitNorm);
G4ThreeVector localExitNorm = normalOutStc.exitNormal;
G4ThreeVector globalExitNorm =
GlobalToLocal.InverseTransformAxis(localExitNorm);
exitNormalStc= normalOutStc; // Normal, convex, calculated, side
exitNormalStc.exitNormal= globalExitNorm;
@@ -914,8 +914,8 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
}
if( motherDeterminedStep)
{
G4ThreeVector globalExitNormalTop=
globalToLocalTop.Inverse().TransformAxis(exitVectorMother);
G4ThreeVector globalExitNormalTop =
globalToLocalTop.InverseTransformAxis(exitVectorMother);
exitNormalStc= motherNormalStc;
exitNormalStc.exitNormal= globalExitNormalTop;
@@ -1077,7 +1077,7 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
#ifdef DAUGHTER_NORMAL_ALSO
// This norm can be calculated later, if needed daughter is available
localExitNorm = sampleSolid->SurfaceNormal(samplePoint);
daughtNormRepCrd = sampleTf.Inverse().TransformAxis(localExitNorm);
daughtNormRepCrd = sampleTf.InverseTransformAxis(localExitNorm);
#endif
#ifdef G4VERBOSE
@@ -1135,8 +1135,8 @@ G4ReplicaNavigation::ComputeStep(const G4ThreeVector &globalPoint,
// GlobalToLastDepth.Inverse().TransformAxis(daughtNormRepCrd);
// ==> Can calculate it, but have no way to transmit it to caller (for now)
exitNormalVector=globalToLocalTop.Inverse().TransformAxis(daughtNormGlobal);
validExitNormal= false; // Entering daughter - never convex for parent
exitNormalVector = globalToLocalTop.InverseTransformAxis(daughtNormGlobal);
validExitNormal = false; // Entering daughter - never convex for parent
calculatedExitNormal= true;
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4SafetyHelper.cc 110067 2018-05-15 09:20:12Z gcosmo $
// $Id: G4SafetyHelper.cc 109355 2018-04-12 08:08:58Z gcosmo $
// GEANT4 tag $ Name: $
//
// class G4SafetyHelper Implementation
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VIntersectionLocator.cc 105904 2017-08-28 07:36:13Z gcosmo $
// $Id: G4VIntersectionLocator.cc 110772 2018-06-13 07:47:49Z gcosmo $
//
// Class G4VIntersectionLocator implementation
//
@@ -466,10 +466,9 @@ AdjustmentOfFoundIntersection( const G4ThreeVector& CurrentA_Point,
#ifdef G4VERBOSE
if ( fVerboseLevel>1 )
{
G4cerr << "WARNING - "
<< "G4VIntersectionLocator::AdjustementOfFoundIntersection()"
<< G4endl
<< " No intersection. Parallels lines!" << G4endl;
G4Exception("G4VIntersectionLocator::AdjustmentOfFoundIntersection()",
"GeomNav0003", JustWarning,
"No intersection. Parallels lines!");
}
#endif
lambda =- Normal.dot(CurrentF_Point-CurrentE_Point)/n_d_m;
@@ -591,8 +590,7 @@ GetGlobalSurfaceNormal(const G4ThreeVector& CurrentE_Point,
<< G4endl;
message << " * Result: " << G4endl;
message << " Global Normal= " << localNormal << G4endl;
message << "**************************************************************"
<< G4endl;
message << "**************************************************************";
G4Exception("G4VIntersectionLocator::GetGlobalSurfaceNormal()",
"GeomNav1002", JustWarning, message);
}
@@ -660,10 +658,11 @@ void G4VIntersectionLocator::ReportTrialStep( G4int step_no,
if( ( std::fabs(NormalAtEntry.mag2() - 1.0) > perThousand ) )
{
G4cerr << " PROBLEM in G4VIntersectionLocator::ReportTrialStep " << G4endl
<< " Normal is not unit - mag=" << NormalAtEntry.mag()
<< " ValidNormalAtE = " << validNormal
<< G4endl;
std::ostringstream message;
message << "Normal is not unit - mag= " << NormalAtEntry.mag() << G4endl
<< " ValidNormalAtE = " << validNormal;
G4Exception("G4VIntersectionLocator::ReportTrialStep()",
"GeomNav1002", JustWarning, message);
}
return;
}
@@ -706,11 +705,14 @@ LocateGlobalPointWithinVolumeAndCheck( const G4ThreeVector& position )
EInside inMother= motherSolid->Inside( localPosition );
if( inMother != kInside )
{
G4cerr << " ERROR in " << MethodName << " Position located "
<< ( inMother == kSurface ? " on Surface " : " outside " )
<< "expected volume" << G4endl;
G4double safetyFromOut= motherSolid->DistanceToIn(localPosition);
G4cerr << " Safety (from Outside) = " << safetyFromOut << G4endl;
std::ostringstream message;
message << "Position located "
<< ( inMother == kSurface ? " on Surface " : " outside " )
<< "expected volume" << G4endl
<< " Safety (from Outside) = "
<< motherSolid->DistanceToIn(localPosition);
G4Exception("G4VIntersectionLocator::LocateGlobalPointWithinVolumeAndCheck()",
"GeomNav1002", JustWarning, message);
}
// 1. Simple next step - quick relocation and check result.
@@ -722,8 +724,9 @@ LocateGlobalPointWithinVolumeAndCheck( const G4ThreeVector& position )
|| (nextPhysical->GetCopyNo() != motherCopyNo )
)
{
G4cerr << " ERROR in " << MethodName
<< " Position located outside expected volume" << G4endl;
G4Exception("G4VIntersectionLocator::LocateGlobalPointWithinVolumeAndCheck()",
"GeomNav1002", JustWarning,
"Position located outside expected volume.");
}
nav->CheckMode(navCheck); // Recover original value
}
@@ -741,7 +744,7 @@ LocateGlobalPointWithinVolumeAndCheck( const G4ThreeVector& position )
void G4VIntersectionLocator::
LocateGlobalPointWithinVolumeCheckAndReport( const G4ThreeVector& position,
const G4String& CodeLocationInfo,
G4int CheckMode )
G4int /* CheckMode */)
{
// Save value of Check mode first
G4bool oldCheck= GetCheckMode();
@@ -749,12 +752,17 @@ LocateGlobalPointWithinVolumeCheckAndReport( const G4ThreeVector& position,
G4bool ok= LocateGlobalPointWithinVolumeAndCheck( position );
if( !ok )
{
G4cerr << " ERROR occured in Intersection Locator" << G4endl;
G4cerr << " Code Location info: " << CodeLocationInfo << G4endl;
if( CheckMode > 1 ) {
std::ostringstream message;
message << "Failed point location." << G4endl
<< " Code Location info: " << CodeLocationInfo;
G4Exception("G4VIntersectionLocator::LocateGlobalPointWithinVolumeCheckAndReport()",
"GeomNav1002", JustWarning, message);
/*
if( CheckMode > 1 )
{
// Additional information
}
*/
}
SetCheckMode( oldCheck );