Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4ReplicaNavigation.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//
27// $Id$
28//
29//
30// class G4ReplicaNavigation
31//
32// Class description:
33//
34// Utility for navigation in volumes containing a single G4PVParameterised
35// volume for which voxels for the replicated volumes have been constructed.
36// [Voxels MUST be along one axis only: NOT refined]
37
38// History:
39// - Created. Paul Kent, Aug 96
40// --------------------------------------------------------------------
41#ifndef G4REPLICANAVIGATION_HH
42#define G4REPLICANAVIGATION_HH
43
45
46#include "G4Types.hh"
48#include "G4LogicalVolume.hh"
49#include "G4VPhysicalVolume.hh"
50#include "G4ThreeVector.hh"
51#include "G4BlockingList.hh"
52
53// Required for voxel handling
54//
55#include "G4SmartVoxelHeader.hh"
56
57class G4VSolid;
58
60{
61 // Bucket to hold value of Normal (3-vector),
62 // bools for calculated and leave-behind or 'validConvex',
63 // and exiting side.
64
66 // Identity of 'Side' of Replicas. Used by DistanceToOut methods.
67
69 G4bool calculated; // Normal
70 G4bool validConvex; // Solid locally convex
72
73 public:
74
76 G4bool calc = false,
77 G4bool valid= false,
78 ESide side = kNull )
79 { exitNormal= norm; calculated= calc; validConvex=valid; exitSide=side;}
80};
81
83{
84 public: // with description
85
88
90 const G4VPhysicalVolume *blockedVol,
91 const G4int blockedNum,
92 const G4ThreeVector &globalPoint,
93 const G4ThreeVector* globalDirection,
94 const G4bool pLocatedOnEdge,
95 G4ThreeVector &localPoint );
96
97 G4double ComputeStep( const G4ThreeVector &globalPoint,
98 const G4ThreeVector &globalDirection,
99 const G4ThreeVector &localPoint,
100 const G4ThreeVector &localDirection,
101 const G4double currentProposedStepLength,
102 G4double &newSafety,
103 G4NavigationHistory &history,
104 G4bool &validExitNormal,
105 G4bool &calculatedExitNormal,
106 G4ThreeVector &exitNormal,
107 G4bool &exiting,
108 G4bool &entering,
109 G4VPhysicalVolume *(*pBlockedPhysical),
110 G4int &blockedReplicaNo );
111
112 G4double ComputeSafety( const G4ThreeVector &globalPoint,
113 const G4ThreeVector &localPoint,
114 G4NavigationHistory &history,
115 const G4double pProposedMaxLength=DBL_MAX );
116
118 const G4ThreeVector &globalPoint,
119 G4ThreeVector &localPoint,
120 const G4bool &exiting,
121 G4bool &notKnownInside ) const;
122
123 void ComputeTransformation( const G4int replicaNo,
124 G4VPhysicalVolume *pVol,
125 G4ThreeVector &point ) const;
126 void ComputeTransformation( const G4int replicaNo,
127 G4VPhysicalVolume *pVol ) const;
128
129 EInside Inside( const G4VPhysicalVolume *pVol,
130 const G4int replicaNo,
131 const G4ThreeVector &localPoint ) const;
133 const G4int replicaNo,
134 const G4ThreeVector &localPoint ) const;
136 const G4int replicaNo,
137 const G4ThreeVector &localPoint,
138 const G4ThreeVector &localDirection,
139 G4ExitNormal& candidateNormal ) const;
140
141 inline G4int GetVerboseLevel() const;
142 inline void SetVerboseLevel(G4int level);
143 // Get/Set Verbose(ness) level.
144 // [if level>0 && G4VERBOSE, printout can occur]
145
146 inline void CheckMode(G4bool mode);
147 // Run navigation in "check-mode", therefore using additional
148 // verifications and more strict correctness conditions.
149 // Is effective only with G4VERBOSE set.
150
151 private:
152
153 inline G4int VoxelLocate( const G4SmartVoxelHeader *pHead,
154 const G4ThreeVector &localPoint,
155 const G4int blocked=-1 ) const;
156
157 G4double DistanceToOutPhi( const G4ThreeVector &localPoint,
158 const G4ThreeVector &localDirection,
159 const G4double width,
160 G4ExitNormal& foundNormal ) const;
161
162 G4double DistanceToOutRad( const G4ThreeVector &localPoint,
163 const G4ThreeVector &localDirection,
164 const G4double width,
165 const G4double offset,
166 const G4int replicaNo,
167 G4ExitNormal& foundNormal ) const;
168 inline void SetPhiTransformation( const G4double ang,
169 G4VPhysicalVolume *pVol=0 ) const;
170 private:
171
172 // Invariants - unaltered during navigation
173 // **********
174
175 G4bool fCheck;
176 G4int fVerbose;
177 // Configuration parameters
178
179 G4double kCarTolerance, kRadTolerance, kAngTolerance;
180 // Local copy of constants
181};
182
183#include "G4ReplicaNavigation.icc"
184
185#endif
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4double DistanceToOut(const G4VPhysicalVolume *pVol, const G4int replicaNo, const G4ThreeVector &localPoint) const
G4double ComputeStep(const G4ThreeVector &globalPoint, const G4ThreeVector &globalDirection, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, const G4double currentProposedStepLength, G4double &newSafety, G4NavigationHistory &history, G4bool &validExitNormal, G4bool &calculatedExitNormal, G4ThreeVector &exitNormal, G4bool &exiting, G4bool &entering, G4VPhysicalVolume *(*pBlockedPhysical), G4int &blockedReplicaNo)
G4double ComputeSafety(const G4ThreeVector &globalPoint, const G4ThreeVector &localPoint, G4NavigationHistory &history, const G4double pProposedMaxLength=DBL_MAX)
void ComputeTransformation(const G4int replicaNo, G4VPhysicalVolume *pVol, G4ThreeVector &point) const
G4bool LevelLocate(G4NavigationHistory &history, const G4VPhysicalVolume *blockedVol, const G4int blockedNum, const G4ThreeVector &globalPoint, const G4ThreeVector *globalDirection, const G4bool pLocatedOnEdge, G4ThreeVector &localPoint)
void CheckMode(G4bool mode)
EInside Inside(const G4VPhysicalVolume *pVol, const G4int replicaNo, const G4ThreeVector &localPoint) const
G4int GetVerboseLevel() const
void SetVerboseLevel(G4int level)
EInside BackLocate(G4NavigationHistory &history, const G4ThreeVector &globalPoint, G4ThreeVector &localPoint, const G4bool &exiting, G4bool &notKnownInside) const
EInside
Definition: geomdefs.hh:58
G4ThreeVector exitNormal
G4ExitNormal(G4ThreeVector norm=G4ThreeVector(0., 0., 0.), G4bool calc=false, G4bool valid=false, ESide side=kNull)
#define DBL_MAX
Definition: templates.hh:83