Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParameterisedNavigation.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// class G4ParameterisedNavigation
27//
28// Class description:
29//
30// Utility for navigation in volumes containing a single G4PVParameterised
31// volume for which voxels for the replicated volumes have been constructed.
32// [Voxels MUST be along one axis only: NOT refined]
33
34// History:
35// - Created. Paul Kent, Aug 96
36// --------------------------------------------------------------------
37#ifndef G4PARAMETERISEDNAVIGATION_HH
38#define G4PARAMETERISEDNAVIGATION_HH
39
40#include "G4Types.hh"
41
42#include <vector>
43
44#include "G4VoxelNavigation.hh"
46#include "G4AffineTransform.hh"
47#include "G4VPhysicalVolume.hh"
49#include "G4LogicalVolume.hh"
50#include "G4VSolid.hh"
51#include "G4ThreeVector.hh"
52#include "G4BlockingList.hh"
53
55{
56 public: // with description
57
60
62 const G4ThreeVector& localPoint );
63
65 const G4VPhysicalVolume* blockedVol,
66 const G4int blockedNum,
67 const G4ThreeVector& globalPoint,
68 const G4ThreeVector* globalDirection,
69 const G4bool pLocatedOnEdge,
70 G4ThreeVector& localPoint );
71
72 G4double ComputeStep( const G4ThreeVector& globalPoint,
73 const G4ThreeVector& globalDirection,
74 const G4double currentProposedStepLength,
75 G4double& newSafety,
76 G4NavigationHistory& history,
77 G4bool& validExitNormal,
78 G4ThreeVector& exitNormal,
79 G4bool& exiting,
80 G4bool& entering,
81 G4VPhysicalVolume *(*pBlockedPhysical),
82 G4int& blockedReplicaNo );
83
84 G4double ComputeSafety( const G4ThreeVector& localPoint,
85 const G4NavigationHistory& history,
86 const G4double pProposedMaxLength=DBL_MAX );
87
88 private:
89
90 G4double ComputeVoxelSafety( const G4ThreeVector& localPoint,
91 const EAxis pAxis ) const;
92 G4bool LocateNextVoxel( const G4ThreeVector& localPoint,
93 const G4ThreeVector& localDirection,
94 const G4double currentStep,
95 const EAxis pAxis );
96 private:
97
98 // Necessary to resolve cases with nested parameterisations
99
100 inline G4VSolid* IdentifyAndPlaceSolid( G4int num,
101 G4VPhysicalVolume* apparentPhys,
102 G4VPVParameterisation* curParam );
103 // Call virtual 'Compute' methods, and copy information if nested.
104 // 'ApparentPhys' is potentially a PhysV or PhysT.
105
106 G4VPhysicalVolume* CreateVolumeWithParent(G4VPhysicalVolume* curPhysical,
107 const G4NavigationHistory& hist );
108 // Create necessary parent touchable and physical with parent.
109
110 private:
111
112 // Voxel Stack information (for 1D optimisation only)
113 //
114 EAxis fVoxelAxis = kUndefined;
115 G4int fVoxelNoSlices = 0;
116 G4double fVoxelSliceWidth = 0.0;
117 std::size_t fVoxelNodeNo = 0;
118 G4SmartVoxelHeader* fVoxelHeader = nullptr;
119};
120
121#include "G4ParameterisedNavigation.icc"
122
123#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4double ComputeStep(const G4ThreeVector &globalPoint, const G4ThreeVector &globalDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo)
G4SmartVoxelNode * ParamVoxelLocate(G4SmartVoxelHeader *pHead, const G4ThreeVector &localPoint)
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
G4double ComputeSafety(const G4ThreeVector &localPoint, const G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX)
EAxis
Definition: geomdefs.hh:54
@ kUndefined
Definition: geomdefs.hh:61
#define DBL_MAX
Definition: templates.hh:62