Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NormalNavigation.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// G4NormalNavigation
27//
28// Class description:
29//
30// Utility for navigation in volumes containing only G4PVPlacement
31// daughter volumes.
32
33// Author: Paul Kent (CERN), August 1996
34// --------------------------------------------------------------------
35#ifndef G4NORMALNAVIGATION_HH
36#define G4NORMALNAVIGATION_HH 1
37
38#include <iomanip>
39
40#include "G4VNavigation.hh"
42
43#include "G4VPhysicalVolume.hh"
44#include "G4LogicalVolume.hh"
45#include "G4VSolid.hh"
46#include "G4ThreeVector.hh"
48
50
51/**
52 * @brief G4NormalNavigation is a concrete utility class for navigation in
53 * volumes containing only G4PVPlacement daughter volumes.
54 */
55
57{
58 public:
59
60 /**
61 * Constructor and Destructor.
62 */
64 ~G4NormalNavigation() override;
65
66 /**
67 * Searches positioned volumes in mother at current top level of history
68 * for volume containing @p globalPoint. Do not test against @p blockedVol.
69 * If a containing volume is found, push it onto navigation history state
70 * and return true, else return false (the point lying in the mother but
71 * not any of the daughters).
72 * @param[in,out] history Navigation history.
73 * @param[in,out] blockedVol Blocked volume to be ignored in queries.
74 * @param[in,out] blockedNum Copy number for blocked volumes.
75 * @param[in,out] globalPoint Point in global coordinates system.
76 * @param[in,out] globalDirection Pointer to global direction or null.
77 * @param[in] pLocatedOnEdge Flag specifying if point is located on edge.
78 * @param[in,out] localPoint Point in local coordinates system.
79 * @returns Whether a containing volume has been found.
80 */
82 const G4VPhysicalVolume* blockedVol,
83 const G4int blockedNum,
84 const G4ThreeVector& globalPoint,
85 const G4ThreeVector* globalDirection,
86 const G4bool pLocatedOnEdge,
87 G4ThreeVector& localPoint) final;
88
89 /**
90 * Computes the length of a step to the next boundary.
91 * Does not test against @p pBlockedPhysical. Identifies the next candidate
92 * volume (if a daughter of the current volume), and returns it in:
93 * pBlockedPhysical, blockedReplicaNo.
94 * @param[in] localPoint Local point.
95 * @param[in] localDirection Pointer to local direction or null pointer.
96 * @param[in] currentProposedStepLength Current proposed step length.
97 * @param[in,out] newSafety New safety.
98 * @param[in,out] history Navigation history.
99 * @param[in,out] validExitNormal Flag to indicate whether exit normal is
100 * valid or not.
101 * @param[in,out] exitNormal Exit normal.
102 * @param[in,out] exiting Flag to indicate whether exiting a volume.
103 * @param[in,out] entering Flag to indicate whether entering a volume.
104 * @param[in,out] pBlockedPhysical Blocked physical volume that should be
105 * ignored in queries.
106 * @param[in,out] blockedReplicaNo Copy number for blocked replica volumes.
107 * @returns Length from current point to next boundary surface along
108 * @p localDirection.
109 */
110 G4double ComputeStep( const G4ThreeVector& localPoint,
111 const G4ThreeVector& localDirection,
112 const G4double currentProposedStepLength,
113 G4double& newSafety,
114 G4NavigationHistory& history,
115 G4bool& validExitNormal,
116 G4ThreeVector& exitNormal,
117 G4bool& exiting,
118 G4bool& entering,
119 G4VPhysicalVolume* (*pBlockedPhysical),
120 G4int& blockedReplicaNo ) final;
121
122 /**
123 * Calculates the isotropic distance to the nearest boundary from the
124 * specified point in the local coordinate system.
125 * The localpoint utilised must be within the current volume.
126 * @param[in] localPoint Local point.
127 * @param[in] history Navigation history.
128 * @param[in] pMaxLength Maximum step length beyond which volumes
129 * need not be checked.
130 * @returns Length from current point to closest surface.
131 */
132 G4double ComputeSafety( const G4ThreeVector& localpoint,
133 const G4NavigationHistory& history,
134 const G4double pMaxLength=DBL_MAX ) final;
135
136 /**
137 * Verbosity control.
138 * @note If level>0 && G4VERBOSE, printout can occur.
139 */
140 G4int GetVerboseLevel() const final;
141 void SetVerboseLevel(G4int level) final;
142
143 private:
144
145 G4NavigationLogger* fLogger;
146};
147
148#include "G4NormalNavigation.icc"
149
150#endif
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4NavigationHistory is a class responsible for the maintenance of the history of the path taken throu...
G4NavigationLogger is a simple utility class for use by the navigation systems for verbosity and chec...
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint) final
void SetVerboseLevel(G4int level) final
G4double ComputeStep(const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo) final
G4double ComputeSafety(const G4ThreeVector &localpoint, const G4NavigationHistory &history, const G4double pMaxLength=DBL_MAX) final
G4int GetVerboseLevel() const final
G4VNavigation class holds the common navigation interface for all geometry navigator types.
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
#define DBL_MAX
Definition templates.hh:62