Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
geometry
navigation
include
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
44
#include <
CLHEP/Units/SystemOfUnits.h
>
45
46
#include "
G4Types.hh
"
47
#include "
G4NavigationHistory.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
57
class
G4VSolid
;
58
59
struct
G4ExitNormal
60
{
61
// Bucket to hold value of Normal (3-vector),
62
// bools for calculated and leave-behind or 'validConvex',
63
// and exiting side.
64
65
enum
ESide
{
kNull
,
kRMin
,
kRMax
,
kSPhi
,
kEPhi
,
kPX
,
kMX
,
kPY
,
kMY
,
kPZ
,
kMZ
,
kMother
};
66
// Identity of 'Side' of Replicas. Used by DistanceToOut methods.
67
68
G4ThreeVector
exitNormal
;
69
G4bool
calculated
;
// Normal
70
G4bool
validConvex
;
// Solid locally convex
71
ESide
exitSide
;
72
73
public
:
74
75
G4ExitNormal
(
G4ThreeVector
norm
=
G4ThreeVector
(0.,0.,0.),
76
G4bool
calc =
false
,
77
G4bool
valid=
false
,
78
ESide
side
=
kNull
)
79
{
exitNormal
=
norm
;
calculated
= calc;
validConvex
=valid;
exitSide
=
side
;}
80
};
81
82
class
G4ReplicaNavigation
83
{
84
public
:
// with description
85
86
G4ReplicaNavigation
();
87
~G4ReplicaNavigation
();
88
89
inline
G4bool
LevelLocate
(
G4NavigationHistory
& history,
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
117
EInside
BackLocate
(
G4NavigationHistory
&history,
118
const
G4ThreeVector
&globalPoint,
119
G4ThreeVector
&localPoint,
120
const
G4bool
&exiting,
121
G4bool
¬KnownInside )
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
;
132
G4double
DistanceToOut
(
const
G4VPhysicalVolume
*pVol,
133
const
G4int
replicaNo,
134
const
G4ThreeVector
&localPoint )
const
;
135
G4double
DistanceToOut
(
const
G4VPhysicalVolume
*pVol,
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
Generated on Sat May 25 2013 14:33:11 for Geant4 by
1.8.4