Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ErrorPropagationNavigator Class Reference

#include <G4ErrorPropagationNavigator.hh>

+ Inheritance diagram for G4ErrorPropagationNavigator:

Public Member Functions

 G4ErrorPropagationNavigator ()
 
 ~G4ErrorPropagationNavigator ()
 
G4double ComputeStep (const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
 
G4double ComputeSafety (const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
 
G4ThreeVector GetGlobalExitNormal (const G4ThreeVector &point, G4bool *valid)
 
G4double TargetSafetyFromPoint (const G4ThreeVector &pGlobalpoint)
 
- Public Member Functions inherited from G4Navigator
 G4Navigator ()
 
 G4Navigator (const G4Navigator &)=delete
 
G4Navigatoroperator= (const G4Navigator &)=delete
 
virtual ~G4Navigator ()
 
virtual G4double ComputeStep (const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
 
G4double CheckNextStep (const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
 
virtual G4VPhysicalVolumeResetHierarchyAndLocate (const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &h)
 
virtual G4VPhysicalVolumeLocateGlobalPointAndSetup (const G4ThreeVector &point, const G4ThreeVector *direction=nullptr, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
 
virtual void LocateGlobalPointWithinVolume (const G4ThreeVector &position)
 
void LocateGlobalPointAndUpdateTouchableHandle (const G4ThreeVector &position, const G4ThreeVector &direction, G4TouchableHandle &oldTouchableToUpdate, const G4bool RelativeSearch=true)
 
void LocateGlobalPointAndUpdateTouchable (const G4ThreeVector &position, const G4ThreeVector &direction, G4VTouchable *touchableToUpdate, const G4bool RelativeSearch=true)
 
void LocateGlobalPointAndUpdateTouchable (const G4ThreeVector &position, G4VTouchable *touchableToUpdate, const G4bool RelativeSearch=true)
 
void SetGeometricallyLimitedStep ()
 
virtual G4double ComputeSafety (const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
 
G4VPhysicalVolumeGetWorldVolume () const
 
void SetWorldVolume (G4VPhysicalVolume *pWorld)
 
G4GRSVolumeCreateGRSVolume () const
 
G4GRSSolidCreateGRSSolid () const
 
G4TouchableHistoryCreateTouchableHistory () const
 
G4TouchableHistoryCreateTouchableHistory (const G4NavigationHistory *) const
 
virtual G4TouchableHistoryHandle CreateTouchableHistoryHandle () const
 
virtual G4ThreeVector GetLocalExitNormal (G4bool *valid)
 
virtual G4ThreeVector GetLocalExitNormalAndCheck (const G4ThreeVector &point, G4bool *valid)
 
virtual G4ThreeVector GetGlobalExitNormal (const G4ThreeVector &point, G4bool *valid)
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int level)
 
G4bool IsActive () const
 
void Activate (G4bool flag)
 
G4bool EnteredDaughterVolume () const
 
G4bool ExitedMotherVolume () const
 
void CheckMode (G4bool mode)
 
G4bool IsCheckModeActive () const
 
void SetPushVerbosity (G4bool mode)
 
void PrintState () const
 
const G4AffineTransformGetGlobalToLocalTransform () const
 
const G4AffineTransform GetLocalToGlobalTransform () const
 
G4AffineTransform GetMotherToDaughterTransform (G4VPhysicalVolume *dVolume, G4int dReplicaNo, EVolume dVolumeType)
 
void ResetStackAndState ()
 
G4int SeverityOfZeroStepping (G4int *noZeroSteps) const
 
G4ThreeVector GetCurrentLocalCoordinate () const
 
G4ThreeVector NetTranslation () const
 
G4RotationMatrix NetRotation () const
 
void EnableBestSafety (G4bool value=false)
 
G4VExternalNavigationGetExternalNavigation () const
 
void SetExternalNavigation (G4VExternalNavigation *externalNav)
 
G4NavigatorClone () const
 
G4ThreeVector GetLastStepEndPoint () const
 
void InformLastStep (G4double lastStep, G4bool entersDaughtVol, G4bool exitsMotherVol)
 
void SetVoxelNavigation (G4VoxelNavigation *voxelNav)
 

Additional Inherited Members

- Protected Member Functions inherited from G4Navigator
void SetSavedState ()
 
void RestoreSavedState ()
 
virtual void ResetState ()
 
G4ThreeVector ComputeLocalPoint (const G4ThreeVector &rGlobPoint) const
 
G4ThreeVector ComputeLocalAxis (const G4ThreeVector &pVec) const
 
EVolume VolumeType (const G4VPhysicalVolume *pVol) const
 
EVolume CharacteriseDaughters (const G4LogicalVolume *pLog) const
 
G4int GetDaughtersRegularStructureId (const G4LogicalVolume *pLv) const
 
virtual void SetupHierarchy ()
 
G4bool CheckOverlapsIterative (G4VPhysicalVolume *vol)
 
- Protected Attributes inherited from G4Navigator
G4double kCarTolerance
 
G4double fMinStep
 
G4double fSqTol
 
G4NavigationHistory fHistory
 
G4ThreeVector fStepEndPoint
 
G4ThreeVector fLastStepEndPointLocal
 
G4int fVerbose = 0
 
G4bool fEnteredDaughter
 
G4bool fExitedMother
 
G4bool fWasLimitedByGeometry = false
 

Detailed Description

Definition at line 44 of file G4ErrorPropagationNavigator.hh.

Constructor & Destructor Documentation

◆ G4ErrorPropagationNavigator()

G4ErrorPropagationNavigator::G4ErrorPropagationNavigator ( )

Definition at line 44 of file G4ErrorPropagationNavigator.cc.

45 : G4Navigator()
46{
47}

◆ ~G4ErrorPropagationNavigator()

G4ErrorPropagationNavigator::~G4ErrorPropagationNavigator ( )

Definition at line 51 of file G4ErrorPropagationNavigator.cc.

52{
53}

Member Function Documentation

◆ ComputeSafety()

G4double G4ErrorPropagationNavigator::ComputeSafety ( const G4ThreeVector globalpoint,
const G4double  pProposedMaxLength = DBL_MAX,
const G4bool  keepState = true 
)
virtual

Reimplemented from G4Navigator.

Definition at line 153 of file G4ErrorPropagationNavigator.cc.

157{
158 G4double safetyGeom = G4Navigator::ComputeSafety(pGlobalPoint,
159 pMaxLength, keepState);
160
161 G4double safetyTarget = TargetSafetyFromPoint( pGlobalPoint );
162
163 return std::min(safetyGeom, safetyTarget);
164}
double G4double
Definition: G4Types.hh:83
G4double TargetSafetyFromPoint(const G4ThreeVector &pGlobalpoint)
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)

◆ ComputeStep()

G4double G4ErrorPropagationNavigator::ComputeStep ( const G4ThreeVector pGlobalPoint,
const G4ThreeVector pDirection,
const G4double  pCurrentProposedStepLength,
G4double pNewSafety 
)
virtual

Reimplemented from G4Navigator.

Definition at line 57 of file G4ErrorPropagationNavigator.cc.

62{
63 G4double safetyGeom = DBL_MAX;
64
65 G4double Step = G4Navigator::ComputeStep(pGlobalPoint, pDirection,
66 pCurrentProposedStepLength,
67 safetyGeom);
68
71
72 if ( g4edata != nullptr )
73 {
74 const G4ErrorTarget* target = g4edata->GetTarget();
75 if( target != nullptr )
76 {
77 G4double StepPlane=target->GetDistanceFromPoint(pGlobalPoint,pDirection);
78
79 if( StepPlane < 0. ) // Negative means target is crossed,
80 { // will not be found
81 StepPlane = DBL_MAX;
82 }
83#ifdef G4VERBOSE
85 {
86 G4cout << "G4ErrorPropagationNavigator::ComputeStep()" << G4endl
87 << " Target step: " << StepPlane
88 << ", Transportation step: " << Step << G4endl;
89 target->Dump( "G4ErrorPropagationNavigator::ComputeStep Target " );
90 }
91#endif
92
93 if( StepPlane < Step )
94 {
95#ifdef G4VERBOSE
97 {
98 G4cout << "G4ErrorPropagationNavigator::ComputeStep()" << G4endl
99 << " TargetCloserThanBoundary: " << StepPlane << " < "
100 << Step << G4endl;
101 }
102#endif
103 Step = StepPlane;
105 }
106 else
107 {
109 }
110 }
111 }
112 G4double safetyTarget = TargetSafetyFromPoint(pGlobalPoint);
113
114 // Avoid call to G4Navigator::ComputeSafety - which could have side effects
115 //
116 pNewSafety = std::min(safetyGeom, safetyTarget);
117
118#ifdef G4VERBOSE
120 {
121 G4cout << "G4ErrorPropagationNavigator::ComputeStep()" << G4endl
122 << " Step: " << Step << ", ComputeSafety: " << pNewSafety
123 << G4endl;
124 }
125#endif
126
127 return Step;
128}
@ G4ErrorState_TargetCloserThanBoundary
@ G4ErrorState_Propagating
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static G4ErrorPropagatorData * GetErrorPropagatorData()
const G4ErrorTarget * GetTarget(G4bool mustExist=false) const
void SetState(G4ErrorState sta)
virtual void Dump(const G4String &msg) const =0
virtual G4double GetDistanceFromPoint(const G4ThreeVector &, const G4ThreeVector &) const
virtual G4double ComputeStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
Definition: G4Navigator.cc:756
#define DBL_MAX
Definition: templates.hh:62

◆ GetGlobalExitNormal()

G4ThreeVector G4ErrorPropagationNavigator::GetGlobalExitNormal ( const G4ThreeVector point,
G4bool valid 
)
virtual

Reimplemented from G4Navigator.

Definition at line 168 of file G4ErrorPropagationNavigator.cc.

170{
171 G4ErrorPropagatorData* g4edata
173 const G4ErrorTarget* target = nullptr;
174
175 G4ThreeVector normal(0.0, 0.0, 0.0);
176 G4double distance= 0;
177
178 // Determine which 'geometry' limited the step
179 if ( g4edata != nullptr )
180 {
181 target = g4edata->GetTarget();
182 if( target != nullptr )
183 {
184 distance = target->GetDistanceFromPoint(point);
185 }
186 }
187
188 if( distance > kCarTolerance || (target == nullptr) )
189 // Not reached the target or if a target does not exist,
190 // this seems the best we can do
191 {
192 normal = G4Navigator::GetGlobalExitNormal(point, valid);
193 }
194 else
195 {
196 switch( target->GetType() )
197 {
199 // The volume is in the 'real' mass geometry
200 normal = G4Navigator::GetGlobalExitNormal(point, valid);
201 break;
203 normal = G4ThreeVector( 0.0, 0.0, 0.0);
204 *valid = false;
205 G4Exception("G4ErrorPropagationNavigator::GetGlobalExitNormal",
206 "Geometry1003",
207 JustWarning, "Unexpected value of Target type");
208 break;
211 const G4ErrorSurfaceTarget* surfaceTarget=
212 static_cast<const G4ErrorSurfaceTarget*>(target);
213 normal = surfaceTarget->GetTangentPlane(point).normal().unit();
214 *valid = true;
215 break;
216
217// default:
218// normal= G4ThreeVector( 0.0, 0.0, 0.0 );
219// *valid = false;
220// G4Exception("G4ErrorPropagationNavigator::GetGlobalExitNormal",
221// "Geometry:003",
222// FatalException, "Impossible value of Target type");
223// break;
224 }
225 }
226 return normal;
227}
@ G4ErrorTarget_PlaneSurface
@ G4ErrorTarget_CylindricalSurface
@ G4ErrorTarget_GeomVolume
@ G4ErrorTarget_TrkL
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
CLHEP::Hep3Vector G4ThreeVector
virtual G4Plane3D GetTangentPlane(const G4ThreeVector &point) const =0
G4ErrorTargetType GetType() const
virtual G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &point, G4bool *valid)
G4double kCarTolerance
Definition: G4Navigator.hh:377
Normal3D< T > normal() const
Definition: Plane3D.h:97

◆ TargetSafetyFromPoint()

G4double G4ErrorPropagationNavigator::TargetSafetyFromPoint ( const G4ThreeVector pGlobalpoint)

Definition at line 132 of file G4ErrorPropagationNavigator.cc.

134{
135 G4double safety = DBL_MAX;
136
137 G4ErrorPropagatorData* g4edata
139
140 if ( g4edata != nullptr )
141 {
142 const G4ErrorTarget* target = g4edata->GetTarget();
143 if( target != nullptr )
144 {
145 safety = target->GetDistanceFromPoint(pGlobalpoint);
146 }
147 }
148 return safety;
149}

Referenced by ComputeSafety(), and ComputeStep().


The documentation for this class was generated from the following files: