Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Navigator.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4Navigator
27//
28// Class description:
29//
30// A class for use by the tracking management, able to obtain/calculate
31// dynamic tracking time information such as the distance to the next volume,
32// or to find the physical volume containing a given point in the world
33// reference system. The navigator maintains a transformation history and
34// other information to optimise the tracking time performance.
35
36// Original author: Paul Kent (CERN), July 1995-1996
37//
38// - Made Navigator Abstract G. Cosmo, Nov 2003
39// - Added check mode G. Cosmo, Mar 2004
40// - Zero step protections J.A. / G.C., Nov 2004
41// --------------------------------------------------------------------
42#ifndef G4NAVIGATOR_HH
43#define G4NAVIGATOR_HH 1
44
45#include "geomdefs.hh"
46
47#include "G4ThreeVector.hh"
48#include "G4AffineTransform.hh"
49#include "G4RotationMatrix.hh"
50
51#include "G4LogicalVolume.hh" // Used in inline methods
52#include "G4TouchableHandle.hh" // " "
53
55#include "G4NormalNavigation.hh"
56#include "G4VoxelNavigation.hh"
61
62#include <iostream>
63
66
67/**
68 * @brief G4Navigator is a class for use by the tracking management, able to
69 * obtain/calculate dynamic tracking time information such as the distance to
70 * the next volume, or to find the physical volume containing a given point in
71 * the world reference system. The navigator maintains a transformation history
72 * and other information to optimise the tracking time performance.
73 */
74
76{
77 public:
78
79 friend std::ostream& operator << (std::ostream &os, const G4Navigator &n);
80
81 /**
82 * Constructor - initialisers and setup.
83 */
85
86 /**
87 * Copy constructor & assignment operator not allowed.
88 */
89 G4Navigator(const G4Navigator&) = delete;
91
92 /**
93 * Destructor.
94 */
95 virtual ~G4Navigator();
96
97 /**
98 * Calculates the distance to the next boundary intersected along the
99 * specified NORMALISED vector direction and from the specified point in
100 * the global coordinate system.
101 * LocateGlobalPointAndSetup() or LocateGlobalPointWithinVolume() must
102 * have been called with the same global point prior to this call.
103 * The isotropic distance to the nearest boundary is also calculated
104 * (usually an underestimate). The current proposed Step length is used
105 * to avoid intersection calculations: if it can be determined that the
106 * nearest boundary is >pCurrentProposedStepLength away, kInfinity
107 * is returned together with the computed isotropic safety distance.
108 * @note Geometry must be closed.
109 * @param[in] pGlobalPoint The point in global coordinates system.
110 * @param[in] pDirection The normalised vector direction.
111 * @param[in] pCurrentProposedStepLength Current proposed step length.
112 * @param[in,out] newSafety New safety.
113 * @returns Length from current point to next boundary surface along
114 * @p pDirection.
115 */
116 virtual G4double ComputeStep(const G4ThreeVector& pGlobalPoint,
117 const G4ThreeVector& pDirection,
118 const G4double pCurrentProposedStepLength,
119 G4double& pNewSafety);
120
121 /**
122 * Same as ComputeStep() above, but does not affect/modify the state
123 * of the Navigator.
124 */
125 G4double CheckNextStep(const G4ThreeVector& pGlobalPoint,
126 const G4ThreeVector& pDirection,
127 const G4double pCurrentProposedStepLength,
128 G4double& pNewSafety);
129
130 /**
131 * Resets the geometrical hierarchy and searches for the volumes deepest
132 * in the hierarchy containing the point in the global coordinates space.
133 * The direction is used to check if a volume is entered.
134 * The search begin is the geometrical hierarchy at the location of the
135 * last located point, or the endpoint of the previous Step if
136 * SetGeometricallyLimitedStep() has been called immediately before.
137 * @note: In order to call this the geometry MUST be closed.
138 * @param[in] point The point in global coordinates system.
139 * @param[in] direction The normalised vector direction.
140 * @param[in] h The touchable history to be used for initialisation.
141 * @returns The pointer to the physical volume where point is located.
142 */
143 virtual
145 const G4ThreeVector& direction,
146 const G4TouchableHistory& h);
147
148 /**
149 * Searches the geometrical hierarchy for the volumes deepest in hierarchy
150 * containing the point in the global coordinate space. Two main cases
151 * are:
152 * i) If pRelativeSearch=false it makes use of no previous/state
153 * information. Returns the physical volume containing the point,
154 * with all previous mothers correctly set up.
155 * ii) If pRelativeSearch is set to true, the search begin is the
156 * geometrical hierarchy at the location of the last located point,
157 * or the endpoint of previous Step if SetGeometricallyLimitedStep()
158 * has been called immediately before.
159 * The direction is used (to check if a volume is entered) if either
160 * - the argument ignoreDirection is false, or
161 * - the Navigator has determined that it is on an edge shared by two
162 * or more volumes (this is state information).
163 * @note In order to call this the geometry MUST be closed.
164 * @param[in] point The point in global coordinates system.
165 * @param[in] direction The normalised vector direction.
166 * @param[in] pRelativeSearch Flag to specify where search starts from.
167 * @param[in] ignoreDirection Flag to specify if to use direction or not.
168 * @returns The pointer to the physical volume where point is located.
169 */
170 virtual
172 const G4ThreeVector* direction = nullptr,
173 const G4bool pRelativeSearch = true,
174 const G4bool ignoreDirection = true);
175
176 /**
177 * Notifies the Navigator that a track has moved to the new Global point
178 * 'position', that is known to be within the current safety.
179 * No check is performed to ensure that it is within the volume.
180 * This method can be called instead of LocateGlobalPointAndSetup() ONLY
181 * if the caller is certain that the new global point (position) is inside
182 * the same volume as the previous position. Usually this can be guaranteed
183 * only if the point is within safety.
184 * @param[in] position The position point in global coordinates system.
185 */
186 virtual
188
189 /**
190 * It first searches the geometrical hierarchy like the above method
191 * LocateGlobalPointAndSetup(), then it uses the volume found and its
192 * navigation history to update the touchable handle.
193 * @param[in] position The point in global coordinates system.
194 * @param[in] direction The normalised vector direction.
195 * @param[in,out] oldTouchableToUpdate Touchable handle to update.
196 * @param[in] RelativeSearch Flag to specify where search starts from.
197 */
199 const G4ThreeVector& position,
200 const G4ThreeVector& direction,
201 G4TouchableHandle& oldTouchableToUpdate,
202 const G4bool RelativeSearch = true);
203 /**
204 * Same as the method above LocateGlobalPointAndUpdateTouchableHandle(),
205 * except that a pointer to G4VTouchable is used for updating the touchable.
206 */
208 const G4ThreeVector& position,
209 const G4ThreeVector& direction,
210 G4VTouchable* touchableToUpdate,
211 const G4bool RelativeSearch = true);
212
213 /**
214 * Same as the method above LocateGlobalPointAndUpdateTouchable(),
215 * except that direction is not specified.
216 */
218 const G4ThreeVector& position,
219 G4VTouchable* touchableToUpdate,
220 const G4bool RelativeSearch = true);
221
222 /**
223 * Informs the navigator that the previous Step calculated by the
224 * geometry was taken in its entirety.
225 */
227
228 /**
229 * Calculates the isotropic distance to the nearest boundary from the
230 * specified point in the global coordinate system.
231 * @note The geometry must be closed.
232 * @param[in] globalpoint The point in global coordinates system.
233 * The point must be within the current volume.
234 * @param[in] pProposedMaxLength The proposed maximum length is used
235 * to avoid volume safety calculations.
236 * @param[in] keepState Flag to instruct keeping the state (default true)
237 * to ensure minimum side effects from the call.
238 * @returns Length from current point to closest boundary surface.
239 * The value returned is usually an underestimate.
240 */
241 virtual G4double ComputeSafety(const G4ThreeVector& globalpoint,
242 const G4double pProposedMaxLength = DBL_MAX,
243 const G4bool keepState = true);
244
245 /**
246 * Returns the current world (topmost) volume.
247 */
249
250 /**
251 * Sets the world (topmost) volume. This must be positioned at the
252 * origin (0,0,0) and unrotated.
253 */
254 inline void SetWorldVolume(G4VPhysicalVolume* pWorld);
255
256 /**
257 * Touchable creation method.
258 * @note Caller has deletion responsibility.
259 * @returns A pointer to the allocated touchable history.
260 */
262
263 /**
264 * Touchable creation method, given a history.
265 * @note Caller has deletion responsibility.
266 * @param[in] h Pointer to a navigation history to copy from.
267 * @returns A pointer to the allocated touchable history.
268 */
270
271 /**
272 * Returns a reference counted handle to a touchable history.
273 */
275
276 /**
277 * Obtains the Normal vector to a surface (in local coordinates)
278 * pointing out of previous volume and into current volume
279 * Convention: the *local* normal is in the coordinate system of the
280 * *final* volume. The method takes full care about how to calculate
281 * this normal, but if the surfaces are not convex it will return
282 * valid=false.
283 * @note Can only be called if the Navigator's last Step has crossed a
284 * volume geometrical boundary.
285 * @note Normals are not available for replica volumes (i.e. valid=false).
286 * @param[in,out] valid Flag indicating if normal is valid.
287 * @returns A Exit Surface Normal vector and validity too.
288 */
290
291 /**
292 * Obtains the Normal vector to a surface (in local coordinates)
293 * pointing out of previous volume and into current volume, and
294 * checks the current point against expected 'local' value.
295 * Convention: the *local* normal is in the coordinate system of the
296 * *final* volume. The method takes full care about how to calculate
297 * this normal, but if the surfaces are not convex it will return
298 * valid=false.
299 * @note Can only be called if the Navigator's last Step has crossed a
300 * volume geometrical boundary.
301 * @note Normals are not available for replica volumes (i.e. valid=false).
302 * @param[in] point Point in global coordinates system to compare to.
303 * @param[in,out] valid Flag indicating if normal is valid.
304 * @returns A Exit Surface Normal vector and validity too.
305 */
307 G4bool* valid);
308 /**
309 * Obtains the Normal vector to a surface (in global coordinates)
310 * pointing out of previous volume and into current volume
311 * The method takes full care about how to calculate the normal,
312 * but if the surfaces are not convex it will return valid=false.
313 * @note Can only be called if the Navigator's last Step has crossed a
314 * volume geometrical boundary.
315 * @note Normals are not available for replica volumes (i.e. valid=false).
316 * @param[in] point Point in global coordinates system to compare to.
317 * @param[in,out] valid Flag indicating if normal is valid.
318 * @returns A Exit Surface Normal vector and validity too.
319 */
321 G4bool* valid);
322
323 /**
324 * Verbosity control.
325 * @note If level>0 && G4VERBOSE, printout can occur.
326 */
327 inline G4int GetVerboseLevel() const;
328 inline void SetVerboseLevel(G4int level);
329
330 /**
331 * Verify if the navigator is active.
332 */
333 inline G4bool IsActive() const;
334
335 /**
336 * Activate/inactivate the navigator.
337 */
338 inline void Activate(G4bool flag);
339
340 /**
341 * The purpose of this function is to inform the caller if the track is
342 * entering a daughter volume while exiting from the current volume.
343 * @note It is not guaranteed to work if SetGeometricallyLimitedStep()
344 * was not called when it should have been called.
345 * @returns True only in case when the Step has caused the track to arrive
346 * at a boundary of a daughter. False, in all other cases.
347 */
349
350 /**
351 * Verify if the step has exited the mother volume.
352 */
354
355 /**
356 * Run navigation in "check-mode", therefore using additional verifications
357 * and more strict correctness conditions.
358 * @note Is effective only with G4VERBOSE set.
359 */
360 inline void CheckMode(G4bool mode);
361
362 /**
363 * Set/unset verbosity for pushed tracks (default is true).
364 */
365 inline G4bool IsCheckModeActive() const;
366 inline void SetPushVerbosity(G4bool mode);
367
368 /**
369 * Prints the internal state of the Navigator (for debugging).
370 * The level of detail is according to the verbosity.
371 */
372 void PrintState() const;
373
374 /**
375 * Obtains the transformations Global/Local (and inverse).
376 * @note Clients of these methods must copy the data
377 * if they need to keep it.
378 */
381
382 /**
383 * Obtains mother to daughter transformation.
384 */
386 G4int dReplicaNo,
387 EVolume dVolumeType );
388
389 /**
390 * Resets stack and minimum or navigator state machine necessary for reset
391 * as needed by LocalGlobalPointAndSetup().
392 * @note Does not perform clears, resizes, or reset fLastLocatedPointLocal.
393 */
394 inline void ResetStackAndState();
395
396 /**
397 * Reports on severity of error and number of zero steps,
398 * in case Navigator is stuck and is returning zero steps.
399 * Values: 1 (small problem), 5 (correcting),
400 * 9 (ready to abandon), 10 (abandoned)
401 * @param[in,out] noZeroSteps Returns the number of zero steps in case
402 * pointer is not null.
403 * @returns The error severity.
404 */
405 inline G4int SeverityOfZeroStepping( G4int* noZeroSteps ) const;
406
407 /**
408 * Returns the local coordinate of the point in the reference system
409 * of its containing volume that was found by LocalGlobalPointAndSetup().
410 * The local coordinate of the last located track.
411 */
413
414 /**
415 * Computes and returns the local->global translation/rotation
416 * of current volume.
417 */
420
421 /**
422 * Enables best-possible evaluation of isotropic safety.
423 */
424 inline void EnableBestSafety( G4bool value = false );
425
426 /**
427 * Accessor & modifier for custom external navigation.
428 */
431
432 /**
433 * Gets/sets alternative navigator for voxel volumes.
434 */
437
438 /**
439 * Cloning feature for use in MT applications to clone the navigator,
440 * including external sub-navigator.
441 * @note Client has responsibility for ownership of the returned
442 * allocated pointer.
443 * @returns A pointer to the cloned navigator object.
444 */
445 inline G4Navigator* Clone() const;
446
447 /**
448 * Gets endpoint of last step.
449 */
451
452 /**
453 * Derived navigators which rely on LocateGlobalPointAndSetup() need to
454 * inform size of step, to maintain logic about arriving on boundary
455 * for challenging cases.
456 * Required in order to cope with multiple trials at boundaries
457 * => Locate with use direction rather than simple, fast logic.
458 */
459 void InformLastStep(G4double lastStep,
460 G4bool entersDaughtVol,
461 G4bool exitsMotherVol );
462
463 protected:
464
465 /**
466 * Saves the state: fValidExitNormal, fExitNormal, fExiting, fEntering,
467 * fBlockedPhysicalVolume, fBlockedReplicaNo, fLastStepWasZero,
468 * fLastLocatedPointLocal, fLocatedOutsideWorld, fEnteredDaughter,
469 * fExitedMother, fPreviousSftOrigin, fPreviousSafety.
470 */
471 void SetSavedState();
472
473 /**
474 * Copy aspects of the state, to enable a non-state changing
475 * call to ComputeStep().
476 */
477 void RestoreSavedState();
478
479 /**
480 * Utility method to reset the navigator state machine.
481 */
482 virtual void ResetState();
483
484 /**
485 * Returns position vector in local coordinate system, given a position
486 * vector in world coordinate system.
487 */
488 inline G4ThreeVector ComputeLocalPoint(const G4ThreeVector& rGlobP) const;
489
490 /**
491 * Returns the local direction of the specified vector in the reference
492 * system of the volume that was found by LocalGlobalPointAndSetup().
493 * The Local Coordinates of point in world coordinate system.
494 */
496
497 /**
498 * Characterises the type of volume - normal/replicated/parameterised.
499 */
500 inline EVolume VolumeType(const G4VPhysicalVolume *pVol) const;
501
502 /**
503 * Characterises the daughters of given logical volume.
504 */
506
507 /**
508 * Gets regular structure ID of first daughter.
509 */
511
512 /**
513 * Renavigates & resets hierarchy described by the current history:
514 * Resets volumes and recomputes transforms and/or solids of
515 * replicated/parameterised volumes.
516 */
517 virtual void SetupHierarchy();
518
519 /**
520 * Utility method to trigger overlaps check on a volume with reported
521 * overlaps ordered by relevance. Used in ComputeStep() when loopings
522 * with zero step are detected.
523 */
525
526 private:
527
528 /**
529 * Logs and checks for steps larger than the tolerance.
530 */
531 void ComputeStepLog(const G4ThreeVector& pGlobalpoint,
532 G4double moveLenSq) const;
533
534 protected:
535
536 G4double kCarTolerance, fMinStep, fSqTol; // Cached tolerances.
537
538 // BEGIN State information ------------------------------------------------
539 //
540
541 /** Transformation and history of the current path
542 through the geometrical hierarchy. */
544
545 /** Endpoint of last ComputeStep().
546 Can be used for optimisation (e.g. when computing safety). */
548
549 /** Position of the end-point of the last call to ComputeStep()
550 in last local coordinates. */
552
553 /** Verbosity level [if > 0, printout can occur]. */
555
556 /** A memory of whether in this Step a daughter volume is entered
557 (set in Compute & Locate).
558 After Compute: it expects to enter a daughter
559 After Locate: it has entered a daughter. */
561
562 /** A similar memory whether the Step exited current "mother" volume
563 completely, not entering daughter. */
565
566 /** Set true if last Step was limited by geometry. */
568
569 private:
570
571 /** Position of the last located point relative to its containing volume.
572 This is coupled with the Boolean member 'fLocatedOutsideWorld'. */
573 G4ThreeVector fLastLocatedPointLocal;
574
575 /** Leaving volume normal, in the volume containing the exited
576 volume's coordinate system.
577 This is closely coupled with 'fValidExitNormal', which signals whether
578 we have a (valid) normal for volume we're leaving. */
579 G4ThreeVector fExitNormal;
580
581 /** Leaving volume normal, in its own coordinate system. */
582 G4ThreeVector fGrandMotherExitNormal;
583
584 /** Leaving volume normal, in the global coordinate system. */
585 G4ThreeVector fExitNormalGlobalFrame;
586
587 /** Memory of last safety origin & value. Used in ComputeStep() to ensure
588 that origin of current Step is in the same volume as the point of the
589 last relocation. */
590 G4ThreeVector fPreviousSftOrigin;
591 G4double fPreviousSafety;
592
593 /** Memory of the mother volume during previous step.
594 Intended use: inform user in case of stuck track. */
595 G4VPhysicalVolume* fLastMotherPhys = nullptr;
596
597 /** Identifies the volume and copy / replica number that is blocked
598 (after exiting -- because the exit direction is along the exit normal)
599 or a candidate for entry (after compute step). */
600 G4VPhysicalVolume* fBlockedPhysicalVolume;
601 G4int fBlockedReplicaNo;
602
603 /** Count zero steps, as one or two can occur due to changing momentum at
604 a boundary or at an edge common between volumes; several zero steps
605 are likely a problem in the geometry description or in the navigation.
606 Number of preceding moves that were Zero.
607 Reset to 0 after finite step. */
608 G4int fNumberZeroSteps;
609
610 /** After this many failed/zero steps, act (push etc). */
611 G4int fActionThreshold_NoZeroSteps = 10;
612
613 /** After this many failed/zero steps, abandon track. */
614 G4int fAbandonThreshold_NoZeroSteps = 25;
615
616 /** States if the navigator is activated or not. */
617 G4bool fActive = false;
618
619 /** Whether ComputeStep() was called since the last call to a Locate().
620 Uses: distinguish parts of state which differ before/after calls
621 to ComputeStep() or one of the Locate() methods; avoid two consecutive
622 calls to compute-step (illegal). */
623 G4bool fLastTriedStepComputation = false;
624
625 /** Entering/Exiting volumes blocking/setup.
626 o If exiting, volume ptr & replica number (set & used by Locate..())
627 used for blocking on redescent of geometry;
628 o If entering, volume ptr & replica number (set by ComputeStep(),
629 used by Locate..()) of volume for 'automatic' entry. */
630 G4bool fEntering, fExiting;
631
632 /** Set true if have leaving volume normal. */
633 G4bool fValidExitNormal;
634
635 /** Whether the last ComputeStep moved Zero. Used to check for edges. */
636 G4bool fLastStepWasZero;
637
638 /** Whether the Navigator has detected an edge. */
639 G4bool fLocatedOnEdge;
640
641 /** Whether the last call to Locate methods left the world. */
642 G4bool fLocatedOutsideWorld;
643
644 /** Whether frame is changed. */
645 G4bool fChangedGrandMotherRefFrame;
646
647 /** Has it been computed since the last call to ComputeStep().
648 Covers both Global and GrandMother. */
649 G4bool fCalculatedExitNormal;
650
651 //
652 // END State information --------------------------------------------------
653
654 // Optional State information (created/used as needed)
655 //
656
657 // Save key state information (NOT the navigation history stack)
658 //
659 struct G4SaveNavigatorState
660 {
661 G4ThreeVector sExitNormal;
662 G4bool sValidExitNormal;
663 G4bool sEntering, sExiting;
664 G4VPhysicalVolume* spBlockedPhysicalVolume;
665 G4int sBlockedReplicaNo;
666 G4int sLastStepWasZero;
667 G4bool sWasLimitedByGeometry;
668
669 // Potentially relevant
670 //
671 G4bool sLocatedOutsideWorld;
672 G4ThreeVector sLastLocatedPointLocal;
673 G4bool sEnteredDaughter, sExitedMother;
674 G4ThreeVector sPreviousSftOrigin;
675 G4double sPreviousSafety;
676 } fSaveState;
677
678 // ========================================================================
679 // BEGIN -- Tracking Invariants
680
681 /** A link to the topmost physical volume in the detector.
682 Must be positioned at the origin and unrotated. */
683 G4VPhysicalVolume* fTopPhysical = nullptr;
684
685 // Helpers/Utility classes
686
687 G4NormalNavigation fnormalNav;
688 G4VoxelNavigation* fpvoxelNav;
690 G4ReplicaNavigation freplicaNav;
691 G4RegularNavigation fregularNav;
692 G4VExternalNavigation* fpExternalNav = nullptr;
693 G4VoxelSafety* fpVoxelSafety;
694 G4SafetyCalculator* fpSafetyCalculator = nullptr;
695
696 // Utility information
697
698 /** Check-mode flag [if true, more strict checks are performed]. */
699 G4bool fCheck = false;
700
701 /** Push flags [if true, means a stuck particle has been pushed]. */
702 G4bool fPushed = false, fWarnPush = true;
703
704 // End -- Tracking Invariants
705 // ========================================================================
706};
707
708#include "G4Navigator.icc"
709
710#endif
711
712
713// NOTES:
714//
715// The following methods provide detailed information when a Step has
716// arrived at a geometrical boundary. They distinguish between the different
717// causes that can result in the track leaving its current volume.
718//
719// Four cases are possible:
720//
721// 1) The particle has reached a boundary of a daughter of the current volume:
722// (this could cause the relocation to enter the daughter itself
723// or a potential granddaughter or further descendant)
724//
725// 2) The particle has reached a boundary of the current
726// volume, exiting into a mother (regardless the level
727// at which it is located in the tree):
728//
729// 3) The particle has reached a boundary of the current
730// volume, exiting into a volume which is not in its
731// parental hierarchy:
732//
733// 4) The particle is not on a boundary between volumes:
734// the function returns an exception, and the caller is
735// reccomended to compare the G4touchables associated
736// to the preStepPoint and postStepPoint to handle this case.
737//
738// G4bool EnteredDaughterVolume()
739// G4bool IsExitNormalValid()
740// G4ThreeVector GetLocalExitNormal()
741//
742// The expected usefulness of these methods is to allow the caller to
743// determine how to compute the surface normal at the volume boundary. The two
744// possibilities are to obtain the normal from:
745//
746// i) the solid associated with the volume of the initial point of the Step.
747// This is valid for cases 2 and 3.
748// (Note that the initial point is generally the PreStepPoint of a Step).
749// or
750//
751// ii) the solid of the final point, ie of the volume after the relocation.
752// This is valid for case 1.
753// (Note that the final point is generally the PreStepPoint of a Step).
754//
755// This way the caller can always get a valid normal, pointing outside
756// the solid for which it is computed, that can be used at his own
757// discretion.
#define fPushed
CLHEP::HepRotation G4RotationMatrix
CLHEP::Hep3Vector G4ThreeVector
G4ReferenceCountedHandle< G4VTouchable > G4TouchableHandle
G4TouchableHandle is a type providing reference counting mechanism for any kind of touchable objects....
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4TouchableHistory G4VTouchable
G4VTouchable is a G4TouchableHistory object.
G4AffineTransform is a class for geometric affine transformations. It supports efficient arbitrary ro...
G4LogicalVolume represents a leaf node or unpositioned subtree in the geometry hierarchy....
G4NavigationHistory is a class responsible for the maintenance of the history of the path taken throu...
G4double fMinStep
void RestoreSavedState()
void SetVerboseLevel(G4int level)
virtual void SetupHierarchy()
G4TouchableHistory * CreateTouchableHistory() const
void SetPushVerbosity(G4bool mode)
void LocateGlobalPointAndUpdateTouchable(const G4ThreeVector &position, G4VTouchable *touchableToUpdate, const G4bool RelativeSearch=true)
void SetGeometricallyLimitedStep()
G4ThreeVector fStepEndPoint
void SetExternalNavigation(G4VExternalNavigation *externalNav)
G4int GetVerboseLevel() const
G4bool fExitedMother
virtual void ResetState()
G4bool fEnteredDaughter
G4TouchableHistory * CreateTouchableHistory(const G4NavigationHistory *h) const
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
EVolume VolumeType(const G4VPhysicalVolume *pVol) const
G4bool IsActive() const
void Activate(G4bool flag)
G4VExternalNavigation * GetExternalNavigation() const
G4ThreeVector ComputeLocalPoint(const G4ThreeVector &rGlobP) const
void CheckMode(G4bool mode)
virtual void LocateGlobalPointWithinVolume(const G4ThreeVector &position)
G4Navigator(const G4Navigator &)=delete
G4ThreeVector fLastStepEndPointLocal
G4bool fWasLimitedByGeometry
G4VoxelNavigation & GetVoxelNavigator()
virtual ~G4Navigator()
G4double fSqTol
G4bool CheckOverlapsIterative(G4VPhysicalVolume *vol)
void SetSavedState()
G4Navigator & operator=(const G4Navigator &)=delete
EVolume CharacteriseDaughters(const G4LogicalVolume *pLog) const
G4int SeverityOfZeroStepping(G4int *noZeroSteps) const
virtual G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &point, G4bool *valid)
void SetVoxelNavigation(G4VoxelNavigation *voxelNav)
void PrintState() const
void LocateGlobalPointAndUpdateTouchableHandle(const G4ThreeVector &position, const G4ThreeVector &direction, G4TouchableHandle &oldTouchableToUpdate, const G4bool RelativeSearch=true)
G4ThreeVector ComputeLocalAxis(const G4ThreeVector &pVec) const
G4ThreeVector NetTranslation() const
G4double kCarTolerance
virtual G4ThreeVector GetLocalExitNormalAndCheck(const G4ThreeVector &point, G4bool *valid)
virtual G4ThreeVector GetLocalExitNormal(G4bool *valid)
const G4AffineTransform GetLocalToGlobalTransform() const
void InformLastStep(G4double lastStep, G4bool entersDaughtVol, G4bool exitsMotherVol)
G4RotationMatrix NetRotation() const
virtual G4double ComputeStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=nullptr, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
G4Navigator * Clone() const
void LocateGlobalPointAndUpdateTouchable(const G4ThreeVector &position, const G4ThreeVector &direction, G4VTouchable *touchableToUpdate, const G4bool RelativeSearch=true)
G4AffineTransform GetMotherToDaughterTransform(G4VPhysicalVolume *dVolume, G4int dReplicaNo, EVolume dVolumeType)
void ResetStackAndState()
void SetWorldVolume(G4VPhysicalVolume *pWorld)
G4bool IsCheckModeActive() const
G4bool EnteredDaughterVolume() const
G4double CheckNextStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
virtual G4VPhysicalVolume * ResetHierarchyAndLocate(const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &h)
G4bool ExitedMotherVolume() const
G4int GetDaughtersRegularStructureId(const G4LogicalVolume *pLv) const
G4ThreeVector GetLastStepEndPoint() const
friend std::ostream & operator<<(std::ostream &os, const G4Navigator &n)
G4VPhysicalVolume * GetWorldVolume() const
G4NavigationHistory fHistory
virtual G4TouchableHandle CreateTouchableHistoryHandle() const
const G4AffineTransform & GetGlobalToLocalTransform() const
void EnableBestSafety(G4bool value=false)
G4ThreeVector GetCurrentLocalCoordinate() const
G4NormalNavigation is a concrete utility class for navigation in volumes containing only G4PVPlacemen...
G4ParameterisedNavigation is a concrete utility class for navigation in volumes containing a single G...
G4RegularNavigation is a concrete utility class for fast navigation in volumes containing a regular p...
G4ReplicaNavigation is a utility class for navigation in volumes containing a single G4PVParameterise...
G4SafetyCalculator is a class that provides an estimate of the isotropic safety (the minimum distance...
G4TouchableHistory is an object representing a touchable detector element, and its history in the geo...
G4VExternalNavigation is a pure virtual class to be specialised by the user for tracking with an exte...
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4VoxelNavigation is a concrete utility class for navigation in volumes containing only G4PVPlacement...
G4VoxelSafety is an utility class for the handling isotropic safety in volumes containing only G4PVPl...
EVolume
Definition geomdefs.hh:83
#define DBL_MAX
Definition templates.hh:62